##// END OF EJS Templates
phase: remove useless test, olddata is never None
Patrick Mezard -
r16715:1e24da6f default
parent child Browse files
Show More
@@ -4443,25 +4443,23 b' def phase(ui, repo, *revs, **opts):'
4443 phases.retractboundary(repo, targetphase, nodes)
4443 phases.retractboundary(repo, targetphase, nodes)
4444 finally:
4444 finally:
4445 lock.release()
4445 lock.release()
4446 if olddata is not None:
4446 newdata = repo._phasecache.getphaserevs(repo)
4447 changes = 0
4447 changes = sum(o != newdata[i] for i, o in enumerate(olddata))
4448 newdata = repo._phasecache.getphaserevs(repo)
4448 rejected = [n for n in nodes
4449 changes = sum(o != newdata[i] for i, o in enumerate(olddata))
4449 if newdata[repo[n].rev()] < targetphase]
4450 rejected = [n for n in nodes
4450 if rejected:
4451 if newdata[repo[n].rev()] < targetphase]
4451 ui.warn(_('cannot move %i changesets to a more permissive '
4452 if rejected:
4452 'phase, use --force\n') % len(rejected))
4453 ui.warn(_('cannot move %i changesets to a more permissive '
4453 ret = 1
4454 'phase, use --force\n') % len(rejected))
4454 if changes:
4455 ret = 1
4455 msg = _('phase changed for %i changesets\n') % changes
4456 if changes:
4456 if ret:
4457 msg = _('phase changed for %i changesets\n') % changes
4457 ui.status(msg)
4458 if ret:
4459 ui.status(msg)
4460 else:
4461 ui.note(msg)
4462 else:
4458 else:
4463 ui.warn(_('no phases changed\n'))
4459 ui.note(msg)
4464 ret = 1
4460 else:
4461 ui.warn(_('no phases changed\n'))
4462 ret = 1
4465 return ret
4463 return ret
4466
4464
4467 def postincoming(ui, repo, modheads, optupdate, checkout):
4465 def postincoming(ui, repo, modheads, optupdate, checkout):
General Comments 0
You need to be logged in to leave comments. Login now