diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4952,11 +4952,11 @@ def paths(ui, repo, search=None): ('f', 'force', False, _('allow to move boundary backward')), ('r', 'rev', [], _('target revision'), _('REV')), ], - _('[-p|-d|-s] [-f] [-r] REV...')) + _('[-p|-d|-s] [-f] [-r] [REV...]')) def phase(ui, repo, *revs, **opts): """set or show the current phase name - With no argument, show the phase name of specified revisions. + With no argument, show the phase name of the current revision(s). With one of -p/--public, -d/--draft or -s/--secret, change the phase value of the specified revisions. @@ -4981,7 +4981,9 @@ def phase(ui, repo, *revs, **opts): revs = list(revs) revs.extend(opts['rev']) if not revs: - raise util.Abort(_('no revisions specified')) + # display both parents as the second parent phase can influence + # the phase of a merge commit + revs = [c.rev() for c in repo[None].parents()] revs = scmutil.revrange(repo, revs) diff --git a/tests/test-phases.t b/tests/test-phases.t --- a/tests/test-phases.t +++ b/tests/test-phases.t @@ -36,6 +36,8 @@ Following commit are draft too Draft commit are properly created over public one: $ hg phase --public . + $ hg phase + 1: public $ hglog 1 0 B 0 0 A @@ -86,6 +88,9 @@ Even on merge $ hg merge 4 # E 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) + $ hg phase + 6: draft + 4: secret $ hg ci -m "merge B' and E" $ hglog 7 2 merge B' and E