Attached is a patch that implements apply --mirror, including a small
test script. This is WIP as there is no warning yet, and no way to
interactively select the patches to obliterate.
It occurred to me that this idea could be generalized to provide user-
selectable merge strategies. Given a set of patches to apply (them) and
an existing set (us), with all common patches already removed, we could
offer:
- default: standard merge, possibly resulting in conflicts,
details depend on --mark-conflicts/--allow-conflicts/...
- mirror: replace us with them (this one)
- remove-conflicting: remove only our conflicting patches
- suspend: suspend all our existing patches
- suspend-conflicting: suspend (only) our conflicting patches
- skip-conflicting: add only their non-conflicting patches
The versions wich suspend or remove existing patches in the target repo
could support interactive selection, possibly resulting in a "mixed
mode" strategy, where we first obliterate or suspend the selected
patches and then fall back to the default merge for the rest.
Attachments
|