subrepo: avoid redundant "util.makedirs" invocation
"util.makedirs" for the (sub-)repository root of "hgsubrepo" is also
executed in the constructor of "localrepository", if "create" is True
and ".hg" of it doesn't exist.
This patch avoids redundant "util.makedirs" invocation in the
constructor of "hgsubrepo".
--- a/mercurial/subrepo.py Wed Nov 19 08:50:08 2014 -0800
+++ b/mercurial/subrepo.py Wed Nov 19 18:35:14 2014 +0900
@@ -522,10 +522,7 @@
self._state = state
r = ctx._repo
root = r.wjoin(path)
- create = False
- if not os.path.exists(os.path.join(root, '.hg')):
- create = True
- util.makedirs(root)
+ create = not os.path.exists(os.path.join(root, '.hg'))
self._repo = hg.repository(r.baseui, root, create=create)
for s, k in [('ui', 'commitsubrepos')]:
v = r.ui.config(s, k)