Diff
Not logged in

Differences From:

File src/descendants.c part of check-in [472f9411ee] - Add the "hyperlinks are disabled" warning to the taglist page. Disable hyperlinks on the leaves page when hyperlinks are suppose to be disabled. by drh on 2009-01-29 03:04:38. [view]

To:

File src/descendants.c part of check-in [7847b418bb] - Improvements to the way the update target is computed when saying "fossil update" without specifying what to update to. Avoid the "bad object id: 0" error. by drh on 2009-08-14 14:00:10. [view]

@@ -80,10 +80,23 @@
   bag_init(&seen);
   bag_init(&pending);
   bag_insert(&pending, iBase);
 
-  /* This query returns all non-merge children of check-in :rid */
-  db_prepare(&q1, "SELECT cid FROM plink WHERE pid=:rid AND isprim");
+  /* This query returns all non-branch-merge children of check-in :rid.
+  **
+  ** If a a child is a merge of a fork within the same branch, it is
+  ** returned.  Only merge children in different branches are excluded.
+  */
+  db_prepare(&q1,
+    "SELECT cid FROM plink"
+    " WHERE pid=:rid"
+    "   AND (isprim"
+    "        OR coalesce((SELECT value FROM tagxref"
+                      "   WHERE tagid=%d AND rid=plink.pid), 'trunk')"
+               "=coalesce((SELECT value FROM tagxref"
+                      "   WHERE tagid=%d AND rid=plink.cid), 'trunk'))",
+    TAG_BRANCH, TAG_BRANCH
+  );
 
   /* This query returns a single row if check-in :rid is the first
   ** check-in of a new branch.
   */