##// END OF EJS Templates
merge: use original file extension for temporary files...
Mads Kiilerich -
r30538:c2154979 default
parent child Browse files
Show More
@@ -577,8 +577,9 b' def _filemerge(premerge, repo, mynode, o'
577 a boolean indicating whether the file was deleted from disk."""
577 a boolean indicating whether the file was deleted from disk."""
578
578
579 def temp(prefix, ctx):
579 def temp(prefix, ctx):
580 pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
580 fullbase, ext = os.path.splitext(ctx.path())
581 (fd, name) = tempfile.mkstemp(prefix=pre)
581 pre = "%s~%s." % (os.path.basename(fullbase), prefix)
582 (fd, name) = tempfile.mkstemp(prefix=pre, suffix=ext)
582 data = repo.wwritedata(ctx.path(), ctx.data())
583 data = repo.wwritedata(ctx.path(), ctx.data())
583 f = os.fdopen(fd, "wb")
584 f = os.fdopen(fd, "wb")
584 f.write(data)
585 f.write(data)
@@ -1209,3 +1209,15 b' internal merge cannot handle symlinks an'
1209 [1]
1209 [1]
1210
1210
1211 #endif
1211 #endif
1212
1213 Verify naming of temporary files and that extension is preserved:
1214
1215 $ hg update -q -C 1
1216 $ hg mv f f.txt
1217 $ hg ci -qm "f.txt"
1218 $ hg update -q -C 2
1219 $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
1220 merging f and f.txt to f.txt
1221 */f~base.?????? $TESTTMP/f.txt.orig */f~other.??????.txt $TESTTMP/f.txt (glob)
1222 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1223 (branch merge, don't forget to commit)
General Comments 0
You need to be logged in to leave comments. Login now