/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/switch.py

  • Committer: Aaron Bentley
  • Date: 2010-04-26 23:36:26 UTC
  • mfrom: (5185 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5186.
  • Revision ID: aaron@aaronbentley.com-20100426233626-6f66brvtpldo0syf
Merged bzr.dev into fix-switch-branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib.trace import note
21
21
 
22
22
 
 
23
def _run_post_switch_hooks(control_dir, to_branch, force, revision_id):
 
24
    from bzrlib.branch import SwitchHookParams
 
25
    hooks = Branch.hooks['post_switch']
 
26
    if not hooks:
 
27
        return
 
28
    params = SwitchHookParams(control_dir, to_branch, force, revision_id)
 
29
    for hook in hooks:
 
30
        hook(params)
 
31
 
23
32
def switch(control_dir, to_branch, force=False, quiet=False, revision_id=None):
24
33
    """Switch the branch associated with a checkout.
25
34
 
36
45
    _set_branch_location(control_dir, to_branch, force)
37
46
    tree = control_dir.open_workingtree()
38
47
    _update(tree, source_repository, quiet, revision_id)
39
 
 
 
48
    _run_post_switch_hooks(control_dir, to_branch, force, revision_id)
40
49
 
41
50
def _check_pending_merges(control, force=False):
42
51
    """Check that there are no outstanding pending merges before switching.