Fossil SCM

Add timeline rel query string and change r=TAG to be an alias for t=TAG&rel so that related can be a checkbox and the tag filter text entry can work whether or not related is checked. This addresses issues (2) and (3).

andygoth 2016-11-05 05:18 andygoth-timeline-ms
Commit 90057326f4ea86ca4f9728f5469ae578fa502488
1 file changed +50 -46
+50 -46
--- src/timeline.c
+++ src/timeline.c
@@ -1409,22 +1409,24 @@
14091409
/*
14101410
** WEBPAGE: timeline
14111411
**
14121412
** Query parameters:
14131413
**
1414
-** a=TIMEORTAG after this event
1415
-** b=TIMEORTAG before this event
1416
-** c=TIMEORTAG "circa" this event
1417
-** m=TIMEORTAG mark this event
1418
-** n=COUNT suggested number of events in output
1419
-** p=CHECKIN parents and ancestors of CHECKIN
1420
-** d=CHECKIN descendants of CHECIN
1414
+** a=TIMEORTAG After this event
1415
+** b=TIMEORTAG Before this event
1416
+** c=TIMEORTAG "Circa" this event
1417
+** m=TIMEORTAG Mark this event
1418
+** n=COUNT Suggested number of events in output
1419
+** p=CHECKIN Parents and ancestors of CHECKIN
1420
+** d=CHECKIN Descendants of CHECIN
14211421
** dp=CHECKIN The same as d=CHECKIN&p=CHECKIN
1422
-** t=TAG show only check-ins with the given TAG
1423
-** r=TAG show check-ins related to TAG
1424
-** ms=STYLE sets tag match style to EXACT, GLOB, LIKE, REGEXP
1425
-** u=USER only show items associated with USER
1422
+** t=TAG Show only check-ins with the given TAG
1423
+** r=TAG Show check-ins related to TAG, equivalent to t=TAG&rel
1424
+** rel Show related check-ins as well as those matching t=TAG
1425
+** mionly Limit rel to show ancestors but not descendants
1426
+** ms=STYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
1427
+** u=USER Only show items associated with USER
14261428
** y=TYPE 'ci', 'w', 't', 'e', or (default) 'all'
14271429
** ng No Graph.
14281430
** nd Do not highlight the focus check-in
14291431
** v Show details of files changed
14301432
** f=CHECKIN Show family (immediate parents and children) of CHECKIN
@@ -1462,11 +1464,12 @@
14621464
const char *zAfter = P("a"); /* Events after this time */
14631465
const char *zBefore = P("b"); /* Events before this time */
14641466
const char *zCirca = P("c"); /* Events near this time */
14651467
const char *zMark = P("m"); /* Mark this event or an event this time */
14661468
const char *zTagName = P("t"); /* Show events with this tag */
1467
- const char *zBrName = P("r"); /* Show events related to this tag */
1469
+ const char *zBrName = P("r"); /* Equivalent to t=TAG&rel */
1470
+ int related = PB("rel"); /* Show events related to zTagName */
14681471
const char *zMatchStyle = P("ms"); /* Tag/branch match style string */
14691472
MatchStyle matchStyle = MS_EXACT; /* Match style code */
14701473
const char *zMatchDesc = 0; /* Tag match expression description text */
14711474
const char *zTagSql = 0; /* Tag/branch match SQL expression */
14721475
const char *zSearch = P("s"); /* Search string */
@@ -1529,46 +1532,45 @@
15291532
return;
15301533
}
15311534
url_initialize(&url, "timeline");
15321535
cgi_query_parameters_to_url(&url);
15331536
1534
- /* Ignore empty tag or branch name query strings. */
1537
+ /* Convert r=TAG to t=TAG&rel. */
1538
+ if( zBrName && !related ){
1539
+ cgi_delete_query_parameter("r");
1540
+ cgi_set_query_parameter("t", zBrName);
1541
+ cgi_set_query_parameter("rel", "1");
1542
+ zTagName = zBrName;
1543
+ related = 1;
1544
+ }
1545
+
1546
+ /* Ignore empty tag query strings. */
15351547
if( zTagName && !*zTagName ){
1536
- zTagName = 0;
1537
- }
1538
- if( zBrName && !*zBrName ){
1539
- zBrName = 0;
1548
+ zTagName = 0;
15401549
}
15411550
1542
- /* Identify the tag or branch name or match pattern. */
1551
+ /* Finish preliminary processing of tag match queries. */
15431552
if( zTagName ){
1544
- zThisTag = zTagName;
1545
- }else if( zBrName ){
1546
- zThisTag = zBrName;
1547
- }
1548
-
1549
- /* Interpet the tag style string. */
1550
- if( zThisTag ){
1553
+ /* Interpet the tag style string. */
15511554
if( fossil_stricmp(zMatchStyle, "glob")==0 ){
15521555
matchStyle = MS_GLOB;
15531556
}else if( fossil_stricmp(zMatchStyle, "like")==0 ){
15541557
matchStyle = MS_LIKE;
15551558
}else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
15561559
matchStyle = MS_REGEXP;
1560
+ }else{
1561
+ /* For exact maching, inhibit links to the selected tag. */
1562
+ zThisTag = zTagName;
15571563
}
1558
- }
1564
+
1565
+ /* Display a checkbox to enable/disable display of related check-ins. */
1566
+ style_submenu_checkbox("rel", "Related", 0);
15591567
1560
- /* Construct the tag match expression. */
1561
- if( zThisTag ){
1562
- zTagSql = tagMatchExpression(matchStyle, zThisTag, &zMatchDesc);
1568
+ /* Construct the tag match expression. */
1569
+ zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc);
15631570
}
15641571
1565
- if( zTagName && g.perm.Read ){
1566
- timeline_submenu(&url, "Related", "r", zTagName, "t");
1567
- }else if( zBrName && g.perm.Read ){
1568
- timeline_submenu(&url, "Branch Only", "t", zBrName, "r");
1569
- }
15701572
if( zMark && zMark[0]==0 ){
15711573
if( zAfter ) zMark = zAfter;
15721574
if( zBefore ) zMark = zBefore;
15731575
if( zCirca ) zMark = zCirca;
15741576
}
@@ -1800,11 +1802,11 @@
18001802
if( zTagSql ){
18011803
blob_append_sql(&cond,
18021804
" AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag"
18031805
" WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/);
18041806
1805
- if( zBrName ){
1807
+ if( related ){
18061808
/* The next two blob_appendf() calls add SQL that causes check-ins that
18071809
** are not part of the branch which are parents or children of the
18081810
** branch to be included in the report. This related check-ins are
18091811
** useful in helping to visualize what has happened on a quiescent
18101812
** branch that is infrequently merged with a much more activate branch.
@@ -1974,21 +1976,23 @@
19741976
}
19751977
if( zUser ){
19761978
blob_appendf(&desc, " by user %h", zUser);
19771979
tmFlags |= TIMELINE_DISJOINT;
19781980
}
1979
- if( zThisTag ){
1980
- if( matchStyle!=MS_EXACT ){
1981
- if( zTagName ){
1982
- blob_appendf(&desc, " with tags matching %h", zMatchDesc);
1983
- }else{
1984
- blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
1985
- }
1986
- }else if( zTagName ){
1987
- blob_appendf(&desc, " tagged with %h", zMatchDesc);
1988
- }else{
1989
- blob_appendf(&desc, " related to %h", zMatchDesc);
1981
+ if( zTagName ){
1982
+ if( matchStyle==MS_EXACT ){
1983
+ if( related ){
1984
+ blob_appendf(&desc, " related to %h", zMatchDesc);
1985
+ }else{
1986
+ blob_appendf(&desc, " tagged with %h", zMatchDesc);
1987
+ }
1988
+ }else{
1989
+ if( related ){
1990
+ blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
1991
+ }else{
1992
+ blob_appendf(&desc, " with tags matching %h", zMatchDesc);
1993
+ }
19901994
}
19911995
tmFlags |= TIMELINE_DISJOINT;
19921996
}
19931997
addFileGlobDescription(zChng, &desc);
19941998
if( rAfter>0.0 ){
19951999
--- src/timeline.c
+++ src/timeline.c
@@ -1409,22 +1409,24 @@
1409 /*
1410 ** WEBPAGE: timeline
1411 **
1412 ** Query parameters:
1413 **
1414 ** a=TIMEORTAG after this event
1415 ** b=TIMEORTAG before this event
1416 ** c=TIMEORTAG "circa" this event
1417 ** m=TIMEORTAG mark this event
1418 ** n=COUNT suggested number of events in output
1419 ** p=CHECKIN parents and ancestors of CHECKIN
1420 ** d=CHECKIN descendants of CHECIN
1421 ** dp=CHECKIN The same as d=CHECKIN&p=CHECKIN
1422 ** t=TAG show only check-ins with the given TAG
1423 ** r=TAG show check-ins related to TAG
1424 ** ms=STYLE sets tag match style to EXACT, GLOB, LIKE, REGEXP
1425 ** u=USER only show items associated with USER
 
 
1426 ** y=TYPE 'ci', 'w', 't', 'e', or (default) 'all'
1427 ** ng No Graph.
1428 ** nd Do not highlight the focus check-in
1429 ** v Show details of files changed
1430 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
@@ -1462,11 +1464,12 @@
1462 const char *zAfter = P("a"); /* Events after this time */
1463 const char *zBefore = P("b"); /* Events before this time */
1464 const char *zCirca = P("c"); /* Events near this time */
1465 const char *zMark = P("m"); /* Mark this event or an event this time */
1466 const char *zTagName = P("t"); /* Show events with this tag */
1467 const char *zBrName = P("r"); /* Show events related to this tag */
 
1468 const char *zMatchStyle = P("ms"); /* Tag/branch match style string */
1469 MatchStyle matchStyle = MS_EXACT; /* Match style code */
1470 const char *zMatchDesc = 0; /* Tag match expression description text */
1471 const char *zTagSql = 0; /* Tag/branch match SQL expression */
1472 const char *zSearch = P("s"); /* Search string */
@@ -1529,46 +1532,45 @@
1529 return;
1530 }
1531 url_initialize(&url, "timeline");
1532 cgi_query_parameters_to_url(&url);
1533
1534 /* Ignore empty tag or branch name query strings. */
 
 
 
 
 
 
 
 
 
1535 if( zTagName && !*zTagName ){
1536 zTagName = 0;
1537 }
1538 if( zBrName && !*zBrName ){
1539 zBrName = 0;
1540 }
1541
1542 /* Identify the tag or branch name or match pattern. */
1543 if( zTagName ){
1544 zThisTag = zTagName;
1545 }else if( zBrName ){
1546 zThisTag = zBrName;
1547 }
1548
1549 /* Interpet the tag style string. */
1550 if( zThisTag ){
1551 if( fossil_stricmp(zMatchStyle, "glob")==0 ){
1552 matchStyle = MS_GLOB;
1553 }else if( fossil_stricmp(zMatchStyle, "like")==0 ){
1554 matchStyle = MS_LIKE;
1555 }else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
1556 matchStyle = MS_REGEXP;
 
 
 
1557 }
1558 }
 
 
1559
1560 /* Construct the tag match expression. */
1561 if( zThisTag ){
1562 zTagSql = tagMatchExpression(matchStyle, zThisTag, &zMatchDesc);
1563 }
1564
1565 if( zTagName && g.perm.Read ){
1566 timeline_submenu(&url, "Related", "r", zTagName, "t");
1567 }else if( zBrName && g.perm.Read ){
1568 timeline_submenu(&url, "Branch Only", "t", zBrName, "r");
1569 }
1570 if( zMark && zMark[0]==0 ){
1571 if( zAfter ) zMark = zAfter;
1572 if( zBefore ) zMark = zBefore;
1573 if( zCirca ) zMark = zCirca;
1574 }
@@ -1800,11 +1802,11 @@
1800 if( zTagSql ){
1801 blob_append_sql(&cond,
1802 " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag"
1803 " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/);
1804
1805 if( zBrName ){
1806 /* The next two blob_appendf() calls add SQL that causes check-ins that
1807 ** are not part of the branch which are parents or children of the
1808 ** branch to be included in the report. This related check-ins are
1809 ** useful in helping to visualize what has happened on a quiescent
1810 ** branch that is infrequently merged with a much more activate branch.
@@ -1974,21 +1976,23 @@
1974 }
1975 if( zUser ){
1976 blob_appendf(&desc, " by user %h", zUser);
1977 tmFlags |= TIMELINE_DISJOINT;
1978 }
1979 if( zThisTag ){
1980 if( matchStyle!=MS_EXACT ){
1981 if( zTagName ){
1982 blob_appendf(&desc, " with tags matching %h", zMatchDesc);
1983 }else{
1984 blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
1985 }
1986 }else if( zTagName ){
1987 blob_appendf(&desc, " tagged with %h", zMatchDesc);
1988 }else{
1989 blob_appendf(&desc, " related to %h", zMatchDesc);
 
 
1990 }
1991 tmFlags |= TIMELINE_DISJOINT;
1992 }
1993 addFileGlobDescription(zChng, &desc);
1994 if( rAfter>0.0 ){
1995
--- src/timeline.c
+++ src/timeline.c
@@ -1409,22 +1409,24 @@
1409 /*
1410 ** WEBPAGE: timeline
1411 **
1412 ** Query parameters:
1413 **
1414 ** a=TIMEORTAG After this event
1415 ** b=TIMEORTAG Before this event
1416 ** c=TIMEORTAG "Circa" this event
1417 ** m=TIMEORTAG Mark this event
1418 ** n=COUNT Suggested number of events in output
1419 ** p=CHECKIN Parents and ancestors of CHECKIN
1420 ** d=CHECKIN Descendants of CHECIN
1421 ** dp=CHECKIN The same as d=CHECKIN&p=CHECKIN
1422 ** t=TAG Show only check-ins with the given TAG
1423 ** r=TAG Show check-ins related to TAG, equivalent to t=TAG&rel
1424 ** rel Show related check-ins as well as those matching t=TAG
1425 ** mionly Limit rel to show ancestors but not descendants
1426 ** ms=STYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
1427 ** u=USER Only show items associated with USER
1428 ** y=TYPE 'ci', 'w', 't', 'e', or (default) 'all'
1429 ** ng No Graph.
1430 ** nd Do not highlight the focus check-in
1431 ** v Show details of files changed
1432 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
@@ -1462,11 +1464,12 @@
1464 const char *zAfter = P("a"); /* Events after this time */
1465 const char *zBefore = P("b"); /* Events before this time */
1466 const char *zCirca = P("c"); /* Events near this time */
1467 const char *zMark = P("m"); /* Mark this event or an event this time */
1468 const char *zTagName = P("t"); /* Show events with this tag */
1469 const char *zBrName = P("r"); /* Equivalent to t=TAG&rel */
1470 int related = PB("rel"); /* Show events related to zTagName */
1471 const char *zMatchStyle = P("ms"); /* Tag/branch match style string */
1472 MatchStyle matchStyle = MS_EXACT; /* Match style code */
1473 const char *zMatchDesc = 0; /* Tag match expression description text */
1474 const char *zTagSql = 0; /* Tag/branch match SQL expression */
1475 const char *zSearch = P("s"); /* Search string */
@@ -1529,46 +1532,45 @@
1532 return;
1533 }
1534 url_initialize(&url, "timeline");
1535 cgi_query_parameters_to_url(&url);
1536
1537 /* Convert r=TAG to t=TAG&rel. */
1538 if( zBrName && !related ){
1539 cgi_delete_query_parameter("r");
1540 cgi_set_query_parameter("t", zBrName);
1541 cgi_set_query_parameter("rel", "1");
1542 zTagName = zBrName;
1543 related = 1;
1544 }
1545
1546 /* Ignore empty tag query strings. */
1547 if( zTagName && !*zTagName ){
1548 zTagName = 0;
 
 
 
1549 }
1550
1551 /* Finish preliminary processing of tag match queries. */
1552 if( zTagName ){
1553 /* Interpet the tag style string. */
 
 
 
 
 
 
1554 if( fossil_stricmp(zMatchStyle, "glob")==0 ){
1555 matchStyle = MS_GLOB;
1556 }else if( fossil_stricmp(zMatchStyle, "like")==0 ){
1557 matchStyle = MS_LIKE;
1558 }else if( fossil_stricmp(zMatchStyle, "regexp")==0 ){
1559 matchStyle = MS_REGEXP;
1560 }else{
1561 /* For exact maching, inhibit links to the selected tag. */
1562 zThisTag = zTagName;
1563 }
1564
1565 /* Display a checkbox to enable/disable display of related check-ins. */
1566 style_submenu_checkbox("rel", "Related", 0);
1567
1568 /* Construct the tag match expression. */
1569 zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc);
 
1570 }
1571
 
 
 
 
 
1572 if( zMark && zMark[0]==0 ){
1573 if( zAfter ) zMark = zAfter;
1574 if( zBefore ) zMark = zBefore;
1575 if( zCirca ) zMark = zCirca;
1576 }
@@ -1800,11 +1802,11 @@
1802 if( zTagSql ){
1803 blob_append_sql(&cond,
1804 " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag"
1805 " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/);
1806
1807 if( related ){
1808 /* The next two blob_appendf() calls add SQL that causes check-ins that
1809 ** are not part of the branch which are parents or children of the
1810 ** branch to be included in the report. This related check-ins are
1811 ** useful in helping to visualize what has happened on a quiescent
1812 ** branch that is infrequently merged with a much more activate branch.
@@ -1974,21 +1976,23 @@
1976 }
1977 if( zUser ){
1978 blob_appendf(&desc, " by user %h", zUser);
1979 tmFlags |= TIMELINE_DISJOINT;
1980 }
1981 if( zTagName ){
1982 if( matchStyle==MS_EXACT ){
1983 if( related ){
1984 blob_appendf(&desc, " related to %h", zMatchDesc);
1985 }else{
1986 blob_appendf(&desc, " tagged with %h", zMatchDesc);
1987 }
1988 }else{
1989 if( related ){
1990 blob_appendf(&desc, " related to tags matching %h", zMatchDesc);
1991 }else{
1992 blob_appendf(&desc, " with tags matching %h", zMatchDesc);
1993 }
1994 }
1995 tmFlags |= TIMELINE_DISJOINT;
1996 }
1997 addFileGlobDescription(zChng, &desc);
1998 if( rAfter>0.0 ){
1999

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button