##// END OF EJS Templates
phase: make if abort on nullid for the good reason...
Patrick Mezard -
r16659:58edd786 default
parent child Browse files
Show More
@@ -4375,9 +4375,9 b' def phase(ui, repo, *revs, **opts):'
4375 lock = repo.lock()
4375 lock = repo.lock()
4376 try:
4376 try:
4377 # set phase
4377 # set phase
4378 nodes = [ctx.node() for ctx in repo.set('%ld', revs)]
4378 if not revs:
4379 if not nodes:
4380 raise util.Abort(_('empty revision set'))
4379 raise util.Abort(_('empty revision set'))
4380 nodes = [repo[r].node() for r in revs]
4381 olddata = repo._phasecache.getphaserevs(repo)[:]
4381 olddata = repo._phasecache.getphaserevs(repo)[:]
4382 phases.advanceboundary(repo, targetphase, nodes)
4382 phases.advanceboundary(repo, targetphase, nodes)
4383 if opts['force']:
4383 if opts['force']:
@@ -101,6 +101,7 b' Note: old client behave as publish serve'
101 import errno
101 import errno
102 from node import nullid, nullrev, bin, hex, short
102 from node import nullid, nullrev, bin, hex, short
103 from i18n import _
103 from i18n import _
104 import util
104
105
105 allphases = public, draft, secret = range(3)
106 allphases = public, draft, secret = range(3)
106 trackedphases = allphases[1:]
107 trackedphases = allphases[1:]
@@ -250,6 +251,8 b' class phasecache(object):'
250 newroots = [n for n in nodes
251 newroots = [n for n in nodes
251 if self.phase(repo, repo[n].rev()) < targetphase]
252 if self.phase(repo, repo[n].rev()) < targetphase]
252 if newroots:
253 if newroots:
254 if nullid in newroots:
255 raise util.Abort(_('cannot change null revision phase'))
253 currentroots = currentroots.copy()
256 currentroots = currentroots.copy()
254 currentroots.update(newroots)
257 currentroots.update(newroots)
255 ctxs = repo.set('roots(%ln::)', currentroots)
258 ctxs = repo.set('roots(%ln::)', currentroots)
@@ -13,7 +13,7 b''
13 Cannot change null revision phase
13 Cannot change null revision phase
14
14
15 $ hg phase --force --secret null
15 $ hg phase --force --secret null
16 abort: unknown revision '-1'!
16 abort: cannot change null revision phase
17 [255]
17 [255]
18 $ hg phase null
18 $ hg phase null
19 -1: public
19 -1: public
General Comments 0
You need to be logged in to leave comments. Login now