Fossil SCM

Technote counterpart fix of [ecb705359a].

stephan 2021-02-22 03:33 trunk
Commit b8c1d429cbc2209319576f200af4cae062edb94b7c4a9c7fc9c3bd439f64bb78
1 file changed +6 -7
+6 -7
--- src/manifest.c
+++ src/manifest.c
@@ -2458,26 +2458,25 @@
24582458
);
24592459
}
24602460
if( p->type==CFTYPE_EVENT ){
24612461
char *zTag = mprintf("event-%s", p->zEventId);
24622462
int tagid = tag_findid(zTag, 1);
2463
- int prior, subsequent;
2463
+ int prior = 0, subsequent;
24642464
int nWiki;
24652465
char zLength[40];
24662466
Stmt qatt;
24672467
while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
24682468
nWiki = strlen(p->zWiki);
24692469
sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
24702470
tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
24712471
fossil_free(zTag);
2472
- prior = db_int(0,
2473
- "SELECT rid FROM tagxref"
2474
- " WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
2475
- " ORDER BY mtime DESC",
2476
- tagid, p->rDate, rid
2477
- );
2472
+ if(p->nParent){
2473
+ prior = fast_uuid_to_rid(p->azParent[0]);
2474
+ }
24782475
subsequent = db_int(0,
2476
+ /* BUG: this check is only correct if subsequent
2477
+ version has already been crosslinked. */
24792478
"SELECT rid FROM tagxref"
24802479
" WHERE tagid=%d AND mtime>=%.17g AND rid!=%d"
24812480
" ORDER BY mtime",
24822481
tagid, p->rDate, rid
24832482
);
24842483
--- src/manifest.c
+++ src/manifest.c
@@ -2458,26 +2458,25 @@
2458 );
2459 }
2460 if( p->type==CFTYPE_EVENT ){
2461 char *zTag = mprintf("event-%s", p->zEventId);
2462 int tagid = tag_findid(zTag, 1);
2463 int prior, subsequent;
2464 int nWiki;
2465 char zLength[40];
2466 Stmt qatt;
2467 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
2468 nWiki = strlen(p->zWiki);
2469 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2470 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
2471 fossil_free(zTag);
2472 prior = db_int(0,
2473 "SELECT rid FROM tagxref"
2474 " WHERE tagid=%d AND mtime<%.17g AND rid!=%d"
2475 " ORDER BY mtime DESC",
2476 tagid, p->rDate, rid
2477 );
2478 subsequent = db_int(0,
 
 
2479 "SELECT rid FROM tagxref"
2480 " WHERE tagid=%d AND mtime>=%.17g AND rid!=%d"
2481 " ORDER BY mtime",
2482 tagid, p->rDate, rid
2483 );
2484
--- src/manifest.c
+++ src/manifest.c
@@ -2458,26 +2458,25 @@
2458 );
2459 }
2460 if( p->type==CFTYPE_EVENT ){
2461 char *zTag = mprintf("event-%s", p->zEventId);
2462 int tagid = tag_findid(zTag, 1);
2463 int prior = 0, subsequent;
2464 int nWiki;
2465 char zLength[40];
2466 Stmt qatt;
2467 while( fossil_isspace(p->zWiki[0]) ) p->zWiki++;
2468 nWiki = strlen(p->zWiki);
2469 sqlite3_snprintf(sizeof(zLength), zLength, "%d", nWiki);
2470 tag_insert(zTag, 1, zLength, rid, p->rDate, rid);
2471 fossil_free(zTag);
2472 if(p->nParent){
2473 prior = fast_uuid_to_rid(p->azParent[0]);
2474 }
 
 
 
2475 subsequent = db_int(0,
2476 /* BUG: this check is only correct if subsequent
2477 version has already been crosslinked. */
2478 "SELECT rid FROM tagxref"
2479 " WHERE tagid=%d AND mtime>=%.17g AND rid!=%d"
2480 " ORDER BY mtime",
2481 tagid, p->rDate, rid
2482 );
2483

Keyboard Shortcuts

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