[darcs-devel] Re: bug in get_extra

David Roundy droundy at abridgegame.org
Wed Nov 17 03:11:54 PST 2004


On Mon, Nov 15, 2004 at 08:47:01PM -0800, Jim Radford wrote:
> A bit more specifically, I have a bunch of patches generated with
> cvsps on which I ran the following
> 
>   darcs init;
>   for p in ../*.patch; do 
>     patch -sp1 < ../$p 
>     perl darcs-metadata-from-cvsps-header ../$p | \
>        darcs record -a --look-for-adds --pipe
>   done
> 
> After using the resulting darcs repository for a while I noticed the
> mis-attribution.  I then edited one of the patch files to correct the
> author and re-ran the above generating a new initial version of the
> repository.  I thought that pushing the new repository to the
> repository I'd been using would just push that one patch or at worst
> get come kind of conflict on that patch.

Indeed this won't work.  You have two inconsistent sets of history, which
to darcs means a corrupt pair of repositories.  Darcs relies on a unique
correspondence between patch names and changes, and by changing the name of
one of the patches, that was broken, since you now had patches that came
*after* the modified patch which had the same name, but depended on a
different context.

A workaround for this issue (obviously to be performed after backing up
both repositories) would be to edit the _darcs/inventory file (or perhaps
one of the _darcs/inventories/* files, if that's where it is) in the
repository with the "wrong" attribution to match the other one.  This
modified repository will now be slightly corrupt (since it won't be able to
find that patch), but you can now pull from it to the other one any new
patches you added.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list