mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
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:
parent
32e0b804f2
commit
88a2f791c1
@ -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.
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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 + '/'):
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user