eU7# PUddlmZddlmZddlmZddlZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZddlZddlmZmZddlZddlmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+ddl,Z,e*rdd l-m.Z.dd l/m0Z0dd l1m2Z2m3Z3dd l4m5Z5dd l6m7Z7m8Z8m9Z9m:Z:m;Z;mZ>m?Z?e'de(ddZ@ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJgdZKe jLeMZNeoe jOPddZQeoe jOPddZRe'dZSdedeSfdedeSffdZTejUde;dee;ddffdZVde;ddfdZWde;ddfdZXdjd!ed"ed#eYdeYfd$ZZd%e;d&e;de;fd'Z[er(de;de;fd(Z\de;de]fd)Z^eK_d*e\Z`n de;de]fd+Z^e^Z`d%e;d&e;de;fd,Zadkde;d.ebdebfd/Zcde%e]fd0Zddld1e]de#e;de"e]fd2Zed3e#e]de]de]fd4Zfejgd5d6d-fejgd7efd-fejgd8efd-fejgd9ejhd:dfejgd;d<d-ffZie&e&e$e]eebfdfejd=<de]de]fd>Zkejgd?Zlde;de]fd@ZmiZnee]e#ebfejdA<e+dBdde7d-fdCZoe+dBe;debfdDZodBe(de;fdebfdEZode]fdFZpdGe(ejqdHfdIeddfdJZre+dmd&ddKebddfdLZse+dmd&e;dKebde]fdMZsdnd&e(de;fdKebde#e;fdNZsdOe%e]de"e]fdPZtGdQdReuZvGdSdTevZwGdUdVeuZxGdWdXeuZyGdYdZeuZzGd[d\euZ{Gd]d^e{Z|Gd_d`e"e@Z}Gdadbe~ZGdcddeeZe:Gdfdge9ZGdhdie jZdS)o)abstractmethodN)is_win)wraps)maxsize)urlsplit urlunsplit)AnyAnyStrBinaryIOCallableDict GeneratorIOIteratorListOptionalPatternSequenceTupleTypeVarUnioncast TYPE_CHECKINGoverload)Remote)Repo)GitConfigParserSectionConstraint)Git) Literal SupportsIndexProtocolruntime_checkablePathLikeHSH_TDTotal_TDFiles_TDHas_id_attribute T_IterableObj) IterableObjr)T)bound covariant) make_shaLockedFDfile_contents_rofile_contents_ro_filepath LazyMixin to_hex_sha to_bin_sha bin_to_hex hex_to_bin) stream_copy join_pathto_native_path_linuxjoin_path_nativeStatsIndexFileSHA1Writerr+ IterableListBlockingLockFileLockFileActor get_user_idassure_directory_existsRemoteProgressCallableRemoteProgressrmtree unbare_repoHIDE_WINDOWS_KNOWN_ERRORSrGHIDE_WINDOWS_FREEZE_ERRORSTfunc.returnc |ddlmtdddtdtdtffd }|S) zqMethods with this decorator raise :class:`.exc.InvalidGitRepositoryError` if they encounter a bare repositoryr)InvalidGitRepositoryErrorselfrargskwargsrKcZ|jjrdjz|g|Ri|S)Nz/Method '%s' cannot operate on bare repositories)repobare__name__)rNrOrPrMrJs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/util.pywrapperzunbare_repo..wrappersK 9> o++,]`d`m,mnn ntD*4***6***)excrMrr rI)rJrVrMs` @rUrFrFsn/..... 4[[+h+s+c+a++++++[+ NrWnew_dirc#Ktj}tj| |Vtj|dS#tj|wxYwN)osgetcwdchdir)rYold_dirs rUcwdr`s[ikkGHW  s AApathcddtdtdtddfd}tj|d|S)zRemove the given recursively. :note: we use shutil rmtree but adjust its behaviour to see whether files that couldn't be deleted are read-only. Windows will not remove them in that caserJraexc_inforKNctj|tj ||dS#t$r2}t r%ddlm}|d||d}~wwxYw)Nr)SkipTestz'FIXME: fails with: PermissionError {}) r\chmodstatS_IWUSR ExceptionrGunittestreformat)rJrarcexres rUonerrorzrmtree..onerrors t|$$$  DJJJJJ   ( ^------hIPPQSTTUU[]]   s . A*-A%%A*F)r r%strshutilrE)rarms rUrErEsH h h # $     =ug . ..rWctj|r2trtj|dtj|dSdS)zSEnsure file deleted also on *Windows* where read-only files need special treatment.iN)ospisfilerr\rfremoveras rUrmfilerusI z$  " HT5 ! ! ! $rWsource destination chunk_sizecd} ||}|||t|z }t||krnQ|S)zCopy all data from the source stream into the destination stream in chunks of size chunk_size :return: amount of bytes writtenr)readwritelen)rwrxrybrchunks rUr7r7sc B J''%    c%jj u:: " "   IrWapct|}|D]`}t|}|s|dr||ddz }7|dks|dr||z }X|d|zz }a|S)zhJoin path tokens together similar to osp.join, but always use '/' instead of possibly '' on windows./rN)rn startswithendswith)rrrabs rUr8r8s q66D    FF   <<    AabbEMDD RZZ4==--Z AIDD C!GODD KrWcLt|}|ddS)Nr\rnreplacerts rUto_native_path_windowsrs!4yy||C&&&rWcLt|}|ddS)Nrrrrts rUr9r9s!4yy||D#&&&rWrc t|Sr[)rnrts rUr9r9s4yyrWc6tt|g|RS)z As join path, but makes sure an OS native path is returned. This is only needed to play it safe on my dear windows and to assure nice paths that only use '')to_native_pathr8)rrs rUr:r:s" )A**** + ++rWFis_filec|rtj|}tj|stj|ddSdS)zAssure that the directory pointed to by path exists. :param is_file: If True, path is assumed to be a file and handled correctly. Otherwise it must be a directory :return: True if the directory was created, False if it already existedT)exist_okF)rqdirnameisdirr\makedirs)rars rUrBrBsJ !{4   9T?? D4((((t 5rWctjdd}|r6td|tjDn t rdndS)NPATHEXTc3>K|]}|VdSr[)upper).0rs rU z&_get_exe_extensions..s* ; ;Aaggii ; ; ; ; ; ;rW)z.BATCOMz.EXEr)r\environgettuplesplitpathsepr)rs rU_get_exe_extensionsr s[jnnY--G?Fw ; ;rz!:!: ; ; ;;;;gmLwLcLctvrWprogramctdtdtffd }g}|stjd}t|tjD]c}|d}|rJtj ||gfdDzD]"}||r| |#d|S)NfpathrKctjoLtjtjo-tjdkp pt fdDS)Nntc3fK|]+}|V,dSr[)rr)rextrs rUrz,py_where..is_exec..s;;p;p\_EKKMM.is_execsg Ju   r %)) rDp $4p;p;p;p;pco;p;p;p8p8p rWPATH"cg|]}| Sr)reexe_paths rU zpy_where..%s""P"P"PaXXqq#9"P"P"PrW) rrnboolr\rrrstriprqjoinappend)rrarprogsfolderfrrs @@rUpy_wherers&((L s t       E "z&!d))//"*--$$c""  $x00HZ"P"P"P"P<"P"P"PP $ $71::$LLOOO LrWdrivec|tj|r|s|}n|o7tjtjtj|}tj|r|r|}n,t |}n|rd|d|}t|}|ddS)Nz/proc/cygdrive/rr) rqisabsnormpath expandvars expandusercygpathlowerrnr)rrarp_strs rU _cygexpathr+s y rCs,&&&%%%IZIZ[_adIeIeIe*frWz\\\\\?\\(\w):[/\\](.*)z(\w):[/\\](.*)z file:(.*)c|Sr[r)rs rUrrHs rWz (\w{2,}:.*)c|Sr[r)urls rUrrIscrW_cygpath_parsersc t|}|ds_tD]G\}}}||}|r*||}|rt |}nHt d|}|S)zLUse :meth:`git.cmd.Git.polish_url()` instead, that works on any environment.)z /cygdriverz/proc/cygdriveN)rnrrmatchgroupsrr)raregexparserrecursers rUrrMs t99D ??@ A A *&6 * * "E67KK%%E vu||~~.)"4==D   dD))D KrWz(?:/proc)?/cygdrive/(\w)(/.*)?ct|}t|}|r2|\}}|d|pd}|ddS)N:rrr)rn_decygpath_regexrrrr)ramrrs rU decygpathrbsj t99Dt$$A:88::y++----b9 <<T " ""rW_is_cygwin_cachegit_executablecdSr[rrs rU is_cygwin_gitrqCrWcdSr[rrs rUrrvrrWc trdS|dSt|}t|}|d} t j|}|s-t |}|rt j|dnd}t j|d}tj |gtj d}| \}}d|v}n2#t$r%}td|Yd}~nd}~wwxYw|t|<|S) NFrrunameT)stdoutuniversal_newlinesCYGWINz/Failed checking if running in CYGWIN due to: %r)rrnrrrqrrr subprocessPopenPIPE communicaterilogdebug) r is_cygwingit_dirres uname_cmdprocess uname_out_rls rUrr{s6 uu((N $$^44I  Mk.11G =~..14<#+c!f---"'22I & {:?_cdddG"..00LIq I-II M M M IIG L L L L L L L L M+4( sBC DC<<DcTtjdtjS)zI:return: string identifying the currently active system user as name@node@)getpassgetuserplatformnoderrWrUrArAs#o'''' 99rWproczGit.AutoInterruptrPc |jdi|dS)zSWait for the process (clone, fetch, pull or push) and handle its errors accordinglyNr)wait)rrPs rUfinalize_processrs"DIrW expand_varscdSr[rrrs rU expand_pathrrrWcdSr[rrs rUrrs CrWc"t|tjr|S t j|}|rt j|}t jt j|S#t$rYdSwxYwr[) isinstancepathlibPathresolverqrrrabspathrirs rUrrs!W\""yy{{ N1    "q!!A|CKNN+++ ttsAB B Bcmdlinecg}t|D]\}}|| t|}|j|j9|j4||j|jd}|j4||j|jd}t|||<#t$rYwxYw|S)a8 Parse any command line argument and if on of the element is an URL with a username and/or password, replace them by stars (in-place). If nothing found just returns the command line as-is. This should be used for every log line that print a command line, as well as exception messages. Nz*****)netloc) enumeraterrpasswordusername_replacerrr ValueError)r  new_cmdlineindexto_parsers rUremove_password_if_presentrsK$W--x8$$$ 8$$C|# (<|'ll#**<*s...Aa...rWzdone.z, ) _cur_line _seen_ops error_lines other_linesz%(remote: )?([\w\s]+):\s+()(\d+)()(.*)z2(remote: )?([\w\s]+):\s+(\d+)% \((\d+)/(\d+)\)(.*)rKNc>g|_d|_g|_g|_dSr[)rrr r!rNs rU__init__zRemoteProgress.__init__s&$&(,&(&(rWlinec|t|tr|d}n|}||_|jdr!|j|jdSd}tt|D]\}}t|dkr| dz }| |d|}| }d\}}|j |}||j |}|s1|||j|dSd} |\} } } }}} | dkr | |jz} n}| d kr | |jz} nl| d kr | |jz} n[| d kr | |jz} nJ| d kr | |jz} n9| d kr | |jz} n(| dkr | |jz} n||dS| |jvr$|j| | |jz} | d} | } | |jr'| |jz} | dt=|j } | |j} | | |otC||otC|| dS)a3Parse progress information from the given line as retrieved by git-push or git-fetch. - Lines that do not contain progress info are stored in :attr:`other_lines`. - Lines that seem to contain an error (i.e. start with error: or fatal:) are stored in :attr:`error_lines`.zutf-8)zerror:zfatal:N r)NNrzCounting objectszCompressing objectszWriting objectszReceiving objectszResolving deltaszFinding sourceszChecking out filesr)"rbytesdecoderrr rrreversedordrstripre_op_relativerre_op_absolute line_droppedr!rCOUNTING COMPRESSINGWRITING RECEIVING RESOLVINGFINDING_SOURCES CHECKING_OUTrBEGINrr DONE_TOKENENDr}TOKEN_SEPARATORupdatefloat)rNr%line_strlast_valid_indexic cur_count max_countrop_code_remoteop_name_percentmessages rU_parse_progress_linez#RemoteProgress._parse_progress_lines. dE " " {{7++HHH! > $ $%9 : :    # #DN 3 3 3 F hx0011 * *DAq1vv{{$%26   ' 1!1 12H??$$) 9#))(33 ='--h77E    h ' ' '   # #H - - - FDILLNNA(Iy' ( ( ( t} $GG - - - t' 'GG ) ) ) t| #GG + + + t~ %GG * * * t~ %GG ) ) ) t+ +GG , , , t( (GG   h ' ' '4 $. ( ( N ! !' * * * tz !G ?G--//   DO , , 7 tx G5T_!5!5 556G-- 455   *% **  *% **       rWc&dtddffd }|S)z :return: a progress handler suitable for handle_process_output(), passing lines on to this Progress handler in a suitable formatr%rKNcR|Sr[)rHr,)r%rNs rUhandlerz3RemoteProgress.new_message_handler..handlerss,,T[[]];; ;rW)r )rNrKs` rUnew_message_handlerz"RemoteProgress.new_message_handlerms6  <& >I787777777(C(3(4((((((((rWrDc eZdZdZejdZejdZdZdZ dZ dZ dZ d Z d Zdeed eed d fd Zded efdZded efdZd efdZd efdZd efdZeded dfdZe ddedededd dfdZeddedd dfdZeddedd dfdZd S)r@zActors hold information about a person acting on the repository. They can be committers and authors or anything with a name and an email as mentioned in the git log entries.z<(.*)>z (.*) <(.*?)>GIT_AUTHOR_NAMEGIT_AUTHOR_EMAILGIT_COMMITTER_NAMEGIT_COMMITTER_EMAILremailrrjrKNc"||_||_dSr[rk)rNrrjs rUr$zActor.__init__s  rWothercB|j|jko|j|jkSr[rkrNrms rU__eq__z Actor.__eq__syEJ&D4:+DDrWc||k Sr[rros rU__ne__z Actor.__ne__sEM""rWc8t|j|jfSr[)hashrrjr#s rU__hash__zActor.__hash__sTY +,,,rWc"|jr|jndSrP)rr#s rU__str__z Actor.__str__s I-tyy2-rWc(d|jd|jdS)Nz ">rkr#s rU__repr__zActor.__repr__s*.)))TZZZ@@rWstringc&|j|}|r'|\}}t||S|j|}|r#t|ddSt|dS)zCreate an Actor from a string. :param string: is the string, which is expected to be in regular git format John Doe :return: ActorrN)name_email_regexsearchrr@name_only_regexgroup)clsrzrrrjs rU _from_stringzActor._from_strings  ' ' / /  '((**KD%u%% %#**622A /QWWQZZ...&& &rWenv_name env_email config_reader)Nrrc tdd}d dtf fd dtf fd }d||j|fd||j ffD]\}}}} tj|} t ||| ,#t$rq|C |d|} n#t$r | } YnwxYwt ||| t||st ||| YwxYw|S)NrrKc(stSr[)rA)user_idsrU default_emailz(Actor._main_actor..default_emails (%--NrWcJddS)Nrr)r)rsrU default_namez'Actor._main_actor..default_names" =??((--a0 0rWrrjuser) r@rn conf_name conf_emailr\rsetattrKeyErrorrrigetattr) rrrractorrattrevarcvardefaultvalrrs @@rU _main_actorzActor._main_actorslb"  s        1c 1 1 1 1 1 1Xs}l ; i ?*  4 4 %D$g 4j&tS)))) 4 4 4 ,(+//==$(((%gii(E4---ud++4E4333 4 s6 #A11 C,>BC,B,)C,+B,,=C,+C,cD||j|j|S)a :return: Actor instance corresponding to the configured committer. It behaves similar to the git implementation, such that the environment will override configuration values of config_reader. If no value is set at all, it will be generated :param config_reader: ConfigReader to use to retrieve the values from in case they are not set in the environment)renv_committer_nameenv_committer_emailrrs rU committerzActor.committers!s5s7NP]^^^rWcD||j|j|S)zSame as committer(), but defines the main author. It may be specified in the environment, but defaults to the committer)renv_author_nameenv_author_emailrs rUauthorz Actor.authors s2C4H-XXXrWr[) rTrQrRrSrZr[r~r|rrrrrrrYrrnr$r rrprrrTrurwry classmethodrrrrrrrWrUr@r@sI)) !bj++O!rz/22(O)-/IJ!IXc]8C=TECEDEEEE#C#D####-#----.....A#AAAA'#'''''['( NR %%%%IJ %  %%%[%N__e,X&Y_el___[_YY5)U#VYbiYYY[YYYrWr@cZeZdZdZdZdedeeeffdZ e ddde d dfd Z d S) r;a Represents stat information as presented by git at the end of a merge. It is created from the output of a diff operation. ``Example``:: c = Commit( sha1 ) s = c.stats s.total # full-stat-dict s.files # dict( filepath : stat-dict ) ``stat-dict`` A dictionary with the following keys and values:: deletions = number of deleted lines as int insertions = number of inserted lines as int lines = total number of lines changed as int, or deletions + insertions ``full-stat-dict`` In addition to the items in the stat-dict, it features additional information:: files = number of changed files as inttotalfilesrrc"||_||_dSr[r)rNrrs rUr$zStats.__init__@s  rWrRrtextrKc dddddid}|D]}|d\}}}|dkrt|pd}|dkrt|pd} |ddxx|z cc<|ddxx| z cc<|dd xx|| zz cc<|dd xxd z cc<|| || zd } | |d |<t |d|d S) zRCreate a Stat object from output retrieved by git-diff. :return: git.Statr) insertions deletionslinesrr -rrrrrr)rrr) splitlinesrrTrr;) rrRrhshr%raw_insertions raw_deletionsfilenamerr files_dicts rU_list_from_stringzStats._list_from_stringDsa%&AANN  OO%% 8 8D8< 48H8H 5^]H'3.F3~3F3FK!J%,C]1C1CHqI L & & &* 4 & & & L % % % 2 % % % L ! ! !Z)%; ; ! ! ! L ! ! !Q & ! ! !(&#i/$$J .8CL)) * *S\3w<000rWN) rTrQrRrSrYr'rr%r(r$rrnrrrWrUr;r;#s//2#IhtHh4F/G1V1317111[111rWr;cZeZdZdZdZdeddfdZdedefdZ de fd Z de fd Z defd Z dS) r<aWrapper around a file-like object that remembers the SHA1 of the data written to it. It will write a sha when the stream is closed or if the asked for explicitly using write_sha. Only useful to the indexfile :note: Based on the dulwich project)rsha1rrKNc<||_td|_dS)NrW)rr.r)rNrs rUr$zIndexFileSHA1Writer.__init__ksSMM rWdatacj|j||j|Sr[)rr;rr|)rNrs rUr|zIndexFileSHA1Writer.writeos, v||D!!!rWcl|j}|j||Sr[)rdigestrr|rNshas rU write_shazIndexFileSHA1Writer.write_shass.i    S rWc`|}|j|Sr[)rrclosers rUrzIndexFileSHA1Writer.closexs%nn   rWc4|jSr[)rtellr#s rUrzIndexFileSHA1Writer.tell}sv{{}}rW)rTrQrRrSrYrr$r rTr|r(rrrrrWrUr<r<_s++I""""""""&"S""""5 u crWr<c^eZdZdZdZdeddfdZd dZdefdZ de fd Z d d Z d d Z d d ZdS)r?aProvides methods to obtain, check for, and release a file based lock which should be used to handle concurrent access to the same file. As we are a utility class to be derived from, we only use protected methods. Locks will automatically be released on destruction _file_path _owns_lock file_pathrKNc"||_d|_dS)NFr)rNrs rUr$zLockFile.__init__s#rWc.|dSr[) _release_lockr#s rU__del__zLockFile.__del__s rWcd|jzS)z:return: Path to lockfilez%s.lock)rr#s rU_lock_file_pathzLockFile._lock_file_pathsDO,,rWc|jS)z:return: True if we have a lock and if the lockfile still exists :raise AssertionError: if our lock-file does not exist)rr#s rU _has_lockzLockFile._has_locks rWc|rdS|}tj|rt d|jd|d t jt jzt j z}tr|t j z}t j ||d}t j |n/#t$r"}t t||d}~wwxYwd|_dS)zCreate a lock file as flag for other instances, mark our instance as lock-holder :raise IOError: if a lock was already present or a lock file could not be writtenNzLock for file z did already exist, delete z in case the lock is illegalrT)rrrqrrIOErrorrr\O_WRONLYO_CREATO_EXCLr O_SHORT_LIVEDopenrOSErrorrnr)rN lock_fileflagsfdrs rU_obtain_lock_or_raisezLockFile._obtain_lock_or_raises >>    F((** :i  '???III/   )K"*,ry8E *))E1--B HRLLLL ) ) )#a&&//q ( )sA&C C. C))C.c*|S)zThe default implementation will raise if a lock cannot be obtained. Subclasses may override this method to provide a different implementation)rr#s rU _obtain_lockzLockFile._obtain_locks))+++rWc|sdS|} t|n#t$rYnwxYwd|_dS)zRelease our lock if we have oneNF)rrrurr)rNlfps rUrzLockFile._release_locksi~~  F""$$  3KKKK    D s< A A rO)rTrQrRrSrYr%r$rrnrrrrrrrrWrUr?r?s;;-I ( t    -----4 0,,,,       rWr?c JeZdZdZdZdefdedededdffd Z d fd Z xZ S) r>aThe lock file will block until a lock could be obtained, or fail after a specified timeout. :note: If the directory containing the lock was removed, an exception will be raised during the blocking period, preventing hangs as the lock can never be obtained.)_check_interval_max_block_timeg333333?rcheck_interval_smax_block_time_srKNcttt||||_||_dS)aConfigure the instance :param check_interval_s: Period of time to sleep until the lock is checked the next time. By default, it waits a nearly unlimited time :param max_block_time_s: Maximum amount of seconds we may lockN)r`r>r$rr)rNrrrras rUr$zBlockingLockFile.__init__s: %%..y999//rWcdtj}|t|jz} tt|dS#t $r}tj}tjtj | s,d| ||z fz}t ||||kr,d||z | fz}t ||tj |j Yd}~nd}~wwxYw)zThis method blocks until it obtained the lock, or raises IOError if it ran out of time or if the parent directory was not available anymore. If this method returns, you are guaranteed to own the lockTzVDirectory containing the lockfile %r was not readable anymore after waiting %g secondsz Waited %g seconds for lock at %rN) timer<rr`r>rrrqrrrsleepr)rN starttimemaxtimercurtimemsgras rUrzBlockingLockFile._obtain_locksKIKK eD$8999  &--::<<<,+ 1 1 1)++yT-A-A-C-C!D!DEE.r,,..)+vC"#,,A-g%%<)+,,..@C"#,,A- 4/00000000' 1 s'A D-!CD((D-rO) rTrQrRrSrYrr%r<rTr$rrcrds@rUr>r>s""7I #& ' 000 0 0  000000"rWr>ceZdZdZdZddededdffd Zddededd fd Zd ede fd Z d ede fd Z de eeeefde fdZde eeeefdd fdZxZS)r=as List of iterable objects allowing to query an object by id or by named index:: heads = repo.heads heads.master heads['master'] heads[0] Iterable parent objects = [Commit, SubModule, Reference, FetchInfo, PushInfo] Iterable via inheritance = [Head, TagReference, RemoteReference] ] It requires an id_attribute name to be set which will be queried from its contained items to have a means for comparison. A prefix can be specified which is to be used in case the id returned by the items always contains a prefix that does not matter to the user, so it can be left out._id_attr_prefixrid_attrprefixrKzIterableList[IterableObj]cTtt||Sr[)r`r=__new__)rrrras rUrzIterableList.__new__s!\3''//444rWNc"||_||_dSr[r)rNrrs rUr$zIterableList.__init__s  rWrc t||}|r|Sn#ttf$rYnwxYw t |t t |dS#ttf$rYdSwxYw)NTF)list __contains__AttributeError TypeErrorrrrn)rNrrvals rUrzIterableList.__contains__#s $$T400D    *    D    D$sD// * * *4 *   55 s"66#AA43A4c|j|z}|D]}t||j|kr|cS t||Sr[)rrrr__getattribute__)rNritems rU __getattr__zIterableList.__getattr__5sZ|d"  DtT]++t33 4$$T4000rWrc~t|tttfs Jdt|trt||St|trt d t||S#t$r }td|j |zz|d}~wwxYw)N-Index of IterableList should be an int or strzIndex should be an int or strzNo item found with id %r) rrTrnslicer __getitem__rrr IndexErrorr)rNrrs rUrzIterableList.__getitem__=s%#sE!233dd5ddd3 eS ! ! ]##D%00 0 u % % ]<== = ]tU+++! ] ] ] !;t|e?S!TUU[\\ ]sB B<B77B<ct|ttfs Jdtt|}t|tsVd}|j|z}t |D]"\}}t ||j|kr|}n#|dkrtd|zt ||dS)NrzItem with name %s not found) rrTrnrrrrrrr __delitem__)rNrdelindexrr?rs rUrzIterableList.__delitem__Ls%#s,,]].]]],U##%%% GH<%'D$T??  44//477 HE8 2~~ !>!EFFF x(((((rW)r)rTrQrRrSrYrnrr$objectrrr*rrr"rTrrrrcrds@rUr=r=sA$(I55c5358S555555S$D$11 1111 ]}c5#'E!F ]= ] ] ] ])}c5#'E!F)4))))))))rWr=c*eZdZdZdedededdfdZdS)IterableClassWatcherzMetaclass that watchesrbasesclsdictrKNc|D]:}t|tkr tjd|dtd;dS)Nz!GitPython Iterable subclassed by zs. Iterable is deprecated due to naming clash since v3.1.18 and will be removed in 3.1.20, Use IterableObj instead ) stacklevel)typer warningswarnDeprecationWarning)rrr r bases rUr$zIterableClassWatcher.__init__dse  DDzz111 1111'   rW)rTrQrRrSrnrrr$rrWrUr r asJ   C         rWr c jeZdZdZdZdZedddededefd Zedddededefd Z d S) IterablezDefines an interface for iterable items which is to assure a uniform way to retrieve and iterate items within the git repositoryrz5attribute that most suitably identifies your instancerRrrOrPrKcvt|j}||j|g|Ri||S)am Deprecated, use IterableObj instead. Find all items of this type - subclasses can specify args and kwargs differently. If no args are given, subclasses are obliged to return all items if no additional arguments arg given. :note: Favor the iter_items method as it will :return: list(Item,...) list of item instancesr=_id_attribute_extend iter_itemsrrRrOrPout_lists rU list_itemszIterable.list_itemsysG%S%788t=d===f==>>>rWc tdzbFor more information about the arguments, see list_items :return: iterator yielding ItemszTo be implemented by SubclassNotImplementedErrorrrRrOrPs rUrzIterable.iter_itemss ""ABBBrWN) rTrQrRrSrYrrr rrrrWrUrrqsCCILN f S C C   [ CfCSCCCCCCC[CCCrWr) metaclassc eZdZUdZdZeed<edddedede e fd Z ee dddedede e fd Zd S) r+zDefines an interface for iterable items which is to assure a uniform way to retrieve and iterate items within the git repository Subclasses = [Submodule, Commit, Reference, PushInfo, FetchInfo, Remote]rrrRrrOrPrKcvt|j}||j|g|Ri||S)a@ Find all items of this type - subclasses can specify args and kwargs differently. If no args are given, subclasses are obliged to return all items if no additional arguments arg given. :note: Favor the iter_items method as it will :return: list(Item,...) list of item instancesrrs rUrzIterableObj.list_itemssG".c.@!A!At=d===f==>>>rWc tdr!r"r$s rUrzIterableObj.iter_itemss ""ABBBrWN)rTrQrRrSrYrnrUrr r=r*rrrrrrWrUr+r+sPP I f S C LQ^D_   [ CfCSCCCH]D[CCC^[CCCrWr+ceZdZdeddfdZdS) NullHandlerrecordrKNcdSr[r)rNr+s rUemitzNullHandler.emits rW)rTrQrRr r-rrWrUr*r*s6 6 d      rWr*)rv)Fr[).)T)abcros.pathrarqcompatr contextlib functoolsrrloggingr\rrrZrorgsysrr urllib.parserr rtypingr r r r rrrrrrrrrrrrrrr  git.remoter git.repo.baser git.configrrgitr typesr!r"r#r$r%r&r'r(r)r* gitdb.utilr.r/r0r1r2r3r4r5r6__all__ getLoggerrTrrrrGrHrIrFcontextmanagerr`rErurTr7r8rrnr9rrr:rrBrrrr[IrrUrrrrrrArrrrr rCrDr@r;r<r?r>r=rr rr+Handlerr*rrWrUrBsH    -------- *!!!!!!""""""========                      u5V/Wcghhh                      "   *g!!#Xrz~~6QSW'X'X#Z 7SUY(Z(Z GCLLhsAv&8CF+;$ i$(<=//d////,d   x S Z]     xH$ *'X'('''''8''''' NN+,,,+NN8*N,,h,8,,,,  ( T d    Xc]c(!3tCy0$hsm$3$3$$$$.  @AA f f  RZ)**Z%@RZ!""Z%8RZ bd##&A&ADIRZ//E: E%gclHd:;S@A   ##$2:?@@#H#####/1$sHTN*+000 $75>  (t %h"7D@:S:::: 5!13F!FGSV[_  4dT  8$   5x( t xPXGY     $s)F{ { { { { V{ { { | ( ( ( ( (^ ( ( (uYuYuYuYuYFuYuYuYp9191919191F919191x&DD D D D D vD D D N:::::x:::|X)X)X)X)X)4 &X)X)X)v     4    CCCCC-CCCC>CCCCC(CCCF     '/     rW