# HG changeset patch
# User Martin von Zweigbergk <martinv...@google.com>
# Date 1474301672 25200
#      Mon Sep 19 09:14:32 2016 -0700
# Node ID 00910394ea13a94631ea1ba35bedb954e18451dc
# Parent  83d10fef08a4f93da5bc4002cba6f610af66227a
strip: clarify that user action is required to recover temp bundle

If strip fails when applying the temporary bundle, the commits in the
temporary bundle have not yet been applied, so the user will almost
definitely want to apply the bundle. We should be more clear to the
user about that than our current "partial bundle stored in...".

Note that we will probably not be able to recover it automatically,
since whatever made it fail (e.g. a hook) will most likely make it
fail again. We need to give control back to the user to fix the
problem before trying again.

diff -r 83d10fef08a4 -r 00910394ea13 mercurial/repair.py
--- a/mercurial/repair.py       Thu Sep 15 09:45:29 2016 -0700
+++ b/mercurial/repair.py       Mon Sep 19 09:14:32 2016 -0700
@@ -231,8 +231,10 @@
             ui.warn(_("strip failed, full bundle stored in '%s'\n")
                     % vfs.join(backupfile))
         if chgrpfile:
-            ui.warn(_("strip failed, partial bundle stored in '%s'\n")
+            ui.warn(_("strip failed, unrecovered changes stored in '%s'\n")
                     % vfs.join(chgrpfile))
+            ui.warn(_("(fix the problem, then recover the changesets with "
+                      "\"hg unbundle '%s'\")\n") % vfs.join(chgrpfile))
         raise
     else:
         if chgrpfile:
diff -r 83d10fef08a4 -r 00910394ea13 tests/test-strip.t
--- a/tests/test-strip.t        Thu Sep 15 09:45:29 2016 -0700
+++ b/tests/test-strip.t        Mon Sep 19 09:14:32 2016 -0700
@@ -375,7 +375,8 @@
   transaction abort!
   rollback completed
   strip failed, full bundle stored in 
'$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
-  strip failed, partial bundle stored in 
'$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
+  strip failed, unrecovered changes stored in 
'$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
+  (fix the problem, then recover the changesets with "hg unbundle 
'$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
   abort: pretxnchangegroup.bad hook exited with status 1
   [255]
   $ restore
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to