The Terminal Programmer

Darcs 2 enhances amend-record

Suraj N. Kurapati

    Version 2 of Darcs, the feel good distributed version control system was released recently. This version includes a new feature that I long awaited for, and almost invented my own version control system for:

    The main lesson regarding these new semantics is that patches depends on primitive patches, not on named patches. A named patch is really just a set of primitive patches.

    To better understand this feature, consider this example:

    1. Patch X modifies files A, B, and C.
    2. Patch Y modifies files A and C.
    3. You modify file B and want to amend patch X.

    Darcs 2 allows this (hurray!) whereas Darcs 1 does not. As a result, you had to go through a fair bit of manual labor to achieve the same effect in Darcs 1:

    1. Create a temporary branch.
    2. Unrecord patch Y.
    3. Amend patch X.
    4. Push the new patch X.
    5. Recreate patch Y.
    6. Finally, push patch Y.