Patchwork D8034: check-code: allow `hg cp -r`, by using a negative lookbehind

login
register
mail settings
Submitter phabricator
Date Jan. 28, 2020, 11:53 p.m.
Message ID <differential-rev-PHID-DREV-6xqjbo5a2crqya56l5bb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44720/
State Superseded
Headers show

Comments

phabricator - Jan. 28, 2020, 11:53 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/check-code.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 7, 2020, 8:51 p.m.
marmoute added a comment.


  See my comment in D8030 <https://phab.mercurial-scm.org/D8030>, the feature is interresting, but it seems to me that we should implement that through regular amend.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: marmoute, mercurial-devel
phabricator - Feb. 12, 2020, 7:44 p.m.
durin42 added a comment.


  I think this is obsolete now? Maybe?

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: durin42, marmoute, mercurial-devel
phabricator - Feb. 12, 2020, 7:45 p.m.
This revision is now accepted and ready to land.
durin42 added a comment.
durin42 accepted this revision.


  Nevermind, I misread.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

To: martinvonz, #hg-reviewers, durin42
Cc: durin42, marmoute, mercurial-devel
phabricator - Feb. 14, 2020, 11:16 p.m.
martinvonz added a comment.
martinvonz abandoned this revision.


  No longer needed now that we've renamed `-r` to `--at-rev`.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers, durin42
Cc: durin42, marmoute, mercurial-devel

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -183,7 +183,7 @@ 
             "don't use 'sed ... \\n', use a \\ and a newline",
         ),
         (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'"),
-        (r'cp.* -r ', "don't use 'cp -r', use 'cp -R'"),
+        (r'(?<!hg )cp.* -r ', "don't use 'cp -r', use 'cp -R'"),
         (r'grep.* -[ABC]', "don't use grep's context flags"),
         (
             r'find.*-printf',