# HG changeset patch # User Pierre-Yves David # Date 1326829421 -3600 # Node ID aad565319fa30057f93bfb2e7972ea1987c6b005 # Parent 634d49a8b6db9f4df070681b3f1112f00c6bc721 phase: report phase movement When used in "set" mode, the phase command now display the number of changeset who changed phase. diff -r 634d49a8b6db -r aad565319fa3 mercurial/commands.py --- a/mercurial/commands.py Mon Jan 16 19:45:35 2012 +0100 +++ b/mercurial/commands.py Tue Jan 17 20:43:41 2012 +0100 @@ -4237,6 +4237,8 @@ lower phase to an higher phase. Phases are ordered as follows:: public < draft < secret + + Return 0 on success, 1 if no phases were changed. """ # search for a unique phase argument targetphase = None @@ -4253,6 +4255,7 @@ raise util.Abort(_('no revisions specified!')) lock = None + ret = 0 if targetphase is None: # display for ctx in repo.set('%lr', revs): @@ -4264,11 +4267,22 @@ nodes = [ctx.node() for ctx in repo.set('%lr', revs)] if not nodes: raise util.Abort(_('empty revision set')) + olddata = repo._phaserev[:] phases.advanceboundary(repo, targetphase, nodes) if opts['force']: phases.retractboundary(repo, targetphase, nodes) finally: lock.release() + if olddata is not None: + changes = 0 + newdata = repo._phaserev + changes = sum(o != newdata[i] for i, o in enumerate(olddata)) + if changes: + ui.note(_('phase change for %i changesets\n') % changes) + else: + ui.warn(_('no phases changed\n')) + ret = 1 + return ret def postincoming(ui, repo, modheads, optupdate, checkout): if modheads == 0: