[PATCH 3 of 5] repair: create transaction for bundle1 unbundling earlier

Martin von Zweigbergk martinvonz at google.com
Sun Jun 18 03:02:26 EDT 2017


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1497593354 25200
#      Thu Jun 15 23:09:14 2017 -0700
# Node ID 1a23893eb7f7ea55df8835bd6208f8427fa36d13
# Parent  b6b0928d0128d2b424b40bf4c4d2a59acc20f9ac
repair: create transaction for bundle1 unbundling earlier

See earlier patch for motivation.

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -202,13 +202,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.lock(), repo.transaction(txnname):
+                    gen.apply(repo, 'strip', tmpbundleurl, True)
             if not repo.ui.verbose:
                 repo.ui.popbuffer()
             f.close()


More information about the Mercurial-devel mailing list