-=[ Mr. Bumblebee ]=-
_Indonesia_

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

σ
ξ:οNc@@sΝdZddlmZddlmZmZmZmZddlm	Z	m
Z
ddlmZddl
mZdefd„ƒYZdeed	„Zeed
„Zeed„Zd„Zdd
„ZdS(sbzr upgrade logic.i(tabsolute_import(terrorsttracetuiturlutils(t
ControlDirtformat_registry(tgettext(tRemoteBzrDirtConvertcB@s,eZdddd„Zd„Zd„ZRS(cC@s||_d}|tjjk}|dkrH|dkrHtdƒ‚n|dk	r`||_ntj|ƒ|_t	|jt
ƒr£|jjƒ|jj|_n|jj
jƒrΑtj‚n|jj
|_tjjj|ƒz|jƒWd|stjjj|ƒnXdS(s²Convert a Bazaar control directory to a given format.

        Either the url or control_dir parameter must be given.

        :param url: the URL of the control directory or None if the
          control_dir is explicitly given instead
        :param format: the format to convert to or None for the default
        :param control_dir: the control directory or None if it is
          specified via the URL parameter instead
        tcross_format_fetchs4either the url or control_dir parameter must be set.N(tformatRt
ui_factorytsuppressed_warningstNonetAssertionErrortbzrdirRtopen_unsupportedt
isinstanceRt_ensure_realt_real_bzrdirtroot_transporttis_readonlyRtUpgradeReadonlyt	transporttaddtconverttremove(tselfturlRtcontrol_dirt
warning_idt
saved_warning((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyt__init__%s(	
cC@sώyW|jjƒ}|j|jjkrStjjtdƒtj|jdƒƒn~Wnt	j
t	jfk
rvnX|jdkrγy|jjƒjj}Wnt	jk
r»t}nX|rΛd}nd}tj|ƒ}n	|j}|jj|ƒst	j|jjƒ‚n|jjƒsGt	jtdƒ|jjƒ‚n|jj|ƒtjjtdƒtj|jjdƒƒ|jjƒ\|_|_xC|jj|ƒrγ|jjj|ƒ}|j |jdƒ|_q‘WtjjtdƒƒdS(NsDThis is a checkout. The branch (%s) needs to be upgraded separately.sutf-8sdefault-rich-roottdefaults$cannot upgrade from bzrdir format %ssstarting upgrade of %stfinished(!Rtopen_branchtuser_urlRRtnoteRRtunescape_for_displayRtNotBranchErrortIncompatibleRepositoriesRRtfind_repositoryt_formattrich_root_datatNoRepositoryPresenttFalseRtmake_bzrdirtneeds_format_conversiontUpToDateFormattcan_convert_formattBzrErrortcheck_conversion_targetRtbaset
backup_bzrdirtbackup_oldpathtbackup_newpatht
get_converterR(Rtbrancht	rich_roottformat_nameRt	converter((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyRHsB
		cC@s`|j}|j|jƒ}tjjƒ}|jtdƒƒz|j|ƒWd|j	ƒXdS(sUClean-up after a conversion.

        This removes the backup.bzr directory.
        sDeleting backup.bzrN(
RtrelpathR8RRtnested_progress_bartupdateRtdelete_treeR#(RRtbackup_relpathtchild_pb((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pytclean_upps	N(t__name__t
__module__RR!RRD(((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyR	#s#	(cC@s–tj|ƒg}t||d|d|ƒ\}}}t|ƒdkr’t|ƒ}t|ƒ}	||	}
tjjtdƒj||	|
ƒƒn|S(sνUpgrade locations to format.
 
    This routine wraps the smart_upgrade() routine with a nicer UI.
    In particular, it ensures all URLs can be opened before starting
    and reports a summary at the end if more than one upgrade was attempted.
    This routine is useful for command line tools. Other bzrlib clients
    probably ought to use smart_upgrade() instead.

    :param url: a URL of the locations to upgrade.
    :param format: the format to convert to or None for the best default
    :param clean-up: if True, the backup.bzr directory is removed if the
      upgrade succeeded for a given repo/branch/tree
    :param dry_run: show what would happen but don't actually do any upgrades
    :return: the list of exceptions encountered
    RDtdry_runis;
SUMMARY: {0} upgrades attempted, {1} succeeded, {2} failed(	RRt
smart_upgradetlenRRR&RR(RRRDRGtcontrol_dirst	attemptedt	succeededt
exceptionstattempted_counttsucceeded_counttfailed_count((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pytupgrades
	cC@s{g}g}g}xY|D]Q}t||d|d|ƒ\}}	}
|j|ƒ|j|	ƒ|j|
ƒqW|||fS(sͺConvert control directories to a new format intelligently.

    If the control directory is a shared repository, dependent branches
    are also converted provided the repository converted successfully.
    If the conversion of a branch fails, remaining branches are still tried.

    :param control_dirs: the BzrDirs to upgrade
    :param format: the format to convert to or None for the best default
    :param clean_up: if True, the backup.bzr directory is removed if the
      upgrade succeeded for a given repo/branch/tree
    :param dry_run: show what would happen but don't actually do any upgrades
    :return: attempted-control-dirs, succeeded-control-dirs, exceptions
    RDRG(t_smart_upgrade_onetextend(RJRRDRGt
all_attemptedt
all_succeededtall_exceptionsRRKRLRM((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyRHs


c
C@sd}y|jƒ}Wntjk
r,n"X|jƒrN|jdtƒ}n|g}t|g|||ƒ\}}|r|rtj	j
tdƒt|ƒfƒg|D]}	|	j
^q«}
t|
|||ddƒ\}}|j|
ƒ|j|ƒ|j|ƒn|||fS(smConvert a control directory to a new format intelligently.

    See smart_upgrade for parameter details.
    tusings+Found %d dependent branches - upgrading ...tlabelR:N(Rtopen_repositoryRR-t	is_sharedt
find_branchestTruet_convert_itemsRRR&RRIRRS(
RRRDRGt
dependentstrepoRKRLRMtbtbranch_cdirst	successestproblems((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyRRΈs(	

cC@sεyFy|jdtdtƒ}Wn#tk
rD|jdtƒ}nXWntjk
r\nX|dfSy|jƒ}Wntjk
rnX|dfSy|jƒ}Wntjtj	fk
rΗnX|dfSt
d|ƒ‚dS(sCReturn the primary object and type label for a control directory.

    :return: object, label where:
      * object is a Branch, Repository or WorkingTree and
      * label is one of:
        * branch            - a branch
        * repository        - a repository
        * tree              - a lightweight checkout
    tunsupportedtignore_fallbacksR:t
repositoryttrees$unknown type of control directory %sN(R$R\tNotImplementedErrorRR(RYR-topen_workingtreet
NoWorkingTreetNotLocalUrlR(RtbrR_twt((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyt_get_object_and_labelβs(





cC@sg}g}tjjƒ}|jtdƒdt|ƒƒx°t|ƒD]’\}}	|	jj}
t	|	ƒ\}}|pz|}
|jtdƒ|
|dt|ƒƒtjj
tdƒj|
tj
|
dƒƒƒy"|sσtd|	d|ƒ}nWnotjk
r2}tjj
t|ƒƒ|j|	ƒqGn4tk
re}tjd	|ƒ|j|ƒqGnX|j|	ƒ|rGy-tjj
td
ƒƒ|s₯|jƒnWqιtk
rε}tjtdƒ|
|fƒ|j|ƒqιXqGqGW|jƒ||fS(s	Convert a sequence of control directories to the given format.
 
    :param items: the control directories to upgrade
    :param format: the format to convert to or None for the best default
    :param clean-up: if True, the backup.bzr directory is removed if the
      upgrade succeeded for a given repo/branch/tree
    :param dry_run: show what would happen but don't actually do any upgrades
    :param label: the label for these items or None to calculate one
    :return: items successfully upgraded, exceptions
    sUpgrading bzrdirsisUpgrading %sisUpgrading {0} {1} ...sutf-8RRsconversion error: %ssRemoving backup ...sfailed to clean-up {0}: {1}(RRR?R@RRIt	enumerateRR5RnR&RRR'R	RR1tstrtappendt	ExceptionRtwarningRDR#(titemsRRDRGRXRLRMRCtiRtlocationt
bzr_objectt	bzr_labelt
type_labeltcvtex((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyR]sB'



N(t__doc__t
__future__RtbzrlibRRRRtbzrlib.controldirRRtbzrlib.i18nRt
bzrlib.remoteRtobjectR	RR.RQRHRRRnR](((s2/usr/lib/python2.7/dist-packages/bzrlib/upgrade.pyt<module>s"\)	$

Copyright © 2017 || Recoded By Mr.Bumblebee