~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Robert Collins
  • Date: 2005-10-14 02:17:36 UTC
  • mfrom: (1185.16.34)
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051014021736-7230e59066856096
MergeĀ fromĀ Martin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    def __ne__(self, other):
58
58
        return not self.__eq__(other)
59
59
 
60
 
        
61
 
REVISION_ID_RE = None
62
 
 
63
 
def validate_revision_id(rid):
64
 
    """Check rid is syntactically valid for a revision id."""
65
 
    global REVISION_ID_RE
66
 
    if not REVISION_ID_RE:
67
 
        import re
68
 
        REVISION_ID_RE = re.compile('[\w:.-]+@[\w%.-]+--?[\w]+--?[0-9a-f]+\Z')
69
 
 
70
 
    if not REVISION_ID_RE.match(rid):
71
 
        raise ValueError("malformed revision-id %r" % rid)
72
 
 
73
60
 
74
61
def is_ancestor(revision_id, candidate_id, branch):
75
62
    """Return true if candidate_id is an ancestor of revision_id.