diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4972,22 +4972,6 @@ def outgoing(ui, repo, dest=None, **opts ) opts = pycompat.byteskwargs(opts) - if opts.get(b'graph'): - logcmdutil.checkunsupportedgraphflags([], opts) - o, other = hg._outgoing(ui, repo, dest, opts) - if not o: - cmdutil.outgoinghooks(ui, repo, other, opts, o) - return - - revdag = logcmdutil.graphrevs(repo, o, opts) - ui.pager(b'outgoing') - displayer = logcmdutil.changesetdisplayer(ui, repo, opts, buffered=True) - logcmdutil.displaygraph( - ui, repo, revdag, displayer, graphmod.asciiedges - ) - cmdutil.outgoinghooks(ui, repo, other, opts, o) - return 0 - if opts.get(b'bookmarks'): dest = path.pushloc or path.loc other = hg.peer(repo, opts, dest) diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -32,6 +32,7 @@ from . import ( error, exchange, extensions, + graphmod, httppeer, localrepo, lock, @@ -1382,18 +1383,29 @@ def _outgoing_filter(repo, revs, opts): def outgoing(ui, repo, dest, opts): - + if opts.get(b'graph'): + logcmdutil.checkunsupportedgraphflags([], opts) o, other = _outgoing(ui, repo, dest, opts) ret = 1 try: if o: ret = 0 - ui.pager(b'outgoing') - displayer = logcmdutil.changesetdisplayer(ui, repo, opts) - for n in _outgoing_filter(repo, o, opts): - displayer.show(repo[n]) - displayer.close() + if opts.get(b'graph'): + revdag = logcmdutil.graphrevs(repo, o, opts) + ui.pager(b'outgoing') + displayer = logcmdutil.changesetdisplayer( + ui, repo, opts, buffered=True + ) + logcmdutil.displaygraph( + ui, repo, revdag, displayer, graphmod.asciiedges + ) + else: + ui.pager(b'outgoing') + displayer = logcmdutil.changesetdisplayer(ui, repo, opts) + for n in _outgoing_filter(repo, o, opts): + displayer.show(repo[n]) + displayer.close() cmdutil.outgoinghooks(ui, repo, other, opts, o) ret = min(ret, _outgoing_recurse(ui, repo, dest, opts)) return ret # exit code is zero since we found outgoing changes diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t --- a/tests/test-largefiles-misc.t +++ b/tests/test-largefiles-misc.t @@ -675,6 +675,7 @@ check messages when there is no files to searching for changes no changes found largefiles: no files to upload + [1] check messages when there are files to upload: