Fossil SCM
Improved description of tag changes in the EVENT table, and hence on the timeline.
Commit
7367cec4c8d3b3c07300de6c2edfe949ce35cc3f
Parent
a537c995313243b…
2 files changed
+53
-16
+6
+53
-16
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1869,35 +1869,72 @@ | ||
| 1869 | 1869 | Blob comment; |
| 1870 | 1870 | int i; |
| 1871 | 1871 | const char *zName; |
| 1872 | 1872 | const char *zValue; |
| 1873 | 1873 | const char *zUuid; |
| 1874 | + int branchMove = 0; | |
| 1874 | 1875 | blob_zero(&comment); |
| 1875 | 1876 | for(i=0; i<p->nTag; i++){ |
| 1876 | 1877 | zUuid = p->aTag[i].zUuid; |
| 1877 | 1878 | if( i==0 || fossil_strcmp(zUuid, p->aTag[i-1].zUuid)!=0 ){ |
| 1878 | 1879 | 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 [[/info/%S | %S]]:", | |
| 1880 | 1882 | zUuid, zUuid); |
| 1883 | + branchMove = 0; | |
| 1881 | 1884 | } |
| 1882 | 1885 | zName = p->aTag[i].zName; |
| 1883 | 1886 | 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, " [[/info/%S | details]]");*/ | |
| 1899 | 1936 | db_multi_exec( |
| 1900 | 1937 | "REPLACE INTO event(type,mtime,objid,user,comment)" |
| 1901 | 1938 | "VALUES('g',%.17g,%d,%Q,%Q)", |
| 1902 | 1939 | p->rDate, rid, p->zUser, blob_str(&comment) |
| 1903 | 1940 | ); |
| 1904 | 1941 |
| --- 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 [[/info/%S | %S]]:", |
| 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, " [[/info/%S | details]]");*/ |
| 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 |
+6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -364,10 +364,15 @@ | ||
| 364 | 364 | @ (user: <a href="%s(zLink)">%h(zUser)</a>%s(zTagList?",":"\051") |
| 365 | 365 | fossil_free(zLink); |
| 366 | 366 | }else{ |
| 367 | 367 | @ (user: %h(zUser)%s(zTagList?",":"\051") |
| 368 | 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 | + } | |
| 369 | 374 | |
| 370 | 375 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 371 | 376 | ** with hyperlinks to the tag list. |
| 372 | 377 | */ |
| 373 | 378 | if( zTagList ){ |
| @@ -393,10 +398,11 @@ | ||
| 393 | 398 | blob_reset(&links); |
| 394 | 399 | }else{ |
| 395 | 400 | @ tags: %h(zTagList)) |
| 396 | 401 | } |
| 397 | 402 | } |
| 403 | + | |
| 398 | 404 | |
| 399 | 405 | /* Generate extra hyperlinks at the end of the comment */ |
| 400 | 406 | if( xExtra ){ |
| 401 | 407 | xExtra(rid); |
| 402 | 408 | } |
| 403 | 409 |
| --- 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 |