/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/branchbuilder.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:
16
16
 
17
17
"""Utility for create branches with particular contents."""
18
18
 
 
19
from __future__ import absolute_import
 
20
 
19
21
from . import (
20
22
    controldir,
21
23
    commit,
22
24
    errors,
23
25
    revision,
24
26
    )
 
27
from .sixish import (
 
28
    viewitems,
 
29
    )
25
30
 
26
31
 
27
32
class BranchBuilder(object):
43
48
    ...     ('add', ('', b'root-id', 'directory', '')),
44
49
    ...     ('add', ('filename', b'f-id', 'file', b'content\n'))],
45
50
    ...     revision_id=b'rev-id')
46
 
    b'rev-id'
 
51
    'rev-id'
47
52
    >>> builder.build_snapshot([b'rev-id'],
48
53
    ...     [('modify', ('filename', b'new-content\n'))],
49
54
    ...     revision_id=b'rev2-id')
50
 
    b'rev2-id'
 
55
    'rev2-id'
51
56
    >>> builder.finish_series()
52
57
    >>> branch = builder.get_branch()
53
58
 
270
275
            tree.unversion(pending.to_unversion_paths)
271
276
        tree.add(pending.to_add_files, pending.to_add_file_ids,
272
277
                 pending.to_add_kinds)
273
 
        for path, content in pending.new_contents.items():
 
278
        for path, content in viewitems(pending.new_contents):
274
279
            tree.put_file_bytes_non_atomic(path, content)
275
280
 
276
281
    def get_branch(self):