Skip to content
Snippets Groups Projects
Commit 6faa5b0f authored by durin42's avatar durin42
Browse files

gitignore: gate feature on dirstate having rootcache and ignore having readpats

parent 09028a1e
No related merge requests found
......@@ -41,7 +41,7 @@
'collections',
])
import gitrepo, hgrepo, gitdirstate
import gitrepo, hgrepo
from git_handler import GitHandler
testedwith = '1.9.3 2.0.2 2.1.2 2.2.3 2.3.1'
......@@ -130,9 +130,15 @@
repo.ui.status(_("clearing out the git cache data\n"))
git = GitHandler(repo, ui)
git.clear()
extensions.wrapfunction(ignore, 'ignore', gitdirstate.gignore)
dirstate.dirstate = gitdirstate.gitdirstate
from mercurial import dirstate
from mercurial import ignore
if (getattr(dirstate, 'rootcache', False) and
getattr(ignore, 'readpats', False)):
# only install our dirstate wrapper if it has a hope of working
import gitdirstate
extensions.wrapfunction(ignore, 'ignore', gitdirstate.gignore)
dirstate.dirstate = gitdirstate.gitdirstate
def git_cleanup(ui, repo):
new_map = []
......
$ python -c 'from mercurial.dirstate import rootcache' || exit 80
$ python -c 'from mercurial.ignore import readpats' || exit 80
Load commonly used test logic
$ . "$TESTDIR/testutil"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment