comparison mercurial/commands.py @ 31078:d2ed0abce08e

outgoing: avoid running pager until we're actually showing changes Consistent with the new behavior of incoming in the previous patch.
author Augie Fackler <augie@google.com>
date Tue, 21 Feb 2017 11:06:02 -0500
parents 16d7db8f752c
children 2a0c8e3636b0
comparison
equal deleted inserted replaced
31077:16d7db8f752c 31078:d2ed0abce08e
3639 3639
3640 Returns 0 if there are outgoing changes, 1 otherwise. 3640 Returns 0 if there are outgoing changes, 1 otherwise.
3641 """ 3641 """
3642 if opts.get('graph'): 3642 if opts.get('graph'):
3643 cmdutil.checkunsupportedgraphflags([], opts) 3643 cmdutil.checkunsupportedgraphflags([], opts)
3644 ui.pager('outgoing')
3645 o, other = hg._outgoing(ui, repo, dest, opts) 3644 o, other = hg._outgoing(ui, repo, dest, opts)
3646 if not o: 3645 if not o:
3647 cmdutil.outgoinghooks(ui, repo, other, opts, o) 3646 cmdutil.outgoinghooks(ui, repo, other, opts, o)
3648 return 3647 return
3649 3648
3650 revdag = cmdutil.graphrevs(repo, o, opts) 3649 revdag = cmdutil.graphrevs(repo, o, opts)
3650 ui.pager('outgoing')
3651 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=True) 3651 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=True)
3652 cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges) 3652 cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges)
3653 cmdutil.outgoinghooks(ui, repo, other, opts, o) 3653 cmdutil.outgoinghooks(ui, repo, other, opts, o)
3654 return 0 3654 return 0
3655 3655
3658 dest, branches = hg.parseurl(dest, opts.get('branch')) 3658 dest, branches = hg.parseurl(dest, opts.get('branch'))
3659 other = hg.peer(repo, opts, dest) 3659 other = hg.peer(repo, opts, dest)
3660 if 'bookmarks' not in other.listkeys('namespaces'): 3660 if 'bookmarks' not in other.listkeys('namespaces'):
3661 ui.warn(_("remote doesn't support bookmarks\n")) 3661 ui.warn(_("remote doesn't support bookmarks\n"))
3662 return 0 3662 return 0
3663 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
3663 ui.pager('outgoing') 3664 ui.pager('outgoing')
3664 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
3665 return bookmarks.outgoing(ui, repo, other) 3665 return bookmarks.outgoing(ui, repo, other)
3666 3666
3667 repo._subtoppath = ui.expandpath(dest or 'default-push', dest or 'default') 3667 repo._subtoppath = ui.expandpath(dest or 'default-push', dest or 'default')
3668 try: 3668 try:
3669 ui.pager('outgoing')
3670 return hg.outgoing(ui, repo, dest, opts) 3669 return hg.outgoing(ui, repo, dest, opts)
3671 finally: 3670 finally:
3672 del repo._subtoppath 3671 del repo._subtoppath
3673 3672
3674 @command('parents', 3673 @command('parents',