diff --git a/docs/template-authoring-guide.html b/docs/template-authoring-guide.html
index a9560827..1e5ea465 100644
--- a/docs/template-authoring-guide.html
+++ b/docs/template-authoring-guide.html
@@ -1726,6 +1726,18 @@ td {
Valid values: exact, like, glob,
regex, notregex.
+
+ comment |
+ String |
+ Query string for filtering results by log message. |
+
+
+ comment_match |
+ String |
+ Type of match to perform with comment query string. Possible
+ values: exact, like, glob,
+ regex, notregex. |
+
date |
String |
diff --git a/docs/url-reference.html b/docs/url-reference.html
index 563e5f99..cedf3b2f 100644
--- a/docs/url-reference.html
+++ b/docs/url-reference.html
@@ -999,6 +999,16 @@ th.caption {
optional |
"exact" "like" "glob" "regex" or "notregex" determining type of author match |
+
+ comment=COMMENT |
+ optional |
+ log message query string |
+
+
+ comment_match=COMMENT_MATCH |
+ optional |
+ "exact" "like" "glob" "regex" or "notregex" determining type of log message match |
+
querysort=SORT |
optional |
diff --git a/lib/cvsdb.py b/lib/cvsdb.py
index 61f95693..5f3a6b4a 100644
--- a/lib/cvsdb.py
+++ b/lib/cvsdb.py
@@ -337,6 +337,12 @@ class CheckinDatabase:
temp = self.SQLQueryListString("people.who", query.author_list)
condList.append(temp)
+ if len(query.comment_list):
+ tableList.append(("descs", "(checkins.descid=descs.id)"))
+ temp = self.SQLQueryListString("descs.description",
+ query.comment_list)
+ condList.append(temp)
+
if query.from_date:
temp = "(checkins.ci_when>=\"%s\")" % (str(query.from_date))
condList.append(temp)
@@ -661,6 +667,7 @@ class CheckinDatabaseQuery:
self.directory_list = []
self.file_list = []
self.author_list = []
+ self.comment_list = []
## date range in DBI 2.0 timedate objects
self.from_date = None
@@ -691,6 +698,9 @@ class CheckinDatabaseQuery:
def SetAuthor(self, author, match = "exact"):
self.author_list.append(QueryEntry(author, match))
+ def SetComment(self, comment, match = "exact"):
+ self.comment_list.append(QueryEntry(comment, match))
+
def SetSortMethod(self, sort):
self.sort = sort
diff --git a/lib/viewvc.py b/lib/viewvc.py
index f63d2f4d..53d0d9c4 100644
--- a/lib/viewvc.py
+++ b/lib/viewvc.py
@@ -671,6 +671,8 @@ _legal_params = {
'file_match' : _re_validate_alpha,
'who' : _validate_regex,
'who_match' : _re_validate_alpha,
+ 'comment' : _validate_regex,
+ 'comment_match' : _re_validate_alpha,
'querysort' : _re_validate_alpha,
'date' : _re_validate_alpha,
'hours' : _re_validate_number,
@@ -3154,6 +3156,8 @@ def view_queryform(request):
data['file_match'] = request.query_dict.get('file_match', 'exact')
data['who'] = request.query_dict.get('who', '')
data['who_match'] = request.query_dict.get('who_match', 'exact')
+ data['comment'] = request.query_dict.get('comment', '')
+ data['comment_match'] = request.query_dict.get('comment_match', 'exact')
data['querysort'] = request.query_dict.get('querysort', 'date')
data['date'] = request.query_dict.get('date', 'hours')
data['hours'] = request.query_dict.get('hours', '2')
@@ -3208,7 +3212,8 @@ def english_query(request):
ret.append(' %s ' % request.server.escape(dir))
file = request.query_dict.get('file', '')
if file:
- if len(ret) != 1: ret.append('and ')
+ if len(ret) != 1:
+ ret.append('and ')
ret.append('to file %s ' % request.server.escape(file))
who = request.query_dict.get('who', '')
branch = request.query_dict.get('branch', '')
@@ -3216,6 +3221,9 @@ def english_query(request):
ret.append('on branch %s ' % request.server.escape(branch))
else:
ret.append('on all branches ')
+ comment = request.query_dict.get('comment', '')
+ if comment:
+ ret.append('with comment %s ' % htmlify(comment))
if who:
ret.append('by %s ' % request.server.escape(who))
date = request.query_dict.get('date', 'hours')
@@ -3381,6 +3389,8 @@ def view_query(request):
file_match = request.query_dict.get('file_match', 'exact')
who = request.query_dict.get('who', '')
who_match = request.query_dict.get('who_match', 'exact')
+ comment = request.query_dict.get('comment', '')
+ comment_match = request.query_dict.get('comment_match', 'exact')
querysort = request.query_dict.get('querysort', 'date')
date = request.query_dict.get('date', 'hours')
hours = request.query_dict.get('hours', '2')
@@ -3400,6 +3410,7 @@ def view_query(request):
if not match_types.has_key(branch_match): branch_match = 'exact'
if not match_types.has_key(file_match): file_match = 'exact'
if not match_types.has_key(who_match): who_match = 'exact'
+ if not match_types.has_key(comment_match): comment_match = 'exact'
if not sort_types.has_key(querysort): querysort = 'date'
if not date_types.has_key(date): date = 'hours'
mindate = parse_date(mindate)
@@ -3438,6 +3449,8 @@ def view_query(request):
query.SetFile(file, file_match)
if who:
query.SetAuthor(who, who_match)
+ if comment:
+ query.SetComment(comment, comment_match)
query.SetSortMethod(querysort)
if date == 'hours':
query.SetFromDateHoursAgo(int(hours))
diff --git a/templates/query_form.ezt b/templates/query_form.ezt
index cecdd9c6..6da48014 100644
--- a/templates/query_form.ezt
+++ b/templates/query_form.ezt
@@ -102,6 +102,32 @@ Browse Directory
+
+ Comment: |
+
+
+
+
+
+
+ |
+
Sort By: |
|