/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/per_branch/test_revision_history.py

  • Committer: Martin von Gagern
  • Date: 2010-04-20 08:47:38 UTC
  • mfrom: (5167 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5195.
  • Revision ID: martin.vgagern@gmx.net-20100420084738-ygymnqmdllzrhpfn
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for Branch.revision_history and last_revision."""
18
18
 
21
21
    errors,
22
22
    revision as _mod_revision,
23
23
    )
24
 
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
25
 
 
26
 
 
27
 
class TestLastRevision(TestCaseWithBranch):
 
24
from bzrlib.tests import per_branch
 
25
 
 
26
 
 
27
class TestLastRevision(per_branch.TestCaseWithBranch):
28
28
    """Tests for the last_revision property of the branch.
29
29
    """
30
30
 
47
47
        ##         br.set_last_revision_info, 4, 'current:')
48
48
 
49
49
 
50
 
class TestRevisionHistoryCaching(TestCaseWithBranch):
 
50
class TestRevisionHistoryCaching(per_branch.TestCaseWithBranch):
51
51
    """Tests for the caching of branches' revision_history.
52
52
 
53
53
    When locked, branches should avoid regenerating or rereading
124
124
        cause the revision history to be cached.
125
125
        """
126
126
        branch, calls = self.get_instrumented_branch()
127
 
        # Lock the branch, set the revision history, then repeatedly call
128
 
        # revision_history.
129
127
        branch.set_revision_history([])
130
128
        branch.revision_history()
131
129
        self.assertEqual(['_gen_revision_history'], calls)
203
201
            branch.unlock()
204
202
 
205
203
 
206
 
class TestRevisionHistory(TestCaseWithBranch):
 
204
class TestRevisionHistory(per_branch.TestCaseWithBranch):
207
205
 
208
206
    def test_parent_ghost(self):
209
207
        tree = self.make_branch_and_tree('tree')