diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -758,10 +758,16 @@ class localrepository(repo.repository): 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 @@ class localrepository(repo.repository): 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 diff --git a/tests/test-fncache.t b/tests/test-fncache.t --- a/tests/test-fncache.t +++ b/tests/test-fncache.t @@ -80,6 +80,7 @@ Non store repo: .hg/undo.branch .hg/undo.desc .hg/undo.dirstate + .hg/undo.phaseroots $ cd .. Non fncache repo: @@ -103,6 +104,7 @@ Non fncache repo: .hg/store/data/tst.d.hg .hg/store/data/tst.d.hg/_foo.i .hg/store/undo + .hg/store/undo.phaseroots .hg/undo.bookmarks .hg/undo.branch .hg/undo.desc diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t --- a/tests/test-hardlinks.t +++ b/tests/test-hardlinks.t @@ -48,6 +48,7 @@ Prepare repo r1: 1 r1/.hg/store/data/f1.i 1 r1/.hg/store/fncache 1 r1/.hg/store/undo + 1 r1/.hg/store/undo.phaseroots Create hardlinked clone r2: @@ -76,6 +77,7 @@ Repos r1 and r2 should now contain hardl 2 r1/.hg/store/data/f1.i 2 r1/.hg/store/fncache 1 r1/.hg/store/undo + 1 r1/.hg/store/undo.phaseroots $ nlinksdir r2/.hg/store 2 r2/.hg/store/00changelog.i @@ -93,6 +95,7 @@ Repo r3 should not be hardlinked: 1 r3/.hg/store/data/f1.i 1 r3/.hg/store/fncache 1 r3/.hg/store/undo + 1 r3/.hg/store/undo.phaseroots Create a non-inlined filelog in r3: @@ -113,6 +116,7 @@ Create a non-inlined filelog in r3: 1 r3/.hg/store/data/f1.i 1 r3/.hg/store/fncache 1 r3/.hg/store/undo + 1 r3/.hg/store/undo.phaseroots Push to repo r1 should break up most hardlinks in r2: @@ -196,6 +200,7 @@ r4 has hardlinks in the working dir (not 2 r4/.hg/store/data/f1.i 2 r4/.hg/store/fncache 2 r4/.hg/store/undo + 2 r4/.hg/store/undo.phaseroots 2 r4/.hg/undo.bookmarks 2 r4/.hg/undo.branch 2 r4/.hg/undo.desc @@ -225,6 +230,7 @@ Update back to revision 11 in r4 should 2 r4/.hg/store/data/f1.i 2 r4/.hg/store/fncache 2 r4/.hg/store/undo + 2 r4/.hg/store/undo.phaseroots 2 r4/.hg/undo.bookmarks 2 r4/.hg/undo.branch 2 r4/.hg/undo.desc diff --git a/tests/test-hup.t b/tests/test-hup.t --- a/tests/test-hup.t +++ b/tests/test-hup.t @@ -17,4 +17,4 @@ Test hangup signal in the middle of tran rollback completed killed! $ echo .hg/* .hg/store/* - .hg/00changelog.i .hg/journal.bookmarks .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a + .hg/00changelog.i .hg/journal.bookmarks .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a .hg/store/journal.phaseroots diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t --- a/tests/test-inherit-mode.t +++ b/tests/test-inherit-mode.t @@ -77,6 +77,7 @@ new directories are setgid 00660 ./.hg/store/data/foo.i 00660 ./.hg/store/fncache 00660 ./.hg/store/undo + 00660 ./.hg/store/undo.phaseroots 00660 ./.hg/undo.bookmarks 00660 ./.hg/undo.branch 00660 ./.hg/undo.desc @@ -118,6 +119,7 @@ group can still write everything 00660 ../push/.hg/store/data/foo.i 00660 ../push/.hg/store/fncache 00660 ../push/.hg/store/undo + 00660 ../push/.hg/store/undo.phaseroots 00660 ../push/.hg/undo.bookmarks 00660 ../push/.hg/undo.branch 00660 ../push/.hg/undo.desc