[darcs-users] darcs unapply
jwlato at gmail.com
Mon Mar 26 13:24:55 UTC 2012
On Mon, Mar 26, 2012 at 1:26 PM, Owen Stephens <darcs at owenstephens.co.uk> wrote:
> On 26 March 2012 13:16, John Lato <jwlato at gmail.com> wrote:
>> I find that I often want a command that performs an "unapply" -
>> patches are unapplied from the working copy but remain in the local
>> repository. Presently I usually get this behavior by either doing
>> "darcs obliterate" followed by "darcs pull", or "darcs send -o
>> somepatches" then "darcs apply somepatches". Obviously this is
>> non-optimal, as I need to check beforehand whether the patch exists
>> elsewhere or not.
> You can skip some steps in your workflow, by using the -o option of
> (I've just tested this on a small repo locally):
> darcs obliterate -o removed_patches.dpatch
> "hack, hack, hack."
> darcs apply removed_patches.dpatch
Thanks for this; I didn't know that obliterate would take a -o option.
The resulting workflow is about what I had hoped for.
>> Is there a command that does this already? If not, would others find
>> it useful? It seems like it'd be simple to add.
> I'm not sure that this work around is the optimal aproach, it might be nice
> darcs could somehow help to manage the "unapplied" patches for you (though
> cautious to suggest it should maintain a list of disabled patches)
For what I had in mind, the unapplied patches wouldn't need any
management. If the hacks work out, then "darcs record" would
automatically Do The Right Thing. To abandon any changes and apply
the "unapplied" patches, just do a "darcs revert". At least for my
workflow, I'd never want to use unapply to work on multiple changes in
the same repo.
As I see it, the drawbacks of the workaround you present are that it
takes more typing, the .dpatch file needs to be cleaned up, and
there's still a danger of mistyping something and obliterating (or at
least misplacing) patches you want to keep. But it's still better
than what I'm doing now, and darcs is smart enough that "darcs
obliterate -o /dev/null" doesn't actually remove anything.
More information about the darcs-users