-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/config.pyc


fRc@@sdZddlmZddlmZddlZddlZddlZddlm	Z	ddl
mZeedddlm
Z
mZmZmZdd	lmZmZdZd
ZdZdZd
ZdZdZd
ZdZiee6de6d
e6Ziee6ed6ed6ed
6ZeZ eZ!eZ"dZ#dZ$dZ%dZ&de'j(fdYZ(de)fdYZ*dej+fdYZ,e,Z-dej+fdYZ.e.Z/de*fdYZ0de0fdYZ1de1fd YZ2d!Z3d"e1fd#YZ4d$e*fd%YZ5ed&Z6d'Z7d(Z8d)Z9d*Z:d+Z;d,Z<d-Z=d.d/Z>d0Z?d1Z@d2ZAd3ZBd4e0fd5YZCd6e)fd7YZDd8ejEfd9YZFeFZGd:e)fd;YZHd<eHfd=YZIeGjJd>eId?eIjd>eG_Kd@eHfdAYZLeGjJdBeLd?eLjdCe)fdDYZMdEe)fdFYZNdGe)fdHYZOdIZPdJZQeRdKdLddMdLdNdOdLdPZSdQZTdRZUe'j(idSdTdUeVdVeWZXdWeOfdXYZYdYeOfdZYZZej[d[Z\d\Z]d]ejEfd^YZ^e^Z_e_jJeOd_d`edaePdbdcd?dde_jJeYded`ed?dfe_jJeOdgd`dhdaeTd?die_jJeOdjd`edaePd?dke_jJeOdld`ed?dme_jJeOdnd`eWdaePd?doe_j`dpdqdre_jJeOdsd`dLdaeQdbdcd?dte_jJeOdud`ed?dve_jJeOdwd`edae%d?dxe_jJeOdyd?dze_jJeOd{d?d|e_jJeOd}d`edae&d?d~e_jJeOdd`eVdaePd?de_jJeYdd`gd?de_jJeOdd`dd?de_jJeOdd`edaePd?de_jJeOdd?de_jJeOdddgd`e?d?de_jJeOdd`dd?de_jJeOdd`ed?de_jJeOdd`eWdaePd?de_jJeOdd?de_jJeOdd`eWdaePd?de_jJeOdd`dd?de_j`ddde_jJeOdd?de_jJeOdd`ed?de_jJeOdd`ed?de_j`ddde_jJeOdd`ed?de_jJeOdd`ed?de_jJeOdd`edaePd?de_jJeOdd`eVdaePd?de_j`ddde_j`ddde_j`ddde_jJeOdd`ddaeQd?de_jJeOdd`edaePd?de_jJeOdd`ddaeUd?de_jJeOdd`ed?de_jJeOdd`ed?de_jJeOdd?de_jJeYdd`gd?de_jJeOdd`eWdaePdbdcd?de_j`ddde_j`dddde)fdYZae)Zbe)ZcdeafdYZdde)fdYZedeefdYZfdeefdYZgdegfdYZhdehfdYZideifdYZjdeifdYZkdehfdYZldeifdYZmde)fdYZndenfdYZodeafdYZpdenfdYZqdenfdYZriZseWatde)fdYZudeufdYZvdeufdYZwdeufdYZxdeufdYZydeufdYZzdeufdYZ{deufdYZ|de
j}fdYZ~ejEZejEZdS(sConfiguration that affects the behaviour of Bazaar.

Currently this configuration resides in ~/.bazaar/bazaar.conf
and ~/.bazaar/locations.conf, which is written to by bzr.

In bazaar.conf the following options may be set:
[DEFAULT]
editor=name-of-program
email=Your Name <your@email.address>
check_signatures=require|ignore|check-available(default)
create_signatures=always|never|when-required(default)
gpg_signing_command=name-of-program
log_format=name-of-format
validate_signatures_in_log=true|false(default)
acceptable_keys=pattern1,pattern2
gpg_signing_key=amy@example.com

in locations.conf, you specify the url of a branch and options for it.
Wildcards may be used - * and ? as normal in shell completion. Options
set in both bazaar.conf and locations.conf are overridden by the locations.conf
setting.
[/home/robertc/source]
recurse=False|True(default)
email= as above
check_signatures= as above
create_signatures= as above.
validate_signatures_in_log=as above
acceptable_keys=as above

explanation of options
----------------------
editor - this option sets the pop up editor to use during commits.
email - this option sets the user id bzr will use when committing.
check_signatures - this option will control whether bzr will require good gpg
                   signatures, ignore them, or check them if they are
                   present.  Currently it is unused except that check_signatures
                   turns on create_signatures.
create_signatures - this option controls whether bzr will always create
                    gpg signatures or not on commits.  There is an unused
                    option which in future is expected to work if
                    branch settings require signatures.
log_format - this option sets the default log format.  Possible values are
             long, short, line, or a plugin can register new formats.
validate_signatures_in_log - show GPG signature validity in log output
acceptable_keys - comma separated list of key patterns acceptable for
                  verify-signatures command

In bazaar.conf you can also define aliases in the ALIASES sections, example

[ALIASES]
lastlog=log --line -r-10..-1
ll=log --line -r-10..-1
h=help
up=pull
i(tabsolute_import(tStringION(tneeds_write_lock(tlazy_imports
import base64
import fnmatch
import re

from bzrlib import (
    atomicfile,
    controldir,
    debug,
    directory_service,
    errors,
    lazy_regex,
    library_state,
    lockdir,
    mergetools,
    osutils,
    symbol_versioning,
    trace,
    transport,
    ui,
    urlutils,
    win32utils,
    )
from bzrlib.i18n import gettext
from bzrlib.util.configobj import configobj
(tcommandsthookst
lazy_regextregistry(t
deprecated_intdeprecated_methodiit	norecurset
appendpathtnoneiicC@sV|jdkrtS|jdkr,tS|jdkrBtStd|dS(s%Convert a string to a signing policy.scheck-availabletignoretrequiresInvalid signatures policy '%s'N(tlowertCHECK_IF_POSSIBLEtCHECK_NEVERtCHECK_ALWAYSt
ValueError(tsignature_string((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsignature_policy_from_unicodescC@sV|jdkrtS|jdkr,tS|jdkrBtStd|dS(s%Convert a string to a signing policy.s
when-requiredtnevertalwayssInvalid signing policy '%s'N(RtSIGN_WHEN_REQUIREDt
SIGN_NEVERtSIGN_ALWAYSR(R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsigning_policy_from_unicodest	ConfigObjcB@s&eZddZdZdZRS(cK@s&tt|jd|dt|dS(Ntinfilet
interpolation(tsuperRt__init__tFalse(tselfRtkwargs((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@s||j|S(N(tas_bool(R"tsectiontkey((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_boolscC@s;|dkr/y||SWq/tk
r+q/Xn|||S(NtDEFAULT(tKeyError(R"R%tname((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt	get_values
N(t__name__t
__module__tNoneR R'R+(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs	tConfigcB@s3eZdZdZdZdZdZdZd+Z	d+dZ
d+d+dZd+d+dZd	Z
d
ZedZd+d+dZd+d
Zeed,d+dZeed-dZdZeed.dZdZdZdZeed/dZdZeed0dZdZdZ dZ!dZ"eed1dZ#eed2d Z$eed3d!Z%eed4d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+d(Z,d)Z-d*Z.RS(5s>A configuration policy - what username, editor, gpg needs etc.cC@stt|jdS(N(RR/R (R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@st|jdS(s#Returns a unique ID for the config.N(tNotImplementedErrort	config_id(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR1scC@sHddlm}|j}|dkr,dS|jj|||tjS(Ni(tdiff(tbzrlibR2t_get_change_editorR.tDiffFromTooltfrom_stringtsyststdout(R"told_treetnew_treeR2tcmd((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_change_editorscC@sdS(s6Template method to override signature checking policy.N((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_signature_checkingscC@sdS(s6Template method to override signature creation policy.N((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_signing_policyscC@s|j||S(s,Expand option references in the string in the configuration context.

        :param string: The string containing option to expand.

        :param env: An option dict defining additional configuration options or
            overriding existing ones.

        :returns: The expanded string.
        (t_expand_options_in_string(R"tstringtenv((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytexpand_optionss
cC@s\g}xO|D]G}|j|||}t|trG|j|q
|j|q
W|S(sExpand options in  a list of strings in the configuration context.

        :param slist: A list of strings.

        :param env: An option dict defining additional configuration options or
            overriding existing ones.

        :param _ref_stack: Private list containing the options being
            expanded to detect loops.

        :returns: The flatten list of expanded strings.
        (R?t
isinstancetlisttextendtappend(R"tslistRAt
_ref_stacktresulttstvalue((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_expand_options_in_lists
cC@s|dkrdS|dkr%g}n|jdkrItjd|_n|}xUtr|jj|}t|dkr|Sg}t}t}x|D]}	|s|	r|j|	nt}q|	dd!}
|
|krt	j
||n|j|
|j|
||}|dkr5t	j|
|nt
|trZt}|j|n
|j||jt}qW|r|j|||Sdj|}qRW|S(sExpand options in the string in the configuration context.

        :param string: The string to be expanded.

        :param env: An option dict defining additional configuration options or
            overriding existing ones.

        :param _ref_stack: Private list containing the options being
            expanded to detect loops.

        :returns: The expanded string.
        s
({[^{}]+})iitN(R.t
option_ref_retretcompiletTruetsplittlenR!RFterrorstOptionExpansionLoopt_expand_optiontExpandingUnknownOptionRCRDREtpopRLtjoin(R"R@RARHRIt
raw_chunkstchunkst
list_valuetchunk_is_reftchunkR*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR?sH
		
	




cC@sz|dk	r%||kr%||}nQ|j|dt}t|tra|j|||}n|j|||}|S(Ntexpand(R.tget_user_optionR!RCRDRLR?(R"R*RARHRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRVJs
cC@sdS(s)Template method to provide a user option.N(R.(R"toption_name((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_user_option\scC@s|j|}|rnt|tr6|j|}qnt|tr\tjd|fqn|j|}nx"tdD]}||||qyW|S(sGet a generic option - no special process, no default.

        :param option_name: The queried option.

        :param expand: Whether options references should be expanded.

        :returns: The value of the option.
        s9Cannot expand "%s": Dicts do not support option expansiontget(	RbRCRDRLtdictttracetwarningR?tOldConfigHooks(R"RaR_RKthook((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR``s		cC@sZ|j|d|}|dkr%|Stj|}|dkrVtjd||n|S(sCGet a generic option as a boolean.

        :param expand: Allow expanding references to other config values.
        :param default: Default value if nothing is configured
        :return None if the option doesn't exist or its value can't be
            interpreted as a boolean. Returns True or False otherwise.
        R_s$Value "%s" is not a boolean for "%s"N(R`R.tuitbool_from_stringReRf(R"RaR_tdefaultRJtval((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_user_option_as_boolws	
cC@s:|j|d|}t|ttfr6|g}n|S(sGet a generic option as a list - no special process, no default.

        :return None if the option doesn't exist. Returns the value as a list
            otherwise.
        R_(R`RCtstrtunicode(R"RaR_tl((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_user_option_as_listsiiicC@sb|j|}t|tr+|d}n|d
kr@|}ntjdtj}y|j|}|d
k	rt|j	d}|j	dd
k	rC|j	dj
dkr|d9}q|j	dj
dkr|d9}q|j	dj
d
kr|d9}qqCn(tjj
tdj|||}Wntk
r]|}nX|S(sGet a generic option from a human readable size in SI units, e.g 10MB

        Accepted suffixes are K,M,G. It is case-insensitive and may be followed
        by a trailing b (i.e. Kb, MB). This is intended to be practical and not
        pedantic.

        :return Integer, expanded to its base-10 value if a proper SI unit is 
            found. If the option doesn't exist, or isn't a value in 
            SI units, return default (which defaults to None)
        is^(\d+)([kmg])*b*$iitki
itmitgi	s>Invalid config value for "{0}"  value {1!r} is not an SI unit.Nii@Biʚ;(R`RCRDR.RORPt
IGNORECASEtmatchtinttgroupRRit
ui_factorytshow_warningtgettexttformatt	TypeError(R"RaRkRltpRs((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_user_option_as_int_from_SIs.
	





cC@s%|j}|dkr!d}n|S(s/What program should be used to sign signatures?tgpgN(t_gpg_signing_commandR.(R"RI((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytgpg_signing_commands	cC@sdS(sSee gpg_signing_command().N(R.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s%|j}|dkr!d}n|S(sWhat log format should be usedtlongN(t_log_formatR.(R"RI((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
log_formats	cC@sdS(sSee log_format().N(R.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s+|j}|dkr!t}nt}|S(s"Show GPG signature validity in logttrue(t_validate_signatures_in_logRQR!(R"RI((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytvalidate_signatures_in_logs
	cC@sdS(s!See validate_signatures_in_log().N(R.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s|j}|S(sUComma separated list of key patterns acceptable to 
        verify-signatures command(t_acceptable_keys(R"RI((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytacceptable_keysscC@sdS(sSee acceptable_keys().N(R.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jS(spAn ordered list of python functions to call.

        Each function takes branch, rev_id as parameters.
        (t_post_commit(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytpost_commitscC@sdS(sSee Config.post_commit.N(R.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@st|jS(s.Return just the email component of a username.(textract_email_addresstusername(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
user_emailscC@sHtjjd}|r+|jtjS|j}|rA|StS(s;Return email-style username.

        Something similar to 'Martin Pool <mbp@sourcefrog.net>'

        $BZR_EMAIL can be set to override this, then
        the concrete policy type is checked, and finally
        $EMAIL is examined.
        If no username can be found, errors.NoWhoami exception is raised.
        t	BZR_EMAIL(tostenvironRctdecodetosutilstget_user_encodingt_get_user_idt
default_email(R"tv((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s|jdS(sRaise errors.NoWhoami if username is not set.

        This method relies on the username() function raising the error.
        N(R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytensure_usernamescC@s |j}|dk	r|StS(s3What is the current policy for signature checking?.N(R=R.R(R"tpolicy((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsignature_checkingscC@s |j}|dk	r|StS(s3What is the current policy for signature checking?.N(R>R.R(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsigning_policyscC@sW|j}|dkrC|j}|dk	rStjdqSn|tkrStStS(s(Is a signature needed when committing ?.sIPlease use create_signatures, not check_signatures to set signing policy.N(R>R.R=ReRfRRQR!(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsignature_needed'scC@s9|jd}|dks'|dkr1|jS|SdS(sGPG user-id to sign commitstgpg_signing_keyRkN(R`R.R(R"R&((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR6s
cC@s
|j|S(N(t
_get_alias(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt	get_alias?scC@sdS(N((R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRBscC@s
|jS(N(t
_get_nickname(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_nicknameEscC@sdS(N(R.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRHscC@sLytjdSWn6tk
rG|jd}|dkrCd}n|SXdS(NtBZR_REMOTE_PATHtbzr_remote_pathtbzr(RRR)R`R.(R"tpath((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_bzr_remote_pathKs
	cC@s3|jd}|dks'||kr+tStSdS(sShould the warning be suppressed or emitted.

        :param warning: The name of the warning being tested.

        :returns: True if the warning should be suppressed, False otherwise.
        tsuppress_warningsN(RqR.R!RQ(R"Rftwarnings((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsuppress_warningTscC@syi}x[|jD]M\}}}}}|jdr|td}|j|t||<qqWtjd||S(Nsbzr.mergetool.sloaded merge tools: %r(t_get_optionst
startswithRSR`R!Retmutter(R"ttoolstonameRKR%tconf_idtparsert	tool_name((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_merge_toolsas"cC@s2|jd|dtp+tjj|d}|S(Nsbzr.mergetool.%sR_(R`R!t
mergetoolstknown_merge_toolsRcR.(R"R*tcommand_line((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytfind_merge_tooljs	N(iii(iii(iii(iii(iii(iii(iii(iii(iii(/R,R-t__doc__R R1R<R=R>R.RNRBRLR?RVRbRQR`RmRqR	RRRRRRRRRRRRRRRRRRRRRRRRRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR/sT					E		
&																		
		t_ConfigHookscB@seZdZdZRS(sCA dict mapping hook names and a list of callables for configs.
    cC@s|tt|jdd|jddd|jddd|jd	d
d|jddd|jd
dddS(sCreate the default hooks.

        These are all empty initially, because by default nothing should get
        notified.
        s
bzrlib.configtConfigHookstloads@Invoked when a config store is loaded. The signature is (store).iitsaves?Invoked when a config store is saved. The signature is (store).RcsLInvoked when a config option is read. The signature is (stack, name, value).tsetsKInvoked when a config option is set. The signature is (stack, name, value).tremovesHInvoked when a config option is removed. The signature is (stack, name).N(ii(ii(ii(ii(ii(RRR tadd_hook(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR ys 					(R,R-RR (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRust_OldConfigHookscB@seZdZdZRS(sCA dict mapping hook names and a list of callables for configs.
    cC@s|tt|jdd|jddd|jddd|jd	d
d|jddd|jd
dddS(sCreate the default hooks.

        These are all empty initially, because by default nothing should get
        notified.
        s
bzrlib.configRgRsAInvoked when a config store is loaded. The signature is (config).iiRs@Invoked when a config store is saved. The signature is (config).RcsMInvoked when a config option is read. The signature is (config, name, value).RsLInvoked when a config option is set. The signature is (config, name, value).RsIInvoked when a config option is removed. The signature is (config, name).N(ii(ii(ii(ii(ii(RRR R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s 					(R,R-RR (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRstIniBasedConfigcB@s
eZdZejddZededZ	dZ
ejdZdZdZ
dZddZdd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdZddZdZRS(s1A configuration policy that draws from ini files.cC@s~tt|j||_tj|r_tjdtdd|dk	rh||_qhn	||_d|_	d|_
dS(s}Base class for configuration files using an ini-like syntax.

        :param file_name: The configuration file path.
        sSIniBasedConfig.__init__(get_filename) was deprecated in 2.3. Use file_name instead.t
stackleveliN(RRR t	file_nametsymbol_versioningtdeprecated_passedtwarntDeprecationWarningR.t_contentt_parser(R"tget_filenameR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s			cC@s#|d|}|j|||S(sCreate a config object from a string.

        :param str_or_unicode: A string representing the file content. This will
            be utf-8 encoded.

        :param file_name: The configuration file path.

        :param _save: Whether the file should be saved upon creation.
        R(t_create_from_string(tclststr_or_unicodeRRtconf((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR6scC@s/t|jd|_|r+|jndS(Nsutf-8(RtencodeRt_write_config_file(R"RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s$|jdk	r|jStj|r>tjdtddn|jdk	rY|j}n'|jdkrwtdn	|j}yt	|dd|_WnSt
jk
r}tj
|j|jjn#tk
rtj|jnX|j|j_xtdD]}||q	W|jS(NseIniBasedConfig._get_parser(file=xxx) was deprecated in 2.3. Use IniBasedConfig(_content=xxx) instead.Ris'We have no content to create the configtencodingsutf-8R(RR.RRRRRRtAssertionErrorRt	configobjtConfigObjErrorRTtParseConfigErrortconfigtfilenametUnicodeDecodeErrortConfigContentErrorRg(R"tfiletco_inputteRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_parsers,
	
cC@s`|jdkrtdn|jdk	r=|jjnxtdD]}||qHWdS(s!Reload the config file from disk.s(We need a file name to reload the configRN(RR.RRtreloadR(R"Rh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s-|j}|dk	r%|dfgSgSdS(sReturn an ordered list of (section_name, extra_path) pairs.

        If the section contains inherited configuration, extra_path is
        a string containing the additional path components.
        RMN(t_get_sectionR.(R"R%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_matching_sections
s
cC@sdS(s7Override this to define the section used by the config.R(((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscc@sK|j}|dk	r3||||jfVnd||jfVdS(sReturns an iterator of the sections specified by ``name``.

        :param name: The section name. If None is supplied, the default
            configurations are yielded.

        :return: A tuple (name, section, config_id) for all sections that will
            be walked by user_get_option() in the 'right' order. The first one
            is where set_user_option() will update the value.
        N(RR.R1(R"R*R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
_get_sectionss
c
c@sg}|dkr||j}g}xU|jD]D\}}y||}Wntk
raq1nX|j||fq1Wn|j}xN|D]F\}}x7|jD])\}}	||j|	|||fVqWqWdS(sReturn an ordered list of (name, value, section, config_id) tuples.

        All options are returned with their associated value and the section
        they appeared in. ``config_id`` is a unique identifier for the
        configuration file the option is defined in.

        :param sections: Default to ``_get_matching_sections`` if not
            specified. This gives a better control to daughter classes about
            which sections should be searched. This is a list of (name,
            configobj) tuples.
        N(R.RRR)RFR1t	iteritemst_quote(
R"tsectionstoptsRtsection_namet_R%R1R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR/s
cC@stS(s<Return the policy for the given (section, option_name) pair.(tPOLICY_NONE(R"R%Ra((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_option_policyNscC@s
|jdS(Nt
change_editor(R`(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR4RscC@s#|jd}|rt|SdS(s#See Config._get_signature_checking.tcheck_signaturesN(RbR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR=UscC@s#|jd}|rt|SdS(sSee Config._get_signing_policytcreate_signaturesN(RbR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR>[scC@s
|jdS(s<Get the user id from the 'email' key in the current section.temail(Rb(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRascC@sx|jD]\}}y|jj||}Wntk
rKq
nX|j||}|tkrn|S|tkr|rq
q|Sq
|tkr|rtj	||}n|St
d|q
WdSdS(sSee Config._get_user_option.sUnexpected config policy %rN(RRR+R)RRtPOLICY_NORECURSEtPOLICY_APPENDPATHturlutilsRYRR.(R"RaR%t
extra_pathRKR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRbes$
cC@s
|jdS(sSee Config.gpg_signing_command.R(Rb(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR~scC@s
|jdS(sSee Config.log_format.R(Rb(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(s&See Config.validate_signatures_in_log.R(Rb(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(sSee Config.acceptable_keys.R(Rb(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(sSee Config.post_commit.R(Rb(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s2y|jjd|SWntk
r-nXdS(NtALIASES(RR+R)(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs

cC@s
|jdS(Ntnickname(R`(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s|j|j}|dkr+|}n
||}y||=Wn tk
rbtj|nX|jxtdD]}|||qxWdS(sRemove a user option and save the configuration file.

        :param option_name: The option to be removed.

        :param section_name: The section the option is defined in, default to
            the default section.
        RN(RRR.R)RTtNoSuchConfigOptionRRg(R"RaRRR%Rh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytremove_user_options
	


cC@s|jdkrtdntjj|j}t|tj|j}|j	j
||j|jt
j|jxtdD]}||qWdS(Ns&We cannot save, self.file_name is NoneR(RR.RRRtdirnametensure_config_dir_existst
atomicfilet
AtomicFileRtwritetcommittcloseRtcopy_ownership_from_pathRg(R"tconf_dirtatomic_fileRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs


N( R,R-RRtDEPRECATED_PARAMETERR.R tclassmethodR!R6RRRRRRRRR4R=R>RRbRRRRRRRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs6																		tLockableConfigcB@s_eZdZdZdZdZd	dZdZdZ	e
d	dZdZRS(
sA configuration needing explicit locking for access.

    If several processes try to write the config file, the accesses need to be
    serialized.

    Daughter classes should decorate all methods that update a config with the
    ``@needs_write_lock`` decorator (they call, directly or indirectly, the
    ``_write_config_file()`` method. These methods (typically ``set_option()``
    and variants must reload the config file from disk before calling
    ``_write_config_file()``), this can be achieved by calling the
    ``self.reload()`` method. Note that the lock scope should cover both the
    reading and the writing of the config file which is why the decorator can't
    be applied to ``_write_config_file()`` only.

    This should be enough to implement the following logic:
    - lock for exclusive write access,
    - reload the config file from disk,
    - set the new value
    - unlock

    This logic guarantees that a writer can update a value without erasing an
    update made by another writer.
    tlockcC@sktt|jd|tjtj|j|_tj	|j|_t
j|j|j|_
dS(NR(RRR RRtsafe_unicodeRtdirt	transporttget_transport_from_pathtlockdirtLockDirt	lock_namet_lock(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@sDtt|j|t|r@|j|j|jndS(N(RRRR!t
lock_writeRtunlock(R"t
unicode_bytesR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs


cC@st|j|jj|S(sTakes a write lock in the directory containing the config file.

        If the directory doesn't exist it is created.
        (RRRR(R"ttoken((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s|jjdS(N(RR
(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
scC@s|jjdS(N(Rt
break_lock(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@stt|j||dS(N(RRR(R"RaR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@sE|jdks|jjr.tj|ntt|jdS(N(RR.tis_heldRTtObjectNotLockedRRR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsN(
R,R-RR
R RR.RR
RRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs					tGlobalConfigcB@seZdZdZdZeedZedZ	dZ
edZedZdZ
dd	Zedd
ZRS(s>The configuration that should be used for a specific location.cC@s tt|jdtdS(NR(RRR tconfig_filename(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
scC@sdS(Ntbazaar((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR1scC@s|}|j|||S(sCreate a config object from a string.

        :param str_or_unicode: A string representing the file content. This
            will be utf-8 encoded.

        :param save: Whether the file should be saved upon creation.
        (R(RRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR6s		cC@s|j||ddS(s/Save option and its value in the configuration.R(N(t_set_option(R"toptionRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytset_user_option scC@s(d|jkr |jdSiSdS(sReturn the aliases section.RN(R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_aliases%scC@s|j||ddS(s$Save the alias in the configuration.RN(R(R"t
alias_namet
alias_command((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt	set_alias,scC@sY|j|jjd}|s2||krDtj|n||=|jdS(sUnset an existing alias.RN(RRRcRTtNoSuchAliasR(R"Rtaliases((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytunset_alias1s
cC@sY|j||jj|i|<|jx"tdD]}||||q;WdS(NR(RRt
setdefaultRRg(R"RRKR%Rh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR;s


cc@sV|j}|dkr:d}d|kr:i|d<q:n||||jfVdS(s#See IniBasedConfig._get_sections().R(N(NsDEFAULT(RR.R1(R"R*R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRBscC@s2|dkrd}ntt|j||dS(NR((R.RRR(R"RaR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyROs	N(R,R-RR R1RR!R6RRRRRRR.RR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s			
	
c
c@s|jdjd}x|D]}|jdrFtj|}n|}|jdjd}t}t|t|krt}nDt||}x2|D]*}t	j	|d|dst}PqqW|sqndj
|t|}	||	t|fVqWdS(s,Keep only the sessions matching the specified location.

    :param sections: An iterable of section names.

    :param location: An url or a local path to match against.

    :returns: An iterator of (section, extra_path, nb_parts) where nb is the
        number of path components in the section name, section is the section
        name and extra_path is the difference between location and the section
        name.

    ``location`` will always be a local path and never a 'file://' url but the
    section names themselves can be in either form.
    t/sfile://iiN(trstripRRRRtlocal_path_from_urlRQRSR!tziptfnmatchRY(
Rtlocationtlocation_partsR%tsection_patht
section_partstmatchedtnamesR*R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_iter_for_location_by_partsYs$
	
tLocationConfigcB@skeZdZdZdZeedZdZd	dZ
dZdZe
edZRS(
s<A configuration object that gives the policy for a location.cC@sJtt|jdt|jdr=tj|}n||_dS(NRsfile://(RR-R tlocations_config_filenameRRR#R&(R"R&((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s

cC@sdS(Nt	locations((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR1scC@s ||}|j|||S(s,Create a config object from a string.

        :param str_or_unicode: A string representing the file content. This will
            be utf-8 encoded.

        :param location: The location url to filter the configuration.

        :param save: Whether the file should be saved upon creation.
        (R(RRR&RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR6scc@stt|j|j}|jdddtxW|D]O\}}}||fVy!|j|jdrxPnWq>tk
rq>Xq>WdS(s?Return an ordered list of section names matching this location.R&cS@s|\}}}||fS(N((t.0R%Rtlength((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt<lambda>streversetignore_parentsN(RDR,RR&tsortRQR$R)(R"tmatchesR%RR1((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs		
cc@sE|j}x2|jD]$\}}||||jfVqWdS(s#See IniBasedConfig._get_sections().N(RRR1(R"R*RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@sy|j|jd}Wntk
r6t}nX|sAtS|d}y|j||}Wntk
r|d}nXt|S(s<Return the policy for the given (section, option_name) pair.trecurses:policyN(RR$R)RQRR.t
_policy_value(R"R%RaR7t
policy_keytpolicy_name((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs




cC@sy|j|jd}Wntk
r0nzXtjd|t|j|d=|sxK|j|jD]0}|jdssd|j||d<qsqsWn|d}t|}|dk	r||j||<n*||j|kr|j||=ndS(s>Set the policy for the given option name in the given section.R7sbThe recurse option is deprecated as of 0.14.  The section "%s" has been converted to use policies.s:policyR
N(
RR$R)RRRtkeystendswitht_policy_nameR.(R"R%Rat
option_policyR7R&R9R:((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_set_option_policys&
"

cC@s|tttgkr.td||fn|j|j}|jdr]|d }n|j}||kr|d|kri||<n|d|kr|d}n||||<|j||||j	x"t
dD]}||||qWdS(s/Save option and its value in the configuration.sbad storage policy %r for %rR!iRN(tSTORE_LOCATIONtSTORE_LOCATION_NORECURSEtSTORE_LOCATION_APPENDPATHRRR&R<RR?RRg(R"RRKtstoreR&RRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs&
	



N(R,R-RR R1RR!R6RR.RRR?RR@R(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR-s	
				tBranchConfigcB@seZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZdd
ZddZeedZddZdZdZdZdZdZdZdZdZRS(s6A configuration object giving the policy for a branch.cC@sVtt|jd|_d|_d|_||_|j|j	|j
f|_dS(N(RRDR R.t_location_configt_branch_data_configt_global_configtbrancht_get_location_configt_get_branch_data_configt_get_global_configtoption_sources(R"RH((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s				cC@sdS(NRH((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR1scC@s:|jdkr3t|j|_|j|j_n|jS(N(RFR.t
TreeConfigRHR1(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRJscC@s.|jdkr't|jj|_n|jS(N(RER.R-RHtbase(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRI$scC@s%|jdkrt|_n|jS(N(RGR.R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRK)scC@s=x6|jD]+}t||}|dk	r
|Sq
WdS(sThis returns a user option from local, tree or global config.

        They are tried in that order.  Use get_safe_value if trusted values
        are necessary.
        N(RLtgetattrR.(R"RatsourceRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_best_value.s
cC@sFx?|j|jfD]+}t||}|dk	r|SqWdS(s*This variant of get_best_value never returns untrusted values.

        It does not return values from the branch data, because the branch may
        not be controlled by the user.

        We may wish to allow locations.conf to control whether branches are
        trusted in the future.
        N(RIRKROR.(R"RaRPRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_safe_value:s
	cC@s
|jdS(sReturn the full user id for the branch.

        e.g. "John Hacker <jhacker@example.com>"
        This is looked up in the email controlfile for the branch.
        R(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRIscC@s
|jdS(NR4(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR4QscC@s
|jdS(s#See Config._get_signature_checking.R=(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR=TscC@s
|jdS(sSee Config._get_signing_policy.R>(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR>XscC@s:x3|jD](}|j|}|dk	r
|Sq
WdS(sSee Config._get_user_option.N(RLRbR.(R"RaRPRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRb\s
cc@s:x3|jD](}x|j|D]}|Vq#Wq
WdS(s"See IniBasedConfig.get_sections().N(RLR(R"R*RPR%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRdsc
c@sg}x|jjD]}|VqW|j}|dkrXd|jfg}n|j}xK|D]C\}}x4|jD]&\}}	||	|||jfVqWqkWx|jjD]}|VqWdS(NR((RIRRJR.RR1RRK(
R"RRRt
branch_configR1RR%R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRjs		cC@s	|tkr%|jj||n>|tkrJ|jj||n|jj||||smdS|ttfkr|jj|}|dk	rt	j
d||q|tkr|j}|j|}|dk	rt	j
d||qqndS(Ns0Value "%s" is masked by "%s" from locations.confs-Value "%s" is masked by "%s" from branch.conf(tSTORE_BRANCHRJt
set_optiontSTORE_GLOBALRKRRIR`R.ReRf(R"R*RKRCtwarn_maskedt
mask_valueRS((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR~s$	
	cC@s|jj||dS(N(RJt
remove_option(R"RaR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(sSee Config.gpg_signing_command.R(RR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(sSee Config.post_commit.R(RR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@sR|j}|dk	r|S|jjr2|jjStj|jjjddS(NR!i(t_get_explicit_nicknameR.RHR*RtunescapeRNRR(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s|jdk	S(s7Return true if a nickname has been explicitly assigned.N(RZR.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pythas_explicit_nicknamescC@s
|jdS(NR(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRZscC@s
|jdS(sSee Config.log_format.R(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(s&See Config.validate_signatures_in_log.R(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jdS(sSee Config.acceptable_keys.R(RQ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsN(R,R-RR R1RJRIRKRQRRRR4R=R>RbR.RRRTR!RRRRRR\RZRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRDs4	
																		cC@s|dkrt}ntjj|stjdkrtjj|}tjj|stj	d|tj
|qntj	d|tj
|tj|ndS(sMake sure a configuration directory exists.
    This makes sure that the directory exists.
    On windows, since configuration directories are 2 levels deep,
    it makes sure both the directory and the parent directory exists.
    twin32s$creating config parent directory: %rscreating config directory: %rN(
R.t
config_dirRRtisdirR7tplatformRReRtmkdirRR(Rt
parent_dir((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@stjd}tjdkrg|d
kr9tj}n|d
krTtj}ntj|ddS|d
krtjdkrtjd}|d
krtjtj	d}ntj|d}tj
|rtjd||Sntj	}ntj|d	S(s/Return per-user configuration directory as unicode string

    By default this is %APPDATA%/bazaar/2.0 on Windows, ~/.bazaar on Mac OS X
    and Linux.  On Linux, if there is a $XDG_CONFIG_HOME/bazaar directory,
    that will be used instead.

    TODO: Global option --config-dir to override this.
    tBZR_HOMER]Rs2.0tdarwintXDG_CONFIG_HOMEs.configs(Using configuration in XDG directory %s.s.bazaarN(
Rtpath_from_environR7R`R.t
win32utilstget_appdata_locationtget_home_locationtpathjoint
_get_home_dirR_ReR(RNtxdg_dir((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR^s&	cC@stjtdS(s0Return per-user configuration ini file filename.sbazaar.conf(RRjR^(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@stjtdS(s0Return per-user configuration ini file filename.slocations.conf(RRjR^(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR.scC@stjtdS(s1Return per-user authentication ini file filename.sauthentication.conf(RRjR^(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytauthentication_config_filenamescC@stjtdS(s'Return the user default ignore filenameR
(RRjR^(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytuser_ignore_config_filenamescC@s9tjdkr"tjtdStjjddSdS(sReturn the directory name to store crash files.

    This doesn't implicitly create it.

    On Windows it's in the config directory; elsewhere it's /var/crash
    which may be monitored by apport.  It can be overridden by
    $APPORT_CRASH_DIR.
    R]tCrashtAPPORT_CRASH_DIRs
/var/crashN(R7R`RRjR^RRRc(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt	crash_dirs	cC@s3tjjdd}|r|StjjdSdS(NtXDG_CACHE_HOMEs~/.cache(RRRcR.Rt
expanduser(R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
xdg_cache_dirss
/etc/mailnamecC@sltjdkrdSyt|}Wnttfk
r?}dSXz|jj}|SWd|jXdS(sfIf possible, return the assumed default email domain.

    :returns: string mail domain, or None.
    R]N(	R7R`R.topentIOErrortOSErrortreadlinetstripR(t
mailname_filetfRtdomain((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_default_mail_domainscC@stjjd}|r+|jtjStjjd}|rV|jtjSt\}}|r|rd||fS|r|StjdS(NRtEMAILu%s <%s>(	RRRcRRRt
_auto_user_idRTtNoWhoami(RR*R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR2sc
C@sotjdkrd
St}|s&dSddl}tj}y|j|}Wn#tk
rvt	j
d|dSXy|jjd}d}Wn[t
k
ry"tj}|jj|}Wqt
k
r}t	j
d|d
SXnXy|jj|}Wn%t
k
r.}t	j
d|dSX|jd}|dkrS|}	n
|| }	|	|d	|fS(sCalculate automatic user identification.

    :returns: (realname, email), either of which may be None if they can't be
    determined.

    Only used when none is set in the environment or the id file.

    This only returns an email address if we can be fairly sure the 
    address is reasonable, ie if /etc/mailname is set on unix.

    This doesn't use the FQDN as the default domain because that may be 
    slow, and it doesn't use the hostname alone because that's not normally 
    a reasonable address.
    R]iNsno passwd entry for uid %d?sutf-8scannot decode passwd entry %st,it@(NN(NN(NN(NN(NN(R7R`R.R}tpwdRtgetuidtgetpwuidR)ReRtpw_gecosRtUnicodeErrorRRtpw_nametfind(
tdefault_mail_domainRtuidtwtgecosRRRtcommatrealname((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRAs@	


		
cC@sHtjd|}|dkr(|dfS|jd|jdfSdS(s9Parse e-mail username and return a (name, address) tuple.s(.*?)\s*<?([\w+.-]+@[\w+.-]+)>?RMiiN(RORvR.Rx(RRv((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytparse_username~s
cC@s.t|\}}|s*tj|n|S(s(Return just the address part of an email string.

    That is just the user@domain part, nothing else.
    This part is required to contain only ascii characters.
    If it can't be extracted, raises an error.

    >>> extract_email_address('Jane Tester <jane@test.com>')
    "jane@test.com"
    (RRTtNoEmailInUsername(RR*R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
RMcB@sJeZdZdZddZdddZddZddZRS(sDBranch configuration data associated with its contents, not locationcC@s|j|_||_dS(N(t_get_configt_configRH(R"RH((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@s&|dk	rtj|S|jjS(N(R.RRRt_get_configobj(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s<|jjz|jj|||SWd|jjXdS(N(RHt	lock_readRt
get_optionR
(R"R*R%Rk((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s<|jjz|jj|||Wd|jjXdS(s%Set a per-branch configuration optionN(RHRRRUR
(R"RKR*R%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRUs
cC@s9|jjz|jj||Wd|jjXdS(N(RHRRRYR
(R"RaR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRYs
N(	R,R-RR R.RRRURY(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRMs	
tAuthenticationConfigcB@seZdZd
dZdZdZdZd
d
d
d
dZd
d
d
d
d
d
dZ	d
d
d
d
e
d
dZd
d
d
d
dZd	Z
RS(sThe authentication configuration file based on a ini file.

    Implements the authentication.conf file described in
    doc/developers/authentication-ring.txt.
    cC@sMd|_|dkr7t|_t|_|_nd|_||_dS(N(R.RRmt	_filenamet_input(R"t_file((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s		cC@s|jdk	r|jSyt|jdd|_WnStjk
re}tj|j|jj	n#t
k
rtj|jnX|jS(NRsutf-8(
RR.RRRRRTRRRRRR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@sZtjj|j}t|t|jd}z|jj|Wd|jXdS(s7Save the config file, only tests should use it for now.twbN(	RRRRRRRRR(R"RR{((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_saves
cC@sV|j}|j|}|dkr>i||<||}n|||<|jdS(s*Set an authentication configuration optionN(RRcR.R(R"RRaRKRR%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs


cC@sd}x{|jjD]g\}}	t|	tjk	rMtd|nt|	jddddg\}
}}}
y|	j	d}Wn7t
k
rd}n!tk
rtd|nXy|	jd}Wn7t
k
rt}n!tk
rtd	|nX|
dk	r/||
kr/qn|dk	rn||kpb|j
d
ob|j|snqqnn|dk	r||krqn|
dk	r|dk	r|j
|
rqn|dk	r|dk	r||krqn|dkrqntd|d|d|
d|d|d|d|d
|	jd
dd|	}|j||	jdddtjkrtjd|nPqW|dkrtj||||||}n|S(stReturns the matching credentials from authentication.conf file.

        :param scheme: protocol

        :param host: the server address

        :param port: the associated port (optional)

        :param user: login (optional)

        :param path: the absolute path on the server (optional)

        :param realm: the http authentication realm (optional)

        :return: A dict containing the matching credentials or None.
           This includes:
           - name: the section name of the credentials in the
             authentication.conf file,
           - user: can't be different from the provided user if any,
           - scheme: the server protocol,
           - host: the server address,
           - port: the server port (can be None),
           - path: the absolute server path (can be None),
           - realm: the http specific authentication realm (can be None),
           - password: the decoded password, could be None if the credential
             defines only the user
           - verify_certificates: https specific, True if the server
             certificate should be verified, False otherwise.
        s%s defined outside a sectiontschemethosttuserRtports'port' not numeric in %stverify_certificatess''verify_certificates' not boolean in %st.R*trealmtpasswordtpassword_encodingtauths Using authentication section: %rN(R.RtitemsttypeRtSectionRtmapRctas_intR)R$RQRR<Rdtdecode_passwordtdebugtdebug_flagsReRtcredential_store_registrytget_fallback_credentials(R"RRRRRRtcredentialst
auth_def_nametauth_defta_schemeta_hostta_userta_pathta_portta_verify_certificates((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_credentialssj'
	

	
			c
C@s?i|d6|d6}
|d
k	r-||
d<n|d
k	rF||
d<n|d
k	rcd||
d<n|d
k	r|||
d<n|d
k	rt||
d<n|	d
k	r|	|
d	<n|j}g}xT|jD]F\}
}x7dD](}|j||
j|krPqqW||
=qW|ji|
|6|jd
S(shSet authentication credentials for a host.

        Any existing credentials with matching scheme, host, port and path
        will be deleted, regardless of name.

        :param name: An arbitrary name to describe this set of credentials.
        :param host: Name of the host that accepts these credentials.
        :param user: The username portion of these credentials.
        :param scheme: The URL scheme (e.g. ssh, http) the credentials apply
            to.
        :param password: Password portion of these credentials.
        :param port: The IP port on the host that these credentials apply to.
        :param path: A filesystem path on the host that these credentials
            apply to.
        :param verify_certificates: On https, verify server certificates if
            True.
        :param realm: The http authentication realm (optional).
        RRRRs%dRRRRN(sschemeshostsportspathsrealm(R.RnRRRctupdateR(R"R*RRRRRRRRtvaluesRtfor_deletionR%texisting_valuesR&((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytset_credentialsXs,




c	
C@s|j|||ddd|d|}	|	dk	r@|	d}
nd}
|
dkr|r|dkr~d|jfd}n|dk	rd||f}n|}tjj|d|}
q|}
n|
S(	sGet a user from authentication file.

        :param scheme: protocol

        :param host: the server address

        :param port: the associated port (optional)

        :param realm: the realm sent by the server (optional)

        :param path: the absolute path on the server (optional)

        :param ask: Ask the user if there is no explicitly configured username 
                    (optional)

        :param default: The username returned if none is defined (optional).

        :return: The found user.
        RRRu%su %(host)s usernames%s:%dRN(RR.tupperRiRytget_username(R"RRRRRtprompttaskRkRRtprompt_host((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_users
	cC@s|j||||||}|d
k	rm|d}	|	d
k	rs|dkrstjd|dd
}	qsnd
}	|	d
kr|d
krd|jd}n|d
k	rd||f}
n|}
tjj|d|
d	|}	n|	S(sGet a password from authentication file or prompt the user for one.

        :param scheme: protocol

        :param host: the server address

        :param port: the associated port (optional)

        :param user: login

        :param realm: the realm sent by the server (optional)

        :param path: the absolute path on the server (optional)

        :return: The found password or the one entered by the user.
        Rtsshs:password ignored in section [%s], use an ssh agent insteadR*u%su %(user)s@%(host)s passwords%s:%dRRN(RR.ReRfRRiRytget_password(R"RRRRRRRRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs$	
	cC@sNytj|}Wn!tk
r6td|nX|j||d<|S(Ns#%r is not a known password_encodingR(Rtget_credential_storeR)RR(R"RRtcs((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
N(R,R-RR.R RRRRRR!RRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
		
	
	a	+	)*tCredentialStoreRegistrycB@s\eZdZddZdZdddddZdeedZdeedZ	RS(sA class that registers credential stores.

    A credential store provides access to credentials via the password_encoding
    field in authentication.conf sections.

    Except for stores provided by bzr itself, most stores are expected to be
    provided by plugins that will therefore use
    register_lazy(password_encoding, module_name, member_name, help=help,
    fallback=fallback) to install themselves.

    A fallback credential store is one that is queried if no credentials can be
    found via authentication.conf.
    cC@s+|j|}t|r'|}n|S(N(Rctcallable(R"RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|j|S(s@Check if the named credentials store should be used as fallback.(tget_info(R"R*((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytis_fallbacksc
C@ssd}xf|jD]X}|j|s.qn|j|}	|	j||||||}|dk	rPqqW|S(sRequest credentials from all fallback credentials stores.

        The first credentials store that can provide credentials wins.
        N(R.R;RRR(
R"RRRRRRRR*R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s(tt|j|||d|d|S(sRegister a new object to a name.

        :param key: This is the key to use to request the object later.
        :param obj: The object to register.
        :param help: Help text for this entry. This may be a string or
                a callable. If it is a callable, it should take two
                parameters (registry, key): this registry and the key that
                the help was registered under.
        :param override_existing: Raise KeyErorr if False and something has
                already been registered for that key. If True, ignore if there
                is an existing key (always register the new value).
        :param fallback: Whether this credential store should be 
                used as fallback.
        tinfotoverride_existing(RRtregister(R"R&tobjthelpRtfallback((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsc	C@s+tt|j||||d|d|S(sRegister a new credential store to be loaded on request.

        :param module_name: The python path to the module. Such as 'os.path'.
        :param member_name: The member of the module to return.  If empty or
                None, get() will return the module itself.
        :param help: Help text for this entry. This may be a string or
                a callable.
        :param override_existing: If True, replace the existing object
                with the new one. If False, if there is already something
                registered with the same key, raise a KeyError
        :param fallback: Whether this credential store should be 
                used as fallback.
        RR(RRt
register_lazy(R"R&tmodule_nametmember_nameRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR"sN(
R,R-RR.RRRR!RR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
	tCredentialStorecB@s,eZdZdZdddddZRS(s6An abstract class to implement storage for credentialscC@st|jdS(s;Returns a clear text password for the provided credentials.N(R0R(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR=scC@st|jdS(sReturn the matching credentials from this credential store.

        This method is only called on fallback credential stores.
        N(R0R(R"RRRRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRAsN(R,R-RRR.R(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR:s		tPlainTextCredentialStorecB@seZdZdZRS(s<Plain text credential store for the authentication.conf filecC@s|dS(s$See CredentialStore.decode_password.R((R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRNs(R,R-RR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRKstplainRtBase64CredentialStorecB@seZdZdZRS(s8Base64 credential store for the authentication.conf filecC@stj|dS(s$See CredentialStore.decode_password.R(tbase64tdecodestring(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR[s(R,R-RR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRXsRtBzrDirConfigcB@s#eZdZdZdZRS(cC@s||_|j|_dS(N(t_bzrdirRR(R"tbzrdir((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR gs	cC@sa|jdkr(tjd|jn|dkrJ|jjddn|jj|ddS(sSet the default stacking location.

        It may be set to a location, or None.

        This policy affects all branches contained by this control dir, except
        for those under repositories.
        sCannot set configuration in %sRMtdefault_stack_onN(RR.RTtBzrErrorRRU(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytset_default_stack_onks	cC@s>|jdkrdS|jjd}|dkr:d}n|S(sReturn the default stacking location.

        This will either be a location, or None.

        This policy affects all branches contained by this control dir, except
        for those under repositories.
        RRMN(RR.R(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_default_stack_on{s	(R,R-R RR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRes		tTransportConfigcB@sbeZdZdZd	d	dZd	dZd	dZdZdZ	dZ
dZRS(
s	A Config that reads/writes a config file on a Transport.

    It is a low-level object that considers config data to be name/value pairs
    that may be associated with a section.  Assigning meaning to these values
    is done at higher levels like TreeConfig.
    cC@s||_||_dS(N(t
_transportR(R"RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s	cC@s|j}|dkr!|}n#y||}Wntk
rC|SX|j||}x"tdD]}||||qaW|S(sReturn the value associated with a named option.

        :param name: The name of the value
        :param section: The section the option is in (if any)
        :param default: The value to return if the value is not set
        :return: The value or default value
        RcN(RR.R)RcRg(R"R*R%RkRtsection_objRKRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs	
cC@sq|j}|dkr%|||<n||j|i|<x"tdD]}||||qFW|j|dS(sSet the value associated with a named option.

        :param value: The value to set
        :param name: The name of the value to set
        :param section: The section the option is in (if any)
        RN(RR.R Rgt_set_configobj(R"RKR*R%RRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRUs
cC@s`|j}|dkr"||=n|||=xtdD]}|||q8W|j|dS(NR(RR.RgR(R"RaRRRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRYs
cC@syBt|jj|j}xtdD]}||q)W|SWnbtjk
r\tStjk
r}tj	dt
jt
j|jj
|jdtSXdS(NRs=Permission denied while trying to open configuration file %s.sutf-8(RRt	get_bytesRRgRTt
NoSuchFiletPermissionDeniedReRfRtunescape_for_displayRYRN(R"R{RhR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_config_files	"cC@stj|jj|jS(N(RRYRtexternal_urlR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
_external_urlscC@s|j}zsyt|dd}WnVtjk
rX}tj|j|jn&tk
r}tj|jnXWd|j	X|S(NRsutf-8(
RRRRRTRRRRR(R"R{RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s\t}|j||jd|jj|j|xtdD]}||qDWdS(NiR(RRtseekRtput_fileRRg(R"Rtout_fileRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs	

N(R,R-RR R.RRURYRRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs	
			
tOptioncB@sneZdZddddddedZedZdZdZ	dZ
dZdedZRS(	s6An option definition.

    The option *values* are stored in config files and found in sections.

    Here we define various properties about the option itself, its default
    value, how to convert it from stores, what to do when invalid values are
    encoutered, in which config files it can be stored.
    c		C@s9|dkrg}n|dkr*g}n||_||_|dkrTd|_nt|tr|rxtdnd|_n\t|ttt	t
tfrd|f|_n+t|r||_ntd|f||_
||_||_||_|r,|d	kr,td|fn||_dS(
sBuild an option definition.

        :param name: the name used to refer to the option.

        :param override_from_env: A list of environment variables which can
           provide override any configuration setting.

        :param default: the default value to use when none exist in the config
            stores. This is either a string that ``from_unicode`` will convert
            into the proper type, a callable returning a unicode string so that
            ``from_unicode`` can be used on the return value, or a python
            object that can be stringified (so only the empty list is supported
            for example).

        :param default_from_env: A list of environment variables which can
           provide a default value. 'default' will be used only if none of the
           variables specified here are set in the environment.

        :param help: a doc string to explain the option to the user.

        :param from_unicode: a callable to convert the unicode string
            representing the option value in a store or its default value.

        :param invalid: the action to be taken when an invalid value is
            encountered in a store. This is called only when from_unicode is
            invoked to convert a string and returns None or raise ValueError or
            TypeError. Accepted values are: None (ignore invalid values),
            'warning' (emit a warning), 'error' (emit an error message and
            terminates).

        :param unquote: should the unicode value be unquoted before conversion.
           This should be used only when the store providing the values cannot
           safely unquote them (see http://pad.lv/906897). It is provided so
           daughter classes can handle the quoting themselves.
        s0Only empty lists are supported as default valuesu,u%ss&%r is not supported as a default valueRfterrors%s not supported for 'invalid'N(swarningserror(R.R*toverride_from_envRkRCRDRRnRotboolRwtfloatRtdefault_from_envt_helptfrom_unicodetunquotetinvalid(	R"R*RRkRRRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s4&				
				cC@s|jS(N(R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR>	scC@s|jr3|dk	r3|dk	r3|j|}n|jdksN|dkrR|Sy|j|}Wnttfk
rd}nX|dkr|jdk	r|jdkrtjd||jq|jdkrt	j
|j|qn|S(NRfs Value "%s" is not valid for "%s"R(RR.RRR}RReRfR*RTtConfigOptionValueError(R"RCt
unicode_valuet	converted((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytconvert_from_unicodeB	s!
	cC@sVd}xI|jD]>}y!tj|jtj}PWqtk
rMqqXqW|S(N(R.RRRRRRR)(R"RKtvar((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_overrideV	s
cC@sd}xI|jD]>}y!tj|jtj}PWqtk
rMqqXqW|dkrt|j	r|j	}t
|tstd|j
qq|j	}n|S(Ns1Callable default value for '%s' should be unicode(R.RRRRRRR)RRkRCRoRR*(R"RKR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_defaulta	s 
cC@s|jS(N(R*(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_help_topicv	scC@sH|j}ddlm}||j|7}|rD|j|}n|S(Ni(thelp_topics(RR3Rt_format_see_alsothelp_as_plain_text(R"tadditional_see_alsoRRIR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
get_help_texty	s	N(
R,R-RR.RQR tpropertyRRRRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsE				cC@s
tj|S(N(RiRj(tunicode_str((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytbool_from_store	scC@s
t|S(N(Rw(R
((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytint_from_store	stKi
tMitGi	cC@sddjtd}tj|tj}|j|}d}|dk	r|j\}}}t|}|ryt|j	}Wn,t
k
rttdj
|nX||9}qn|S(s[Convert a human readable size in SI units, e.g 10MB into an integer.

    Accepted suffixes are K,M,G. It is case-insensitive and may be followed
    by a trailing b (i.e. Kb, MB). This is intended to be practical and not
    pedantic.

    :return Integer, expanded to its base-10 value if a proper SI unit is 
        found, None otherwise.
    s	^(\d+)(([RMs])b?)?$s{0} is not an SI unit.N(RYt_unit_suffixesRORPRuRvR.tgroupsRwRR)RR{R|(R
tregexpR~RsRlRtunittcoeff((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytint_SI_from_store	s

cC@s
t|S(N(R(R
((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytfloat_from_store	sRsutf-8tlist_valuesRt
ListOptioncB@s&eZdddddZdZRS(cC@sAtt|j|d|d|d|jd|d|dtdS(sA list Option definition.

        This overrides the base class so the conversion from a unicode string
        can take quoting into account.
        RkRRRRRN(RRR RR!(R"R*RkRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 	scC@swt|tstntjtjd|fgtd}t|trm|rd|g}qsg}n|}|S(Nulist=%sRD(RCt
basestringR}t_list_converter_configtresett_parse(R"R
t
maybe_listRp((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR	s	

	N(R,R-R.R R(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR	stRegistryOptioncB@s8eZdZddddZdZedZRS(s$Option for a choice from a registry.c@sStt|j|dfdd|d|jd|d|dt|_dS(	sA registry based Option definition.

        This overrides the base class so the conversion from a unicode string
        can take quoting into account.
        Rkc@s
tjS(N(Rotdefault_key((R(s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR2	sRRRRRN(RRR RR!R(R"R*RRRR((Rs1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 	s
cC@s]t|tstny|jj|SWn*tk
rXtd||jfnXdS(Ns?Invalid value %s for %s.See help for a list of possible values.(RCRR}RRcR)RR*(R"R
((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR	s	
cC@sY|jdg}x:|jjD])}|jd||jj|fqWdj|S(Ns&

The following values are supported:
s	 %s - %s
RM(RRR;RFtget_helpRY(R"tretR&((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR	s'N(R,R-RR.R RR	R(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR	s

	s({[^\d\W](?:\.\w|\w)*})cc@s6t}x)tj|D]}||fV|}qWdS(N(R!t_option_ref_reRR(R@tis_refR^((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytiter_option_refs
stOptionRegistrycB@s5eZdZdZdZdZddZRS(sRegister config options by their name.

    This overrides ``registry.Registry`` to simplify registration by acquiring
    some information from the option object itself.
    cC@s/tjd|dkr+tj|ndS(s\Ensures an option name is valid.

        :param option_name: The name to validate.
        s{%s}N(R"RvR.RTtIllegalOptionName(R"Ra((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_check_option_name
scC@s9|j|jtt|j|j|d|jdS(sxRegister a new option to its name.

        :param option: The option to register. Its name is used as the key.
        RN(R'R*RR%RR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
scC@s-|j|tt|j|||dS(sRegister a new option to be loaded on request.

        :param key: the key to request the option later. Since the registration
            is lazy, it should be provided and match the option name.

        :param module_name: the python path to the module. Such as 'os.path'.

        :param member_name: the member of the module to return.  If empty or 
                None, get() will return the module itself.
        N(R'RR%R(R"R&RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR$
s
cC@s5|j|}|j}t|r1|||S|S(s/Get the help text associated with the given key(RcRR(R"R&Rtthe_help((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 3
s
	
N(R,R-RR'RRR.R (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR%
s
				tappend_revisions_onlyRkRRRfsWhether to only append revisions to the mainline.

If this is set to true, then it is not possible to change the
existing mainline of the branch.
Rs@List of GPG key patterns which are acceptable for verification.
sadd.maximum_file_sizeu20MBsSize above which files should be added manually.

Files below this size are added automatically when using ``bzr add`` without
arguments.

A negative value means disable the size check.
tboundsIs the branch bound to ``bound_location``.

If set to "True", the branch should act as a checkout, and push each commit to
the bound_location.  This option is normally set by ``bind``/``unbind``.

See also: bound_location.
tbound_locations~The location that commits should go to when acting as a checkout.

This option is normally set by ``bind``.

See also: bound.
sbranch.fetch_tagss:Whether revisions associated with tags should be fetched.
sbzr.transform.orphan_policysbzrlib.transformtopt_transform_orphans"bzr.workingtree.worth_saving_limits^How many changes before saving the dirstate.

-1 means that we will never rewrite the dirstate file for only
stat-cache changes. Regardless of this setting, we will always rewrite
the dirstate file if a file is added/removed/renamed/etc. This flag only
affects the behavior of updating the dirstate file after we notice that
a file has been touched.
t
bugtrackersDefault bug tracker to use.

This bug tracker will be used for example when marking bugs
as fixed using ``bzr commit --fixes``, if no explicit
bug tracker was specified.
RsGPG checking policy.

Possible values: require, ignore, check-available (default)

this option will control whether bzr will require good gpg
signatures, ignore them, or check them if they are
present.
tchild_submit_formats3The preferred format of submissions to this branch.tchild_submit_tos/Where submissions to this branch are mailed to.RsGPG Signing policy.

Possible values: always, never, when-required (default)

This option controls whether bzr will always create
gpg signatures or not on commits.
sdirstate.fdatasyncsFlush dirstate changes onto physical disk?

If true (default), working tree metadata changes are flushed through the
OS buffers to physical disk.  This is somewhat slower, but means data
should not be lost if the machine crashes.  See also repository.fdatasync.
RsDebug flags to activate.tdefault_formatt2as#Format used when creating branches.tdpush_strictsThe default value for ``dpush --strict``.

If present, defines the ``--strict`` option default value for checking
uncommitted changes before pushing into a different VCS without any
custom bzr metadata.
teditors:The command called to launch an editor to enter a message.RRRsThe users identityRRsjProgram to use use for creating signatures.

This should support at least the -u and --clearsign options.
Rs]GPG key to use for signing.

This defaults to the first key associated with the users email.
tignore_missing_extensionssaControl the missing extensions warning display.

The warning will not be emitted if set to True.
tlanguages$Language to translate messages into.slocks.steal_deadsSteal locks that appears to be dead.

If set to True, bzr will check if a lock is supposed to be held by an
active process from the same user on the same machine. If the user and
machine match, but no process with the given PID is active, then bzr
will automatically break the stale lock, and create a new lock for
this process.
Otherwise, bzr will prompt as normal to break the lock.
RRsLog format to use when displaying revisions.

Standard log formats are ``long``, ``short`` and ``line``. Additional formats
may be provided by plugins.
tmail_clientsbzrlib.mail_clienttopt_mail_clienttoutput_encodingsAUnicode encoding for output (terminal encoding if not specified).tparent_locationsThe location of the default branch for pull or merge.

This option is normally set when creating a branch, the first ``pull`` or by
``pull --remember``.
RsPost commit functions.

An ordered list of python functions to call, separated by spaces.

Each function takes branch, rev_id as parameters.
tprogress_barsbzrlib.ui.texttopt_progress_bart
public_branchsA publically-accessible version of this branch.

This implies that the branch setting this option is not publically-accessible.
Used and set by ``bzr send``.
t
push_locationsxThe location of the default branch for push.

This option is normally set by the first ``push`` or ``push --remember``.
tpush_strictsThe default value for ``push --strict``.

If present, defines the ``--strict`` option default value for checking
uncommitted changes before sending a merge directive.
srepository.fdatasyncsFlush repository changes onto physical disk?

If true (default), repository changes are flushed through the OS buffers
to physical disk.  This is somewhat slower, but means data should not be
lost if the machine crashes.  See also dirstate.fdatasync.
tsmtp_serversbzrlib.smtp_connectiont
smtp_passwordt
smtp_usernamesselftest.timeoutt600s>Abort selftest if one test takes longer than this many secondstsend_strictsThe default value for ``send --strict``.

If present, defines the ``--strict`` option default value for checking
uncommitted changes before sending a bundle.
sserve.client_timeoutgr@siIf we wait for a new request from a client for more than X seconds, consider the client idle, and hangup.tstacked_on_locations-The location where this branch is stacked on.t
submit_branchsThe branch you intend to submit your current work to.

This is automatically set by ``bzr send`` and ``bzr merge``, and is also used
by the ``submit:`` revision spec.
t	submit_tos1Where submissions from this branch are mailed to.Rs$List of warning classes to suppress.Rs*Whether to validate signatures in bzr log.sssl.ca_certss'bzrlib.transport.http._urllib2_wrapperstopt_ssl_ca_certss
ssl.cert_reqstopt_ssl_cert_reqsRcB@s8eZdZdZdedZdZdZRS(sA section defines a dict of option name => value.

    This is merely a read-only dict which can add some knowledge about the
    options. It is *not* a python dict object though and doesn't try to mimic
    its API.
    cC@s||_||_dS(N(tidtoptions(R"t
section_idRJ((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR ys	cC@s|jj||S(N(RJRc(R"R*RkR_((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRc~scc@s#x|jjD]}|VqWdS(N(RJtiterkeys(R"Rr((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytiter_option_namesscC@sd|jj|jfS(Ns<config.%s id=%s>(t	__class__R,RI(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt__repr__sN(	R,R-RR R.RQRcRMRO(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRqs
		tMutableSectioncB@s;eZdZdZdZdZdZdZRS(sDA section allowing changes and keeping track of the original values.cC@s'tt|j|||jdS(N(RRPR t
reset_changes(R"RKRJ((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@s[||jkrt|j|<n+||jkrJ|j|d|j|<n||j|<dS(N(RJt_NewlyCreatedOptiontorigRcR.(R"R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@sH||jkr:||jkr:|j|d|j|<n|j|=dS(N(RSRJRcR.(R"R*((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
i|_dS(N(RS(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRQsc
C@sx|jjD]\}}|j|t}|j|t}|tkrn||jkr~|j|q~n|j||||kr|tkrd}n|tkrd}n|tkrd}ntj	t
dj||j|j
|||qqW|jdS(s(Apply option value changes.

        ``self`` has been reloaded from the persistent storage. ``dirty``
        contains the changes made since the previous loading.

        :param dirty: the mutable section containing the changes.

        :param store: the store containing the section
        s	<DELETED>s	<CREATED>sZOption {0} in section {1} of {2} was changed from {3} to {4}. The {5} value will be saved.N(RSRRct_DeletedOptionRRRJRRReRfR{R|RIRRQ(R"tdirtyRCRrtexpectedtactualtreloaded((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
apply_changess&
				(R,R-RR RRRQRY(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRPs				tStorecB@seZdZeZeZdZdZdZ	dZ
dZdZdZ
dZd	Zd
ZdZdZd
ZddZdZRS(sCAbstract interface to persistent storage for configuration options.cC@s
i|_dS(N(tdirty_sections(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@st|jdS(sReturns True if the Store has been loaded.

        This is used to implement lazy loading and ensure the persistent
        storage is queried only when needed.
        N(R0t	is_loaded(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR\scC@st|jdS(s(Loads the Store from persistent storage.N(R0R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@st|jdS(syCreate a store from a string in configobj syntax.

        :param bytes: A string representing the file content.
        N(R0t_load_from_string(R"tbytes((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR]scC@st|jdS(sUnloads the Store.

        This should make is_loaded() return False. This is used when the caller
        knows that the persistent storage has changed or may have change since
        the last load.
        N(R0tunload(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR_scC@s|S(sQuote a configuration option value for storing purposes.

        This allows Stacks to present values as they will be stored.
        ((R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytquotescC@s|S(slUnquote a configuration option value into unicode.

        The received value is quoted as stored.
        ((R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@st|jdS(s&Saves the Store to persistent storage.N(R0R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s+x$|jjD]}|jrtSqWtS(N(R[RRSRQR!(R"RJ((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_need_savings	cC@sS|jx9|jD]+\}}|j|}|j||qWi|_dS(s)Apply changes from dirty sections while checking for coherency.

        The Store content is discarded and reloaded from persistent storage to
        acquire up-to-date values.

        Dirty sections are MutableSection which kept track of the value they
        are expected to update.
        N(R_Rtget_mutable_sectionRYR[(R"R[RKRUtclean((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRYs

cC@st|jdS(sSaves the Store to persistent storage if changes occurred.

        Apply the changes recorded in the mutable sections to a store content
        refreshed from persistent storage.
        N(R0tsave_changes(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRd#scC@st|jdS(N(R0R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR+scC@st|jdS(snReturns an ordered iterable of existing sections.

        :returns: An iterable of (store, section).
        N(R0tget_sections(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRe.scC@st|jdS(sbReturns the specified mutable section.

        :param section_id: The section identifier
        N(R0Rb(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRb5scC@sd|jj|jfS(Ns<config.%s(%s)>(RNR,R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRO<sN(R,R-RRtreadonly_section_classRPtmutable_section_classR R\RR]R_R`RRRaRYRdRReR.RbRO(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRZs$														tCommandLineStorecB@s>eZdZddZdZdZdZdZRS(s?A store to carry command line overrides for the config options.cC@s>tt|j|dkr(i}ni|_d|_dS(Ntcmdline(RRhR R.RJRI(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR Es
		cC@s|jjdS(N(RJtclear(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_resetLscC@sx|jxg|D]_}y|jdd\}}Wn-tk
rbtjtd|fnX||j|<qWdS(Nt=is0Invalid '%s', should be of the form 'name=value'(RkRRRRTtBzrCommandErrorR{RJ(R"t	overridestoverR*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
_from_cmdlinePs


	cC@sdS(NRi((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR\scc@s||jd|jfVdS(N(RfR.RJ(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyReasN(	R,R-RR.R RkRpRRe(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRhBs			tIniFileStorecB@seZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZddZdZd
ZdZRS(sA config Store using ConfigObj for storage.

    :ivar _config_obj: Private member to hold the ConfigObj instance used to
        serialize/deserialize the config file.
    cC@s tt|jd|_dS(s4A config Store using ConfigObj for storage.
        N(RRqR R.t_config_obj(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR lscC@s
|jdkS(N(RrR.(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR\rscC@sd|_i|_dS(N(R.RrR[(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR_us	cC@st|jdS(sqLoad the config file bytes.

        This should be provided by subclasses

        :return: Byte string
        N(R0t
_load_content(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsyscC@st|jdS(sSave the config file bytes.

        This should be provided by subclasses

        :param content: Config file bytes to write
        N(R0t
_save_content(R"tcontent((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRtscC@sL|jrdS|j}|j|xtdD]}||q4WdS(s(Load the store from the associated file.NR(R\RsR]R(R"RuRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@s|jr%td|jfnt|}yt|dddt|_Wn_tjk
r}d|_t	j
|j	|jn&tk
rt	j
|jnXdS(slCreate a config store from a string.

        :param bytes: A string representing the file content.
        sAlready loaded: %rRsutf-8RN(R\RRrRRR!RRR.RTRRRR(R"R^RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR]s	
cC@sP|jsdS|js dSt|jj}|j||jdS(N(R\RaRdR[RRYR(R"R[((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRds
cC@s_|jsdSt}|jj||j|jxtdD]}||qGWdS(NR(R\RRrRRttgetvalueR(R"toutRh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs	cc@sy|jWntjtjfk
r.dSX|j}|jr[||jd|fVnx,|jD]!}||j|||fVqeWdS(siGet the configobj section in the file order.

        :returns: An iterable of (store, section).
        N(	RRTRRRrtscalarsRfR.R(R"tcobjR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRes			cC@sy|jWn!tjk
r1|jdnX||jkrL|j|S|dkrd|j}n|jj|i}|j||}||j|<|S(NRM(	RRTRR]R[R.RrR Rg(R"RKR%tmutable_section((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRbs
cC@s4z t|j_|jj|SWdt|j_XdS(N(RQRrRRR!(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR`scC@s.|r*t|tr*|jj|}n|S(N(RCRRrt_unquote(R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@sdS(NsIn-Process Store, no URL((R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsN(R,R-RR R\R_RsRtRR]RdRReR.RbR`RR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRqes												
			tTransportIniFileStorecB@s2eZdZdZdZdZdZRS(sIniFileStore that loads files from a transport.

    :ivar transport: The transport object where the config file is located.

    :ivar file_name: The config file basename in the transport directory.
    cC@s)tt|j||_||_dS(sA Store using a ini file on a Transport

        :param transport: The transport object where the config file is located.
        :param file_name: The config file basename in the transport directory.
        N(RR|R RR(R"RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
s	cC@sKy|jj|jSWn-tjk
rFtjd|jnXdS(Ns>Permission denied while trying to load configuration store %s.(RRRRTRReRfR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
s	
cC@s|jj|j|dS(N(Rt	put_bytesR(R"Ru((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRt
scC@stj|jj|jS(N(RRYRRR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s(R,R-RR RsRtR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR|s
	
		tLockableIniFileStorecB@sPeZdZddZddZdZdZedZ	dZ
RS(s?A ConfigObjStore using locks on save to ensure store integrity.cC@sV|dkrd}n||_tt|j||tj|j|j|_dS(sA config Store using ConfigObj for storage.

        :param transport: The transport object where the config file is located.

        :param file_name: The config file basename in the transport directory.
        RN(	R.t
lock_dir_nameRR~R RR	RR(R"RRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR (
s
		cC@s|jj|jj|S(sTakes a write lock in the directory containing the config file.

        If the directory doesn't exist it is created.
        (Rt
create_prefixRR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR5
s
cC@s|jjdS(N(RR
(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
@
scC@s|jjdS(N(RR(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRC
scC@s|jdS(N(tsave_without_locking(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRF
scC@stt|jdS(N(RR~R(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRK
sN(R,R-RR.R RR
RRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR~%
s
		tGlobalStorecB@seZdZddZRS(s_A config store for global options.

    There is a single GlobalStore for a given process.
    cC@s>tjtd|}tt|j|dd|_dS(Ntpossible_transportssbazaar.confR(RRR^RRR RI(R"Rtt((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR ]
sN(R,R-RR.R (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRW
st
LocationStorecB@seZdZddZRS(sqA config store for options specific to a location.

    There is a single LocationStore for a given process.
    cC@s>tjtd|}tt|j|dd|_dS(NRslocations.confR/(RRR^RRR RI(R"RR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR j
sN(R,R-RR.R (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRd
stBranchStorecB@seZdZdZRS(s^A config store for branch options.

    There is a single BranchStore for a given branch.
    cC@s2tt|j|jd||_d|_dS(Nsbranch.confRH(RRR tcontrol_transportRHRI(R"RH((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR w
s	(R,R-RR (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRq
stControlStorecB@seZdZRS(cC@s/tt|j|jdddd|_dS(Nscontrol.confRtbranch_locktcontrol(RRR RRI(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
s(R,R-R (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR~
stSectionMatchercB@s)eZdZdZdZdZRS(sSelect sections into a given Store.

    This is intended to be used to postpone getting an iterable of sections
    from a store.
    cC@s
||_dS(N(RC(R"RC((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
scc@sG|jj}x1|D])\}}|j|r||fVqqWdS(N(RCReRv(R"RRCRJ((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRe
scC@st|jdS(sDoes the proposed section match.

        :param section: A Section object.

        :returns: True if the section matches, False otherwise.
        N(R0Rv(R"R%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRv
s(R,R-RR ReRv(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s			tNameMatchercB@seZdZdZRS(cC@s#tt|j|||_dS(N(RRR RK(R"RCRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
scC@s|j|jkS(N(RIRK(R"R%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRv
s(R,R-R Rv(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s	tLocationSectioncB@s#eZddZdedZRS(cC@shtt|j|j|j||_|dkr=d}ni|d6tj|d6|d6|_	dS(NRMtrelpathtbasenamet
branchname(
RRR RIRJRR.RRtlocals(R"R%Rtbranch_name((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
s		
cC@stt|j||}|dk	r|r|j|dd}tj|t}|tkrytj||j	}ng}xpt
|D]b\}}	|s|j|	q|	dd!}
|
|jkr|j|j|
q|j|	qWdj|}n|S(Ns:policyiiRM(
RRRcR.R8RRRRYRR$RFR(R"R*RkR_RKR:RR[R#R^tref((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRc
s 
N(R,R-R.R RQRc(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s	tStartingPathMatchercB@s eZdZdZdZRS(s@Select sections for a given location respecting the Store order.cC@sDtt|j||jdr7tj|}n||_dS(Nsfile://(RRR RRR#R&(R"RCR&((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR 
sc	c@s|jjdjd}|j}g}xtt|jD]\}}|jdkr{|t	||jfVqCn|j}|j
drtj|}n|jj
|st
j
|j|rC|jdjd}dj|t|}|t	||fVqCqCWdS(sGGet all sections matching ``location`` in the store.

        The most generic sections are described first in the store, then more
        specific ones can be provided for reduced scopes.

        The returned section are therefore returned in the reversed order so
        the most specific ones can be found first.
        R!sfile://N(R&R"RRRCtreversedRDReRIR.RRRR#R%RYRS(	R"R'RCRRR%R(R)R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRe
s		%	(R,R-RR Re(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s
	tLocationMatchercB@s#eZdZdZdZRS(cC@stt|j|tj|\}}|jdrLtj|}n||_|jd}|dkrtj
|j|_ntj||_dS(Nsfile://RH(
RRR Rtsplit_segment_parametersRR#R&RcR.RRR[(R"RCR&turltparamsR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s	cC@s+d}g}xB|jjD]1\}}|jdkr@|}q|j|qWtg|D]}|j^q[|j}t|}g}|dk	r|jdt||jfnxk|D]c\}	}
}xQt	r"|j
}|	|jkrt||
|j}|j||fPqqWqW|S(s'Get all sections matching ``location``.iN(R.RCReRIRFR,R&titerRRQtnextR(R"tno_name_sectiontall_sectionsRR%RJtfiltered_sectionstiter_all_sectionstmatching_sectionsRKRR1((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s,	%		cc@s|j}t|dddt}x\|D]T\}}|jdd}|dk	rjtj|}n|rtPn|j|fVq.WdS(NR&cS@s|\}}||jfS(N(RI(R0R1R%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR26sR3R4(RtsortedRQRcR.RiRjRC(R"RRRR%R
((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRe1s			(R,R-R RRe(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
s		$tStackcB@seZdZd
d
dZdZeedZd
dZd
d
dZ	dZ
dZdZd	Z
d
ZdZd
dZRS(s8A stack of configurations where an option can be definedcC@s||_||_||_dS(sNCreates a stack of sections with an optional store for changes.

        :param sections_def: A list of Section or callables that returns an
            iterable of Section. This defines the Sections for the Stack and
            can be called repeatedly if needed.

        :param store: The optional Store where modifications will be
            recorded. If none is specified, no modifications can be done.

        :param mutable_section_id: The id of the MutableSection where changes
            are recorded. This requires the ``store`` parameter to be
            specified.
        N(tsections_defRCtmutable_section_id(R"RRCR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR Ls		cc@s=x6|jD]+}x"|D]\}}||fVqWq
WdS(s!Iterate all the defined sections.N(R(R"RRCR%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
iter_sections^sc	@s@d}dytjWntk
r8dnXfd}dk	rjrj}||}n|dkrx?jD]1\}}|j}|dk	r|PqqW||}dk	r|dkrj}||}qnx"tdD]}||q"W|S(sReturn the *first* option value found in the sections.

        This is where we guarantee that sections coming from Store are loaded
        lazily: the loading is delayed until we need to either check that an
        option exists or get its value, which in turn may require to discover
        in which sections it can be defined. Both of these (section and option
        existence) require loading the store (even partially).

        :param name: The queried option.

        :param expand: Whether options references should be expanded.

        :param convert: Whether the option value should be converted from
            unicode (do nothing for non-registered options).

        :returns: The value of the option.
        c@s|dk	rrSt|tr3j|}qStjdt|fndkrqj|}qrj|}qn|S(Ns8Cannot expand "%s": %s does not support option expansion(	R.RCRR?ReRfRRR(Rl(tconvertR_tfound_storeR*toptR"(s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytexpand_and_converts	RcN(	R.toption_registryRcR)RRRRR(	R"R*R_RRKRRCR%Rh((RR_RR*RR"s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRchs.

cC@s|j||S(s/Expand option references in the string in the configuration context.

        :param string: The string containing option(s) to expand.

        :param env: An option dict defining additional configuration options or
            overriding existing ones.

        :returns: The expanded string.
        (R?(R"R@RA((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRBs
cC@s|dkrdS|dkr%g}n|}t}x|rt}g}xt|D]\}}|su|j|qSt}|dd!}	|	|krtj||n|j|	|j|	||}
|
dkrtj|	|n|j|
|j	qSWdj
|}q4W|S(sExpand options in the string in the configuration context.

        :param string: The string to be expanded.

        :param env: An option dict defining additional configuration options or
            overriding existing ones.

        :param _refs: Private list (FIFO) containing the options being expanded
            to detect loops.

        :returns: The expanded string.
        iiRMN(R.RQR!R$RFRTRURVRWRXRY(R"R@RAt_refsRItexpandedR[R#R^R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR?s0
		


cC@sY|dk	r%||kr%||}n0|j|dtdt}|j|||}|S(NR_R(R.RcR!R?(R"R*RARRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRVs

cC@s%|j}|j|j}||fS(sPGet the MutableSection for the Stack.

        This is where we guarantee that the mutable section is lazily loaded:
        this means we won't load the corresponding store before setting a value
        or deleting an option. In practice the store will often be loaded but
        this helps catching some programming errors.
        (RCRbR(R"RCR%((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_mutable_sections	cC@sT|j\}}|j||j|x"tdD]}||||q6WdS(sSet a new value for the option.RN(RRR`R(R"R*RKRCR%Rh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@sE|j\}}|j|xtdD]}|||q*WdS(sRemove an existing option.RN(RRR(R"R*RR%Rh((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
cC@sd|jjt|fS(Ns<config.%s(%s)>(RNR,RI(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyROscC@s#tjdk	rtjjjSgS(N(R3tglobal_stateR.tcmdline_overridesRe(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_get_overrides	sc@s|dkrtj}n|dkrdtfd}tsmddl}|j|taqmn	|j|j	}y|SWnt
k
r||<|SXdS(s}Get a known shared store.

        Store urls uniquely identify them and are used to ensure a single copy
        is shared across all users.

        :param store: The store known to the caller.

        :param state: The library state where the known stores are kept.

        :returns: The store received if it's not a known one, an already known
            otherwise.
        c@s+x$jD]\}}|jq
WdS(N(RRd(RrRC(tstores(s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytsave_config_changes!siN(R.R3Rt_shared_storest _shared_stores_at_exit_installedtatexitRRQt
config_storesRR)(R"RCtstateRRR((Rs1/usr/lib/python2.7/dist-packages/bzrlib/config.pytget_shared_stores 

	

N(R,R-RR.R RRQRcRBR?RVRRRRORR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRIs	
B+	
					tMemoryStackcB@seZdZddZRS(sxA configuration stack defined from a string.

    This is mainly intended for tests and requires no disk resources.
    cC@sHt}|dk	r%|j|ntt|j|jg|dS(sLCreate an in-memory stack from a given content.

        It uses a single store based on configobj and support reading and
        writing options.

        :param content: The initial content of the store. If None, the store is
            not loaded and ``_load_from_string`` can and should be used if
            needed.
        N(RqR.R]RRR Re(R"RuRC((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR :s

	N(R,R-RR.R (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR4st_CompatibleStackcB@s eZdZdZdZRS(sNPlace holder for compatibility with previous design.

    This is intended to ease the transition from the Config-based design to the
    Stack-based design and should not be used nor relied upon by plugins.

    One assumption made here is that the daughter classes will all use Stores
    derived from LockableIniFileStore).

    It implements set() and remove () by re-loading the store before applying
    the modification and saving it.

    The long term plan being to implement a single write by store to save
    all modifications, this class should not be used in the interim.
    cC@s7|jjtt|j|||jjdS(N(RCR_RRRR(R"R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR[s
cC@s4|jjtt|j||jjdS(N(RCR_RRRR(R"R*((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRbs
(R,R-RRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRKs	tGlobalStackcB@seZdZdZRS(sGlobal options only stack.

    The following sections are queried:

    * command-line overrides,

    * the 'DEFAULT' section in bazaar.conf

    This stack will use the ``DEFAULT`` section in bazaar.conf as its
    MutableSection.
    cC@sJ|jt}tt|j|jt|djg|dddS(NR(R(RRRRR RRRe(R"tgstore((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR ws
(R,R-RR (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRjst
LocationStackcB@seZdZdZRS(sPer-location options falling back to global options stack.


    The following sections are queried:

    * command-line overrides,

    * the sections matching ``location`` in ``locations.conf``, the order being
      defined by the number of path components in the section glob, higher
      numbers first (from most specific section to most generic).

    * the 'DEFAULT' section in bazaar.conf

    This stack will use the ``location`` section in locations.conf as its
    MutableSection.
    cC@s|jt}|jdr3tj|}n|jt}tt|j|j	t
||jt|djg|d|dS(sdMake a new stack for a location and global configuration.

        :param location: A URL prefix to sfile://R(RN(
RRRRR#RRRR RRReR(R"R&tlstoreR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s(R,R-RR (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRstBranchStackcB@sJeZdZdZddZdZedZedZ	RS(s*Per-location options falling back to branch then global options stack.

    The following sections are queried:

    * command-line overrides,

    * the sections matching ``location`` in ``locations.conf``, the order being
      defined by the number of path components in the section glob, higher
      numbers first (from most specific section to most generic),

    * the no-name section in branch.conf,

    * the ``DEFAULT`` section in ``bazaar.conf``.

    This stack will use the no-name section in ``branch.conf`` as its
    MutableSection.
    cC@s|jt}|j}|jt}tt|j|jt||j	j
t|dj
t|dj
g|||_
dS(NR((RRt_get_config_storeRRRR RRRNReRR.RH(R"RHRtbstoreR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR scC@s|jj|S(N(RHR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jjS(N(RHR
(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
scC@stt|j||dS(N(RRR(R"R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@stt|j|dS(N(RRR(R"R*((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsN(
R,R-RR R.RR
RRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs		tRemoteControlStackcB@seZdZdZRS(s"Remote control-only options stack.cC@sA|j}tt|jt|djg|||_dS(N(RRRR RR.ReR(R"Rtcstore((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s
(R,R-RR (((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRstBranchOnlyStackcB@sJeZdZdZddZdZedZedZ	RS(sBranch-only options stack.cC@sA|j}tt|jt|djg|||_dS(N(RRRR RR.ReRH(R"RHR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR s
cC@s|jj|S(N(RHR(R"R((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s
|jjS(N(RHR
(R"((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR
scC@s*tt|j|||jjdS(N(RRRRCRd(R"R*RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@s'tt|j||jjdS(N(RRRRCRd(R"R*((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsN(
R,R-RR R.RR
RRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs		t
cmd_configcB@seZdZdgZdejddddeejdddejd	dd
gZdgZej	deddedZded
Z
dZdZdZdZdZRS(sDisplay, set or remove a configuration option.

    Display the active value for option NAME.

    If --all is specified, NAME is interpreted as a regular expression and all
    matching options are displayed mentioning their scope and without resolving
    option references in the value). The active value that bzr will take into
    account is the first one displayed for each option.

    If NAME is not given, --all .* is implied (all options are displayed for the
    current scope).

    Setting a value is achieved by using NAME=value without spaces. The value
    is set in the most relevant scope and can be checked by displaying the
    option again.

    Removing a value is achieved by using --remove NAME.
    sname?t	directorytscopeRs5Reduce the scope to the specified configuration file.Rtalls8Display all the defined values for the matching options.Rs.Remove the option from the configuration file.t
configurationcC@s#|dkrd}ntjj|}tj|}|rT|rTtjdn|rp|j|||n|dkr|j	d||ny|j
dd\}}Wn@tk
r|r|j	|||q|j|||n/X|r	tjdn|j
||||dS(NRs*--all and --remove are mutually exclusive.s.*RlisOnly one option can be set.(R.tdirectory_servicetdirectoriestdereferenceRt
normalize_urlRTRt_remove_config_optiont_show_matching_optionsRRRt_show_valuet_set_config_option(R"R*RRRRRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pytrun)s*	
cC@s|dk	r|dkrtS|dkr5t|S|dkrtjj|\}}}|r{|j|jjn|j	St
j|nfyHtjj|\}}}|r|j|jjn|j	SWnt
jk
rt|SXdS(s-Get the configuration stack specified by ``directory`` and ``scope``.

        :param directory: Where the configurations are derived from.

        :param scope: A specific config to start from.

        :param write_access: Whether a write access to the stack will be
            attempted.
        RR/RHN(
R.RRt
controldirt
ControlDirtopen_containing_tree_or_branchtadd_cleanupRR
tget_config_stackRTtNoSuchConfigtNotBranchError(R"RRtwrite_accessRtbr((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt
_get_stackIs(

	
	cC@s!d|krd|d}n|S(Ns
s"""((R"RK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt_quote_multilinenscC@su|j||}|j|dtdt}|dk	rb|j|}|jjd|fntj	|dS(NR_Rs%s
(
RRcRQR!R.RtoutfRRTR(R"R*RRRRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRsscC@s>tj|}|jd}d}|j||}x|jD]\}}x|jD]}	|j|	r]||jkr|j	j
d|jf|j}d}n|jdk	r||jkr|j	j
d|jf|j}n|j|	dt}
|j
|
}
|j	j
d|	|
fq]q]WqDWdS(Ns%s:
s  [%s]
R_s
  %s = %s
(Rtlazy_compilet_compile_and_collapseR.RRRMtsearchRIRRRcR!R(R"R*RRtcur_store_idtcur_sectionRRCR%RRK((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyR}s$
		cC@s,|j||dt}|j||dS(NR(RRQR(R"R*RKRRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRscC@sn|dkrtjdn|j||dt}y|j|Wn tk
ritj|nXdS(Ns%--remove expects an option to remove.R(R.RTRmRRQRR)R(R"R*RRR((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs
N(R,R-Rt
takes_argsRRRot
takes_optionst	_see_alsotdisplay_commandR.R!RRRRRRR(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyRs$		%		
		(Rt
__future__Rt	cStringIORRR7R3tbzrlib.decoratorsRtbzrlib.lazy_importRtglobalsRRRRtbzrlib.symbol_versioningRR	RRRRRRRRRR.R=R8R@RARBRTRVRRRRtobjectR/tHooksRRRRgRRRR,R-RDRR^RR.RmRnRqRtR}RRRRRMRtRegistryRRRRRRRRRRRRRdRRRRQR!RRRRR"R$R%RRRRRRTRPRZRhRqR|R~RRRRRRRRRRRRRRRRRRRtCommandRttest_store_builder_registryttest_stack_builder_registry(((s1/usr/lib/python2.7/dist-packages/bzrlib/config.pyt<module>Is4	"

		 	 	JO	4	!						
		=			)$T	
		
&b		'		%$		0		
	
	
	
	


	

	
	
	





	

	
	

	



	
	

	
	


	
	
	
	

	
	
	
	
	

	
	
		?s#,2


	
"/G!2!

Copyright © 2017 || Recoded By Mr.Bumblebee