# HG changeset patch # User FUJIWARA Katsunori # Date 1416389714 -32400 # Node ID 55525924af43e98521c6f8880a6702963cfb18e6 # Parent cc83cac41619b32375b28f821237fb0747010b80 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". diff -r cc83cac41619 -r 55525924af43 mercurial/subrepo.py --- 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)