Show More
@@ -4237,6 +4237,8 b' def phase(ui, repo, *revs, **opts):' | |||
|
4237 | 4237 | lower phase to an higher phase. Phases are ordered as follows:: |
|
4238 | 4238 | |
|
4239 | 4239 | public < draft < secret |
|
4240 | ||
|
4241 | Return 0 on success, 1 if no phases were changed. | |
|
4240 | 4242 | """ |
|
4241 | 4243 | # search for a unique phase argument |
|
4242 | 4244 | targetphase = None |
@@ -4253,6 +4255,7 b' def phase(ui, repo, *revs, **opts):' | |||
|
4253 | 4255 | raise util.Abort(_('no revisions specified!')) |
|
4254 | 4256 | |
|
4255 | 4257 | lock = None |
|
4258 | ret = 0 | |
|
4256 | 4259 | if targetphase is None: |
|
4257 | 4260 | # display |
|
4258 | 4261 | for ctx in repo.set('%lr', revs): |
@@ -4264,11 +4267,22 b' def phase(ui, repo, *revs, **opts):' | |||
|
4264 | 4267 | nodes = [ctx.node() for ctx in repo.set('%lr', revs)] |
|
4265 | 4268 | if not nodes: |
|
4266 | 4269 | raise util.Abort(_('empty revision set')) |
|
4270 | olddata = repo._phaserev[:] | |
|
4267 | 4271 | phases.advanceboundary(repo, targetphase, nodes) |
|
4268 | 4272 | if opts['force']: |
|
4269 | 4273 | phases.retractboundary(repo, targetphase, nodes) |
|
4270 | 4274 | finally: |
|
4271 | 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 | 4287 | def postincoming(ui, repo, modheads, optupdate, checkout): |
|
4274 | 4288 | if modheads == 0: |
General Comments 0
You need to be logged in to leave comments.
Login now