##// END OF EJS Templates
localrepo: always write the filtered phasecache when nodes are destroyed (issue3827)...
Idan Kamara -
r18757:1c8e0d6a stable
parent child Browse files
Show More
@@ -1416,9 +1416,8 b' class localrepository(object):'
1416 # removed. We can either remove phasecache from the filecache,
1416 # removed. We can either remove phasecache from the filecache,
1417 # causing it to reload next time it is accessed, or simply filter
1417 # causing it to reload next time it is accessed, or simply filter
1418 # the removed nodes now and write the updated cache.
1418 # the removed nodes now and write the updated cache.
1419 if '_phasecache' in self._filecache:
1419 self._phasecache.filterunknown(self)
1420 self._phasecache.filterunknown(self)
1420 self._phasecache.write()
1421 self._phasecache.write()
1422
1421
1423 # update the 'served' branch cache to help read only server process
1422 # update the 'served' branch cache to help read only server process
1424 # Thanks to branchcach collaboration this is done from the nearest
1423 # Thanks to branchcach collaboration this is done from the nearest
@@ -236,6 +236,27 b' def hgignore(server):'
236 f.close()
236 f.close()
237 runcommand(server, ['status', '-i', '-u'])
237 runcommand(server, ['status', '-i', '-u'])
238
238
239 def phasecacheafterstrip(server):
240 readchannel(server)
241
242 # create new head, 5:731265503d86
243 runcommand(server, ['update', '-C', '0'])
244 f = open('a', 'ab')
245 f.write('a\n')
246 f.close()
247 runcommand(server, ['commit', '-Am.', 'a'])
248 runcommand(server, ['log', '-Gq'])
249
250 # make it public; draft marker moves to 4:7966c8e3734d
251 runcommand(server, ['phase', '-p', '.'])
252 runcommand(server, ['phase', '.']) # load _phasecache.phaseroots
253
254 # strip 1::4 outside server
255 os.system('hg --config extensions.mq= strip 1')
256
257 # shouldn't raise "7966c8e3734d: no node!"
258 runcommand(server, ['branches'])
259
239 if __name__ == '__main__':
260 if __name__ == '__main__':
240 os.system('hg init')
261 os.system('hg init')
241
262
@@ -258,3 +279,4 b" if __name__ == '__main__':"
258 check(rollback)
279 check(rollback)
259 check(branch)
280 check(branch)
260 check(hgignore)
281 check(hgignore)
282 check(phasecacheafterstrip)
@@ -164,3 +164,29 b' testing hgignore:'
164 adding .hgignore
164 adding .hgignore
165 runcommand status -i -u
165 runcommand status -i -u
166 I ignored-file
166 I ignored-file
167
168 testing phasecacheafterstrip:
169
170 runcommand update -C 0
171 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
172 runcommand commit -Am. a
173 created new head
174 runcommand log -Gq
175 @ 5:731265503d86
176 |
177 | o 4:7966c8e3734d
178 | |
179 | o 3:b9b85890c400
180 | |
181 | o 2:aef17e88f5f0
182 | |
183 | o 1:d3a0a68be6de
184 |/
185 o 0:eff892de26ec
186
187 runcommand phase -p .
188 runcommand phase .
189 5: public
190 saved backup bundle to $TESTTMP/.hg/strip-backup/d3a0a68be6de-backup.hg
191 runcommand branches
192 default 1:731265503d86
General Comments 0
You need to be logged in to leave comments. Login now