~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Andrew Bennetts
  • Date: 2008-03-17 17:16:11 UTC
  • mfrom: (3290 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080317171611-o9wdrnf0m7qwo198
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4040
4040
    generic options are "default", "editor", "mapi", and "xdg-email".
4041
4041
 
4042
4042
    If mail is being sent, a to address is required.  This can be supplied
4043
 
    either on the commandline, or by setting the submit_to configuration
4044
 
    option.
 
4043
    either on the commandline, by setting the submit_to configuration
 
4044
    option in the branch itself or the child_submit_to configuration option 
 
4045
    in the submit branch.
4045
4046
 
4046
4047
    Two formats are currently supported: "4" uses revision bundle format 4 and
4047
4048
    merge directive format 2.  It is significantly faster and smaller than
4126
4127
            if remembered_submit_branch:
4127
4128
                note('Using saved location: %s', submit_branch)
4128
4129
 
 
4130
            if mail_to is None:
 
4131
                submit_config = Branch.open(submit_branch).get_config()
 
4132
                mail_to = submit_config.get_user_option("child_submit_to")
 
4133
 
4129
4134
            stored_public_branch = branch.get_public_branch()
4130
4135
            if public_branch is None:
4131
4136
                public_branch = stored_public_branch
4447
4452
            urlutils.unescape_for_display(to_branch.base, 'utf-8'))
4448
4453
 
4449
4454
 
 
4455
class cmd_hooks(Command):
 
4456
    """Show a branch's currently registered hooks.
 
4457
    """
 
4458
 
 
4459
    hidden = True
 
4460
    takes_args = ['path?']
 
4461
 
 
4462
    def run(self, path=None):
 
4463
        if path is None:
 
4464
            path = '.'
 
4465
        branch_hooks = Branch.open(path).hooks
 
4466
        for hook_type in branch_hooks:
 
4467
            hooks = branch_hooks[hook_type]
 
4468
            self.outf.write("%s:\n" % (hook_type,))
 
4469
            if hooks:
 
4470
                for hook in hooks:
 
4471
                    self.outf.write("  %s\n" %
 
4472
                                    (branch_hooks.get_hook_name(hook),))
 
4473
            else:
 
4474
                self.outf.write("  <no hooks installed>\n")
 
4475
 
 
4476
 
4450
4477
def _create_prefix(cur_transport):
4451
4478
    needed = [cur_transport]
4452
4479
    # Recurse upwards until we can create a directory successfully