Fossil SCM

Improved description of tag changes in the EVENT table, and hence on the timeline.

drh 2012-02-14 01:48 trunk
Commit 7367cec4c8d3b3c07300de6c2edfe949ce35cc3f
2 files changed +53 -16 +6
+53 -16
--- src/manifest.c
+++ src/manifest.c
@@ -1869,35 +1869,72 @@
18691869
Blob comment;
18701870
int i;
18711871
const char *zName;
18721872
const char *zValue;
18731873
const char *zUuid;
1874
+ int branchMove = 0;
18741875
blob_zero(&comment);
18751876
for(i=0; i<p->nTag; i++){
18761877
zUuid = p->aTag[i].zUuid;
18771878
if( i==0 || fossil_strcmp(zUuid, p->aTag[i-1].zUuid)!=0 ){
18781879
if( i>0 ) blob_append(&comment, " ", 1);
1879
- blob_appendf(&comment, "Tag changes on [/timeline?dp=%S&n=4 | %S]:",
1880
+ blob_appendf(&comment,
1881
+ "Edit &#91;[/info/%S | %S]&#93;:",
18801882
zUuid, zUuid);
1883
+ branchMove = 0;
18811884
}
18821885
zName = p->aTag[i].zName;
18831886
zValue = p->aTag[i].zValue;
1884
- if( zName[0]=='-' ){
1885
- blob_appendf(&comment, " Cancel");
1886
- }else if( zName[0]=='+' ){
1887
- blob_appendf(&comment, " Add");
1888
- }else{
1889
- blob_appendf(&comment, " Add propagating");
1890
- }
1891
- if( memcmp(&zName[1], "sym-",4)==0 ){
1892
- blob_appendf(&comment, " symbolic tag \"%h\".", &zName[5]);
1893
- }else if( fossil_strcmp(&zName[1], "comment")!=0 && zValue && zValue[0] ){
1894
- blob_appendf(&comment, " %h=%h.", &zName[1], zValue);
1895
- }else{
1896
- blob_appendf(&comment, " %h.", &zName[1]);
1897
- }
1898
- }
1887
+ if( strcmp(zName, "*branch")==0 ){
1888
+ blob_appendf(&comment,
1889
+ " Move to branch [/timeline?r=%h&nd&dp=%S | %h].",
1890
+ zValue, zUuid, zValue);
1891
+ branchMove = 1;
1892
+ }else if( strcmp(zName, "*bgcolor")==0 ){
1893
+ blob_appendf(&comment,
1894
+ " Change branch background color to \"%h\".", zValue);
1895
+ }else if( strcmp(zName, "+bgcolor")==0 ){
1896
+ blob_appendf(&comment,
1897
+ " Change background color to \"%h\".", zValue);
1898
+ }else if( strcmp(zName, "-bgcolor")==0 ){
1899
+ blob_appendf(&comment, " Cancel background color.");
1900
+ }else if( strcmp(zName, "+comment")==0 ){
1901
+ blob_appendf(&comment, " Edit check-in comment.");
1902
+ }else if( strcmp(zName, "+user")==0 ){
1903
+ blob_appendf(&comment, " Change user to \"%h\".", zValue);
1904
+ }else if( strcmp(zName, "+date")==0 ){
1905
+ blob_appendf(&comment, " Timestamp %h.", zValue);
1906
+ }else if( memcmp(zName, "-sym-",5)==0 ){
1907
+ if( !branchMove ) blob_appendf(&comment, " Cancel tag %h.", &zName[5]);
1908
+ }else if( memcmp(zName, "*sym-",5)==0 ){
1909
+ if( !branchMove ){
1910
+ blob_appendf(&comment, " Add propagating tag \"%h\".", &zName[5]);
1911
+ }
1912
+ }else if( memcmp(zName, "+sym-",5)==0 ){
1913
+ blob_appendf(&comment, " Add tag \"%h\".", &zName[5]);
1914
+ }else if( memcmp(zName, "-sym-",5)==0 ){
1915
+ blob_appendf(&comment, " Cancel tag \"%h\".", &zName[5]);
1916
+ }else if( strcmp(zName, "+closed")==0 ){
1917
+ blob_appendf(&comment, " Marked \"Closed\".");
1918
+ }else if( strcmp(zName, "-closed")==0 ){
1919
+ blob_appendf(&comment, " Removed the \"Closed\" mark.");
1920
+ }else {
1921
+ if( zName[0]=='-' ){
1922
+ blob_appendf(&comment, " Cancel \"%h\"", &zName[1]);
1923
+ }else if( zName[0]=='+' ){
1924
+ blob_appendf(&comment, " Add \"%h\"", &zName[1]);
1925
+ }else{
1926
+ blob_appendf(&comment, " Add propagating \"%h\"", &zName[1]);
1927
+ }
1928
+ if( zValue && zValue[0] ){
1929
+ blob_appendf(&comment, " with value \"%h\".", zValue);
1930
+ }else{
1931
+ blob_appendf(&comment, ".");
1932
+ }
1933
+ }
1934
+ }
1935
+ /*blob_appendf(&comment, " &#91;[/info/%S | details]&#93;");*/
18991936
db_multi_exec(
19001937
"REPLACE INTO event(type,mtime,objid,user,comment)"
19011938
"VALUES('g',%.17g,%d,%Q,%Q)",
19021939
p->rDate, rid, p->zUser, blob_str(&comment)
19031940
);
19041941
--- src/manifest.c
+++ src/manifest.c
@@ -1869,35 +1869,72 @@
1869 Blob comment;
1870 int i;
1871 const char *zName;
1872 const char *zValue;
1873 const char *zUuid;
 
1874 blob_zero(&comment);
1875 for(i=0; i<p->nTag; i++){
1876 zUuid = p->aTag[i].zUuid;
1877 if( i==0 || fossil_strcmp(zUuid, p->aTag[i-1].zUuid)!=0 ){
1878 if( i>0 ) blob_append(&comment, " ", 1);
1879 blob_appendf(&comment, "Tag changes on [/timeline?dp=%S&n=4 | %S]:",
 
1880 zUuid, zUuid);
 
1881 }
1882 zName = p->aTag[i].zName;
1883 zValue = p->aTag[i].zValue;
1884 if( zName[0]=='-' ){
1885 blob_appendf(&comment, " Cancel");
1886 }else if( zName[0]=='+' ){
1887 blob_appendf(&comment, " Add");
1888 }else{
1889 blob_appendf(&comment, " Add propagating");
1890 }
1891 if( memcmp(&zName[1], "sym-",4)==0 ){
1892 blob_appendf(&comment, " symbolic tag \"%h\".", &zName[5]);
1893 }else if( fossil_strcmp(&zName[1], "comment")!=0 && zValue && zValue[0] ){
1894 blob_appendf(&comment, " %h=%h.", &zName[1], zValue);
1895 }else{
1896 blob_appendf(&comment, " %h.", &zName[1]);
1897 }
1898 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1899 db_multi_exec(
1900 "REPLACE INTO event(type,mtime,objid,user,comment)"
1901 "VALUES('g',%.17g,%d,%Q,%Q)",
1902 p->rDate, rid, p->zUser, blob_str(&comment)
1903 );
1904
--- src/manifest.c
+++ src/manifest.c
@@ -1869,35 +1869,72 @@
1869 Blob comment;
1870 int i;
1871 const char *zName;
1872 const char *zValue;
1873 const char *zUuid;
1874 int branchMove = 0;
1875 blob_zero(&comment);
1876 for(i=0; i<p->nTag; i++){
1877 zUuid = p->aTag[i].zUuid;
1878 if( i==0 || fossil_strcmp(zUuid, p->aTag[i-1].zUuid)!=0 ){
1879 if( i>0 ) blob_append(&comment, " ", 1);
1880 blob_appendf(&comment,
1881 "Edit &#91;[/info/%S | %S]&#93;:",
1882 zUuid, zUuid);
1883 branchMove = 0;
1884 }
1885 zName = p->aTag[i].zName;
1886 zValue = p->aTag[i].zValue;
1887 if( strcmp(zName, "*branch")==0 ){
1888 blob_appendf(&comment,
1889 " Move to branch [/timeline?r=%h&nd&dp=%S | %h].",
1890 zValue, zUuid, zValue);
1891 branchMove = 1;
1892 }else if( strcmp(zName, "*bgcolor")==0 ){
1893 blob_appendf(&comment,
1894 " Change branch background color to \"%h\".", zValue);
1895 }else if( strcmp(zName, "+bgcolor")==0 ){
1896 blob_appendf(&comment,
1897 " Change background color to \"%h\".", zValue);
1898 }else if( strcmp(zName, "-bgcolor")==0 ){
1899 blob_appendf(&comment, " Cancel background color.");
1900 }else if( strcmp(zName, "+comment")==0 ){
1901 blob_appendf(&comment, " Edit check-in comment.");
1902 }else if( strcmp(zName, "+user")==0 ){
1903 blob_appendf(&comment, " Change user to \"%h\".", zValue);
1904 }else if( strcmp(zName, "+date")==0 ){
1905 blob_appendf(&comment, " Timestamp %h.", zValue);
1906 }else if( memcmp(zName, "-sym-",5)==0 ){
1907 if( !branchMove ) blob_appendf(&comment, " Cancel tag %h.", &zName[5]);
1908 }else if( memcmp(zName, "*sym-",5)==0 ){
1909 if( !branchMove ){
1910 blob_appendf(&comment, " Add propagating tag \"%h\".", &zName[5]);
1911 }
1912 }else if( memcmp(zName, "+sym-",5)==0 ){
1913 blob_appendf(&comment, " Add tag \"%h\".", &zName[5]);
1914 }else if( memcmp(zName, "-sym-",5)==0 ){
1915 blob_appendf(&comment, " Cancel tag \"%h\".", &zName[5]);
1916 }else if( strcmp(zName, "+closed")==0 ){
1917 blob_appendf(&comment, " Marked \"Closed\".");
1918 }else if( strcmp(zName, "-closed")==0 ){
1919 blob_appendf(&comment, " Removed the \"Closed\" mark.");
1920 }else {
1921 if( zName[0]=='-' ){
1922 blob_appendf(&comment, " Cancel \"%h\"", &zName[1]);
1923 }else if( zName[0]=='+' ){
1924 blob_appendf(&comment, " Add \"%h\"", &zName[1]);
1925 }else{
1926 blob_appendf(&comment, " Add propagating \"%h\"", &zName[1]);
1927 }
1928 if( zValue && zValue[0] ){
1929 blob_appendf(&comment, " with value \"%h\".", zValue);
1930 }else{
1931 blob_appendf(&comment, ".");
1932 }
1933 }
1934 }
1935 /*blob_appendf(&comment, " &#91;[/info/%S | details]&#93;");*/
1936 db_multi_exec(
1937 "REPLACE INTO event(type,mtime,objid,user,comment)"
1938 "VALUES('g',%.17g,%d,%Q,%Q)",
1939 p->rDate, rid, p->zUser, blob_str(&comment)
1940 );
1941
--- src/timeline.c
+++ src/timeline.c
@@ -364,10 +364,15 @@
364364
@ (user: <a href="%s(zLink)">%h(zUser)</a>%s(zTagList?",":"\051")
365365
fossil_free(zLink);
366366
}else{
367367
@ (user: %h(zUser)%s(zTagList?",":"\051")
368368
}
369
+
370
+ /* Generate a "detail" link for tags. */
371
+ if( zType[0]=='g' && g.perm.History ){
372
+ @ [<a href="%s(g.zTop)/info/%S(zUuid)">details</a>]
373
+ }
369374
370375
/* Generate the "tags: TAGLIST" at the end of the comment, together
371376
** with hyperlinks to the tag list.
372377
*/
373378
if( zTagList ){
@@ -393,10 +398,11 @@
393398
blob_reset(&links);
394399
}else{
395400
@ tags: %h(zTagList))
396401
}
397402
}
403
+
398404
399405
/* Generate extra hyperlinks at the end of the comment */
400406
if( xExtra ){
401407
xExtra(rid);
402408
}
403409
--- src/timeline.c
+++ src/timeline.c
@@ -364,10 +364,15 @@
364 @ (user: <a href="%s(zLink)">%h(zUser)</a>%s(zTagList?",":"\051")
365 fossil_free(zLink);
366 }else{
367 @ (user: %h(zUser)%s(zTagList?",":"\051")
368 }
 
 
 
 
 
369
370 /* Generate the "tags: TAGLIST" at the end of the comment, together
371 ** with hyperlinks to the tag list.
372 */
373 if( zTagList ){
@@ -393,10 +398,11 @@
393 blob_reset(&links);
394 }else{
395 @ tags: %h(zTagList))
396 }
397 }
 
398
399 /* Generate extra hyperlinks at the end of the comment */
400 if( xExtra ){
401 xExtra(rid);
402 }
403
--- src/timeline.c
+++ src/timeline.c
@@ -364,10 +364,15 @@
364 @ (user: <a href="%s(zLink)">%h(zUser)</a>%s(zTagList?",":"\051")
365 fossil_free(zLink);
366 }else{
367 @ (user: %h(zUser)%s(zTagList?",":"\051")
368 }
369
370 /* Generate a "detail" link for tags. */
371 if( zType[0]=='g' && g.perm.History ){
372 @ [<a href="%s(g.zTop)/info/%S(zUuid)">details</a>]
373 }
374
375 /* Generate the "tags: TAGLIST" at the end of the comment, together
376 ** with hyperlinks to the tag list.
377 */
378 if( zTagList ){
@@ -393,10 +398,11 @@
398 blob_reset(&links);
399 }else{
400 @ tags: %h(zTagList))
401 }
402 }
403
404
405 /* Generate extra hyperlinks at the end of the comment */
406 if( xExtra ){
407 xExtra(rid);
408 }
409

Keyboard Shortcuts

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