~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Aaron Bentley
  • Date: 2007-01-17 15:37:08 UTC
  • mto: This revision was merged to the branch mainline in revision 2239.
  • Revision ID: abentley@panoramicfeedback.com-20070117153708-4jni0ycaitv7xgra
change reserved_id to is_reserved_id, add check_not_reserved for DRY

Show diffs side-by-side

added added

removed removed

Lines of Context:
518
518
 
519
519
    def get_delta(self, version_id):
520
520
        """Get a delta for constructing version from some other version."""
521
 
        if self.reserved_id(version_id):
522
 
            raise errors.ReservedId(version_id)
 
521
        self.check_not_reserved_id(version_id)
523
522
        if not self.has_version(version_id):
524
523
            raise RevisionNotPresent(version_id, self.filename)
525
524
        
687
686
        ### FIXME escape. RBC 20060228
688
687
        if contains_whitespace(version_id):
689
688
            raise InvalidRevisionId(version_id, self.filename)
690
 
        if self.reserved_id(version_id):
691
 
            raise errors.ReservedId(version_id)
 
689
        self.check_not_reserved_id(version_id)
692
690
        if self.has_version(version_id):
693
691
            raise RevisionAlreadyPresent(version_id, self.filename)
694
692
        self._check_lines_not_unicode(lines)
802
800
    def get_line_list(self, version_ids):
803
801
        """Return the texts of listed versions as a list of strings."""
804
802
        for version_id in version_ids:
805
 
            if self.reserved_id(version_id):
806
 
                raise errors.ReservedId(version_id)
 
803
            self.check_not_reserved_id(version_id)
807
804
        text_map, content_map = self._get_content_maps(version_ids)
808
805
        return [text_map[v] for v in version_ids]
809
806