# HG changeset patch # User Thomas Arendsen Hein # Date 1149107120 -7200 # Node ID 16276b1c065897419b974348d96b7169a6ed2aac # Parent 0c0bfea3f72affb03bb3ad00231e28dfb3cec2c5 Manifest groups may be empty, so don't abort in this case (fixes issue210). Only abort on empty changelog and file revlogs. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1510,7 +1510,8 @@ class localrepository(object): self.ui.status(_("adding changesets\n")) cor = cl.count() - 1 chunkiter = changegroup.chunkiter(source) - cl.addgroup(chunkiter, csmap, tr, 1) # unique + if cl.addgroup(chunkiter, csmap, tr, 1) is None: + raise util.Abort(_("received changelog group is empty")) cnr = cl.count() - 1 changesets = cnr - cor @@ -1522,6 +1523,10 @@ class localrepository(object): # pull off the manifest group self.ui.status(_("adding manifests\n")) chunkiter = changegroup.chunkiter(source) + # no need to check for empty manifest group here: + # if the result of the merge of 1 and 2 is the same in 3 and 4, + # no new manifest will be created and the manifest group will + # be empty during the pull mf.addgroup(chunkiter, revmap, tr) # process the files @@ -1534,7 +1539,8 @@ class localrepository(object): fl = self.file(f) o = fl.count() chunkiter = changegroup.chunkiter(source) - fl.addgroup(chunkiter, revmap, tr) + if fl.addgroup(chunkiter, revmap, tr) is None: + raise util.Abort(_("received file revlog group is empty")) revisions += fl.count() - o files += 1 diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1196,8 +1196,6 @@ class revlog(object): start = self.start(base) end = self.end(t) - if node is None: - raise RevlogError(_("group to be added is empty")) return node def strip(self, rev, minlink):