~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-15 11:24:18 UTC
  • mfrom: (2617 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070715112418-9nn4n6esxv60ny4b
merge bzr.dev@1617

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# perhaps show them in log -v and allow them as options to the commit command.
19
19
 
20
20
 
21
 
import bzrlib.errors as errors
 
21
from bzrlib import (
 
22
    errors,
 
23
    symbol_versioning
 
24
    )
22
25
from bzrlib.deprecated_graph import (
23
26
    all_descendants,
24
27
    Graph,
124
127
    revisions_source is an object supporting a get_revision operation that
125
128
    behaves like Branch's.
126
129
    """
 
130
    if is_null(candidate_id):
 
131
        return True
127
132
    return (candidate_id in branch.repository.get_ancestry(revision_id,
128
133
            topo_sorted=False))
129
134
 
483
488
    if is_reserved_id(revision_id):
484
489
        raise errors.ReservedId(revision_id)
485
490
 
 
491
 
486
492
def ensure_null(revision_id):
487
493
    """Ensure only NULL_REVISION is used to represent the null revisionn"""
488
494
    if revision_id is None:
489
495
        return NULL_REVISION
490
496
    else:
491
497
        return revision_id
 
498
 
 
499
 
 
500
def is_null(revision_id):
 
501
    if revision_id is None:
 
502
        symbol_versioning.warn('NULL_REVISION should be used for the null'
 
503
            ' revision instead of None, as of bzr 0.19.',
 
504
            DeprecationWarning, stacklevel=2)
 
505
    return revision_id in (None, NULL_REVISION)