/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 __init__.py

Don't try and register the hook if install_named_hook is not available

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
        if directory is None:
354
354
            directory = u'.'
355
355
 
 
356
        if auto and not auto_hook_available:
 
357
            raise BzrCommandError("Your version of bzr does not have the "
 
358
                    "hooks necessary for --auto to work")
 
359
 
356
360
        wt = workingtree.WorkingTree.open_containing(directory)[0]
357
361
        changes = wt.changes_from(wt.basis_tree())
358
362
 
404
408
 
405
409
from bzrlib.plugins.upload.auto_upload_hook import auto_upload_hook
406
410
 
407
 
branch.Branch.hooks.install_named_hook('post_change_branch_tip',
408
 
        auto_upload_hook,
409
 
        'Auto upload code from a branch when it is changed.')
 
411
 
 
412
if hasattr(branch.Branch.hooks, "install_named_hook"):
 
413
    branch.Branch.hooks.install_named_hook('post_change_branch_tip',
 
414
            auto_upload_hook,
 
415
            'Auto upload code from a branch when it is changed.')
 
416
    auto_hook_available = True
 
417
else:
 
418
    auto_hook_available = False
410
419
 
411
420
 
412
421
def load_tests(basic_tests, module, loader):