changeset 15091:106f89299da6 stable

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.
author Sune Foldager <cryo@cyanite.org>
date Wed, 14 Sep 2011 13:51:50 +0200
parents 31c9e2a702d1
children 2ca855126091 258eee414ab7
files mercurial/bundlerepo.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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