Mercurial > hg
comparison mercurial/commands.py @ 1373:965d1db5c95d
hg log: add -k for keyword searching
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 03 Oct 2005 13:45:59 -0700 |
parents | 136920d13fc2 |
children | c3654cfaa77d |
comparison
equal
deleted
inserted
replaced
1372:544633f0080d | 1373:965d1db5c95d |
---|---|
1254 elif st == 'add': | 1254 elif st == 'add': |
1255 du.bump(rev) | 1255 du.bump(rev) |
1256 br = None | 1256 br = None |
1257 if opts['branch']: | 1257 if opts['branch']: |
1258 br = repo.branchlookup([repo.changelog.node(rev)]) | 1258 br = repo.branchlookup([repo.changelog.node(rev)]) |
1259 | |
1260 if opts['keyword']: | |
1261 changes = repo.changelog.read(repo.changelog.node(rev)) | |
1262 miss = 0 | |
1263 for k in opts['keyword']: | |
1264 if not (k in changes[1].lower() or | |
1265 k in changes[4].lower() or | |
1266 k in " ".join(changes[3][:20]).lower()): | |
1267 miss = 1 | |
1268 break | |
1269 if miss: | |
1270 continue | |
1271 | |
1259 show_changeset(du, repo, rev, brinfo=br) | 1272 show_changeset(du, repo, rev, brinfo=br) |
1260 if opts['patch']: | 1273 if opts['patch']: |
1261 changenode = repo.changelog.node(rev) | 1274 changenode = repo.changelog.node(rev) |
1262 prev, other = repo.changelog.parents(changenode) | 1275 prev, other = repo.changelog.parents(changenode) |
1263 dodiff(du, du, repo, prev, changenode, fns) | 1276 dodiff(du, du, repo, prev, changenode, fns) |
1866 "^log|history": | 1879 "^log|history": |
1867 (log, | 1880 (log, |
1868 [('I', 'include', [], 'include path in search'), | 1881 [('I', 'include', [], 'include path in search'), |
1869 ('X', 'exclude', [], 'exclude path from search'), | 1882 ('X', 'exclude', [], 'exclude path from search'), |
1870 ('b', 'branch', None, 'show branches'), | 1883 ('b', 'branch', None, 'show branches'), |
1884 ('k', 'keyword', [], 'search for a keyword'), | |
1871 ('r', 'rev', [], 'revision'), | 1885 ('r', 'rev', [], 'revision'), |
1872 ('p', 'patch', None, 'show patch')], | 1886 ('p', 'patch', None, 'show patch')], |
1873 'hg log [-I] [-X] [-r REV]... [-p] [FILE]'), | 1887 'hg log [-I] [-X] [-r REV]... [-p] [FILE]'), |
1874 "manifest": (manifest, [], 'hg manifest [REV]'), | 1888 "manifest": (manifest, [], 'hg manifest [REV]'), |
1875 "outgoing|out": (outgoing, | 1889 "outgoing|out": (outgoing, |