diff -r 8413916df816 -r 774da7121fc9 mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Aug 24 05:42:41 2011 -0400 +++ b/mercurial/localrepo.py Thu Aug 25 20:21:04 2011 -0400 @@ -521,7 +521,7 @@ for label, nodes in branches.iteritems(): for node in nodes: f.write("%s %s\n" % (hex(node), encoding.fromlocal(label))) - f.rename() + f.close() except (IOError, OSError): pass