Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset d4112ba in mainline


Ignore:
Timestamp:
2012-08-02T14:36:08Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
798105ca
Parents:
9bcdbc5
Message:

Repository.iter_reverse_revision_history() method is deprecated and will be removed eventually
reimplement the wrapper around Graph.iter_lefthand_ancestry by our means

Location:
contrib/bazaar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • contrib/bazaar/bzreml/__init__.py

    r9bcdbc5 rd4112ba  
    102102        return ""
    103103
     104def iter_reverse_revision_history(repository, revision_id):
     105        """Iterate backwards through revision ids in the lefthand history"""
     106       
     107        graph = repository.get_graph()
     108        stop_revisions = (None, _mod_revision.NULL_REVISION)
     109        return graph.iter_lefthand_ancestry(revision_id, stop_revisions)
     110
    104111def revision_sequence(branch, revision_old_id, revision_new_id):
    105112        """Calculate a sequence of revisions"""
    106113       
    107         for revision_ac_id in branch.repository.iter_reverse_revision_history(revision_new_id):
     114        for revision_ac_id in iter_reverse_revision_history(branch.repository, revision_new_id):
    108115                if (revision_ac_id == revision_old_id):
    109116                        break
  • contrib/bazaar/mbprotect/__init__.py

    r9bcdbc5 rd4112ba  
    4545from bzrlib.errors import TipChangeRejected
    4646
     47def iter_reverse_revision_history(repository, revision_id):
     48        """Iterate backwards through revision ids in the lefthand history"""
     49       
     50        graph = repository.get_graph()
     51        stop_revisions = (None, _mod_revision.NULL_REVISION)
     52        return graph.iter_lefthand_ancestry(revision_id, stop_revisions)
     53
    4754def pre_change_branch_tip(params):
    4855        repo = params.branch.repository
     
    5461        # First permitted case is appending changesets to main branch.Look for
    5562        # old tip in new main branch.
    56         for revision_id in repo.iter_reverse_revision_history(params.new_revid):
     63        for revision_id in iter_reverse_revision_history(repo, params.new_revid):
    5764                if revision_id == params.old_revid:
    5865                        return  # Found old tip
     
    6067        # Another permitted case is backing out changesets. Look for new tip
    6168        # in old branch.
    62         for revision_id in repo.iter_reverse_revision_history(params.old_revid):
     69        for revision_id in iter_reverse_revision_history(repo, params.old_revid):
    6370                if revision_id == params.new_revid:
    6471                        return  # Found new tip
Note: See TracChangeset for help on using the changeset viewer.