def _construct_upstream_url(self): source_urls = self.invoke_vcs(['remote', '-v'], self.root).split('\n') for src_url in source_urls: name, repo, _ = src_url.split() # TODO: Why do we assume origin is upstream? if name == 'origin': if repo.startswith("[email protected]:"): return "https://github.com/" + repo[len("[email protected]:"):] elif repo.startswith(("git://github.com/", "https://github.com/")): repo = without_ending('.git', repo) if repo.startswith("git:"): repo = "https" + repo[len("git"):] return repo warn("Your git remote is not supported yet. Please use a " "GitHub remote if you would like version control " "naviagtion links to show.") break
def _construct_upstream_url(self): source_urls = self.invoke_vcs(['remote', '-v'], self.root).split('\n') for src_url in source_urls: if not src_url: continue name, repo, _ = src_url.split() # TODO: Why do we assume origin is upstream? if name == 'origin': if repo.startswith("[email protected]:"): return "https://github.com/" + repo[len("[email protected]:"):] elif repo.startswith(("git://github.com/", "https://github.com/")): repo = without_ending('.git', repo) if repo.startswith("git:"): repo = "https" + repo[len("git"):] return repo warn("Your git remote is not supported yet. Please use a " "GitHub remote if you would like version control " "naviagtion links to show.") break
def __new__(metaclass, name, bases, dict): dict['id'] = without_ending('Ref', name) return type.__new__(metaclass, name, bases, dict)