~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/switch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-22 15:44:21 UTC
  • mfrom: (5171.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100422154421-eeit8sxsvtxxherb
(vila) Merge 2.2 into bzr.dev

Show diffs side-by-side

added added

removed removed

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