~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-21 20:07:34 UTC
  • mto: This revision was merged to the branch mainline in revision 2212.
  • Revision ID: john@arbash-meinel.com-20061221200734-3kqiep3996uxtwsc
Add an exception class when the knit index storage method is unknown, and properly test for it

Show diffs side-by-side

added added

removed removed

Lines of Context:
1014
1014
        self._create_parent_dir = create_parent_dir
1015
1015
        self._need_to_create = False
1016
1016
 
 
1017
    def _full_path(self):
 
1018
        """Return the full path to this file."""
 
1019
        return self._transport.base + self._filename
 
1020
 
1017
1021
    def check_header(self, fp):
1018
1022
        line = fp.readline()
1019
1023
        if line == '':
1020
1024
            # An empty file can actually be treated as though the file doesn't
1021
1025
            # exist yet.
1022
 
            raise errors.NoSuchFile(self._transport.base + self._filename)
 
1026
            raise errors.NoSuchFile(self._full_path())
1023
1027
        if line != self.HEADER:
1024
1028
            raise KnitHeaderError(badline=line,
1025
1029
                              filename=self._transport.abspath(self._filename))
1326
1330
        if 'fulltext' in options:
1327
1331
            return 'fulltext'
1328
1332
        else:
1329
 
            assert 'line-delta' in options
 
1333
            if 'line-delta' not in options:
 
1334
                raise errors.KnitIndexUnknownMethod(self._full_path(), options)
1330
1335
            return 'line-delta'
1331
1336
 
1332
1337
    def get_options(self, version_id):