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.
--- 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:
--- 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