Skip to content
Snippets Groups Projects
Commit 44ef2162 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

strip: report both bundle files in case of exception (issue5368)

If strip fails while recovering the temporary bundle (e.g. because a
hook fails), we tell the user only about the backup bundle, not about
the temporary bundle. Since the user did not ask to strip the commits
in the temporary bundle, that's the more important bundle to mention,
so let's do that (and also mention the backup bundle as usual).
parent e7acbe53
No related branches found
No related tags found
No related merge requests found
......@@ -230,7 +230,7 @@
if backupfile:
ui.warn(_("strip failed, full bundle stored in '%s'\n")
% vfs.join(backupfile))
elif chgrpfile:
if chgrpfile:
ui.warn(_("strip failed, partial bundle stored in '%s'\n")
% vfs.join(chgrpfile))
raise
......
......@@ -367,7 +367,47 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
Failed hook while applying "saveheads" bundle.
$ hg strip 2 --config hooks.pretxnchangegroup.bad=false
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
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)
abort: pretxnchangegroup.bad hook exited with status 1
[255]
$ restore
$ hg log -G
o changeset: 4:443431ffac4f
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: e
|
o changeset: 3:65bd5f99a4a3
| parent: 1:ef3a871183d7
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: d
|
| o changeset: 2:264128213d29
|/ user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: c
|
@ changeset: 1:ef3a871183d7
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: b
|
o changeset: 0:9ab35a2d17cb
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
2 different branches: 2 strips
$ hg strip 2 4
......@@ -370,8 +410,7 @@
2 different branches: 2 strips
$ hg strip 2 4
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
$ hg log -G
o changeset: 2:65bd5f99a4a3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment