# HG changeset patch # User Sean Farley # Date 1511827508 18000 # Node ID bd1a01f98154ee28ae33ef19a299746fc1e307e8 # Parent 8ed6c0cae9b846c4d9966943dfab5efa652a35f7 cleanup: wrap to 80 chars diff -r 8ed6c0cae9b8 -r bd1a01f98154 hggit/__init__.py --- a/hggit/__init__.py Mon Nov 27 18:46:07 2017 -0500 +++ b/hggit/__init__.py Mon Nov 27 19:05:08 2017 -0500 @@ -284,9 +284,9 @@ def gverify(ui, repo, **opts): '''verify that a Mercurial rev matches the corresponding Git rev - Given a Mercurial revision that has a corresponding Git revision in the map, - this attempts to answer whether that revision has the same contents as the - corresponding Git revision. + Given a Mercurial revision that has a corresponding Git revision in the + map, this attempts to answer whether that revision has the same contents as + the corresponding Git revision. ''' ctx = scmutil.revsingle(repo, opts.get('rev'), '.') @@ -465,7 +465,8 @@ def gitnodekw(**args): - """:gitnode: String. The Git changeset identification hash, as a 40 hexadecimal digit string.""" + """:gitnode: String. The Git changeset identification hash, as a 40 hexadecimal +digit string.""" node = args['ctx'] repo = args['repo'] gitnode = repo.githandler.map_git_get(node.hex()) diff -r 8ed6c0cae9b8 -r bd1a01f98154 hggit/git2hg.py --- a/hggit/git2hg.py Mon Nov 27 18:46:07 2017 -0500 +++ b/hggit/git2hg.py Mon Nov 27 19:05:08 2017 -0500 @@ -7,9 +7,12 @@ def find_incoming(git_object_store, git_map, refs): '''find what commits need to be imported - git_object_store is a dulwich object store. - git_map is a map with keys being Git commits that have already been imported - refs is a map of refs to SHAs that we're interested in.''' + git_object_store: is a dulwich object store. + git_map: is a map with keys being Git commits that have already been + imported + refs: is a map of refs to SHAs that we're interested in. + + ''' done = set() commit_cache = {} @@ -88,13 +91,16 @@ # commits that originated in Git we'd like to optionally infer rename # information to store in Mercurial, but for commits that originated in # Mercurial we'd like to disable this. How do we tell whether the commit - # originated in Mercurial or in Git? We rely on the presence of extra hg-git - # fields in the Git commit. - # - Commits exported by hg-git versions past 0.7.0 always store at least one - # hg-git field. + # originated in Mercurial or in Git? We rely on the presence of extra + # hg-git fields in the Git commit. + # + # - Commits exported by hg-git versions past 0.7.0 always store at least + # one hg-git field. + # # - For commits exported by hg-git versions before 0.7.0, this becomes a - # heuristic: if the commit has any extra hg fields, it definitely originated - # in Mercurial. If the commit doesn't, we aren't really sure. + # heuristic: if the commit has any extra hg fields, it definitely + # originated in Mercurial. If the commit doesn't, we aren't really sure. + # # If we think the commit originated in Mercurial, we set renames to a # dict. If we don't, we set renames to None. Callers can then determine # whether to infer rename information. diff -r 8ed6c0cae9b8 -r bd1a01f98154 hggit/git_handler.py --- a/hggit/git_handler.py Mon Nov 27 18:46:07 2017 -0500 +++ b/hggit/git_handler.py Mon Nov 27 19:05:08 2017 -0500 @@ -1211,10 +1211,10 @@ localclient, path = self.get_transport_and_path(remote_name) # The dulwich default walk only checks refs/heads/. We also want to - # consider remotes when doing discovery, so we build our own list. We + # consider remotes when doing discovery, so we build our own list. We # can't just do 'refs/' here because the tag class doesn't have a - # parents function for walking, and older versions of dulwich don't like - # that. + # parents function for walking, and older versions of dulwich don't + # like that. haveheads = self.git.refs.as_dict('refs/remotes/').values() haveheads.extend(self.git.refs.as_dict('refs/heads/').values()) graphwalker = self.git.get_graph_walker(heads=haveheads) @@ -1253,9 +1253,8 @@ if head: symrefs["HEAD"] = head # use FetchPackResult as upstream now does - ret = compat.FetchPackResult(ret, - symrefs, - client.default_user_agent_string()) + agent = client.default_user_agent_string() + ret = compat.FetchPackResult(ret, symrefs, agent) return ret except (HangupException, GitProtocolError), e: raise hgutil.Abort(_("git remote error: ") + str(e)) @@ -1700,12 +1699,13 @@ >>> mockrepo.sharedpath = '' >>> mockrepo.path = '' >>> g = GitHandler(mockrepo, ui()) - >>> client, url = g.get_transport_and_path('http://fqdn.com/test.git') + >>> tp = g.get_transport_and_path + >>> client, url = tp('http://fqdn.com/test.git') >>> print isinstance(client, HttpGitClient) True >>> print url http://fqdn.com/test.git - >>> client, url = g.get_transport_and_path('git@fqdn.com:user/repo.git') + >>> client, url = tp('git@fqdn.com:user/repo.git') >>> print isinstance(client, SSHGitClient) True >>> print url diff -r 8ed6c0cae9b8 -r bd1a01f98154 hggit/hg2git.py --- a/hggit/hg2git.py Mon Nov 27 18:46:07 2017 -0500 +++ b/hggit/hg2git.py Mon Nov 27 19:05:08 2017 -0500 @@ -35,12 +35,14 @@ ... print s >>> u = fakeui() >>> audit_git_path(u, 'foo/git~100/wat') - warning: path 'foo/git~100/wat' contains a potentially dangerous path component. + ... # doctest: +ELLIPSIS + warning: path 'foo/git~100/wat' contains a potentially dangerous ... It may not be legal to check out in Git. It may also be rejected by some git server configurations. >>> audit_git_path(u, u'foo/.gi\u200ct'.encode('utf-8')) - warning: path 'foo/.gi\xe2\x80\x8ct' contains a potentially dangerous path component. + ... # doctest: +ELLIPSIS + warning: path 'foo/.gi\xe2\x80\x8ct' contains a potentially dangerous ... It may not be legal to check out in Git. It may also be rejected by some git server configurations. diff -r 8ed6c0cae9b8 -r bd1a01f98154 hggit/overlay.py --- a/hggit/overlay.py Mon Nov 27 18:46:07 2017 -0500 +++ b/hggit/overlay.py Mon Nov 27 19:05:08 2017 -0500 @@ -103,8 +103,9 @@ return self._map.get(path, default) def diff(self, m2, match=None, clean=False): - # Older mercurial clients used diff(m2, clean=False). If a caller failed - # to specify clean as a keyword arg, it might get passed as match here. + # Older mercurial clients used diff(m2, clean=False). If a caller + # failed to specify clean as a keyword arg, it might get passed as + # match here. if isinstance(match, bool): clean = match match = None @@ -161,8 +162,8 @@ kwargs = { 'clean': clean } - # Older versions of mercurial don't support the match arg, so only add it if - # it exists. + # Older versions of mercurial don't support the match arg, so only add it + # if it exists. if match is not None: kwargs['match'] = match if isinstance(m2, overlaymanifest): diff -r 8ed6c0cae9b8 -r bd1a01f98154 hggit/verify.py --- a/hggit/verify.py Mon Nov 27 18:46:07 2017 -0500 +++ b/hggit/verify.py Mon Nov 27 19:05:08 2017 -0500 @@ -18,9 +18,9 @@ def verify(ui, repo, hgctx): '''verify that a Mercurial rev matches the corresponding Git rev - Given a Mercurial revision that has a corresponding Git revision in the map, - this attempts to answer whether that revision has the same contents as the - corresponding Git revision. + Given a Mercurial revision that has a corresponding Git revision in the + map, this attempts to answer whether that revision has the same contents as + the corresponding Git revision. ''' handler = repo.githandler