# HG changeset patch # User Tony Tung # Date 1471638640 25200 # Node ID bac1829ec31f469b03eed092fc751f742e6d5b27 # Parent 1316c7cccc76288274070c5f7dd68dd5dded2bec util: checknlink should remove file it creates if an exception occurs There's no reason to leave the file behind. diff -r 1316c7cccc76 -r bac1829ec31f mercurial/util.py --- a/mercurial/util.py Tue Aug 23 17:58:53 2016 -0700 +++ b/mercurial/util.py Fri Aug 19 13:30:40 2016 -0700 @@ -1341,6 +1341,10 @@ try: posixfile(f1, 'w').close() except IOError: + try: + os.unlink(f1) + except OSError: + pass return False f2 = testfile + ".hgtmp2"