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

Changeset 850987d in mainline


Ignore:
Timestamp:
2010-02-22T21:41:45Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
5e50394
Parents:
72bf0d2
Message:

remove fake half-tabs

File:
1 edited

Legend:

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

    r72bf0d2 r850987d  
    3333# branch (a.k.a. linear history) of bzr repositories from unwanted change,
    3434# effectively making the main branch append-only.
    35 # 
     35#
    3636# Specifically we verify that the new main branch contains the old tip.
    3737# This prevents a branch from inadvertently aquiring the tip of another branch.
     
    4646
    4747def pre_change_branch_tip(params):
    48     repo = params.branch.repository
    49 
    50     # Check if the old repository was empty.
    51     if params.old_revid == 'null:':
    52         return
    53 
    54     # First permitted case is appending changesets to main branch.Look for
    55     # old tip in new main branch.
    56     for revision_id in repo.iter_reverse_revision_history(params.new_revid):
    57         if revision_id == params.old_revid:
    58             return      # Found old tip
    59 
    60     # Another permitted case is backing out changesets. Look for new tip
    61     # in old branch.
    62     for revision_id in repo.iter_reverse_revision_history(params.old_revid):
    63         if revision_id == params.new_revid:
    64             return      # Found new tip
    65 
    66     # Trying to do something else. Reject the change.
    67     raise TipChangeRejected('Bad tip. Read http://trac.helenos.org/trac.fcgi/' +
    68         'wiki/BazaarWorkflow')
     48        repo = params.branch.repository
     49       
     50        # Check if the old repository was empty.
     51        if params.old_revid == 'null:':
     52                return
     53       
     54        # First permitted case is appending changesets to main branch.Look for
     55        # old tip in new main branch.
     56        for revision_id in repo.iter_reverse_revision_history(params.new_revid):
     57                if revision_id == params.old_revid:
     58                        return  # Found old tip
     59       
     60        # Another permitted case is backing out changesets. Look for new tip
     61        # in old branch.
     62        for revision_id in repo.iter_reverse_revision_history(params.old_revid):
     63                if revision_id == params.new_revid:
     64                        return  # Found new tip
     65       
     66        # Trying to do something else. Reject the change.
     67        raise TipChangeRejected('Bad tip. Read http://trac.helenos.org/wiki/BazaarWorkflow')
    6968
    7069# Install hook.
    7170bzrlib.branch.Branch.hooks.install_named_hook('pre_change_branch_tip',
    72     pre_change_branch_tip, 'MB-Protect tip check')
     71        pre_change_branch_tip, 'MB-Protect tip check')
Note: See TracChangeset for help on using the changeset viewer.