~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_get_revision_id_to_revno_map.py

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for Branch.get_revision_id_to_revno_map()"""
18
18
 
19
 
from bzrlib import (
20
 
    errors,
21
 
    revision,
22
 
    )
23
 
 
 
19
from bzrlib.symbol_versioning import deprecated_in
24
20
from bzrlib.tests.per_branch import TestCaseWithBranch
25
21
 
26
22
 
85
81
        finally:
86
82
            branch.unlock()
87
83
 
88
 
    def test_set_revision_history_when_locked(self):
89
 
        """Calling set_revision_history should reset the cache."""
90
 
        branch, calls = self.get_instrumented_branch()
91
 
        branch.lock_write()
92
 
        try:
93
 
            self.assertEqual({'rev-1':(1,), 'rev-2':(2,), 'rev-3':(3,),
94
 
                              'rev-1.1.1':(1,1,1)
95
 
                             }, branch.get_revision_id_to_revno_map())
96
 
            branch.set_revision_history(['rev-1', 'rev-2'])
97
 
            self.assertEqual({'rev-1':(1,), 'rev-2':(2,)},
98
 
                             branch.get_revision_id_to_revno_map())
99
 
            self.assertEqual({'rev-1':(1,), 'rev-2':(2,)},
100
 
                             branch.get_revision_id_to_revno_map())
101
 
            self.assertEqual(['_gen_revno_map']*2, calls)
102
 
        finally:
103
 
            branch.unlock()
104
 
 
105
84
    def test_set_last_revision_info_when_locked(self):
106
85
        """Calling set_last_revision_info should reset the cache."""
107
86
        branch, calls = self.get_instrumented_branch()