# HG changeset patch # User Sean Farley # Date 1395678050 18000 # Node ID fadacedaf391a3d77eecc97fc6b646a3b08c9902 # Parent 5f86e2ac7659a0b48d5e1d3d5bba5ea8516843bb layouts: add cached branchdir property to standard Currently, this does nothing but we will use this in the next patch to remove the direct call to ui.config. diff --git a/hgsubversion/layouts/standard.py b/hgsubversion/layouts/standard.py --- a/hgsubversion/layouts/standard.py +++ b/hgsubversion/layouts/standard.py @@ -10,6 +10,12 @@ class StandardLayout(base.BaseLayout): self._tag_locations = None + # branchdir is expected to be stripped of leading slashes but retain + # its last slash + meta._gen_cachedconfig('branchdir', 'branches', + pre=lambda x: '/'.join(p for p in x.split('/') + if p) + '/') + self._branch_dir = self.meta.ui.config('hgsubversion', 'branchdir', 'branches') if self._branch_dir[0] == '/': self._branch_dir = self._branch_dir[1:]