Fossil SCM
Automatically adjust the width of printed comments according to the detected terminal width.
Commit
0ff6a9e282cf83566d6563b3210aa74c7fb437bc
Parent
3467da790134783…
11 files changed
+1
-1
+22
+1
-1
+7
-3
+1
-1
+2
-2
+3
-3
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | 394 | fossil_free(z); |
| 395 | - comment_print(aBisectOption[i].zDesc, 27, 79); | |
| 395 | + comment_print(aBisectOption[i].zDesc, 27, -1); | |
| 396 | 396 | } |
| 397 | 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | 398 | unsigned int i; |
| 399 | 399 | n = strlen(g.argv[3]); |
| 400 | 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 | 401 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | fossil_free(z); |
| 395 | comment_print(aBisectOption[i].zDesc, 27, 79); |
| 396 | } |
| 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | unsigned int i; |
| 399 | n = strlen(g.argv[3]); |
| 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | fossil_free(z); |
| 395 | comment_print(aBisectOption[i].zDesc, 27, -1); |
| 396 | } |
| 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | unsigned int i; |
| 399 | n = strlen(g.argv[3]); |
| 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 |
+22
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -19,10 +19,15 @@ | ||
| 19 | 19 | ** text on a TTY. |
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "comformat.h" |
| 23 | 23 | #include <assert.h> |
| 24 | +#ifdef _WIN32 | |
| 25 | +# include <windows.h> | |
| 26 | +#else | |
| 27 | +# include <termios.h> | |
| 28 | +#endif | |
| 24 | 29 | |
| 25 | 30 | /* |
| 26 | 31 | ** Given a comment string zText, format that string for printing |
| 27 | 32 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | 33 | ** the left margin and that a single line can contain no more than |
| @@ -36,10 +41,27 @@ | ||
| 36 | 41 | int doIndent = 0; |
| 37 | 42 | char *zBuf; |
| 38 | 43 | char zBuffer[400]; |
| 39 | 44 | int lineCnt = 0; |
| 40 | 45 | |
| 46 | +#if defined(_WIN32) | |
| 47 | + if( lineLength<0 ){ | |
| 48 | + CONSOLE_SCREEN_BUFFER_INFO csbi; | |
| 49 | + memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO)); | |
| 50 | + if( GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) ){ | |
| 51 | + tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent; | |
| 52 | + } | |
| 53 | + } | |
| 54 | +#elif defined(TIOCGWINSZ) | |
| 55 | + if( lineLength<0 ){ | |
| 56 | + struct winsize w; | |
| 57 | + memset(&w, 0, sizeof(struct winsize)); | |
| 58 | + if( ioctl(0, TIOCGWINSZ, &w)!=-1 ){ | |
| 59 | + tlen = w.ws_col - indent; | |
| 60 | + } | |
| 61 | + } | |
| 62 | +#endif | |
| 41 | 63 | if( zText==0 ) zText = "(NULL)"; |
| 42 | 64 | if( tlen<=0 ){ |
| 43 | 65 | tlen = strlen(zText); |
| 44 | 66 | } |
| 45 | 67 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 | 68 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -19,10 +19,15 @@ | |
| 19 | ** text on a TTY. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "comformat.h" |
| 23 | #include <assert.h> |
| 24 | |
| 25 | /* |
| 26 | ** Given a comment string zText, format that string for printing |
| 27 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | ** the left margin and that a single line can contain no more than |
| @@ -36,10 +41,27 @@ | |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( zText==0 ) zText = "(NULL)"; |
| 42 | if( tlen<=0 ){ |
| 43 | tlen = strlen(zText); |
| 44 | } |
| 45 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -19,10 +19,15 @@ | |
| 19 | ** text on a TTY. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "comformat.h" |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | #else |
| 27 | # include <termios.h> |
| 28 | #endif |
| 29 | |
| 30 | /* |
| 31 | ** Given a comment string zText, format that string for printing |
| 32 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 33 | ** the left margin and that a single line can contain no more than |
| @@ -36,10 +41,27 @@ | |
| 41 | int doIndent = 0; |
| 42 | char *zBuf; |
| 43 | char zBuffer[400]; |
| 44 | int lineCnt = 0; |
| 45 | |
| 46 | #if defined(_WIN32) |
| 47 | if( lineLength<0 ){ |
| 48 | CONSOLE_SCREEN_BUFFER_INFO csbi; |
| 49 | memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO)); |
| 50 | if( GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) ){ |
| 51 | tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent; |
| 52 | } |
| 53 | } |
| 54 | #elif defined(TIOCGWINSZ) |
| 55 | if( lineLength<0 ){ |
| 56 | struct winsize w; |
| 57 | memset(&w, 0, sizeof(struct winsize)); |
| 58 | if( ioctl(0, TIOCGWINSZ, &w)!=-1 ){ |
| 59 | tlen = w.ws_col - indent; |
| 60 | } |
| 61 | } |
| 62 | #endif |
| 63 | if( zText==0 ) zText = "(NULL)"; |
| 64 | if( tlen<=0 ){ |
| 65 | tlen = strlen(zText); |
| 66 | } |
| 67 | if( tlen >= (sizeof(zBuffer)) ){ |
| 68 |
+1
-1
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -356,11 +356,11 @@ | ||
| 356 | 356 | width = atoi(zWidth); |
| 357 | 357 | if( (width!=0) && (width<=39) ){ |
| 358 | 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | 359 | } |
| 360 | 360 | }else{ |
| 361 | - width = 79; | |
| 361 | + width = -1; | |
| 362 | 362 | } |
| 363 | 363 | db_find_and_open_repository(0,0); |
| 364 | 364 | if( recomputeFlag ) leaf_rebuild(); |
| 365 | 365 | blob_zero(&sql); |
| 366 | 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 367 | 367 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -356,11 +356,11 @@ | |
| 356 | width = atoi(zWidth); |
| 357 | if( (width!=0) && (width<=39) ){ |
| 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | } |
| 360 | }else{ |
| 361 | width = 79; |
| 362 | } |
| 363 | db_find_and_open_repository(0,0); |
| 364 | if( recomputeFlag ) leaf_rebuild(); |
| 365 | blob_zero(&sql); |
| 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 367 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -356,11 +356,11 @@ | |
| 356 | width = atoi(zWidth); |
| 357 | if( (width!=0) && (width<=39) ){ |
| 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | } |
| 360 | }else{ |
| 361 | width = -1; |
| 362 | } |
| 363 | db_find_and_open_repository(0,0); |
| 364 | if( recomputeFlag ) leaf_rebuild(); |
| 365 | blob_zero(&sql); |
| 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 367 |
+7
-3
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -146,16 +146,20 @@ | ||
| 146 | 146 | /* this is the default, no-op */ |
| 147 | 147 | } |
| 148 | 148 | zLimit = find_option("limit","n",1); |
| 149 | 149 | zWidth = find_option("width","W",1); |
| 150 | 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | - iWidth = zWidth ? atoi(zWidth) : 79; | |
| 152 | 151 | zOffset = find_option("offset",0,1); |
| 153 | 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 154 | 153 | iBrief = (find_option("brief","b",0) == 0); |
| 155 | - if( (iWidth!=0) && (iWidth<=22) ){ | |
| 156 | - fossil_fatal("-W|--width value must be >22 or 0"); | |
| 154 | + if( zWidth ){ | |
| 155 | + iWidth = atoi(zWidth); | |
| 156 | + if( (iWidth!=0) && (iWidth<=22) ){ | |
| 157 | + fossil_fatal("-W|--width value must be >22 or 0"); | |
| 158 | + } | |
| 159 | + }else{ | |
| 160 | + iWidth = -1; | |
| 157 | 161 | } |
| 158 | 162 | if( g.argc!=3 ){ |
| 159 | 163 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 160 | 164 | } |
| 161 | 165 | file_tree_name(g.argv[2], &fname, 1); |
| 162 | 166 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -146,16 +146,20 @@ | |
| 146 | /* this is the default, no-op */ |
| 147 | } |
| 148 | zLimit = find_option("limit","n",1); |
| 149 | zWidth = find_option("width","W",1); |
| 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | iWidth = zWidth ? atoi(zWidth) : 79; |
| 152 | zOffset = find_option("offset",0,1); |
| 153 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 154 | iBrief = (find_option("brief","b",0) == 0); |
| 155 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 156 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 157 | } |
| 158 | if( g.argc!=3 ){ |
| 159 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 160 | } |
| 161 | file_tree_name(g.argv[2], &fname, 1); |
| 162 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -146,16 +146,20 @@ | |
| 146 | /* this is the default, no-op */ |
| 147 | } |
| 148 | zLimit = find_option("limit","n",1); |
| 149 | zWidth = find_option("width","W",1); |
| 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | zOffset = find_option("offset",0,1); |
| 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 153 | iBrief = (find_option("brief","b",0) == 0); |
| 154 | if( zWidth ){ |
| 155 | iWidth = atoi(zWidth); |
| 156 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 157 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 158 | } |
| 159 | }else{ |
| 160 | iWidth = -1; |
| 161 | } |
| 162 | if( g.argc!=3 ){ |
| 163 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 164 | } |
| 165 | file_tree_name(g.argv[2], &fname, 1); |
| 166 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -132,11 +132,11 @@ | ||
| 132 | 132 | fossil_print("tags: %s\n", zTags); |
| 133 | 133 | } |
| 134 | 134 | free(zTags); |
| 135 | 135 | if( zComment ){ |
| 136 | 136 | fossil_print("comment: "); |
| 137 | - comment_print(zComment, 14, 79); | |
| 137 | + comment_print(zComment, 14, -1); | |
| 138 | 138 | free(zComment); |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -132,11 +132,11 @@ | |
| 132 | fossil_print("tags: %s\n", zTags); |
| 133 | } |
| 134 | free(zTags); |
| 135 | if( zComment ){ |
| 136 | fossil_print("comment: "); |
| 137 | comment_print(zComment, 14, 79); |
| 138 | free(zComment); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -132,11 +132,11 @@ | |
| 132 | fossil_print("tags: %s\n", zTags); |
| 133 | } |
| 134 | free(zTags); |
| 135 | if( zComment ){ |
| 136 | fossil_print("comment: "); |
| 137 | comment_print(zComment, 14, -1); |
| 138 | free(zComment); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 |
+2
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -47,11 +47,11 @@ | ||
| 47 | 47 | indent-1, zLabel, |
| 48 | 48 | db_column_text(&q, 3), |
| 49 | 49 | db_column_text(&q, 1), |
| 50 | 50 | db_column_text(&q, 0), |
| 51 | 51 | indent, ""); |
| 52 | - comment_print(zCom, indent, 78); | |
| 52 | + comment_print(zCom, indent, -1); | |
| 53 | 53 | fossil_free(zCom); |
| 54 | 54 | } |
| 55 | 55 | db_finalize(&q); |
| 56 | 56 | } |
| 57 | 57 | |
| @@ -210,11 +210,11 @@ | ||
| 210 | 210 | ); |
| 211 | 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | - comment_print(zCom, 0, 79); | |
| 215 | + comment_print(zCom, 0, -1); | |
| 216 | 216 | fossil_free(zCom); |
| 217 | 217 | } |
| 218 | 218 | db_finalize(&q); |
| 219 | 219 | }else{ |
| 220 | 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 | 221 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | indent-1, zLabel, |
| 48 | db_column_text(&q, 3), |
| 49 | db_column_text(&q, 1), |
| 50 | db_column_text(&q, 0), |
| 51 | indent, ""); |
| 52 | comment_print(zCom, indent, 78); |
| 53 | fossil_free(zCom); |
| 54 | } |
| 55 | db_finalize(&q); |
| 56 | } |
| 57 | |
| @@ -210,11 +210,11 @@ | |
| 210 | ); |
| 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | comment_print(zCom, 0, 79); |
| 216 | fossil_free(zCom); |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | }else{ |
| 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | indent-1, zLabel, |
| 48 | db_column_text(&q, 3), |
| 49 | db_column_text(&q, 1), |
| 50 | db_column_text(&q, 0), |
| 51 | indent, ""); |
| 52 | comment_print(zCom, indent, -1); |
| 53 | fossil_free(zCom); |
| 54 | } |
| 55 | db_finalize(&q); |
| 56 | } |
| 57 | |
| @@ -210,11 +210,11 @@ | |
| 210 | ); |
| 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | comment_print(zCom, 0, -1); |
| 216 | fossil_free(zCom); |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | }else{ |
| 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 |
+3
-3
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -582,11 +582,11 @@ | ||
| 582 | 582 | default: zType = "Unknown"; break; |
| 583 | 583 | } |
| 584 | 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | 585 | db_column_text(&q, 1)); |
| 586 | 586 | fossil_print("comment: "); |
| 587 | - comment_print(db_column_text(&q,3), 12, 78); | |
| 587 | + comment_print(db_column_text(&q,3), 12, -1); | |
| 588 | 588 | } |
| 589 | 589 | db_finalize(&q); |
| 590 | 590 | |
| 591 | 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | ||
| 604 | 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | 605 | db_column_text(&q, 1), |
| 606 | 606 | db_column_text(&q, 3), |
| 607 | 607 | db_column_text(&q, 2)); |
| 608 | 608 | fossil_print(" "); |
| 609 | - comment_print(db_column_text(&q,4), 12, 78); | |
| 609 | + comment_print(db_column_text(&q,4), 12, -1); | |
| 610 | 610 | } |
| 611 | 611 | db_finalize(&q); |
| 612 | 612 | |
| 613 | 613 | /* Check to see if this object is used as an attachment */ |
| 614 | 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | ||
| 639 | 639 | db_column_text(&q,7)); |
| 640 | 640 | } |
| 641 | 641 | fossil_print(" by user %s on %s\n", |
| 642 | 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | 643 | fossil_print(" "); |
| 644 | - comment_print(db_column_text(&q,1), 12, 78); | |
| 644 | + comment_print(db_column_text(&q,1), 12, -1); | |
| 645 | 645 | } |
| 646 | 646 | db_finalize(&q); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | /* |
| 650 | 650 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -582,11 +582,11 @@ | |
| 582 | default: zType = "Unknown"; break; |
| 583 | } |
| 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | db_column_text(&q, 1)); |
| 586 | fossil_print("comment: "); |
| 587 | comment_print(db_column_text(&q,3), 12, 78); |
| 588 | } |
| 589 | db_finalize(&q); |
| 590 | |
| 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | |
| 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | db_column_text(&q, 1), |
| 606 | db_column_text(&q, 3), |
| 607 | db_column_text(&q, 2)); |
| 608 | fossil_print(" "); |
| 609 | comment_print(db_column_text(&q,4), 12, 78); |
| 610 | } |
| 611 | db_finalize(&q); |
| 612 | |
| 613 | /* Check to see if this object is used as an attachment */ |
| 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | |
| 639 | db_column_text(&q,7)); |
| 640 | } |
| 641 | fossil_print(" by user %s on %s\n", |
| 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | fossil_print(" "); |
| 644 | comment_print(db_column_text(&q,1), 12, 78); |
| 645 | } |
| 646 | db_finalize(&q); |
| 647 | } |
| 648 | |
| 649 | /* |
| 650 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -582,11 +582,11 @@ | |
| 582 | default: zType = "Unknown"; break; |
| 583 | } |
| 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | db_column_text(&q, 1)); |
| 586 | fossil_print("comment: "); |
| 587 | comment_print(db_column_text(&q,3), 12, -1); |
| 588 | } |
| 589 | db_finalize(&q); |
| 590 | |
| 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | |
| 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | db_column_text(&q, 1), |
| 606 | db_column_text(&q, 3), |
| 607 | db_column_text(&q, 2)); |
| 608 | fossil_print(" "); |
| 609 | comment_print(db_column_text(&q,4), 12, -1); |
| 610 | } |
| 611 | db_finalize(&q); |
| 612 | |
| 613 | /* Check to see if this object is used as an attachment */ |
| 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | |
| 639 | db_column_text(&q,7)); |
| 640 | } |
| 641 | fossil_print(" by user %s on %s\n", |
| 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | fossil_print(" "); |
| 644 | comment_print(db_column_text(&q,1), 12, -1); |
| 645 | } |
| 646 | db_finalize(&q); |
| 647 | } |
| 648 | |
| 649 | /* |
| 650 |
+1
-1
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -202,11 +202,11 @@ | ||
| 202 | 202 | width = atoi(zWidth); |
| 203 | 203 | if( (width!=0) && (width<=20) ){ |
| 204 | 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | 205 | } |
| 206 | 206 | }else{ |
| 207 | - width = 79; | |
| 207 | + width = -1; | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | db_must_be_within_tree(); |
| 211 | 211 | if( g.argc<2 ) return; |
| 212 | 212 | blob_init(&pattern, g.argv[2], -1); |
| 213 | 213 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -202,11 +202,11 @@ | |
| 202 | width = atoi(zWidth); |
| 203 | if( (width!=0) && (width<=20) ){ |
| 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | } |
| 206 | }else{ |
| 207 | width = 79; |
| 208 | } |
| 209 | |
| 210 | db_must_be_within_tree(); |
| 211 | if( g.argc<2 ) return; |
| 212 | blob_init(&pattern, g.argv[2], -1); |
| 213 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -202,11 +202,11 @@ | |
| 202 | width = atoi(zWidth); |
| 203 | if( (width!=0) && (width<=20) ){ |
| 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | } |
| 206 | }else{ |
| 207 | width = -1; |
| 208 | } |
| 209 | |
| 210 | db_must_be_within_tree(); |
| 211 | if( g.argc<2 ) return; |
| 212 | blob_init(&pattern, g.argv[2], -1); |
| 213 |
+1
-1
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -525,11 +525,11 @@ | ||
| 525 | 525 | width = atoi(zWidth); |
| 526 | 526 | if( (width!=0) && (width<=46) ){ |
| 527 | 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | 528 | } |
| 529 | 529 | }else{ |
| 530 | - width = 79; | |
| 530 | + width = -1; | |
| 531 | 531 | } |
| 532 | 532 | if( !verboseFlag ){ |
| 533 | 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 534 | 534 | } |
| 535 | 535 | verify_all_options(); |
| 536 | 536 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -525,11 +525,11 @@ | |
| 525 | width = atoi(zWidth); |
| 526 | if( (width!=0) && (width<=46) ){ |
| 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | } |
| 529 | }else{ |
| 530 | width = 79; |
| 531 | } |
| 532 | if( !verboseFlag ){ |
| 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 534 | } |
| 535 | verify_all_options(); |
| 536 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -525,11 +525,11 @@ | |
| 525 | width = atoi(zWidth); |
| 526 | if( (width!=0) && (width<=46) ){ |
| 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | } |
| 529 | }else{ |
| 530 | width = -1; |
| 531 | } |
| 532 | if( !verboseFlag ){ |
| 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 534 | } |
| 535 | verify_all_options(); |
| 536 |
+1
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1780,11 +1780,11 @@ | ||
| 1780 | 1780 | width = atoi(zWidth); |
| 1781 | 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | 1783 | } |
| 1784 | 1784 | }else{ |
| 1785 | - width = 79; | |
| 1785 | + width = -1; | |
| 1786 | 1786 | } |
| 1787 | 1787 | zOffset = find_option("offset",0,1); |
| 1788 | 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1789 | 1789 | if( g.argc>=4 ){ |
| 1790 | 1790 | k = strlen(g.argv[2]); |
| 1791 | 1791 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1780,11 +1780,11 @@ | |
| 1780 | width = atoi(zWidth); |
| 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | } |
| 1784 | }else{ |
| 1785 | width = 79; |
| 1786 | } |
| 1787 | zOffset = find_option("offset",0,1); |
| 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1789 | if( g.argc>=4 ){ |
| 1790 | k = strlen(g.argv[2]); |
| 1791 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1780,11 +1780,11 @@ | |
| 1780 | width = atoi(zWidth); |
| 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | } |
| 1784 | }else{ |
| 1785 | width = -1; |
| 1786 | } |
| 1787 | zOffset = find_option("offset",0,1); |
| 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1789 | if( g.argc>=4 ){ |
| 1790 | k = strlen(g.argv[2]); |
| 1791 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -1264,11 +1264,11 @@ | ||
| 1264 | 1264 | fossil_print(" Change "); |
| 1265 | 1265 | } |
| 1266 | 1266 | fossil_print("%h: ",z); |
| 1267 | 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | - comment_print(blob_str(&val),4,79); | |
| 1269 | + comment_print(blob_str(&val),4,-1); | |
| 1270 | 1270 | }else{ |
| 1271 | 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | 1272 | } |
| 1273 | 1273 | blob_reset(&val); |
| 1274 | 1274 | } |
| 1275 | 1275 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1264,11 +1264,11 @@ | |
| 1264 | fossil_print(" Change "); |
| 1265 | } |
| 1266 | fossil_print("%h: ",z); |
| 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | comment_print(blob_str(&val),4,79); |
| 1270 | }else{ |
| 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | } |
| 1273 | blob_reset(&val); |
| 1274 | } |
| 1275 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1264,11 +1264,11 @@ | |
| 1264 | fossil_print(" Change "); |
| 1265 | } |
| 1266 | fossil_print("%h: ",z); |
| 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | comment_print(blob_str(&val),4,-1); |
| 1270 | }else{ |
| 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | } |
| 1273 | blob_reset(&val); |
| 1274 | } |
| 1275 |