Mercurial > hg-stable
changeset 16715:1e24da6fcd67
phase: remove useless test, olddata is never None
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Sat, 12 May 2012 16:53:36 +0200 |
parents | 0a176990243c |
children | 0311a6abd38a |
files | mercurial/commands.py |
diffstat | 1 files changed, 16 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sun May 13 14:29:05 2012 +0200 +++ b/mercurial/commands.py Sat May 12 16:53:36 2012 +0200 @@ -4443,25 +4443,23 @@ phases.retractboundary(repo, targetphase, nodes) finally: lock.release() - if olddata is not None: - changes = 0 - newdata = repo._phasecache.getphaserevs(repo) - changes = sum(o != newdata[i] for i, o in enumerate(olddata)) - rejected = [n for n in nodes - if newdata[repo[n].rev()] < targetphase] - if rejected: - ui.warn(_('cannot move %i changesets to a more permissive ' - 'phase, use --force\n') % len(rejected)) - ret = 1 - if changes: - msg = _('phase changed for %i changesets\n') % changes - if ret: - ui.status(msg) - else: - ui.note(msg) + newdata = repo._phasecache.getphaserevs(repo) + changes = sum(o != newdata[i] for i, o in enumerate(olddata)) + rejected = [n for n in nodes + if newdata[repo[n].rev()] < targetphase] + if rejected: + ui.warn(_('cannot move %i changesets to a more permissive ' + 'phase, use --force\n') % len(rejected)) + ret = 1 + if changes: + msg = _('phase changed for %i changesets\n') % changes + if ret: + ui.status(msg) else: - ui.warn(_('no phases changed\n')) - ret = 1 + ui.note(msg) + else: + ui.warn(_('no phases changed\n')) + ret = 1 return ret def postincoming(ui, repo, modheads, optupdate, checkout):