hg in: if no incoming csets, remove existing bundle
authorMatt Mackall <mpm@selenic.com>
Tue, 19 Dec 2006 16:37:45 -0600
changeset 3940 7997c0e01bfc
parent 3932 e0793314360e
child 3941 d0bbd8ee50c7
hg in: if no incoming csets, remove existing bundle
mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1531,6 +1531,10 @@ def incoming(ui, repo, source="default",
     other = hg.repository(ui, source)
     incoming = repo.findincoming(other, force=opts["force"])
     if not incoming:
+        try:
+            os.unlink(opts["bundle"])
+        except:
+            pass
         ui.status(_("no changes found\n"))
         return 1