idcRddlmZddlZddlZddlZddlZddlZddlmZddl m Z m Z ddl m Z mZmZddlmZmZmZmZddlmZmZddlmZdd lmZmZmZmZmZm Z dd lm!Z!ddl"m#Z$d d l%m&Z&m'Z'm(Z(m)Z)m*Z*dd l+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1ddl+m2Z2m3Z3m4Z4ddl5m6Z6m7Z7m8Z8m9Z9e0rddl:m;Z;ddlm?Z?ddgZ@ejAdZBeBCejDGddeZEeEjFZFeEjGZGeEjHZHeEjIZIeEjJZJGddeeZKdS))BytesION)Git)defencis_win)SectionConstraintGitConfigParsercp)InvalidGitRepositoryErrorNoSuchPathErrorRepositoryDirtyErrorBadName) IndexObjectObject)TraversableIterableObj)join_path_nativeto_native_path_linuxRemoteProgressrmtree unbare_repo IterableList)HIDE_WINDOWS_KNOWN_ERRORS)mkheadsm_name sm_sectionSubmoduleConfigParserfind_first_remote_branch)CallableDictMappingSequence TYPE_CHECKINGcast)AnyIteratorUnion) Commit_ishLiteralPathLikeTBD) IndexFile)Repo)Head SubmoduleUpdateProgresszgit.objects.submodule.baseceZdZUdZdeejejdzD\ZZZ ejdzZe e d<dZ dS)r/zClass providing detailed progress information to the caller who should derive from it and implement the ``update(...)`` messagecg|]}d|zS)r).0xs O/opt/cloudlinux/venv/lib/python3.11/site-packages/git/objects/submodule/base.py zUpdateProgress.Gsuuu!qAvuuu _num_op_codesr2N) __name__ __module__ __qualname____doc__rangerr9CLONEFETCH UPDWKTREEint__annotations__ __slots__r2r7r5r/r/Bso@@vuuu^5QSaSorsSs/t/tuuuE5)'59M3999IIIr7cZeZdZUdZdZdZdZdZej ej zZ dZ e ded<dZd Z d_d d d edeed fdeed fdeed fdeed fdeed fdeed fdd ffd Zdedd ffd ZedddedfdZededefdZdedefdZ de!defdZ"defdZ#defdZ$defd Z%ed d deed fd!ede&fd"Z'd`d#Z(edede)fd$Z*d!ede+fd%Z,ed&d dededefd'Z-e dad d dededed)ed*ed+edd fd,Z.ed&d dedefd-Z/ed.ed/edd fd0Z0e dbd d dededeed fdeed fd1ed2eed fd3ee1eefd fd4ee2e3d fd)ed*eddfd5Z4 dcd7ed8ed9ed:ed;ded3ee1eefd fd4ee2e3d fd)ed*eddfd?Z5e6ddd@edAedBeddfdCZ7e6 dedBed=edAede?didSZ@e?defdTZAe?defdUZBe?defdVZCe?djdXZDe?defdYZEde+e&fdZZFdedfd[ZGe dkd d deeefd]ed+edeHdf d^ZIxZJS)lr.avImplements access to a git submodule. They are special in that their sha represents a commit in the submodule's repository which is to be checked out at the path of this instance. The submodule type does not have a string type associated with it, as it exists solely as a marker in the tree and index. All methods work in bare and non-bare repositories.name .gitmodulesbranchmaster submoduletype)_parent_commit_url _branch_path_name __weakref__pathrMrNNrepor,binshamoderR parent_commiturl branch_pathreturnc tt|||||d|_||_|||_|||_| ||_dSdS)aInitialize this instance with its attributes. We only document the ones that differ from ``IndexObject`` :param repo: Our parent repository :param binsha: binary sha referring to a commit in the remote repository, see url parameter :param parent_commit: see set_parent_commit() :param url: The url to the remote repository which is the submodule :param branch_path: full (relative) path to ref to checkout when cloning the remote repositoryrN)superr.__init__sizerLrMrNrO) selfrSrTrUrRrFrVrWrX __class__s r5r\zSubmodule.__init__msk& i''fdDAAA + ?DI  " +D   DJJJ  r7attrcV|dvr|} |d|_nX#tj$rF}|jj0tdtj |jjdz|Yd}~nd}~wwxYw|d|_ | |j tj|j|_dS|dkrt%dt't(||dS)NrQrRz;This submodule instance does not exist anymore in '%s' filerGrWrOzCCannot retrieve the name of a submodule if it was not set initially) config_readergetrRr NoSectionErrorrSworking_tree_dir ValueErrorospjoinrM get_value k_head_optiongitr- to_full_pathk_head_defaultrNAttributeErrorr[r. _set_cache_)r^r`readerer_s r5rozSubmodule._set_cache_s2 3 3 3(,(:(:(<(>$++--00 0( $ $ $## # # # $s&)AArkc(|jdddkS)Nr8)r) version_info)rwrks r5_need_gitfile_submodulesz"Submodule._need_gitfile_submoduless#y00r7otherc"|j|jkS)zCompare with another submodulerOr^r~s r5__eq__zSubmodule.__eq__s zU[((r7c||k S)z-Compare with another submodule for inequalityr2rs r5__ne__zSubmodule.__ne__sEM""r7c*t|jS)z4Hash this instance using its logical id, not the sha)hashrOr^s r5__hash__zSubmodule.__hash__sDJr7c|jSNrrs r5__str__zSubmodule.__str__s zr7c rdt|jd|jd|jd|jd|jd S)Nzgit.z(name=z, path=z, url=z, branch_path=))rKr:rOrRrWrXrs r5__repr__zSubmodule.__repr__sG JJ    JJJ III HHH       r7 read_onlycd}|" |jj|k}n#t$rYnwxYw|js)|r'|jr t j|j|j}nP| Jd ||}n-#t$r }td|jd||d}~wwxYw|s|js|stdt||S)a7:return: Config Parser constrained to our submodule in read or write mode :raise IOError: If the .gitmodules file cannot be found, either locally or in the repository at the given parent commit. Otherwise the exception would be delayed until the first access of the config parserTNz-need valid parent_commit in bare repositorieszCould not find z# file in the tree of parent commit z;Cannot write blobs of 'historical' submodule configurationsr) headcommitrfbarerergrhk_modules_file _sio_modulesKeyErrorIOErrorr)rwrSrVrparent_matches_head fp_modulerqs r5_config_parserzSubmodule._config_parsers;#  $ &*i&6-&G##     y 0 T5J !68JKKII ,,.],,, ,,];;    gPSPbPbPbdqdqr  \di \/B \Z[[ [%Y)DDDDs$ $$$A:: B$BB$c\|jD]#} t||#t$rY wxYwdSr) _cache_attrsdelattrrn)r^rFs r5 _clear_cachezSubmodule._clear_cachesV%  D d####!      s  ))ct|j|jj}|j|_|S)z]:return: Configuration file as BytesIO - we only access it through the respective blob's data)rtreer data_streamreadrF)rwrVsios r5rzSubmodule._sio_moduless:m();<HMMOOPP% r7c |j}n#t$rd}YnwxYw||j||}||t |t |jS)zI:return: Config Parser constrained to our submodule in read or write modeN)rVrfrrS set_submodulerrrF)r^rpcparsers r5_config_parser_constrainedz$Submodule._config_parser_constraineds~ ,0,>BB   BBB $$TYI>>T""" DI)>)>???s   parent_repoc||jrtj|jd|S|jrtj|j|St )Nmodules)r}rkrgrhgit_dirreNotADirectoryError)rwrrRrFs r5_module_abspathzSubmodule._module_abspath s_  ' '  8 8 B8K/DAA A  ' @8K8$?? ? """r7Fallow_unsafe_optionsallow_unsafe_protocolskwargsc ||||}|} ||jrh||d<tj|} tj| st j| tjt|j |} tj j || f||d|} ||jr| | || S)a:return: Repo instance of newly cloned repository :param repo: our parent repository :param url: url to clone from :param path: repository - relative path to the submodule checkout location :param name: canonical of the submodule :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext :param allow_unsafe_options: Allow unsafe options to be used, like --upload-pack :param kwargs: additional arguments given to git.cloneseparate_git_dir)rr)rr}rkrgdirnameisdirosmakedirsrhstrrer, clone_from!_write_git_file_and_module_config) rwrSrWrRrFrrrmodule_abspathmodule_checkout_pathmodule_abspath_dirclones r5 _clone_repozSubmodule._clone_repos&,,T4>>-  ' ' 1 1 N)7F% &!$^!> ? ? ? @ @ @ @ @ @ @ @ @ @ @ @ @ @ @SXnh??5af g g g kq   $S[1A%X%X%XYY                     s$+1B((B,/B,9DD"%D" no_checkoutdepthenvclone_multi_optionsc |jrtd|||}|t|}|||j|j||d} | rt |jjj t|} || _ | S#t$r9|j } | j| |d}|j| _| cYSwxYwt#j|t"jt|p|j}| }|du}|rB|@|d| jDvrt1d|d| jd d}|[|st1d |z| }d |jD}|st1d | jz|d}nXd |i}|s |j|d<|r*t7|t8r||d<nt1d| r| |d<|j||||f|| | d|}t=j|}| j !5}|"tG|d|dddn #1swxYwY| j j } | !| d5}|"d||"d||| _$|s,|"|j%|j&|j&| _'dddn #1swxYwY|r|jjj| _| (| gd| S)ac Add a new submodule to the given repository. This will alter the index as well as the .gitmodules file, but will not create a new commit. If the submodule already exists, no matter if the configuration differs from the one provided, the existing submodule will be returned. :param repo: Repository instance which should receive the submodule :param name: The name/identifier for the submodule :param path: repository-relative or absolute path at which the submodule should be located It will be created as required during the repository initialization. :param url: git-clone compatible URL, see git-clone reference for more information If None, the repository is assumed to exist, and the url of the first remote is taken instead. This is useful if you want to make an existing repository a submodule of anotherone. :param branch: name of branch at which the submodule should (later) be checked out. The given branch must exist in the remote repository, and will be checked out locally as a tracking branch. It will only be written into the configuration if it not None, which is when the checked out branch will be the one the remote HEAD pointed to. The result you get in these situation is somewhat fuzzy, and it is recommended to specify at least 'master' here. Examples are 'master' or 'feature/new' :param no_checkout: if True, and if the repository has to be cloned manually, no checkout will be performed :param depth: Create a shallow clone with a history truncated to the specified number of commits. :param env: Optional dictionary containing the desired environment variables. Note: Provided variables will be used to update the execution environment for `git`. If some variable is not specified in `env` and is defined in `os.environ`, value from `os.environ` will be used. If you want to unset some variable, consider providing empty string as its value. :param clone_multi_options: A list of Clone options. Please see ``git.repo.base.Repo.clone`` for details. :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext :param allow_unsafe_options: Allow unsafe options to be used, like --upload-pack :return: The newly created submodule instance :note: works atomically, such that no change will be done if the repository update fails for instancez*Cannot add submodules to bare repositoriesNzinvalid-temporaryrWrcg|] }|j Sr2rr3rs r5r6z!Submodule.add..s>>>Q15>>>r7zSpecified URL 'z6' does not match any remote url of the repository at 'rz8A URL was not given and a repository did not exist at %scg|] }|j Sr2rrs r5r6z!Submodule.add..s111aAE111r7z.Didn't find any remote url in repository at %snbrzdepth should be an integer multi_options)rrrrWF)indexrrRTr))rr rr NULL_BIN_SHAk_default_modeexistsrrrrrOrrentries entry_keyrTrkr-rlrm module_existsrvremotesrfabspathrF isinstancerBrr polish_urlrS config_writerrrrMrjrRrNadd)rwrSrFrRrWrHrrrrrrsmrentrybr has_modulebranch_is_defaultmrepourlsrrs r5rz Submodule.addossn 9 Z+,XYY Y$$T400 ?&s++CS       #     99;;  Y%*3t995      eoodA&>&>?!L   XdCH11#f++2SASTT U U%%'' "dN  #/>>"))++*=>>>>> jdgdgdgikisisist $( ; d ![^b!bcccIIKKE115=111D ` !QTVT^!^___q'CCHKKFXF$ & gs  CeS))C&+F7OO$%ABBB" >*='$CO  %9'=    EnS!!W " " $ $ ;   Z--uc : : : ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;    E  7 7 *6   UC ( ( (   VT * * *BG$ *  !2BG<<<"$' * * * * * * * * * * * * * * *  1 )0BI 2$d ### s8.,BACC'%JJJA"L44L8;L8T recursiveinitto_latest_revisionprogress)r/Ndry_runforce keep_goingc > |jjr|S|t}d} |rd} |rd} |} | j}t |}t |D]\}}t}|dkr |tz}| |||| d|d|j z|s| |||dz kr |tz}| |||| d |j zznK#t$r=d} |s|cYS|j}|sOtj|r; t#j|n%#t&$r}t'd |z|d}~wwxYw| tt(zdd| d |jd |d |j z|s2||j|j|j|j d|| | |  } | tt(zdd| d|zz|s= t1d| } t3| j|j}t7| |j}|t=| |j| j !|d|z| j j"#|n7#tHtf$r#tJ&d|jYnwxYw|j'5}|(tS|j d|jdddn #1swxYwYYnwxYw|j*}|j+}| | j j,}| |rd| j-z}|s]| j j".}||j/}|j*}|j+}nBtJ0d|| j j"ntJ0d|| | j j/j*|krd}| j j/j*|jkr| 1| j j/|}t |dks|dd|dj+|krS|r"d} | dz } tJ2| n/d} | |rdpd| j | fz} tJ3| d}|r*|s(| 4dddrtk| d | ttlzdd| d!|jd"|j d#|z|s>|r<|r| j78||$n| j 9|dd%| ttlzdd| d&|j zznA#tt$r4}!|stJ0tw|!Yd}!~!nd}!~!wwxYw|rH| F|<|D]}"|" |||||||'|S)(a} Update the repository of this submodule to point to the checkout we point at with the binsha of this instance. :param recursive: if True, we will operate recursively and update child- modules as well. :param init: if True, the module repository will be cloned into place if necessary :param to_latest_revision: if True, the submodule's sha will be ignored during checkout. Instead, the remote will be fetched, and the local tracking branch updated. This only works if we have a local tracking branch, which is the case if the remote repository had a master branch, or of the 'branch' option was specified for this submodule and the branch existed remotely :param progress: UpdateProgress instance or None if no progress should be shown :param dry_run: if True, the operation will only be simulated, but not performed. All performed operations are read - only :param force: If True, we may reset heads even if the repository in question is dirty. Additinoally we will be allowed to set a tracking branch which is ahead of its remote branch back into the past or the location of the remote branch. This will essentially 'forget' commits. If False, local tracking branches that are in the future of their respective remote branches will simply not be moved. :param keep_going: if True, we will ignore but log all errors, and keep going recursively. Unless dry_run is set as well, keep_going could cause subsequent / inherited errors you wouldn't see otherwise. In conjunction with dry_run, it can be useful to anticipate all errors when updating submodules :param env: Optional dictionary containing the desired environment variables. Note: Provided variables will be used to update the execution environment for `git`. If some variable is not specified in `env` and is defined in `os.environ`, value from `os.environ` will be used. If you want to unset some variable, consider providing empty string as its value. :param clone_multi_options: list of Clone options. Please see ``git.repo.base.Repo.clone`` for details. Only take effect with `init` option. :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext :param allow_unsafe_options: Allow unsafe options to be used, like --upload-pack :note: does nothing in bare repositories :note: method is definitely not atomic if recurisve is True :return: selfNrtz DRY-RUN: rzFetching remote z of submodule )rrz$Done fetching remote of submodule %rz:Module directory at %r does already exist and is non-emptyz Cloning url 'z' to 'z' in submodule T)rrrrrzDone cloning to %sr,zsubmodule: attaching head to %s)logmsgz%Failed to checkout tracking branch %srWz8Cannot update to latest revision in repository at %r as z6%s a tracking branch was not set for local branch '%s'z%%s there was no local tracking branchzNWill force checkout or reset on local branch that is possibly in the future ofzJthe commit it will be checked out to, effectively 'forgetting' new commitszRSkipping %s on branch '%s' of submodule repo '%s' as it contains un-pushed commitscheckoutresetFr working_treeuntracked_fileszCannot reset a dirty repositoryzUpdating working tree at z for submodule z to revision )r)rr z+Done updating working tree for submodule %r)rrrr)=rSrr/rvrr enumerater@BEGINupdaterFfetchENDr rrgrrrmdirOSErrorr?rWrrRr#r branch_namerrX set_objectrrr set_reference referenceset_tracking_branch IndexErrorlogwarningrrrrThexsha is_detached working_dirtracking_branchrerror merge_basedebuginfois_dirtyr rArkr r  Exceptionr iter_items)#r^rrrrrrrrrrrprefixrrmtslen_rmtsiremoteopcheckout_module_abspathrq remote_branch local_branchrrTrrmsg_baserrefrcommit may_reset base_commitmsgerrrJs# r5rzSubmodule.updatesf 9> K  %''H  ! F  EL j Q }t99!*4IAvBAvve OO QUQZQZ![[ #8 h 777HqL((c OO !G$)!SS )6-K QK QK Q KKK+/,'!39-D#E#E!!!89999"!!!%X[rr !!EMFDHHHHNeNeNegkgpgpqr   ,,   &9-A/E-  E%K14KKK Q_ $VU 3 3(@PTP`(a(a '-eT5E'F'F %//ud>O0P0PQQQ 00(#D|#S1 ,@@OOOO&(AB___ $KTM]^^^^^_0022Qf((DI)>)>txPPPQQQQQQQQQQQQQQQUK Qb[F[F #j4  %7 UX]Xii"Q :/??AAD'"&+!(!( T$!J0IIExPPP  UZ%6%=%G%G ! :$+t/@@@"'"2"25:3Df"M"MK;''1,,Q1KP[\]P^PeioPoPo ."rC#ooCIIcNNNN"vC + : Eg % %$C  HHSMMM(-I!]]5>>[_qu>3v3v]25:[\\\ I%FW[W`W`W`bfbkbkbkmsmstu P9P"P  **6*???? ((t$(OOO)OJTYVV      IIc#hh            !%!?!?  I$$!*!) '##-% sC C75V7L?V L?(D=<L?= EEEB L?B%J&%L?&1KL?KL?6/L1% L?1L5 5L?8L5 9L?<V>L??IV W*W  W module_path configurationrvc.||zdkrtd||j|}||jkr|St t |jj|}tj|rtd|z|jj }| |d}|r||j vrtd|rtj |rnttj|rtdtj|rtj|ntj|n |j}d} |rtj |rztj||d} tjtj|d r<||j|j|j} ||| |j} |r | |jd} |j | } |j | =t3j| d d |fz| d d z}||j |<n*#t6$r}t9d |jz|d }~wwxYw||5}|d|||_d d d n #1swxYwYn&#t>$r| rtj||wxYw| |jkr| ||S)aMove the submodule to a another module path. This involves physically moving the repository at our current path, changing the configuration, as well as adjusting our index entry accordingly. :param module_path: the path to which to move our module in the parent repostory's working tree, given as repository - relative or absolute path. Intermediate directories will be created accordingly. If the path already exists, it must be empty. Trailing(back)slashes are removed automatically :param configuration: if True, the configuration will be adjusted to let the submodule point to the given path. :param module: if True, the repository managed by this submodule will be moved as well. If False, we don't move the submodule's checkout, which may leave the parent repository in an inconsistent state. :return: self :raise ValueError: if the module path existed and was not empty, or was a file :note: Currently the method is not atomic, and it could leave the repository in an inconsistent state if a sub - step fails for some reason rzRYou must specify to move at least the module or the configuration of the submodulez&Cannot move repository onto a file: %srz-Index entry for target path did already existz*Destination module directory was not emptyFTrNr8z%Submodule's entry at %r did not exist)rrR)!rfrrSrRrrrergrrrrrrrlistdirislinkrrrrenamesrhrrFrrk IndexEntryrr rrr'rename)r^r9r:rvrmodule_checkout_abspathrtekeycur_pathrenamed_modulerprevious_sm_pathekeyrnentryrqrs r5movezSubmodule.moveFs( M !A % %qrr r $55diMM 49 , ,K#33ty7Q3R3RTh"i"i :- . . aEH__`` `  4a88  NUem33LMM M  z122 rz"9::;;S$%QRRR:5666I56666H45555  <  `cj** ` Jx!8 9 9 9!Nz#(#:FCCDD `!%!5!5diDI!V!V667NP^___  9  5r ??49a88D!M$/E d+ ^E"1"I9M8O,ORWXYXZXZR[,[\\F+1EM%((rrr34[_c_h4ijjpqqr ''e'445$$V-ABBB 4DI555555555555555    > 2H===    ty ( ( KK, - - - sU0K3A%IK J#I;;JKK7 KKK K K#K2c|s|stdd}|D] }|dz }|||||~!|r<|s:|dkr4|jd|jz|rk|rV|}|j}|r||j } d} tj | r tj} n?tj | rt} n#tj| rt!d|s| sJ| | nS|dddrt%d |jz|jD]} d} | j} | D]0}| t-|j|dkz } 1t-| r*| t-| krt%d |jzt-| r~~ ~ |s||j}~ddl}| tt9|n?#t:$r2}t<r%dd lm }|d !||d}~wwxYw|shtj |rT| t|n/#t:$r"}t<rdd lm }|d ||d}~wwxYw|s||r|s|j"j} |j#|$|j%d=n#tL$rYnwxYw|'|j"(5}|)tU|jdddn #1swxYwY|(5}|)dddn #1swxYwY|S)aRemove this submodule from the repository. This will remove our entry from the .gitmodules file and the entry in the .git / config file. :param module: If True, the module checkout we point to will be deleted as well. If the module is currently on a commit which is not part of any branch in the remote, if the currently checked out branch working tree, or untracked files, is ahead of its tracking branch, if you have modifications in the In case the removal of the repository fails for these reasons, the submodule status will not have been altered. If this submodule has child - modules on its own, these will be deleted prior to touching the own module. :param force: Enforces the deletion of the module even though it contains modifications. This basically enforces a brute - force file system based deletion. :param configuration: if True, the submodule is deleted from the configuration, otherwise it isn't. Although this should be enabled most of the times, this flag enables you to safely delete the repository of your submodule. :param dry_run: if True, we will not actually do anything, but throw the errors we would usually throw :return: self :note: doesn't work in bare repositories :note: doesn't work atomically, as failure to remove any part of the submodule will leave an inconsistent state :raise InvalidGitRepositoryError: thrown if the repository cannot be deleted :raise OSError: if directories or files could not be removedzCNeed to specify to delete at least the module, or the configurationrrz-Removed at least one of child-modules of '%s'NzKCannot forcibly delete repository as it was neither a link, nor a directoryTr zLCannot delete module at %s with any modifications, unless force is specifiedz3Cannot delete module at %s as there are new commits)SkipTestz'FIXME: fails with: PermissionError {}z%FIXME: fails with: PermissionError )+rfchildrenrrvrrrFrrrrgr>rrrrAssertionErrorr&r rerrefsrrkcherryrgccollectrr'runittestrKformatrSrrrRrrrremove_sectionr)r^rvrr:rnccsmmodrmpmethodr-num_branches_with_new_commitsrrefsr3wtdrPexrK parent_index gcp_writer sc_writers r5rzSubmodule.removesND d- dbcc c==??  C !GB JJvumW = = =  d dR!VV KKMM  & &'VY]Yb'b c c c T d((**T ++--CkGC \BF:b>>xYFFYr]]x#FFZ^^x()vwww!MMMF2JJJ<"&D K)""6**  f , ,*PVPVPVX\XkXkXklmm m%%  q((D4GSW(XXF%%j&;&;<< q&-# j]a]f]f]fhnhn!oppp , TY07DKK , , ,+DKKK ,  s $C11D  D r)r+Nrrcf|d}| ||j_||j_|S)aH:return: a config writer instance allowing you to read and write the data belonging to this submodule into the .gitmodules file. :param index: if not None, an IndexFile instance which should be written. defaults to the index of the Submodule's parent repository. :param write: if True, the index will be written each time a configuration value changes. :note: the parameters allow for a more efficient writing of the index, as you can pass in a modified index on your own, prevent automatic writing, and write yourself once the whole operation is complete :raise ValueError: if trying to get a writer on a parent_commit which does not match the current head commit :raise IOError: If the .gitmodules file/blob could not be readFr)rr_index _auto_write)r^rrrs r5rzSubmodule.config_writers9"0050AA  #(FM $) ! r7new_namec:|j|kr|S|j5}|t |jr5|t |jt |dddn #1swxYwY|dj5}|t |jt |dddn #1swxYwY||_|}| r| |j|j |}|j }t|t|j rV| |j|j ttj}t#j|||}t#j|||jr||j||S)aRename this submodule :note: This method takes care of renaming the submodule in various places, such as * $parent_git_dir / config * $working_tree_dir / .gitmodules * (git >= v1.8.0: move submodule repository to new name) As .gitmodules will be changed, you would need to make a commit afterwards. The changed .gitmodules file will already be added to the index :return: this submodule instance NTr)rFrSrrcrrename_sectionrrOrvhas_separate_working_treerrRrrruuiduuid4rr?rer)r^rkpwcwrWdestination_module_abspath source_dirtmp_dirs r5rAzSubmodule.renamesw 9 KY $ $ & & O"~~j3344 O!!*TY"7"7H9M9MNNN  O O O O O O O O O O O O O O O  d  + + 2 Kb   j33Z5I5I J J J K K K K K K K K K K K K K K K kkmm  ( ( * * i)-)=)=diT\)])] &J-..99#ck:J:JKK %..ty$)SEVEVWW :w///$ Jz#= > > ># i66s7KMghhh s$ABBB66C88C<?C<c|j} tj|}||jkr|S t d|z#tt f$r}t d|z|d}~wwxYw)z:return: Repo instance initialized from the repository at our submodule path :raise InvalidGitRepositoryError: if a repository was not available. This could also mean that it was not yet initializedz(Repository at %r was not yet checked outzNo valid repository at %sN)rrkr,rSr r )r^rBrSrqs r5rvzSubmodule.modules #', r8344Dty   ! ,,VYp,pqq q*?; j j j+,GJa,abbhi i js =A&A!!A&cR |dS#t$rYdSwxYw)zU:return: True if our module exists and is a valid git repository. See module() methodTF)rvr'rs r5rzSubmodule.module_existss;  KKMMM4   55 s  &&c t}|jD]B} t||rt||||<'#tjt f$rY?wxYw| |j |jD]}||vrt||||dS#t$r)Y|jD]}||vrt||||dSwxYw#|jD]}||vrt||||wxYw)z :return: True if the submodule exists, False otherwise. Please note that a submodule may exist ( in the .gitmodules file) even though its module doesn't exist on diskTF) localsrhasattrgetattrr rdrfrrRsetattrr')r^locr`s r5rzSubmodule.existssshh%  D 4&&4 'd 3 3CI%z2      3   ) 3 33;;D$D 222 3 3    ) 3 33;;D$D 222 3 3  ) 3 33;;D$D 222 3s3#=AA/B C(CCC'C;r-cPt||jS)z:return: The branch instance that we are to checkout :raise InvalidGitRepositoryError: if our module is not yet checked out)rrvrNrs r5rHzSubmodule.branchsdkkmmT%6777r7c|jS)zu :return: full(relative) path as string to the branch we would checkout from the remote and track)rNrs r5rXzSubmodule.branch_paths   r7cJtj|j|jjS)zK:return: the name of the branch, which is the shortest possible branch name)rkr-rSrNrFrs r5rzSubmodule.branch_name s x 4#455::r7c|jS)zJ:return: The url to the repository which our module - repository refers to)rMrs r5rWz Submodule.url's yr7r'cP|j|jS|jS)z:return: Commit instance with the tree containing the .gitmodules file :note: will always point to the current head's commit if it was not set explicitly)rLrSrrs r5rVzSubmodule.parent_commit,s*   &9##%% %""r7c|jS)a~:return: The name of this submodule. It is used to identify it within the .gitmodules file. :note: by default, the name is the path at which to find the submodule, but in git - python it should be a unique identifier similar to the identifiers used for remotes, which allows to change the path of the submodule easily rrs r5rFzSubmodule.name4s zr7c.|dS)a :return: ConfigReader instance which allows you to qurey the configuration values of this submodule, as provided by the .gitmodules file :note: The config reader will actually read the data directly from the repository and thus does not need nor care about your working tree. :note: Should be cached by the caller and only kept as long as needed :raise IOError: If the .gitmodules file/blob could not be readTr)rrs r5rbzSubmodule.config_reader?s...>>>r7c,||S)z :return: IterableList(Submodule, ...) an iterable list of submodules instances which are children of this submodule or 0 if the submodule is not checked out)rxrs r5rLzSubmodule.childrenIs++D111r7HEADArgsc/K ||}|||d}n&#ttf$rt gcYSwxYw|D]Z}t |}||d} ||d} |j} | ||j r(t|||j } |j } |j } | | }ne#t$rX | j| | d}t#||j|j|j}n#t$rYYwxYwYnwxYw||_||kr||_t.j| |_| |_|V\dS)zP:return: iterator yielding Submodule instances available in the given repositoryTrrRrWrN)rrrr itersectionsrrcrm has_optionrjrrrrrrr.rTrUrRrOrLrkr-rlrNrM)rwrSrVrrrrsmsrpurrrtrrs r5r(zSubmodule.iter_itemsSs ]++B''bD'AAFF!   88OOO ??$$" " C A 3''A 3&&A"A  c&788 < 3(9::;;JE WU   !M%//!Q*?*?@E"4uz5:NNBBHHB  BHT[[]]""$&!!h33A66BOBGHHHHE" " sF-2 AA<D  E.AEE. E($E.'E((E.-E.)NNNNNN)rYN)FF)NNFNNNFF) FTFNFFFNNFF)TT)TFTF)T)NT)rYr,)rYr-)rYr')r)Kr:r;r<r=_id_attribute_rrjrmstatS_IFDIRS_IFLNKrrKr(rCrDrbytesr&rBr)rr'r\ro classmethodrrxrboolr}r$robjectrrrrrrrrrrrrrrrr r!r*rrrrIrrgrrArvrrpropertyrHrXrrWrVrFrbrLr%r( __classcell__)r_s@r5r.r.Wsy ;;N"NMN\DL0N"-D'+ ,,,RI3L "&&*!%15 $-1CI  HdN#  CI Z-.39 8T>* <55555555,$;$< ;T$$$[$1314111[1)C)D))))#F#t#### #     #    !E!E*/ D0@*A!ENR!E !E!E!E[!EF[ @D @=N @ @ @ @#&###PX###[#&+',&&&& &  & # &!%&& &&&[&PF(x[.[chl[6 !%#'!"&.2:>%*',llll l 39  l c4i llS$Yl738$d* +l#8C=$#67l#l!%l lll[l` #(26 .2:>%*',ffff! f ./ f  fff738$d* +f#8C=$#67f#f!%f ffffP jjjjdj^ijjj[jX" ffff f  f  fff[fP--j$.>(?--Xc----^DH,-=A 2 3[,-s-{---[-frrr[r"t33333D888X8 !X!!!X! ;S;;;X; SX###X#cX?01FG????2,{3222217111Z_-1 1  1 +  111[11111r7)Liorloggingrrrorkgit.cmdr git.compatrr git.configrrr git.excr r r r git.objects.baserrgit.objects.utilrgit.utilrrrrrrros.pathrRrgutilrrrrrtypingrrr r!r"r#r$r%r& git.typesr'r(r)r* git.indexr+git.repor,git.refsr-__all__ getLoggerr addHandler NullHandlerr/rrr?r@rAr.r2r7r5rsJ >========= 10000000333333/.....JIIIIIIIIIIIIIII''''''''''888888888888###### ( )g455"w"$$%%%^   $ nnnnn 3nnnnnr7