/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/plugins/git/filegraph.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-25 18:15:53 UTC
  • mfrom: (7045.4.7 python3-s)
  • Revision ID: breezy.the.bot@gmail.com-20180725181553-mz6zhncntlovb8ii
Fix another couple of hundred tests on Python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-s/+merge/350749

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        self.store = self.repository._git.object_store
41
41
 
42
42
    def find_last_change_revision(self, path, commit_id):
 
43
        if not isinstance(path, bytes):
 
44
            raise TypeError(path)
43
45
        commit = self.store[commit_id]
44
46
        target_mode, target_sha = tree_lookup_path(self.store.__getitem__,
45
47
            commit.tree, path)
46
 
        if path == '':
 
48
        if path == b'':
47
49
            target_mode = stat.S_IFDIR
48
50
        if target_mode is None:
49
51
            raise AssertionError("sha %r for %r in %r" % (target_sha, path, commit_id))
57
59
                    continue
58
60
                else:
59
61
                    parent_commits.append(parent_commit)
60
 
                if path == '':
 
62
                if path == b'':
61
63
                    mode = stat.S_IFDIR
62
64
                # Candidate found iff, mode or text changed,
63
65
                # or is a directory that didn't previously exist.
86
88
        text_parents = []
87
89
        for commit_parent in self.store[commit_id].parents:
88
90
            try:
89
 
                (path, text_parent) = self.change_scanner.find_last_change_revision(path, commit_parent)
 
91
                (path, text_parent) = self.change_scanner.find_last_change_revision(path.encode('utf-8'), commit_parent)
90
92
            except KeyError:
91
93
                continue
92
94
            if text_parent not in text_parents:
102
104
            if text_revision == NULL_REVISION:
103
105
                ret[key] = ()
104
106
                continue
 
107
            if not isinstance(file_id, bytes):
 
108
                raise TypeError(file_id)
 
109
            if not isinstance(text_revision, bytes):
 
110
                raise TypeError(text_revision)
105
111
            try:
106
112
                ret[key] = self._get_parents(file_id, text_revision)
107
113
            except KeyError: