Fossil SCM

The output from "fossil merge-info" appears in priority order: CONFLICT first, then MERGE, then other minor changes.

drh 2024-12-09 16:47 trunk
Commit 0b5dfa9f6cacfba116b7d82a501114f747c523c988b7b42064dbb84cec8f55dc
1 file changed +10 -4
+10 -4
--- src/merge.c
+++ src/merge.c
@@ -51,11 +51,14 @@
5151
/* No files named on the command-line. Use every file mentioned
5252
** in the MERGESTAT table to generate the file list. */
5353
Stmt q;
5454
int cnt = 0;
5555
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",
5760
bAll ? "" : "WHERE op IN ('MERGE','CONFLICT')" /*safe-for-%s*/
5861
);
5962
while( db_step(&q)==SQLITE_ROW ){
6063
blob_appendf(&script," %s ", db_column_text(&q,1));
6164
blob_append_tcl_literal(&script, db_column_text(&q,0),
@@ -306,15 +309,18 @@
306309
zWhere = "";
307310
}else{
308311
zWhere = "WHERE op IN ('MERGE','CONFLICT','ERROR')";
309312
}
310313
db_prepare(&q,
314
+ "WITH priority(op,pri) AS (VALUES('CONFLICT',0),('ERROR',0),"
315
+ "('MERGE',1),('ADDED',2),('UPDATE',2))"
316
+
311317
/* 0 1 2 */
312318
"SELECT op, coalesce(fnr,fn), msg"
313
- " FROM mergestat"
319
+ " FROM mergestat JOIN priority USING(op)"
314320
" %s"
315
- " ORDER BY coalesce(fnr,fn)",
321
+ " ORDER BY pri, coalesce(fnr,fn)",
316322
zWhere /*safe-for-%s*/
317323
);
318324
while( db_step(&q)==SQLITE_ROW ){
319325
const char *zOp = db_column_text(&q, 0);
320326
const char *zName = db_column_text(&q, 1);
@@ -327,11 +333,11 @@
327333
cnt++;
328334
}
329335
db_finalize(&q);
330336
if( !bAll && cnt==0 ){
331337
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"
333339
);
334340
}
335341
}
336342
337343
/*
338344
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button