Patchwork [2,of,3] changegroup: remove option to allow empty changegroup (API)

login
register
mail settings
Submitter via Mercurial-devel
Date July 5, 2017, 10:12 p.m.
Message ID <748b0ea7aa3b88ef8ccd.1499292753@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/22022/
State Accepted
Headers show

Comments

via Mercurial-devel - July 5, 2017, 10:12 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1498892409 25200
#      Sat Jul 01 00:00:09 2017 -0700
# Node ID 748b0ea7aa3b88ef8ccdd236339d9a2daba18f54
# Parent  efb8e7e78aa8c9f10bd40d9963bb8bb10b005f8c
changegroup: remove option to allow empty changegroup (API)

No caller sets the "emptyok" option, so let's remove it.

Patch

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -237,8 +237,8 @@ 
         repo.ui.progress(_('manifests'), None)
         self.callback = None
 
-    def apply(self, repo, tr, srctype, url, emptyok=False,
-              targetphase=phases.draft, expectedtotal=None):
+    def apply(self, repo, tr, srctype, url, targetphase=phases.draft,
+              expectedtotal=None):
         """Add the changegroup returned by source.read() to this repo.
         srctype is a string like 'push', 'pull', or 'unbundle'.  url is
         the URL of the repo where this changegroup is coming from.
@@ -297,7 +297,7 @@ 
             cgnodes = cl.addgroup(self, csmap, trp, addrevisioncb=onchangelog)
             efiles = len(efiles)
 
-            if not (cgnodes or emptyok):
+            if not cgnodes:
                 raise error.Abort(_("received changelog group is empty"))
             clend = len(cl)
             changesets = clend - clstart