# HG changeset patch # User Martin von Zweigbergk # Date 2017-07-01 06:58:31 # Node ID 665271d601f5b31b8771515896b591b0d0cd149d # Parent a9808bd1449e9172b3e5a642c1704c609a37294b 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/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -213,7 +213,7 @@ def strip(ui, repo, nodelist, backup=Tru 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: repo.ui.popbuffer() f.close()