Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Change the way branches are tagged: The value of the "branch" property is used to identify the branch name. Repository rebuild required. Also, branches must be retagged. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
42c2a18e736b0cc75a93daa63a7afb6c |
| User & Date: | drh 2009-01-22 12:03:51.000 |
Context
|
2009-01-22
| ||
| 13:08 | Reenable the "Tags" menu item, but make it go to the new "taglist" page. Also add separate "tagtimeline" page and separate "brlist" into "brlist" and "brtimeline". check-in: a12cb216b7 user: drh tags: trunk | |
| 12:03 | Change the way branches are tagged: The value of the "branch" property is used to identify the branch name. Repository rebuild required. Also, branches must be retagged. check-in: 42c2a18e73 user: drh tags: trunk | |
| 01:53 | Define a "leaf" as a check-in with no children in the same branch. The is_a_leaf() function does some complicated SQL to figure this out. check-in: faf09dc7ae user: drh tags: trunk | |
Changes
Changes to src/branch.c.
| ︙ | ︙ | |||
103 104 105 106 107 108 109 |
}
}
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rootid);
blob_appendf(&branch, "P %s\n", zUuid);
blob_appendf(&branch, "R %s\n", mParent.zRepoCksum);
manifest_clear(&mParent);
| | | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
}
}
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rootid);
blob_appendf(&branch, "P %s\n", zUuid);
blob_appendf(&branch, "R %s\n", mParent.zRepoCksum);
manifest_clear(&mParent);
/* Add the symbolic branch name and the "branch" tag to identify
** this as a new branch */
if( zColor!=0 ){
blob_appendf(&branch, "T *bgcolor * %F\n", zColor);
}
blob_appendf(&branch, "T *branch * %F\n", zBranch);
blob_appendf(&branch, "T *sym-%F *\n", zBranch);
/* Cancel all other symbolic tags */
db_prepare(&q,
"SELECT tagname FROM tagxref, tag"
" WHERE tagxref.rid=%d AND tagxref.tagid=tag.tagid"
" AND tagtype>0 AND tagname GLOB 'sym-*'"
" ORDER BY tagname",
|
| ︙ | ︙ | |||
199 200 201 202 203 204 205 |
if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
branch_new();
}else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
Stmt q;
db_prepare(&q,
"%s"
" AND blob.rid IN (SELECT rid FROM tagxref"
| | | | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){
branch_new();
}else if( n>=2 && strncmp(g.argv[2],"list",n)==0 ){
Stmt q;
db_prepare(&q,
"%s"
" AND blob.rid IN (SELECT rid FROM tagxref"
" WHERE tagid=%d AND tagtype==2 AND srcid!=0)"
" ORDER BY event.mtime DESC",
timeline_query_for_tty(), TAG_BRANCH
);
print_timeline(&q, 2000);
db_finalize(&q);
}else{
fossil_panic("branch subcommand should be one of: "
"new list");
}
|
| ︙ | ︙ | |||
248 249 250 251 252 253 254 |
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
style_header("Branches");
login_anonymous_available();
@ <h2>The initial check-in for each branch:</h2>
db_prepare(&q,
| | > | | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
login_check_credentials();
if( !g.okRead ){ login_needed(); return; }
style_header("Branches");
login_anonymous_available();
@ <h2>The initial check-in for each branch:</h2>
db_prepare(&q,
"%s AND blob.rid IN (SELECT rid FROM tagxref"
" WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
" ORDER BY event.mtime DESC",
timeline_query_for_www(), TAG_BRANCH
);
www_print_timeline(&q, 0, brlist_extra);
db_finalize(&q);
@ <br clear="both">
@ <script>
@ function xin(id){
@ }
|
| ︙ | ︙ | |||
284 285 286 287 288 289 290 |
@ <h2>Check-ins that have one or more primary symbolic tags</h2>
db_prepare(&q,
"%s AND blob.rid IN (SELECT rid FROM tagxref"
" WHERE tagtype>1 AND srcid>0"
" AND tagid IN (SELECT tagid FROM tag "
" WHERE tagname GLOB 'sym-*'))"
" ORDER BY event.mtime DESC",
| | | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
@ <h2>Check-ins that have one or more primary symbolic tags</h2>
db_prepare(&q,
"%s AND blob.rid IN (SELECT rid FROM tagxref"
" WHERE tagtype>1 AND srcid>0"
" AND tagid IN (SELECT tagid FROM tag "
" WHERE tagname GLOB 'sym-*'))"
" ORDER BY event.mtime DESC",
timeline_query_for_www()
);
www_print_timeline(&q, 0, 0);
db_finalize(&q);
@ <br clear="both">
@ <script>
@ function xin(id){
@ }
@ function xout(id){
@ }
@ </script>
style_footer();
}
|
Changes to src/checkin.c.
| ︙ | ︙ | |||
345 346 347 348 349 350 351 |
}
g.aCommitFile[ii-2] = 0;
}
}
/*
** Return true if the check-in with RID=rid is a leaf.
| < | < < | < | | < | < < < | | < < < < < | < < < | < < < < | | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
}
g.aCommitFile[ii-2] = 0;
}
}
/*
** Return true if the check-in with RID=rid is a leaf.
** A leaf has no children in the same branch.
*/
int is_a_leaf(int rid){
int rc;
static const char zSql[] =
@ SELECT 1 FROM plink
@ WHERE pid=%d
@ AND 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')
;
rc = db_int(0, zSql, rid, TAG_BRANCH, TAG_BRANCH);
return rc==0;
}
/*
** COMMAND: ci
** COMMAND: commit
**
** Usage: %fossil commit ?-m COMMENT? ?--nosign? ?FILE...?
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
938 939 940 941 942 943 944 |
blob_appendf(&manifest, "C initial\\sempty\\scheck-in\n");
zDate = db_text(0, "SELECT datetime('now')");
zDate[10]='T';
blob_appendf(&manifest, "D %s\n", zDate);
blob_appendf(&manifest, "P\n");
md5sum_init();
blob_appendf(&manifest, "R %s\n", md5sum_finish(0));
| | | | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 |
blob_appendf(&manifest, "C initial\\sempty\\scheck-in\n");
zDate = db_text(0, "SELECT datetime('now')");
zDate[10]='T';
blob_appendf(&manifest, "D %s\n", zDate);
blob_appendf(&manifest, "P\n");
md5sum_init();
blob_appendf(&manifest, "R %s\n", md5sum_finish(0));
blob_appendf(&manifest, "T *branch * trunk\n");
blob_appendf(&manifest, "T *sym-trunk *\n");
blob_appendf(&manifest, "U %F\n", g.zLogin);
md5sum_blob(&manifest, &hash);
blob_appendf(&manifest, "Z %b\n", &hash);
blob_reset(&hash);
rid = content_put(&manifest, 0, 0);
manifest_crosslink(rid, &manifest);
}
|
| ︙ | ︙ |
Changes to src/descendants.c.
| ︙ | ︙ | |||
31 32 33 34 35 36 37 | /* ** Create a temporary table named "leaves" if it does not ** already exist. Load this table with the RID of all ** check-ins that are leaves which are decended from ** check-in iBase. ** | | < < < < < < < < < < | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | /* ** Create a temporary table named "leaves" if it does not ** already exist. Load this table with the RID of all ** check-ins that are leaves which are decended from ** check-in iBase. ** ** A "leaf" is a check-in that has no children in the same branch. ** ** The closeMode flag determines behavior associated with the "closed" ** tag: ** ** closeMode==0 Show all leaves regardless of the "closed" tag. ** ** closeMode==1 Show only leaves without the "closed" tag. |
| ︙ | ︙ | |||
91 92 93 94 95 96 97 | 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 a single row if check-in :rid is the first | | < | > > | | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
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 a single row if check-in :rid is the first
** check-in of a new branch.
*/
db_prepare(&isBr,
"SELECT 1 FROM tagxref"
" WHERE rid=:rid AND tagid=%d AND tagtype=2"
" AND srcid>0",
TAG_BRANCH
);
/* This statement inserts check-in :rid into the LEAVES table.
*/
db_prepare(&ins, "INSERT OR IGNORE INTO leaves VALUES(:rid)");
while( bag_count(&pending) ){
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
228 229 230 231 232 233 234 | } } /* ** Show information about baselines mentioned in the "leaves" table. */ | | | | > | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
}
}
/*
** Show information about baselines mentioned in the "leaves" table.
*/
static void showLeaves(int rid){
Stmt q;
int cnt = 0;
db_prepare(&q,
"SELECT blob.uuid, datetime(event.mtime, 'localtime'),"
" coalesce(event.euser, event.user),"
" coalesce(event.ecomment,event.comment)"
" FROM leaves, blob, event"
" WHERE blob.rid=leaves.rid AND blob.rid!=%d"
" AND event.objid=leaves.rid"
" ORDER BY event.mtime DESC",
rid
);
while( db_step(&q)==SQLITE_ROW ){
const char *zUuid = db_column_text(&q, 0);
const char *zDate = db_column_text(&q, 1);
const char *zUser = db_column_text(&q, 2);
const char *zCom = db_column_text(&q, 3);
cnt++;
|
| ︙ | ︙ | |||
475 476 477 478 479 480 481 |
}else{
@ %h(zName)</li>
}
}
@ </ul>
compute_leaves(rid, 0);
showDescendants(rid, 2, "Descendants");
| | | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
}else{
@ %h(zName)</li>
}
}
@ </ul>
compute_leaves(rid, 0);
showDescendants(rid, 2, "Descendants");
showLeaves(rid);
showAncestors(rid, 2, "Ancestors");
style_footer();
}
/*
** WEBPAGE: winfo
** URL: /winfo?name=RID
|
| ︙ | ︙ | |||
1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 |
int rid;
const char *zComment;
const char *zNewComment;
const char *zUser;
const char *zNewUser;
const char *zColor;
const char *zNewColor;
int fPropagateColor;
char *zUuid;
Blob comment;
static const struct SampleColors {
const char *zCName;
const char *zColor;
} aColor[] = {
{ "(none)", "" },
{ "#f2dcdc", "#f2dcdc" },
{ "#f0ffc0", "#f0ffc0" },
| > > > | 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 |
int rid;
const char *zComment;
const char *zNewComment;
const char *zUser;
const char *zNewUser;
const char *zColor;
const char *zNewColor;
const char *zNewTag;
const char *zNewBranch;
int fPropagateColor;
char *zUuid;
Blob comment;
Stmt q;
static const struct SampleColors {
const char *zCName;
const char *zColor;
} aColor[] = {
{ "(none)", "" },
{ "#f2dcdc", "#f2dcdc" },
{ "#f0ffc0", "#f0ffc0" },
|
| ︙ | ︙ | |||
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 |
{ "#c0c0c0", "#c0c0c0" },
};
int i;
login_check_credentials();
if( !g.okWrite ){ login_needed(); return; }
rid = atoi(PD("r","0"));
zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
" FROM event WHERE objid=%d", rid);
if( zComment==0 ) fossil_redirect_home();
zNewComment = PD("c",zComment);
zUser = db_text(0, "SELECT coalesce(euser,user)"
" FROM event WHERE objid=%d", rid);
if( zUser==0 ) fossil_redirect_home();
zNewUser = PD("u",zUser);
zColor = db_text("", "SELECT bgcolor"
" FROM event WHERE objid=%d", rid);
zNewColor = PD("clr",zColor);
fPropagateColor = P("pclr")!=0;
| > > > > | | | < > > < > < | > > | | > > < > | < | | > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > | > > > > > > > > > > > > > > > > > | 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 |
{ "#c0c0c0", "#c0c0c0" },
};
int i;
login_check_credentials();
if( !g.okWrite ){ login_needed(); return; }
rid = atoi(PD("r","0"));
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
zComment = db_text(0, "SELECT coalesce(ecomment,comment)"
" FROM event WHERE objid=%d", rid);
if( zComment==0 ) fossil_redirect_home();
if( P("cancel") ){
cgi_redirectf("vinfo?name=%d", rid);
}
zNewComment = PD("c",zComment);
zUser = db_text(0, "SELECT coalesce(euser,user)"
" FROM event WHERE objid=%d", rid);
if( zUser==0 ) fossil_redirect_home();
zNewUser = PD("u",zUser);
zColor = db_text("", "SELECT bgcolor"
" FROM event WHERE objid=%d", rid);
zNewColor = PD("clr",zColor);
fPropagateColor = P("pclr")!=0;
zNewTag = P("newtag")!=0 ? P("tagname") : 0;
if( zNewTag && zNewTag[0]==0 ) zNewTag = 0;
zNewBranch = P("newbr")!=0 ? P("brname") : 0;
if( zNewBranch && zNewBranch[0]==0 ) zNewBranch = 0;
if( P("apply") ){
Blob ctrl;
char *zDate;
int nChng = 0;
login_verify_csrf_secret();
blob_zero(&ctrl);
zDate = db_text(0, "SELECT datetime('now')");
zDate[10] = 'T';
blob_appendf(&ctrl, "D %s\n", zDate);
db_multi_exec("CREATE TEMP TABLE newtags(tag UNIQUE, prefix, value)");
if( zNewColor[0] && strcmp(zColor,zNewColor)!=0 ){
char *zPrefix = "+";
if( fPropagateColor ){
zPrefix = "*";
}
db_multi_exec("REPLACE INTO newtags VALUES('bgcolor',%Q,%Q)",
zPrefix, zNewColor);
}
if( zNewColor[0]==0 && zColor[0]!=0 ){
db_multi_exec("REPLACE INTO newtags VALUES('bgcolor','-',NULL)");
}
if( strcmp(zComment,zNewComment)!=0 ){
db_multi_exec("REPLACE INTO newtags VALUES('comment','+',%Q)",
zNewComment);
}
if( strcmp(zUser,zNewUser)!=0 ){
db_multi_exec("REPLACE INTO newtags VALUES('user','+',%Q)", zNewUser);
}
if( zNewTag ){
db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','+',NULL)", zNewTag);
}
if( zNewBranch ){
db_multi_exec(
"REPLACE INTO newtags "
" SELECT tagname, '-', NULL FROM tagxref, tag"
" WHERE tagxref.rid=%d AND tagtype==2"
" AND tagname GLOB 'sym-*'"
" AND tag.tagid=tagxref.tagid",
rid
);
db_multi_exec("REPLACE INTO newtags VALUES('branch','*',%Q)", zNewBranch);
db_multi_exec("REPLACE INTO newtags VALUES('sym-%q','*',NULL)",
zNewBranch);
}
db_prepare(&q, "SELECT tag, prefix, value FROM newtags"
" ORDER BY prefix || tag");
while( db_step(&q)==SQLITE_ROW ){
const char *zTag = db_column_text(&q, 0);
const char *zPrefix = db_column_text(&q, 1);
const char *zValue = db_column_text(&q, 2);
nChng++;
if( zValue ){
blob_appendf(&ctrl, "T %s%F %s %F\n", zPrefix, zTag, zUuid, zValue);
}else{
blob_appendf(&ctrl, "T %s%F %s\n", zPrefix, zTag, zUuid);
}
}
db_finalize(&q);
if( nChng>0 ){
int nrid;
Blob cksum;
blob_appendf(&ctrl, "U %F\n", g.zLogin);
md5sum_blob(&ctrl, &cksum);
blob_appendf(&ctrl, "Z %b\n", &cksum);
db_begin_transaction();
nrid = content_put(&ctrl, 0, 0);
manifest_crosslink(nrid, &ctrl);
db_end_transaction(0);
}
cgi_redirectf("vinfo?name=%d", rid);
}
blob_zero(&comment);
blob_append(&comment, zNewComment, -1);
zUuid[10] = 0;
style_header("Edit Baseline [%s]", zUuid);
if( P("preview") ){
Blob suffix;
int nTag = 0;
@ <b>Preview:</b>
@ <blockquote>
@ <table border=0>
if( zNewColor && zNewColor[0] ){
@ <tr><td bgcolor="%h(zNewColor)">
}else{
@ <tr><td>
}
wiki_convert(&comment, 0, WIKI_INLINE);
blob_zero(&suffix);
blob_appendf(&suffix, "(user: %h", zNewUser);
db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag"
" WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d"
" AND tagtype>1 AND tag.tagid=tagxref.tagid",
rid);
while( db_step(&q)==SQLITE_ROW ){
const char *zTag = db_column_text(&q, 0);
if( nTag==0 ){
blob_appendf(&suffix, ", tags: %h", zTag);
}else{
blob_appendf(&suffix, ", %h", zTag);
}
nTag++;
}
db_finalize(&q);
blob_appendf(&suffix, ")");
@ %s(blob_str(&suffix))
@ </td></tr></table>
@ </blockquote>
@ <hr>
blob_reset(&suffix);
}
@ <p>Make changes to attributes of check-in
@ [<a href="vinfo?name=%d(rid)">%s(zUuid)</a>]:</p>
@ <form action="%s(g.zBaseURL)/vedit" method="POST">
login_insert_csrf_secret();
@ <input type="hidden" name="r" value="%d(rid)">
@ <table border="0" cellspacing="10">
|
| ︙ | ︙ | |||
1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 |
@ <input type="checkbox" name="pclr" checked>
}else{
@ <input type="checkbox" name="pclr">
}
@ Propagate color to descendants</input></td></tr>
@ </table>
@ </td></tr>
@ <tr><td colspan="2">
@ <input type="submit" name="preview" value="Preview">
@ <input type="submit" name="apply" value="Apply Changes">
@ <input type="submit" name="cancel" value="Cancel">
@ </td></tr>
@ </table>
@ </form>
style_footer();
}
| > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 |
@ <input type="checkbox" name="pclr" checked>
}else{
@ <input type="checkbox" name="pclr">
}
@ Propagate color to descendants</input></td></tr>
@ </table>
@ </td></tr>
@ <tr><td align="right" valign="top"><b>Tags:</b></td>
@ <td valign="top">
@ <input type="checkbox" name="newtag">
@ Add the following new tag name to this check-in:
@ <input type="text" width="15" name="tagname">
@ </td></tr>
if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d AND tagid=%d AND srcid>0",
rid, TAG_BRANCH)==0 ){
@ <tr><td align="right" valign="top"><b>Branching:</b></td>
@ <td valign="top">
@ <input type="checkbox" name="newbr">
@ Make this check-in the start of a new branch named:
@ <input type="text" width="15" name="brname">
@ </td></tr>
}
if( is_a_leaf(rid) ){
@ <tr><td align="right" valign="top"><b>Leaf Closure:</b></td>
@ <td valign="top">
@ <input type="checkbox" name="close">
@ Mark this leaf as "closed" so that it no longer appears on the
@ "leaves" page and is no longer labeled as a "<b>Leaf</b>".
@ </td></tr>
}
@ <tr><td colspan="2">
@ <input type="submit" name="preview" value="Preview">
@ <input type="submit" name="apply" value="Apply Changes">
@ <input type="submit" name="cancel" value="Cancel">
@ </td></tr>
@ </table>
@ </form>
style_footer();
}
|
Changes to src/rebuild.c.
| ︙ | ︙ | |||
171 172 173 174 175 176 177 |
** Check to see if the the "sym-trunk" tag exists. If not, create it
** and attach it to the very first check-in.
*/
static void rebuild_tag_trunk(void){
int tagid = db_int(0, "SELECT 1 FROM tag WHERE tagname='sym-trunk'");
int rid;
char *zUuid;
| < < < < < < < < < < < | | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
** Check to see if the the "sym-trunk" tag exists. If not, create it
** and attach it to the very first check-in.
*/
static void rebuild_tag_trunk(void){
int tagid = db_int(0, "SELECT 1 FROM tag WHERE tagname='sym-trunk'");
int rid;
char *zUuid;
if( tagid>0 ) return;
rid = db_int(0, "SELECT pid FROM plink AS x WHERE NOT EXISTS("
" SELECT 1 FROM plink WHERE cid=x.pid)");
if( rid==0 ) return;
/* Add the trunk tag to the root of the whole tree */
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
if( zUuid==0 ) return;
tag_add_artifact("sym-", "trunk", zUuid, 0, 2);
tag_add_artifact("", "branch", zUuid, "trunk", 2);
}
/*
** Core function to rebuild the infomration in the derived tables of a
** fossil repository from the blobs. This function is shared between
** 'rebuild_database' ('rebuild') and 'reconstruct_cmd'
** ('reconstruct'), both of which have to regenerate this information
|
| ︙ | ︙ |
Changes to src/schema.c.
| ︙ | ︙ | |||
277 278 279 280 281 282 283 | @ ); @ INSERT INTO tag VALUES(1, 'bgcolor'); -- TAG_BGCOLOR @ INSERT INTO tag VALUES(2, 'comment'); -- TAG_COMMENT @ INSERT INTO tag VALUES(3, 'user'); -- TAG_USER @ INSERT INTO tag VALUES(4, 'hidden'); -- TAG_HIDDEN @ INSERT INTO tag VALUES(5, 'private'); -- TAG_PRIVATE @ INSERT INTO tag VALUES(6, 'cluster'); -- TAG_CLUSTER | | | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | @ ); @ INSERT INTO tag VALUES(1, 'bgcolor'); -- TAG_BGCOLOR @ INSERT INTO tag VALUES(2, 'comment'); -- TAG_COMMENT @ INSERT INTO tag VALUES(3, 'user'); -- TAG_USER @ INSERT INTO tag VALUES(4, 'hidden'); -- TAG_HIDDEN @ INSERT INTO tag VALUES(5, 'private'); -- TAG_PRIVATE @ INSERT INTO tag VALUES(6, 'cluster'); -- TAG_CLUSTER @ INSERT INTO tag VALUES(7, 'branch'); -- TAG_BRANCH @ INSERT INTO tag VALUES(8, 'closed'); -- TAG_CLOSED @ @ -- Assignments of tags to baselines. Note that we allow tags to @ -- have values assigned to them. So we are not really dealing with @ -- tags here. These are really properties. But we are going to @ -- keep calling them tags because in many cases the value is ignored. @ -- |
| ︙ | ︙ | |||
331 332 333 334 335 336 337 | #if INTERFACE # define TAG_BGCOLOR 1 /* Set the background color for display */ # define TAG_COMMENT 2 /* The check-in comment */ # define TAG_USER 3 /* User who made a checking */ # define TAG_HIDDEN 4 /* Do not display or sync */ # define TAG_PRIVATE 5 /* Display but do not sync */ # define TAG_CLUSTER 6 /* A cluster */ | | | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | #if INTERFACE # define TAG_BGCOLOR 1 /* Set the background color for display */ # define TAG_COMMENT 2 /* The check-in comment */ # define TAG_USER 3 /* User who made a checking */ # define TAG_HIDDEN 4 /* Do not display or sync */ # define TAG_PRIVATE 5 /* Display but do not sync */ # define TAG_CLUSTER 6 /* A cluster */ # define TAG_BRANCH 7 /* Value is name of the current branch */ # define TAG_CLOSED 8 /* Do not display this check-in as a leaf */ #endif #if EXPORT_INTERFACE # define MAX_INT_TAG 8 /* The largest pre-assigned tag id */ #endif /* |
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
73 74 75 76 77 78 79 |
}else{
@ <a href="%s(g.zBaseURL)/diff?v1=%s(zV1)&v2=%s(zV2)">[diff]</a>
}
}
}
/*
| | > > > > | | < | | | | | | < > | < | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
}else{
@ <a href="%s(g.zBaseURL)/diff?v1=%s(zV1)&v2=%s(zV2)">[diff]</a>
}
}
}
/*
** Count the number of primary non-branch children for the given check-in.
**
** A primary child is one where the parent is the primary parent, not
** a merge parent.
**
** A non-branch child is one which is on the same branch as the parent.
*/
int count_nonbranch_children(int pid){
int nNonBranch;
static const char zSql[] =
@ SELECT count(*) FROM plink
@ WHERE pid=%d AND isprim
@ AND 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')
;
nNonBranch = db_int(0, zSql, pid, TAG_BRANCH, TAG_BRANCH);
return nNonBranch;
}
/*
** Allowed flags for the tmFlags argument to www_print_timeline
*/
#if INTERFACE
|
| ︙ | ︙ | |||
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
}
/*
** Return a pointer to a constant string that forms the basis
** for a timeline query for the WWW interface.
*/
const char *timeline_query_for_www(void){
static const char zBaseSql[] =
@ SELECT
@ blob.rid,
@ uuid,
@ datetime(event.mtime,'localtime') AS timestamp,
@ coalesce(ecomment, comment),
@ coalesce(euser, user),
@ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
@ (SELECT count(*) FROM plink WHERE cid=blob.rid),
| > | | | | > | > > > | | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
}
/*
** Return a pointer to a constant string that forms the basis
** for a timeline query for the WWW interface.
*/
const char *timeline_query_for_www(void){
static char *zBase = 0;
static const char zBaseSql[] =
@ SELECT
@ blob.rid,
@ uuid,
@ datetime(event.mtime,'localtime') AS timestamp,
@ coalesce(ecomment, comment),
@ coalesce(euser, user),
@ (SELECT count(*) FROM plink WHERE pid=blob.rid AND isprim=1),
@ (SELECT count(*) FROM plink WHERE cid=blob.rid),
@ NOT EXISTS(SELECT 1 FROM plink
@ WHERE pid=blob.rid
@ AND 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')),
@ bgcolor,
@ event.type,
@ (SELECT group_concat(substr(tagname,5), ', ') FROM tag, tagxref
@ WHERE tagname GLOB 'sym-*' AND tag.tagid=tagxref.tagid
@ AND tagxref.rid=blob.rid AND tagxref.tagtype>0)
@ FROM event JOIN blob
@ WHERE blob.rid=event.objid
;
if( zBase==0 ){
zBase = mprintf(zBaseSql, TAG_BRANCH, TAG_BRANCH);
}
return zBase;
}
/*
** Generate a submenu element with a single parameter change.
*/
static void timeline_submenu(
HQuery *pUrl, /* Base URL */
|
| ︙ | ︙ |