comparison hgsubversion/layouts/standard.py @ 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 4744b7bfa476
children 738c685f893c
comparison
equal deleted inserted replaced
1267:5f86e2ac7659 1268:fadacedaf391
7 7
8 def __init__(self, meta): 8 def __init__(self, meta):
9 base.BaseLayout.__init__(self, meta) 9 base.BaseLayout.__init__(self, meta)
10 10
11 self._tag_locations = None 11 self._tag_locations = None
12
13 # branchdir is expected to be stripped of leading slashes but retain
14 # its last slash
15 meta._gen_cachedconfig('branchdir', 'branches',
16 pre=lambda x: '/'.join(p for p in x.split('/')
17 if p) + '/')
12 18
13 self._branch_dir = self.meta.ui.config('hgsubversion', 'branchdir', 'branches') 19 self._branch_dir = self.meta.ui.config('hgsubversion', 'branchdir', 'branches')
14 if self._branch_dir[0] == '/': 20 if self._branch_dir[0] == '/':
15 self._branch_dir = self._branch_dir[1:] 21 self._branch_dir = self._branch_dir[1:]
16 if self._branch_dir[-1] != '/': 22 if self._branch_dir[-1] != '/':