/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

  • Committer: Jelmer Vernooij
  • Date: 2020-08-22 22:46:24 UTC
  • mfrom: (7490.40.105 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200822224624-om4a4idsr7cn8jew
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

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