Diff
Not logged in

Differences From:

File src/merge.c part of check-in [a36177bcce] - Add the "undo" and "redo" commands. Untested at this point so don't try to use them yet. by drh on 2007-09-11 02:25:19. Also file src/merge.c part of check-in [f76192b245] - Pulled the latest CLI, website, and sqlite changes into the importer branch. by aku on 2007-09-17 01:00:32. [view]

To:

File src/merge.c part of check-in [50ff86afd0] - Add the --detail flag to the merge command. by drh on 2007-11-08 16:14:13. [view]

@@ -45,9 +45,11 @@
   int vid;              /* Current version */
   int mid;              /* Version we are merging against */
   int pid;              /* The pivot version - most recent common ancestor */
   Stmt q;
+  int detailFlag;
 
+  detailFlag = find_option("detail",0,0)!=0;
   if( g.argc!=3 ){
     usage("VERSION");
   }
   db_must_be_within_tree();
@@ -216,21 +218,26 @@
   /*
   ** Do a three-way merge on files that have changes pid->mid and pid->vid
   */
   db_prepare(&q,
-    "SELECT ridm, idv, ridp FROM fv"
+    "SELECT ridm, idv, ridp, ridv FROM fv"
     " WHERE idp>0 AND idv>0 AND idm>0"
     "   AND ridm!=ridp AND (ridv!=ridp OR chnged)"
   );
   while( db_step(&q)==SQLITE_ROW ){
     int ridm = db_column_int(&q, 0);
     int idv = db_column_int(&q, 1);
     int ridp = db_column_int(&q, 2);
+    int ridv = db_column_int(&q, 3);
     char *zName = db_text(0, "SELECT pathname FROM vfile WHERE id=%d", idv);
     char *zFullPath;
     Blob m, p, v, r;
     /* Do a 3-way merge of idp->idm into idp->idv.  The results go into idv. */
-    printf("MERGE %s\n", zName);
+    if( detailFlag ){
+      printf("MERGE %s  (pivot=%d v1=%d v2=%d)\n", zName, ridp, ridm, ridv);
+    }else{
+      printf("MERGE %s\n", zName);
+    }
     undo_save(zName);
     zFullPath = mprintf("%s/%s", g.zLocalRoot, zName);
     free(zName);
     content_get(ridp, &p);