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

Merge http support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009-2010 Jelmer Vernooij <jelmer@samba.org>
 
1
# Copyright (C) 2009 Jelmer Vernooij <jelmer@samba.org>
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
112
112
 
113
113
    def finish_inventory(self):
114
114
        # eliminate blobs that were removed
115
 
        for path, entry in iter(self._blobs.items()):
 
115
        for path, entry in self._blobs.iteritems():
116
116
            if entry is None:
117
117
                del self._blobs[path]
118
118
 
119
 
    def _iterblobs(self):
120
 
        return ((path, sha, mode) for (path, (mode, sha)) in self._blobs.iteritems())
121
 
 
122
119
    def commit(self, message):
123
120
        c = Commit()
124
121
        c.parents = [self.repository.lookup_bzr_revision_id(revid)[0] for revid in self.parents]
125
 
        c.tree = commit_tree(self.store, self._iterblobs())
 
122
        c.tree = commit_tree(self.store,
 
123
                [(path, sha, mode) for (path, (mode, sha)) in self._blobs.iteritems()])
126
124
        c.committer = self._committer
127
125
        c.author = self._revprops.get('author', self._committer)
128
126
        c.commit_time = int(self._timestamp)
129
127
        c.author_time = int(self._timestamp)
130
128
        c.commit_timezone = self._timezone
131
129
        c.author_timezone = self._timezone
132
 
        c.encoding = 'utf-8'
133
130
        c.message = message.encode("utf-8")
134
131
        self.store.add_object(c)
135
132
        self._new_revision_id = self.repository.get_mapping().revision_id_foreign_to_bzr(c.id)