/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/blackbox/test_status.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:
34
34
    errors,
35
35
    )
36
36
import bzrlib.branch
37
 
from bzrlib.builtins import merge
38
37
from bzrlib.osutils import pathjoin
39
38
from bzrlib.revisionspec import RevisionSpec
40
39
from bzrlib.status import show_tree_status
145
144
        b_2 = b_2_dir.open_branch()
146
145
        wt2 = b_2_dir.open_workingtree()
147
146
        wt.commit(u"\N{TIBETAN DIGIT TWO} Empty commit 2")
148
 
        merge(["./branch", -1], [None, None], this_dir = './copy')
 
147
        wt2.merge_from_branch(wt.branch)
149
148
        message = self.status_string(wt2)
150
149
        self.assertStartsWith(message, "pending merges:\n")
151
150
        self.assertEndsWith(message, "Empty commit 2\n")
153
152
        # must be long to make sure we see elipsis at the end
154
153
        wt.commit("Empty commit 3 " +
155
154
                   "blah blah blah blah " * 100)
156
 
        merge(["./branch", -1], [None, None], this_dir = './copy')
 
155
        wt2.merge_from_branch(wt.branch)
157
156
        message = self.status_string(wt2)
158
157
        self.assertStartsWith(message, "pending merges:\n")
159
158
        self.assert_("Empty commit 3" in message)