Changeset 1694 in josm


Ignore:
Timestamp:
2009-06-24T22:07:18+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #2769: Download members is broken

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java

    r1692 r1694  
    66import java.util.Collection;
    77import java.util.HashMap;
    8 import java.util.Iterator;
    98import java.util.LinkedList;
    109import java.util.Map;
     
    103102                return;
    104103        } else {
    105             // try to merge onto a primitive with which has no id assigned
     104            // try to merge onto a primitive which has no id assigned
    106105            // yet but which is equal in its semantic attributes
    107106            //
     
    235234                    //
    236235                    conflicts.put(my,other);
     236                } else if (my.incomplete) {
     237                    // my is incomplete, other completes it
     238                    // => merge other onto my
     239                    //
     240                    my.incomplete = false;
     241                    my.cloneFrom(other);
     242                    merged.put(other, my);
     243                } else if (my.deleted != other.deleted) {
     244                    // differences in deleted state have to be resolved manually
     245                    //
     246                    conflicts.put(my,other);
    237247                } else if (! my.modified && other.modified) {
    238248                    // my not modified. We can assume that other is the most recent version.
     
    245255                    my.cloneFrom(other);
    246256                    merged.put(other, my);
    247                 } else if (! my.modified && !other.modified) {
     257                } else if (! my.modified && !other.modified && my.version == other.version) {
    248258                    // both not modified. Keep mine
    249259                    //
     260                    merged.put(other,my);
     261                } else if (! my.modified && !other.modified && my.version < other.version) {
     262                    // my not modified but other is newer. clone other onto mine.
     263                    //
     264                    my.cloneFrom(other);
    250265                    merged.put(other,my);
    251266                } else if (my.modified && ! other.modified && my.version == other.version) {
     
    253268                    // => keep mine
    254269                    merged.put(other, my);
    255                 } else if (my.deleted != other.deleted) {
    256                     // if we get here my is modified. Differences in deleted state
    257                     // have to be resolved manually
    258                     //
    259                     conflicts.put(my,other);
    260270                } else if (! my.hasEqualSemanticAttributes(other)) {
    261271                    // my is modified and is not semantically equal with other. Can't automatically
Note: See TracChangeset for help on using the changeset viewer.