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

Fix reporting of git commits in 'bzr log'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from bzrlib import (
25
25
    deprecated_graph,
26
26
    errors,
 
27
    foreign,
27
28
    inventory,
28
29
    osutils,
29
30
    repository,
35
36
from bzrlib.transport import get_transport
36
37
 
37
38
from bzrlib.plugins.git.foreign import (
38
 
    versionedfiles
 
39
    versionedfiles,
39
40
    )
40
41
from bzrlib.plugins.git.mapping import default_mapping
41
42
 
139
140
 
140
141
        :return: a `bzrlib.revision.Revision` object.
141
142
        """
142
 
        rev = revision.Revision(default_mapping.revision_id_foreign_to_bzr(commit.id))
 
143
        rev = foreign.ForeignRevision(commit.id, default_mapping, default_mapping.revision_id_foreign_to_bzr(commit.id))
143
144
        rev.parent_ids = tuple([default_mapping.revision_id_foreign_to_bzr(p.id) for p in commit.parents])
144
145
        rev.inventory_sha1 = ""
145
146
        rev.message = commit.message.decode("utf-8", "replace")
146
 
        rev.committer = str(commit.committer)
147
 
        rev.properties['author'] = str(commit.author)
 
147
        rev.committer = str(commit.committer).decode("utf-8", "replace")
 
148
        rev.properties['author'] = str(commit.author).decode("utf-8", "replace")
148
149
        rev.timestamp = time.mktime(commit.committed_date)
149
150
        rev.timezone = 0
150
151
        return rev
200
201
 
201
202
    def _build_inventory(self, tree, ie, path):
202
203
        assert isinstance(path, str)
203
 
        for b in tree.contents:
 
204
        for key in tree:
 
205
            b = tree.get(key)
204
206
            basename = b.name.decode("utf-8")
205
207
            if path == "":
206
208
                child_path = b.name