~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/multiparent.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-08 07:05:00 UTC
  • mfrom: (3376.2.15 no-asserts)
  • Revision ID: pqm@pqm.ubuntu.com-20080508070500-9zyyvsk0eev20t4w
(mbp) remove and disallow assert statements

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
            yield version_id
58
58
            seen.add(version_id)
59
59
        cur = next
60
 
    assert len(seen) == len(versions)
61
60
 
62
61
 
63
62
class MultiParent(object):
195
194
            elif cur_line[0] == '\n':
196
195
                hunks[-1].lines[-1] += '\n'
197
196
            else:
198
 
                assert cur_line[0] == 'c', cur_line[0]
 
197
                if not (cur_line[0] == 'c'):
 
198
                    raise AssertionError(cur_line[0])
199
199
                parent, parent_pos, child_pos, num_lines =\
200
200
                    [int(v) for v in cur_line.split(' ')[1:]]
201
201
                hunks.append(ParentText(parent, parent_pos, child_pos,
370
370
        :param single_parent: If true, omit all but one parent text, (but
371
371
            retain parent metadata).
372
372
        """
373
 
        assert no_cache or not verify
 
373
        if not (no_cache or not verify):
 
374
            raise ValueError()
374
375
        revisions = set(vf.versions())
375
376
        total = len(revisions)
376
377
        pb = ui.ui_factory.nested_progress_bar()
394
395
                        self.clear_cache()
395
396
                        vf.clear_cache()
396
397
                        if verify:
397
 
                            assert lines == self.get_line_list([revision])[0]
 
398
                            if not (lines == self.get_line_list([revision])[0]):
 
399
                                raise AssertionError()
398
400
                            self.clear_cache()
399
401
                    pb.update('Importing revisions',
400
402
                              (total - len(revisions)) + len(added), total)