[darcs-users] tla2darcs

David Roundy droundy at abridgegame.org
Sat Feb 12 12:51:46 UTC 2005


On Wed, Feb 09, 2005 at 12:59:22AM +0100, Marco Baringer wrote:
> here's another tla2darcs script. it attempts to write out a
> _darcs/patches/pending file based on the tla changeset, while it was
> able to successfully convert the entire tla history of uncommon web
> (700 patches containing moves, renames, deletes and creatations in
> multiple directories and reusing some names) i'm not certain it's 100%
> bullet-proof. in particular:
> 
> when a new file is added the script simply appends "addfile
> FILENAME\n" and doesn't add the hunk line with the file
> contents. apparently darcs (1.0.1) does The Right Thing (TM) when
> recording this change but i'm not sure if this is kosher or if i'm
> just getting lucky.

Pending only keeps track of things like file adds, not hunk contents
(except when something weird--and usually wrong--happens), so that's fine.
But rather than modifying pending manually, I think it would be better to
call darcs add.

I imagine you need a bit of sophistication (I haven't read your script) to
completely reliably translate arch changesets, since arch allows for
cyclical renaming, which darcs doesn't support directly.  So in cases of
cyclical renames, you'll need to come up with a temporary name for one of
the files, which may be challenging to get right.

Another potential pitfall is the ordering of renames, when a directory is
renamed, and a file within that directory is also renamed.  Here there's no
fundamentally hard issue (as in the case of cyclical renames, where you
need to come up with a temporary name that is "harmless"), but you do need
to be careful, since the ordering of the renames will affect the
representation of the renames themselves.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-users mailing list