mercurial/commands.py
changeset 522 2f1de824798a
parent 518 b0187336843c
child 523 003df62ae39f
--- a/mercurial/commands.py	Wed Jun 29 11:16:41 2005 -0800
+++ b/mercurial/commands.py	Wed Jun 29 13:48:57 2005 -0800
@@ -302,8 +302,9 @@
             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 @@
 
     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: