diff mercurial/localrepo.py @ 15455:c6f87bdab2a1

phases: add rollback support
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 07 Nov 2011 12:27:25 +0100
parents 5a7dde5adec8
children abcaaf51d568
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Nov 07 14:11:01 2011 +0100
+++ b/mercurial/localrepo.py	Mon Nov 07 12:27:25 2011 +0100
@@ -758,10 +758,16 @@
             util.copyfile(bkname, self.join('journal.bookmarks'))
         else:
             self.opener.write('journal.bookmarks', '')
+        phasesname = self.sjoin('phaseroots')
+        if os.path.exists(phasesname):
+            util.copyfile(phasesname, self.sjoin('journal.phaseroots'))
+        else:
+            self.sopener.write('journal.phaseroots', '')
 
         return (self.sjoin('journal'), self.join('journal.dirstate'),
                 self.join('journal.branch'), self.join('journal.desc'),
-                self.join('journal.bookmarks'))
+                self.join('journal.bookmarks'),
+                self.sjoin('journal.phaseroots'))
 
     def recover(self):
         lock = self.lock()
@@ -826,6 +832,9 @@
         if os.path.exists(self.join('undo.bookmarks')):
             util.rename(self.join('undo.bookmarks'),
                         self.join('bookmarks'))
+        if os.path.exists(self.sjoin('undo.phaseroots')):
+            util.rename(self.sjoin('undo.phaseroots'),
+                        self.sjoin('phaseroots'))
         self.invalidate()
 
         parentgone = (parents[0] not in self.changelog.nodemap or