Mercurial > hg
comparison mercurial/localrepo.py @ 15454:5a7dde5adec8
phases: add a moveboundary function to move phases boundaries
Also include logic to detect when to write phases data.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 07 Nov 2011 14:11:01 +0100 |
parents | e80d0d3198f0 |
children | c6f87bdab2a1 |
comparison
equal
deleted
inserted
replaced
15453:cff509500a24 | 15454:5a7dde5adec8 |
---|---|
34 self.auditor = scmutil.pathauditor(self.root, self._checknested) | 34 self.auditor = scmutil.pathauditor(self.root, self._checknested) |
35 self.opener = scmutil.opener(self.path) | 35 self.opener = scmutil.opener(self.path) |
36 self.wopener = scmutil.opener(self.root) | 36 self.wopener = scmutil.opener(self.root) |
37 self.baseui = baseui | 37 self.baseui = baseui |
38 self.ui = baseui.copy() | 38 self.ui = baseui.copy() |
39 self._dirtyphases = False | |
39 | 40 |
40 try: | 41 try: |
41 self.ui.readconfig(self.join("hgrc"), self.root) | 42 self.ui.readconfig(self.join("hgrc"), self.root) |
42 extensions.loadall(self.ui) | 43 extensions.loadall(self.ui) |
43 except IOError: | 44 except IOError: |
170 def _writebookmarks(self, marks): | 171 def _writebookmarks(self, marks): |
171 bookmarks.write(self) | 172 bookmarks.write(self) |
172 | 173 |
173 @filecache('phaseroots') | 174 @filecache('phaseroots') |
174 def _phaseroots(self): | 175 def _phaseroots(self): |
176 self._dirtyphases = False | |
175 return phases.readroots(self) | 177 return phases.readroots(self) |
176 | 178 |
177 @propertycache | 179 @propertycache |
178 def _phaserev(self): | 180 def _phaserev(self): |
179 cache = [0] * len(self) | 181 cache = [0] * len(self) |
908 l.lock() | 910 l.lock() |
909 return l | 911 return l |
910 | 912 |
911 def unlock(): | 913 def unlock(): |
912 self.store.write() | 914 self.store.write() |
915 if self._dirtyphases: | |
916 phases.writeroots(self) | |
913 for k, ce in self._filecache.items(): | 917 for k, ce in self._filecache.items(): |
914 if k == 'dirstate': | 918 if k == 'dirstate': |
915 continue | 919 continue |
916 ce.refresh() | 920 ce.refresh() |
917 | 921 |