Mercurial > hg
changeset 1212:ccb6201e3f28
Change grep -e to grep --all
We want to reserve -e for future use and grep compatibility.
I've changed every-match to all out of a general preference for
shorter long option names where short options don't exist.
author | mpm@selenic.com |
---|---|
date | Wed, 07 Sep 2005 20:50:23 -0700 |
parents | 1c455338ad95 |
children | db9639b8594c |
files | doc/hg.1.txt mercurial/commands.py tests/test-grep |
diffstat | 3 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/hg.1.txt Wed Sep 07 20:09:16 2005 -0700 +++ b/doc/hg.1.txt Wed Sep 07 20:50:23 2005 -0700 @@ -219,13 +219,13 @@ file in which it finds a match. To get it to print every revision that contains a change in match status ("-" for a match that becomes a non-match, or "+" for a non-match that becomes a match), - use the --every-match flag. + use the --all flag. options: -0, --print0 end fields with NUL -I, --include <pat> include names matching the given patterns -X, --exclude <pat> exclude names matching the given patterns - -e, --every-match print every revision that matches + --all print all revisions that match -i, --ignore-case ignore case when matching -l, --files-with-matches print only file names and revs that match -n, --line-number print matching line numbers
--- a/mercurial/commands.py Wed Sep 07 20:09:16 2005 -0700 +++ b/mercurial/commands.py Wed Sep 07 20:50:23 2005 -0700 @@ -912,7 +912,7 @@ counts = {'-': 0, '+': 0} filerevmatches = {} for l in diff: - if incrementing or not opts['every_match']: + if incrementing or not opts['all']: change = ((l in prevstates) and '-') or '+' r = rev else: @@ -920,7 +920,7 @@ r = prev[fn] cols = [fn, str(rev)] if opts['line_number']: cols.append(str(l.linenum)) - if opts['every_match']: cols.append(change) + if opts['all']: cols.append(change) if opts['user']: cols.append(trimuser(ui, getchange(rev)[1], rev, ucache)) if opts['files_with_matches']: @@ -957,10 +957,10 @@ states.sort() for fn, m in states: if fn in skip: continue - if incrementing or not opts['every_match'] or fstate[fn]: + if incrementing or not opts['all'] or fstate[fn]: pos, neg = display(fn, rev, m, fstate[fn]) count += pos + neg - if pos and not opts['every_match']: + if pos and not opts['all']: skip[fn] = True fstate[fn] = m prev[fn] = rev @@ -1666,7 +1666,7 @@ [('0', 'print0', None, 'end fields with NUL'), ('I', 'include', [], 'include path in search'), ('X', 'exclude', [], 'include path in search'), - ('e', 'every-match', None, 'print every rev with matches'), + ('', 'all', None, 'print all revisions with matches'), ('i', 'ignore-case', None, 'ignore case when matching'), ('l', 'files-with-matches', None, 'print names of files and revs with matches'), ('n', 'line-number', None, 'print line numbers'),