# HG changeset patch # User Augie Fackler # Date 1436386260 14400 # Node ID 356460fb01fa01b06a5e971977177f5406ae9ac6 # Parent c7d067c174b8bba942d76c773cacd8e179c55f10# Parent 0f1f88e71138923c4e9c5c84f9406bd42f0ea980 Merge with stable. diff --git a/hgsubversion/layouts/custom.py b/hgsubversion/layouts/custom.py --- a/hgsubversion/layouts/custom.py +++ b/hgsubversion/layouts/custom.py @@ -18,7 +18,9 @@ class CustomLayout(base.BaseLayout): self.svn_to_hg = {} self.hg_to_svn = {} - for hg_branch, svn_path in meta.ui.configitems('hgsubversionbranch'): + meta._gen_cachedconfig('custombranches', {}, configname='hgsubversionbranch') + + for hg_branch, svn_path in meta.custombranches.iteritems(): hg_branch = hg_branch.strip() if hg_branch == 'default' or not hg_branch: diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py --- a/hgsubversion/maps.py +++ b/hgsubversion/maps.py @@ -34,7 +34,7 @@ class AuthorMap(dict): self.super = super(AuthorMap, self) self.super.__init__() - self.load(self.meta.authors_file) + self.load(self.meta.authormap_file) # append authors specified from the commandline clmap = util.configpath(self.meta.ui, 'authormap') @@ -49,8 +49,8 @@ class AuthorMap(dict): return writing = False - if path != self.meta.authors_file: - writing = open(self.meta.authors_file, 'a') + if path != self.meta.authormap_file: + writing = open(self.meta.authormap_file, 'a') self.meta.ui.debug('reading authormap from %s\n' % path) f = open(path, 'r') diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -94,6 +94,8 @@ class SVNMeta(object): c = self.ui.configint('hgsubversion', configname, default) elif isinstance(default, list): c = self.ui.configlist('hgsubversion', configname, default) + elif isinstance(default, dict): + c = dict(self.ui.configitems(configname)) else: c = self.ui.config('hgsubversion', configname, default) @@ -284,7 +286,7 @@ class SVNMeta(object): return os.path.join(self.metapath, 'branch_info') @property - def authors_file(self): + def authormap_file(self): return os.path.join(self.metapath, 'authors') @property diff --git a/hgsubversion/svnwrap/subvertpy_wrapper.py b/hgsubversion/svnwrap/subvertpy_wrapper.py --- a/hgsubversion/svnwrap/subvertpy_wrapper.py +++ b/hgsubversion/svnwrap/subvertpy_wrapper.py @@ -186,7 +186,8 @@ class SubversionRepo(object): Note that password stores do not work, the parameter is only here to ensure that the API is the same as for the SWIG wrapper. """ - def __init__(self, url='', username='', password='', head=None, password_stores=None): + def __init__(self, url='', username='', password='', head=None, + password_stores=None, meta=None): parsed = common.parse_url(url, username, password) # --username and --password override URL credentials self.username = parsed[0] @@ -210,6 +211,9 @@ class SubversionRepo(object): self.hasdiff3 = True self.autoprops_config = common.AutoPropsConfig() + # store the svn meta object for use with branch skipping + self.meta = meta + def init_ra_and_client(self): """ Initializes the RA and client layers. diff --git a/hgsubversion/svnwrap/svn_swig_wrapper.py b/hgsubversion/svnwrap/svn_swig_wrapper.py --- a/hgsubversion/svnwrap/svn_swig_wrapper.py +++ b/hgsubversion/svnwrap/svn_swig_wrapper.py @@ -205,7 +205,8 @@ class SubversionRepo(object): It uses the SWIG Python bindings, see above for requirements. """ - def __init__(self, url='', username='', password='', head=None, password_stores=None): + def __init__(self, url='', username='', password='', head=None, + password_stores=None, meta=None): parsed = common.parse_url(url, username, password) # --username and --password override URL credentials self.username = parsed[0] @@ -231,6 +232,9 @@ class SubversionRepo(object): self.hasdiff3 = True self.autoprops_config = common.AutoPropsConfig() + # store the svn meta object for use with branch skipping + self.meta = meta + def init_ra_and_client(self): """Initializes the RA and client layers, because sometimes getting unified diffs runs the remote server out of open files. diff --git a/hgsubversion/wrappers.py b/hgsubversion/wrappers.py --- a/hgsubversion/wrappers.py +++ b/hgsubversion/wrappers.py @@ -396,6 +396,7 @@ def pull(repo, source, heads=[], force=F svn = source.svn if meta is None: meta = repo.svnmeta(svn.uuid, svn.subdir) + svn.meta = meta stopat_rev = util.parse_revnum(svn, checkout)