~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/changeset/read_changeset.py

  • Committer: Aaron Bentley
  • Date: 2006-05-15 11:51:02 UTC
  • mto: (1185.82.108 w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: aaron.bentley@utoronto.ca-20060515115102-1f88e5f55acddde8
Started work on testing install_revisions/handling empty changesets

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
                rev.committer = self.committer
138
138
            self.real_revisions.append(rev.as_revision())
139
139
 
140
 
        if self.base is None:
 
140
        if self.base is None and len(self.real_revisions) > 0:
141
141
            # When we don't have a base, then the real base
142
142
            # is the first parent of the first revision listed
143
143
            rev = self.real_revisions[0]
372
372
        for line in self._next():
373
373
            # The bzr header is terminated with a blank line
374
374
            # which does not start with '#'
375
 
            if line == '\n':
 
375
            if line is None or line == '\n':
376
376
                break
377
377
            self._handle_next(line)
378
378
 
405
405
        return key, value
406
406
 
407
407
    def _handle_next(self, line):
 
408
        if line is None:
 
409
            return
408
410
        key, value = self._read_next_entry(line, indent=1)
409
411
        mutter('_handle_next %r => %r' % (key, value))
410
412
        if key is None:
800
802
            patch_original = None
801
803
        file_patch = self.patches.get(self.id2path(file_id))
802
804
        if file_patch is None:
 
805
            assert patch_original is not None
803
806
            return patch_original
804
807
 
805
808
        assert not file_patch.startswith('\\'), \