Patchwork D468: util: use ~ as a suffix for a temp file in the same directory as a source file

login
register
mail settings
Submitter phabricator
Date Aug. 29, 2017, 3:43 p.m.
Message ID <b6120e52532535f204f8fe675aa95454@localhost.localdomain>
Download mbox | patch
Permalink /patch/23477/
State Not Applicable
Headers show

Comments

phabricator - Aug. 29, 2017, 3:43 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2ad028635ccd: util: use ~ as a suffix for a temp file in the same directory as a source file (authored by mbolin).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D468?vs=1144&id=1396

REVISION DETAIL
  https://phab.mercurial-scm.org/D468

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: mbolin, #hg-reviewers, quark, durin42
Cc: smf, mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -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