/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to refs.py

  • Committer: Jelmer Vernooij
  • Date: 2010-05-05 09:58:55 UTC
  • mto: (0.200.912 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20100505095855-i0165hooflvk9chy
Ignore control files in inventories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    if name is None:
49
49
        return default
50
50
    if name == "HEAD":
51
 
        return name
 
51
        return "HEAD"
52
52
    if not name.startswith("refs/"):
53
53
        return "refs/heads/%s" % name
54
54
    else:
70
70
    :param ref: Ref
71
71
    :return: A branch name
72
72
    """
73
 
    if ref in (None, "HEAD"):
74
 
        return ref
 
73
    if ref == "HEAD":
 
74
        return "HEAD"
75
75
    if ref.startswith("refs/heads/"):
76
76
        return ref[len("refs/heads/"):]
77
77
    raise ValueError("unable to map ref %s back to branch name" % ref)
110
110
        try:
111
111
            branch = self.dir.open_branch(branch_name)
112
112
        except errors.NoColocatedBranchSupport:
113
 
            if branch_name in ("HEAD", "master"):
114
 
                branch = self.dir.open_branch()
115
 
            else:
116
 
                raise
 
113
            raise
117
114
        return branch.last_revision()
118
115
 
119
116
    def read_loose_ref(self, ref):
131
128
        for branch in self.dir.list_branches():
132
129
            repo = branch.repository
133
130
            if repo.has_revision(branch.last_revision()):
134
 
                ref = branch_name_to_ref(branch.name, "refs/heads/master")
135
 
                keys.add(ref)
136
 
                if branch.name is None:
137
 
                    keys.add("HEAD")
 
131
                keys.add(branch_name_to_ref(branch.name, "HEAD"))
138
132
            for tag_name, revid in branch.tags.get_tag_dict().iteritems():
139
133
                if repo.has_revision(revid):
140
134
                    keys.add(tag_name_to_ref(tag_name))