changeset 21274:3b4c75690206

journal: set Abort hint when failing due to an abandoned transaction
author Johan Bjork <jbjoerk@gmail.com>
date Thu, 08 May 2014 14:58:25 +0000
parents 20b8090d8125
children c7e9fb881a5a
files mercurial/localrepo.py tests/test-journal-exists.t
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu May 08 16:37:33 2014 -0700
+++ b/mercurial/localrepo.py	Thu May 08 14:58:25 2014 +0000
@@ -857,7 +857,8 @@
         # abort here if the journal already exists
         if self.svfs.exists("journal"):
             raise error.RepoError(
-                _("abandoned transaction found - run hg recover"))
+                _("abandoned transaction found"),
+                hint=_("run 'hg recover' to clean up transaction"))
 
         def onclose():
             self.store.write(tr)
--- a/tests/test-journal-exists.t	Thu May 08 16:37:33 2014 -0700
+++ b/tests/test-journal-exists.t	Thu May 08 14:58:25 2014 +0000
@@ -9,7 +9,8 @@
 
   $ echo foo > a
   $ hg ci -Am0
-  abort: abandoned transaction found - run hg recover!
+  abort: abandoned transaction found!
+  (run 'hg recover' to clean up transaction)
   [255]
 
   $ hg recover