/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 breezy/git/annotate.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-13 23:57:28 UTC
  • mfrom: (7490 work)
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200213235728-m6ds0mm3mbs4y182
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Annotate."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from dulwich.object_store import (
20
22
    tree_lookup_path,
21
23
    )
22
24
 
23
25
from .. import osutils
24
 
from ..bzr.versionedfile import UnavailableRepresentation
25
26
from ..errors import (
26
27
    NoSuchRevision,
 
28
    UnavailableRepresentation,
27
29
    )
28
30
from ..graph import Graph
29
31
from ..revision import (
30
32
    NULL_REVISION,
31
33
    )
32
34
 
33
 
from .mapping import (
34
 
    decode_git_path,
35
 
    encode_git_path,
36
 
    )
37
 
 
38
35
 
39
36
class GitBlobContentFactory(object):
40
37
    """Static data content factory.
119
116
            self.change_scanner.repository.lookup_bzr_revision_id(
120
117
                text_revision))
121
118
        text_parents = []
122
 
        path = encode_git_path(path)
 
119
        path = path.encode('utf-8')
123
120
        for commit_parent in self.store[commit_id].parents:
124
121
            try:
125
122
                (path, text_parent) = (
130
127
            if text_parent not in text_parents:
131
128
                text_parents.append(text_parent)
132
129
        return tuple([
133
 
            (decode_git_path(path),
 
130
            (path.decode('utf-8'),
134
131
                self.change_scanner.repository.lookup_foreign_revision_id(p))
135
132
            for p in text_parents])
136
133
 
168
165
                continue
169
166
            try:
170
167
                (mode, blob_sha) = tree_lookup_path(
171
 
                    store.__getitem__, tree_id, encode_git_path(path))
 
168
                    store.__getitem__, tree_id, path.encode('utf-8'))
172
169
            except KeyError:
173
170
                yield GitAbsentContentFactory(store, path, text_revision)
174
171
            else: