Fossil

Artifact [2c7b158b]
Login

Artifact [2c7b158b]

Artifact 2c7b158b2960c90fb992338f344c99798c1aece4:

Attachment "filename_changes_checkins.patch" to ticket [c9d45415] added by anonymous 2011-01-04 10:42:00.
Index: src/bisect.c
===================================================================
--- src/bisect.c
+++ src/bisect.c
@@ -368,12 +368,27 @@
   if( p==0 ) return;
   bisect_reverse_path();
   db_prepare(&q1,
      "SELECT pfnid, fnid FROM mlink WHERE mid=:mid AND pfnid>0"
   );
-  for(p=bisect.pStart->u.pTo; p; p=p->u.pTo){
+
+  p = bisect.pStart;
+  /* If we start at a parent of the next, skip the checkin */
+  if ( p->u.pTo && p->u.pTo->fromIsParent )
+      p = p->u.pTo;
+  for(; p; p=p->u.pTo){
     int fnid, pfnid;
+
+    /* We should not take the change, if:
+     * - We are the parent node of the From and the To.
+     * - We are a parent of the From, and there is no To.
+     */
+    if ( ! p->fromIsParent &&
+            ( !p->u.pTo ||
+              ( p->u.pTo && p->u.pTo->fromIsParent ) ) )
+        continue;
+
     db_bind_int(&q1, ":mid", p->rid);
     while( db_step(&q1)==SQLITE_ROW ){
       if( p->fromIsParent ){
         fnid = db_column_int(&q1, 1);
         pfnid = db_column_int(&q1, 0);