mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
gitignore: add a config option
Summary: gitignore could have performance issues stating .gitignore files everywhere. That happens if watchman returns O(working copy) files. Add a config to disable it as we're finding solutions. Reviewed By: DurhamG Differential Revision: D7482499 fbshipit-source-id: 4c9247b0318bf034c8e9af4b74c21110cc598714
This commit is contained in:
parent
1b393dbae1
commit
d0886b9b94
@ -998,6 +998,9 @@ coreconfigitem('ui', 'formatjson',
|
||||
coreconfigitem('ui', 'formatted',
|
||||
default=None,
|
||||
)
|
||||
coreconfigitem('ui', 'gitignore',
|
||||
default=False,
|
||||
)
|
||||
coreconfigitem('ui', 'graphnodetemplate',
|
||||
default=None,
|
||||
)
|
||||
|
@ -164,7 +164,10 @@ class dirstate(object):
|
||||
@rootcache('.hgignore')
|
||||
def _ignore(self):
|
||||
files = self._ignorefiles()
|
||||
gitignore = matchmod.gitignorematcher(self._root, '')
|
||||
if self._ui.configbool('ui', 'gitignore'):
|
||||
gitignore = matchmod.gitignorematcher(self._root, '')
|
||||
else:
|
||||
gitignore = matchmod.nevermatcher(self._root, '')
|
||||
if not files:
|
||||
return gitignore
|
||||
|
||||
|
@ -2084,6 +2084,9 @@ User interface controls.
|
||||
Encoding to try if it's not possible to decode the changelog using
|
||||
UTF-8. (default: ISO-8859-1)
|
||||
|
||||
``gitignore``
|
||||
Respect gitignore or not. (default: False)
|
||||
|
||||
``graphnodetemplate``
|
||||
The template used to print changeset nodes in an ASCII revision graph.
|
||||
(default: ``{graphnode}``)
|
||||
|
@ -1,4 +1,5 @@
|
||||
$ newrepo
|
||||
$ setconfig ui.gitignore=1
|
||||
|
||||
$ cat > .gitignore << EOF
|
||||
> *.tmp
|
||||
|
@ -3,9 +3,12 @@
|
||||
|
||||
gitignore is used when there is no hgignore:
|
||||
|
||||
$ hg debugignore
|
||||
$ hg debugignore --config ui.gitignore=1
|
||||
<gitignorematcher>
|
||||
|
||||
$ hg debugignore --config ui.gitignore=0
|
||||
<nevermatcher>
|
||||
|
||||
Issue562: .hgignore requires newline at end:
|
||||
|
||||
$ touch foo
|
||||
@ -197,9 +200,12 @@ Test relative ignore path (issue4473):
|
||||
$ hg status .
|
||||
A b.o
|
||||
|
||||
$ hg debugignore
|
||||
$ hg debugignore --config ui.gitignore=1
|
||||
<unionmatcher matchers=[<gitignorematcher>, <includematcher includes='(?:(?:|.*/)[^/]*(?:/|$))'>]>
|
||||
|
||||
$ hg debugignore
|
||||
<unionmatcher matchers=[<nevermatcher>, <includematcher includes='(?:(?:|.*/)[^/]*(?:/|$))'>]>
|
||||
|
||||
$ hg debugignore b.o
|
||||
b.o is ignored
|
||||
(ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: '*') (glob)
|
||||
|
Loading…
Reference in New Issue
Block a user