# HG changeset patch # User mpm@selenic.com # Date 1126151423 25200 # Node ID ccb6201e3f28a362737312cdd244a2ddcc952645 # Parent 1c455338ad95b50ae8ce36e64f91ec1a0ea94c53 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. diff -r 1c455338ad95 -r ccb6201e3f28 doc/hg.1.txt --- 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 include names matching the given patterns -X, --exclude 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 diff -r 1c455338ad95 -r ccb6201e3f28 mercurial/commands.py --- 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'), diff -r 1c455338ad95 -r ccb6201e3f28 tests/test-grep --- a/tests/test-grep Wed Sep 07 20:09:16 2005 -0700 +++ b/tests/test-grep Wed Sep 07 20:50:23 2005 -0700 @@ -19,5 +19,5 @@ hg commit -m 4 -u spam -d '4 0' hg grep port port echo 'FIXME: history is wrong here' -hg grep -enu port port +hg grep --all -nu port port hg grep import port