Comments
Patch
@@ -576,8 +576,9 @@ def _filemerge(premerge, repo, mynode, o
a boolean indicating whether the file was deleted from disk."""
def temp(prefix, ctx):
- pre = "%s~%s." % (os.path.basename(ctx.path()), prefix)
- (fd, name) = tempfile.mkstemp(prefix=pre)
+ fullbase, ext = os.path.splitext(ctx.path())
+ pre = "%s~%s." % (os.path.basename(fullbase), prefix)
+ (fd, name) = tempfile.mkstemp(prefix=pre, suffix=ext)
data = repo.wwritedata(ctx.path(), ctx.data())
f = os.fdopen(fd, "wb")
f.write(data)
@@ -1209,3 +1209,15 @@ internal merge cannot handle symlinks an
[1]
#endif
+
+Verify naming of temporary files and that extension is preserved:
+
+ $ hg update -q -C 1
+ $ hg mv f f.txt
+ $ hg ci -qm "f.txt"
+ $ hg update -q -C 2
+ $ hg merge -y -r tip --tool echo --config merge-tools.echo.args='$base $local $other $output'
+ merging f and f.txt to f.txt
+ */f~base.?????? $TESTTMP/f.txt.orig */f~other.??????.txt $TESTTMP/f.txt (glob)
+ 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)