Fossil

Check-in [fe40b652]
Login

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

Overview
Comment:Much faster rendering of branch timelines.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fe40b652fe38a480ec456b9d2e5c765f88b9f11d6dd6cdf53d773d085b3d3ead
User & Date: drh 2018-12-27 21:56:02.036
Context
2018-12-28
01:25
Improvements to /timeline generation of cherrypick merges. Cherrypicks are now shown with the f= query parameter. Add the cherrypicks query parameter to /timeline. Add test cases to the graph-test-1.wiki page. ... (check-in: ee64832f user: drh tags: trunk)
2018-12-27
21:56
Much faster rendering of branch timelines. ... (check-in: fe40b652 user: drh tags: trunk)
20:41
General enhancements to the "amend", "tag", and "reparent" command, including adding flags like --override-date, --override-user, and --dry-run. ... (check-in: 5c995571 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/timeline.c.
1874
1875
1876
1877
1878
1879
1880
1881


1882
1883
1884
1885







1886
1887
1888
1889
1890
1891
1892

1893
1894
1895
1896
1897
1898

1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921

1922
1923
1924


1925

1926
1927
1928

1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
      nDays = atoi(zNDays);
      if( nDays<1 ) nDays = 1;
      blob_append_sql(&cond, " AND event.mtime>=julianday('now','-%d days') ",
                      nDays);
      nEntry = -1;
    }
    if( zTagSql ){
      blob_append_sql(&cond,


        " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag"
        " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/);

      if( related ){







        /* The next two blob_appendf() calls add SQL that causes check-ins that
        ** are not part of the branch which are parents or children of the
        ** branch to be included in the report.  These related check-ins are
        ** useful in helping to visualize what has happened on a quiescent
        ** branch that is infrequently merged with a much more activate branch.
        */
        blob_append_sql(&cond,

          " OR EXISTS(SELECT 1 FROM plink CROSS JOIN tagxref ON rid=cid"
          " NATURAL JOIN tag WHERE %s AND tagtype>0 AND pid=blob.rid)\n",
           zTagSql/*safe-for-%s*/
        );
        if( (tmFlags & TIMELINE_UNHIDE)==0 ){
          blob_append_sql(&cond,

            " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=cid"
                       " WHERE tagid=%d AND tagtype>0 AND pid=blob.rid)\n",
            TAG_HIDDEN
          );
        }
        if( P("mionly")==0 ){
          blob_append_sql(&cond,
            " OR EXISTS(SELECT 1 FROM plink CROSS JOIN tagxref ON rid=pid"
            " NATURAL JOIN tag WHERE %s AND tagtype>0 AND cid=blob.rid)\n",
            zTagSql/*safe-for-%s*/
          );
          if( (tmFlags & TIMELINE_UNHIDE)==0 ){
            blob_append_sql(&cond,
              " AND NOT EXISTS(SELECT 1 FROM plink JOIN tagxref ON rid=pid"
              " WHERE tagid=%d AND tagtype>0 AND cid=blob.rid)\n",
              TAG_HIDDEN
            );
          }
        }
        if( !PB("ncp") && db_table_exists("repository","cherrypick") ){
          tmFlags |= TIMELINE_CHPICK;
          blob_append_sql(&cond,
            " OR EXISTS(SELECT 1 FROM cherrypick CROSS JOIN tagxref"

            " ON rid=childid NATURAL JOIN tag WHERE %s AND tagtype>0"
            " AND parentid=blob.rid)\n", zTagSql/*safe-for-%s*/
          );


          blob_append_sql(&cond,

            " OR EXISTS(SELECT 1 FROM cherrypick CROSS JOIN tagxref"
            " ON rid=parentid NATURAL JOIN tag WHERE %s AND tagtype>0"
            " AND childid=blob.rid)\n", zTagSql/*safe-for-%s*/

          );
        }
      }
      blob_append_sql(&cond, ")");
    }
    if( (zType[0]=='w' && !g.perm.RdWiki)
     || (zType[0]=='t' && !g.perm.RdTkt)
     || (zType[0]=='e' && !g.perm.RdWiki)
     || (zType[0]=='c' && !g.perm.Read)
     || (zType[0]=='g' && !g.perm.Read)
     || (zType[0]=='f' && !g.perm.RdForum)







|
>
>
|
|
|
|
>
>
>
>
>
>
>






|
>
|
|
<

|
|
>
|
|
<


|
|
|
<
<
<
<
<
|
|
<
|
<
<
<
<
|
<
>
|
|

>
>
|
>
|
|
<
>



<







1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904

1905
1906
1907
1908
1909
1910

1911
1912
1913
1914
1915





1916
1917

1918




1919

1920
1921
1922
1923
1924
1925
1926
1927
1928
1929

1930
1931
1932
1933

1934
1935
1936
1937
1938
1939
1940
      nDays = atoi(zNDays);
      if( nDays<1 ) nDays = 1;
      blob_append_sql(&cond, " AND event.mtime>=julianday('now','-%d days') ",
                      nDays);
      nEntry = -1;
    }
    if( zTagSql ){
      db_multi_exec(
        "CREATE TEMP TABLE selected_nodes(rid INTEGER PRIMARY KEY);"
        "INSERT OR IGNORE INTO selected_nodes"
        " SELECT tagxref.rid FROM tagxref NATURAL JOIN tag"
        " WHERE %s AND tagtype>0", zTagSql/*safe-for-%s*/
      );
      if( !related ){
        blob_append_sql(&cond, " AND blob.rid IN selected_nodes");
      }else{
        db_multi_exec(
          "CREATE TEMP TABLE related_nodes(rid INTEGER PRIMARY KEY);"
          "INSERT INTO related_nodes SELECT rid FROM selected_nodes;"
        );
        blob_append_sql(&cond, " AND blob.rid IN related_nodes");
        /* The next two blob_appendf() calls add SQL that causes check-ins that
        ** are not part of the branch which are parents or children of the
        ** branch to be included in the report.  These related check-ins are
        ** useful in helping to visualize what has happened on a quiescent
        ** branch that is infrequently merged with a much more activate branch.
        */
        db_multi_exec(
          "INSERT OR IGNORE INTO related_nodes"
          " SELECT pid FROM selected_nodes CROSS JOIN plink"
          " WHERE selected_nodes.rid=plink.cid;"

        );
        if( P("mionly")==0 ){
          db_multi_exec(
            "INSERT OR IGNORE INTO related_nodes"
            " SELECT cid FROM selected_nodes CROSS JOIN plink"
            " WHERE selected_nodes.rid=plink.pid;"

          );
        }
        if( !PB("ncp") && db_table_exists("repository","cherrypick") ){
          db_multi_exec(
            "INSERT OR IGNORE INTO related_nodes"





            " SELECT parentid FROM selected_nodes CROSS JOIN cherrypick"
            " WHERE selected_nodes.rid=cherrypick.childid;"

          );




          db_multi_exec(

            "INSERT OR IGNORE INTO related_nodes"
            " SELECT childid FROM selected_nodes CROSS JOIN cherrypick"
            " WHERE selected_nodes.rid=cherrypick.parentid;"
          );
        }
        if( (tmFlags & TIMELINE_UNHIDE)==0 ){
          db_multi_exec(
            "DELETE FROM related_nodes WHERE rid IN "
            " (SELECT related_nodes.rid FROM related_nodes, tagxref"
            " WHERE tagid=%d AND tagtype>0 AND tagxref.rid=related_nodes.rid)",

            TAG_HIDDEN
          );
        }
      }

    }
    if( (zType[0]=='w' && !g.perm.RdWiki)
     || (zType[0]=='t' && !g.perm.RdTkt)
     || (zType[0]=='e' && !g.perm.RdWiki)
     || (zType[0]=='c' && !g.perm.Read)
     || (zType[0]=='g' && !g.perm.Read)
     || (zType[0]=='f' && !g.perm.RdForum)