/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/tests/test_bundle.py

Changed ``pre_commit`` hook signature.

The hook's signature is now

  ::

    hook(local, master, old_revno, old_revid, new_revno, new_revid,
         affected_ids, future_revision_tree)

``affected_ids`` is a dictionary of (change_type, ids). change_type is
a string describing the change (e.g. 'added', 'deleted', 'modified'), and
ids is a list of inventory entry ids.

Hooks can get an added file easier than before:

  ::

    for id in affected_ids.get('added', []):
        if future_revision_tree.kind(id) == 'file':
            file = future_revision_tree.get_file(id)
            ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    revision as _mod_revision,
28
28
    treebuilder,
29
29
    )
30
 
from bzrlib.builtins import _merge_helper
31
30
from bzrlib.bzrdir import BzrDir
32
31
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
33
32
from bzrlib.bundle.bundle_data import BundleTree
637
636
        self.assertEqualDiff(tree1_inv, tree2_inv)
638
637
        other.rename_one('sub/dir/nolastnewline.txt', 'sub/nolastnewline.txt')
639
638
        other.commit('rename file', rev_id='a@cset-0-6b')
640
 
        _merge_helper([other.basedir, -1], [None, None],
641
 
                      this_dir=self.tree1.basedir)
 
639
        self.tree1.merge_from_branch(other.branch)
642
640
        self.tree1.commit(u'Merge', rev_id='a@cset-0-7',
643
641
                          verbose=False)
644
642
        bundle = self.get_valid_bundle('a@cset-0-6', 'a@cset-0-7')
740
738
        tt.create_file('file2', trans_id)
741
739
        tt.apply()
742
740
        other.commit('modify text in another tree', rev_id='a@lmod-0-2b')
743
 
        _merge_helper([other.basedir, -1], [None, None],
744
 
                      this_dir=self.tree1.basedir)
 
741
        self.tree1.merge_from_branch(other.branch)
745
742
        self.tree1.commit(u'Merge', rev_id='a@lmod-0-3',
746
743
                          verbose=False)
747
744
        self.tree1.commit(u'Merge', rev_id='a@lmod-0-4')