~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.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:
456
456
    return path
457
457
 
458
458
 
459
 
def reserved_id(revision_id):
 
459
def is_reserved_id(revision_id):
460
460
    """Determine whether a revision id is reserved
461
461
 
462
462
    :return: True if the revision is is reserved, False otherwise
463
463
    """
464
464
    return isinstance(revision_id, basestring) and revision_id.endswith(':')
 
465
 
 
466
 
 
467
def check_not_reserved_id(revision_id):
 
468
    """Raise ReservedId if the supplied revision_id is reserved"""
 
469
    if is_reserved_id(revision_id):
 
470
        raise errors.ReservedId(revision_id)