Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 46915:efc6f6a794bd
outgoing: merge the code handling --graph with the main one
The --graph code had its own copy of the logic. With the previous reorganisation
of the code, we can now merge it with the main code, reducing fragile
complication.
As a side effect, `hg out --graph` now use the right return code when they are
nothing outgoing. This explain the change to output in
`tests/test-largefiles-misc.t`.
Differential Revision: https://phab.mercurial-scm.org/D10383
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 11 Apr 2021 20:00:46 +0200 |
parents | df7439cc6806 |
children | efadec3ea8e2 |
comparison
equal
deleted
inserted
replaced
46914:50b79f8b802d | 46915:efc6f6a794bd |
---|---|
4970 _(b'default repository not configured!'), | 4970 _(b'default repository not configured!'), |
4971 hint=_(b"see 'hg help config.paths'"), | 4971 hint=_(b"see 'hg help config.paths'"), |
4972 ) | 4972 ) |
4973 | 4973 |
4974 opts = pycompat.byteskwargs(opts) | 4974 opts = pycompat.byteskwargs(opts) |
4975 if opts.get(b'graph'): | |
4976 logcmdutil.checkunsupportedgraphflags([], opts) | |
4977 o, other = hg._outgoing(ui, repo, dest, opts) | |
4978 if not o: | |
4979 cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
4980 return | |
4981 | |
4982 revdag = logcmdutil.graphrevs(repo, o, opts) | |
4983 ui.pager(b'outgoing') | |
4984 displayer = logcmdutil.changesetdisplayer(ui, repo, opts, buffered=True) | |
4985 logcmdutil.displaygraph( | |
4986 ui, repo, revdag, displayer, graphmod.asciiedges | |
4987 ) | |
4988 cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
4989 return 0 | |
4990 | |
4991 if opts.get(b'bookmarks'): | 4975 if opts.get(b'bookmarks'): |
4992 dest = path.pushloc or path.loc | 4976 dest = path.pushloc or path.loc |
4993 other = hg.peer(repo, opts, dest) | 4977 other = hg.peer(repo, opts, dest) |
4994 try: | 4978 try: |
4995 if b'bookmarks' not in other.listkeys(b'namespaces'): | 4979 if b'bookmarks' not in other.listkeys(b'namespaces'): |