keyword search on hg log

TK Soh teekaysoh at gmail.com
Thu Mar 29 17:00:48 UTC 2007


On 3/28/07, Matt Mackall <mpm at selenic.com> wrote:
> Feel free to fix it. It's also in hgweb.

Please review these patches: two on the search fix, plus on to update
the help doc on --keyword. Thanks.
-------------- next part --------------
# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Date 1175178779 18000
# Node ID 1193d37c788a8cdf06ee83490a8bf0ef1c114564
# Parent  98ada748a77f5d8ec43fc3841ccac93c84fa28cf
hgweb: expand keyword search to full list of files

diff -r 98ada748a77f -r 1193d37c788a mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Thu Mar 29 09:28:10 2007 -0500
+++ b/mercurial/hgweb/hgweb_mod.py	Thu Mar 29 09:32:59 2007 -0500
@@ -257,7 +257,7 @@ class hgweb(object):
                 for q in qw:
                     if not (q in ctx.user().lower() or
                             q in ctx.description().lower() or
-                            q in " ".join(ctx.files()[:20]).lower()):
+                            q in " ".join(ctx.files()).lower()):
                         miss = 1
                         break
                 if miss:
-------------- next part --------------
# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Date 1175178490 18000
# Node ID 98ada748a77f5d8ec43fc3841ccac93c84fa28cf
# Parent  a1406a50ca83e9d3388f7273c8f6ee9283d83c5c
log: expand keyword search to full list of files

diff -r a1406a50ca83 -r 98ada748a77f mercurial/commands.py
--- a/mercurial/commands.py	Tue Mar 13 13:17:26 2007 +0100
+++ b/mercurial/commands.py	Thu Mar 29 09:28:10 2007 -0500
@@ -1772,7 +1772,7 @@ def log(ui, repo, *pats, **opts):
                 for k in [kw.lower() for kw in opts['keyword']]:
                     if not (k in changes[1].lower() or
                             k in changes[4].lower() or
-                            k in " ".join(changes[3][:20]).lower()):
+                            k in " ".join(changes[3]).lower()):
                         miss = 1
                         break
                 if miss:
-------------- next part --------------
# HG changeset patch
# User TK Soh <teekaysoh at yahoo.com>
# Date 1175181919 18000
# Node ID 771fa151a4909b6d192b45fed8c5c91b055bd1fc
# Parent  1193d37c788a8cdf06ee83490a8bf0ef1c114564
help: log --keyword is case-insensitive

diff -r 1193d37c788a -r 771fa151a490 mercurial/commands.py
--- a/mercurial/commands.py	Thu Mar 29 09:32:59 2007 -0500
+++ b/mercurial/commands.py	Thu Mar 29 10:25:19 2007 -0500
@@ -2842,7 +2842,7 @@ table = {
            _('only follow the first parent of merge changesets')),
           ('d', 'date', '', _('show revs matching date spec')),
           ('C', 'copies', None, _('show copied files')),
-          ('k', 'keyword', [], _('search for a keyword')),
+          ('k', 'keyword', [], _('do case-insensitive search for a keyword')),
           ('l', 'limit', '', _('limit number of changes displayed')),
           ('r', 'rev', [], _('show the specified revision or range')),
           ('', 'removed', None, _('include revs where files were removed')),


More information about the Mercurial mailing list