Mercurial > hg
changeset 636:ac0ec421e3a5
Move the empty changeset detection out of findincoming to pull
This lets us reuse findincoming for findoutgoing
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 06 Jul 2005 22:20:56 -0800 |
parents | 85e2209d401c |
children | 31e090c34d3b |
files | mercurial/hg.py |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hg.py Wed Jul 06 22:20:12 2005 -0800 +++ b/mercurial/hg.py Wed Jul 06 22:20:56 2005 -0800 @@ -870,12 +870,7 @@ seen = {} seenbranch = {} - # if we have an empty repo, fetch everything - if self.changelog.tip() == nullid: - self.ui.status("requesting all changes\n") - return [nullid] - - # otherwise, assume we're closer to the tip than the root + # assume we're closer to the tip than the root # and start by examining the heads self.ui.status("searching for changes\n") heads = remote.heads() @@ -1006,7 +1001,14 @@ def pull(self, remote): lock = self.lock() - fetch = self.findincoming(remote) + + # if we have an empty repo, fetch everything + if self.changelog.tip() == nullid: + self.ui.status("requesting all changes\n") + fetch = [nullid] + else: + fetch = self.findincoming(remote) + if not fetch: self.ui.status("no changes found\n") return 1