comparison mercurial/changegroup.py @ 33308:248d5890c80a

changegroup: remove option to allow empty changegroup (API) No caller sets the "emptyok" option, so let's remove it.
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 01 Jul 2017 00:00:09 -0700
parents 86c9aa1d598f
children 69c4493a54f9
comparison
equal deleted inserted replaced
33307:665271d601f5 33308:248d5890c80a
235 self.manifestheader() 235 self.manifestheader()
236 repo.manifestlog._revlog.addgroup(self, revmap, trp) 236 repo.manifestlog._revlog.addgroup(self, revmap, trp)
237 repo.ui.progress(_('manifests'), None) 237 repo.ui.progress(_('manifests'), None)
238 self.callback = None 238 self.callback = None
239 239
240 def apply(self, repo, tr, srctype, url, emptyok=False, 240 def apply(self, repo, tr, srctype, url, targetphase=phases.draft,
241 targetphase=phases.draft, expectedtotal=None): 241 expectedtotal=None):
242 """Add the changegroup returned by source.read() to this repo. 242 """Add the changegroup returned by source.read() to this repo.
243 srctype is a string like 'push', 'pull', or 'unbundle'. url is 243 srctype is a string like 'push', 'pull', or 'unbundle'. url is
244 the URL of the repo where this changegroup is coming from. 244 the URL of the repo where this changegroup is coming from.
245 245
246 Return an integer summarizing the change to this repo: 246 Return an integer summarizing the change to this repo:
295 295
296 self.changelogheader() 296 self.changelogheader()
297 cgnodes = cl.addgroup(self, csmap, trp, addrevisioncb=onchangelog) 297 cgnodes = cl.addgroup(self, csmap, trp, addrevisioncb=onchangelog)
298 efiles = len(efiles) 298 efiles = len(efiles)
299 299
300 if not (cgnodes or emptyok): 300 if not cgnodes:
301 raise error.Abort(_("received changelog group is empty")) 301 raise error.Abort(_("received changelog group is empty"))
302 clend = len(cl) 302 clend = len(cl)
303 changesets = clend - clstart 303 changesets = clend - clstart
304 repo.ui.progress(_('changesets'), None) 304 repo.ui.progress(_('changesets'), None)
305 self.callback = None 305 self.callback = None