~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.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:
247
247
 
248
248
    def _lookup(self, name):
249
249
        """Convert symbolic version name to index."""
250
 
        if self.reserved_id(name):
251
 
            raise errors.ReservedId(name)
 
250
        self.check_not_reserved_id(name)
252
251
        try:
253
252
            return self._name_map[name]
254
253
        except KeyError:
1122
1121
 
1123
1122
    def _add_lines(self, version_id, parents, lines, parent_texts):
1124
1123
        """Add a version and save the weave."""
1125
 
        if self.reserved_id(version_id):
1126
 
            raise errors.ReservedId(version_id)
 
1124
        self.check_not_reserved_id(version_id)
1127
1125
        result = super(WeaveFile, self)._add_lines(version_id, parents, lines,
1128
1126
                                                   parent_texts)
1129
1127
        self._save()