132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
db_static_prepare(&addLeaf, "INSERT OR IGNORE INTO leaf VALUES(:rid)");
db_bind_int(&addLeaf, ":rid", rid);
db_step(&addLeaf);
db_reset(&addLeaf);
}
}
/*
** Check for a fork against rid and set g.fForkSeen
*/
void fork_check(int rid){
if( is_a_leaf(rid) && fossil_find_nearest_fork(rid, 0) ){
g.forkSeen = 1;
}
}
/*
** Return an SQL expression (stored in memory obtained from fossil_malloc())
** that is true if the SQL variable named "zVar" contains the rid with
** a CLOSED tag. In other words, return true if the leaf is closed.
**
** The result can be prefaced with a NOT operator to get all leaves that
** are open.
|
<
<
<
<
<
<
<
<
<
|
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
db_static_prepare(&addLeaf, "INSERT OR IGNORE INTO leaf VALUES(:rid)");
db_bind_int(&addLeaf, ":rid", rid);
db_step(&addLeaf);
db_reset(&addLeaf);
}
}
/*
** Return an SQL expression (stored in memory obtained from fossil_malloc())
** that is true if the SQL variable named "zVar" contains the rid with
** a CLOSED tag. In other words, return true if the leaf is closed.
**
** The result can be prefaced with a NOT operator to get all leaves that
** are open.
|
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
while( db_step(&parentsOf)==SQLITE_ROW ){
bag_insert(&needToCheck, db_column_int(&parentsOf, 0));
}
db_reset(&parentsOf);
}
/*
** Do all pending leaf and fork checks.
*/
void leaf_do_pending_checks(void){
int rid;
for(rid=bag_first(&needToCheck); rid; rid=bag_next(&needToCheck,rid)){
leaf_check(rid);
}
for(rid=bag_first(&needToCheck); rid; rid=bag_next(&needToCheck,rid)){
fork_check(rid);
}
bag_clear(&needToCheck);
}
|
|
<
<
<
|
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
while( db_step(&parentsOf)==SQLITE_ROW ){
bag_insert(&needToCheck, db_column_int(&parentsOf, 0));
}
db_reset(&parentsOf);
}
/*
** Do all pending leaf checks.
*/
void leaf_do_pending_checks(void){
int rid;
for(rid=bag_first(&needToCheck); rid; rid=bag_next(&needToCheck,rid)){
leaf_check(rid);
}
bag_clear(&needToCheck);
}
|