Fossil

Check-in [fcc9f6642e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Try to keep graph nodes from the same branch on the same rail of the graph.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | mlink-improvements
Files: files | file ages | folders
SHA1: fcc9f6642ede764b177a7d065ea7aebd8674839d
User & Date: drh 2015-01-26 16:28:24.429
Context
2015-01-26
16:45
Add two new columns to the MLINK table. ("fossil rebuild" is not required but is highly recommended.) Use these new tables to improve the display of the history of changes to a single file. ... (check-in: 65aa10f97c user: drh tags: trunk)
16:28
Try to keep graph nodes from the same branch on the same rail of the graph. ... (Closed-Leaf check-in: fcc9f6642e user: drh tags: mlink-improvements)
15:19
Use the GR_MAX_RAIL macro to limit the number of parents for a node on a graph. On the /finfo page, ensure that a node is only marked "Added" if it has no parents. ... (check-in: c1c50ced22 user: drh tags: mlink-improvements)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.c.
376
377
378
379
380
381
382





















383
384
385
386
387
388
389
        if( hashFind(p, pRow->aParent[i])==0 ){
          pRow->aParent[i] = pRow->aParent[--pRow->nParent];
          i--;
        }
      }
    }
  }























  /* Find the pChild pointer for each node.
  **
  ** The pChild points to the node directly above on the same rail.
  ** The pChild must be in the same branch.  Leaf nodes have a NULL
  ** pChild.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
        if( hashFind(p, pRow->aParent[i])==0 ){
          pRow->aParent[i] = pRow->aParent[--pRow->nParent];
          i--;
        }
      }
    }
  }

  /* If the primary parent is in a different branch, but there are
  ** other parents in the same branch, reorder the parents to make
  ** the parent from the same branch the primary parent.
  */
  for(pRow=p->pFirst; pRow; pRow=pRow->pNext){
    if( pRow->isDup ) continue;
    if( pRow->nParent<2 ) continue;                    /* Not a fork */
    pParent = hashFind(p, pRow->aParent[0]);
    if( pParent==0 ) continue;                         /* Parent off-screen */
    if( pParent->zBranch==pRow->zBranch ) continue;    /* Same branch */
    for(i=1; i<pRow->nParent; i++){
      pParent = hashFind(p, pRow->aParent[i]);
      if( pParent->zBranch==pRow->zBranch ){
        int t = pRow->aParent[0];
        pRow->aParent[0] = pRow->aParent[i];
        pRow->aParent[i] = t;
        break;
      }
    }
  }


  /* Find the pChild pointer for each node.
  **
  ** The pChild points to the node directly above on the same rail.
  ** The pChild must be in the same branch.  Leaf nodes have a NULL
  ** pChild.