# HG changeset patch # User Sean Farley # Date 1395678051 18000 # Node ID d21b7259724ae22c302df92cd0b6e87cf272314f # Parent a1ca3d6be68ca8c98cead10639744b58e12363eb layouts: add cached infix property to standard diff --git a/hgsubversion/layouts/standard.py b/hgsubversion/layouts/standard.py --- a/hgsubversion/layouts/standard.py +++ b/hgsubversion/layouts/standard.py @@ -16,6 +16,15 @@ class StandardLayout(base.BaseLayout): pre=lambda x: '/'.join(p for p in x.split('/') if p) + '/') + # infix is expected to be stripped of trailing slashes but retain + # its first slash + def _infix_transform(x): + x = '/'.join(p for p in x.split('/') if p) + if x: + x = '/' + x + return x + meta._gen_cachedconfig('infix', '', pre=_infix_transform) + self._infix = self.meta.ui.config('hgsubversion', 'infix', '').strip('/') if self._infix: self._infix = '/' + self._infix