bundlerepo: add argument check before unlink stable
authorSune Foldager <cryo@cyanite.org>
Wed, 14 Sep 2011 13:51:50 +0200
branchstable
changeset 15091 106f89299da6
parent 15088 31c9e2a702d1
child 15093 2ca855126091
child 15094 258eee414ab7
bundlerepo: add argument check before unlink The default argument value of None, for bundlename, would cause an exception. Callers currently pass an empty string, thus dodging this problem.
mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Sun Sep 11 14:42:30 2011 +0200
+++ b/mercurial/bundlerepo.py	Wed Sep 14 13:51:50 2011 +0200
@@ -315,7 +315,8 @@
     common, incoming, rheads = tmp
     if not incoming:
         try:
-            os.unlink(bundlename)
+            if bundlename:
+                os.unlink(bundlename)
         except OSError:
             pass
         return other, [], other.close