~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_info.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-11 21:41:24 UTC
  • mto: This revision was merged to the branch mainline in revision 3543.
  • Revision ID: john@arbash-meinel.com-20080711214124-qi09irlj7pd5cuzg
Shortcut the case when one revision is in the ancestry of the other.

At the cost of a heads() check, when one parent supersedes, we don't have to extract
the text for the other. Changes merge time from 3m37s => 3m21s. Using a
CachingParentsProvider would drop the time down to 3m11s.

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
            expected = None
147
147
            if key in ('dirstate', 'dirstate-tags', 'dirstate-with-subtree',
148
148
                'pack-0.92', 'pack-0.92-subtree', 'rich-root',
149
 
                'rich-root-pack', '1.6', '1.6.1-rich-root',
150
 
                '1.9', '1.9-rich-root'):
151
 
                expected = '1.6 or 1.6.1-rich-root or ' \
152
 
                    '1.9 or 1.9-rich-root or ' \
153
 
                    'dirstate or dirstate-tags or pack-0.92 or'\
 
149
                'rich-root-pack'):
 
150
                expected = 'dirstate or dirstate-tags or pack-0.92 or'\
154
151
                    ' rich-root or rich-root-pack'
155
 
            elif key in ('knit', 'metaweave'):
 
152
            if key in ('knit', 'metaweave'):
156
153
                expected = 'knit or metaweave'
157
 
            elif key in ('development-wt5', 'development-wt5-rich-root'):
158
 
                expected = 'development-wt5 or development-wt5-rich-root'
159
154
            self.assertCheckoutDescription(key, expected)
160
155
 
161
156
    def test_describe_branch_format(self):
165
160
            expected = None
166
161
            if key in ('dirstate', 'knit'):
167
162
                expected = 'dirstate or knit'
168
 
            elif key in ('1.9', 'development-wt5'):
169
 
                expected = '1.9 or development-wt5'
170
 
            elif key in ('1.9-rich-root', 'development-wt5-rich-root'):
171
 
                expected = '1.9-rich-root or development-wt5-rich-root'
172
163
            self.assertBranchDescription(key, expected)
173
164
 
174
165
    def test_describe_repo_format(self):
178
169
            expected = None
179
170
            if key in ('dirstate', 'knit', 'dirstate-tags'):
180
171
                expected = 'dirstate or dirstate-tags or knit'
181
 
            elif key in ('1.9', 'development-wt5'):
182
 
                expected = '1.9 or development-wt5'
183
 
            elif key in ('1.9-rich-root', 'development-wt5-rich-root'):
184
 
                expected = '1.9-rich-root or development-wt5-rich-root'
185
172
            self.assertRepoDescription(key, expected)
186
173
 
187
174
        format = bzrdir.format_registry.make_bzrdir('metaweave')