Description: 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.
 Upstream commit: 106f89299da61291b31dc054de721c98a04a1380
Origin: upstream, http://selenic.com/hg/rev/106f89299da61291b31dc054de721c98a04a1380
Author: Sune Foldager <cryo@cyanite.org>
Bug-Ubuntu: https://bugs.launchpad.net/bug/831313
Acked-by: Stefano Rivera <stefanor@ubuntu.com>
Last-Update: 2011-10-17

--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -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
