# HG changeset patch # User Patrick Mezard # Date 1336668727 -7200 # Node ID 503e674fb545066eb34c12d28f43c54b2cee84cc # Parent df9df747070d08a5a1915d9728c358d833007bd9 phases: stop modifying localrepo in writeroots() Also pass the phaseroots being written for clarity. repo._dirtyphases was already reset to False at call site. diff -r df9df747070d -r 503e674fb545 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu May 10 18:52:04 2012 +0200 +++ b/mercurial/localrepo.py Thu May 10 18:52:07 2012 +0200 @@ -932,7 +932,7 @@ def unlock(): self.store.write() if self._dirtyphases: - phases.writeroots(self) + phases.writeroots(self, self._phaseroots) self._dirtyphases = False for k, ce in self._filecache.items(): if k == 'dirstate': diff -r df9df747070d -r 503e674fb545 mercurial/phases.py --- a/mercurial/phases.py Thu May 10 18:52:04 2012 +0200 +++ b/mercurial/phases.py Thu May 10 18:52:07 2012 +0200 @@ -156,14 +156,13 @@ dirty = True return roots, dirty -def writeroots(repo): +def writeroots(repo, phaseroots): """Write phase roots from disk""" f = repo.sopener('phaseroots', 'w', atomictemp=True) try: - for phase, roots in enumerate(repo._phaseroots): + for phase, roots in enumerate(phaseroots): for h in roots: f.write('%i %s\n' % (phase, hex(h))) - repo._dirtyphases = False finally: f.close()