Patchwork D7617: fix: make example fix hgrc work in subdirs

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2019, 10:42 p.m.
Message ID <differential-rev-PHID-DREV-zrbxjgsdv6okb6intvc5-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43759/
State Superseded
Headers show

Comments

phabricator - Dec. 12, 2019, 10:42 p.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Filesets are relative to the current working directory by default, so we use
  rootglob: to change this behavior.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  contrib/examples/fix.hgrc

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 12, 2019, 10:54 p.m.
mharbison72 added a comment.


  See D7065 <https://phab.mercurial-scm.org/D7065> and D7570 <https://phab.mercurial-scm.org/D7570>.  I didn't realize you could stack `set:` and the other patterns like this.

REPOSITORY
  rHG Mercurial

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

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

To: spectral, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 13, 2019, 12:31 a.m.
spectral added a comment.
spectral planned changes to this revision.


  In D7617#112130 <https://phab.mercurial-scm.org/D7617#112130>, @mharbison72 wrote:
  
  > See D7065 <https://phab.mercurial-scm.org/D7065> and D7570 <https://phab.mercurial-scm.org/D7570>.  I didn't realize you could stack `set:` and the other patterns like this.
  
  As far as I know, set: isn't a pattern itself, it's a "hey, everything that comes after this is a fileset, not a glob".
  
  I'm OK waiting for D7570 <https://phab.mercurial-scm.org/D7570>, it's the main reason I split this out from the other two in this stack, but if we want to accept it before D7570 <https://phab.mercurial-scm.org/D7570> makes it in (unsure if it's currently blocked), I'm also OK with that.
  
  I think that the later commits are still useful, though: I don't think D7570 <https://phab.mercurial-scm.org/D7570> deals with `listfile`, and the configuration for clang-format is broken in other ways. I'll reorder them so this is tip instead of root.

INLINE COMMENTS

> fix.hgrc:2
>  [fix]
> -clang-format:command = clang-format --style file -i
> -clang-format:pattern = (**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"

Oops, split failure, this line should remain, I'll send an update.

REPOSITORY
  rHG Mercurial

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

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

To: spectral, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 20, 2019, 12:28 p.m.
pulkit added a comment.


  This fails to apply on current tip of default, needs rebase.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

To: spectral, #hg-reviewers, pulkit
Cc: mharbison72, mercurial-devel
phabricator - Dec. 20, 2019, 2:56 p.m.
martinvonz added a comment.


  In D7617#113453 <https://phab.mercurial-scm.org/D7617#113453>, @pulkit wrote:
  
  > This fails to apply on current tip of default, needs rebase.
  
  It seems like D7570 <https://phab.mercurial-scm.org/D7570> is pretty much ready,  so we could drop this patch then. I think the `rootglob:`s are a slight distraction that we should not have if they're not needed.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

To: spectral, #hg-reviewers, pulkit
Cc: martinvonz, mharbison72, mercurial-devel
phabricator - Jan. 8, 2020, 8:02 p.m.
durin42 added a comment.


  Now that D7570 <https://phab.mercurial-scm.org/D7570> is landed, this is obsolete, right?

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

To: spectral, #hg-reviewers, pulkit
Cc: durin42, martinvonz, mharbison72, mercurial-devel

Patch

diff --git a/contrib/examples/fix.hgrc b/contrib/examples/fix.hgrc
--- a/contrib/examples/fix.hgrc
+++ b/contrib/examples/fix.hgrc
@@ -1,9 +1,8 @@ 
 [fix]
-clang-format:command = clang-format --style file -i
-clang-format:pattern = (**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"
+clang-format:pattern = (rootglob:**.c or rootglob:**.cc or rootglob:**.h) and not "listfile:contrib/clang-format-ignorelist"
 
 rustfmt:command = rustfmt
-rustfmt:pattern = set:**.rs
+rustfmt:pattern = set:rootglob:**.rs
 
 black:command = black --config=black.toml -
-black:pattern = set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"
+black:pattern = set:rootglob:**.py - rootglob:mercurial/thirdparty/** - "rootglob:contrib/python-zstandard/**"