[darcs-users] Whatsnew on a rolled back repo

Ben Franksen ben.franksen at online.de
Sat Nov 8 23:54:45 UTC 2014


Gian Piero Carrubba wrote:

> * [Mon, Aug 25, 2014 at 04:57:44PM -0300] Guillaume Hoffmann:
>>> status, so I need a way for displaying the changes in the working dir
>>> other than the ones generated by the rollback command.
> [...]
>>
>>Another option would be to clone your repository R1 into another one
>>R2, run rollback of the same function in R2, record a patch P1, then
>>copy the working copy of R1 into R2 and record a patch P2. If P1 and
>>P2 commute, you can pull P1 it back into R1 (after reverting
>>everything there).
> 
> Thank you, Guillame. I like this solution as it is mostly scriptable.
> 
> (pseudo-shell script)
> darcs clone R S
> if test -n "$hash"
> then
>   darcs rollback --repo S --match "hash $hash"
> else
>   darcs rollback --repo S # manually select the patch
> fi
> darcs record --repo S -am P1
> copy working dir
> darcs record --repo S -lam P2
> darcs push --repo S -a R
> 
> At this point, if we know if P1 and P2 commute, we could do:
> 
> if commute P1 P2
> then
>   darcs obliterate --repo R -p P1
> else
>   cd R  # darcs rebase does not accept --repo. Is it a bug ?
>   darcs rebase suspend -p P1 -a
>   darcs rebase obliterate -p P1
>   darcs rebase unsuspend -p P2 -a
>   ... (manually resolve conflicts)
>   darcs amend -p P2 -a
> fi
> 
> Now the question is: there is a simple non-interactive way for knowing
> if two patches commute ?

Unfortunately I know of no way to do this in darcs as it stands, except by 
the obvious and tedious way (pulling/pushing between repos). I think it 
would a very good addition have a command that would answer "low level" 
questions such as this one but I don't have a design ready and cannot say 
how difficult it would be to implement.

Cheers
Ben
-- 
"Make it so they have to reboot after every typo." -- Scott Adams




More information about the darcs-users mailing list