/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-07-28 02:47:10 UTC
  • mfrom: (7519.1.1 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200728024710-a2ylds219f1lsl62
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/388173

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