Fossil SCM
Better outlining of output from "fossil status", "fossil changes" and "fossil ls --verbose". Let "fossil ls --verbose" differentiate between EDITED, CONFLICT, UPD_BY_MERGE and ADD_BY_MERGE, just like "fossil status" and "fossil changes"
Commit
c41d70dccd14b619ebbe5a6069b8e4f37aec0987
Parent
1064dfac1221b19…
1 file changed
+31
-23
+31
-23
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -84,41 +84,41 @@ | ||
| 84 | 84 | zDisplayName += 2; /* no unnecessary ./ prefix */ |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | blob_append(report, zPrefix, nPrefix); |
| 88 | 88 | if( isDeleted ){ |
| 89 | - blob_appendf(report, "DELETED %s\n", zDisplayName); | |
| 89 | + blob_appendf(report, "DELETED %s\n", zDisplayName); | |
| 90 | 90 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 91 | 91 | if( file_access(zFullName, 0)==0 ){ |
| 92 | - blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); | |
| 92 | + blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); | |
| 93 | 93 | if( missingIsFatal ){ |
| 94 | 94 | fossil_warning("not a file: %s", zDisplayName); |
| 95 | 95 | nErr++; |
| 96 | 96 | } |
| 97 | 97 | }else{ |
| 98 | - blob_appendf(report, "MISSING %s\n", zDisplayName); | |
| 98 | + blob_appendf(report, "MISSING %s\n", zDisplayName); | |
| 99 | 99 | if( missingIsFatal ){ |
| 100 | 100 | fossil_warning("missing file: %s", zDisplayName); |
| 101 | 101 | nErr++; |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | }else if( isNew ){ |
| 105 | - blob_appendf(report, "ADDED %s\n", zDisplayName); | |
| 105 | + blob_appendf(report, "ADDED %s\n", zDisplayName); | |
| 106 | 106 | }else if( isDeleted ){ |
| 107 | - blob_appendf(report, "DELETED %s\n", zDisplayName); | |
| 108 | - }else if( isChnged==2 ){ | |
| 109 | - blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName); | |
| 110 | - }else if( isChnged==3 ){ | |
| 111 | - blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName); | |
| 112 | - }else if( isChnged==1 ){ | |
| 113 | - if( file_contains_merge_marker(zFullName) ){ | |
| 114 | - blob_appendf(report, "CONFLICT %s\n", zDisplayName); | |
| 107 | + blob_appendf(report, "DELETED %s\n", zDisplayName); | |
| 108 | + }else if( isChnged ){ | |
| 109 | + if( isChnged==2 ){ | |
| 110 | + blob_appendf(report, "UPD_BY_MERGE %s\n", zDisplayName); | |
| 111 | + }else if( isChnged==3 ){ | |
| 112 | + blob_appendf(report, "ADD_BY_MERGE %s\n", zDisplayName); | |
| 113 | + }else if( file_contains_merge_marker(zFullName) ){ | |
| 114 | + blob_appendf(report, "CONFLICT %s\n", zDisplayName); | |
| 115 | 115 | }else{ |
| 116 | - blob_appendf(report, "EDITED %s\n", zDisplayName); | |
| 116 | + blob_appendf(report, "EDITED %s\n", zDisplayName); | |
| 117 | 117 | } |
| 118 | 118 | }else if( isRenamed ){ |
| 119 | - blob_appendf(report, "RENAMED %s\n", zDisplayName); | |
| 119 | + blob_appendf(report, "RENAMED %s\n", zDisplayName); | |
| 120 | 120 | }else{ |
| 121 | 121 | report->nUsed -= nPrefix; |
| 122 | 122 | } |
| 123 | 123 | free(zFullName); |
| 124 | 124 | } |
| @@ -127,12 +127,12 @@ | ||
| 127 | 127 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 128 | 128 | " WHERE id<=0"); |
| 129 | 129 | while( db_step(&q)==SQLITE_ROW ){ |
| 130 | 130 | const char *zLabel = "MERGED_WITH"; |
| 131 | 131 | switch( db_column_int(&q, 1) ){ |
| 132 | - case -1: zLabel = "CHERRYPICK"; break; | |
| 133 | - case -2: zLabel = "BACKOUT "; break; | |
| 132 | + case -1: zLabel = "CHERRYPICK "; break; | |
| 133 | + case -2: zLabel = "BACKOUT "; break; | |
| 134 | 134 | } |
| 135 | 135 | blob_append(report, zPrefix, nPrefix); |
| 136 | 136 | blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0)); |
| 137 | 137 | } |
| 138 | 138 | db_finalize(&q); |
| @@ -318,25 +318,33 @@ | ||
| 318 | 318 | int renamed = db_column_int(&q,4); |
| 319 | 319 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 320 | 320 | const char *type = ""; |
| 321 | 321 | if( verboseFlag ){ |
| 322 | 322 | if( isNew ){ |
| 323 | - type = "ADDED "; | |
| 323 | + type = "ADDED "; | |
| 324 | 324 | }else if( isDeleted ){ |
| 325 | - type = "DELETED "; | |
| 325 | + type = "DELETED "; | |
| 326 | 326 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 327 | 327 | if( file_access(zFullName, 0)==0 ){ |
| 328 | - type = "NOT_A_FILE "; | |
| 328 | + type = "NOT_A_FILE "; | |
| 329 | 329 | }else{ |
| 330 | - type = "MISSING "; | |
| 330 | + type = "MISSING "; | |
| 331 | 331 | } |
| 332 | 332 | }else if( chnged ){ |
| 333 | - type = "EDITED "; | |
| 333 | + if( chnged==2 ){ | |
| 334 | + type = "UPD_BY_MERGE "; | |
| 335 | + }else if( chnged==3 ){ | |
| 336 | + type = "ADD_BY_MERGE "; | |
| 337 | + }else if( file_contains_merge_marker(zFullName) ){ | |
| 338 | + type = "CONFLICT "; | |
| 339 | + }else{ | |
| 340 | + type = "EDITED "; | |
| 341 | + } | |
| 334 | 342 | }else if( renamed ){ |
| 335 | - type = "RENAMED "; | |
| 343 | + type = "RENAMED "; | |
| 336 | 344 | }else{ |
| 337 | - type = "UNCHANGED "; | |
| 345 | + type = "UNCHANGED "; | |
| 338 | 346 | } |
| 339 | 347 | } |
| 340 | 348 | if( showAge ){ |
| 341 | 349 | fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname); |
| 342 | 350 | }else{ |
| 343 | 351 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -84,41 +84,41 @@ | |
| 84 | zDisplayName += 2; /* no unnecessary ./ prefix */ |
| 85 | } |
| 86 | } |
| 87 | blob_append(report, zPrefix, nPrefix); |
| 88 | if( isDeleted ){ |
| 89 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 90 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 91 | if( file_access(zFullName, 0)==0 ){ |
| 92 | blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); |
| 93 | if( missingIsFatal ){ |
| 94 | fossil_warning("not a file: %s", zDisplayName); |
| 95 | nErr++; |
| 96 | } |
| 97 | }else{ |
| 98 | blob_appendf(report, "MISSING %s\n", zDisplayName); |
| 99 | if( missingIsFatal ){ |
| 100 | fossil_warning("missing file: %s", zDisplayName); |
| 101 | nErr++; |
| 102 | } |
| 103 | } |
| 104 | }else if( isNew ){ |
| 105 | blob_appendf(report, "ADDED %s\n", zDisplayName); |
| 106 | }else if( isDeleted ){ |
| 107 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 108 | }else if( isChnged==2 ){ |
| 109 | blob_appendf(report, "UPDATED_BY_MERGE %s\n", zDisplayName); |
| 110 | }else if( isChnged==3 ){ |
| 111 | blob_appendf(report, "ADDED_BY_MERGE %s\n", zDisplayName); |
| 112 | }else if( isChnged==1 ){ |
| 113 | if( file_contains_merge_marker(zFullName) ){ |
| 114 | blob_appendf(report, "CONFLICT %s\n", zDisplayName); |
| 115 | }else{ |
| 116 | blob_appendf(report, "EDITED %s\n", zDisplayName); |
| 117 | } |
| 118 | }else if( isRenamed ){ |
| 119 | blob_appendf(report, "RENAMED %s\n", zDisplayName); |
| 120 | }else{ |
| 121 | report->nUsed -= nPrefix; |
| 122 | } |
| 123 | free(zFullName); |
| 124 | } |
| @@ -127,12 +127,12 @@ | |
| 127 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 128 | " WHERE id<=0"); |
| 129 | while( db_step(&q)==SQLITE_ROW ){ |
| 130 | const char *zLabel = "MERGED_WITH"; |
| 131 | switch( db_column_int(&q, 1) ){ |
| 132 | case -1: zLabel = "CHERRYPICK"; break; |
| 133 | case -2: zLabel = "BACKOUT "; break; |
| 134 | } |
| 135 | blob_append(report, zPrefix, nPrefix); |
| 136 | blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0)); |
| 137 | } |
| 138 | db_finalize(&q); |
| @@ -318,25 +318,33 @@ | |
| 318 | int renamed = db_column_int(&q,4); |
| 319 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 320 | const char *type = ""; |
| 321 | if( verboseFlag ){ |
| 322 | if( isNew ){ |
| 323 | type = "ADDED "; |
| 324 | }else if( isDeleted ){ |
| 325 | type = "DELETED "; |
| 326 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 327 | if( file_access(zFullName, 0)==0 ){ |
| 328 | type = "NOT_A_FILE "; |
| 329 | }else{ |
| 330 | type = "MISSING "; |
| 331 | } |
| 332 | }else if( chnged ){ |
| 333 | type = "EDITED "; |
| 334 | }else if( renamed ){ |
| 335 | type = "RENAMED "; |
| 336 | }else{ |
| 337 | type = "UNCHANGED "; |
| 338 | } |
| 339 | } |
| 340 | if( showAge ){ |
| 341 | fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname); |
| 342 | }else{ |
| 343 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -84,41 +84,41 @@ | |
| 84 | zDisplayName += 2; /* no unnecessary ./ prefix */ |
| 85 | } |
| 86 | } |
| 87 | blob_append(report, zPrefix, nPrefix); |
| 88 | if( isDeleted ){ |
| 89 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 90 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 91 | if( file_access(zFullName, 0)==0 ){ |
| 92 | blob_appendf(report, "NOT_A_FILE %s\n", zDisplayName); |
| 93 | if( missingIsFatal ){ |
| 94 | fossil_warning("not a file: %s", zDisplayName); |
| 95 | nErr++; |
| 96 | } |
| 97 | }else{ |
| 98 | blob_appendf(report, "MISSING %s\n", zDisplayName); |
| 99 | if( missingIsFatal ){ |
| 100 | fossil_warning("missing file: %s", zDisplayName); |
| 101 | nErr++; |
| 102 | } |
| 103 | } |
| 104 | }else if( isNew ){ |
| 105 | blob_appendf(report, "ADDED %s\n", zDisplayName); |
| 106 | }else if( isDeleted ){ |
| 107 | blob_appendf(report, "DELETED %s\n", zDisplayName); |
| 108 | }else if( isChnged ){ |
| 109 | if( isChnged==2 ){ |
| 110 | blob_appendf(report, "UPD_BY_MERGE %s\n", zDisplayName); |
| 111 | }else if( isChnged==3 ){ |
| 112 | blob_appendf(report, "ADD_BY_MERGE %s\n", zDisplayName); |
| 113 | }else if( file_contains_merge_marker(zFullName) ){ |
| 114 | blob_appendf(report, "CONFLICT %s\n", zDisplayName); |
| 115 | }else{ |
| 116 | blob_appendf(report, "EDITED %s\n", zDisplayName); |
| 117 | } |
| 118 | }else if( isRenamed ){ |
| 119 | blob_appendf(report, "RENAMED %s\n", zDisplayName); |
| 120 | }else{ |
| 121 | report->nUsed -= nPrefix; |
| 122 | } |
| 123 | free(zFullName); |
| 124 | } |
| @@ -127,12 +127,12 @@ | |
| 127 | db_prepare(&q, "SELECT uuid, id FROM vmerge JOIN blob ON merge=rid" |
| 128 | " WHERE id<=0"); |
| 129 | while( db_step(&q)==SQLITE_ROW ){ |
| 130 | const char *zLabel = "MERGED_WITH"; |
| 131 | switch( db_column_int(&q, 1) ){ |
| 132 | case -1: zLabel = "CHERRYPICK "; break; |
| 133 | case -2: zLabel = "BACKOUT "; break; |
| 134 | } |
| 135 | blob_append(report, zPrefix, nPrefix); |
| 136 | blob_appendf(report, "%s %s\n", zLabel, db_column_text(&q, 0)); |
| 137 | } |
| 138 | db_finalize(&q); |
| @@ -318,25 +318,33 @@ | |
| 318 | int renamed = db_column_int(&q,4); |
| 319 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 320 | const char *type = ""; |
| 321 | if( verboseFlag ){ |
| 322 | if( isNew ){ |
| 323 | type = "ADDED "; |
| 324 | }else if( isDeleted ){ |
| 325 | type = "DELETED "; |
| 326 | }else if( !file_wd_isfile_or_link(zFullName) ){ |
| 327 | if( file_access(zFullName, 0)==0 ){ |
| 328 | type = "NOT_A_FILE "; |
| 329 | }else{ |
| 330 | type = "MISSING "; |
| 331 | } |
| 332 | }else if( chnged ){ |
| 333 | if( chnged==2 ){ |
| 334 | type = "UPD_BY_MERGE "; |
| 335 | }else if( chnged==3 ){ |
| 336 | type = "ADD_BY_MERGE "; |
| 337 | }else if( file_contains_merge_marker(zFullName) ){ |
| 338 | type = "CONFLICT "; |
| 339 | }else{ |
| 340 | type = "EDITED "; |
| 341 | } |
| 342 | }else if( renamed ){ |
| 343 | type = "RENAMED "; |
| 344 | }else{ |
| 345 | type = "UNCHANGED "; |
| 346 | } |
| 347 | } |
| 348 | if( showAge ){ |
| 349 | fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname); |
| 350 | }else{ |
| 351 |