diff -r b39958d6b81b -r aac4be30e250 mercurial/util.py --- a/mercurial/util.py Thu May 03 18:39:58 2018 +0900 +++ b/mercurial/util.py Sat May 26 12:14:04 2018 +0900 @@ -31,7 +31,6 @@ import socket import stat import sys -import tempfile import time import traceback import warnings @@ -1893,7 +1892,7 @@ # work around issue2543 (or testfile may get lost on Samba shares) f1, f2, fp = None, None, None try: - fd, f1 = tempfile.mkstemp(prefix='.%s-' % os.path.basename(testfile), + fd, f1 = pycompat.mkstemp(prefix='.%s-' % os.path.basename(testfile), suffix='1~', dir=os.path.dirname(testfile)) os.close(fd) f2 = '%s2~' % f1[:-2] @@ -1939,7 +1938,7 @@ Returns the name of the temporary file. """ d, fn = os.path.split(name) - fd, temp = tempfile.mkstemp(prefix='.%s-' % fn, suffix='~', dir=d) + fd, temp = pycompat.mkstemp(prefix='.%s-' % fn, suffix='~', dir=d) os.close(fd) # Temporary files are created with mode 0600, which is usually not # what we want. If the original file already exists, just copy