diff -r 37625132fe37 -r 3dd5ce2fddb6 mercurial/hg.py --- a/mercurial/hg.py Sat May 28 14:13:12 2005 -0800 +++ b/mercurial/hg.py Sun May 29 09:06:43 2005 -0800 @@ -525,15 +525,21 @@ return nl def getchangegroup(self, remote): - tip = remote.branches([])[0] - self.ui.debug("remote tip branch is %s:%s\n" % - (short(tip[0]), short(tip[1]))) m = self.changelog.nodemap - unknown = [tip] search = [] fetch = [] seen = {} seenbranch = {} + tip = remote.branches([])[0] + self.ui.debug("remote tip branch is %s:%s\n" % + (short(tip[0]), short(tip[1]))) + + # if we have an empty repo, fetch everything + if self.changelog.tip() == nullid: + return remote.changegroup([nullid]) + + # otherwise, assume we're closer to the tip than the root + unknown = [tip] if tip[0] in m: self.ui.note("nothing to do!\n")