##// END OF EJS Templates
restore branch after rollback (issue 902)
Alexandre Vassalotti -
r5814:dd5a501c default
parent child Browse files
Show More
@@ -525,9 +525,11 b' class localrepository(repo.repository):'
525 525 except IOError:
526 526 ds = ""
527 527 self.opener("journal.dirstate", "w").write(ds)
528 self.opener("journal.branch", "w").write(self.dirstate.branch())
528 529
529 530 renames = [(self.sjoin("journal"), self.sjoin("undo")),
530 (self.join("journal.dirstate"), self.join("undo.dirstate"))]
531 (self.join("journal.dirstate"), self.join("undo.dirstate")),
532 (self.join("journal.branch"), self.join("undo.branch"))]
531 533 tr = transaction.transaction(self.ui.warn, self.sopener,
532 534 self.sjoin("journal"),
533 535 aftertrans(renames))
@@ -557,6 +559,8 b' class localrepository(repo.repository):'
557 559 self.ui.status(_("rolling back last transaction\n"))
558 560 transaction.rollback(self.sopener, self.sjoin("undo"))
559 561 util.rename(self.join("undo.dirstate"), self.join("dirstate"))
562 branch = self.opener("undo.branch").read()
563 self.dirstate.setbranch(branch)
560 564 self.invalidate()
561 565 self.dirstate.invalidate()
562 566 else:
@@ -4,4 +4,4 b' adding changesets'
4 4 transaction abort!
5 5 rollback completed
6 6 killed!
7 .hg/00changelog.i .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a
7 .hg/00changelog.i .hg/journal.branch .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a
@@ -13,3 +13,9 b' hg rollback'
13 13 hg verify
14 14 hg parents
15 15 hg status
16
17 # Test issue 902
18 hg commit -m "test"
19 hg branch test
20 hg rollback
21 hg branch
@@ -16,3 +16,6 b' crosschecking files in changesets and ma'
16 16 checking files
17 17 0 files, 0 changesets, 0 total revisions
18 18 A a
19 marked working directory as branch test
20 rolling back last transaction
21 default
General Comments 0
You need to be logged in to leave comments. Login now