diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -301,7 +301,8 @@ def clone(ui, source, dest = None, **opt else: repo = hg.repository(ui, ".", create=1) other = hg.repository(ui, source) - cg = repo.getchangegroup(other) + fetch = repo.findincoming(other) + cg = other.changegroup(fetch) repo.addchangegroup(cg) f = repo.opener("hgrc", "w") @@ -547,7 +548,8 @@ def pull(ui, repo, source="default", **o ui.status('pulling from %s\n' % (source)) other = hg.repository(ui, source) - cg = repo.getchangegroup(other) + fetch = repo.findincoming(other) + cg = other.changegroup(fetch) r = repo.addchangegroup(cg) if cg and not r: if opts['update']: diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -820,7 +820,7 @@ class localrepository: return nl - def getchangegroup(self, remote): + def findincoming(self, remote): m = self.changelog.nodemap search = [] fetch = [] @@ -830,7 +830,7 @@ class localrepository: # if we have an empty repo, fetch everything if self.changelog.tip() == nullid: self.ui.status("requesting all changes\n") - return remote.changegroup([nullid]) + return [nullid] # otherwise, assume we're closer to the tip than the root self.ui.status("searching for changes\n") @@ -925,8 +925,8 @@ class localrepository: self.ui.debug("%d total queries\n" % reqcnt) - return remote.changegroup(fetch) - + return fetch + def changegroup(self, basenodes): nodes = self.newer(basenodes)