~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-01-17 17:21:14 UTC
  • mfrom: (2229.2.5 reserved-ids)
  • Revision ID: pqm@pqm.ubuntu.com-20070117172114-dc75493dad46088c
Ensure reserved ids are never stored

Show diffs side-by-side

added added

removed removed

Lines of Context:
454
454
        next = best_ancestor(next)
455
455
    path.reverse()
456
456
    return path
 
457
 
 
458
 
 
459
def is_reserved_id(revision_id):
 
460
    """Determine whether a revision id is reserved
 
461
 
 
462
    :return: True if the revision is is reserved, False otherwise
 
463
    """
 
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)