Fossil SCM
Add the -v/--verbose option to the "fossil merge-info" command.
Commit
3c8de67618e6557c3a59a9ee71809dd423f72ae5a0e5b0a10e2983c98e121eed
Parent
018d4a5d68fb318…
1 file changed
+61
-21
+61
-21
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -300,10 +300,11 @@ | ||
| 300 | 300 | ** lines are shown |
| 301 | 301 | ** -c|--context N Show N lines of context around each change, |
| 302 | 302 | ** with negative N meaning show all content. Only |
| 303 | 303 | ** meaningful in combination with --tcl or --tk. |
| 304 | 304 | ** --dark Use dark mode for the Tcl/Tk-based GUI |
| 305 | +** -v|--verbose Show extra information about each merge operation | |
| 305 | 306 | ** --tk Bring up a Tcl/Tk GUI that shows the changes |
| 306 | 307 | ** associated with the most recent merge. |
| 307 | 308 | ** |
| 308 | 309 | ** Options used internally by --tk: |
| 309 | 310 | ** --diff12 FILE Bring up a separate --tk diff for just the baseline |
| @@ -323,10 +324,11 @@ | ||
| 323 | 324 | const char *zCnt; |
| 324 | 325 | const char *zTcl; |
| 325 | 326 | int bTk; |
| 326 | 327 | int bDark; |
| 327 | 328 | int bAll; |
| 329 | + int bDetail; | |
| 328 | 330 | int nContext; |
| 329 | 331 | Stmt q; |
| 330 | 332 | const char *zWhere; |
| 331 | 333 | int cnt = 0; |
| 332 | 334 | const char *zDiff2 = 0; |
| @@ -336,10 +338,11 @@ | ||
| 336 | 338 | bTk = find_option("tk", 0, 0)!=0; |
| 337 | 339 | zTcl = find_option("tcl", 0, 1); |
| 338 | 340 | zCnt = find_option("context", "c", 1); |
| 339 | 341 | bDark = find_option("dark", 0, 0)!=0; |
| 340 | 342 | bAll = find_option("all", "a", 0)!=0; |
| 343 | + bDetail = find_option("verbose", "v", 0)!=0; | |
| 341 | 344 | if( (zDiff2 = find_option("diff12", 0, 1))!=0 ){ |
| 342 | 345 | diffMode = 12; |
| 343 | 346 | }else |
| 344 | 347 | if( (zDiff2 = find_option("diff13", 0, 1))!=0 ){ |
| 345 | 348 | diffMode = 13; |
| @@ -388,31 +391,68 @@ | ||
| 388 | 391 | if( bAll ){ |
| 389 | 392 | zWhere = ""; |
| 390 | 393 | }else{ |
| 391 | 394 | zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')"; |
| 392 | 395 | } |
| 393 | - db_prepare(&q, | |
| 394 | - "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," | |
| 395 | - "('MERGE',1),('ADDED',2),('UPDATE',2))" | |
| 396 | - | |
| 397 | - /* 0 1 2 */ | |
| 398 | - "SELECT op, coalesce(fnr,fn), msg" | |
| 399 | - " FROM mergestat JOIN priority USING(op)" | |
| 400 | - " %s" | |
| 401 | - " ORDER BY pri, coalesce(fnr,fn)", | |
| 402 | - zWhere /*safe-for-%s*/ | |
| 403 | - ); | |
| 404 | - while( db_step(&q)==SQLITE_ROW ){ | |
| 405 | - const char *zOp = db_column_text(&q, 0); | |
| 406 | - const char *zName = db_column_text(&q, 1); | |
| 407 | - const char *zErr = db_column_text(&q, 2); | |
| 408 | - if( zErr && fossil_strcmp(zOp,"CONFLICT")!=0 ){ | |
| 409 | - fossil_print("%-9s %s (%s)\n", zOp, zName, zErr); | |
| 410 | - }else{ | |
| 411 | - fossil_print("%-9s %s\n", zOp, zName); | |
| 412 | - } | |
| 413 | - cnt++; | |
| 396 | + if( !bDetail ){ | |
| 397 | + db_prepare(&q, | |
| 398 | + "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," | |
| 399 | + "('MERGE',1),('ADDED',2),('UPDATE',2))" | |
| 400 | + | |
| 401 | + /* 0 1 2 */ | |
| 402 | + "SELECT op, coalesce(fnr,fn), msg" | |
| 403 | + " FROM mergestat JOIN priority USING(op)" | |
| 404 | + " %s" | |
| 405 | + " ORDER BY pri, coalesce(fnr,fn)", | |
| 406 | + zWhere /*safe-for-%s*/ | |
| 407 | + ); | |
| 408 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 409 | + const char *zOp = db_column_text(&q, 0); | |
| 410 | + const char *zName = db_column_text(&q, 1); | |
| 411 | + const char *zErr = db_column_text(&q, 2); | |
| 412 | + if( zErr && fossil_strcmp(zOp,"CONFLICT")!=0 ){ | |
| 413 | + fossil_print("%-9s %s (%s)\n", zOp, zName, zErr); | |
| 414 | + }else{ | |
| 415 | + fossil_print("%-9s %s\n", zOp, zName); | |
| 416 | + } | |
| 417 | + cnt++; | |
| 418 | + } | |
| 419 | + }else{ | |
| 420 | + fossil_print( | |
| 421 | + " Status Local Pivot Merge-in Filename\n" | |
| 422 | + "--------- ---------- ---------- ---------- ----------------\n"); | |
| 423 | + db_prepare(&q, | |
| 424 | + "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," | |
| 425 | + "('MERGE',1),('ADDED',2),('UPDATE',2))" | |
| 426 | + | |
| 427 | + /* 0 1 2 */ | |
| 428 | + "SELECT op, coalesce(fnr,fn), msg," | |
| 429 | + " (SELECT uuid FROM blob WHERE blob.rid=mergestat.ridv)," /* 3: local */ | |
| 430 | + " (SELECT uuid FROM blob WHERE blob.rid=mergestat.ridp)," /* 4: pivot */ | |
| 431 | + " (SELECT uuid FROM blob WHERE blob.rid=mergestat.ridm)" /* 5: mergein*/ | |
| 432 | + " FROM mergestat JOIN priority USING(op)" | |
| 433 | + " %s" | |
| 434 | + " ORDER BY pri, coalesce(fnr,fn)", | |
| 435 | + zWhere /*safe-for-%s*/ | |
| 436 | + ); | |
| 437 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 438 | + const char *zOp = db_column_text(&q, 0); | |
| 439 | + const char *zName = db_column_text(&q, 1); | |
| 440 | + const char *zErr = db_column_text(&q, 2); | |
| 441 | + const char *zLocal = db_column_text(&q, 3); | |
| 442 | + const char *zPivot = db_column_text(&q, 4); | |
| 443 | + const char *zMergein = db_column_text(&q, 5); | |
| 444 | + if( zLocal==0 ) zLocal = ""; | |
| 445 | + if( zErr && fossil_strcmp(zOp,"CONFLICT")!=0 ){ | |
| 446 | + fossil_print("%-9s %10.10s %10.10s %10.10s %s (%s)\n", | |
| 447 | + zOp, zLocal, zPivot, zMergein, zName, zErr); | |
| 448 | + }else{ | |
| 449 | + fossil_print("%-9s %10.10s %10.10s %10.10s %s\n", | |
| 450 | + zOp, zLocal, zPivot, zMergein, zName); | |
| 451 | + } | |
| 452 | + cnt++; | |
| 453 | + } | |
| 414 | 454 | } |
| 415 | 455 | db_finalize(&q); |
| 416 | 456 | if( !bAll && cnt==0 ){ |
| 417 | 457 | fossil_print( |
| 418 | 458 | "No interesting changes in this merge. Use --all to see everything.\n" |
| 419 | 459 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -300,10 +300,11 @@ | |
| 300 | ** lines are shown |
| 301 | ** -c|--context N Show N lines of context around each change, |
| 302 | ** with negative N meaning show all content. Only |
| 303 | ** meaningful in combination with --tcl or --tk. |
| 304 | ** --dark Use dark mode for the Tcl/Tk-based GUI |
| 305 | ** --tk Bring up a Tcl/Tk GUI that shows the changes |
| 306 | ** associated with the most recent merge. |
| 307 | ** |
| 308 | ** Options used internally by --tk: |
| 309 | ** --diff12 FILE Bring up a separate --tk diff for just the baseline |
| @@ -323,10 +324,11 @@ | |
| 323 | const char *zCnt; |
| 324 | const char *zTcl; |
| 325 | int bTk; |
| 326 | int bDark; |
| 327 | int bAll; |
| 328 | int nContext; |
| 329 | Stmt q; |
| 330 | const char *zWhere; |
| 331 | int cnt = 0; |
| 332 | const char *zDiff2 = 0; |
| @@ -336,10 +338,11 @@ | |
| 336 | bTk = find_option("tk", 0, 0)!=0; |
| 337 | zTcl = find_option("tcl", 0, 1); |
| 338 | zCnt = find_option("context", "c", 1); |
| 339 | bDark = find_option("dark", 0, 0)!=0; |
| 340 | bAll = find_option("all", "a", 0)!=0; |
| 341 | if( (zDiff2 = find_option("diff12", 0, 1))!=0 ){ |
| 342 | diffMode = 12; |
| 343 | }else |
| 344 | if( (zDiff2 = find_option("diff13", 0, 1))!=0 ){ |
| 345 | diffMode = 13; |
| @@ -388,31 +391,68 @@ | |
| 388 | if( bAll ){ |
| 389 | zWhere = ""; |
| 390 | }else{ |
| 391 | zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')"; |
| 392 | } |
| 393 | db_prepare(&q, |
| 394 | "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," |
| 395 | "('MERGE',1),('ADDED',2),('UPDATE',2))" |
| 396 | |
| 397 | /* 0 1 2 */ |
| 398 | "SELECT op, coalesce(fnr,fn), msg" |
| 399 | " FROM mergestat JOIN priority USING(op)" |
| 400 | " %s" |
| 401 | " ORDER BY pri, coalesce(fnr,fn)", |
| 402 | zWhere /*safe-for-%s*/ |
| 403 | ); |
| 404 | while( db_step(&q)==SQLITE_ROW ){ |
| 405 | const char *zOp = db_column_text(&q, 0); |
| 406 | const char *zName = db_column_text(&q, 1); |
| 407 | const char *zErr = db_column_text(&q, 2); |
| 408 | if( zErr && fossil_strcmp(zOp,"CONFLICT")!=0 ){ |
| 409 | fossil_print("%-9s %s (%s)\n", zOp, zName, zErr); |
| 410 | }else{ |
| 411 | fossil_print("%-9s %s\n", zOp, zName); |
| 412 | } |
| 413 | cnt++; |
| 414 | } |
| 415 | db_finalize(&q); |
| 416 | if( !bAll && cnt==0 ){ |
| 417 | fossil_print( |
| 418 | "No interesting changes in this merge. Use --all to see everything.\n" |
| 419 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -300,10 +300,11 @@ | |
| 300 | ** lines are shown |
| 301 | ** -c|--context N Show N lines of context around each change, |
| 302 | ** with negative N meaning show all content. Only |
| 303 | ** meaningful in combination with --tcl or --tk. |
| 304 | ** --dark Use dark mode for the Tcl/Tk-based GUI |
| 305 | ** -v|--verbose Show extra information about each merge operation |
| 306 | ** --tk Bring up a Tcl/Tk GUI that shows the changes |
| 307 | ** associated with the most recent merge. |
| 308 | ** |
| 309 | ** Options used internally by --tk: |
| 310 | ** --diff12 FILE Bring up a separate --tk diff for just the baseline |
| @@ -323,10 +324,11 @@ | |
| 324 | const char *zCnt; |
| 325 | const char *zTcl; |
| 326 | int bTk; |
| 327 | int bDark; |
| 328 | int bAll; |
| 329 | int bDetail; |
| 330 | int nContext; |
| 331 | Stmt q; |
| 332 | const char *zWhere; |
| 333 | int cnt = 0; |
| 334 | const char *zDiff2 = 0; |
| @@ -336,10 +338,11 @@ | |
| 338 | bTk = find_option("tk", 0, 0)!=0; |
| 339 | zTcl = find_option("tcl", 0, 1); |
| 340 | zCnt = find_option("context", "c", 1); |
| 341 | bDark = find_option("dark", 0, 0)!=0; |
| 342 | bAll = find_option("all", "a", 0)!=0; |
| 343 | bDetail = find_option("verbose", "v", 0)!=0; |
| 344 | if( (zDiff2 = find_option("diff12", 0, 1))!=0 ){ |
| 345 | diffMode = 12; |
| 346 | }else |
| 347 | if( (zDiff2 = find_option("diff13", 0, 1))!=0 ){ |
| 348 | diffMode = 13; |
| @@ -388,31 +391,68 @@ | |
| 391 | if( bAll ){ |
| 392 | zWhere = ""; |
| 393 | }else{ |
| 394 | zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')"; |
| 395 | } |
| 396 | if( !bDetail ){ |
| 397 | db_prepare(&q, |
| 398 | "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," |
| 399 | "('MERGE',1),('ADDED',2),('UPDATE',2))" |
| 400 | |
| 401 | /* 0 1 2 */ |
| 402 | "SELECT op, coalesce(fnr,fn), msg" |
| 403 | " FROM mergestat JOIN priority USING(op)" |
| 404 | " %s" |
| 405 | " ORDER BY pri, coalesce(fnr,fn)", |
| 406 | zWhere /*safe-for-%s*/ |
| 407 | ); |
| 408 | while( db_step(&q)==SQLITE_ROW ){ |
| 409 | const char *zOp = db_column_text(&q, 0); |
| 410 | const char *zName = db_column_text(&q, 1); |
| 411 | const char *zErr = db_column_text(&q, 2); |
| 412 | if( zErr && fossil_strcmp(zOp,"CONFLICT")!=0 ){ |
| 413 | fossil_print("%-9s %s (%s)\n", zOp, zName, zErr); |
| 414 | }else{ |
| 415 | fossil_print("%-9s %s\n", zOp, zName); |
| 416 | } |
| 417 | cnt++; |
| 418 | } |
| 419 | }else{ |
| 420 | fossil_print( |
| 421 | " Status Local Pivot Merge-in Filename\n" |
| 422 | "--------- ---------- ---------- ---------- ----------------\n"); |
| 423 | db_prepare(&q, |
| 424 | "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0)," |
| 425 | "('MERGE',1),('ADDED',2),('UPDATE',2))" |
| 426 | |
| 427 | /* 0 1 2 */ |
| 428 | "SELECT op, coalesce(fnr,fn), msg," |
| 429 | " (SELECT uuid FROM blob WHERE blob.rid=mergestat.ridv)," /* 3: local */ |
| 430 | " (SELECT uuid FROM blob WHERE blob.rid=mergestat.ridp)," /* 4: pivot */ |
| 431 | " (SELECT uuid FROM blob WHERE blob.rid=mergestat.ridm)" /* 5: mergein*/ |
| 432 | " FROM mergestat JOIN priority USING(op)" |
| 433 | " %s" |
| 434 | " ORDER BY pri, coalesce(fnr,fn)", |
| 435 | zWhere /*safe-for-%s*/ |
| 436 | ); |
| 437 | while( db_step(&q)==SQLITE_ROW ){ |
| 438 | const char *zOp = db_column_text(&q, 0); |
| 439 | const char *zName = db_column_text(&q, 1); |
| 440 | const char *zErr = db_column_text(&q, 2); |
| 441 | const char *zLocal = db_column_text(&q, 3); |
| 442 | const char *zPivot = db_column_text(&q, 4); |
| 443 | const char *zMergein = db_column_text(&q, 5); |
| 444 | if( zLocal==0 ) zLocal = ""; |
| 445 | if( zErr && fossil_strcmp(zOp,"CONFLICT")!=0 ){ |
| 446 | fossil_print("%-9s %10.10s %10.10s %10.10s %s (%s)\n", |
| 447 | zOp, zLocal, zPivot, zMergein, zName, zErr); |
| 448 | }else{ |
| 449 | fossil_print("%-9s %10.10s %10.10s %10.10s %s\n", |
| 450 | zOp, zLocal, zPivot, zMergein, zName); |
| 451 | } |
| 452 | cnt++; |
| 453 | } |
| 454 | } |
| 455 | db_finalize(&q); |
| 456 | if( !bAll && cnt==0 ){ |
| 457 | fossil_print( |
| 458 | "No interesting changes in this merge. Use --all to see everything.\n" |
| 459 |