Check-in [fcabd4774c]
Not logged in
Overview

SHA1 Hash:fcabd4774c2199a33f7e61af487c28bab3ac6cbd
Date: 2007-09-13 03:52:04
User: drh
Comment:Improvements to the CLI timeline display. When an update fails due to multiple descendents, show all of the descendents in timeline format.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/timeline.c from [6222d040d3] to [44b7795660].

@@ -376,11 +376,11 @@
       printf("=== %.10s ===\n", zDate);
       memcpy(zPrevDate, zDate, 10);
       nLine++;
     }
     if( zCom==0 ) zCom = "";
-    printf("%.5s [%.10s] ", &zDate[11], zUuid);
+    printf("%.8s ", &zDate[11]);
     if( nChild>1 || nParent>1 ){
       int n = 0;
       char zPrefix[50];
       if( nParent>1 ){
         sqlite3_snprintf(sizeof(zPrefix), zPrefix, "*MERGE* ");
@@ -388,13 +388,15 @@
       }
       if( nChild>1 ){
         sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*FORK* ");
         n = strlen(zPrefix);
       }
-      zCom = zFree = sqlite3_mprintf("%s%s", zPrefix, zCom);
+      zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom);
+    }else{
+      zFree = sqlite3_mprintf("[%.10s] %s", zUuid, zCom);
     }
-    nLine += comment_print(zCom, 19, 79);
+    nLine += comment_print(zFree, 9, 79);
     sqlite3_free(zFree);
   }
 }
 
 

Modified src/update.c from [f281e3565d] to [6cc6e53fd7].

@@ -67,11 +67,21 @@
       fossil_fatal("not a version: %s", g.argv[2]);
     }
   }else{
     compute_leaves(vid);
     if( db_int(0, "SELECT count(*) FROM leaves")>1 ){
-      fossil_fatal("multiple descendents");
+      db_prepare(&q,
+        "SELECT blob.rid, uuid, datetime(event.mtime,'localtime'),"
+        "       comment || ' (by ' || user || ')', 1, 1"
+        "  FROM event, blob"
+        " WHERE event.type='ci' AND blob.rid=event.objid"
+        "   AND event.objid IN leaves"
+        " ORDER BY event.mtime DESC"
+      );
+      print_timeline(&q, 100);
+      db_finalize(&q);
+      fossil_fatal("Multiple descendents");
     }
     tid = db_int(0, "SELECT rid FROM leaves");
   }
 
   db_begin_transaction();