comparison mercurial/phases.py @ 16626:503e674fb545

phases: stop modifying localrepo in writeroots() Also pass the phaseroots being written for clarity. repo._dirtyphases was already reset to False at call site.
author Patrick Mezard <patrick@mezard.eu>
date Thu, 10 May 2012 18:52:07 +0200
parents df9df747070d
children b6081c2c4647
comparison
equal deleted inserted replaced
16625:df9df747070d 16626:503e674fb545
154 dirty = True 154 dirty = True
155 if _filterunknown(repo.ui, repo.changelog, roots): 155 if _filterunknown(repo.ui, repo.changelog, roots):
156 dirty = True 156 dirty = True
157 return roots, dirty 157 return roots, dirty
158 158
159 def writeroots(repo): 159 def writeroots(repo, phaseroots):
160 """Write phase roots from disk""" 160 """Write phase roots from disk"""
161 f = repo.sopener('phaseroots', 'w', atomictemp=True) 161 f = repo.sopener('phaseroots', 'w', atomictemp=True)
162 try: 162 try:
163 for phase, roots in enumerate(repo._phaseroots): 163 for phase, roots in enumerate(phaseroots):
164 for h in roots: 164 for h in roots:
165 f.write('%i %s\n' % (phase, hex(h))) 165 f.write('%i %s\n' % (phase, hex(h)))
166 repo._dirtyphases = False
167 finally: 166 finally:
168 f.close() 167 f.close()
169 168
170 def advanceboundary(repo, targetphase, nodes): 169 def advanceboundary(repo, targetphase, nodes):
171 """Add nodes to a phase changing other nodes phases if necessary. 170 """Add nodes to a phase changing other nodes phases if necessary.