53
53
raise NotImplementedError
55
def is_branch(self, path):
55
def is_branch(self, path, project=None):
56
56
"""Check whether a specified path points at a branch."""
58
(type, _, bp, rp) = self.parse(path)
58
(type, proj, bp, rp) = self.parse(path)
59
59
except NotBranchError:
61
if type == "branch" and rp == "":
61
if (type == "branch" and rp == "" and
62
(project is None or proj == project)):
65
def is_tag(self, path):
66
def is_tag(self, path, project=None):
66
67
"""Check whether a specified path points at a tag."""
68
(type, _, bp, rp) = self.parse(path)
69
(type, proj, bp, rp) = self.parse(path)
69
70
except NotBranchError:
71
if type == "tag" and rp == "":
72
if (type == "tag" and rp == "" and
73
(project is None or proj == project)):
77
def is_branch_or_tag(self, path, project=None):
78
return self.is_branch(path, project) or self.is_tag(path, project)
80
def is_branch_or_tag_parent(self, path, project=None):
81
return self.is_branch_parent(path, project) or self.is_tag_parent(path, project)
75
83
def get_branches(self, revnum, project="", pb=None):
76
84
"""Retrieve a list of paths that refer to branches in a specific revision.