/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

Merge roundtrip support.

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 "HEAD"
 
51
        return default
52
52
    if not name.startswith("refs/"):
53
53
        return "refs/heads/%s" % name
54
54
    else:
110
110
        try:
111
111
            branch = self.dir.open_branch(branch_name)
112
112
        except errors.NoColocatedBranchSupport:
113
 
            raise
 
113
            if branch_name in ("HEAD", "master"):
 
114
                branch = self.dir.open_branch()
 
115
            else:
 
116
                raise
114
117
        return branch.last_revision()
115
118
 
116
119
    def read_loose_ref(self, ref):
128
131
        for branch in self.dir.list_branches():
129
132
            repo = branch.repository
130
133
            if repo.has_revision(branch.last_revision()):
131
 
                keys.add(branch_name_to_ref(branch.name, "HEAD"))
 
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")
132
138
            for tag_name, revid in branch.tags.get_tag_dict().iteritems():
133
139
                if repo.has_revision(revid):
134
140
                    keys.add(tag_name_to_ref(tag_name))