~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Lukáš Lalinský
  • Date: 2007-12-17 17:28:25 UTC
  • mfrom: (3120 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3123.
  • Revision ID: lalinsky@gmail.com-20071217172825-tr3pqm1mhvs3gwnn
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        return self.properties.get('author', self.committer)
126
126
 
127
127
 
 
128
@deprecated_function(symbol_versioning.zero_ninetythree)
128
129
def is_ancestor(revision_id, candidate_id, branch):
129
130
    """Return true if candidate_id is an ancestor of revision_id.
130
131
 
133
134
    
134
135
    revisions_source is an object supporting a get_revision operation that
135
136
    behaves like Branch's.
 
137
 
 
138
    This function is deprecated, it is better for callers to directly use
 
139
    Graph.is_ancestor() (just watch out that the parameter order is switched)
136
140
    """
137
 
    if is_null(candidate_id):
138
 
        return True
139
 
    return (candidate_id in branch.repository.get_ancestry(revision_id,
140
 
            topo_sorted=False))
 
141
    return branch.repository.get_graph().is_ancestor(candidate_id, revision_id)
141
142
 
142
143
 
143
144
def iter_ancestors(revision_id, revision_source, only_present=False):
452
453
 
453
454
 
454
455
def ensure_null(revision_id):
455
 
    """Ensure only NULL_REVISION is used to represent the null revisionn"""
 
456
    """Ensure only NULL_REVISION is used to represent the null revision"""
456
457
    if revision_id is None:
457
458
        symbol_versioning.warn('NULL_REVISION should be used for the null'
458
459
            ' revision instead of None, as of bzr 0.91.',