Hi! What I want to do ===================== I'm trying to sort out the different tree conflict scenarios for a possible tree conflict resolver as described in #3144 [1].
As a first step I'm looking at conflicts on files when using update. I have attached a script for testing. Run './utc.sh list' for info on how to use it. I've used the classification described in notes/tree-conflicts/resolution.txt and compared it with all the possible tree conflict scenarios as outlined in stsp:s thesis [2] on tree conflicts. There is four classes of conflicts. I describe some example of use cases for each taken from notes/tree-conflicts/resolution.txt and then present how I tried to resolve each of the concrete tree conflict scenarios in the attached shell script. Questions ========== Is there a better approach than these four classes presented below? Is there a better way of handling conflicts for any of the concrete scenarios? 1. Locale add, incoming add ========================= Some use cases: - I have already applied the patch - their item is identical to mine. -> want to do it just once -> THEIRS. - Two different new items happened to be given the same name. -> accept theirs & rename mine -> RENAME-MINE. - I was doing roughly the same thing but the item is a bit different. -> merge the two items -> manual 2-way merge (or 3-way if both are w/hist and it's the same copy-from source) -> MERGE. ### If we have atomic moves then there's no need for an explicit ### MERGE, right? It would automatically be merged. cp-add ------------- alpha has been locally copied to eta, incoming add eta Options: THEIRS:1) svn revert eta 2) rm eta 3) svn up eta MINE: 1) svn resolved eta RENAME-MINE: 1) svn revert eta 2) rm eta 3) svn cp alpha alpha2 4) svn up eta MERGE: Can't be done at the moment. mv-add ------------- alpha has been locally moved to eta, incoming add eta Options: THEIRS: 1) svn mv eta alpha 2) svn revert eta 3) svn up eta MINE: 1) svn resolved eta RENAME-MINE: 1) svn mv eta alpha 2) svn mv alpha alpha2 3) svn revert eta 4) svn up eta MERGE: Can't be done at the moment. cp-mv ----------- alpha has been locally copied to alpha2, incoming mv alpha to alpha2. Options: THEIRS: 1) svn revert alpha2 2) rm alpha2 3) svn up alpha2 MINE: 1) svn resolved alpha2 RENAME-MINE: 1) svn revert alpha2 2) svn cp alpha alpha3 3) rm alpha2 4) svn up alpha2 MERGE: Can't be done at the moment. 2. Locale del, incoming del ========================= Some use cases: - Already applied the patch -> want to do it just once -> THEIRS. - Renamed to two different names -> want to undo Their renaming and make it like Mine, as if we had a "Choose Mine" option that worked on whole rename operations. -> RENAME. del-mv -------------- alpha has been locally deleted, incoming mv alpha to alpha2. Options: THEIRS: 1) svn resolved alpha MINE: 1) svn resolved alpha RENAME: No need mv-del -------------- alpha has been locally moved to alpha2, incoming rm alpha. Options: THEIRS: 1) svn mv alpha2 alpha 2) svn rm --force alpha (if not used '? alpha' will remain) 3) svn resolved alpha MINE: 1) svn resolved alpha RENAME: No need mv-mv ----------- alpha has been locally moved to alpha3, incoming mv alpha to alpha2. Options: THEIRS: 1) svn di -r BASE:PREV 2) svn rm --force alpha3 3) svn resolved alpha MINE: 1) svn rm --force alpha2 2) svn resolved alpha RENAME: 3. Locale del, incoming edit ========================== Some use cases: - Locally renamed -> want to apply the incoming mod to a different item -> ELSEWHERE. del-edit ----------------- alpha has been locally deleted, incoming edit on alpha. Options: THEIRS: 1) svn revert alpha MINE: 1) svn resolved alpha ELSEWHERE: Not an option here. mv-edit ------------- alpha has been locally moved to alpha2, incoming edit on alpha. Options: THEIRS: 1) svn mv alpha2 alpha 2) svn revert alpha MINE: 1) svn resolved alpha ELSEWHERE: 1) svn merge ^/trunk/alpha alpha2 2) svn resolved alpha 4. Locale edit, incoming del ============================= Some use cases: - The incoming change is (part of) a rename -> want to transfer my local mod to the renamed item -> MOVE-MY-MODS. edit-del ---------------- alpha has been locally modified, incoming delete on alpha. Options: THEIRS: 1) svn rm --force alpha 2) svn resolved alpha MINE: 1) svn resolved alpha MOVE-MY-MODS: Not an option here. edit-mv -------------- alpha has been locally modified, incoming mv alpha to alpha2. ### If the incoming change had text modifications then we'd have to ### merge? Options: THEIRS: MINE: 1) svn revert alpha2 2) svn resolved alpha MOVE-MY-MODS: 1) svn revert alpha 2) rm alpha /Daniel [1] http://subversion.tigris.org/issues/show_bug.cgi?id=3144 [2] https://www.inf.fu-berlin.de/w/SE/ThesisTreeConflicts
utc.sh
Description: Bourne shell script