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

Update the GitTreeTransform to not use file ids internally.

Merged from https://code.launchpad.net/~jelmer/brz/transform/+merge/389623

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
    def describe(self):
177
177
        return 'Text conflict in %(path)s' % self.__dict__
178
178
 
 
179
    def __str__(self):
 
180
        return self.describe()
 
181
 
 
182
    def __repr__(self):
 
183
        return "%s(%r)" % (type(self).__name__, self.path)
 
184
 
179
185
 
180
186
class GitWorkingTree(MutableGitIndexTree, workingtree.WorkingTree):
181
187
    """A Git working tree."""
975
981
                self._set_conflicted(path, path in by_path)
976
982
 
977
983
    def _set_conflicted(self, path, conflicted):
978
 
        trace.mutter('change conflict: %r -> %r', path, conflicted)
979
984
        value = self.index[path]
980
985
        self._index_dirty = True
981
986
        if conflicted:
1159
1164
    def store_uncommitted(self):
1160
1165
        raise errors.StoringUncommittedNotSupported(self)
1161
1166
 
1162
 
    def _apply_transform_delta(self, changes):
1163
 
        for (old_path, new_path, ie) in changes:
1164
 
            if old_path is not None:
1165
 
                (index, old_subpath) = self._lookup_index(
1166
 
                    encode_git_path(old_path))
1167
 
                try:
1168
 
                    self._index_del_entry(index, old_subpath)
1169
 
                except KeyError:
1170
 
                    pass
1171
 
                else:
1172
 
                    self._versioned_dirs = None
1173
 
            if new_path is not None and ie.kind != 'directory':
1174
 
                if ie.kind == 'tree-reference':
1175
 
                    self._index_add_entry(
1176
 
                        new_path, ie.kind,
1177
 
                        reference_revision=ie.reference_revision)
1178
 
                else:
1179
 
                    self._index_add_entry(new_path, ie.kind)
1180
 
        self.flush()
1181
 
 
1182
1167
    def annotate_iter(self, path,
1183
1168
                      default_revision=_mod_revision.CURRENT_REVISION):
1184
1169
        """See Tree.annotate_iter
1337
1322
    def get_reference_revision(self, path, branch=None):
1338
1323
        hexsha = self._read_submodule_head(path)
1339
1324
        if hexsha is None:
1340
 
            return _mod_revision.NULL_REVISION
 
1325
            (index, subpath) = self._lookup_index(
 
1326
                encode_git_path(path))
 
1327
            if subpath is None:
 
1328
                raise errors.NoSuchFile(path)
 
1329
            hexsha = index[subpath].sha
1341
1330
        return self.branch.lookup_foreign_revision_id(hexsha)
1342
1331
 
1343
1332
    def get_nested_tree(self, path):