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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-30 16:06:19 UTC
  • mfrom: (5971.1.80 bzr-gpgme)
  • Revision ID: pqm@pqm.ubuntu.com-20110630160619-3022zmfchft893nt
(jr) A new command ``bzr verify-signatures`` has been added to check that
 commits
 are correctly signed with trusted keys by GPG. This requires python-gpgme to
 be installed. ``bzr log`` has gained a ``--signatures`` option to list the
 validity of signatures for each commit. New config options
 ``acceptable_keys``
 and ``validate_signatures_in_log`` can be set to control options to these
 commands. (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
create_signatures=always|never|when-required(default)
30
30
gpg_signing_command=name-of-program
31
31
log_format=name-of-format
 
32
validate_signatures_in_log=true|false(default)
 
33
acceptable_keys=pattern1,pattern2
32
34
 
33
35
in locations.conf, you specify the url of a branch and options for it.
34
36
Wildcards may be used - * and ? as normal in shell completion. Options
39
41
email= as above
40
42
check_signatures= as above
41
43
create_signatures= as above.
 
44
validate_signatures_in_log=as above
 
45
acceptable_keys=as above
42
46
 
43
47
explanation of options
44
48
----------------------
45
49
editor - this option sets the pop up editor to use during commits.
46
50
email - this option sets the user id bzr will use when committing.
47
 
check_signatures - this option controls whether bzr will require good gpg
 
51
check_signatures - this option will control whether bzr will require good gpg
48
52
                   signatures, ignore them, or check them if they are
49
 
                   present.
 
53
                   present.  Currently it is unused except that check_signatures
 
54
                   turns on create_signatures.
50
55
create_signatures - this option controls whether bzr will always create
51
 
                    gpg signatures, never create them, or create them if the
52
 
                    branch is configured to require them.
 
56
                    gpg signatures or not on commits.  There is an unused
 
57
                    option which in future is expected to work if               
 
58
                    branch settings require signatures.
53
59
log_format - this option sets the default log format.  Possible values are
54
60
             long, short, line, or a plugin can register new formats.
 
61
validate_signatures_in_log - show GPG signature validity in log output
 
62
acceptable_keys - comma separated list of key patterns acceptable for
 
63
                  verify-signatures command
55
64
 
56
65
In bazaar.conf you can also define aliases in the ALIASES sections, example
57
66
 
427
436
        """See log_format()."""
428
437
        return None
429
438
 
 
439
    def validate_signatures_in_log(self):
 
440
        """Show GPG signature validity in log"""
 
441
        result = self._validate_signatures_in_log()
 
442
        if result == "true":
 
443
            result = True
 
444
        else:
 
445
            result = False
 
446
        return result
 
447
 
 
448
    def _validate_signatures_in_log(self):
 
449
        """See validate_signatures_in_log()."""
 
450
        return None
 
451
 
 
452
    def acceptable_keys(self):
 
453
        """Comma separated list of key patterns acceptable to 
 
454
        verify-signatures command"""
 
455
        result = self._acceptable_keys()
 
456
        return result
 
457
 
 
458
    def _acceptable_keys(self):
 
459
        """See acceptable_keys()."""
 
460
        return None
 
461
 
430
462
    def post_commit(self):
431
463
        """An ordered list of python functions to call.
432
464
 
830
862
        """See Config.log_format."""
831
863
        return self._get_user_option('log_format')
832
864
 
 
865
    def _validate_signatures_in_log(self):
 
866
        """See Config.validate_signatures_in_log."""
 
867
        return self._get_user_option('validate_signatures_in_log')
 
868
 
 
869
    def _acceptable_keys(self):
 
870
        """See Config.acceptable_keys."""
 
871
        return self._get_user_option('acceptable_keys')
 
872
 
833
873
    def _post_commit(self):
834
874
        """See Config.post_commit."""
835
875
        return self._get_user_option('post_commit')
1410
1450
        """See Config.log_format."""
1411
1451
        return self._get_best_value('_log_format')
1412
1452
 
 
1453
    def _validate_signatures_in_log(self):
 
1454
        """See Config.validate_signatures_in_log."""
 
1455
        return self._get_best_value('_validate_signatures_in_log')
 
1456
 
 
1457
    def _acceptable_keys(self):
 
1458
        """See Config.acceptable_keys."""
 
1459
        return self._get_best_value('_acceptable_keys')
 
1460
 
1413
1461
 
1414
1462
def ensure_config_dir_exists(path=None):
1415
1463
    """Make sure a configuration directory exists.