Changeset 5e718d9 in mainline for contrib/bazaar/mbprotect/__init__.py


Ignore:
Timestamp:
2012-08-21T10:04:16Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67edca6
Parents:
0da6c04 (diff), 6a97f2e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with upstream (lp:~wtachi/helenos/bithenge)

File:
1 edited

Legend:

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

    r0da6c04 r5e718d9  
    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.