/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 server.py

merge server fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        self.mapping = default_mapping
58
58
 
59
59
    def open_repository(self, path):
60
 
        # FIXME: Sanitize path properly
 
60
        # FIXME: More secure path sanitization
61
61
        return BzrBackendRepo(self.transport.clone(path.lstrip("/")), self.mapping)
62
62
 
63
63
 
74
74
        """Return a dict of all tags and branches in repository (and shas) """
75
75
        ret = {}
76
76
        branch = None
77
 
        for branch in self.repo.find_branches(using=True):
 
77
        for branch in self.repo_dir.list_branches():
78
78
            #FIXME: Look for 'master' or 'trunk' in here, and set HEAD
79
79
            # accordingly...
80
80
            #FIXME: Need to get branch path relative to its repository and
81
81
            # use this instead of nick
82
 
            ret["refs/heads/"+branch.nick] = self.object_store._lookup_revision_sha1(branch.last_revision())
83
 
        if 'HEAD' not in ret and branch:
84
 
            ret['HEAD'] = self.object_store._lookup_revision_sha1(branch.last_revision())
 
82
            ret["refs/heads/"+branch.name] = self.object_store._lookup_revision_sha1(branch.last_revision())
85
83
        return ret
86
84
 
87
85
    def apply_pack(self, refs, read):
144
142
                rev_id = self.mapping.revision_id_foreign_to_bzr(sha)
145
143
                target_branch.generate_revision_history(rev_id)
146
144
 
147
 
    def fetch_objects(self, determine_wants, graph_walker, progress):
 
145
    def fetch_objects(self, determine_wants, graph_walker, progress, get_tagged=None):
148
146
        """ yield git objects to send to client """
149
147
        # If this is a Git repository, just use the existing fetch_objects implementation.
150
148
        if getattr(self.repo, "fetch_objects", None) is not None: