Fossil SCM
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.
Commit
7847b418bb514bd8f63784aeddcb1647693ef045
Parent
9cbef7a104e5d61…
1 file changed
+15
-2
+15
-2
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -79,12 +79,25 @@ | ||
| 79 | 79 | /* Initialize the bags. */ |
| 80 | 80 | bag_init(&seen); |
| 81 | 81 | bag_init(&pending); |
| 82 | 82 | bag_insert(&pending, iBase); |
| 83 | 83 | |
| 84 | - /* This query returns all non-merge children of check-in :rid */ | |
| 85 | - db_prepare(&q1, "SELECT cid FROM plink WHERE pid=:rid AND isprim"); | |
| 84 | + /* This query returns all non-branch-merge children of check-in :rid. | |
| 85 | + ** | |
| 86 | + ** If a a child is a merge of a fork within the same branch, it is | |
| 87 | + ** returned. Only merge children in different branches are excluded. | |
| 88 | + */ | |
| 89 | + db_prepare(&q1, | |
| 90 | + "SELECT cid FROM plink" | |
| 91 | + " WHERE pid=:rid" | |
| 92 | + " AND (isprim" | |
| 93 | + " OR coalesce((SELECT value FROM tagxref" | |
| 94 | + " WHERE tagid=%d AND rid=plink.pid), 'trunk')" | |
| 95 | + "=coalesce((SELECT value FROM tagxref" | |
| 96 | + " WHERE tagid=%d AND rid=plink.cid), 'trunk'))", | |
| 97 | + TAG_BRANCH, TAG_BRANCH | |
| 98 | + ); | |
| 86 | 99 | |
| 87 | 100 | /* This query returns a single row if check-in :rid is the first |
| 88 | 101 | ** check-in of a new branch. |
| 89 | 102 | */ |
| 90 | 103 | db_prepare(&isBr, |
| 91 | 104 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -79,12 +79,25 @@ | |
| 79 | /* Initialize the bags. */ |
| 80 | bag_init(&seen); |
| 81 | bag_init(&pending); |
| 82 | bag_insert(&pending, iBase); |
| 83 | |
| 84 | /* This query returns all non-merge children of check-in :rid */ |
| 85 | db_prepare(&q1, "SELECT cid FROM plink WHERE pid=:rid AND isprim"); |
| 86 | |
| 87 | /* This query returns a single row if check-in :rid is the first |
| 88 | ** check-in of a new branch. |
| 89 | */ |
| 90 | db_prepare(&isBr, |
| 91 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -79,12 +79,25 @@ | |
| 79 | /* Initialize the bags. */ |
| 80 | bag_init(&seen); |
| 81 | bag_init(&pending); |
| 82 | bag_insert(&pending, iBase); |
| 83 | |
| 84 | /* This query returns all non-branch-merge children of check-in :rid. |
| 85 | ** |
| 86 | ** If a a child is a merge of a fork within the same branch, it is |
| 87 | ** returned. Only merge children in different branches are excluded. |
| 88 | */ |
| 89 | db_prepare(&q1, |
| 90 | "SELECT cid FROM plink" |
| 91 | " WHERE pid=:rid" |
| 92 | " AND (isprim" |
| 93 | " OR coalesce((SELECT value FROM tagxref" |
| 94 | " WHERE tagid=%d AND rid=plink.pid), 'trunk')" |
| 95 | "=coalesce((SELECT value FROM tagxref" |
| 96 | " WHERE tagid=%d AND rid=plink.cid), 'trunk'))", |
| 97 | TAG_BRANCH, TAG_BRANCH |
| 98 | ); |
| 99 | |
| 100 | /* This query returns a single row if check-in :rid is the first |
| 101 | ** check-in of a new branch. |
| 102 | */ |
| 103 | db_prepare(&isBr, |
| 104 |