/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: Jelmer Vernooij
  • Date: 2018-07-23 22:25:11 UTC
  • mto: This revision was merged to the branch mainline in revision 7053.
  • Revision ID: jelmer@jelmer.uk-20180723222511-gns8mqohgakwa2b9
Some brz-git fixes.

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: