diff -r 3340efe80803 -r 2ad028635ccd mercurial/util.py --- a/mercurial/util.py Mon Aug 28 14:47:18 2017 -0700 +++ b/mercurial/util.py Tue Aug 22 00:38:38 2017 +0000 @@ -1525,7 +1525,7 @@ Returns the name of the temporary file. """ d, fn = os.path.split(name) - fd, temp = tempfile.mkstemp(prefix='.%s-' % fn, dir=d) + fd, temp = tempfile.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