/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_knit.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:
1735
1735
 
1736
1736
    def test_get_options_deltas(self):
1737
1737
        index = self.two_graph_index(deltas=True)
1738
 
        self.assertEqual('fulltext,no-eol', index.get_options('tip'))
1739
 
        self.assertEqual('line-delta', index.get_options('parent'))
 
1738
        self.assertEqual(['fulltext', 'no-eol'], index.get_options('tip'))
 
1739
        self.assertEqual(['line-delta'], index.get_options('parent'))
1740
1740
 
1741
1741
    def test_get_options_no_deltas(self):
1742
1742
        # check that the parent-history lookup is ignored with deltas=False.
1743
1743
        index = self.two_graph_index(deltas=False)
1744
 
        self.assertEqual('fulltext,no-eol', index.get_options('tip'))
1745
 
        self.assertEqual('fulltext', index.get_options('parent'))
 
1744
        self.assertEqual(['fulltext', 'no-eol'], index.get_options('tip'))
 
1745
        self.assertEqual(['fulltext'], index.get_options('parent'))
1746
1746
 
1747
1747
    def test_get_parents(self):
1748
1748
        # get_parents ignores ghosts
2008
2008
    def test_get_method(self):
2009
2009
        index = self.two_graph_index()
2010
2010
        self.assertEqual('fulltext', index.get_method('tip'))
2011
 
        self.assertEqual('fulltext', index.get_options('parent'))
 
2011
        self.assertEqual(['fulltext'], index.get_options('parent'))
2012
2012
 
2013
2013
    def test_get_options(self):
2014
2014
        index = self.two_graph_index()
2015
 
        self.assertEqual('fulltext,no-eol', index.get_options('tip'))
2016
 
        self.assertEqual('fulltext', index.get_options('parent'))
 
2015
        self.assertEqual(['fulltext', 'no-eol'], index.get_options('tip'))
 
2016
        self.assertEqual(['fulltext'], index.get_options('parent'))
2017
2017
 
2018
2018
    def test_get_parents(self):
2019
2019
        index = self.two_graph_index()