##// END OF EJS Templates
phase: report phase movement...
Pierre-Yves David -
r15906:aad56531 default
parent child Browse files
Show More
@@ -4237,6 +4237,8 b' def phase(ui, repo, *revs, **opts):'
4237 lower phase to an higher phase. Phases are ordered as follows::
4237 lower phase to an higher phase. Phases are ordered as follows::
4238
4238
4239 public < draft < secret
4239 public < draft < secret
4240
4241 Return 0 on success, 1 if no phases were changed.
4240 """
4242 """
4241 # search for a unique phase argument
4243 # search for a unique phase argument
4242 targetphase = None
4244 targetphase = None
@@ -4253,6 +4255,7 b' def phase(ui, repo, *revs, **opts):'
4253 raise util.Abort(_('no revisions specified!'))
4255 raise util.Abort(_('no revisions specified!'))
4254
4256
4255 lock = None
4257 lock = None
4258 ret = 0
4256 if targetphase is None:
4259 if targetphase is None:
4257 # display
4260 # display
4258 for ctx in repo.set('%lr', revs):
4261 for ctx in repo.set('%lr', revs):
@@ -4264,11 +4267,22 b' def phase(ui, repo, *revs, **opts):'
4264 nodes = [ctx.node() for ctx in repo.set('%lr', revs)]
4267 nodes = [ctx.node() for ctx in repo.set('%lr', revs)]
4265 if not nodes:
4268 if not nodes:
4266 raise util.Abort(_('empty revision set'))
4269 raise util.Abort(_('empty revision set'))
4270 olddata = repo._phaserev[:]
4267 phases.advanceboundary(repo, targetphase, nodes)
4271 phases.advanceboundary(repo, targetphase, nodes)
4268 if opts['force']:
4272 if opts['force']:
4269 phases.retractboundary(repo, targetphase, nodes)
4273 phases.retractboundary(repo, targetphase, nodes)
4270 finally:
4274 finally:
4271 lock.release()
4275 lock.release()
4276 if olddata is not None:
4277 changes = 0
4278 newdata = repo._phaserev
4279 changes = sum(o != newdata[i] for i, o in enumerate(olddata))
4280 if changes:
4281 ui.note(_('phase change for %i changesets\n') % changes)
4282 else:
4283 ui.warn(_('no phases changed\n'))
4284 ret = 1
4285 return ret
4272
4286
4273 def postincoming(ui, repo, modheads, optupdate, checkout):
4287 def postincoming(ui, repo, modheads, optupdate, checkout):
4274 if modheads == 0:
4288 if modheads == 0:
General Comments 0
You need to be logged in to leave comments. Login now