Comments
Patch
@@ -1087,12 +1087,10 @@ class localrepository(object):
if l is not None and l.held:
l.lock()
return l
def unlock():
- if hasunfilteredcache(self, '_phasecache'):
- self._phasecache.write()
for k, ce in self._filecache.items():
if k == 'dirstate' or k not in self.__dict__:
continue
ce.refresh()
@@ -204,15 +204,17 @@ class phasecache(object):
for phase, roots in enumerate(self.phaseroots):
for h in roots:
fp.write('%i %s\n' % (phase, hex(h)))
self.dirty = False
- def _updateroots(self, phase, newroots):
+ def _updateroots(self, phase, newroots, tr):
self.phaseroots[phase] = newroots
self._phaserevs = None
self.dirty = True
+ tr.addfilegenerator('phase', ('phaseroots',), self._write)
+
def advanceboundary(self, repo, tr, targetphase, nodes):
# Be careful to preserve shallow-copied values: do not update
# phaseroots values, replace them.
repo = repo.unfiltered()
@@ -225,11 +227,11 @@ class phasecache(object):
break # no roots to move anymore
olds = self.phaseroots[phase]
roots = set(ctx.node() for ctx in repo.set(
'roots((%ln::) - (%ln::%ln))', olds, olds, nodes))
if olds != roots:
- self._updateroots(phase, roots)
+ self._updateroots(phase, roots, tr)
# some roots may need to be declared for lower phases
delroots.extend(olds - roots)
# declare deleted root in the target phase
if targetphase != 0:
self.retractboundary(repo, tr, targetphase, delroots)
@@ -248,11 +250,11 @@ class phasecache(object):
raise util.Abort(_('cannot change null revision phase'))
currentroots = currentroots.copy()
currentroots.update(newroots)
ctxs = repo.set('roots(%ln::)', currentroots)
currentroots.intersection_update(ctx.node() for ctx in ctxs)
- self._updateroots(targetphase, currentroots)
+ self._updateroots(targetphase, currentroots, tr)
repo.invalidatevolatilesets()
def filterunknown(self, repo):
"""remove unknown nodes from the phase boundary
@@ -118,11 +118,10 @@ group can still write everything
00770 ../push/.hg/store/data/
00770 ../push/.hg/store/data/dir/
00660 ../push/.hg/store/data/dir/bar.i
00660 ../push/.hg/store/data/foo.i
00660 ../push/.hg/store/fncache
- 00660 ../push/.hg/store/phaseroots
00660 ../push/.hg/store/undo
00660 ../push/.hg/store/undo.phaseroots
00660 ../push/.hg/undo.bookmarks
00660 ../push/.hg/undo.branch
00660 ../push/.hg/undo.desc