Changes in contrib/bazaar/mbprotect/__init__.py [01607604:850987d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/bazaar/mbprotect/__init__.py
r01607604 r850987d 33 33 # branch (a.k.a. linear history) of bzr repositories from unwanted change, 34 34 # effectively making the main branch append-only. 35 # 35 # 36 36 # Specifically we verify that the new main branch contains the old tip. 37 37 # This prevents a branch from inadvertently aquiring the tip of another branch. … … 46 46 47 47 def 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') 69 68 70 69 # Install hook. 71 70 bzrlib.branch.Branch.hooks.install_named_hook('pre_change_branch_tip', 72 71 pre_change_branch_tip, 'MB-Protect tip check')
Note:
See TracChangeset
for help on using the changeset viewer.