Fossil SCM
The output from "fossil merge-info" appears in priority order: CONFLICT first, then MERGE, then other minor changes.
Commit
0b5dfa9f6cacfba116b7d82a501114f747c523c988b7b42064dbb84cec8f55dc
Parent
8c6dddc6d03553d…
1 file changed
+10
-4
+10
-4
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -51,11 +51,14 @@ | ||
| 51 | 51 | /* No files named on the command-line. Use every file mentioned |
| 52 | 52 | ** in the MERGESTAT table to generate the file list. */ |
| 53 | 53 | Stmt q; |
| 54 | 54 | int cnt = 0; |
| 55 | 55 | db_prepare(&q, |
| 56 | - "SELECT coalesce(fnr,fn), op FROM mergestat %s ORDER BY 1", | |
| 56 | + "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," | |
| 57 | + "('MERGE',1),('ADDED',2),('UPDATE',2))" | |
| 58 | + "SELECT coalesce(fnr,fn), op FROM mergestat JOIN priority USING(op)" | |
| 59 | + " %s ORDER BY pri, 1", | |
| 57 | 60 | bAll ? "" : "WHERE op IN ('MERGE','CONFLICT')" /*safe-for-%s*/ |
| 58 | 61 | ); |
| 59 | 62 | while( db_step(&q)==SQLITE_ROW ){ |
| 60 | 63 | blob_appendf(&script," %s ", db_column_text(&q,1)); |
| 61 | 64 | blob_append_tcl_literal(&script, db_column_text(&q,0), |
| @@ -306,15 +309,18 @@ | ||
| 306 | 309 | zWhere = ""; |
| 307 | 310 | }else{ |
| 308 | 311 | zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')"; |
| 309 | 312 | } |
| 310 | 313 | db_prepare(&q, |
| 314 | + "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," | |
| 315 | + "('MERGE',1),('ADDED',2),('UPDATE',2))" | |
| 316 | + | |
| 311 | 317 | /* 0 1 2 */ |
| 312 | 318 | "SELECT op, coalesce(fnr,fn), msg" |
| 313 | - " FROM mergestat" | |
| 319 | + " FROM mergestat JOIN priority USING(op)" | |
| 314 | 320 | " %s" |
| 315 | - " ORDER BY coalesce(fnr,fn)", | |
| 321 | + " ORDER BY pri, coalesce(fnr,fn)", | |
| 316 | 322 | zWhere /*safe-for-%s*/ |
| 317 | 323 | ); |
| 318 | 324 | while( db_step(&q)==SQLITE_ROW ){ |
| 319 | 325 | const char *zOp = db_column_text(&q, 0); |
| 320 | 326 | const char *zName = db_column_text(&q, 1); |
| @@ -327,11 +333,11 @@ | ||
| 327 | 333 | cnt++; |
| 328 | 334 | } |
| 329 | 335 | db_finalize(&q); |
| 330 | 336 | if( !bAll && cnt==0 ){ |
| 331 | 337 | fossil_print( |
| 332 | - "No interesting change in this merge. Use --all to see everything.\n" | |
| 338 | + "No interesting changes in this merge. Use --all to see everything.\n" | |
| 333 | 339 | ); |
| 334 | 340 | } |
| 335 | 341 | } |
| 336 | 342 | |
| 337 | 343 | /* |
| 338 | 344 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -51,11 +51,14 @@ | |
| 51 | /* No files named on the command-line. Use every file mentioned |
| 52 | ** in the MERGESTAT table to generate the file list. */ |
| 53 | Stmt q; |
| 54 | int cnt = 0; |
| 55 | db_prepare(&q, |
| 56 | "SELECT coalesce(fnr,fn), op FROM mergestat %s ORDER BY 1", |
| 57 | bAll ? "" : "WHERE op IN ('MERGE','CONFLICT')" /*safe-for-%s*/ |
| 58 | ); |
| 59 | while( db_step(&q)==SQLITE_ROW ){ |
| 60 | blob_appendf(&script," %s ", db_column_text(&q,1)); |
| 61 | blob_append_tcl_literal(&script, db_column_text(&q,0), |
| @@ -306,15 +309,18 @@ | |
| 306 | zWhere = ""; |
| 307 | }else{ |
| 308 | zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')"; |
| 309 | } |
| 310 | db_prepare(&q, |
| 311 | /* 0 1 2 */ |
| 312 | "SELECT op, coalesce(fnr,fn), msg" |
| 313 | " FROM mergestat" |
| 314 | " %s" |
| 315 | " ORDER BY coalesce(fnr,fn)", |
| 316 | zWhere /*safe-for-%s*/ |
| 317 | ); |
| 318 | while( db_step(&q)==SQLITE_ROW ){ |
| 319 | const char *zOp = db_column_text(&q, 0); |
| 320 | const char *zName = db_column_text(&q, 1); |
| @@ -327,11 +333,11 @@ | |
| 327 | cnt++; |
| 328 | } |
| 329 | db_finalize(&q); |
| 330 | if( !bAll && cnt==0 ){ |
| 331 | fossil_print( |
| 332 | "No interesting change in this merge. Use --all to see everything.\n" |
| 333 | ); |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | /* |
| 338 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -51,11 +51,14 @@ | |
| 51 | /* No files named on the command-line. Use every file mentioned |
| 52 | ** in the MERGESTAT table to generate the file list. */ |
| 53 | Stmt q; |
| 54 | int cnt = 0; |
| 55 | db_prepare(&q, |
| 56 | "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," |
| 57 | "('MERGE',1),('ADDED',2),('UPDATE',2))" |
| 58 | "SELECT coalesce(fnr,fn), op FROM mergestat JOIN priority USING(op)" |
| 59 | " %s ORDER BY pri, 1", |
| 60 | bAll ? "" : "WHERE op IN ('MERGE','CONFLICT')" /*safe-for-%s*/ |
| 61 | ); |
| 62 | while( db_step(&q)==SQLITE_ROW ){ |
| 63 | blob_appendf(&script," %s ", db_column_text(&q,1)); |
| 64 | blob_append_tcl_literal(&script, db_column_text(&q,0), |
| @@ -306,15 +309,18 @@ | |
| 309 | zWhere = ""; |
| 310 | }else{ |
| 311 | zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')"; |
| 312 | } |
| 313 | db_prepare(&q, |
| 314 | "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," |
| 315 | "('MERGE',1),('ADDED',2),('UPDATE',2))" |
| 316 | |
| 317 | /* 0 1 2 */ |
| 318 | "SELECT op, coalesce(fnr,fn), msg" |
| 319 | " FROM mergestat JOIN priority USING(op)" |
| 320 | " %s" |
| 321 | " ORDER BY pri, coalesce(fnr,fn)", |
| 322 | zWhere /*safe-for-%s*/ |
| 323 | ); |
| 324 | while( db_step(&q)==SQLITE_ROW ){ |
| 325 | const char *zOp = db_column_text(&q, 0); |
| 326 | const char *zName = db_column_text(&q, 1); |
| @@ -327,11 +333,11 @@ | |
| 333 | cnt++; |
| 334 | } |
| 335 | db_finalize(&q); |
| 336 | if( !bAll && cnt==0 ){ |
| 337 | fossil_print( |
| 338 | "No interesting changes in this merge. Use --all to see everything.\n" |
| 339 | ); |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | /* |
| 344 |