[darcs-users] duplicate patch ...
Pietro Abate
Pietro.Abate at anu.edu.au
Mon Jul 16 09:45:46 UTC 2007
On Sat, Jul 14, 2007 at 05:06:05PM +0200, Tommy Pettersson wrote:
> On Sat, Jul 14, 2007 at 02:10:05AM +1000, Pietro Abate wrote:
> > Is there a simple way to remove/rename one patch from the stack without
> > messing up everything ?
> In your case the biggest problem probably is that one of the
> patches is actually missing. If two patches have the same hash
> they will save their contents in the same file, and therefore
> one will have over-written the other. For many operations darcs
> doesn't need the patch contents -- that's why partial repos work
> -- so if you're lucky darcs have never used the "wrong" patch
> contents, in which case all of the other patches are ok.
... this is easier to say then to do... I've tried, but I always end up
with either a missing patch or a corrupted inventory...
let's see if I understand the problem correctly. The initial cvs
repository is kosher, then when I run tailor, because of some unknown
reason, it commits the same patch twice in a split of a second, and as
result darcs build two indetical hash. At this point, darcs is confused
and I get my nasty problem.
As far as I understand we've two problems. On one hand tailor does these
two identical commits (why ?) and on the other hand, darcs is no able to
build two different hash to get out of trouble...
More then fixing my repo (I'm sure I can find a way with enough
time...), I'd like to understand if this problem can be fixed once for
all... Is there a bug open about this (either against darcs or tailor) ?
thanks :)
p
>
> If the patch is named 'init' and you do
>
> cd _darcs/patches
> zgrep -A1 '^\[init$' *.gz
>
> you will find only one match with the right date and author, but
> there should be two, one for each of the patches.
>
> You can use 'darcs record --ask-deps --pipe' and cut'n'paste the
> date and author from the output of above command, but choose a
> different name (or use the same name but choose a different
> date), to construct an empty patch with a new (different) hash.
> Then remove the new patch entry from the inventory (but save it
> in the editor's cut buffer), and replace one of the two
> identical old entries (the hard part is to pick the "missing"
> one) with the new entry (from the cut buffer). The inventory may
> have been split into many files in _darcs/inventories/*.gz, but
> the top inventory file _darcs/inventory will always contain the
> new entry (the one to remove) at the end. There, now you only
> have to put the missing contents into the new patch file. I
> don't know how to do that. You'll have to trick tailor or
> something to output the patch file but not over-write it, and
> cut'n'paste everything but the two top lines (with the modified
> name, author and date).
>
> A 'darcs check --complete' will tell if it failed, and if it
> didn't fail there's a good chance the repo is ok. Thing's that
> will _not_ be ok is if you have used --ask-deps to depend on the
> patch you replaced (likely not if it's the init patch), but you
> can fix that by doing the same replace as the patch entries in
> the inventory, but this time also replace the depend references.
> Old checkpoints might also become invalid, but I'm not sure of
> that.
>
> All existing branches and copies of the repo will no longer work
> with the fixed one!
>
>
> --
> Tommy Pettersson <ptp at lysator.liu.se>
> _______________________________________________
> darcs-users mailing list
> darcs-users at darcs.net
> http://lists.osuosl.org/mailman/listinfo/darcs-users
--
++ Blog: http://blog.rsise.anu.edu.au/?q=pietro
++
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
More information about the darcs-users
mailing list