# HG changeset patch # User Sean Farley # Date 1395678053 18000 # Node ID 7bbe120be1938ec17608bfcf25f747cd7a1bc2fc # Parent 13f8e9cc90c62287609781085197717c28720205 layouts: turn taglocations method into a property We no longer need to pass the meta path since we have an internal reference to the meta object, so we remove the parameter from the taglocations method. diff --git a/hgsubversion/layouts/base.py b/hgsubversion/layouts/base.py --- a/hgsubversion/layouts/base.py +++ b/hgsubversion/layouts/base.py @@ -48,7 +48,8 @@ class BaseLayout(object): """ self.__unimplemented('remotepath') - def taglocations(self, metapath): + @property + def taglocations(self): """Return a list of locations within svn to search for tags Should be returned in reverse-sorted order. diff --git a/hgsubversion/layouts/custom.py b/hgsubversion/layouts/custom.py --- a/hgsubversion/layouts/custom.py +++ b/hgsubversion/layouts/custom.py @@ -64,7 +64,8 @@ class CustomLayout(base.BaseLayout): subdir += '/' return subdir + self.remotename(branch) - def taglocations(self, metapath): + @property + def taglocations(self): return [] def get_path_tag(self, path, taglocations): diff --git a/hgsubversion/layouts/single.py b/hgsubversion/layouts/single.py --- a/hgsubversion/layouts/single.py +++ b/hgsubversion/layouts/single.py @@ -14,7 +14,8 @@ class SingleLayout(base.BaseLayout): def remotepath(self, branch, subdir='/'): return subdir or '/' - def taglocations(self, metapath): + @property + def taglocations(self): return [] def get_path_tag(self, path, taglocations): diff --git a/hgsubversion/layouts/standard.py b/hgsubversion/layouts/standard.py --- a/hgsubversion/layouts/standard.py +++ b/hgsubversion/layouts/standard.py @@ -66,7 +66,8 @@ class StandardLayout(base.BaseLayout): return '%s/%s' % (subdir or '', branchpath) - def taglocations(self, metapath): + @property + def taglocations(self): return self.meta.taglocations def get_path_tag(self, path, taglocations): diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py --- a/hgsubversion/svncommands.py +++ b/hgsubversion/svncommands.py @@ -219,7 +219,7 @@ def _buildmeta(ui, repo, args, partial=F # find commitpath, write to revmap commitpath = revpath[len(subdir)+1:] - tag_locations = layoutobj.taglocations(meta.metapath) + tag_locations = layoutobj.taglocations found_tag = False for location in tag_locations: if commitpath.startswith(location + '/'): diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -385,8 +385,7 @@ class SVNMeta(object): (or tag) we have, for our purposes. """ path = self.normalize(path) - tloc = self.layoutobj.taglocations(self.metapath) - return self.layoutobj.get_path_tag(path, tloc) + return self.layoutobj.get_path_tag(path, self.layoutobj.taglocations) def split_branch_path(self, path, existing=True): """Figure out which branch inside our repo this path represents, and