~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branchbuilder.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-23 17:00:36 UTC
  • mfrom: (4032.1.4 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090223170036-3q1v68ewdt8i0to5
(Marius Kruger) Remove all trailing whitespace and add tests to
        enforce this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Utility for create branches with particular contents."""
18
18
 
19
19
from bzrlib import (
20
 
    bzrdir, 
 
20
    bzrdir,
21
21
    commit,
22
22
    errors,
23
23
    memorytree,
26
26
 
27
27
class BranchBuilder(object):
28
28
    r"""A BranchBuilder aids creating Branches with particular shapes.
29
 
    
 
29
 
30
30
    The expected way to use BranchBuilder is to construct a
31
31
    BranchBuilder on the transport you want your branch on, and then call
32
32
    appropriate build_ methods on it to get the shape of history you want.
58
58
 
59
59
    def __init__(self, transport, format=None):
60
60
        """Construct a BranchBuilder on transport.
61
 
        
 
61
 
62
62
        :param transport: The transport the branch should be created on.
63
63
            If the path of the transport does not exist but its parent does
64
64
            it will be created.
210
210
            tree.add(to_add_files, to_add_file_ids, to_add_kinds)
211
211
            for file_id, content in new_contents.iteritems():
212
212
                tree.put_file_bytes_non_atomic(file_id, content)
213
 
            return self._do_commit(tree, message=message, rev_id=revision_id) 
 
213
            return self._do_commit(tree, message=message, rev_id=revision_id)
214
214
        finally:
215
215
            tree.unlock()
216
216