On Mon, Nov 10, 2008 at 3:59 AM, Miklos Vajna <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have two repos, the other has for example 5 new patches for the other
> one, and I want to write a script that creates a darcs patch for a given
> patch only.
>
> Here is what I did for the darcs1 format:
>
> "New patches:\n", then append _darcs/patches/hash, finally finish the
> file with "darcs changes --context".
>
> The hashed format makes the second step a bit more problematic. Is it
> still possible to do this?

If I understand your script correctly it constructs the patch bundle
itself from the patches in the repository.  If you don't send the
patch that is on the top, eg., darcs changes --last=1, then I think
maybe you are taking a serious risk of corrupting your repositories.

Granted, this may work if in darcs apply it is smart enough to see
where the patch is located in the context and do the appropriate
commutations, but I don't know without investigating the code
carefully.

It seems like the safer approach is to use darcs send and specify
exactly which patch you want to send.

Something like, darcs send --matches='hash 12345' -o mybundle.dpatch

Now, sometimes that will want to send more than one patch, and I'm not
sure how you'll want to handle that in your script.

> Yes, I know that I could just use darcs send and select the patch
> interactively, but my question is about how to do this from a script.

You can also do it non-interactively.  If you need examples we could
discuss how on the list or you could look in the tests subdirectory of
the darcs source to see examples that automate send from bash scripts.
 I can't tell for sure if your script is safe or not, but it seems
like an avoidable risk :)

Good luck!
Jason
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to