~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

Merged bzr.dev r3278.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4426
4426
            urlutils.unescape_for_display(to_branch.base, 'utf-8'))
4427
4427
 
4428
4428
 
 
4429
class cmd_hooks(Command):
 
4430
    """Show a branch's currently registered hooks.
 
4431
    """
 
4432
 
 
4433
    hidden = True
 
4434
    takes_args = ['path?']
 
4435
 
 
4436
    def run(self, path=None):
 
4437
        if path is None:
 
4438
            path = '.'
 
4439
        branch_hooks = Branch.open(path).hooks
 
4440
        for hook_type in branch_hooks:
 
4441
            hooks = branch_hooks[hook_type]
 
4442
            self.outf.write("%s:\n" % (hook_type,))
 
4443
            if hooks:
 
4444
                for hook in hooks:
 
4445
                    self.outf.write("  %s\n" %
 
4446
                                    (branch_hooks.get_hook_name(hook),))
 
4447
            else:
 
4448
                self.outf.write("  <no hooks installed>\n")
 
4449
 
 
4450
 
4429
4451
def _create_prefix(cur_transport):
4430
4452
    needed = [cur_transport]
4431
4453
    # Recurse upwards until we can create a directory successfully