Mercurial > hg > hg-git
diff hggit/gitdirstate.py @ 1038:e3dab807e38c
compat: delay importing osutil until we know we need it
Since 006c837f9181 we don't need osutil on hg >= 4.3. When demandimport
is enabled, this extra import doesn't hurt anything, but it breaks
doctests.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Sun, 06 Aug 2017 09:45:35 -0500 (2017-08-06) |
parents | 006c837f9181 |
children | cf982a23e15c |
line wrap: on
line diff
--- a/hggit/gitdirstate.py +++ b/hggit/gitdirstate.py @@ -6,7 +6,6 @@ from mercurial import ( dirstate, match as matchmod, - osutil, scmutil, util, ) @@ -156,9 +155,11 @@ matchalways = match.always() matchtdir = match.traversedir dmap = self._map + # osutil moved in hg 4.3, but util re-exports listdir try: listdir = util.listdir except AttributeError: + from mercurial import osutil listdir = osutil.listdir lstat = os.lstat dirkind = stat.S_IFDIR