diff -r 806d260c6f3b -r dac81729fea4 mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py Wed Mar 30 21:54:26 2016 +0200 +++ b/mercurial/bundlerepo.py Wed Mar 23 08:55:22 2016 +0100 @@ -32,6 +32,7 @@ localrepo, manifest, mdiff, + node as nodemod, pathutil, phases, revlog, @@ -385,6 +386,16 @@ def getcwd(self): return os.getcwd() # always outside the repo + # Check if parents exist in localrepo before setting + def setparents(self, p1, p2=nullid): + p1rev = self.changelog.rev(p1) + p2rev = self.changelog.rev(p2) + msg = _("setting parent to node %s that only exists in the bundle\n") + if self.changelog.repotiprev < p1rev: + self.ui.warn(msg % nodemod.hex(p1)) + if self.changelog.repotiprev < p2rev: + self.ui.warn(msg % nodemod.hex(p2)) + return super(bundlerepository, self).setparents(p1, p2) def instance(ui, path, create): if create: