HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/mercurial/phases.pyc

Xc@@sdZddlmZddlZddlZddlmZddlmZm	Z	m
Z
mZmZddl
mZedZ\ZZZedZd	d
dgZddZd
efdYZdZdZdZdZdZdZdZ dZ!dS(s Mercurial phases support code

    ---

    Copyright 2011 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
                   Logilab SA        <contact@logilab.fr>
                   Augie Fackler     <durin42@gmail.com>

    This software may be used and distributed according to the terms
    of the GNU General Public License version 2 or any later version.

    ---

This module implements most phase logic in mercurial.


Basic Concept
=============

A 'changeset phase' is an indicator that tells us how a changeset is
manipulated and communicated. The details of each phase is described
below, here we describe the properties they have in common.

Like bookmarks, phases are not stored in history and thus are not
permanent and leave no audit trail.

First, no changeset can be in two phases at once. Phases are ordered,
so they can be considered from lowest to highest. The default, lowest
phase is 'public' - this is the normal phase of existing changesets. A
child changeset can not be in a lower phase than its parents.

These phases share a hierarchy of traits:

            immutable shared
    public:     X        X
    draft:               X
    secret:

Local commits are draft by default.

Phase Movement and Exchange
===========================

Phase data is exchanged by pushkey on pull and push. Some servers have
a publish option set, we call such a server a "publishing server".
Pushing a draft changeset to a publishing server changes the phase to
public.

A small list of fact/rules define the exchange of phase:

* old client never changes server states
* pull never changes server states
* publish and old server changesets are seen as public by client
* any secret changeset seen in another repository is lowered to at
  least draft

Here is the final table summing up the 49 possible use cases of phase
exchange:

                           server
                  old     publish      non-publish
                 N   X    N   D   P    N   D   P
    old client
    pull
     N           -   X/X  -   X/D X/P  -   X/D X/P
     X           -   X/X  -   X/D X/P  -   X/D X/P
    push
     X           X/X X/X  X/P X/P X/P  X/D X/D X/P
    new client
    pull
     N           -   P/X  -   P/D P/P  -   D/D P/P
     D           -   P/X  -   P/D P/P  -   D/D P/P
     P           -   P/X  -   P/D P/P  -   P/D P/P
    push
     D           P/X P/X  P/P P/P P/P  D/D D/D P/P
     P           P/X P/X  P/P P/P P/P  P/P P/P P/P

Legend:

    A/B = final state on client / state on server

    * N = new/not present,
    * P = public,
    * D = draft,
    * X = not tracked (i.e., the old client or server has no internal
          way of recording the phase.)

    passive = only pushes


    A cell here can be read like this:

    "When a new client pushes a draft changeset (D) to a publishing
    server where it's not present (N), it's marked public on both
    sides (P/P)."

Note: old client behave as a publishing server with draft only content
- other people see it as public
- content is pushed as draft

i(tabsolute_importNi(t_(tbinthextnullidtnullrevtshort(terroritpublictdrafttsecretc
C@sb|j}t}gtD]}t^q}yd}dtjkry|jd}Wqtk
r}|j	t	j
krqqXn|dkr|jd}nzDx=|D]5}|j\}}	|t|j
t|	qWWd|jXWnZtk
rW}|j	t	j
kr%n|rNx |D]}|||}q2Wnt}nX||fS(sRead phase roots from disk

    phasedefaults is a list of fn(repo, roots) callable, which are
    executed if the phase roots file does not exist. When phases are
    being initialized on an existing repository, this could be used to
    set selected changesets phase to something else than public.

    Return (roots, dirty) where dirty is true if roots differ from
    what is being stored.
    t
HG_PENDINGsphaseroots.pendingt
phaserootsN(t
unfilteredtFalset	allphasestsettNonetostenvirontsvfstIOErrorterrnotENOENTtsplittinttaddRtclosetTrue(
trepot
phasedefaultstdirtytitrootstftinsttlinetphasetnh((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt
_readroots|s4

%

t
phasecachecB@seZedZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZd
ZdZRS(cC@sS|rOt||\|_|_d|_d|_|j||j|_ndS(N(	R'RRRt
_phaserevst
_phasesetst
filterunknownRtopener(tselfRRt_load((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt__init__s		
cC@sY|jdddt}|j|_|j|_|j|_|j|_|j|_|S(NR.(t	__class__RRRRR,R)R*(R-tph((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pytcopys
cC@s.x'dD]}t||t||qWdS(s4replace all values in 'self' with content of phcacheRRR,R)R*N(RRR,R)R*(tsetattrtgetattr(R-tphcacheta((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pytreplaces
cC@sV|j}g}x1tD])}|jt|jj|j|qW|jj|S(N(R
t
trackedphasestappendtmapt	changelogtrevRt
computephases(R-RtnativerootsR%((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt_getphaserevsnatives

'cC@s|j}tgt|j}||_|j|xutD]m}t|jj|j	|}|r?x|D]}|||<qnWx'|jj
|D]}|||<qWq?q?WdS(N(R
RtlenR;R)t_populatephaserootsR8R:R<Rtdescendants(R-RtrevsR%R!R<((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt_computephaserevspures	


cC@s|jdkr}yJ|jjddr7|j|n!|j|}|\|_|_Wq}tk
ry|j|q}XndS(s0ensure phase information is loaded in the objecttexperimentaltnativephaseskillswitchN(R)Rtuit
configboolRDR?R*tAttributeError(R-Rtres((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt
loadphaserevss	
cC@sd|_d|_dS(N(RR)R*(R-((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt
invalidates	cC@s[|j}|j}xBtD]:}t|j|j|}x|D]}|||<q?WqWdS(s>Fills the _phaserevs cache with phases for the roots.
        N(R;R)R8R:R<R(R-Rtclt	phaserevsR%R!troot((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyRAs		

cC@sz|tkrtS|tkr1ttdn|jdksU|t|jkro|j|j|n|j|S(Nscannot lookup negative revision(	RRt
ValueErrorRR)RR@RLRK(R-RR<((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyR%s$
cC@sN|js
dS|jdddtdt}z|j|Wd|jXdS(NRtwt
atomictempt
checkambig(RR,Rt_writeR(R-R"((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pytwrites	cC@s[xKt|jD]:\}}x+|D]#}|jd|t|fq#WqWt|_dS(Ns%i %s
(t	enumerateRRURRR(R-tfpR%R!th((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyRTs
%cC@sG||j|<|jt|_|jdd|jd|jd<dS(NR%Rt1tphases_moved(R(RRLRRtaddfilegeneratorRTthookargs(R-R%tnewrootsttr((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt_updateroots
s


	c
C@s|j}g}xt|dttD]}g|D].}|j|||j|kr9|^q9}|swPn|j|}td|jd|||D}	||	kr|j||	||j	||	n|dkr,|j
||||q,q,W|jdS(Nics@s|]}|jVqdS(N(tnode(t.0tctx((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pys	<genexpr>ssroots((%ln::) - (%ln::%ln))i(R
txrangeR@RR%R<RRR_textendtretractboundarytinvalidatevolatilesets(
R-RR^ttargetphasetnodestdelrootsR%tntoldsR!((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pytadvanceboundarys  
.
c@sNj|j|}g|D].}|j|j|kr |^q }|r@t|kr~tjtdn|j}|j	|t
fd|Dg|D]"}|jkr|^q}jd|}	tfd|D}
|
j	d|	D|j||
|nj
dS(Ns!cannot change null revision phasec3@s|]}|jVqdS(N(R<(RaRj(R(s4/usr/lib/python2.7/dist-packages/mercurial/phases.pys	<genexpr>:ssroots(%ln::)c3@s+|]!}|jkr|VqdS(N(R<(RaRj(t
minnewrootR(s4/usr/lib/python2.7/dist-packages/mercurial/phases.pys	<genexpr>?scs@s|]}|jVqdS(N(R`(RaRb((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pys	<genexpr>As(R
RR%R<RRtAbortRR2tupdatetminRR_Rf(R-RR^RgRhtcurrentrootsRjR]t
aboverootstupdatedrootst
finalroots((RmRs4/usr/lib/python2.7/dist-packages/mercurial/phases.pyRe*s"

.

"c@st}|jjxt|jD]u\}}tfd|D}|r"x.|D]&}|jjdt||fqWW|j	|t
}q"q"W|rt
|_n|jdS(sremove unknown nodes from the phase boundary

        Nothing is lost as unknown nodes only hold data for their descendants.
        c3@s!|]}|kr|VqdS(N((RaR`(tnodemap(s4/usr/lib/python2.7/dist-packages/mercurial/phases.pys	<genexpr>Nss0removing unknown node %s from %i-phase boundary
N(
RR;RuRVRtsortedRGtdebugRtsymmetric_difference_updateRRRL(R-RtfilteredR%Rhtmissingtmnode((Rus4/usr/lib/python2.7/dist-packages/mercurial/phases.pyR+Fs
	

	(t__name__t
__module__RR/R2R7R?RDRKRLRAR%RURTR_RlReR+(((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyR(s					
	
		
							cC@s9|jj}|j|||||jj|dS(sAdd nodes to a phase changing other nodes phases if necessary.

    This function move boundary *forward* this means that all nodes
    are set in the target phase or kept in a *lower* phase.

    Simplify boundary to contains phase roots only.N(t_phasecacheR2RlR7(RR^RgRhR5((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyRlbscC@s9|jj}|j|||||jj|dS(sSet nodes back to a phase changing other nodes phases if
    necessary.

    This function move boundary *backward* this means that all nodes
    are set in the target phase or kept in a *higher* phase.

    Simplify boundary to contains phase roots only.N(R~R2ReR7(RR^RgRhR5((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyRemscC@sXi}dt}x(|jjtD]}||t|<q!W|jrTd|d<n|S(s/List phases root for serialization over pushkeys%iRt
publishing(R	R~RRR(RtkeystvalueRO((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt
listphasesys

cC@s|j}|j||j}tt|}tt|}||kr||kr|jd#}t|||t|gWdQXdS||krdSdSWdQXdS(s/List phases root for serialization over pushkeys
pushkey-phaseNii(R
tlockR%tabsRttransactionRlR(RtnhextoldphasestrtnewphasestrtcurrentphasetnewphasetoldphaseR^((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt	pushphases
"c	C@s|j}g}|jj}x|jD]\}}|dkrIq+nt|}t|}|tkr|tkr|jj	t
d|qq+|tkr||kr|j|qq+|jj	t
d||fq+Wt
|||}||fS(sCompute phases heads and root in a subset of node from root dict

    * subset is heads of the subset
    * roots is {<nodeid> => phase} mapping. key and value are string.

    Accept unknown element input
    Rs2ignoring inconsistent public root from remote: %s
s,ignoring unexpected root from remote: %i %s
(R
R;Rut	iteritemsRRRRRGtwarnRR	R9tnewheads(	RtsubsetR!t
draftrootsRuRR%R`tpublicheads((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pytanalyzeremotephasess&cC@sD|j}|jd||||}g|D]}|j^q.S(scompute new head of a subset minus another

    * `heads`: define the first subset
    * `roots`: define the second we subtract from the firsts(heads((%ln + parents(%ln)) - (%ln::%ln))(R
RR`(RtheadsR!trevsettc((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyRs	cC@s|jddt}ytj|SWnRtk
rzyt|SWq{tk
rvtd}tj||q{XnXdS(suhelper to get the target phase of new commit

    Handle all possible values for the phases.new-commit options.

    tphasess
new-commits0phases.new-commit: not a valid phase name ('%s')N(	tconfigR	t
phasenamestindexRPRRRtConfigError(RGtvtmsg((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pytnewcommitphases

cC@st|jjdS(s@utility function that check if a repo have any secret changeset.i(tboolR~R(R((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt	hassecrets("t__doc__t
__future__RRRti18nRR`RRRRRtRtrangeRRR	R
R8RRR'tobjectR(RlReRRRRRR(((s4/usr/lib/python2.7/dist-packages/mercurial/phases.pyt<module>es&(
'