diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -302,8 +302,9 @@ def clone(ui, source, dest = None, **opt repo = hg.repository(ui, ".", create=1) other = hg.repository(ui, source) fetch = repo.findincoming(other) - cg = other.changegroup(fetch) - repo.addchangegroup(cg) + if fetch: + cg = other.changegroup(fetch) + repo.addchangegroup(cg) f = repo.opener("hgrc", "w") f.write("[paths]\n") @@ -549,6 +550,10 @@ def pull(ui, repo, source="default", **o other = hg.repository(ui, source) fetch = repo.findincoming(other) + if not fetch: + ui.status("no changes found\n") + return + cg = other.changegroup(fetch) r = repo.addchangegroup(cg) if cg and not r: diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -841,7 +841,6 @@ class localrepository: unknown.append(h) if not unknown: - self.ui.status("nothing to do!\n") return None rep = {} diff --git a/tests/test-pull b/tests/test-pull --- a/tests/test-pull +++ b/tests/test-pull @@ -16,5 +16,6 @@ hg verify hg co cat foo hg manifest +hg pull kill $! diff --git a/tests/test-pull.out b/tests/test-pull.out --- a/tests/test-pull.out +++ b/tests/test-pull.out @@ -15,4 +15,7 @@ checking files 1 files, 1 changesets, 1 total revisions foo 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo +pulling from http://localhost:20059/ +searching for changes +no changes found killed!