darcs

Issue 2446 cleanly convert file moves in "convert export"

Title cleanly convert file moves in "convert export"
Priority Status resolved
Milestone 2.10.0 Resolved in 2.10.0
Superseder Nosy List gh, jaredj, simon
Assigned To
Topics Bridge, ProbablyEasy

Created on 2015-03-19.22:33:15 by gh, last changed 2015-03-27.14:05:04 by noreply.

Messages
msg18324 (view) Author: gh Date: 2015-03-19.22:33:12
From http://irclog.perlgeek.de/darcs/2015-03-19#i_10308733 .

We should take advantage of the fastconvert protocol in the case of file
moves.
msg18325 (view) Author: gh Date: 2015-03-20.04:58:07
Problem happens when exporting the following repo (with a directory
move): http://hub.darcs.net/gh/shelltestrunner-export

Export to git, do a 'diff -r' on both directories.
msg18326 (view) Author: gh Date: 2015-03-20.19:46:53
The problem happens when a patch does a succession of the following
primitive changes:

  move dir1 to dir2
  adddir dir1

In which case, the export stream never says that dir1 should be deleted.
 To fix this, we have to add to the primitive patches a function similar
to `listTouchedFiles` but that would give us a list of paths that are
the source of a move.

Observe that this is distinct from the case of patch that does:

   deldir dir1
   adddir dir1

In fact such a patch cannot be created by darcs because it would be
coalesced. On the other hand, nothing is coalesced when a moved dir is
recreated in the same patch.  Then, the code of "convert export"
believes the same directory (and its contents) is keeps being present.
msg18327 (view) Author: gh Date: 2015-03-20.20:22:47
In fact there is a simpler way: when a directory is touched by a patch,
always dump first a deletion command in the fast-export stream. Since we
dump all of its contents anyway right after that, this is not more
costly. This fixes the bug in the shelltestrunner repository.
msg18336 (view) Author: noreply Date: 2015-03-27.14:05:02
The following patch sent by Guillaume Hoffmann <guillaumh@gmail.com> updated issue issue2446 with
status=resolved;resolvedin=2.10.0 HEAD

* resolve issue2446: in fast-export delete dirs before dumping contents 
Ignore-this: 661ed1b77cdc2297f51767e3a118ae16
History
Date User Action Args
2015-03-19 22:33:15ghcreate
2015-03-20 04:58:09ghsetmessages: + msg18325
2015-03-20 19:46:54ghsetmessages: + msg18326
2015-03-20 20:22:48ghsetmessages: + msg18327
2015-03-27 14:05:04noreplysetstatus: unknown -> resolved
messages: + msg18336
resolvedin: 2.10.0