Handle platform dependency in atomic file renaming

This commit is contained in:
Mark Nauwelaerts
2019-01-06 15:24:23 +01:00
parent 3698638e98
commit 0bf3db826b

View File

@@ -1489,6 +1489,11 @@ def do_push_refspec(parser, refspec, revs):
if tmpmarks and os.path.exists(tmpmarks):
if ok and not dry_run:
# the commits made it through, now we can commit
# sigh ... no atomic rename for existing destination on some platform ...
# (use unofficial platform check)
if os.sep != '/':
if os.path.exists(marks):
os.remove(marks)
os.rename(tmpmarks, marks)
revs[:] = nparser.context.revs
else: