comparison mercurial/hg.py @ 35438:0ebd94ac56d1

outgoing: respect ":pushurl" paths (issue5365) Make 'hg outgoing' respect "paths.default:pushurl" in addition to "paths.default-push". 'hg outgoing' has always meant "what will happen if I run 'hg push'?" and it's still documented that way: Show changesets not found in the specified destination repository or the default push location. These are the changesets that would be pushed if a push was requested. If the user uses the now-deprecated "paths.default-push" path, it continues to work that way. However, as described at https://bz.mercurial-scm.org/show_bug.cgi?id=5365, it doesn't behave the same with "paths.default:pushurl". Why does it matter? Similar to the bugzilla reporter, I have a read-only mirror of a non-Mercurial repository: upstream -> imported mirror -> user clone ^-----------------------/ Users push directly to upstream, and that content is then imported into the mirror. However, those repositories are not the same; it's possible that the mirroring has either broken completely, or an import process is running and not yet complete. In those cases, 'hg outgoing' will list changesets that have already been pushed. Mozilla's desired behavior described in bug 5365 can be accomplished through other means (e.g. 'hg outgoing default'), preserving the consistency and meaning of 'hg outgoing'.
author Hollis Blanchard <hollis_blanchard@mentor.com>
date Thu, 14 Dec 2017 15:03:55 -0800
parents a29fe459fc49
children bdae51a83dfb
comparison
equal deleted inserted replaced
35437:cf532a62e337 35438:0ebd94ac56d1
914 count += 1 914 count += 1
915 displayer.show(other[n]) 915 displayer.show(other[n])
916 return _incoming(display, subreporecurse, ui, repo, source, opts) 916 return _incoming(display, subreporecurse, ui, repo, source, opts)
917 917
918 def _outgoing(ui, repo, dest, opts): 918 def _outgoing(ui, repo, dest, opts):
919 dest = ui.expandpath(dest or 'default-push', dest or 'default') 919 path = ui.paths.getpath(dest, default=('default-push', 'default'))
920 dest, branches = parseurl(dest, opts.get('branch')) 920 if not path:
921 raise error.Abort(_('default repository not configured!'),
922 hint=_("see 'hg help config.paths'"))
923 dest = path.pushloc or path.loc
924 branches = path.branch, opts.get('branch') or []
925
921 ui.status(_('comparing with %s\n') % util.hidepassword(dest)) 926 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
922 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev')) 927 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
923 if revs: 928 if revs:
924 revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)] 929 revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
925 930