changeset 33712:d11e2343762b

repair: create transaction for bundle1 unbundling earlier See earlier patch for motivation.
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 15 Jun 2017 23:09:14 -0700
parents ac9867519103
children af31d531dda0
files mercurial/repair.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -201,13 +201,15 @@
             if not repo.ui.verbose:
                 # silence internal shuffling chatter
                 repo.ui.pushbuffer()
+            tmpbundleurl = 'bundle:' + vfs.join(tmpbundlefile)
             if isinstance(gen, bundle2.unbundle20):
                 with repo.transaction('strip') as tr:
                     bundle2.applybundle(repo, gen, tr, source='strip',
-                                        url='bundle:' + vfs.join(tmpbundlefile))
+                                        url=tmpbundleurl)
             else:
-                gen.apply(repo, 'strip', 'bundle:' + vfs.join(tmpbundlefile),
-                          True)
+                txnname = "strip\n%s" % util.hidepassword(tmpbundleurl)
+                with repo.transaction(txnname):
+                    gen.apply(repo, 'strip', tmpbundleurl, True)
             if not repo.ui.verbose:
                 repo.ui.popbuffer()
             f.close()