Mercurial > hg-git
comparison hggit/__init__.py @ 994:9c15c89088fd
gitdirstate: only wrap for hg-git repos
Previously, if a user enables hg-git and in a non-git repo (i.e.
hg-only) they have a .gitignore, then hg-git will try to parse that. I
consider this a bug and a bad performance regression for what should be
a no-op.
author | Sean Farley <sean@farley.io> |
---|---|
date | Fri, 02 Sep 2016 18:26:01 -0700 |
parents | 1fec6463922b |
children | a128b9a53b5a |
comparison
equal
deleted
inserted
replaced
993:1fec6463922b | 994:9c15c89088fd |
---|---|
206 | 206 |
207 def reposetup(ui, repo): | 207 def reposetup(ui, repo): |
208 if not isinstance(repo, gitrepo.gitrepo): | 208 if not isinstance(repo, gitrepo.gitrepo): |
209 | 209 |
210 if (getattr(dirstate, 'rootcache', False) and | 210 if (getattr(dirstate, 'rootcache', False) and |
211 (not ignoremod or getattr(ignore, 'readpats', False))): | 211 (not ignoremod or getattr(ignore, 'readpats', False)) and |
212 hgutil.safehasattr(repo, 'join') and | |
213 os.path.exists(repo.join('git'))): | |
212 # only install our dirstate wrapper if it has a hope of working | 214 # only install our dirstate wrapper if it has a hope of working |
213 import gitdirstate | 215 import gitdirstate |
214 if ignoremod: | 216 if ignoremod: |
215 def ignorewrap(orig, *args, **kwargs): | 217 def ignorewrap(orig, *args, **kwargs): |
216 return gitdirstate.gignore(*args, **kwargs) | 218 return gitdirstate.gignore(*args, **kwargs) |