# # # patch "src/model/InventoryWatcher.cpp" # from [36ceae753d121333f961f026058f5111eac60a30] # to [5e16d1a0ed098f6450fa5e6bbd3496a3e2d740d8] # ============================================================ --- src/model/InventoryWatcher.cpp 36ceae753d121333f961f026058f5111eac60a30 +++ src/model/InventoryWatcher.cpp 5e16d1a0ed098f6450fa5e6bbd3496a3e2d740d8 @@ -166,18 +166,18 @@ void InventoryWatcher::markPathForNotifi } else { - enum { skip, replace, add } action; + enum { skip, replace, add } action = add; - action = add; foreach (QString oldPath, changedPaths) { - if (newPath.startsWith(oldPath + "/") || + if (newPath.startsWith(oldPath) || newPath == oldPath || oldPath == "") { action = skip; break; } - if (oldPath.startsWith(newPath + "/")) + + if (oldPath.startsWith(newPath)) { action = replace; } @@ -193,7 +193,7 @@ void InventoryWatcher::markPathForNotifi { foreach (QString oldPath, changedPaths) { - if (!oldPath.startsWith(newPath + "/")) + if (!oldPath.startsWith(newPath)) { actualNotifiedPaths.append(oldPath); } @@ -264,7 +264,17 @@ void InventoryWatcher::checkForBookkeepC } bool foundOrAlreadyHandled = false; + enum { unknown, file, dir } type = unknown; + // Unfortunately monotone's revision format doesn't record the node type + // so we can only derive type info from add_dir or add_file, but + // unfortunately not for deleted nodes or attribute changes. + // In this case this code only works as long as the file is still + // still present in the file system so we can manually query its type. + + type = newEntryType == "add_dir" ? dir : + newEntryType == "add_file" ? file : unknown; + for (int i=0; i