changeset 1292:7bbe120be193

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 24 Mar 2014 11:20:53 -0500
parents 13f8e9cc90c6
children 9e85feb93984
files hgsubversion/layouts/base.py hgsubversion/layouts/custom.py hgsubversion/layouts/single.py hgsubversion/layouts/standard.py hgsubversion/svncommands.py hgsubversion/svnmeta.py
diffstat 6 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- 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):
--- 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):
--- 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):
--- 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 + '/'):
--- 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