[darcs-users] some special amend-records
Ganesh Sittampalam
ganesh at earth.li
Fri Mar 22 07:40:32 UTC 2013
Hi Piyush,
On 22/03/2013 07:02, Piyush P Kurur wrote:
> I have this one question on amend-record:
>
> Say we have a repository with patches p0 p1 p2 p3 p4. Then I realised
> that some thing is missing in p2 say. If p3 and p4 commutes with p2
> then I could use ammend-record. However, I think there are natural
> use cases where actually p3 and p4 might not be commutable with p2 and
> one could like to safely ammend p2.
>
> Use case 1: I missed adding a new file when I recorded p2.
>
> As I understand it, if p denotes the diff between the recorded version
> and the working tree and if p commuted with both p3 and p4 (i.e. p3 p4
> p can be commuted to p' p3' p4') then I should be allowed to ammend
> p2. The resulting repository would be p0 p1 p2' p3' p4'.
>
> (1) Is there some flaw that I overlooked ?
Nope - your analysis is correct.
> (2) Is there a way of achieving this in darcs 2.8.1 ?
Unfortunately no.
> (3) Is this feature implied by any other work in progress?
'darcs rebase' will support this and will be in the upcoming 2.10
release - hopefully within the next few months. In the meantime you can
install it from the development repo at http://darcs.net
The workflow would be:
darcs rebase suspend
< select p3 and p4 >
darcs amend-record
< select p2 and add the file as required >
darcs rebase unsuspend
< select p3 and p4 >
Note that the patch identity of p3 and p4 will be changed along with p2,
so any repositories already containing p2, p3 and p4 will see the new
patches as different.
In your scenario the amendment to p commutes with p3 and p4 so there
won't be any conflicts. If it didn't commute, then you would have to
resolve conflicts when unsuspending p3 and p4.
Cheers,
Ganesh
More information about the darcs-users
mailing list