/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 bzrlib/branchbuilder.py

Merge even-better-isolation into 321320-isolate-doc-tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    commit,
22
22
    errors,
23
23
    memorytree,
 
24
    revision,
24
25
    )
25
26
 
26
27
 
41
42
    >>> builder.start_series()
42
43
    >>> builder.build_snapshot('rev-id', None, [
43
44
    ...     ('add', ('', 'root-id', 'directory', '')),
44
 
    ...     ('add', ('filename', 'f-id', 'file', 'content\n'))])
 
45
    ...     ('add', ('filename', 'f-id', 'file', 'content\n'))],
 
46
    ...     committer='Joe <Joe@example.com>')
45
47
    'rev-id'
46
48
    >>> builder.build_snapshot('rev2-id', ['rev-id'],
47
 
    ...     [('modify', ('f-id', 'new-content\n'))])
 
49
    ...     [('modify', ('f-id', 'new-content\n'))],
 
50
    ...     committer='Joe <joe@example.com>')
48
51
    'rev2-id'
49
52
    >>> builder.finish_series()
50
53
    >>> branch = builder.get_branch()
186
189
        :return: The revision_id of the new commit
187
190
        """
188
191
        if parent_ids is not None:
189
 
            base_id = parent_ids[0]
 
192
            if len(parent_ids) == 0:
 
193
                base_id = revision.NULL_REVISION
 
194
            else:
 
195
                base_id = parent_ids[0]
190
196
            if base_id != self._branch.last_revision():
191
197
                self._move_branch_pointer(base_id,
192
198
                    allow_leftmost_as_ghost=allow_leftmost_as_ghost)