# HG changeset patch # User Alexis S. L. Carvalho # Date 2008-01-19 20:01:16 # Node ID afb7bdf11a61a7d8fc7dedcd7d0395184cba7a0e # Parent 0136d7f58982cfd3b595c8441857a8002a6dbff3 addchangegroup: add option to skip check for empty changelog group diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1852,7 +1852,7 @@ class localrepository(repo.repository): return util.chunkbuffer(gengroup()) - def addchangegroup(self, source, srctype, url): + def addchangegroup(self, source, srctype, url, emptyok=False): """add changegroup to repo. return values: @@ -1888,7 +1888,7 @@ class localrepository(repo.repository): self.ui.status(_("adding changesets\n")) cor = cl.count() - 1 chunkiter = changegroup.chunkiter(source) - if cl.addgroup(chunkiter, csmap, trp, 1) is None: + if cl.addgroup(chunkiter, csmap, trp, 1) is None and not emptyok: raise util.Abort(_("received changelog group is empty")) cnr = cl.count() - 1 changesets = cnr - cor