Patchwork [1,of,3] strip: don't allow empty changegroup in bundle1

mail settings
Submitter via Mercurial-devel
Date July 5, 2017, 10:12 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/22021/
State Accepted
Headers show


via Mercurial-devel - July 5, 2017, 10:12 p.m.
# HG changeset patch
# User Martin von Zweigbergk <>
# Date 1498892311 25200
#      Fri Jun 30 23:58:31 2017 -0700
# Node ID efb8e7e78aa8c9f10bd40d9963bb8bb10b005f8c
# Parent  85d1ac0115821253fee376fe4bd980e613c5d474
strip: don't allow empty changegroup in bundle1

Applying an empty changegroup has been an error since the
beginning. The only exception was strip, which would allow to apply an
empty changegroup from the temporary bundle. However, the emptyok=True
option was only set for bundle1 bundles. In other words, temporary
bundle2 bundles would fail if they were empty.

Bundle2 has now been used enough that it seems safe to say that we
simply don't create bundle2 bundles with empty changegroups. That also
suggests that we never create bundle1 bundles with empty changegroups
(i.e. empty bundle1 bundles, since bundle1 is just a changegroup),
because, AFAICT, the code leading up to the application of the bundle
is the same for bundle1 and bundle2.

Therefore, let's stop passing emptyok=True, so we more clearly get the
same behavior for bundle1 and bundle2.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -213,7 +213,7 @@ 
                 txnname = "strip\n%s" % util.hidepassword(tmpbundleurl)
             with repo.transaction(txnname) as tr:
                 bundle2.applybundle(repo, gen, tr, source='strip',
-                                    url=tmpbundleurl, emptyok=True)
+                                    url=tmpbundleurl)
             if not repo.ui.verbose: