-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/ui.pyc


l\c@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZdefdYZdS(i(t_N(thextuicBs3eZd3dZdZdZdZd3ed3d3dZd3d3dZ	dZ
dZdd	Zd
Z
edZd3edZd3ed
ZeedZd3edZdedZd3edZedZedZedZd3dZdZdZd3dZedZedZdZdZdZ dZ!d Z"d!Z#d"Z$dd#Z%d$d%Z&e'd&Z(dd'Z)d3d3d(Z*d)Z+d*Z,d+Z-d,Z.id-Z/d3ed.Z0d/Z1ddd3d0Z2d1Z3d2Z4RS(4cCsg|_g|_t|_|_|_|_t|_t	j	|_
t	j	|_t	j	|_t
|_t
|_t|_|r0|j|_|j|_|j|_|jj|_|jj|_|j
j|_
|jj|_|jj|_|j|_|j|_|jnZtj|_tj|_tj|_tj|_x'tjD]}|j|dtqmWdS(Nttrust(t_bufferst
_bufferstatestFalsetquiettverboset	debugflagt
tracebackflagtTruet_reportuntrustedtconfigt_ocfgt_tcfgt_ucfgtsett_trustuserst_trustgroupst	callhookstfouttferrtfintcopytenviront	fixconfigtsyststdouttstderrtstdintostscmutiltrcpatht
readconfig(tselftsrctf((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt__init__s8				
cCs
|j|S(N(t	__class__(R#((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR4scCstj|||S(N(t	formatter(R#ttopictopts((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR(7scCstj|}tj|r"tS|j|j}}d|ksMd|krQtStj|j}tj|j	}||ks||ks|tjkrtS|j
r|jtd|||fnt
S(Nt*s6not trusting file %s from untrusted user %s, group %s
(tutiltfstattisownerRRRtusernametst_uidt	groupnametst_gidRtwarnRR(R#tfpR%tstttusersttgroupstusertgroup((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt_trusted:s*	cCsyt|}Wntk
r0|s*dSnXtj}|pX|pX|j||}y*|j||d|d||jWn?tjk
r}	|rn|jt	dt
|	nX|jr0x,dD]$}
|
|dkr|d|
=qqWx+|jd
D]\}
}|d
|
=qWn|jdrmx+|jdD]\}
}|d|
=qOWn|r|j
j||j
j|jn|jj||jj|j|dkrtjjd}n|jd|dS(Ntsectionstremapsignored: %s
tdebugtfallbackencodingRtslashtlogtemplatetstylet	tracebackRRtdefaultstaliast~troot(sdebugR>squietsslashR@RAs	tracebacksverbose(topentIOErrorR
R:treadtcloseterrortConfigErrorR3RtstrtplaintitemsRtupdateRRtNoneRtpatht
expanduserR(R#tfilenameRFRR;R<R4tcfgttrustedtinsttktv((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR"MsD
!
c	Cs0|dkr&|ptj}x|j|j|jfD]}x|jdD]\}}|seqMnd|kr|jtd|||j	d|f|j
dd}ntj|}tj
|rtjj|rtjjtjj||}n|jd||qMWq7Wn|dkr|jdd|_|jp_|jdd|_|jo~|jdd|_|jr|jrt|_|_n|jp|jdd	t|_|jdd
t|_n|dkr,|jj|jdd|jj|jdd
ndS(Ntpathss%%s((deprecated '%%' in path %s=%s from %s)
t%RR=RRtreport_untrustedRBRVtuserstgroups(Nspaths(Nsui(Nstrusted(RQRtgetcwdRRRROR3RtconfigsourcetreplaceR,t
expandpatht	hasschemeRRtisabstnormpathtjoinRt
configboolR	RRRRRR
RRPt
configlistR(R#RFtsectiontctntp((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRxs4#$cCs:|jj|||jj|||jj||fS(N(RtbackupRR(R#Rititem((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytbackupconfigscCs@|jj|d|jj|d|jj|ddS(Niii(RtrestoreRR(R#tdata((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt
restoreconfigstcCsMx6|j|j|jfD]}|j||||qW|jd|dS(NRi(RRRRR(R#RitnametvaluetsourceRU((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt	setconfigscCs|r|jp|jS(N(RR(R#t	untrusted((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt_datascCs|j|j||pdS(Ntnone(RyRv(R#RiRtRx((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR`sc	Cst|tr|}n	|g}xH|D]:}|j|j||d}|dk	r(|}Pq(q(W|}|jr|r|jrx[|D]P}|jj||}|dk	r||kr|jd|||fqqWn|S(Ns3ignoring untrusted configuration option %s.%s = %s
(	t
isinstancetlistRytgetRQR	RRR=(	R#RiRttdefaultRxt
alternatesRkRutuvalue((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR
s 		

	cCs|j||||}|dkr(dStjj|sGd|kr|j|||}d|krtjj|jdd}tjj|tjj	|}qn|S(sEget a path config item, expanded relative to repo root or config files://t:iN(
R
RQRRRRdR`tdirnametrsplitRfRS(R#RiRtR~RxRYR$tbase((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt
configpaths'cCs|j||d|}|dkr(|St|tr;|Stj|}|dkr{tjtd|||fn|S(sPparse a configuration element as a boolean

        >>> u = ui(); s = 'foo'
        >>> u.setconfig(s, 'true', 'yes')
        >>> u.configbool(s, 'true')
        True
        >>> u.setconfig(s, 'false', 'no')
        >>> u.configbool(s, 'false')
        False
        >>> u.configbool(s, 'unknown')
        False
        >>> u.configbool(s, 'unknown', True)
        True
        >>> u.setconfig(s, 'invalid', 'somevalue')
        >>> u.configbool(s, 'invalid')
        Traceback (most recent call last):
            ...
        ConfigError: foo.invalid is not a boolean ('somevalue')
        s%s.%s is not a boolean ('%s')N(	R
RQR{tboolR,t	parseboolRKRLR(R#RiRtR~RxRYtb((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRgscCsp|j||d|}|dkr(|Syt|SWn3tk
rktjtd|||fnXdS(s
parse a configuration element as an integer

        >>> u = ui(); s = 'foo'
        >>> u.setconfig(s, 'int1', '42')
        >>> u.configint(s, 'int1')
        42
        >>> u.setconfig(s, 'int2', '-42')
        >>> u.configint(s, 'int2')
        -42
        >>> u.configint(s, 'unknown', 7)
        7
        >>> u.setconfig(s, 'invalid', 'somevalue')
        >>> u.configint(s, 'invalid')
        Traceback (most recent call last):
            ...
        ConfigError: foo.invalid is not an integer ('somevalue')
        s%s.%s is not an integer ('%s')N(R
RQtintt
ValueErrorRKRLR(R#RiRtR~RxRY((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt	configints
icCs|j||}|dkr:t|ts1|S|}nytj|SWn6tjk
rtjt	d|||fnXdS(sparse a configuration element as a quantity in bytes

        Units can be specified as b (bytes), k or kb (kilobytes), m or
        mb (megabytes), g or gb (gigabytes).

        >>> u = ui(); s = 'foo'
        >>> u.setconfig(s, 'val1', '42')
        >>> u.configbytes(s, 'val1')
        42
        >>> u.setconfig(s, 'val2', '42.5 kb')
        >>> u.configbytes(s, 'val2')
        43520
        >>> u.configbytes(s, 'unknown', '7 MB')
        7340032
        >>> u.setconfig(s, 'invalid', 'somevalue')
        >>> u.configbytes(s, 'invalid')
        Traceback (most recent call last):
            ...
        ConfigError: foo.invalid is not a byte quantity ('somevalue')
        s#%s.%s is not a byte quantity ('%s')N(
R
RQR{RMR,t	sizetointRKt
ParseErrorRLR(R#RiRtR~RxRu((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytconfigbytess	csfdfdfd|j||d|}|dkrf|p`g}nt|tr|jd}|dkr|pg}qn|S(sparse a configuration element as a list of comma/space separated
        strings

        >>> u = ui(); s = 'foo'
        >>> u.setconfig(s, 'list1', 'this,is "a small" ,test')
        >>> u.configlist(s, 'list1')
        ['this', 'is', 'a small', 'test']
        cs$t}xF|t|krN||js;||dkrNt}|d7}q	W|t|krnd||fS|r|jdn||dkr|dr||dfS||dkr|dddkr|dd |||d<||dfS|dc||7<||dfS(Nt,iRst"is\(RtlentisspaceRRQtappend(tpartststoffsett
whitespace(t_parse_plaint_parse_quote(s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR7s5
$csN|t|kr||dkr|jd|d7}x@|t|kr{||jsn||dkr{|d7}q<W||fSx|t|kr&||dkr&||dkr|dt|kr||ddkr|d7}|dcd7<n|dc||7<|d7}qW|t|kr|d}|s\d|d<n)d|d|d<|d }|j|d||fS|d7}x0|t|kr||d	kr|d7}qW|t|kr4|dt|kr$||dkr$|dcd7<|d7}qA|jdn
d||fS||fS(
NRRsiRs\iit (RR(RRRtextendRQ(RRRt
real_parts(t_configlistR(s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRHs@"

%
%&





%&

cs\|jd}|sgSdgd}}}x%|rW||||\}}}q3W|S(Ns ,Rsi(trstrip(RtparserRR(R(s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRss	Rxs ,
N(R
RQR{t
basestringtlstrip(R#RiRtR~Rxtresult((RRRs0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRh-s
+	cCs||j|kS(s&tell whether section exists in config.(Ry(R#RiRx((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pythas_sectionscCs|j|j|}|jr|r|jrx[|jj|D]D\}}|jj|||krD|jd|||fqDqDWn|S(Ns3ignoring untrusted configuration option %s.%s = %s
(RyROR	RRRR}R=(R#RiRxRORXRY((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytconfigitemss	ccs[|j|}xE|jD]7}x.|j||D]\}}|||fVq5WqWdS(N(RyR;R(R#RxRURiRtRu((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt
walkconfigscCs`dtjkr"dtjkr"tStjjddjjd}|r\|r\||kStS(s'is plain mode active?

        Plain mode means that all configuration variables which affect
        the behavior and output of Mercurial should be
        ignored. Additionally, the output should be stable,
        reproducible and suitable for use in scripts or applications.

        The only way to trigger plain mode is by setting either the
        `HGPLAIN' or `HGPLAINEXCEPT' environment variables.

        The return value can either be
        - False if HGPLAIN is not set, or feature is in HGPLAINEXCEPT
        - True otherwise
        tHGPLAINt
HGPLAINEXCEPTRsR(RRRR}tstriptsplitR(R#tfeaturet
exceptions((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRNs$
cCsztjjd}|dkrZ|jdddg}|dk	rZtjj|}qZn|dkr{tjjd}n|dkr|jddr|jt	ddd}n|dkr|j
ry7d	tjt
jf}|jt	d
|Wqtk
rqXn|sHtjt	ddt	d
nd|krvtjt	dt|n|S(sAReturn default username to be used in commits.

        Searched in this order: $HGUSER, [ui] section of hgrcs, $EMAIL
        and stop searching if one of these is set.
        If not found and ui.askusername is True, ask the user, else use
        ($LOGNAME or $USER or $LNAME or $USERNAME) + "@full.hostname".
        tHGUSERRR/R8tEMAILtaskusernamesenter a commit username:R~s%s@%ss&no username found, using '%s' instead
sno username suppliedthints+use "hg config --edit" to set your usernames
susername %s contains a newline
N(RRR}RQR
RRt
expandvarsRgtpromptRtinteractiveR,tgetusertsockettgetfqdnR3tKeyErrortAborttrepr(R#R8((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR/s*
"cCs|jstj|}n|S(s>Return a short representation of a user name or email address.(RR,t	shortuser(R#R8((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRs	cCsxtj|s0tjjtjj|dr4|S|jd|}|rn|dk	rn|jd|}n|pw|S(s:Return repository location relative to cwd or from [paths]s.hgRZN(R,RcRRRtisdirRfR
RQ(R#tlocR~RR((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRbs0cCs$|jjg|jj|dS(s}install a buffer to capture standar output of the ui object

        If error is True, the error output will be captured too.N(RRR(R#RK((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt
pushbufferscCs#|jjdj|jjS(spop the last buffer and return the buffered output

        If labeled is True, any labels associated with buffered
        output will be handled. By default, this has no effect
        on the output returned, but extensions and GUI tools may
        handle this argument and returned styled output. If output
        is being buffered so it can be captured and parsed or
        processed, labeled should not be set to True.
        Rs(RtpopRfR(R#tlabeled((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt	popbuffers

cOsd|jr9|jdjg|D]}t|^qn'x$|D]}|jjt|q@WdS(swrite args to output

        By default, this method simply writes to the buffer or stdout,
        but extensions or GUI tools may override this method,
        write_err(), popbuffer(), and label() to style output from
        various parts of hg.

        An optional keyword argument, "label", can be passed in.
        This should be a string containing label names separated by
        space. Label names take the form of "topic.type". For example,
        ui.debug() issues a label of "ui.debug".

        When labeling output for a specific command, a label of
        "cmdname.type" is recommended. For example, status issues
        a label of "status.modified" for modified files.
        iN(RRRMRtwrite(R#targsR*ta((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRs	0
cOsy|jr)|jdr)|j||St|jdtsN|jjnx$|D]}|jjt|qUWt|jdts|jjnWn:tk
r}|j	t	j
t	jt	jfkrqnXdS(Nitclosed(
RRtgetattrRRtflushRRMRHterrnotEPIPEtEIOtEBADF(R#RR*RRW((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt	write_errs
!cCsZy|jjWnttfk
r*nXy|jjWnttfk
rUnXdS(N(RRRHRR(R#((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRscCs&|jddtrtStj|S(NRtnontty(RgRR,tisatty(R#tfh((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt_isattyscCs5|jddd}|dkr1|j|jS|S(s-is interactive input allowed?

        An interactive session is a session where input can be reasonably read
        from `sys.stdin'. If this function returns false, any attempt to read
        from stdin should fail with an error, unless a sensible default has been
        specified.

        Interactiveness is triggered by the value of the `ui.interactive'
        configuration variable or - if it is unset - when `sys.stdin' points
        to a terminal device.

        This function refers to input only; for output, see `ui.formatted()'.
        RRN(RgRQRR(R#ti((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR#scCsEdtjkr;yttjdSWq;tk
r7q;XntjS(s-how wide is the terminal in columns?
        tCOLUMNS(RRRRR,t	termwidth(R#((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR9s
cCsE|jrtS|jddd}|dkrA|j|jS|S(s*should formatted output be used?

        It is often desirable to format the output to suite the output medium.
        Examples of this are truncating long lines or colorizing messages.
        However, this is not often not desirable when piping output into other
        utilities, e.g. `grep'.

        Formatted output is triggered by the value of the `ui.formatted'
        configuration variable or - if it is unset - when `sys.stdout' points
        to a terminal device. Please note that `ui.formatted' should be
        considered an implementation detail; it is not intended for use outside
        Mercurial or its extensions.

        This function refers to output only; for input, see `ui.interactive()'.
        This function always returns false when in plain mode, see `ui.plain()'.
        Rt	formattedN(RNRRgRQRR(R#R((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRCscCs|j|jr@yddl}|jWq@tk
r<q@Xn|j|tj}tj}|jt_|j	t_t
d}|t_|t_tjdkr|r|ddkr|d }n|S(NiRs
s
(
RRtreadlinetread_history_filet	ExceptionRRRRRt	raw_inputRtlinesep(R#RRtoldintoldouttline((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt	_readline_s"

				%
tycCs|js&|j|d|d|Sy-|j|j|d}|sN|S|SWn&tk
r{tjtdnXdS(shPrompt user with msg, read response.
        If ui is not interactive, the default is returned.
        Rs
s	ui.promptsresponse expectedN(RRRtlabeltEOFErrorR,RR(R#tmsgR~tr((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRs
cCs|jd}|djd}g|dD]}|jd^q-}|g|D]8}||jddj|jdddf^qRfS(sExtract prompt message and list of choices from specified prompt.

        This returns tuple "(message, choices)", and "choices" is the
        list of tuple "(response character, text without &)".
        s$$iRit&Rs(RRRtindextlowerRa(RRRRltchoicesR((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytextractchoicess&cCs|j|\}}g|D]\}}|^q}xXtr|j|||}|j|krx|j|jS|jtdq7WdS(sePrompt user with a message, read response, and ensure it matches
        one of the provided choices. The prompt is formatted as follows:

           "would you like fries with that (Yn)? $$ &Yes $$ &No"

        The index of the choice is returned. Responses are case
        insensitive. If ui is not interactive, the default is
        returned.
        sunrecognized response
N(RRRRRRR(R#RR~RRRtttresps((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytpromptchoices	cCs|js|Sy^|j|j|p.tdd|jddr`|jjjdStjdSWn&t	k
rt
jtdnXdS(Ns
password: s	ui.promptRRs
Rssresponse expected(RRRRRgRRRtgetpassRR,R(R#RR~((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRs%
cOs:|js6|jddd|d<|j||ndS(sqwrite status message to output (if ui.quiet is False)

        This adds an output label of "ui.status".
        RRss
 ui.statusN(RR}R(R#RR*((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytstatuss	cOs.|jddd|d<|j||dS(sewrite warning message to output (stderr)

        This adds an output label of "ui.warning".
        RRss ui.warningN(R}R(R#RR*((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR3scOs:|jr6|jddd|d<|j||ndS(sfwrite note to output (if ui.verbose is True)

        This adds an output label of "ui.note".
        RRss ui.noteN(RR}R(R#RR*((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytnotes	cOs:|jr6|jddd|d<|j||ndS(srwrite debug message to output (if ui.debugflag is True)

        This adds an output label of "ui.debug".
        RRss	 ui.debugN(R	R}R(R#RR*((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR=s	c
CsBtjdddddt\}}z	tj|d}|j||ji|d6}d|kr|jit|dd	6nx6dD].}||kr|ji||d	6PqqW|j	}	t
jd|	|fd
|dt
jdt
dd|jt|}|j}
|jWdtj|X|
S(Ntprefixs
hg-editor-tsuffixs.txtttexttwRttransplant_sourcet
HGREVISIONRvt
rebase_sources%s "%s"Rtonerrt	errprefixsedit failedtout(ssourceR(ttempfiletmkstempRRtfdopenRRJRPRt	geteditorR,tsystemRRRRGRItunlink(R#RR8textratfdRtR%RRteditorR((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytedits.


!

cCs|js|r|d	kr*tj}nt|ddd	}|d	k	rtj|d}tj|d}tj|d|d}|jddj	|d dj	|dj	|qtj
|d|d|dd|jn|jp|S(
sprint exception traceback if traceback printing enabled or forced.
        only to call in exception handler. returns true if traceback
        printed.itcauseiis#Traceback (most recent call last):
RsitfileN(R
RQRtexc_infoRRBt	format_tbtformat_exception_onlyRRftprint_exceptionR(R#texctforceRtcausetbtexctbtexconly((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRBs	
cCsgtjdkrd}nd}tjjdpf|jddpftjjdpftjjd|S(	sreturn editor to usetplan9tEssensible-editortHGEDITORRRtVISUALtEDITOR(RtplatformRRR}R
(R#R((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRs	cCs|dks|jrdS|r-d|}n|r@d|}n|rzd||}|jd||||||fn|jd||||fdS(sxshow a progress message

        With stock hg, this is simply a debug message that is hidden
        by default, but with extensions or GUI tools it may be
        visible. 'topic' is the current operation, 'item' is a
        non-numeric marker of the current position (i.e. the currently
        in-process file), 'pos' is the current numeric position (i.e.
        revision, bytes, etc.), unit is a corresponding unit label,
        and total is the highest expected pos.

        Multiple nested topics may be active at a time.

        All topics should be marked closed by setting pos to None at
        termination.
        NRgY@s%s:%s %s/%s%s (%4.2f%%)
s%s:%s %s%s
(RQR	R=(R#R)tposRntunitttotaltpct((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytprogress s

	cOsdS(shook for logging facility extensions

        service should be a readily-identifiable subsystem, which will
        allow filtering.
        message should be a newline-terminated string to log.
        N((R#tserviceRR*((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pytlog@scCs|S(s%style msg based on supplied label

        Like ui.write(), this just returns msg unchanged, but extensions
        and GUI tools can override it to allow styling output without
        writing it.

        ui.write(s, 'label') is equivalent to
        ui.write(ui.label(s, 'label')).
        ((R#RR((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyRIs
N(5t__name__t
__module__RQR&RR(R:RR"RRoRrRwRyR`R
RRgRRRhRRRRNR/RRbRRRRRRRRRRRtstaticmethodRRRRR3RR=RRBRRRR(((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyR
sb&			*"			 !X			

						
	 
					 		(ti18nRRRRRRRRBR
R R,RKR(tnodeRtobjectR(((s0/usr/lib/python2.7/dist-packages/mercurial/ui.pyt<module>sT<

Copyright © 2017 || Recoded By Mr.Bumblebee