yL iWvddgZddlZddlmZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZddlmZmZmZddlmZmZmZmZdd lmZmZdd lmZdd l m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&d d l'm(Z(m)Z)m*Z*m+Z+m,Z,ddl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6e jndk\rddl-m8Z8nddl9m8Z8ddl:m;Z;mm?Z?ddl@mAZAddlBmCZCddlDmEZEejeGZHGdde"ZIeIjZJeIjZKeIjZLeIjZMeIjZNGddeeZOy) SubmoduleUpdateProgressN)BytesIO)Git)defenc)GitConfigParserSectionConstraintcp)BadNameInvalidGitRepositoryErrorNoSuchPathErrorRepositoryDirtyError) IndexObjectObject)TraversableIterableObj) IterableListRemoteProgressjoin_path_nativermtreeto_native_path_linux unbare_repo)SubmoduleConfigParserfind_first_remote_branchmkheadsm_name sm_section) AnyCallableDictIteratorMappingSequence TYPE_CHECKINGUnioncast))Literal) Commit_ishPathLikeTBD) IndexFile)Commit)Head)RepoceZdZUdZeej ej dzDcgc]}d|z c}}\ZZZ ej dzZe e d<dZ ycc}}w)rzClass providing detailed progress information to the caller who should derive from it and implement the :meth:`update(...) ` message.r'r _num_op_codesN) __name__ __module__ __qualname____doc__rangerr2CLONEFETCH UPDWKTREEint__annotations__ __slots__).0xs00`/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/git/objects/submodule/base.pyrrMs_E05^5Q5QSaSoSorsSs/tu!qAvuE5)'559M39Ivs AcFeZdZUdZdZdZdZdZejejzZ dZ e ded< dZd Z d\d d d edeed fdeed fdeed fdeddeed fdeed fdd ffd Zdedd ffd ZedddedfdZededefdZdedefdZde defdZ!defdZ"defd Z#defd!Z$ed d dedd"ede%fd#Z&d]d$Z'edd%de(fd&Z)d"ede*fd'Z+ed(d dededefd)Z,e d^d d dededed*ed+ed,edd fd-Z-ed(d dedefd.Z.ed/ed0edd fd1Z/e d_d d dededeed fdeed fd2ed3eed fd4ee0eefd fd5ee1e2d fd*ed+eddfd6Z3 d`d7ed8ed9ed:ed;ded4ee0eefd fd5ee1e2d fd*ed+eddfd?Z4e5dad@edAedBeddfdCZ6e5 dbdBed=edAede?dfdRZ@e?defdSZAe?defdTZBe?defdUZCe?dgdVZDe?defdWZEde*e%fdXZFdedfdYZGe dhd d dee8efdZed,edeHdf d[ZIxZJS)ira|Implements 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__pathrJrKNrepor0binshamoderO parent_commit)r.Nurl branch_pathreturnc ~t |||||d|_||_|||_|||_|||_yy)aJInitialize this instance with its attributes. We only document the parameters that differ from :class:`~git.objects.base.IndexObject`. :param repo: Our parent repository. :param binsha: Binary sha referring to a commit in the remote repository. See the `url` parameter. :param parent_commit: The :class:`~git.objects.commit.Commit` whose tree is supposed to contain the ``.gitmodules`` blob, or ``None`` to always point to the most recent commit. See :meth:`set_parent_commit` for details. :param url: The URL to the remote repository which is the submodule. :param branch_path: Full repository-relative path to ref to checkout when cloning the remote repository. rN)super__init__sizerIrJrKrL) selfrPrQrRrOrCrSrTrU __class__s rArYzSubmodule.__init__{sTF vtT2 + ?DI  " +D   DJ attrc2|dvr|j} |jd|_|jd|_ |j|jtjj|j |_y|dk(r t%dt&|Q|y#tj$rW}|j j 7tdtj|j j dz|Yd}~d}~wwxYw)NrNrOz;This submodule instance does not exist anymore in '%s' filerDrTrLzCCannot retrieve the name of a submodule if it was not set initially) config_readergetrOr NoSectionErrorrPworking_tree_dir ValueErrorospjoinrJ get_value k_head_optiongitr/ to_full_pathk_head_defaultrKAttributeErrorrX _set_cache_)r[r^readerer\s rArmzSubmodule._set_cache_s 3 3(,(:(:(>$++-0 0( $# # $s !88ric&|jdddk\S)Nr')r) version_info)ruris rA_need_gitfile_submodulesz"Submodule._need_gitfile_submoduless#y00r]otherc4|j|jk(S)zCompare with another submodule.rLr[r|s rA__eq__zSubmodule.__eq__s zzU[[((r]c||k( S)z.Compare with another submodule for inequality.r3rs rA__ne__zSubmodule.__ne__sEM""r]c,t|jS)z5Hash this instance using its logical id, not the sha.)hashrLr[s rA__hash__zSubmodule.__hash__sDJJr]c|jS)Nr~rs rA__str__zSubmodule.__str__s zzr]c dt|jd|jd|jd|jd|j d S)Nzgit.z(name=z, path=z, url=z, branch_path=))rHr4rLrOrTrUrs rA__repr__zSubmodule.__repr__s7 J   JJ II HH      r] read_onlycd}| |jj|k(}|js9|r7|jr+t j |j|j}n|Jd |j|}|s|js|s tdt||S#t$rYwxYw#t$r!}td|jd||d}~wwxYw)ag :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 parser. TNz-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) headcommitrdbarercrerfk_modules_file _sio_modulesKeyErrorIOErrorr)rurPrSrparent_matches_head fp_moduleros rA_config_parserzSubmodule._config_parsers#  $ &*ii&6&6-&G#yy0T5J5J!6!68J8JKI , ].] ], ,,]; dii/BZ[ [%Y)DD/   PSPbPbdqr s)B'.B6' B32B36 C ?CC c^|jD]} t||y#t$rYwxYw)z"Clear the possibly changed values.N) _cache_attrsdelattrrl)r[rCs rA _clear_cachezSubmodule._clear_caches:%% D d# "  s  ,,r.ct|j|jjj }|j|_|S)z :return: Configuration file as :class:`~io.BytesIO` - we only access it through the respective blob's data )rtreer data_streamreadrC)rurSsios rArzSubmodule._sio_moduless@m((););<HHMMOP%% r]c |j}|j|j||}|j |t |t |jS#t$rd}YZwxYw)zI:return: Config parser constrained to our submodule in read or write modeN)rSrdrrP set_submoduler rrC)r[rpcparsers rA_config_parser_constrainedz$Submodule._config_parser_constrained%sf ##B$$TYYI>T" DII)>??  B s A A)(A) parent_repoc|j|jr!tj|jd|S|j r tj|j |St )Nmodules)r{rirerfgit_dirrcNotADirectoryError)rurrOrCs rA_module_abspathzSubmodule._module_abspath0sV  ' '  888K//DA A  ' '88K88$? ? ""r]allow_unsafe_optionsallow_unsafe_protocolskwargsc |j|||}|} |j|jrm||d<tj|} tj | st j| tjt|j|} |jdr_|jjj} |j| j } t j"j| |}tj$j&|| f||d|} |j|jr|j)| || S)a :return: :class:`~git.repo.base.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 name 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 :manpage:`git-clone(1)`. separate_git_dirz../)rr)rr{riredirnameisdirosmakedirsrfstrrc startswith active_branchtracking_branch remote_nameremoterTrOr0 clone_from!_write_git_file_and_module_config)rurPrTrOrCrrrmodule_abspathmodule_checkout_pathmodule_abspath_dirrrepo_remote_urlclones rA _clone_repozSubmodule._clone_repo8s*H,,T4>-  ' ' 1)7F% &!$^!< 99/0 ./#&88C0E0E,F#M >>% ,,<<>JJK"kk+6::O'',,4C##   "6#9      ' ' 1  1 12F W r]cZt|}|jdr|dd}tj|rt|jrht|j}|j |st d|d|d|t|jddzd}|st d|z|S) z:return: A path guaranteed to be relative to the given parent repository :raise ValueError: If path is not contained in the parent repository's working tree. /NzSubmodule checkout path 'z0' needs to be within the parents repository at ''rz?Absolute submodule path '%s' didn't yield a valid relative path) rendswithreisabsrcrrdlenrstrip)rurrOworking_tree_linuxs rA_to_relative_pathzSubmodule._to_relative_pathvs$D) == 9D 99T?{;;!5k6R6R!S ??#56 )41.55c:;a?ABD !bei!ijj r]rcrc 8tj|d}tj||}tjdk(r*tj |rt j|t|d5}|jd|zjtdddttj|ddd 5}|jd d ttj||dddy#1swYfxYw#1swYyxYw) aWrite a ``.git`` file containing a (preferably) relative path to the actual git module repository. It is an error if the `module_abspath` cannot be made into a relative path, relative to the `working_tree_dir`. :note: This will overwrite existing files! :note: As we rewrite both the git file as well as the module configuration, we might fail on the configuration and will not roll back changes done to the git file. This should be a non-issue, but may easily be fixed if it becomes one. :param working_tree_dir: Directory to write the ``.git`` file into. :param module_abspath: Absolute path to the bare repository. .git)startwin32wbz gitdir: %sNconfigF)rmerge_includescoreworktree)rerfrelpathsysplatformisfilerremoveopenwriteencoderr set_valuer)rurcrgit_file rela_pathfpwriters rArz+Submodule._write_git_file_and_module_configs.88,f5KK6FG <<7 "szz('; IIh  (D ! @R HHlY.66v> ? @SXXnh?5af g kq   $S[[1A%XY    @ @  s7(D 2DD D no_checkoutdepthenvclone_multi_optionsc P|jr td|j||}| t|}|||j|j ||d} | j r6 |jjjt|} || _ | St#j$|t"j$j't|xs |j(}| j+}|du}|rR|P|| j-j.Dcgc]}|j0c}vrt3d|d| j4dd}|c|st3d |z| j-}|j.Dcgc]}|j0}}|st3d | j4z|d}nYd |i}|s|j6|d <|r!t9|t:r||d <n t3d| r| |d<|j<||||f|| | d|}t?j@|}| jBjE5}|jGtI|d|ddd| jBj} | jE| d5}|jGd||jGd||| _%|s7|jG|jL|jN|jN| _(ddd|r%|jjj | _| jS| gd| S#t$rA|j} | j| j|d}|j | _| cYSwxYwcc}wcc}w#1swY4xYw#1swYxYw)ax 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 :manpage:`git-clone(1)` 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 another one. :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 attr:`os.environ`, the value from attr:`os.environ` will be used. If you want to unset some variable, consider providing an empty string as its value. :param clone_multi_options: A list of clone options. Please see :meth:`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 :class:`Submodule` instance. :note: Works atomically, such that no change will be done if, for example, the repository update fails. z*Cannot add submodules to bare repositoriesNzinvalid-temporary)rTrzSpecified URL 'z6' does not match any remote url of the repository at 'rz8A URL was not given and a repository did not exist at %sz.Didn't find any remote url in repository at %snbrzdepth should be an integer multi_options)rrrrTF)indexrrOTr)*rr rr NULL_BIN_SHAk_default_modeexistsrrrrrLrrentries entry_keyrQrir/rjrk module_existsrtremotesrTrdabspathrC isinstancer<rr polish_urlrP config_writerrrrJrhrOrKadd)rurPrCrOrTrErrrrrrsmrentrybr has_modulebranch_is_defaultrmrepourlsrrs rArz Submodule.addszb 99+,XY Y$$T40 ?&s+C         #   99; YY%%**3t95 XXdCHH11#f+2SASAST U%%' "dN #/"))+*=*=>Q155>> dgikisist $( ; ![^b!bccIIKE#(==1aAEE1D1 !QTVT^T^!^__q'CHKKFXF$ ggs eS)&+F7O$%ABB"*='$COO  %9'=  EnnS!WW " " $ ;   Z-uc : ;    E  7 *6   UC (   VT *BG$  !2!2BGG<"$'' *  ))00BI 2$d # w   eoodA&>?!LL   ?2T ; ;  * *s8*4L8NN NA%N8ANNNN% recursiveinitto_latest_revisionprogress)rNdry_runforce keep_goingc  |jjr|S| t}d} |rd} |rd} |j} | j}t |}t |D]\}}t}|dk(r |tz}|j|||| d|d|jz|s|j|||dz k(r |tz}|j|||| d |jzz |j^}|j`}| | jJjb}| |rd| jdz}sw| jJjNjg}|%|jh}|j^}|j`}nBtTjkd|| jJjNntTjkd|| | jJjhj^|k7rd}| jJjhj^|jHk7r| jm| jJjh|} t | dk(s| dd| dj`|k(rR|rd}!|!dz }!tTjo|!n3d}!|!xrdxsd| jJ| fz}!tTjq|!d }|r"|s | jsddd!r tu| d"|jttvzdd| d#|j8d$|jd%|z|s@|r>r| jxj{||&n| jJj}|dd'|jttvzdd| d(|jzz|r> <|j|jD]}#|#j|||||||)|S#t$rd} |s|cYS|j}|sLtj |r7 t#j$|n #t&$r}t'd |z|d}~wwxYw|jtt(zdd| d |j*d |d |jz|s|j*j-drVt.j0j3|jjj4j*dz|j*}n |j*}|j7|j||j8|jd|| | |  } |jtt(zdd| d|zz|sC t;d| } t=| j|j>}tA| |jB}|jEtG| |jH| jJjM|d|z| jJjNjQ|n5#tRtf$r#tTjWd|jBYnwxYw|jjY5}|j[t]|jd|j*dddn #1swYnxYwYwxYw#t~$r,}"|stTjkt|"Yd}"~"Fd}"~"wwxYw)*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 if the ``branch`` option was specified for this submodule and the branch existed remotely. :param progress: :class:`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. Additionally 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 attr:`os.environ`, value from attr:`os.environ` will be used. If you want to unset some variable, consider providing the empty string as its value. :param clone_multi_options: List of :manpage:`git-clone(1)` options. Please see :meth:`Repo.clone ` for details. They only take effect with the `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: This method is definitely not atomic if `recursive` is ``True``. :return: self Nrrz 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 .rT)rrrrrzDone cloning to %sr0zsubmodule: attaching head to %s)logmsgz%Failed to checkout tracking branch %srTz8Cannot 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 ofzK the 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)rrz+Done updating working tree for submodule %r)rrrr)BrPrrrtrr enumerater:BEGINupdaterCfetchENDr rrerrrmdirOSErrorr9rTrurllibparseurljoinoriginrrOr&r branch_namerrU set_objectrrr set_reference referenceset_tracking_branch IndexError_loggerwarningrrrrQhexsha is_detached working_dirrrerror merge_basedebuginfois_dirtyrr;rir r  Exceptionr iter_items)$r[rrrrrrrrrrrprefixrrmtslen_rmtsiropcheckout_module_abspathrorT remote_branch local_branchrrQr$r%msg_baserrefrcommit may_reset base_commitmsgerrrGs$ rArzSubmodule.updatesh 99>>K  %'H  F ET $o Q }}t9!*4IAvBAve OO QUQZQZ![[ # h 7HqL(c OO !G$))!SS )b[[F[[F $jj44  %7UX]XiXii" :://??AD'"&++!(!( T$!JJ00MM"I8T  UZZ%6%6%=%=%G! ::$$++t/@/@@"'"2"25::3D3Df"MK;'1,Q1KP[\]P^PePeioPo "rC#ppC#MM#."vC + : Eg % %$C $LL-(-I!5>>[_qu>3v25:[\\ I%W[W`W`bfbkbkmstu 9"  **6*? ((t$(O)OJTYYVV   !%!? I$$!*!) '##-%  Q-P QK+/,,'399-D#E!!89"!%X[rr !!EMDHHHNegkgpgpqr xx**3/$ll224993D3D3K3K3O3ORU3UW[W_W_`"hh ,,   &9-A/E- E%K14KKK c $VU 3(@PTP`P`(a '-eT5E5E'F %//ud>O>O0PQ 00(#D|#S1 ,,@@O&(ABc(OQUQaQabc002Qf((DII)>txxPQQQ_P Q^ $ MM#c( # # $sB>O /JZ ZZ#ZPZ P4 P//P44D!ZB,XZ/X52Z4X55Z1Z  Z Z ZZZZ [(![[ module_path configurationrtcL||zdkr td|j|j|}||jk(r|St t |jj |}tj|rtd|z|jj}|j|d}|r||jvr td|rtj|rjttj|r tdtj |rtj"|ntj$|n |j&}d} |rtj|rtj(||d} tjtj*|d rC|j-|j|j|j.} |j1|| |j} |r |j|jd} |j| } |j| =t3j4| d d |fz| d d z}||j|<|j;|5}|j=d|||_d d d | |j.k(r|jA||S#t6$r}t9d |jz|d }~wwxYw#1swYUxYw#t>$r| rtj(||wxYw)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 repository'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 emptyFTrNr'z%Submodule's entry at %r did not exist)rrO)!rdrrPrOrrrcrerrrrrrrlistdirislinkrrrrenamesrfrrCrri IndexEntryrr rrr,rename)r[r=r>rtrmodule_checkout_abspathrtekeycur_pathrenamed_modulerprevious_sm_pathekeyrnentryrors rAmovezSubmodule.moves> M !A %qr r $55diiM 499 ,K#33tyy7Q7Q3RTh"i ::- .EH__` `  4a8 Uemm3LM M zz12rzz"9:;$%QRR::56II56HH45  << cjj* JJx!8 9!Nzz#((#:FCD!%!5!5diiDII!V667NP^_  99 r ??499a8D!MM$/E d+ ^^E"1I9M8O,ORWXYXZR[,[\F+1EMM%( ''e'45$$V-AB 4DI5 tyy ( KK, - + r34[_c_h_h4ijpqqr 55  2H=   sIL A)K 4LK4 L K1K,,K11L4K=9L#L#c|s |s tdd}|jD]}|dz }|j||||~|r=|s;|dkDr6|jjj d|j z|r|jr|j}|j}|r|j} d} tj| rtj} nrnccsmmodrmpmethodrnum_branches_with_new_commitsrrefsr7wtd parent_index gcp_writer sc_writers rArzSubmodule.removeIsf-bc c==? C !GB JJvumW =  R!V KKM   & &'VY]YbYb'b c d((*++-CkkG \\BF::b>YYFYYr]#FZZ^()vww!M62J<"&D K))""6*   f ,PVX\XkXklm m%%% ((D4G4GSW(XF%%j&;<&-# ]a]f]fhn!opp , TYY077DK   ,++DK ,s!'DD76D7r)r-Nrrcr|jd}|||j_||j_|S)a :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 :class:`~git.index.base.IndexFile` instance which should be written. Defaults to the index of the :class:`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 read. Fr)rr_index _auto_write)r[rrrs rArzSubmodule.config_writer+s::0050A  #(FMM $) ! r]new_namec*|j|k(r|S|jj5}|jt |jr.|j t |jt |ddd|jdj 5}|j t |jt |ddd||_|j}|jr|j|j|j|}|j}t|jt|jrZ|j|j|jttj }t#j$|||}t#j$|||j&r|j)|j&||S#1swY~xYw#1swY8xYw)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 :class:`Submodule` instance NTr)rCrPrrcrrename_sectionrrLrthas_separate_working_treerrOrrruuiduuid4rrCrcr)r[rkpwcwrXdestination_module_abspath source_dirtmp_dirs rArEzSubmodule.renameNs" 99 KYY $ $ & O"~~j34!!*TYY"7H9MN  O  d  + 2 2 Kb   j3Z5I J K kkm  ( ( *)-)=)=diiT\)] &J-.99#ckk:JK..tyy$))SEVW :w/$ JJz#= >##66s7K7KMgh ; O O K KsAG;#/H;HHc|j} tj|}||jk7r|S t d|z#tt f$r}t d|z|d}~wwxYw)a2 :return: :class:`~git.repo.base.Repo` instance initialized from the repository at our submodule path :raise git.exc.InvalidGitRepositoryError: If a repository was not available. This could also mean that it was not yet initialized. z(Repository at %r was not yet checked outzNo valid repository at %sN)rrir0rPr r )r[rFrPros rArtzSubmodule.modules{#',, r8834Dtyy  ! ,,VYp,pq q*?; j+,GJa,abhi i js%AA&A!!A&cD |jy#t$rYywxYw)z :return: ``True`` if our module exists and is a valid git repository. See the :meth:`module` method. TF)rtr,rs rArzSubmodule.module_existss%   KKM  s  c t}|jD]} t||rt||||< |j |j |jD]}||vst||||y#tj t f$rYwxYw#t$r)Y|jD]}||vst||||ywxYw#|jD]}||vst||||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 disk. TF) localsrhasattrgetattrr rbrdrrOsetattrr,)r[locr^s rArzSubmodule.existss!h%% D 4& 'd 3CI   3   )) 33;D$D 2 3%%z2   )) 33;D$D 2 3  )) 33;D$D 2 3s;A> B>BB C&CCCC:'C:cJt|j|jS)z :return: The branch instance that we are to checkout :raise git.exc.InvalidGitRepositoryError: If our module is not yet checked out. )rrtrKrs rArEzSubmodule.branchsdkkmT%6%677r]c|jS)z :return: Full repository-relative path as string to the branch we would checkout from the remote and track )rKrs rArUzSubmodule.branch_paths   r]cjtj|j|jjS)zi :return: The name of the branch, which is the shortest possible branch name )rir/rPrKrCrs rArzSubmodule.branch_names%xx 4#4#45:::r]c|jS)zG:return: The url to the repository our submodule's repository refers to)rJrs rArTz Submodule.urlsyyr]cf|j|jjS|jS)z :return: :class:`~git.objects.commit.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. )rIrPrrs rArSzSubmodule.parent_commits/    &99##% %"""r]c|jS)a :return: The name of this submodule. It is used to identify it within the ``.gitmodules`` file. :note: By default, this is the name is the path at which to find the submodule, but in GitPython it should be a unique identifier similar to the identifiers used for remotes, which allows to change the path of the submodule easily. r~rs rArCzSubmodule.nameszzr]c&|jdS)a :return: ConfigReader instance which allows you to query 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 read. Tr)rrs rAr`zSubmodule.config_readers ...>>r]c$|j|S)z :return: IterableList(Submodule, ...) An iterable list of :class:`Submodule` instances which are children of this submodule or 0 if the submodule is not checked out. )rvrs rArOzSubmodule.children s++D11r]argsc/K |j|}|j||d}|j D]'}t |}|j |d} |j |d} |j} |j||jr%t|j ||j} |j} |j} | | }t)|t*j,j.j0j ur||_||jk7r||_t*j6j9| |_| |_|*y#ttf$rYywxYw#t$rb | j| j| d}t!||j"|j$|j&}n#t$rYYwxYwY wxYww)z :return: Iterator yielding :class:`Submodule` instances available in the given repository TrNrOrTr)rrrr sectionsrrark has_optionrhrrrrrrrrQrRrOrHriobjectsrGbaserLrIr/rjrKrJ)rurPrSrrrrsmsrpurrrtrrs rAr-zSubmodule.iter_items-s ]+B''bD'AF ??$& C A 3'A 3&A""A  c&7&78 3(9(9:;JJE WWUBxs{{4499CCCBHT[[]"$&!!hh33A6BOBGHM&  !   $ !MM%//!Q*?@E"4uzz5::NB  sxG(%E%BG(E:BG(%E74G(6E77G(: G%A GG% GG%G(GG%!G($G%%G()NNNNNN)rVN)FF)NNFNNNFF) FTFNFFFNNFF)TT)TFTF)T)NT)rVr0)rVr/)rVr.)HEAD)Kr4r5r6r7_id_attribute_rrhrkstatS_IFDIRS_IFLNKrrHr)r=r>rbytesr%r<r+rrYrm classmethodrrvrboolr{rrobjectrrrrrrrrrr rrrrrr"r#r,rrrrMrr*rgrrErtrrpropertyrErUrrTrSrCr`rOr!r- __classcell__)r\s@rArrbs!N"NMN\\DLL0NG!,D'+ ,CRI3L "&&*!%/3 $-1+++CI + HdN# + CI +^,+39 +8T>*+ +Z&&&,$;$< ;T$$131411)C)D)#F#t# #  # 'E'E*/*?'ELP'E 'E'ERg @D @=N @#&###PX##&+',;;; ;  ; # ;!%;; ;;zF(x4""[c"hl""L !%#'!"&.2:>%*',EEE E 39  E c4i EES$YE738$d* +E#8C=$#67E#E!%E EER #(26 .2:>%*',OOO! O ./ O  OOO738$d* +O#8C=$#67O#O!%O Ob uuudu^iuun" jjj j  j  jjX3j#t.C(D3T3]h3jDH ,- =A  2 3  D1s1{11nrr, t  3 3J88!X!!;S;;S # # c  ?01FG?$2,{321799Z_-9 9  9 +  99r])P__all__rSiorloggingros.pathrOrerrrorrigit.cmdr git.compatr git.configrr r git.excr r r rgit.objects.baserrgit.objects.utilrgit.utilrrrrrrutilrrrrrtypingrrr r!r"r#r$r%r&rzr)typing_extensions git.typesr*r+r, git.indexr-git.objects.commitr.git.refsr/git.repor0 getLoggerr4r"rrrr9r:r;rr3r]rArs ( )   == 13   v)//#) '  H %^   $ $ E 3Er]