~bzr/ubuntu/intrepid/bzr-svn/bzr-ppa

« back to all changes in this revision

Viewing changes to layout.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-25 21:07:15 UTC
  • mfrom: (309.1.2 debian)
  • Revision ID: john@arbash-meinel.com-20080825210715-gjow5e72oo981g23
Merge in Jelmer's latest updates to bzr-svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        """
53
53
        raise NotImplementedError
54
54
 
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."""
57
57
        try:
58
 
            (type, _, bp, rp) = self.parse(path)
 
58
            (type, proj, bp, rp) = self.parse(path)
59
59
        except NotBranchError:
60
60
            return False
61
 
        if type == "branch" and rp == "":
 
61
        if (type == "branch" and rp == "" and 
 
62
            (project is None or proj == project)):
62
63
            return True
63
64
        return False
64
65
 
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."""
67
68
        try:
68
 
            (type, _, bp, rp) = self.parse(path)
 
69
            (type, proj, bp, rp) = self.parse(path)
69
70
        except NotBranchError:
70
71
            return False
71
 
        if type == "tag" and rp == "":
 
72
        if (type == "tag" and rp == "" and
 
73
            (project is None or proj == project)):
72
74
            return True
73
75
        return False
74
76
 
 
77
    def is_branch_or_tag(self, path, project=None):
 
78
        return self.is_branch(path, project) or self.is_tag(path, project)
 
79
 
 
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)
 
82
 
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.
77
85