diff mercurial/localrepo.py @ 6058:88b4d726332a

Do not abort rollback if undo.branch isn't available, but warn.
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 09 Feb 2008 19:39:01 +0100
parents 0ad2ffbf6b38
children 3c3b126e5619
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Feb 09 19:13:57 2008 +0100
+++ b/mercurial/localrepo.py	Sat Feb 09 19:39:01 2008 +0100
@@ -579,8 +579,13 @@
                 self.ui.status(_("rolling back last transaction\n"))
                 transaction.rollback(self.sopener, self.sjoin("undo"))
                 util.rename(self.join("undo.dirstate"), self.join("dirstate"))
-                branch = self.opener("undo.branch").read()
-                self.dirstate.setbranch(branch)
+                try:
+                    branch = self.opener("undo.branch").read()
+                    self.dirstate.setbranch(branch)
+                except IOError:
+                    self.ui.warn(_("Named branch could not be reset, "
+                                   "current branch still is: %s\n")
+                                 % util.tolocal(self.dirstate.branch()))
                 self.invalidate()
                 self.dirstate.invalidate()
             else: