Benedikt Schmidt wrote:
> Lexington Luthor <[EMAIL PROTECTED]> writes:
>> Basically, when I am making changes to code (new feature), I might
>> also make other changes near it which are unrelated (minor
>> bug-fix). When it comes time to record darcs will (correctly) generate
>> a diff containing both changes in a single hunk, and I have to
>> manually edit the file to undo one of the changes, record it, and redo
>> the changes and record the second change.
> 
> There have been some requests for "edit file" in darcs record before, do
> you think something like this would work in this case:
> 
> 1. darcs shows a hunk for Foo.hs, the user presses "e"
> 
> 2. darcs opens an editor with a temporary copy of the file (evt. with
>    markers for the hunk). You can do some changes, save the file and
>    exit the editor
> 
> 3. darcs recalculates the diff for this file (all other hunk choices for
>    this file are invalidated, of course darcs could try to be more clever
>    in this case, but i'm not sure if it's worth it since the new diff
>    could be completely different from the old one).
> 
> 4. darcs restarts the hunk selection process for Foo.hs
> 
> Since you only change a temporary file, your repo still contains both
> changes, but you only recorded one of them.

I think this is exactly the right idea. And yes, with regard to point 2,
markers for the hunk would be very useful to quickly find the problematic
spots. Markup in the temporary file could be similar to the stuff added
when writing a 'long comment'.

Ben


_______________________________________________
darcs-users mailing list
[email protected]
http://www.abridgegame.org/mailman/listinfo/darcs-users

Reply via email to