Fossil SCM
merge trunk
Commit
1d6cccc5528083fd515ddf38ee0d88fb1cf96242
Parent
3710f2ac5bddee0…
17 files changed
+1
-1
+13
-7
+1
-1
+9
-2
+2
-2
+1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-2
+8
-8
+11
-4
+11
-4
+1
-1
+2
+1
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -977,11 +977,11 @@ | ||
| 977 | 977 | int vid, /* BLOB.id for the parent check-in */ |
| 978 | 978 | CheckinInfo *p, /* Information about the check-in */ |
| 979 | 979 | int *pnFBcard /* OUT: Number of generated B- and F-cards */ |
| 980 | 980 | ){ |
| 981 | 981 | char *zDate; /* Date of the check-in */ |
| 982 | - char *zParentUuid; /* UUID of parent check-in */ | |
| 982 | + char *zParentUuid = 0; /* UUID of parent check-in */ | |
| 983 | 983 | Blob filename; /* A single filename */ |
| 984 | 984 | int nBasename; /* Size of base filename */ |
| 985 | 985 | Stmt q; /* Various queries */ |
| 986 | 986 | Blob mcksum; /* Manifest checksum */ |
| 987 | 987 | ManifestFile *pFile; /* File from the baseline */ |
| 988 | 988 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -977,11 +977,11 @@ | |
| 977 | int vid, /* BLOB.id for the parent check-in */ |
| 978 | CheckinInfo *p, /* Information about the check-in */ |
| 979 | int *pnFBcard /* OUT: Number of generated B- and F-cards */ |
| 980 | ){ |
| 981 | char *zDate; /* Date of the check-in */ |
| 982 | char *zParentUuid; /* UUID of parent check-in */ |
| 983 | Blob filename; /* A single filename */ |
| 984 | int nBasename; /* Size of base filename */ |
| 985 | Stmt q; /* Various queries */ |
| 986 | Blob mcksum; /* Manifest checksum */ |
| 987 | ManifestFile *pFile; /* File from the baseline */ |
| 988 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -977,11 +977,11 @@ | |
| 977 | int vid, /* BLOB.id for the parent check-in */ |
| 978 | CheckinInfo *p, /* Information about the check-in */ |
| 979 | int *pnFBcard /* OUT: Number of generated B- and F-cards */ |
| 980 | ){ |
| 981 | char *zDate; /* Date of the check-in */ |
| 982 | char *zParentUuid = 0; /* UUID of parent check-in */ |
| 983 | Blob filename; /* A single filename */ |
| 984 | int nBasename; /* Size of base filename */ |
| 985 | Stmt q; /* Various queries */ |
| 986 | Blob mcksum; /* Manifest checksum */ |
| 987 | ManifestFile *pFile; /* File from the baseline */ |
| 988 |
+13
-7
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -32,24 +32,33 @@ | ||
| 32 | 32 | */ |
| 33 | 33 | int comment_print(const char *zText, int indent, int lineLength){ |
| 34 | 34 | int tlen = lineLength - indent; |
| 35 | 35 | int si, sk, i, k; |
| 36 | 36 | int doIndent = 0; |
| 37 | - char *zBuf = fossil_malloc(strlen(zText)+400); | |
| 37 | + char *zBuf; | |
| 38 | + char zBuffer[400]; | |
| 38 | 39 | int lineCnt = 0; |
| 39 | 40 | |
| 41 | + if( tlen<=0 ){ | |
| 42 | + tlen = strlen(zText); | |
| 43 | + } | |
| 44 | + if( tlen >= (sizeof(zBuffer)) ){ | |
| 45 | + zBuf = fossil_malloc(tlen+1); | |
| 46 | + }else{ | |
| 47 | + zBuf = zBuffer; | |
| 48 | + } | |
| 40 | 49 | for(;;){ |
| 41 | 50 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 42 | 51 | if( zText[0]==0 ){ |
| 43 | 52 | if( doIndent==0 ){ |
| 44 | 53 | fossil_print("\n"); |
| 45 | 54 | lineCnt = 1; |
| 46 | 55 | } |
| 47 | - fossil_free(zBuf); | |
| 56 | + if( zBuf!=zBuffer) fossil_free(zBuf); | |
| 48 | 57 | return lineCnt; |
| 49 | 58 | } |
| 50 | - for(sk=si=i=k=0; zText[i] && ((tlen<=0)||(k<tlen)); i++){ | |
| 59 | + for(sk=si=i=k=0; zText[i] && k<tlen; i++){ | |
| 51 | 60 | char c = zText[i]; |
| 52 | 61 | if( fossil_isspace(c) ){ |
| 53 | 62 | si = i; |
| 54 | 63 | sk = k; |
| 55 | 64 | if( k==0 || zBuf[k-1]!=' ' ){ |
| @@ -68,19 +77,16 @@ | ||
| 68 | 77 | fossil_print("%*s", indent, ""); |
| 69 | 78 | } |
| 70 | 79 | doIndent = 1; |
| 71 | 80 | if( sk>0 && zText[i] ){ |
| 72 | 81 | zText += si; |
| 73 | - zBuf[sk++] = '\n'; | |
| 74 | 82 | zBuf[sk] = 0; |
| 75 | - fossil_print("%s", zBuf); | |
| 76 | 83 | }else{ |
| 77 | 84 | zText += i; |
| 78 | - zBuf[k++] = '\n'; | |
| 79 | 85 | zBuf[k] = 0; |
| 80 | - fossil_print("%s", zBuf); | |
| 81 | 86 | } |
| 87 | + fossil_print("%s\n", zBuf); | |
| 82 | 88 | lineCnt++; |
| 83 | 89 | } |
| 84 | 90 | } |
| 85 | 91 | |
| 86 | 92 | /* |
| 87 | 93 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -32,24 +32,33 @@ | |
| 32 | */ |
| 33 | int comment_print(const char *zText, int indent, int lineLength){ |
| 34 | int tlen = lineLength - indent; |
| 35 | int si, sk, i, k; |
| 36 | int doIndent = 0; |
| 37 | char *zBuf = fossil_malloc(strlen(zText)+400); |
| 38 | int lineCnt = 0; |
| 39 | |
| 40 | for(;;){ |
| 41 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 42 | if( zText[0]==0 ){ |
| 43 | if( doIndent==0 ){ |
| 44 | fossil_print("\n"); |
| 45 | lineCnt = 1; |
| 46 | } |
| 47 | fossil_free(zBuf); |
| 48 | return lineCnt; |
| 49 | } |
| 50 | for(sk=si=i=k=0; zText[i] && ((tlen<=0)||(k<tlen)); i++){ |
| 51 | char c = zText[i]; |
| 52 | if( fossil_isspace(c) ){ |
| 53 | si = i; |
| 54 | sk = k; |
| 55 | if( k==0 || zBuf[k-1]!=' ' ){ |
| @@ -68,19 +77,16 @@ | |
| 68 | fossil_print("%*s", indent, ""); |
| 69 | } |
| 70 | doIndent = 1; |
| 71 | if( sk>0 && zText[i] ){ |
| 72 | zText += si; |
| 73 | zBuf[sk++] = '\n'; |
| 74 | zBuf[sk] = 0; |
| 75 | fossil_print("%s", zBuf); |
| 76 | }else{ |
| 77 | zText += i; |
| 78 | zBuf[k++] = '\n'; |
| 79 | zBuf[k] = 0; |
| 80 | fossil_print("%s", zBuf); |
| 81 | } |
| 82 | lineCnt++; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /* |
| 87 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -32,24 +32,33 @@ | |
| 32 | */ |
| 33 | int comment_print(const char *zText, int indent, int lineLength){ |
| 34 | int tlen = lineLength - indent; |
| 35 | int si, sk, i, k; |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( tlen<=0 ){ |
| 42 | tlen = strlen(zText); |
| 43 | } |
| 44 | if( tlen >= (sizeof(zBuffer)) ){ |
| 45 | zBuf = fossil_malloc(tlen+1); |
| 46 | }else{ |
| 47 | zBuf = zBuffer; |
| 48 | } |
| 49 | for(;;){ |
| 50 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 51 | if( zText[0]==0 ){ |
| 52 | if( doIndent==0 ){ |
| 53 | fossil_print("\n"); |
| 54 | lineCnt = 1; |
| 55 | } |
| 56 | if( zBuf!=zBuffer) fossil_free(zBuf); |
| 57 | return lineCnt; |
| 58 | } |
| 59 | for(sk=si=i=k=0; zText[i] && k<tlen; i++){ |
| 60 | char c = zText[i]; |
| 61 | if( fossil_isspace(c) ){ |
| 62 | si = i; |
| 63 | sk = k; |
| 64 | if( k==0 || zBuf[k-1]!=' ' ){ |
| @@ -68,19 +77,16 @@ | |
| 77 | fossil_print("%*s", indent, ""); |
| 78 | } |
| 79 | doIndent = 1; |
| 80 | if( sk>0 && zText[i] ){ |
| 81 | zText += si; |
| 82 | zBuf[sk] = 0; |
| 83 | }else{ |
| 84 | zText += i; |
| 85 | zBuf[k] = 0; |
| 86 | } |
| 87 | fossil_print("%s\n", zBuf); |
| 88 | lineCnt++; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /* |
| 93 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -329,11 +329,11 @@ | ||
| 329 | 329 | "%s" |
| 330 | 330 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 331 | 331 | " ORDER BY event.mtime DESC", |
| 332 | 332 | timeline_query_for_tty() |
| 333 | 333 | ); |
| 334 | - print_timeline(&q, -20, 80, 0); | |
| 334 | + print_timeline(&q, 20, 79, 0); | |
| 335 | 335 | db_finalize(&q); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /* |
| 339 | 339 | ** COMMAND: leaves* |
| 340 | 340 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -329,11 +329,11 @@ | |
| 329 | "%s" |
| 330 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 331 | " ORDER BY event.mtime DESC", |
| 332 | timeline_query_for_tty() |
| 333 | ); |
| 334 | print_timeline(&q, -20, 80, 0); |
| 335 | db_finalize(&q); |
| 336 | } |
| 337 | |
| 338 | /* |
| 339 | ** COMMAND: leaves* |
| 340 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -329,11 +329,11 @@ | |
| 329 | "%s" |
| 330 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 331 | " ORDER BY event.mtime DESC", |
| 332 | timeline_query_for_tty() |
| 333 | ); |
| 334 | print_timeline(&q, 20, 79, 0); |
| 335 | db_finalize(&q); |
| 336 | } |
| 337 | |
| 338 | /* |
| 339 | ** COMMAND: leaves* |
| 340 |
+9
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -49,10 +49,11 @@ | ||
| 49 | 49 | ** --offset P skip P changes |
| 50 | 50 | ** -p|--print select print mode |
| 51 | 51 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 52 | 52 | ** to stdout (only in print mode) |
| 53 | 53 | ** -s|--status select status mode (print a status indicator for FILE) |
| 54 | +** -W|--width <num> With of lines (default 79). Must be >22 or 0. | |
| 54 | 55 | ** |
| 55 | 56 | ** See also: artifact, cat, descendants, info, leaves |
| 56 | 57 | */ |
| 57 | 58 | void finfo_cmd(void){ |
| 58 | 59 | capture_case_sensitive_option(); |
| @@ -134,21 +135,27 @@ | ||
| 134 | 135 | Stmt q; |
| 135 | 136 | Blob fname; |
| 136 | 137 | int rid; |
| 137 | 138 | const char *zFilename; |
| 138 | 139 | const char *zLimit; |
| 140 | + const char *zWidth; | |
| 139 | 141 | const char *zOffset; |
| 140 | - int iLimit, iOffset, iBrief; | |
| 142 | + int iLimit, iOffset, iBrief, iWidth; | |
| 141 | 143 | |
| 142 | 144 | if( find_option("log","l",0) ){ |
| 143 | 145 | /* this is the default, no-op */ |
| 144 | 146 | } |
| 145 | 147 | zLimit = find_option("limit","n",1); |
| 148 | + zWidth = find_option("width","W",1); | |
| 146 | 149 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 150 | + iWidth = zWidth ? atoi(zWidth) : 79; | |
| 147 | 151 | zOffset = find_option("offset",0,1); |
| 148 | 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 149 | 153 | iBrief = (find_option("brief","b",0) == 0); |
| 154 | + if( (iWidth!=0) && (iWidth<=22) ){ | |
| 155 | + fossil_fatal("--width|-W value must be >22 or 0"); | |
| 156 | + } | |
| 150 | 157 | if( g.argc!=3 ){ |
| 151 | 158 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 152 | 159 | } |
| 153 | 160 | file_tree_name(g.argv[2], &fname, 1); |
| 154 | 161 | rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B %s", |
| @@ -188,11 +195,11 @@ | ||
| 188 | 195 | if( iBrief ){ |
| 189 | 196 | fossil_print("%s ", zDate); |
| 190 | 197 | zOut = sqlite3_mprintf( |
| 191 | 198 | "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", |
| 192 | 199 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 193 | - comment_print(zOut, 11, 79); | |
| 200 | + comment_print(zOut, 11, iWidth); | |
| 194 | 201 | sqlite3_free(zOut); |
| 195 | 202 | }else{ |
| 196 | 203 | blob_reset(&line); |
| 197 | 204 | blob_appendf(&line, "%.10s ", zCiUuid); |
| 198 | 205 | blob_appendf(&line, "%.10s ", zDate); |
| 199 | 206 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -49,10 +49,11 @@ | |
| 49 | ** --offset P skip P changes |
| 50 | ** -p|--print select print mode |
| 51 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 52 | ** to stdout (only in print mode) |
| 53 | ** -s|--status select status mode (print a status indicator for FILE) |
| 54 | ** |
| 55 | ** See also: artifact, cat, descendants, info, leaves |
| 56 | */ |
| 57 | void finfo_cmd(void){ |
| 58 | capture_case_sensitive_option(); |
| @@ -134,21 +135,27 @@ | |
| 134 | Stmt q; |
| 135 | Blob fname; |
| 136 | int rid; |
| 137 | const char *zFilename; |
| 138 | const char *zLimit; |
| 139 | const char *zOffset; |
| 140 | int iLimit, iOffset, iBrief; |
| 141 | |
| 142 | if( find_option("log","l",0) ){ |
| 143 | /* this is the default, no-op */ |
| 144 | } |
| 145 | zLimit = find_option("limit","n",1); |
| 146 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 147 | zOffset = find_option("offset",0,1); |
| 148 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 149 | iBrief = (find_option("brief","b",0) == 0); |
| 150 | if( g.argc!=3 ){ |
| 151 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 152 | } |
| 153 | file_tree_name(g.argv[2], &fname, 1); |
| 154 | rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B %s", |
| @@ -188,11 +195,11 @@ | |
| 188 | if( iBrief ){ |
| 189 | fossil_print("%s ", zDate); |
| 190 | zOut = sqlite3_mprintf( |
| 191 | "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", |
| 192 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 193 | comment_print(zOut, 11, 79); |
| 194 | sqlite3_free(zOut); |
| 195 | }else{ |
| 196 | blob_reset(&line); |
| 197 | blob_appendf(&line, "%.10s ", zCiUuid); |
| 198 | blob_appendf(&line, "%.10s ", zDate); |
| 199 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -49,10 +49,11 @@ | |
| 49 | ** --offset P skip P changes |
| 50 | ** -p|--print select print mode |
| 51 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 52 | ** to stdout (only in print mode) |
| 53 | ** -s|--status select status mode (print a status indicator for FILE) |
| 54 | ** -W|--width <num> With of lines (default 79). Must be >22 or 0. |
| 55 | ** |
| 56 | ** See also: artifact, cat, descendants, info, leaves |
| 57 | */ |
| 58 | void finfo_cmd(void){ |
| 59 | capture_case_sensitive_option(); |
| @@ -134,21 +135,27 @@ | |
| 135 | Stmt q; |
| 136 | Blob fname; |
| 137 | int rid; |
| 138 | const char *zFilename; |
| 139 | const char *zLimit; |
| 140 | const char *zWidth; |
| 141 | const char *zOffset; |
| 142 | int iLimit, iOffset, iBrief, iWidth; |
| 143 | |
| 144 | if( find_option("log","l",0) ){ |
| 145 | /* this is the default, no-op */ |
| 146 | } |
| 147 | zLimit = find_option("limit","n",1); |
| 148 | zWidth = find_option("width","W",1); |
| 149 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 150 | iWidth = zWidth ? atoi(zWidth) : 79; |
| 151 | zOffset = find_option("offset",0,1); |
| 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 153 | iBrief = (find_option("brief","b",0) == 0); |
| 154 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 155 | fossil_fatal("--width|-W value must be >22 or 0"); |
| 156 | } |
| 157 | if( g.argc!=3 ){ |
| 158 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 159 | } |
| 160 | file_tree_name(g.argv[2], &fname, 1); |
| 161 | rid = db_int(0, "SELECT rid FROM vfile WHERE pathname=%B %s", |
| @@ -188,11 +195,11 @@ | |
| 195 | if( iBrief ){ |
| 196 | fossil_print("%s ", zDate); |
| 197 | zOut = sqlite3_mprintf( |
| 198 | "[%.10s] %s (user: %s, artifact: [%.10s], branch: %s)", |
| 199 | zCiUuid, zCom, zUser, zFileUuid, zBr); |
| 200 | comment_print(zOut, 11, iWidth); |
| 201 | sqlite3_free(zOut); |
| 202 | }else{ |
| 203 | blob_reset(&line); |
| 204 | blob_appendf(&line, "%.10s ", zCiUuid); |
| 205 | blob_appendf(&line, "%.10s ", zDate); |
| 206 |
+2
-2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1899,11 +1899,11 @@ | ||
| 1899 | 1899 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1900 | 1900 | ){ |
| 1901 | 1901 | char *zComment; |
| 1902 | 1902 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1903 | 1903 | zComment = mprintf( |
| 1904 | - "Add attachment [%R/artifact/%S|%h] to wiki page [%h]", | |
| 1904 | + "Add attachment [/artifact/%S|%h] to wiki page [%h]", | |
| 1905 | 1905 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1906 | 1906 | }else{ |
| 1907 | 1907 | zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", |
| 1908 | 1908 | p->zAttachName, p->zAttachTarget); |
| 1909 | 1909 | } |
| @@ -1915,11 +1915,11 @@ | ||
| 1915 | 1915 | free(zComment); |
| 1916 | 1916 | }else{ |
| 1917 | 1917 | char *zComment; |
| 1918 | 1918 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1919 | 1919 | zComment = mprintf( |
| 1920 | - "Add attachment [%R/artifact/%S|%h] to ticket [%S]", | |
| 1920 | + "Add attachment [/artifact/%S|%h] to ticket [%S]", | |
| 1921 | 1921 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1922 | 1922 | }else{ |
| 1923 | 1923 | zComment = mprintf("Delete attachment \"%h\" from ticket [%.10s]", |
| 1924 | 1924 | p->zAttachName, p->zAttachTarget); |
| 1925 | 1925 | } |
| 1926 | 1926 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1899,11 +1899,11 @@ | |
| 1899 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1900 | ){ |
| 1901 | char *zComment; |
| 1902 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1903 | zComment = mprintf( |
| 1904 | "Add attachment [%R/artifact/%S|%h] to wiki page [%h]", |
| 1905 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1906 | }else{ |
| 1907 | zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", |
| 1908 | p->zAttachName, p->zAttachTarget); |
| 1909 | } |
| @@ -1915,11 +1915,11 @@ | |
| 1915 | free(zComment); |
| 1916 | }else{ |
| 1917 | char *zComment; |
| 1918 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1919 | zComment = mprintf( |
| 1920 | "Add attachment [%R/artifact/%S|%h] to ticket [%S]", |
| 1921 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1922 | }else{ |
| 1923 | zComment = mprintf("Delete attachment \"%h\" from ticket [%.10s]", |
| 1924 | p->zAttachName, p->zAttachTarget); |
| 1925 | } |
| 1926 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1899,11 +1899,11 @@ | |
| 1899 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1900 | ){ |
| 1901 | char *zComment; |
| 1902 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1903 | zComment = mprintf( |
| 1904 | "Add attachment [/artifact/%S|%h] to wiki page [%h]", |
| 1905 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1906 | }else{ |
| 1907 | zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", |
| 1908 | p->zAttachName, p->zAttachTarget); |
| 1909 | } |
| @@ -1915,11 +1915,11 @@ | |
| 1915 | free(zComment); |
| 1916 | }else{ |
| 1917 | char *zComment; |
| 1918 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1919 | zComment = mprintf( |
| 1920 | "Add attachment [/artifact/%S|%h] to ticket [%S]", |
| 1921 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1922 | }else{ |
| 1923 | zComment = mprintf("Delete attachment \"%h\" from ticket [%.10s]", |
| 1924 | p->zAttachName, p->zAttachTarget); |
| 1925 | } |
| 1926 |
+1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -349,10 +349,11 @@ | ||
| 349 | 349 | " WHERE type='table'" |
| 350 | 350 | " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 351 | 351 | "'config','shun','private','reportfmt'," |
| 352 | 352 | "'concealed','accesslog','modreq')" |
| 353 | 353 | " AND name NOT GLOB 'sqlite_*'" |
| 354 | + " AND name NOT GLOB 'fx_*'" | |
| 354 | 355 | ); |
| 355 | 356 | if( zTable==0 ) break; |
| 356 | 357 | db_multi_exec("DROP TABLE %Q", zTable); |
| 357 | 358 | free(zTable); |
| 358 | 359 | } |
| 359 | 360 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -349,10 +349,11 @@ | |
| 349 | " WHERE type='table'" |
| 350 | " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 351 | "'config','shun','private','reportfmt'," |
| 352 | "'concealed','accesslog','modreq')" |
| 353 | " AND name NOT GLOB 'sqlite_*'" |
| 354 | ); |
| 355 | if( zTable==0 ) break; |
| 356 | db_multi_exec("DROP TABLE %Q", zTable); |
| 357 | free(zTable); |
| 358 | } |
| 359 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -349,10 +349,11 @@ | |
| 349 | " WHERE type='table'" |
| 350 | " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 351 | "'config','shun','private','reportfmt'," |
| 352 | "'concealed','accesslog','modreq')" |
| 353 | " AND name NOT GLOB 'sqlite_*'" |
| 354 | " AND name NOT GLOB 'fx_*'" |
| 355 | ); |
| 356 | if( zTable==0 ) break; |
| 357 | db_multi_exec("DROP TABLE %Q", zTable); |
| 358 | free(zTable); |
| 359 | } |
| 360 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -222,8 +222,8 @@ | ||
| 222 | 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | 223 | } |
| 224 | 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | 226 | blob_reset(&sql); |
| 227 | - print_timeline(&q, nLimit, 80, 0); | |
| 227 | + print_timeline(&q, 1000, 79, 0); | |
| 228 | 228 | db_finalize(&q); |
| 229 | 229 | } |
| 230 | 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 80, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, 1000, 79, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -222,8 +222,8 @@ | ||
| 222 | 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | 223 | } |
| 224 | 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | 226 | blob_reset(&sql); |
| 227 | - print_timeline(&q, nLimit, 80, 0); | |
| 227 | + print_timeline(&q, 1000, 79, 0); | |
| 228 | 228 | db_finalize(&q); |
| 229 | 229 | } |
| 230 | 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, nLimit, 80, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -222,8 +222,8 @@ | |
| 222 | blob_appendf(&sql,"AND x>%d ", iBest/3); |
| 223 | } |
| 224 | blob_append(&sql, "ORDER BY x DESC, date DESC ", -1); |
| 225 | db_prepare(&q, blob_str(&sql)); |
| 226 | blob_reset(&sql); |
| 227 | print_timeline(&q, 1000, 79, 0); |
| 228 | db_finalize(&q); |
| 229 | } |
| 230 |
+1
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1226,7 +1226,7 @@ | ||
| 1226 | 1226 | ** |
| 1227 | 1227 | ** WEBPAGE: honeypot |
| 1228 | 1228 | */ |
| 1229 | 1229 | void honeypot_page(void){ |
| 1230 | 1230 | cgi_set_status(403, "Forbidden"); |
| 1231 | - @ <p>Access by spiders and robots is forbidden</p> | |
| 1231 | + @ <p>Please enable javascript or log in to see this content</p> | |
| 1232 | 1232 | } |
| 1233 | 1233 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1226,7 +1226,7 @@ | |
| 1226 | ** |
| 1227 | ** WEBPAGE: honeypot |
| 1228 | */ |
| 1229 | void honeypot_page(void){ |
| 1230 | cgi_set_status(403, "Forbidden"); |
| 1231 | @ <p>Access by spiders and robots is forbidden</p> |
| 1232 | } |
| 1233 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1226,7 +1226,7 @@ | |
| 1226 | ** |
| 1227 | ** WEBPAGE: honeypot |
| 1228 | */ |
| 1229 | void honeypot_page(void){ |
| 1230 | cgi_set_status(403, "Forbidden"); |
| 1231 | @ <p>Please enable javascript or log in to see this content</p> |
| 1232 | } |
| 1233 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -469,11 +469,11 @@ | ||
| 469 | 469 | " ORDER BY event.mtime DESC", |
| 470 | 470 | timeline_query_for_tty(), zType, tagid |
| 471 | 471 | ); |
| 472 | 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | 473 | blob_reset(&sql); |
| 474 | - print_timeline(&q, nFindLimit, 80, 0); | |
| 474 | + print_timeline(&q, 2000, 79, 0); | |
| 475 | 475 | db_finalize(&q); |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | }else |
| 479 | 479 | |
| 480 | 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 80, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, 2000, 79, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
+1
-1
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -469,11 +469,11 @@ | ||
| 469 | 469 | " ORDER BY event.mtime DESC", |
| 470 | 470 | timeline_query_for_tty(), zType, tagid |
| 471 | 471 | ); |
| 472 | 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | 473 | blob_reset(&sql); |
| 474 | - print_timeline(&q, nFindLimit, 80, 0); | |
| 474 | + print_timeline(&q, 2000, 79, 0); | |
| 475 | 475 | db_finalize(&q); |
| 476 | 476 | } |
| 477 | 477 | } |
| 478 | 478 | }else |
| 479 | 479 | |
| 480 | 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, nFindLimit, 80, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -469,11 +469,11 @@ | |
| 469 | " ORDER BY event.mtime DESC", |
| 470 | timeline_query_for_tty(), zType, tagid |
| 471 | ); |
| 472 | db_prepare(&q, "%s", blob_str(&sql)); |
| 473 | blob_reset(&sql); |
| 474 | print_timeline(&q, 2000, 79, 0); |
| 475 | db_finalize(&q); |
| 476 | } |
| 477 | } |
| 478 | }else |
| 479 | |
| 480 |
+1
-2
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -529,16 +529,15 @@ | ||
| 529 | 529 | void *p, |
| 530 | 530 | int argc, |
| 531 | 531 | const char **argv, |
| 532 | 532 | int *argl |
| 533 | 533 | ){ |
| 534 | - int openRepository; | |
| 535 | - | |
| 536 | 534 | if( argc!=1 && argc!=2 ){ |
| 537 | 535 | return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); |
| 538 | 536 | } |
| 539 | 537 | if( argc==2 ){ |
| 538 | + int openRepository = 0; | |
| 540 | 539 | if( Th_ToInt(interp, argv[1], argl[1], &openRepository) ){ |
| 541 | 540 | return TH_ERROR; |
| 542 | 541 | } |
| 543 | 542 | if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); |
| 544 | 543 | } |
| 545 | 544 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -529,16 +529,15 @@ | |
| 529 | void *p, |
| 530 | int argc, |
| 531 | const char **argv, |
| 532 | int *argl |
| 533 | ){ |
| 534 | int openRepository; |
| 535 | |
| 536 | if( argc!=1 && argc!=2 ){ |
| 537 | return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); |
| 538 | } |
| 539 | if( argc==2 ){ |
| 540 | if( Th_ToInt(interp, argv[1], argl[1], &openRepository) ){ |
| 541 | return TH_ERROR; |
| 542 | } |
| 543 | if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); |
| 544 | } |
| 545 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -529,16 +529,15 @@ | |
| 529 | void *p, |
| 530 | int argc, |
| 531 | const char **argv, |
| 532 | int *argl |
| 533 | ){ |
| 534 | if( argc!=1 && argc!=2 ){ |
| 535 | return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); |
| 536 | } |
| 537 | if( argc==2 ){ |
| 538 | int openRepository = 0; |
| 539 | if( Th_ToInt(interp, argv[1], argl[1], &openRepository) ){ |
| 540 | return TH_ERROR; |
| 541 | } |
| 542 | if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); |
| 543 | } |
| 544 |
+8
-8
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -30,24 +30,24 @@ | ||
| 30 | 30 | ** arguments from TH1 to Tcl. |
| 31 | 31 | */ |
| 32 | 32 | #define USE_ARGV_TO_OBJV() \ |
| 33 | 33 | int objc; \ |
| 34 | 34 | Tcl_Obj **objv; \ |
| 35 | - int i; | |
| 35 | + int obji; | |
| 36 | 36 | |
| 37 | 37 | #define COPY_ARGV_TO_OBJV() \ |
| 38 | 38 | objc = argc-1; \ |
| 39 | 39 | objv = (Tcl_Obj **)ckalloc((unsigned)(objc * sizeof(Tcl_Obj *))); \ |
| 40 | - for(i=1; i<argc; i++){ \ | |
| 41 | - objv[i-1] = Tcl_NewStringObj(argv[i], argl[i]); \ | |
| 42 | - Tcl_IncrRefCount(objv[i-1]); \ | |
| 40 | + for(obji=1; obji<argc; obji++){ \ | |
| 41 | + objv[obji-1] = Tcl_NewStringObj(argv[obji], argl[obji]); \ | |
| 42 | + Tcl_IncrRefCount(objv[obji-1]); \ | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -#define FREE_ARGV_TO_OBJV() \ | |
| 46 | - for(i=1; i<argc; i++){ \ | |
| 47 | - Tcl_DecrRefCount(objv[i-1]); \ | |
| 48 | - } \ | |
| 45 | +#define FREE_ARGV_TO_OBJV() \ | |
| 46 | + for(obji=1; obji<argc; obji++){ \ | |
| 47 | + Tcl_DecrRefCount(objv[obji-1]); \ | |
| 48 | + } \ | |
| 49 | 49 | ckfree((char *)objv); |
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | ** Fetch the Tcl interpreter from the specified void pointer, cast to a Tcl |
| 53 | 53 | ** context. |
| 54 | 54 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -30,24 +30,24 @@ | |
| 30 | ** arguments from TH1 to Tcl. |
| 31 | */ |
| 32 | #define USE_ARGV_TO_OBJV() \ |
| 33 | int objc; \ |
| 34 | Tcl_Obj **objv; \ |
| 35 | int i; |
| 36 | |
| 37 | #define COPY_ARGV_TO_OBJV() \ |
| 38 | objc = argc-1; \ |
| 39 | objv = (Tcl_Obj **)ckalloc((unsigned)(objc * sizeof(Tcl_Obj *))); \ |
| 40 | for(i=1; i<argc; i++){ \ |
| 41 | objv[i-1] = Tcl_NewStringObj(argv[i], argl[i]); \ |
| 42 | Tcl_IncrRefCount(objv[i-1]); \ |
| 43 | } |
| 44 | |
| 45 | #define FREE_ARGV_TO_OBJV() \ |
| 46 | for(i=1; i<argc; i++){ \ |
| 47 | Tcl_DecrRefCount(objv[i-1]); \ |
| 48 | } \ |
| 49 | ckfree((char *)objv); |
| 50 | |
| 51 | /* |
| 52 | ** Fetch the Tcl interpreter from the specified void pointer, cast to a Tcl |
| 53 | ** context. |
| 54 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -30,24 +30,24 @@ | |
| 30 | ** arguments from TH1 to Tcl. |
| 31 | */ |
| 32 | #define USE_ARGV_TO_OBJV() \ |
| 33 | int objc; \ |
| 34 | Tcl_Obj **objv; \ |
| 35 | int obji; |
| 36 | |
| 37 | #define COPY_ARGV_TO_OBJV() \ |
| 38 | objc = argc-1; \ |
| 39 | objv = (Tcl_Obj **)ckalloc((unsigned)(objc * sizeof(Tcl_Obj *))); \ |
| 40 | for(obji=1; obji<argc; obji++){ \ |
| 41 | objv[obji-1] = Tcl_NewStringObj(argv[obji], argl[obji]); \ |
| 42 | Tcl_IncrRefCount(objv[obji-1]); \ |
| 43 | } |
| 44 | |
| 45 | #define FREE_ARGV_TO_OBJV() \ |
| 46 | for(obji=1; obji<argc; obji++){ \ |
| 47 | Tcl_DecrRefCount(objv[obji-1]); \ |
| 48 | } \ |
| 49 | ckfree((char *)objv); |
| 50 | |
| 51 | /* |
| 52 | ** Fetch the Tcl interpreter from the specified void pointer, cast to a Tcl |
| 53 | ** context. |
| 54 |
+11
-4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1513,12 +1513,11 @@ | ||
| 1513 | 1513 | ** 4. Number of non-merge children |
| 1514 | 1514 | ** 5. Number of parents |
| 1515 | 1515 | ** 6. mtime |
| 1516 | 1516 | ** 7. branch |
| 1517 | 1517 | */ |
| 1518 | -void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ | |
| 1519 | - int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; | |
| 1518 | +void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ | |
| 1520 | 1519 | int nLine = 0; |
| 1521 | 1520 | int nEntry = 0; |
| 1522 | 1521 | char zPrevDate[20]; |
| 1523 | 1522 | const char *zCurrentUuid=0; |
| 1524 | 1523 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| @@ -1577,11 +1576,11 @@ | ||
| 1577 | 1576 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | 1577 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | 1578 | n += strlen(zPrefix); |
| 1580 | 1579 | } |
| 1581 | 1580 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | - nLine += comment_print(zFree, 9, width-1); /* record another X lines */ | |
| 1581 | + nLine += comment_print(zFree, 9, width); /* record another X lines */ | |
| 1583 | 1582 | sqlite3_free(zFree); |
| 1584 | 1583 | |
| 1585 | 1584 | if(verboseFlag){ |
| 1586 | 1585 | if( !fchngQueryInit ){ |
| 1587 | 1586 | db_prepare(&fchngQuery, |
| @@ -1690,11 +1689,11 @@ | ||
| 1690 | 1689 | ** t = tickets only |
| 1691 | 1690 | ** w = wiki commits only |
| 1692 | 1691 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | 1692 | ** and the type of each change (edited, deleted, |
| 1694 | 1693 | ** etc.) after the checkin comment. |
| 1695 | -** -W|--width <num> With of lines (default 80). 0=no limit. | |
| 1694 | +** -W|--width <num> With of lines (default 79). Must be >20 or 0. | |
| 1696 | 1695 | */ |
| 1697 | 1696 | void timeline_cmd(void){ |
| 1698 | 1697 | Stmt q; |
| 1699 | 1698 | int n, k, width; |
| 1700 | 1699 | const char *zLimit; |
| @@ -1725,10 +1724,18 @@ | ||
| 1725 | 1724 | } |
| 1726 | 1725 | if( zWidth ){ |
| 1727 | 1726 | width = atoi(zWidth); |
| 1728 | 1727 | }else{ |
| 1729 | 1728 | width = 80; |
| 1729 | + } | |
| 1730 | + if( zWidth ){ | |
| 1731 | + width = atoi(zWidth); | |
| 1732 | + if( (width!=0) && (width<=20) ){ | |
| 1733 | + fossil_fatal("--width|-W value must be >20 or 0"); | |
| 1734 | + } | |
| 1735 | + }else{ | |
| 1736 | + width = 79; | |
| 1730 | 1737 | } |
| 1731 | 1738 | if( g.argc>=4 ){ |
| 1732 | 1739 | k = strlen(g.argv[2]); |
| 1733 | 1740 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1734 | 1741 | mode = 1; |
| 1735 | 1742 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,12 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ |
| 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | int nLine = 0; |
| 1521 | int nEntry = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| @@ -1577,11 +1576,11 @@ | |
| 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | n += strlen(zPrefix); |
| 1580 | } |
| 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | nLine += comment_print(zFree, 9, width-1); /* record another X lines */ |
| 1583 | sqlite3_free(zFree); |
| 1584 | |
| 1585 | if(verboseFlag){ |
| 1586 | if( !fchngQueryInit ){ |
| 1587 | db_prepare(&fchngQuery, |
| @@ -1690,11 +1689,11 @@ | |
| 1690 | ** t = tickets only |
| 1691 | ** w = wiki commits only |
| 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | ** and the type of each change (edited, deleted, |
| 1694 | ** etc.) after the checkin comment. |
| 1695 | ** -W|--width <num> With of lines (default 80). 0=no limit. |
| 1696 | */ |
| 1697 | void timeline_cmd(void){ |
| 1698 | Stmt q; |
| 1699 | int n, k, width; |
| 1700 | const char *zLimit; |
| @@ -1725,10 +1724,18 @@ | |
| 1725 | } |
| 1726 | if( zWidth ){ |
| 1727 | width = atoi(zWidth); |
| 1728 | }else{ |
| 1729 | width = 80; |
| 1730 | } |
| 1731 | if( g.argc>=4 ){ |
| 1732 | k = strlen(g.argv[2]); |
| 1733 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1734 | mode = 1; |
| 1735 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,12 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ |
| 1519 | int nLine = 0; |
| 1520 | int nEntry = 0; |
| 1521 | char zPrevDate[20]; |
| 1522 | const char *zCurrentUuid=0; |
| 1523 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| @@ -1577,11 +1576,11 @@ | |
| 1576 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1577 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1578 | n += strlen(zPrefix); |
| 1579 | } |
| 1580 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1581 | nLine += comment_print(zFree, 9, width); /* record another X lines */ |
| 1582 | sqlite3_free(zFree); |
| 1583 | |
| 1584 | if(verboseFlag){ |
| 1585 | if( !fchngQueryInit ){ |
| 1586 | db_prepare(&fchngQuery, |
| @@ -1690,11 +1689,11 @@ | |
| 1689 | ** t = tickets only |
| 1690 | ** w = wiki commits only |
| 1691 | ** -v|--verbose Output the list of files changed by each commit |
| 1692 | ** and the type of each change (edited, deleted, |
| 1693 | ** etc.) after the checkin comment. |
| 1694 | ** -W|--width <num> With of lines (default 79). Must be >20 or 0. |
| 1695 | */ |
| 1696 | void timeline_cmd(void){ |
| 1697 | Stmt q; |
| 1698 | int n, k, width; |
| 1699 | const char *zLimit; |
| @@ -1725,10 +1724,18 @@ | |
| 1724 | } |
| 1725 | if( zWidth ){ |
| 1726 | width = atoi(zWidth); |
| 1727 | }else{ |
| 1728 | width = 80; |
| 1729 | } |
| 1730 | if( zWidth ){ |
| 1731 | width = atoi(zWidth); |
| 1732 | if( (width!=0) && (width<=20) ){ |
| 1733 | fossil_fatal("--width|-W value must be >20 or 0"); |
| 1734 | } |
| 1735 | }else{ |
| 1736 | width = 79; |
| 1737 | } |
| 1738 | if( g.argc>=4 ){ |
| 1739 | k = strlen(g.argv[2]); |
| 1740 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1741 | mode = 1; |
| 1742 |
+11
-4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1513,12 +1513,11 @@ | ||
| 1513 | 1513 | ** 4. Number of non-merge children |
| 1514 | 1514 | ** 5. Number of parents |
| 1515 | 1515 | ** 6. mtime |
| 1516 | 1516 | ** 7. branch |
| 1517 | 1517 | */ |
| 1518 | -void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ | |
| 1519 | - int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; | |
| 1518 | +void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ | |
| 1520 | 1519 | int nLine = 0; |
| 1521 | 1520 | int nEntry = 0; |
| 1522 | 1521 | char zPrevDate[20]; |
| 1523 | 1522 | const char *zCurrentUuid=0; |
| 1524 | 1523 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| @@ -1577,11 +1576,11 @@ | ||
| 1577 | 1576 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | 1577 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | 1578 | n += strlen(zPrefix); |
| 1580 | 1579 | } |
| 1581 | 1580 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | - nLine += comment_print(zFree, 9, width-1); /* record another X lines */ | |
| 1581 | + nLine += comment_print(zFree, 9, width); /* record another X lines */ | |
| 1583 | 1582 | sqlite3_free(zFree); |
| 1584 | 1583 | |
| 1585 | 1584 | if(verboseFlag){ |
| 1586 | 1585 | if( !fchngQueryInit ){ |
| 1587 | 1586 | db_prepare(&fchngQuery, |
| @@ -1690,11 +1689,11 @@ | ||
| 1690 | 1689 | ** t = tickets only |
| 1691 | 1690 | ** w = wiki commits only |
| 1692 | 1691 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | 1692 | ** and the type of each change (edited, deleted, |
| 1694 | 1693 | ** etc.) after the checkin comment. |
| 1695 | -** -W|--width <num> With of lines (default 80). 0=no limit. | |
| 1694 | +** -W|--width <num> With of lines (default 79). Must be >20 or 0. | |
| 1696 | 1695 | */ |
| 1697 | 1696 | void timeline_cmd(void){ |
| 1698 | 1697 | Stmt q; |
| 1699 | 1698 | int n, k, width; |
| 1700 | 1699 | const char *zLimit; |
| @@ -1725,10 +1724,18 @@ | ||
| 1725 | 1724 | } |
| 1726 | 1725 | if( zWidth ){ |
| 1727 | 1726 | width = atoi(zWidth); |
| 1728 | 1727 | }else{ |
| 1729 | 1728 | width = 80; |
| 1729 | + } | |
| 1730 | + if( zWidth ){ | |
| 1731 | + width = atoi(zWidth); | |
| 1732 | + if( (width!=0) && (width<=20) ){ | |
| 1733 | + fossil_fatal("--width|-W value must be >20 or 0"); | |
| 1734 | + } | |
| 1735 | + }else{ | |
| 1736 | + width = 79; | |
| 1730 | 1737 | } |
| 1731 | 1738 | if( g.argc>=4 ){ |
| 1732 | 1739 | k = strlen(g.argv[2]); |
| 1733 | 1740 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1734 | 1741 | mode = 1; |
| 1735 | 1742 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,12 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int nLimit, int width, int verboseFlag){ |
| 1519 | int nAbsLimit = (nLimit >= 0) ? nLimit : -nLimit; |
| 1520 | int nLine = 0; |
| 1521 | int nEntry = 0; |
| 1522 | char zPrevDate[20]; |
| 1523 | const char *zCurrentUuid=0; |
| 1524 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| @@ -1577,11 +1576,11 @@ | |
| 1577 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1578 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1579 | n += strlen(zPrefix); |
| 1580 | } |
| 1581 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1582 | nLine += comment_print(zFree, 9, width-1); /* record another X lines */ |
| 1583 | sqlite3_free(zFree); |
| 1584 | |
| 1585 | if(verboseFlag){ |
| 1586 | if( !fchngQueryInit ){ |
| 1587 | db_prepare(&fchngQuery, |
| @@ -1690,11 +1689,11 @@ | |
| 1690 | ** t = tickets only |
| 1691 | ** w = wiki commits only |
| 1692 | ** -v|--verbose Output the list of files changed by each commit |
| 1693 | ** and the type of each change (edited, deleted, |
| 1694 | ** etc.) after the checkin comment. |
| 1695 | ** -W|--width <num> With of lines (default 80). 0=no limit. |
| 1696 | */ |
| 1697 | void timeline_cmd(void){ |
| 1698 | Stmt q; |
| 1699 | int n, k, width; |
| 1700 | const char *zLimit; |
| @@ -1725,10 +1724,18 @@ | |
| 1725 | } |
| 1726 | if( zWidth ){ |
| 1727 | width = atoi(zWidth); |
| 1728 | }else{ |
| 1729 | width = 80; |
| 1730 | } |
| 1731 | if( g.argc>=4 ){ |
| 1732 | k = strlen(g.argv[2]); |
| 1733 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1734 | mode = 1; |
| 1735 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1513,12 +1513,11 @@ | |
| 1513 | ** 4. Number of non-merge children |
| 1514 | ** 5. Number of parents |
| 1515 | ** 6. mtime |
| 1516 | ** 7. branch |
| 1517 | */ |
| 1518 | void print_timeline(Stmt *q, int mxLine, int width, int verboseFlag){ |
| 1519 | int nLine = 0; |
| 1520 | int nEntry = 0; |
| 1521 | char zPrevDate[20]; |
| 1522 | const char *zCurrentUuid=0; |
| 1523 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| @@ -1577,11 +1576,11 @@ | |
| 1576 | if( fossil_strcmp(zCurrentUuid,zId)==0 ){ |
| 1577 | sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* "); |
| 1578 | n += strlen(zPrefix); |
| 1579 | } |
| 1580 | zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom); |
| 1581 | nLine += comment_print(zFree, 9, width); /* record another X lines */ |
| 1582 | sqlite3_free(zFree); |
| 1583 | |
| 1584 | if(verboseFlag){ |
| 1585 | if( !fchngQueryInit ){ |
| 1586 | db_prepare(&fchngQuery, |
| @@ -1690,11 +1689,11 @@ | |
| 1689 | ** t = tickets only |
| 1690 | ** w = wiki commits only |
| 1691 | ** -v|--verbose Output the list of files changed by each commit |
| 1692 | ** and the type of each change (edited, deleted, |
| 1693 | ** etc.) after the checkin comment. |
| 1694 | ** -W|--width <num> With of lines (default 79). Must be >20 or 0. |
| 1695 | */ |
| 1696 | void timeline_cmd(void){ |
| 1697 | Stmt q; |
| 1698 | int n, k, width; |
| 1699 | const char *zLimit; |
| @@ -1725,10 +1724,18 @@ | |
| 1724 | } |
| 1725 | if( zWidth ){ |
| 1726 | width = atoi(zWidth); |
| 1727 | }else{ |
| 1728 | width = 80; |
| 1729 | } |
| 1730 | if( zWidth ){ |
| 1731 | width = atoi(zWidth); |
| 1732 | if( (width!=0) && (width<=20) ){ |
| 1733 | fossil_fatal("--width|-W value must be >20 or 0"); |
| 1734 | } |
| 1735 | }else{ |
| 1736 | width = 79; |
| 1737 | } |
| 1738 | if( g.argc>=4 ){ |
| 1739 | k = strlen(g.argv[2]); |
| 1740 | if( strncmp(g.argv[2],"before",k)==0 ){ |
| 1741 | mode = 1; |
| 1742 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -188,11 +188,11 @@ | ||
| 188 | 188 | "%s " |
| 189 | 189 | " AND event.objid IN leaves" |
| 190 | 190 | " ORDER BY event.mtime DESC", |
| 191 | 191 | timeline_query_for_tty() |
| 192 | 192 | ); |
| 193 | - print_timeline(&q, -100, 80, 0); | |
| 193 | + print_timeline(&q, 100, 79, 0); | |
| 194 | 194 | db_finalize(&q); |
| 195 | 195 | fossil_fatal("Multiple descendants"); |
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 | 199 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -188,11 +188,11 @@ | |
| 188 | "%s " |
| 189 | " AND event.objid IN leaves" |
| 190 | " ORDER BY event.mtime DESC", |
| 191 | timeline_query_for_tty() |
| 192 | ); |
| 193 | print_timeline(&q, -100, 80, 0); |
| 194 | db_finalize(&q); |
| 195 | fossil_fatal("Multiple descendants"); |
| 196 | } |
| 197 | } |
| 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -188,11 +188,11 @@ | |
| 188 | "%s " |
| 189 | " AND event.objid IN leaves" |
| 190 | " ORDER BY event.mtime DESC", |
| 191 | timeline_query_for_tty() |
| 192 | ); |
| 193 | print_timeline(&q, 100, 79, 0); |
| 194 | db_finalize(&q); |
| 195 | fossil_fatal("Multiple descendants"); |
| 196 | } |
| 197 | } |
| 198 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 199 |
+2
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -18,10 +18,12 @@ | ||
| 18 | 18 | supply REQUEST_URI. |
| 19 | 19 | * Add options --dirsonly, --emptydirs, and --allckouts to the |
| 20 | 20 | "[/help?cmd=clean | fossil clean]" command. |
| 21 | 21 | * Ten-fold performance improvement in large "fossil blame" or |
| 22 | 22 | "fossil annotate" commands. |
| 23 | + * Add option -W|--width to the "[/help?cmd=timeline | fossil timeline]" | |
| 24 | + and "[/help?cmd=finfo | fossil finfo]" commands. | |
| 23 | 25 | |
| 24 | 26 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 25 | 27 | * Enhance the [/help?cmd=changes | fossil changes], |
| 26 | 28 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 27 | 29 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 28 | 30 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -18,10 +18,12 @@ | |
| 18 | supply REQUEST_URI. |
| 19 | * Add options --dirsonly, --emptydirs, and --allckouts to the |
| 20 | "[/help?cmd=clean | fossil clean]" command. |
| 21 | * Ten-fold performance improvement in large "fossil blame" or |
| 22 | "fossil annotate" commands. |
| 23 | |
| 24 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 25 | * Enhance the [/help?cmd=changes | fossil changes], |
| 26 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 27 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 28 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -18,10 +18,12 @@ | |
| 18 | supply REQUEST_URI. |
| 19 | * Add options --dirsonly, --emptydirs, and --allckouts to the |
| 20 | "[/help?cmd=clean | fossil clean]" command. |
| 21 | * Ten-fold performance improvement in large "fossil blame" or |
| 22 | "fossil annotate" commands. |
| 23 | * Add option -W|--width to the "[/help?cmd=timeline | fossil timeline]" |
| 24 | and "[/help?cmd=finfo | fossil finfo]" commands. |
| 25 | |
| 26 | <h2>Changes For Version 1.27 (2013-09-11)</h2> |
| 27 | * Enhance the [/help?cmd=changes | fossil changes], |
| 28 | [/help?cmd=clean | fossil clean], [/help?cmd=extras | fossil extras], |
| 29 | [/help?cmd=ls | fossil ls] and [/help?cmd=status | fossil status] commands |
| 30 |