~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/index.py

  • Committer: Robert Collins
  • Date: 2007-07-13 07:28:18 UTC
  • mto: (2592.5.3 pack-repository)
  • mto: This revision was merged to the branch mainline in revision 2624.
  • Revision ID: robertc@robertcollins.net-20070713072818-5db95luqwe9palp5
Empty keys are invalid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        :param value: The value to associate with the key. It may be any
67
67
            bytes as long as it does not contain \0 or \n.
68
68
        """
69
 
        if _whitespace_re.search(key) is not None:
 
69
        if not key or _whitespace_re.search(key) is not None:
70
70
            raise errors.BadIndexKey(key)
71
71
        if _newline_null_re.search(value) is not None:
72
72
            raise errors.BadIndexValue(value)