Comments
Patch
@@ -255,12 +255,18 @@ class convert_git(converter_source):
entry = l.split()
continue
f = l
+ if entry[4][0] == 'C':
+ copysrc = f
+ copydest = difftree[i]
+ i += 1
+ f = copydest
+ copies[copydest] = copysrc
if f not in seen:
add(entry, f, False)
# A file can be copied multiple times, or modified and copied
# simultaneously. So f can be repeated even if fdest isn't.
- if entry[4][0] in 'RC':
- # rename or copy: next line is the destination
+ if entry[4][0] == 'R':
+ # rename: next line is the destination
fdest = difftree[i]
i += 1
if fdest not in seen:
@@ -321,8 +321,9 @@ since bar is not touched in this commit,
$ cp bar bar-copied
$ cp baz baz-copied
$ cp baz baz-copied2
+ $ cp baz ba-copy
$ echo baz2 >> baz
- $ git add bar-copied baz-copied baz-copied2
+ $ git add bar-copied baz-copied baz-copied2 ba-copy
$ commit -a -m 'rename and copy'
$ cd ..
@@ -340,6 +341,8 @@ input validation
$ hg -q convert --config convert.git.similarity=100 --datesort git-repo2 fullrepo
$ hg -R fullrepo status -C --change master
M baz
+ A ba-copy
+ baz
A bar-copied
A baz-copied
baz
@@ -349,6 +352,13 @@ input validation
foo
R foo
+Ensure that the modification to the copy source was preserved
+(there was a bug where if the copy dest was alphabetically prior to the copy
+source, the copy source took the contents of the copy dest)
+ $ hg cat -r tip fullrepo/baz
+ baz
+ baz2
+
$ cd git-repo2
$ echo bar2 >> bar
$ commit -a -m 'change bar'