Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 22080:37f46575d9c2
phase: attach phase to the transaction instead of the lock
The phase cache file is no longer written on lock release, it is now handled by
the transaction (as changesets and obsolescence markers are).
(Hooray)
As we stop relying on the lock to write phase, repos with no existing phase
information will need to wait for a phase move or a strip to happen in order to
get the first write in the `phaseroots` file. This explain the change in
test-inherit-mode.t.
This should not have any side effects but in very obscure cases where
people interact with pre-2.1 and post-2.1 versions of Mercurial on the
same repo while having MQ patches applied but the MQ extension
disabled from time to time. A case unlikely enough to not be worth
preserving the old behavior with awful hacks.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 07 Aug 2014 14:11:36 -0700 |
parents | c1ca47204590 |
children | 269688a398c4 |
comparison
equal
deleted
inserted
replaced
22079:5dcc58649b1a | 22080:37f46575d9c2 |
---|---|
1087 if l is not None and l.held: | 1087 if l is not None and l.held: |
1088 l.lock() | 1088 l.lock() |
1089 return l | 1089 return l |
1090 | 1090 |
1091 def unlock(): | 1091 def unlock(): |
1092 if hasunfilteredcache(self, '_phasecache'): | |
1093 self._phasecache.write() | |
1094 for k, ce in self._filecache.items(): | 1092 for k, ce in self._filecache.items(): |
1095 if k == 'dirstate' or k not in self.__dict__: | 1093 if k == 'dirstate' or k not in self.__dict__: |
1096 continue | 1094 continue |
1097 ce.refresh() | 1095 ce.refresh() |
1098 | 1096 |