/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_version_info.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-12 18:05:15 UTC
  • mto: (4371.4.5 vila-better-heads)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090612180515-t0cwbjsnve094oik
Add a failing test for handling nodes that are in the same linear chain.

It fails because the ancestry skipping causes us to miss the fact that the two nodes
are actually directly related. We could check at the beginning, as the 
code used to do, but I think that will be incomplete for the more-than-two
heads cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
from bzrlib import (
25
25
    errors,
26
 
    registry,
27
26
    symbol_versioning,
28
27
    tests,
29
28
    version_info_formats,
149
148
        stanza = regen(check_for_clean=True, include_file_revisions=True)
150
149
        self.assertEqual(['False'], stanza.get_all('clean'))
151
150
 
152
 
        # This assumes it's being run against a tree that does not update the
153
 
        # root revision on every commit.
 
151
        # XXX: This assumes it's being run against a repository that updates
 
152
        # the root revision on every commit.  Newer ones that use
 
153
        # RootCommitBuilder won't update it on each commit.
154
154
        file_rev_stanza = get_one_stanza(stanza, 'file-revisions')
155
155
        self.assertEqual(['', 'a', 'b', 'c'], file_rev_stanza.get_all('path'))
156
 
        self.assertEqual(['r1', 'r3', 'r2', 'unversioned'],
 
156
        self.assertEqual(['r3', 'r3', 'r2', 'unversioned'],
157
157
            file_rev_stanza.get_all('revision'))
158
158
        os.remove('branch/c')
159
159
 
171
171
        file_rev_stanza = get_one_stanza(stanza, 'file-revisions')
172
172
        self.assertEqual(['', 'a', 'b', 'c', 'd'],
173
173
                          file_rev_stanza.get_all('path'))
174
 
        self.assertEqual(['r1', 'modified', 'renamed to d', 'new',
 
174
        self.assertEqual(['r3', 'modified', 'renamed to d', 'new',
175
175
                          'renamed from b'],
176
176
                         file_rev_stanza.get_all('revision'))
177
177
 
181
181
        stanza = regen(check_for_clean=True, include_file_revisions=True)
182
182
        file_rev_stanza = get_one_stanza(stanza, 'file-revisions')
183
183
        self.assertEqual(['', 'a', 'c', 'd'], file_rev_stanza.get_all('path'))
184
 
        self.assertEqual(['r1', 'r4', 'unversioned', 'removed'],
 
184
        self.assertEqual(['r4', 'r4', 'unversioned', 'removed'],
185
185
                         file_rev_stanza.get_all('revision'))
186
186
 
187
187
    def test_python_null(self):
326
326
 
327
327
    def setUp(self):
328
328
        super(TestVersionInfoFormatRegistry, self).setUp()
329
 
        self.overrideAttr(version_info_formats,
330
 
                          'format_registry', registry.Registry())
 
329
        registry = version_info_formats.format_registry
 
330
        self._default_key = registry._default_key
 
331
        self._dict = registry._dict.copy()
 
332
        self._help_dict = registry._help_dict.copy()
 
333
        self._info_dict = registry._info_dict.copy()
 
334
        self.addCleanup(self._cleanup)
 
335
 
 
336
    def _cleanup(self):
 
337
        # Restore the registry to pristine state after the test runs
 
338
        registry = version_info_formats.format_registry
 
339
        registry._default_key = self._default_key
 
340
        registry._dict = self._dict
 
341
        registry._help_dict = self._help_dict
 
342
        registry._info_dict = self._info_dict
331
343
 
332
344
    def test_register_remove(self):
333
345
        registry = version_info_formats.format_registry