[darcs-devel] get_long_option (was: Greetings..)

Tommy Pettersson ptp at lysator.liu.se
Sat Oct 7 06:14:53 PDT 2006


On Thu, Oct 05, 2006 at 11:04:00PM -0400, Dino Morelli wrote:
> A couple of days ago on IRC, kowey suggested that I could perhaps
> think about issue161, that people really want it done. But this kind of
> sounds like stuff that Tommy posted about on darcs-users today regarding
> amend-record:
> 
>    Subject: Re: [darcs-users] Re: change patch summary
> 
>    ...
> 
>    I think darcs could be made to do this automatically, so you
>    could amend-record a depended upon patch, with the "side effect"
>    that all depending patches also change (as they must do). But it
>    could be complicated to implement...
> 
> 
> If that's what 161 is, I don't think I'm even remotely up for it yet
> without learning how a lot of things work first. Sorry, Eric, but sounds
> scary.

Issue161 is not so difficult. The dialogue in Amend-record won't
let you choose a depended upon patch (so far, and perhaps wont
in the future either, I've just proposed that it could...). The
chosen patch can be read, modified and written back again,
without worries. Well, a more detailed procedure would go
something like: read patch, modify patch, write patch (gets a
new hash name), remove old patch from inventory, add new patch
to inventory, apply changes to pristine, fix up things like
pending and unrevert. And the exact procedure involves highly
abstract functions that operate on entire file trees and repos.
This is already done, where the "modify" part is an interactive
dialogue to add more changes to the patch. It has to be extended
with questions about new name and long comment. It would really
be sufficient to just allow editing the long comment, since it
contains the patch name, but in some way it is more elegant to
not invoke an external editor just asking for a new patch name.

I think the hard part will be to understand how the higher level
functions operate on the repo, or at least it used to be (for
me). The unstable branch contains David's new refactoring of
these functions, and I think it will make it much simpler.
*looking at the code* Yes, it is!

A quick and dirty way would be to past some code from Record.lhs
at the right place in AmendRecord.lhs. A more elegant way is
maybe to extract some common stuff from Record and AmendRecord
into a separate module they both can use, but I don't know how
useful this really would be.


-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-devel mailing list