Change grep -e to grep --all
authormpm@selenic.com
Wed, 07 Sep 2005 20:50:23 -0700
changeset 1212 ccb6201e3f28
parent 1211 1c455338ad95
child 1213 db9639b8594c
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.
doc/hg.1.txt
mercurial/commands.py
tests/test-grep
--- 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'),
--- 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