changeset 1268:fadacedaf391

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:50 -0500
parents 5f86e2ac7659
children 738c685f893c
files hgsubversion/layouts/standard.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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:]