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.

drh 2009-08-14 14:00 trunk
Commit 7847b418bb514bd8f63784aeddcb1647693ef045
1 file changed +15 -2
--- src/descendants.c
+++ src/descendants.c
@@ -79,12 +79,25 @@
7979
/* Initialize the bags. */
8080
bag_init(&seen);
8181
bag_init(&pending);
8282
bag_insert(&pending, iBase);
8383
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
+ );
8699
87100
/* This query returns a single row if check-in :rid is the first
88101
** check-in of a new branch.
89102
*/
90103
db_prepare(&isBr,
91104
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button