##// END OF EJS Templates
convert: fix git copy file content conversions...
Durham Goode -
r25997:d4e1e947 stable
parent child Browse files
Show More
@@ -255,12 +255,18 b' class convert_git(converter_source):'
255 entry = l.split()
255 entry = l.split()
256 continue
256 continue
257 f = l
257 f = l
258 if entry[4][0] == 'C':
259 copysrc = f
260 copydest = difftree[i]
261 i += 1
262 f = copydest
263 copies[copydest] = copysrc
258 if f not in seen:
264 if f not in seen:
259 add(entry, f, False)
265 add(entry, f, False)
260 # A file can be copied multiple times, or modified and copied
266 # A file can be copied multiple times, or modified and copied
261 # simultaneously. So f can be repeated even if fdest isn't.
267 # simultaneously. So f can be repeated even if fdest isn't.
262 if entry[4][0] in 'RC':
268 if entry[4][0] == 'R':
263 # rename or copy: next line is the destination
269 # rename: next line is the destination
264 fdest = difftree[i]
270 fdest = difftree[i]
265 i += 1
271 i += 1
266 if fdest not in seen:
272 if fdest not in seen:
@@ -321,8 +321,9 b' since bar is not touched in this commit,'
321 $ cp bar bar-copied
321 $ cp bar bar-copied
322 $ cp baz baz-copied
322 $ cp baz baz-copied
323 $ cp baz baz-copied2
323 $ cp baz baz-copied2
324 $ cp baz ba-copy
324 $ echo baz2 >> baz
325 $ echo baz2 >> baz
325 $ git add bar-copied baz-copied baz-copied2
326 $ git add bar-copied baz-copied baz-copied2 ba-copy
326 $ commit -a -m 'rename and copy'
327 $ commit -a -m 'rename and copy'
327 $ cd ..
328 $ cd ..
328
329
@@ -340,6 +341,8 b' input validation'
340 $ hg -q convert --config convert.git.similarity=100 --datesort git-repo2 fullrepo
341 $ hg -q convert --config convert.git.similarity=100 --datesort git-repo2 fullrepo
341 $ hg -R fullrepo status -C --change master
342 $ hg -R fullrepo status -C --change master
342 M baz
343 M baz
344 A ba-copy
345 baz
343 A bar-copied
346 A bar-copied
344 A baz-copied
347 A baz-copied
345 baz
348 baz
@@ -349,6 +352,13 b' input validation'
349 foo
352 foo
350 R foo
353 R foo
351
354
355 Ensure that the modification to the copy source was preserved
356 (there was a bug where if the copy dest was alphabetically prior to the copy
357 source, the copy source took the contents of the copy dest)
358 $ hg cat -r tip fullrepo/baz
359 baz
360 baz2
361
352 $ cd git-repo2
362 $ cd git-repo2
353 $ echo bar2 >> bar
363 $ echo bar2 >> bar
354 $ commit -a -m 'change bar'
364 $ commit -a -m 'change bar'
General Comments 0
You need to be logged in to leave comments. Login now