mercurial/localrepo.py
changeset 6058 88b4d726332a
parent 6056 0ad2ffbf6b38
child 6062 3c3b126e5619
equal deleted inserted replaced
6057:218d5b9aa466 6058:88b4d726332a
   577             lock = self.lock()
   577             lock = self.lock()
   578             if os.path.exists(self.sjoin("undo")):
   578             if os.path.exists(self.sjoin("undo")):
   579                 self.ui.status(_("rolling back last transaction\n"))
   579                 self.ui.status(_("rolling back last transaction\n"))
   580                 transaction.rollback(self.sopener, self.sjoin("undo"))
   580                 transaction.rollback(self.sopener, self.sjoin("undo"))
   581                 util.rename(self.join("undo.dirstate"), self.join("dirstate"))
   581                 util.rename(self.join("undo.dirstate"), self.join("dirstate"))
   582                 branch = self.opener("undo.branch").read()
   582                 try:
   583                 self.dirstate.setbranch(branch)
   583                     branch = self.opener("undo.branch").read()
       
   584                     self.dirstate.setbranch(branch)
       
   585                 except IOError:
       
   586                     self.ui.warn(_("Named branch could not be reset, "
       
   587                                    "current branch still is: %s\n")
       
   588                                  % util.tolocal(self.dirstate.branch()))
   584                 self.invalidate()
   589                 self.invalidate()
   585                 self.dirstate.invalidate()
   590                 self.dirstate.invalidate()
   586             else:
   591             else:
   587                 self.ui.warn(_("no rollback information available\n"))
   592                 self.ui.warn(_("no rollback information available\n"))
   588         finally:
   593         finally: