Fossil SCM
Do not separate timeline entries by an empty line when using custom formatting strings.
Commit
256983fdd5219cbc6fc0c08452a5fe141d6475d2326b02158d6ce7966a80dbd7
Parent
e03200e54543046…
1 file changed
+24
-12
+24
-12
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -35,10 +35,17 @@ | ||
| 35 | 35 | #define TIMELINE_MODE_BEFORE 1 |
| 36 | 36 | #define TIMELINE_MODE_AFTER 2 |
| 37 | 37 | #define TIMELINE_MODE_CHILDREN 3 |
| 38 | 38 | #define TIMELINE_MODE_PARENTS 4 |
| 39 | 39 | |
| 40 | +#define TIMELINE_FMT_ONELINE \ | |
| 41 | + "%h %c" | |
| 42 | +#define TIMELINE_FMT_MEDIUM \ | |
| 43 | + "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c" | |
| 44 | +#define TIMELINE_FMT_FULL \ | |
| 45 | + "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n"\ | |
| 46 | + "Branch: %b%nTags: %t%nPhase: %p" | |
| 40 | 47 | /* |
| 41 | 48 | ** Add an appropriate tag to the output if "rid" is unpublished (private) |
| 42 | 49 | */ |
| 43 | 50 | #define UNPUB_TAG "<em>(unpublished)</em>" |
| 44 | 51 | void tag_private_status(int rid){ |
| @@ -3019,12 +3026,15 @@ | ||
| 3019 | 3026 | char zPrevDate[20]; |
| 3020 | 3027 | const char *zCurrentUuid = 0; |
| 3021 | 3028 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 3022 | 3029 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 3023 | 3030 | int rc; |
| 3024 | - int bVerboseNewline = (zFormat!=0 && (fossil_strcmp(zFormat, "%h %c")!=0) ); | |
| 3025 | - /* True: print a newline after file listing */ | |
| 3031 | + /* True: separate entries with a newline after file listing */ | |
| 3032 | + int bVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_ONELINE)!=0)); | |
| 3033 | + /* True: separate entries with a newline even with no file listing */ | |
| 3034 | + int bNoVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_MEDIUM)==0 || | |
| 3035 | + fossil_strcmp(zFormat, TIMELINE_FMT_FULL)==0)); | |
| 3026 | 3036 | |
| 3027 | 3037 | zPrevDate[0] = 0; |
| 3028 | 3038 | if( g.localOpen ){ |
| 3029 | 3039 | int rid = db_lget_int("checkout", 0); |
| 3030 | 3040 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -3153,14 +3163,14 @@ | ||
| 3153 | 3163 | fossil_print(" EDITED %s\n", zFilename); |
| 3154 | 3164 | } |
| 3155 | 3165 | nLine++; /* record another line */ |
| 3156 | 3166 | } |
| 3157 | 3167 | db_reset(&fchngQuery); |
| 3168 | + if( bVerboseNL ) fossil_print("\n"); | |
| 3169 | + }else{ | |
| 3170 | + if( bNoVerboseNL ) fossil_print("\n"); | |
| 3158 | 3171 | } |
| 3159 | - /* With special formatting (except for "oneline") and --verbose, | |
| 3160 | - ** print a newline after the file listing */ | |
| 3161 | - if( bVerboseNewline ) fossil_print("\n"); | |
| 3162 | 3172 | |
| 3163 | 3173 | nEntry++; /* record another complete entry */ |
| 3164 | 3174 | } |
| 3165 | 3175 | if( rc==SQLITE_DONE ){ |
| 3166 | 3176 | /* Did the underlying query actually have all entries? */ |
| @@ -3342,17 +3352,19 @@ | ||
| 3342 | 3352 | int vid = db_lget_int("checkout", 0); |
| 3343 | 3353 | zBr = db_text(0, "SELECT value FROM tagxref WHERE rid=%d AND tagid=%d", |
| 3344 | 3354 | vid, TAG_BRANCH); |
| 3345 | 3355 | } |
| 3346 | 3356 | } |
| 3347 | - if( find_option("oneline",0,0)!= 0 || fossil_strcmp(zFormat,"oneline")==0 ) | |
| 3348 | - zFormat = "%h %c"; | |
| 3349 | - if( find_option("medium",0,0)!= 0 || fossil_strcmp(zFormat,"medium")==0 ) | |
| 3350 | - zFormat = "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c"; | |
| 3351 | - if( find_option("full",0,0)!= 0 || fossil_strcmp(zFormat,"full")==0 ) | |
| 3352 | - zFormat = "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n" | |
| 3353 | - "Branch: %b%nTags: %t%nPhase: %p"; | |
| 3357 | + if( find_option("oneline",0,0)!= 0 || fossil_strcmp(zFormat,"oneline")==0 ){ | |
| 3358 | + zFormat = TIMELINE_FMT_ONELINE; | |
| 3359 | + } | |
| 3360 | + if( find_option("medium",0,0)!= 0 || fossil_strcmp(zFormat,"medium")==0 ){ | |
| 3361 | + zFormat = TIMELINE_FMT_MEDIUM; | |
| 3362 | + } | |
| 3363 | + if( find_option("full",0,0)!= 0 || fossil_strcmp(zFormat,"full")==0 ){ | |
| 3364 | + zFormat = TIMELINE_FMT_FULL; | |
| 3365 | + } | |
| 3354 | 3366 | showSql = find_option("sql",0,0)!=0; |
| 3355 | 3367 | |
| 3356 | 3368 | if( !zLimit ){ |
| 3357 | 3369 | zLimit = find_option("count",0,1); |
| 3358 | 3370 | } |
| 3359 | 3371 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -35,10 +35,17 @@ | |
| 35 | #define TIMELINE_MODE_BEFORE 1 |
| 36 | #define TIMELINE_MODE_AFTER 2 |
| 37 | #define TIMELINE_MODE_CHILDREN 3 |
| 38 | #define TIMELINE_MODE_PARENTS 4 |
| 39 | |
| 40 | /* |
| 41 | ** Add an appropriate tag to the output if "rid" is unpublished (private) |
| 42 | */ |
| 43 | #define UNPUB_TAG "<em>(unpublished)</em>" |
| 44 | void tag_private_status(int rid){ |
| @@ -3019,12 +3026,15 @@ | |
| 3019 | char zPrevDate[20]; |
| 3020 | const char *zCurrentUuid = 0; |
| 3021 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 3022 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 3023 | int rc; |
| 3024 | int bVerboseNewline = (zFormat!=0 && (fossil_strcmp(zFormat, "%h %c")!=0) ); |
| 3025 | /* True: print a newline after file listing */ |
| 3026 | |
| 3027 | zPrevDate[0] = 0; |
| 3028 | if( g.localOpen ){ |
| 3029 | int rid = db_lget_int("checkout", 0); |
| 3030 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -3153,14 +3163,14 @@ | |
| 3153 | fossil_print(" EDITED %s\n", zFilename); |
| 3154 | } |
| 3155 | nLine++; /* record another line */ |
| 3156 | } |
| 3157 | db_reset(&fchngQuery); |
| 3158 | } |
| 3159 | /* With special formatting (except for "oneline") and --verbose, |
| 3160 | ** print a newline after the file listing */ |
| 3161 | if( bVerboseNewline ) fossil_print("\n"); |
| 3162 | |
| 3163 | nEntry++; /* record another complete entry */ |
| 3164 | } |
| 3165 | if( rc==SQLITE_DONE ){ |
| 3166 | /* Did the underlying query actually have all entries? */ |
| @@ -3342,17 +3352,19 @@ | |
| 3342 | int vid = db_lget_int("checkout", 0); |
| 3343 | zBr = db_text(0, "SELECT value FROM tagxref WHERE rid=%d AND tagid=%d", |
| 3344 | vid, TAG_BRANCH); |
| 3345 | } |
| 3346 | } |
| 3347 | if( find_option("oneline",0,0)!= 0 || fossil_strcmp(zFormat,"oneline")==0 ) |
| 3348 | zFormat = "%h %c"; |
| 3349 | if( find_option("medium",0,0)!= 0 || fossil_strcmp(zFormat,"medium")==0 ) |
| 3350 | zFormat = "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c"; |
| 3351 | if( find_option("full",0,0)!= 0 || fossil_strcmp(zFormat,"full")==0 ) |
| 3352 | zFormat = "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n" |
| 3353 | "Branch: %b%nTags: %t%nPhase: %p"; |
| 3354 | showSql = find_option("sql",0,0)!=0; |
| 3355 | |
| 3356 | if( !zLimit ){ |
| 3357 | zLimit = find_option("count",0,1); |
| 3358 | } |
| 3359 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -35,10 +35,17 @@ | |
| 35 | #define TIMELINE_MODE_BEFORE 1 |
| 36 | #define TIMELINE_MODE_AFTER 2 |
| 37 | #define TIMELINE_MODE_CHILDREN 3 |
| 38 | #define TIMELINE_MODE_PARENTS 4 |
| 39 | |
| 40 | #define TIMELINE_FMT_ONELINE \ |
| 41 | "%h %c" |
| 42 | #define TIMELINE_FMT_MEDIUM \ |
| 43 | "Commit: %h%nDate: %d%nAuthor: %a%nComment: %c" |
| 44 | #define TIMELINE_FMT_FULL \ |
| 45 | "Commit: %H%nDate: %d%nAuthor: %a%nComment: %c%n"\ |
| 46 | "Branch: %b%nTags: %t%nPhase: %p" |
| 47 | /* |
| 48 | ** Add an appropriate tag to the output if "rid" is unpublished (private) |
| 49 | */ |
| 50 | #define UNPUB_TAG "<em>(unpublished)</em>" |
| 51 | void tag_private_status(int rid){ |
| @@ -3019,12 +3026,15 @@ | |
| 3026 | char zPrevDate[20]; |
| 3027 | const char *zCurrentUuid = 0; |
| 3028 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 3029 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 3030 | int rc; |
| 3031 | /* True: separate entries with a newline after file listing */ |
| 3032 | int bVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_ONELINE)!=0)); |
| 3033 | /* True: separate entries with a newline even with no file listing */ |
| 3034 | int bNoVerboseNL = (zFormat && (fossil_strcmp(zFormat, TIMELINE_FMT_MEDIUM)==0 || |
| 3035 | fossil_strcmp(zFormat, TIMELINE_FMT_FULL)==0)); |
| 3036 | |
| 3037 | zPrevDate[0] = 0; |
| 3038 | if( g.localOpen ){ |
| 3039 | int rid = db_lget_int("checkout", 0); |
| 3040 | zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| @@ -3153,14 +3163,14 @@ | |
| 3163 | fossil_print(" EDITED %s\n", zFilename); |
| 3164 | } |
| 3165 | nLine++; /* record another line */ |
| 3166 | } |
| 3167 | db_reset(&fchngQuery); |
| 3168 | if( bVerboseNL ) fossil_print("\n"); |
| 3169 | }else{ |
| 3170 | if( bNoVerboseNL ) fossil_print("\n"); |
| 3171 | } |
| 3172 | |
| 3173 | nEntry++; /* record another complete entry */ |
| 3174 | } |
| 3175 | if( rc==SQLITE_DONE ){ |
| 3176 | /* Did the underlying query actually have all entries? */ |
| @@ -3342,17 +3352,19 @@ | |
| 3352 | int vid = db_lget_int("checkout", 0); |
| 3353 | zBr = db_text(0, "SELECT value FROM tagxref WHERE rid=%d AND tagid=%d", |
| 3354 | vid, TAG_BRANCH); |
| 3355 | } |
| 3356 | } |
| 3357 | if( find_option("oneline",0,0)!= 0 || fossil_strcmp(zFormat,"oneline")==0 ){ |
| 3358 | zFormat = TIMELINE_FMT_ONELINE; |
| 3359 | } |
| 3360 | if( find_option("medium",0,0)!= 0 || fossil_strcmp(zFormat,"medium")==0 ){ |
| 3361 | zFormat = TIMELINE_FMT_MEDIUM; |
| 3362 | } |
| 3363 | if( find_option("full",0,0)!= 0 || fossil_strcmp(zFormat,"full")==0 ){ |
| 3364 | zFormat = TIMELINE_FMT_FULL; |
| 3365 | } |
| 3366 | showSql = find_option("sql",0,0)!=0; |
| 3367 | |
| 3368 | if( !zLimit ){ |
| 3369 | zLimit = find_option("count",0,1); |
| 3370 | } |
| 3371 |