##// END OF EJS Templates
localrepo: introduce destroying function
Idan Kamara -
r18310:4499ba5a default
parent child Browse files
Show More
@@ -895,6 +895,7 class localrepository(object):
895 895 return 0
896 896
897 897 parents = self.dirstate.parents()
898 self.destroying()
898 899 transaction.rollback(self.sopener, self.sjoin('undo'), ui.warn)
899 900 if os.path.exists(self.join('undo.bookmarks')):
900 901 util.rename(self.join('undo.bookmarks'),
@@ -1379,6 +1380,20 class localrepository(object):
1379 1380 lock.release()
1380 1381
1381 1382 @unfilteredmethod
1383 def destroying(self):
1384 '''Inform the repository that nodes are about to be destroyed.
1385 Intended for use by strip and rollback, so there's a common
1386 place for anything that has to be done before destroying history.
1387
1388 This is mostly useful for saving state that is in memory and waiting
1389 to be flushed when the current lock is released. Because a call to
1390 destroyed is imminent, the repo will be invalidated causing those
1391 changes to stay in memory (waiting for the next unlock), or vanish
1392 completely.
1393 '''
1394 pass
1395
1396 @unfilteredmethod
1382 1397 def destroyed(self, newheadnodes=None):
1383 1398 '''Inform the repository that nodes have been destroyed.
1384 1399 Intended for use by strip and rollback, so there's a common
@@ -61,6 +61,7 def strip(ui, repo, nodelist, backup="al
61 61 # have to consider the effect of the stripped revisions and not revisions
62 62 # missing because the cache is out-of-date.
63 63 branchmap.updatecache(repo)
64 repo.destroying()
64 65
65 66 cl = repo.changelog
66 67 # TODO handle undo of merge sets
General Comments 0
You need to be logged in to leave comments. Login now