Mercurial > hg
changeset 2108:30c7564f6dfc
Move empty local repo logic for pull into findincoming
This fixes a silly attempt to pull a changegroup from an empty repo.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 21 Apr 2006 15:33:51 -0500 |
parents | 7ff92c04f8e5 |
children | 1b183976e007 |
files | mercurial/localrepo.py tests/test-bad-pull.out tests/test-clone-failure.out |
diffstat | 3 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Fri Apr 21 15:14:27 2006 -0500 +++ b/mercurial/localrepo.py Fri Apr 21 15:33:51 2006 -0500 @@ -831,13 +831,18 @@ if base == None: base = {} + if not heads: + heads = remote.heads() + + if self.changelog.tip() == nullid: + if heads != [nullid]: + return [nullid] + return [] + # assume we're closer to the tip than the root # and start by examining the heads self.ui.status(_("searching for changes\n")) - if not heads: - heads = remote.heads() - unknown = [] for h in heads: if h not in m: @@ -998,12 +1003,9 @@ def pull(self, remote, heads=None, force=False): l = self.lock() - # if we have an empty repo, fetch everything - if self.changelog.tip() == nullid: + fetch = self.findincoming(remote, force=force) + if fetch == [nullid]: self.ui.status(_("requesting all changes\n")) - fetch = [nullid] - else: - fetch = self.findincoming(remote, force=force) if not fetch: self.ui.status(_("no changes found\n"))