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.
This commit is contained in:
Sean Farley 2014-03-24 11:20:53 -05:00
parent 32e0b804f2
commit 88a2f791c1
6 changed files with 10 additions and 7 deletions

View File

@ -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.

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -219,7 +219,7 @@ def _buildmeta(ui, repo, args, partial=False, skipuuid=False):
# 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 + '/'):

View File

@ -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