Patchwork D7003: grep: put --diff in the first line of usage

login
register
mail settings
Submitter phabricator
Date Oct. 6, 2019, 7:22 p.m.
Message ID <differential-rev-PHID-DREV-uyi2unzeutmpptp3jk3o-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42040/
State Superseded
Headers show

Comments

phabricator - Oct. 6, 2019, 7:22 p.m.
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7003

AFFECTED FILES
  mercurial/commands.py
  tests/test-completion.t

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 8, 2019, 1 a.m.
marmoute added a comment.


  This does not seems to be the first line you are looking for. The first line we are looking for is the `usage:` line. It is defined lower in the decorator :
  
    _(b'[OPTION]... PATTERN [FILE]...'),
  
  We need to gain a `[--diff]` here.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7003/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7003

To: navaneeth.suresh, #hg-reviewers
Cc: marmoute, mercurial-devel

Patch

diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -326,7 +326,7 @@ 
   files: rev, print0, include, exclude, template, subrepos
   forget: interactive, include, exclude, dry-run
   graft: rev, base, continue, stop, abort, edit, log, no-commit, force, currentdate, currentuser, date, user, tool, dry-run
-  grep: print0, all, diff, text, follow, ignore-case, files-with-matches, line-number, rev, all-files, user, date, template, include, exclude
+  grep: diff, print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, all-files, user, date, template, include, exclude
   heads: rev, topo, active, closed, style, template
   help: extension, command, keyword, system
   identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2710,10 +2710,10 @@ 
 )
 
 @command('grep',
-    [('0', 'print0', None, _('end fields with NUL')),
+    [('', 'diff', None, _('print all revisions when the term was introduced '
+                          'or removed')),
+    ('0', 'print0', None, _('end fields with NUL')),
     ('', 'all', None, _('print all revisions that match (DEPRECATED) ')),
-    ('', 'diff', None, _('print all revisions when the term was introduced '
-                         'or removed')),
     ('a', 'text', None, _('treat all files as text')),
     ('f', 'follow', None,
      _('follow changeset history,'