D399: filemerge: eliminate most uses of tempfiles

phillco (Phil Cohen) phabricator at mercurial-scm.org
Tue Aug 15 05:28:14 UTC 2017


phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Emphasize that they're unused so we can more easily remobe them later.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -330,7 +330,7 @@
     tool, toolpath, binary, symlink = toolconf
     if symlink or fcd.isabsent() or fco.isabsent():
         return 1
-    a, b, c, back = files
+    unused, unused, unused, back = files
 
     ui = repo.ui
 
@@ -359,7 +359,8 @@
             ui.debug(" premerge successful\n")
             return 0
         if premerge not in validkeep:
-            util.copyfile(back, a) # restore from backup and try again
+            # restore from backup and try again
+            util.copyfile(back, repo.wjoin(fcd.path()))
     return 1 # continue merging
 
 def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf):
@@ -380,8 +381,6 @@
     files. It will fail if there are any conflicts and leave markers in
     the partially merged file. Markers will have two sections, one for each side
     of merge, unless mode equals 'union' which suppresses the markers."""
-    a, b, c, back = files
-
     ui = repo.ui
 
     r = simplemerge.simplemerge(ui, fcd, fca, fco,
@@ -731,7 +730,7 @@
 
 def _check(r, ui, tool, fcd, files):
     fd = fcd.path()
-    a, b, c, back = files
+    a, unused, unused, back = files
 
     if not r and (_toolbool(ui, tool, "checkconflicts") or
                   'conflicts' in _toollist(ui, tool, "check")):



To: phillco, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list