/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: Parth Malwankar
  • Date: 2010-04-23 08:11:50 UTC
  • mfrom: (5176 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5214.
  • Revision ID: parth.malwankar@gmail.com-20100423081150-nwl49sldlrslwv91
mergedĀ inĀ trunk.

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
 
25
34
def switch(control_dir, to_branch, force=False, quiet=False, revision_id=None):
26
35
    """Switch the branch associated with a checkout.
27
36
 
38
47
    _set_branch_location(control_dir, to_branch, force)
39
48
    tree = control_dir.open_workingtree()
40
49
    _update(tree, source_repository, quiet, revision_id)
41
 
 
 
50
    _run_post_switch_hooks(control_dir, to_branch, force, revision_id)
42
51
 
43
52
def _check_pending_merges(control, force=False):
44
53
    """Check that there are no outstanding pending merges before switching.