s4:registry - "patchfile" - add comments
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Mon, 22 Mar 2010 10:45:20 +0000 (11:45 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Mon, 22 Mar 2010 11:26:29 +0000 (12:26 +0100)
Helps to understand when we need to generate the hive diffs.

source4/lib/registry/patchfile.c

index 6b08cf8948110acbd050009e9be23b723fe49b84..0da722bb6dda027091f13f3878a54b5448ea6f78 100644 (file)
@@ -280,10 +280,16 @@ _PUBLIC_ WERROR reg_generate_diff(struct registry_context *ctx1,
                        continue;
                }
 
+               /* if "r1" is NULL (old hive) and "r2" isn't (new hive) then
+                * the hive doesn't exist yet and we have to generate an add
+                * diff */
                if ((r1 == NULL) && (r2 != NULL)) {
                        callbacks->add_key(callback_data,
                                           reg_predefined_keys[i].name);
                }
+               /* if "r1" isn't NULL (old hive) and "r2" is (new hive) then
+                * the hive shouldn't exist anymore and we have to generate a
+                * del diff */
                if ((r1 != NULL) && (r2 == NULL)) {
                        callbacks->del_key(callback_data,
                                           reg_predefined_keys[i].name);