Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 49724:f3b685d9e899
path: pass `path` to `peer` in `hg summary`
We directly use the `path` object to build the `peer` object.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 02 Dec 2022 05:10:05 +0100 |
parents | 970491e630a5 |
children | 2aaa5d1e57e9 |
comparison
equal
deleted
inserted
replaced
49723:970491e630a5 | 49724:f3b685d9e899 |
---|---|
7250 | 7250 |
7251 def getincoming(): | 7251 def getincoming(): |
7252 # XXX We should actually skip this if no default is specified, instead | 7252 # XXX We should actually skip this if no default is specified, instead |
7253 # of passing "default" which will resolve as "./default/" if no default | 7253 # of passing "default" which will resolve as "./default/" if no default |
7254 # path is defined. | 7254 # path is defined. |
7255 source, branches = urlutil.get_unique_pull_path( | 7255 path = urlutil.get_unique_pull_path_obj(b'summary', ui, b'default') |
7256 b'summary', repo, ui, b'default' | 7256 sbranch = path.branch |
7257 ) | |
7258 sbranch = branches[0] | |
7259 try: | 7257 try: |
7260 other = hg.peer(repo, {}, source) | 7258 other = hg.peer(repo, {}, path) |
7261 except error.RepoError: | 7259 except error.RepoError: |
7262 if opts.get(b'remote'): | 7260 if opts.get(b'remote'): |
7263 raise | 7261 raise |
7264 return source, sbranch, None, None, None | 7262 return path.loc, sbranch, None, None, None |
7263 branches = (path.branch, []) | |
7265 revs, checkout = hg.addbranchrevs(repo, other, branches, None) | 7264 revs, checkout = hg.addbranchrevs(repo, other, branches, None) |
7266 if revs: | 7265 if revs: |
7267 revs = [other.lookup(rev) for rev in revs] | 7266 revs = [other.lookup(rev) for rev in revs] |
7268 ui.debug(b'comparing with %s\n' % urlutil.hidepassword(source)) | 7267 ui.debug(b'comparing with %s\n' % urlutil.hidepassword(path.loc)) |
7269 with repo.ui.silent(): | 7268 with repo.ui.silent(): |
7270 commoninc = discovery.findcommonincoming(repo, other, heads=revs) | 7269 commoninc = discovery.findcommonincoming(repo, other, heads=revs) |
7271 return source, sbranch, other, commoninc, commoninc[1] | 7270 return path.loc, sbranch, other, commoninc, commoninc[1] |
7272 | 7271 |
7273 if needsincoming: | 7272 if needsincoming: |
7274 source, sbranch, sother, commoninc, incoming = getincoming() | 7273 source, sbranch, sother, commoninc, incoming = getincoming() |
7275 else: | 7274 else: |
7276 source = sbranch = sother = commoninc = incoming = None | 7275 source = sbranch = sother = commoninc = incoming = None |