Fossil SCM

If the date of a check-in has been changed by a tag, then show that fact on the "info" page for the check-in. <i>Requires a rebuild</i>.

drh 2010-11-24 23:45 trunk
Commit 576f6db2a84d0e6e7cd045460710c172b195bb56
3 files changed +10 -1 +3 -2 +4 -1
+10 -1
--- src/info.c
+++ src/info.c
@@ -216,14 +216,16 @@
216216
@ inherited from
217217
hyperlink_to_uuid(zOrigUuid);
218218
}else{
219219
@ propagates to descendants
220220
}
221
+#if 0
221222
if( zValue && strcmp(zTagname,"branch")==0 ){
222223
@ &nbsp;&nbsp;
223224
@ <a href="%s(g.zBaseURL)/timeline?r=%T(zValue)">branch timeline</a>
224225
}
226
+#endif
225227
}
226228
if( zSrcUuid && zSrcUuid[0] ){
227229
if( tagtype==0 ){
228230
@ by
229231
}else{
@@ -349,11 +351,12 @@
349351
style_footer();
350352
return;
351353
}
352354
isLeaf = !db_exists("SELECT 1 FROM plink WHERE pid=%d", rid);
353355
db_prepare(&q,
354
- "SELECT uuid, datetime(mtime, 'localtime'), user, comment"
356
+ "SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
357
+ " datetime(omtime, 'localtime')"
355358
" FROM blob, event"
356359
" WHERE blob.rid=%d"
357360
" AND event.objid=%d",
358361
rid, rid
359362
);
@@ -362,10 +365,11 @@
362365
char *zTitle = mprintf("Check-in [%.10s]", zUuid);
363366
char *zEUser, *zEComment;
364367
const char *zUser;
365368
const char *zComment;
366369
const char *zDate;
370
+ const char *zOrigDate;
367371
style_header(zTitle);
368372
login_anonymous_available();
369373
free(zTitle);
370374
zEUser = db_text(0,
371375
"SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
@@ -374,19 +378,24 @@
374378
"SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
375379
TAG_COMMENT, rid);
376380
zUser = db_column_text(&q, 2);
377381
zComment = db_column_text(&q, 3);
378382
zDate = db_column_text(&q,1);
383
+ zOrigDate = db_column_text(&q, 4);
379384
@ <div class="section">Overview</div>
380385
@ <table class="label-value">
381386
@ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
382387
if( g.okSetup ){
383388
@ (Record ID: %d(rid))
384389
}
385390
@ </td></tr>
386391
@ <tr><th>Date:</th><td>
387392
hyperlink_to_date(zDate, "</td></tr>");
393
+ if( zOrigDate ){
394
+ @ <tr><th>Original&nbsp;Date:</th><td>
395
+ hyperlink_to_date(zOrigDate, "</td></tr>");
396
+ }
388397
if( zEUser ){
389398
@ <tr><th>Edited&nbsp;User:</th><td>
390399
hyperlink_to_user(zEUser,zDate,"</td></tr>");
391400
@ <tr><th>Original&nbsp;User:</th><td>
392401
hyperlink_to_user(zUser,zDate,"</td></tr>");
393402
--- src/info.c
+++ src/info.c
@@ -216,14 +216,16 @@
216 @ inherited from
217 hyperlink_to_uuid(zOrigUuid);
218 }else{
219 @ propagates to descendants
220 }
 
221 if( zValue && strcmp(zTagname,"branch")==0 ){
222 @ &nbsp;&nbsp;
223 @ <a href="%s(g.zBaseURL)/timeline?r=%T(zValue)">branch timeline</a>
224 }
 
225 }
226 if( zSrcUuid && zSrcUuid[0] ){
227 if( tagtype==0 ){
228 @ by
229 }else{
@@ -349,11 +351,12 @@
349 style_footer();
350 return;
351 }
352 isLeaf = !db_exists("SELECT 1 FROM plink WHERE pid=%d", rid);
353 db_prepare(&q,
354 "SELECT uuid, datetime(mtime, 'localtime'), user, comment"
 
355 " FROM blob, event"
356 " WHERE blob.rid=%d"
357 " AND event.objid=%d",
358 rid, rid
359 );
@@ -362,10 +365,11 @@
362 char *zTitle = mprintf("Check-in [%.10s]", zUuid);
363 char *zEUser, *zEComment;
364 const char *zUser;
365 const char *zComment;
366 const char *zDate;
 
367 style_header(zTitle);
368 login_anonymous_available();
369 free(zTitle);
370 zEUser = db_text(0,
371 "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
@@ -374,19 +378,24 @@
374 "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
375 TAG_COMMENT, rid);
376 zUser = db_column_text(&q, 2);
377 zComment = db_column_text(&q, 3);
378 zDate = db_column_text(&q,1);
 
379 @ <div class="section">Overview</div>
380 @ <table class="label-value">
381 @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
382 if( g.okSetup ){
383 @ (Record ID: %d(rid))
384 }
385 @ </td></tr>
386 @ <tr><th>Date:</th><td>
387 hyperlink_to_date(zDate, "</td></tr>");
 
 
 
 
388 if( zEUser ){
389 @ <tr><th>Edited&nbsp;User:</th><td>
390 hyperlink_to_user(zEUser,zDate,"</td></tr>");
391 @ <tr><th>Original&nbsp;User:</th><td>
392 hyperlink_to_user(zUser,zDate,"</td></tr>");
393
--- src/info.c
+++ src/info.c
@@ -216,14 +216,16 @@
216 @ inherited from
217 hyperlink_to_uuid(zOrigUuid);
218 }else{
219 @ propagates to descendants
220 }
221 #if 0
222 if( zValue && strcmp(zTagname,"branch")==0 ){
223 @ &nbsp;&nbsp;
224 @ <a href="%s(g.zBaseURL)/timeline?r=%T(zValue)">branch timeline</a>
225 }
226 #endif
227 }
228 if( zSrcUuid && zSrcUuid[0] ){
229 if( tagtype==0 ){
230 @ by
231 }else{
@@ -349,11 +351,12 @@
351 style_footer();
352 return;
353 }
354 isLeaf = !db_exists("SELECT 1 FROM plink WHERE pid=%d", rid);
355 db_prepare(&q,
356 "SELECT uuid, datetime(mtime, 'localtime'), user, comment,"
357 " datetime(omtime, 'localtime')"
358 " FROM blob, event"
359 " WHERE blob.rid=%d"
360 " AND event.objid=%d",
361 rid, rid
362 );
@@ -362,10 +365,11 @@
365 char *zTitle = mprintf("Check-in [%.10s]", zUuid);
366 char *zEUser, *zEComment;
367 const char *zUser;
368 const char *zComment;
369 const char *zDate;
370 const char *zOrigDate;
371 style_header(zTitle);
372 login_anonymous_available();
373 free(zTitle);
374 zEUser = db_text(0,
375 "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
@@ -374,19 +378,24 @@
378 "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
379 TAG_COMMENT, rid);
380 zUser = db_column_text(&q, 2);
381 zComment = db_column_text(&q, 3);
382 zDate = db_column_text(&q,1);
383 zOrigDate = db_column_text(&q, 4);
384 @ <div class="section">Overview</div>
385 @ <table class="label-value">
386 @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
387 if( g.okSetup ){
388 @ (Record ID: %d(rid))
389 }
390 @ </td></tr>
391 @ <tr><th>Date:</th><td>
392 hyperlink_to_date(zDate, "</td></tr>");
393 if( zOrigDate ){
394 @ <tr><th>Original&nbsp;Date:</th><td>
395 hyperlink_to_date(zOrigDate, "</td></tr>");
396 }
397 if( zEUser ){
398 @ <tr><th>Edited&nbsp;User:</th><td>
399 hyperlink_to_user(zEUser,zDate,"</td></tr>");
400 @ <tr><th>Original&nbsp;User:</th><td>
401 hyperlink_to_user(zUser,zDate,"</td></tr>");
402
+3 -2
--- src/schema.c
+++ src/schema.c
@@ -221,21 +221,22 @@
221221
@ CREATE INDEX plink_i2 ON plink(cid,pid);
222222
@
223223
@ -- Events used to generate a timeline
224224
@ --
225225
@ CREATE TABLE event(
226
-@ type TEXT, -- Type of event
226
+@ type TEXT, -- Type of event: 'ci', 'w', 'e', 't'
227227
@ mtime DATETIME, -- Date and time when the event occurs
228228
@ objid INTEGER PRIMARY KEY, -- Associated record ID
229229
@ tagid INTEGER, -- Associated ticket or wiki name tag
230230
@ uid INTEGER REFERENCES user, -- User who caused the event
231231
@ bgcolor TEXT, -- Color set by 'bgcolor' property
232232
@ euser TEXT, -- User set by 'user' property
233233
@ user TEXT, -- Name of the user
234234
@ ecomment TEXT, -- Comment set by 'comment' property
235235
@ comment TEXT, -- Comment describing the event
236
-@ brief TEXT -- Short comment when tagid already seen
236
+@ brief TEXT, -- Short comment when tagid already seen
237
+@ omtime DATETIME -- Original unchanged date+time, or NULL
237238
@ );
238239
@ CREATE INDEX event_i1 ON event(mtime);
239240
@
240241
@ -- A record of phantoms. A phantom is a record for which we know the
241242
@ -- UUID but we do not (yet) know the file content.
242243
--- src/schema.c
+++ src/schema.c
@@ -221,21 +221,22 @@
221 @ CREATE INDEX plink_i2 ON plink(cid,pid);
222 @
223 @ -- Events used to generate a timeline
224 @ --
225 @ CREATE TABLE event(
226 @ type TEXT, -- Type of event
227 @ mtime DATETIME, -- Date and time when the event occurs
228 @ objid INTEGER PRIMARY KEY, -- Associated record ID
229 @ tagid INTEGER, -- Associated ticket or wiki name tag
230 @ uid INTEGER REFERENCES user, -- User who caused the event
231 @ bgcolor TEXT, -- Color set by 'bgcolor' property
232 @ euser TEXT, -- User set by 'user' property
233 @ user TEXT, -- Name of the user
234 @ ecomment TEXT, -- Comment set by 'comment' property
235 @ comment TEXT, -- Comment describing the event
236 @ brief TEXT -- Short comment when tagid already seen
 
237 @ );
238 @ CREATE INDEX event_i1 ON event(mtime);
239 @
240 @ -- A record of phantoms. A phantom is a record for which we know the
241 @ -- UUID but we do not (yet) know the file content.
242
--- src/schema.c
+++ src/schema.c
@@ -221,21 +221,22 @@
221 @ CREATE INDEX plink_i2 ON plink(cid,pid);
222 @
223 @ -- Events used to generate a timeline
224 @ --
225 @ CREATE TABLE event(
226 @ type TEXT, -- Type of event: 'ci', 'w', 'e', 't'
227 @ mtime DATETIME, -- Date and time when the event occurs
228 @ objid INTEGER PRIMARY KEY, -- Associated record ID
229 @ tagid INTEGER, -- Associated ticket or wiki name tag
230 @ uid INTEGER REFERENCES user, -- User who caused the event
231 @ bgcolor TEXT, -- Color set by 'bgcolor' property
232 @ euser TEXT, -- User set by 'user' property
233 @ user TEXT, -- Name of the user
234 @ ecomment TEXT, -- Comment set by 'comment' property
235 @ comment TEXT, -- Comment describing the event
236 @ brief TEXT, -- Short comment when tagid already seen
237 @ omtime DATETIME -- Original unchanged date+time, or NULL
238 @ );
239 @ CREATE INDEX event_i1 ON event(mtime);
240 @
241 @ -- A record of phantoms. A phantom is a record for which we know the
242 @ -- UUID but we do not (yet) know the file content.
243
+4 -1
--- src/tag.c
+++ src/tag.c
@@ -201,11 +201,14 @@
201201
wiki_extract_links(zCopy, rid, 0, mtime, 1, WIKI_INLINE);
202202
free(zCopy);
203203
}
204204
}
205205
if( tagid==TAG_DATE ){
206
- db_multi_exec("UPDATE event SET mtime=julianday(%Q) WHERE objid=%d",
206
+ db_multi_exec("UPDATE event "
207
+ " SET mtime=julianday(%Q),"
208
+ " omtime=coalesce(omtime,mtime)"
209
+ " WHERE objid=%d",
207210
zValue, rid);
208211
}
209212
if( tagtype==0 || tagtype==2 ){
210213
tag_propagate(rid, tagid, tagtype, rid, zValue, mtime);
211214
}
212215
--- src/tag.c
+++ src/tag.c
@@ -201,11 +201,14 @@
201 wiki_extract_links(zCopy, rid, 0, mtime, 1, WIKI_INLINE);
202 free(zCopy);
203 }
204 }
205 if( tagid==TAG_DATE ){
206 db_multi_exec("UPDATE event SET mtime=julianday(%Q) WHERE objid=%d",
 
 
 
207 zValue, rid);
208 }
209 if( tagtype==0 || tagtype==2 ){
210 tag_propagate(rid, tagid, tagtype, rid, zValue, mtime);
211 }
212
--- src/tag.c
+++ src/tag.c
@@ -201,11 +201,14 @@
201 wiki_extract_links(zCopy, rid, 0, mtime, 1, WIKI_INLINE);
202 free(zCopy);
203 }
204 }
205 if( tagid==TAG_DATE ){
206 db_multi_exec("UPDATE event "
207 " SET mtime=julianday(%Q),"
208 " omtime=coalesce(omtime,mtime)"
209 " WHERE objid=%d",
210 zValue, rid);
211 }
212 if( tagtype==0 || tagtype==2 ){
213 tag_propagate(rid, tagid, tagtype, rid, zValue, mtime);
214 }
215

Keyboard Shortcuts

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