Fossil SCM
Make sure the --width option is honored by all calls into print_timeline().
Commit
e3df30f45c920682febe0e8ac886f434e5840898
Parent
2920e7df00b9d96…
4 files changed
+18
-4
+3
-2
+3
-2
+14
-1
+18
-4
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -291,18 +291,31 @@ | ||
| 291 | 291 | ** Find all leaf descendants of the baseline specified or if the argument |
| 292 | 292 | ** is omitted, of the baseline currently checked out. |
| 293 | 293 | ** |
| 294 | 294 | ** Options: |
| 295 | 295 | ** -R|--repository FILE Extract info from repository FILE |
| 296 | +** -W|--width <num> Width of lines (default is to auto-detect). | |
| 297 | +** Must be >20 or 0 (= no limit, resulting in a | |
| 298 | +** single line per entry). | |
| 296 | 299 | ** |
| 297 | 300 | ** See also: finfo, info, leaves |
| 298 | 301 | */ |
| 299 | 302 | void descendants_cmd(void){ |
| 300 | 303 | Stmt q; |
| 301 | - int base; | |
| 304 | + int base, width; | |
| 305 | + const char *zWidth; | |
| 302 | 306 | |
| 303 | 307 | db_find_and_open_repository(0,0); |
| 308 | + zWidth = find_option("width","W",1); | |
| 309 | + if( zWidth ){ | |
| 310 | + width = atoi(zWidth); | |
| 311 | + if( (width!=0) && (width<=20) ){ | |
| 312 | + fossil_fatal("-W|--width value must be >20 or 0"); | |
| 313 | + } | |
| 314 | + }else{ | |
| 315 | + width = -1; | |
| 316 | + } | |
| 304 | 317 | if( g.argc==2 ){ |
| 305 | 318 | base = db_lget_int("checkout", 0); |
| 306 | 319 | }else{ |
| 307 | 320 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 308 | 321 | } |
| @@ -312,11 +325,11 @@ | ||
| 312 | 325 | "%s" |
| 313 | 326 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 314 | 327 | " ORDER BY event.mtime DESC", |
| 315 | 328 | timeline_query_for_tty() |
| 316 | 329 | ); |
| 317 | - print_timeline(&q, -20, 79, 0); | |
| 330 | + print_timeline(&q, -20, width, 0); | |
| 318 | 331 | db_finalize(&q); |
| 319 | 332 | } |
| 320 | 333 | |
| 321 | 334 | /* |
| 322 | 335 | ** COMMAND: leaves* |
| @@ -333,12 +346,13 @@ | ||
| 333 | 346 | ** Options: |
| 334 | 347 | ** -a|--all show ALL leaves |
| 335 | 348 | ** -c|--closed show only closed leaves |
| 336 | 349 | ** --bybranch order output by branch name |
| 337 | 350 | ** --recompute recompute the "leaf" table in the repository DB |
| 338 | -** -W|--width <num> With of lines (default 79). Must be >39 or 0 | |
| 339 | -** (= no limit, resulting in a single line per entry). | |
| 351 | +** -W|--width <num> Width of lines (default is to auto-detect). Must be | |
| 352 | +** >39 or 0 (= no limit, resulting in a single line per | |
| 353 | +** entry). | |
| 340 | 354 | ** |
| 341 | 355 | ** See also: descendants, finfo, info, branch |
| 342 | 356 | */ |
| 343 | 357 | void leaves_cmd(void){ |
| 344 | 358 | Stmt q; |
| 345 | 359 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -291,18 +291,31 @@ | |
| 291 | ** Find all leaf descendants of the baseline specified or if the argument |
| 292 | ** is omitted, of the baseline currently checked out. |
| 293 | ** |
| 294 | ** Options: |
| 295 | ** -R|--repository FILE Extract info from repository FILE |
| 296 | ** |
| 297 | ** See also: finfo, info, leaves |
| 298 | */ |
| 299 | void descendants_cmd(void){ |
| 300 | Stmt q; |
| 301 | int base; |
| 302 | |
| 303 | db_find_and_open_repository(0,0); |
| 304 | if( g.argc==2 ){ |
| 305 | base = db_lget_int("checkout", 0); |
| 306 | }else{ |
| 307 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 308 | } |
| @@ -312,11 +325,11 @@ | |
| 312 | "%s" |
| 313 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 314 | " ORDER BY event.mtime DESC", |
| 315 | timeline_query_for_tty() |
| 316 | ); |
| 317 | print_timeline(&q, -20, 79, 0); |
| 318 | db_finalize(&q); |
| 319 | } |
| 320 | |
| 321 | /* |
| 322 | ** COMMAND: leaves* |
| @@ -333,12 +346,13 @@ | |
| 333 | ** Options: |
| 334 | ** -a|--all show ALL leaves |
| 335 | ** -c|--closed show only closed leaves |
| 336 | ** --bybranch order output by branch name |
| 337 | ** --recompute recompute the "leaf" table in the repository DB |
| 338 | ** -W|--width <num> With of lines (default 79). Must be >39 or 0 |
| 339 | ** (= no limit, resulting in a single line per entry). |
| 340 | ** |
| 341 | ** See also: descendants, finfo, info, branch |
| 342 | */ |
| 343 | void leaves_cmd(void){ |
| 344 | Stmt q; |
| 345 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -291,18 +291,31 @@ | |
| 291 | ** Find all leaf descendants of the baseline specified or if the argument |
| 292 | ** is omitted, of the baseline currently checked out. |
| 293 | ** |
| 294 | ** Options: |
| 295 | ** -R|--repository FILE Extract info from repository FILE |
| 296 | ** -W|--width <num> Width of lines (default is to auto-detect). |
| 297 | ** Must be >20 or 0 (= no limit, resulting in a |
| 298 | ** single line per entry). |
| 299 | ** |
| 300 | ** See also: finfo, info, leaves |
| 301 | */ |
| 302 | void descendants_cmd(void){ |
| 303 | Stmt q; |
| 304 | int base, width; |
| 305 | const char *zWidth; |
| 306 | |
| 307 | db_find_and_open_repository(0,0); |
| 308 | zWidth = find_option("width","W",1); |
| 309 | if( zWidth ){ |
| 310 | width = atoi(zWidth); |
| 311 | if( (width!=0) && (width<=20) ){ |
| 312 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 313 | } |
| 314 | }else{ |
| 315 | width = -1; |
| 316 | } |
| 317 | if( g.argc==2 ){ |
| 318 | base = db_lget_int("checkout", 0); |
| 319 | }else{ |
| 320 | base = name_to_typed_rid(g.argv[2], "ci"); |
| 321 | } |
| @@ -312,11 +325,11 @@ | |
| 325 | "%s" |
| 326 | " AND event.objid IN (SELECT rid FROM leaves)" |
| 327 | " ORDER BY event.mtime DESC", |
| 328 | timeline_query_for_tty() |
| 329 | ); |
| 330 | print_timeline(&q, -20, width, 0); |
| 331 | db_finalize(&q); |
| 332 | } |
| 333 | |
| 334 | /* |
| 335 | ** COMMAND: leaves* |
| @@ -333,12 +346,13 @@ | |
| 346 | ** Options: |
| 347 | ** -a|--all show ALL leaves |
| 348 | ** -c|--closed show only closed leaves |
| 349 | ** --bybranch order output by branch name |
| 350 | ** --recompute recompute the "leaf" table in the repository DB |
| 351 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be |
| 352 | ** >39 or 0 (= no limit, resulting in a single line per |
| 353 | ** entry). |
| 354 | ** |
| 355 | ** See also: descendants, finfo, info, branch |
| 356 | */ |
| 357 | void leaves_cmd(void){ |
| 358 | Stmt q; |
| 359 |
+3
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -49,12 +49,13 @@ | ||
| 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 | |
| 55 | -** (= no limit, resulting in a single line per entry). | |
| 54 | +** -W|--width <num> Width of lines (default is to auto-detect). Must be | |
| 55 | +** >22 or 0 (= no limit, resulting in a single line per | |
| 56 | +** entry). | |
| 56 | 57 | ** |
| 57 | 58 | ** See also: artifact, cat, descendants, info, leaves |
| 58 | 59 | */ |
| 59 | 60 | void finfo_cmd(void){ |
| 60 | 61 | capture_case_sensitive_option(); |
| 61 | 62 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -49,12 +49,13 @@ | |
| 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 | ** (= no limit, resulting in a single line per entry). |
| 56 | ** |
| 57 | ** See also: artifact, cat, descendants, info, leaves |
| 58 | */ |
| 59 | void finfo_cmd(void){ |
| 60 | capture_case_sensitive_option(); |
| 61 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -49,12 +49,13 @@ | |
| 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> Width of lines (default is to auto-detect). Must be |
| 55 | ** >22 or 0 (= no limit, resulting in a single line per |
| 56 | ** entry). |
| 57 | ** |
| 58 | ** See also: artifact, cat, descendants, info, leaves |
| 59 | */ |
| 60 | void finfo_cmd(void){ |
| 61 | capture_case_sensitive_option(); |
| 62 |
+3
-2
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1737,12 +1737,13 @@ | ||
| 1737 | 1737 | ** t = tickets only |
| 1738 | 1738 | ** w = wiki commits only |
| 1739 | 1739 | ** -v|--verbose Output the list of files changed by each commit |
| 1740 | 1740 | ** and the type of each change (edited, deleted, |
| 1741 | 1741 | ** etc.) after the checkin comment. |
| 1742 | -** -W|--width <num> With of lines (default 79). Must be >20 or 0 | |
| 1743 | -** (= no limit, resulting in a single line per entry). | |
| 1742 | +** -W|--width <num> Width of lines (default is to auto-detect). Must be | |
| 1743 | +** >20 or 0 (= no limit, resulting in a single line per | |
| 1744 | +** entry). | |
| 1744 | 1745 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 1745 | 1746 | ** the current checkout's repository. |
| 1746 | 1747 | */ |
| 1747 | 1748 | void timeline_cmd(void){ |
| 1748 | 1749 | Stmt q; |
| 1749 | 1750 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1737,12 +1737,13 @@ | |
| 1737 | ** t = tickets only |
| 1738 | ** w = wiki commits only |
| 1739 | ** -v|--verbose Output the list of files changed by each commit |
| 1740 | ** and the type of each change (edited, deleted, |
| 1741 | ** etc.) after the checkin comment. |
| 1742 | ** -W|--width <num> With of lines (default 79). Must be >20 or 0 |
| 1743 | ** (= no limit, resulting in a single line per entry). |
| 1744 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 1745 | ** the current checkout's repository. |
| 1746 | */ |
| 1747 | void timeline_cmd(void){ |
| 1748 | Stmt q; |
| 1749 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1737,12 +1737,13 @@ | |
| 1737 | ** t = tickets only |
| 1738 | ** w = wiki commits only |
| 1739 | ** -v|--verbose Output the list of files changed by each commit |
| 1740 | ** and the type of each change (edited, deleted, |
| 1741 | ** etc.) after the checkin comment. |
| 1742 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be |
| 1743 | ** >20 or 0 (= no limit, resulting in a single line per |
| 1744 | ** entry). |
| 1745 | ** -R REPO_FILE Specifies the repository db to use. Default is |
| 1746 | ** the current checkout's repository. |
| 1747 | */ |
| 1748 | void timeline_cmd(void){ |
| 1749 | Stmt q; |
| 1750 |
+14
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -91,10 +91,12 @@ | ||
| 91 | 91 | ** --debug print debug information on stdout |
| 92 | 92 | ** --latest acceptable in place of VERSION, update to latest version |
| 93 | 93 | ** --force-missing force update if missing content after sync |
| 94 | 94 | ** -n|--dry-run If given, display instead of run actions |
| 95 | 95 | ** -v|--verbose print status information about all files |
| 96 | +** -W|--width <num> Width of lines (default is to auto-detect). Must be >20 | |
| 97 | +** or 0 (= no limit, resulting in a single line per entry). | |
| 96 | 98 | ** |
| 97 | 99 | ** See also: revert |
| 98 | 100 | */ |
| 99 | 101 | void update_cmd(void){ |
| 100 | 102 | int vid; /* Current version */ |
| @@ -110,15 +112,26 @@ | ||
| 110 | 112 | int *aChng; /* Array of file renames */ |
| 111 | 113 | int i; /* Loop counter */ |
| 112 | 114 | int nConflict = 0; /* Number of merge conflicts */ |
| 113 | 115 | int nOverwrite = 0; /* Number of unmanaged files overwritten */ |
| 114 | 116 | int nUpdate = 0; /* Number of changes of any kind */ |
| 117 | + int width; /* Width of printed comment lines */ | |
| 115 | 118 | Stmt mtimeXfer; /* Statement to transfer mtimes */ |
| 119 | + const char *zWidth; /* Width option string value */ | |
| 116 | 120 | |
| 117 | 121 | if( !internalUpdate ){ |
| 118 | 122 | undo_capture_command_line(); |
| 119 | 123 | url_proxy_options(); |
| 124 | + } | |
| 125 | + zWidth = find_option("width","W",1); | |
| 126 | + if( zWidth ){ | |
| 127 | + width = atoi(zWidth); | |
| 128 | + if( (width!=0) && (width<=20) ){ | |
| 129 | + fossil_fatal("-W|--width value must be >20 or 0"); | |
| 130 | + } | |
| 131 | + }else{ | |
| 132 | + width = -1; | |
| 120 | 133 | } |
| 121 | 134 | latestFlag = find_option("latest",0, 0)!=0; |
| 122 | 135 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 123 | 136 | if( !dryRunFlag ){ |
| 124 | 137 | dryRunFlag = find_option("nochange",0,0)!=0; /* deprecated */ |
| @@ -191,11 +204,11 @@ | ||
| 191 | 204 | "%s " |
| 192 | 205 | " AND event.objid IN leaves" |
| 193 | 206 | " ORDER BY event.mtime DESC", |
| 194 | 207 | timeline_query_for_tty() |
| 195 | 208 | ); |
| 196 | - print_timeline(&q, -100, 79, 0); | |
| 209 | + print_timeline(&q, -100, width, 0); | |
| 197 | 210 | db_finalize(&q); |
| 198 | 211 | fossil_fatal("Multiple descendants"); |
| 199 | 212 | } |
| 200 | 213 | } |
| 201 | 214 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 202 | 215 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -91,10 +91,12 @@ | |
| 91 | ** --debug print debug information on stdout |
| 92 | ** --latest acceptable in place of VERSION, update to latest version |
| 93 | ** --force-missing force update if missing content after sync |
| 94 | ** -n|--dry-run If given, display instead of run actions |
| 95 | ** -v|--verbose print status information about all files |
| 96 | ** |
| 97 | ** See also: revert |
| 98 | */ |
| 99 | void update_cmd(void){ |
| 100 | int vid; /* Current version */ |
| @@ -110,15 +112,26 @@ | |
| 110 | int *aChng; /* Array of file renames */ |
| 111 | int i; /* Loop counter */ |
| 112 | int nConflict = 0; /* Number of merge conflicts */ |
| 113 | int nOverwrite = 0; /* Number of unmanaged files overwritten */ |
| 114 | int nUpdate = 0; /* Number of changes of any kind */ |
| 115 | Stmt mtimeXfer; /* Statement to transfer mtimes */ |
| 116 | |
| 117 | if( !internalUpdate ){ |
| 118 | undo_capture_command_line(); |
| 119 | url_proxy_options(); |
| 120 | } |
| 121 | latestFlag = find_option("latest",0, 0)!=0; |
| 122 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 123 | if( !dryRunFlag ){ |
| 124 | dryRunFlag = find_option("nochange",0,0)!=0; /* deprecated */ |
| @@ -191,11 +204,11 @@ | |
| 191 | "%s " |
| 192 | " AND event.objid IN leaves" |
| 193 | " ORDER BY event.mtime DESC", |
| 194 | timeline_query_for_tty() |
| 195 | ); |
| 196 | print_timeline(&q, -100, 79, 0); |
| 197 | db_finalize(&q); |
| 198 | fossil_fatal("Multiple descendants"); |
| 199 | } |
| 200 | } |
| 201 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 202 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -91,10 +91,12 @@ | |
| 91 | ** --debug print debug information on stdout |
| 92 | ** --latest acceptable in place of VERSION, update to latest version |
| 93 | ** --force-missing force update if missing content after sync |
| 94 | ** -n|--dry-run If given, display instead of run actions |
| 95 | ** -v|--verbose print status information about all files |
| 96 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20 |
| 97 | ** or 0 (= no limit, resulting in a single line per entry). |
| 98 | ** |
| 99 | ** See also: revert |
| 100 | */ |
| 101 | void update_cmd(void){ |
| 102 | int vid; /* Current version */ |
| @@ -110,15 +112,26 @@ | |
| 112 | int *aChng; /* Array of file renames */ |
| 113 | int i; /* Loop counter */ |
| 114 | int nConflict = 0; /* Number of merge conflicts */ |
| 115 | int nOverwrite = 0; /* Number of unmanaged files overwritten */ |
| 116 | int nUpdate = 0; /* Number of changes of any kind */ |
| 117 | int width; /* Width of printed comment lines */ |
| 118 | Stmt mtimeXfer; /* Statement to transfer mtimes */ |
| 119 | const char *zWidth; /* Width option string value */ |
| 120 | |
| 121 | if( !internalUpdate ){ |
| 122 | undo_capture_command_line(); |
| 123 | url_proxy_options(); |
| 124 | } |
| 125 | zWidth = find_option("width","W",1); |
| 126 | if( zWidth ){ |
| 127 | width = atoi(zWidth); |
| 128 | if( (width!=0) && (width<=20) ){ |
| 129 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 130 | } |
| 131 | }else{ |
| 132 | width = -1; |
| 133 | } |
| 134 | latestFlag = find_option("latest",0, 0)!=0; |
| 135 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| 136 | if( !dryRunFlag ){ |
| 137 | dryRunFlag = find_option("nochange",0,0)!=0; /* deprecated */ |
| @@ -191,11 +204,11 @@ | |
| 204 | "%s " |
| 205 | " AND event.objid IN leaves" |
| 206 | " ORDER BY event.mtime DESC", |
| 207 | timeline_query_for_tty() |
| 208 | ); |
| 209 | print_timeline(&q, -100, width, 0); |
| 210 | db_finalize(&q); |
| 211 | fossil_fatal("Multiple descendants"); |
| 212 | } |
| 213 | } |
| 214 | tid = db_int(0, "SELECT rid FROM leaves, event" |
| 215 |