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

  • Committer: Jelmer Vernooij
  • Date: 2020-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from . import (
25
25
    config as _mod_config,
 
26
    controldir,
26
27
    errors,
27
28
    lazy_import,
 
29
    osutils,
28
30
    registry,
29
31
    trace,
30
32
    )
31
33
lazy_import.lazy_import(globals(), """
32
34
from breezy import (
33
 
    bencode,
34
35
    cleanup,
35
 
    controldir,
36
 
    commit,
37
36
    conflicts,
38
 
    delta,
39
37
    multiparent,
40
 
    osutils,
41
38
    revision as _mod_revision,
42
39
    ui,
43
40
    urlutils,
44
41
    )
45
42
from breezy.i18n import gettext
46
43
""")
 
44
 
47
45
from .errors import (DuplicateKey,
48
46
                     BzrError, InternalBzrError)
49
47
from .filters import filtered_output_bytes, ContentFilterContext
196
194
        """Support Context Manager API."""
197
195
        self.finalize()
198
196
 
 
197
    def iter_tree_children(self, trans_id):
 
198
        """Iterate through the entry's tree children, if any.
 
199
 
 
200
        :param trans_id: trans id to iterate
 
201
        :returns: Iterator over paths
 
202
        """
 
203
        raise NotImplementedError(self.iter_tree_children)
 
204
 
 
205
    def _read_symlink_target(self, trans_id):
 
206
        raise NotImplementedError(self._read_symlink_target)
 
207
 
 
208
    def canonical_path(self, path):
 
209
        return path
 
210
 
 
211
    def tree_kind(self, trans_id):
 
212
        raise NotImplementedError(self.tree_kind)
 
213
 
199
214
    def finalize(self):
200
215
        """Release the working tree lock, if held.
201
216
 
842
857
                # The child is removed as part of the transform. Since it was
843
858
                # versioned before, it's not an orphan
844
859
                continue
845
 
            elif self.final_file_id(child_tid) is None:
 
860
            if self.final_file_id(child_tid) is None:
846
861
                # The child is not versioned
847
862
                orphans.append(child_tid)
848
863
            else:
1046
1061
        if self._tree.get_revision_id() != last_rev_id:
1047
1062
            raise ValueError('TreeTransform not based on branch basis: %s' %
1048
1063
                             self._tree.get_revision_id().decode('utf-8'))
 
1064
        from . import commit
1049
1065
        revprops = commit.Commit.update_revprops(revprops, branch, authors)
1050
1066
        builder = branch.get_commit_builder(parent_ids,
1051
1067
                                            timestamp=timestamp,
1089
1105
 
1090
1106
        :param serializer: A Serialiser like pack.ContainerSerializer.
1091
1107
        """
 
1108
        from . import bencode
1092
1109
        new_name = {k.encode('utf-8'): v.encode('utf-8')
1093
1110
                    for k, v in viewitems(self._new_name)}
1094
1111
        new_parent = {k.encode('utf-8'): v.encode('utf-8')
1140
1157
        :param records: An iterable of (names, content) tuples, as per
1141
1158
            pack.ContainerPushParser.
1142
1159
        """
 
1160
        from . import bencode
1143
1161
        names, content = next(records)
1144
1162
        attribs = bencode.bdecode(content)
1145
1163
        self._id_number = attribs[b'_id_number']
1348
1366
            descendants.update(self._limbo_descendants(descendant))
1349
1367
        return descendants
1350
1368
 
 
1369
    def _set_mode(self, trans_id, mode_id, typefunc):
 
1370
        raise NotImplementedError(self._set_mode)
 
1371
 
1351
1372
    def create_file(self, contents, trans_id, mode_id=None, sha1=None):
1352
1373
        """Schedule creation of a new file.
1353
1374
 
2222
2243
            conflicts, merge_modified = _prepare_revert_transform(
2223
2244
                working_tree, target_tree, tt, filenames, backups, pp)
2224
2245
            if change_reporter:
 
2246
                from . import delta
2225
2247
                change_reporter = delta._ChangeReporter(
2226
2248
                    unversioned_filter=working_tree.is_ignored)
2227
2249
                delta.report_changes(tt.iter_changes(), change_reporter)