# HG changeset patch # User Sune Foldager # Date 1316001110 -7200 # Node ID 106f89299da61291b31dc054de721c98a04a1380 # Parent 31c9e2a702d128c5d0e2aa35eaa8cf5434029910 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. diff -r 31c9e2a702d1 -r 106f89299da6 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