Patchwork journal: Set Abort hint when failing due to an abandoned transaction

login
register
mail settings
Submitter Johan Björk
Date May 8, 2014, 8:05 p.m.
Message ID <CAC_K0eq3PfiUH1Cn2COwomOFAuzDuZXqsQ4=dcErGksPDGQ+Ww@mail.gmail.com>
Download mbox | patch
Permalink /patch/4675/
State Accepted
Commit 3b4c75690206e9ad90864354dbfc36196c97934c
Headers show

Comments

Johan Björk - May 8, 2014, 8:05 p.m.
# HG changeset patch
# User Johan Bjork <jbjoerk@gmail.com>
# Date 1399561105 0
#      Thu May 08 14:58:25 2014 +0000
# Node ID cf7bd4622f4af4121575f10e19e73a16c56a6b34
# Parent  62a2749895e4151f766a4243fa870b1ddd7386d0
journal: Set Abort hint when failing due to an abandoned transaction
Pierre-Yves David - May 9, 2014, 6:05 a.m.
On 05/08/2014 01:05 PM, Johan Björk wrote:
> # HG changeset patch
> # User Johan Bjork <jbjoerk@gmail.com <mailto:jbjoerk@gmail.com>>
> # Date 1399561105 0
> #      Thu May 08 14:58:25 2014 +0000
> # Node ID cf7bd4622f4af4121575f10e19e73a16c56a6b34
> # Parent  62a2749895e4151f766a4243fa870b1ddd7386d0
> journal: Set Abort hint when failing due to an abandoned transaction

This patch have been queued after fixing the commit message (no leading 
should have been uncapitalized)

Also consider using the patchbomb extension for your next submission. 
Should make thing easier.

Patch

diff -r 62a2749895e4 -r cf7bd4622f4a mercurial/localrepo.py
--- a/mercurial/localrepo.py    Wed May 07 17:58:13 2014 -0500
+++ b/mercurial/localrepo.py    Thu May 08 14:58:25 2014 +0000
@@ -857,7 +857,7 @@ 
         # 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"))

         def onclose():
             self.store.write(tr)
diff -r 62a2749895e4 -r cf7bd4622f4a tests/test-journal-exists.t
--- a/tests/test-journal-exists.t       Wed May 07 17:58:13 2014 -0500
+++ 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)
   [255]

   $ hg recover