[issue927] git renames/copies may be applied incorrectly

Patrick Mézard mercurial-bugs at selenic.com
Sat Jan 12 14:20:31 CST 2008


New submission from Patrick Mézard <pmezard at gmail.com>:

The output of:
"""
#!/bin/sh
hg init t
cd t
touch a
hg ci -Am t
echo a > a
hg copy a a2
hg ci -m copya
hg export --git tip > copy.diff
hg up -C 0
hg import copy.diff
cat copy.diff
echo % view a
cat a
echo % view a2
cat a2
"""

is something like:

"""
adding a
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
applying copy.diff
# HG changeset patch
# User test
# Date 0 0
# Node ID a95948a1d902dfd414bfb0f55aaf01d10a0de7d9
# Parent  681e33dc438758e35c01c8d354d61d3cdc183b7b
movea

diff --git a/a b/a
--- a/a
+++ b/a
@@ -0,0 +1,1 @@
+a
diff --git a/a b/a2
copy from a
copy to a2
--- a/a
+++ b/a2
@@ -0,0 +1,1 @@
+a
% view a
a
a
% view a2
"""

a2 is empty instead of containing "a", its chunk is applied to the "a" file
instead. The problem comes from the "afile in bfile" tests at the end of
patch.selectfile(). I don't really understand what case they handle but since
the same tests exist in mpatch and I clearly don't have cmason diffs knowledge,
I prefer to ask before removing them.

Any idea ?

----------
messages: 4881
nosy: ThomasAH, bos, mason, mpm, pmezard
priority: bug
status: unread
title: git renames/copies may be applied incorrectly
topic: patch

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue927>
____________________________________________________



More information about the Mercurial-devel mailing list