yL iDdddlmZdgZddlZddlZddlZddlmZddl m Z ddl Z ddl Z ddl Z ddlZddlZddlmZddlmZddlmZmZddlmZmZdd lmZdd lmZdd lmZm Z m!Z!dd l"m#Z#dd l$m%Z%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+m,Z,ddl-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7ddl8m9Z9m:Z:m;Z;mm?Z?m@Z@mAZAmBZBmCZCmDZDmEZEddlFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVddl>mWZWmXZXeQrddl$mYZYddlZm[Z[ddl\m]Z]ddl-m^Z^ddl1m_Z_ejeaZbGddeNZcGddZdy)) annotationsRepoN)Path) LooseObjectDB) BadObject)Githandle_process_output)defenc safe_decode)GitConfigParser)GitCmdObjectDB)GitCommandErrorInvalidGitRepositoryErrorNoSuchPathError IndexFile) Submodule RootModuleCommit)HEADHead Reference TagReference)Remote add_progressto_progress_instance)Actorcygpath expand_pathfinalize_process hex_to_binremove_password_if_present)find_submodule_git_dirfind_worktree_git_dir is_git_dir rev_parsetouch)CallableProgress Commit_ishLit_config_levelsPathLikeTBDTree_ish assert_never)AnyBinaryIOCallableDictIteratorListMapping NamedTupleOptionalSequence TYPE_CHECKINGTextIOTupleTypeUnioncast)ConfigLevels_Tup TypedDict)Tree)UpdateProgress)SymbolicReference)RemoteProgress) IterableListc6eZdZUded<ded<ded<ded<y) BlameEntryzDict[str, Commit]commitrangelinenos Optional[str] orig_path orig_linenosN__name__ __module__ __qualname____annotations__S/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/git/repo/base.pyrHrHbs  NrUrHc2eZdZUdZdZeddZded< dZded<ded < d Z ded <e jd Z e jd Z e jdZe jdZe jdZe jdZgdZ dZded< eZ deddf d]dZd^dZd_dZd`dZd`dZdadZdadZdbdZedcd Z e jBddd!Z eded"Z"edfd#Z#edgd$Z$edhd%Z%edhd&Z&edid'Z'edid(Z(edjd)Z)edkd*Z*edld+Z+dmdnd,Z,edod-Z-dpd.Z.dqd/Z/drd0Z0drd1Z1edsd2Z2dtd3Z3e4dud4Z5 dv dwd5Z6dxd6Z7 dy dzd7Z8d{d8Z9d|d9Z:d}d:Z;d~dd;Z< d~ dd<Z= d dd=Z>ddd>Z?d~dd?Z@dd@ZAd~ddAZB d ddBZCddCZDddDZEd~ddEZFdgdFZGddGZHedgdHZIeIjBddIZIddJZJddKZKeddLZLeLjBddMZL d ddNZMeddOZNddPZOddQZPeddRZQddSZR d ddTZSeTddedf ddUZUeT d ddVZV d ddWZWeT d ddXZX d ddYZYdgdZZZe[Z[dcd[Z\dd\Z]y)ra^Represents a git repository and allows you to query references, create commit information, generate diffs, create and clone repositories, and query the log. The following attributes are worth using: * :attr:`working_dir` is the working directory of the git command, which is the working tree directory if available or the ``.git`` directory in case of bare repositories. * :attr:`working_tree_dir` is the working tree directory, but will return ``None`` if we are a bare repository. * :attr:`git_dir` is the ``.git`` repository directory, which is always set. zgit-daemon-export-okrNr, working_dirOptional[PathLike]_working_tree_dirgit_dir _common_dirz\s+z^[0-9A-Fa-f]{40}$z^[0-9A-Fa-f]{4,40}$z5(\$(\{\s?)?[a-zA-Z_]\w*(\}\s?)?|%\s?[a-zA-Z_]\w*\s?%)z^(author|committer)z^\t(.*)$)z --upload-packz-uz--configz-c)systemuserglobal repositoryr@ config_levelFTc|xstjd}|stj}tjrt t |}|xs|xstj}t|t s t |}|r7tj|j|rtjddt||}|*tjj|s t!||}d}|r@t#|r|}tjj%||_tj(j+d;|j-d|}|j/dd r|j+dd |_d tj(vrtjd |_nt1j2|d } t5| } | t1j6| }t5| } | t9| } | t| |}||_n"|snt1j:|\}} | sn|r@| t=|||_d |_ |jCdjEdd |_ tI|j>dz jKjMdjO} t1j2|j>| |_(|j@rd|_|j&xs |jT|_+|jY|jV|_-t1j2|jTd} t]|t^r|| |jZ|_0y|| |_0y#tF$rY wxYw#tR$r d|_(YwxYw)aCreate a new :class:`Repo` instance. :param path: The path to either the worktree directory or the .git directory itself:: repo = Repo("/Users/mtrier/Development/git-python") repo = Repo("/Users/mtrier/Development/git-python.git") repo = Repo("~/Development/git-python.git") repo = Repo("$REPOSITORIES/Development/git-python.git") repo = Repo(R"C:\Users\mtrier\Development\git-python\.git") - In *Cygwin*, `path` may be a ``cygdrive/...`` prefixed path. - If `path` is ``None`` or an empty string, :envvar:`GIT_DIR` is used. If that environment variable is absent or empty, the current directory is used. :param odbt: Object DataBase type - a type which is constructed by providing the directory containing the database objects, i.e. ``.git/objects``. It will be used to access all object data. :param search_parent_directories: If ``True``, all parent directories will be searched for a valid repo as well. Please note that this was the default behaviour in older versions of GitPython, which is considered a bug though. :raise git.exc.InvalidGitRepositoryError: :raise git.exc.NoSuchPathError: :return: :class:`Repo` GIT_DIRzoThe use of environment variables in paths is deprecated for security reasons and may be removed in the future!!r#) stacklevelNGIT_COMMON_DIRracoreworktree GIT_WORK_TREE.gitFbare commondirrr\objects)1osgetenvgetcwdr is_cygwinrstr isinstanceresearch re_envvarswarningswarnrpathexistsrr&dirnamerZenvironget_config_reader has_optionospjoinr$normpathr%splitrr[_bare config_reader getboolean Exceptionr read_text splitlinesstripr]OSError common_dirrXGitCommandWrapperTypegit issubclassr odb)selfryodbtsearch_parent_directories expand_varsepathcurpathr[gitconfdotgit sm_gitpathtailrrootpaths rV__init__z Repo.__init__s&V, ),IIKE ==?CJ'E,,%%JE 299T__e< MMN  E;/  77>>%(%e,, '"!*,)A&::>>"23;"11,HG))&*=18VZ1P."bjj0-/YY-GD*XXgv.F/7J%,,z2/7J!26: %%j+>)0&,IIg.MGTY^ ?+E2 2   ++L9DDVVTDJ  "t||,{:EEGRRTUVW]]_J"xx jAD  ::%)D "&*%;%;%Nt--d.>.>?88DOOY7 dN +Hdhh/DHH~DH1    "!D  "s%#&N A*N- N*)N*-O?Oc|SNrTrs rV __enter__zRepo.__enter__As rUc$|jyr)close)rargss rV__exit__z Repo.__exit__Ds  rUcD |jy#t$rYywxYwr)rrrs rV__del__z Repo.__del__Gs"  JJL   s  c@|jr|jjtjdk(rt j t jjj tjdk(rt j yyy)Nwin32) r clear_cachesysplatformgccollectgitdbutilmmanrs rVrz Repo.closeMsc 88 HH " ||w& JJOO # # %||w& ' rUcVt|tr|j|jk(Sy)NF)rsrr[rrhss rV__eq__z Repo.__eq__Zs" c4 <<3;;. .rUc&|j| Sr)rrs rV__ne__z Repo.__ne___s;;s###rUc,t|jSr)hashr[rs rV__hash__z Repo.__hash__bsDLL!!rUctj|jd}t|d5}|j j j tcdddS#1swYyxYw)zThe project's description descriptionrbN)rrr[openreadrstripdecoder )rfilenamefps rVrzRepo.descriptionesV88DLL-8 (D ! 5R779##%,,V4 5 5 5s 1A((A1ctj|jd}t|d5}|j |dzj t dddy#1swYyxYw)Nrwb )rrr[rwriteencoder )rdescrrrs rVrzRepo.descriptionlsR88DLL-8 (D ! 4R HHedl**62 3 4 4 4s (AA'c|jS)z :return: The working tree directory of our git repository. If this is a bare repository, ``None`` is returned. )rZrs rVworking_tree_dirzRepo.working_tree_dirrs%%%rUc6|jxs |jS)z :return: The git dir that holds everything except possibly HEAD, FETCH_HEAD, ORIG_HEAD, COMMIT_EDITMSG, index, and logs/. )r]r[rs rVrzRepo.common_dir{s/4<</rUc|jS)z+:return: ``True`` if the repository is bare)rrs rVrkz Repo.bareszzrUc,tj|S)zA list of :class:`~git.refs.head.Head` objects representing the branch heads in this repo. :return: ``git.IterableList(Head, ...)`` )r list_itemsrs rVheadsz Repo.headsst$$rUc|jS)zAlias for heads. A list of :class:`~git.refs.head.Head` objects representing the branch heads in this repo. :return: ``git.IterableList(Head, ...)`` )rrs rVbranchesz Repo.branchesszzrUc,tj|S)zA list of :class:`~git.refs.reference.Reference` objects representing tags, heads and remote references. :return: ``git.IterableList(Reference, ...)`` )rrrs rV referenceszRepo.referencess##D))rUc|jS)zAlias for references. A list of :class:`~git.refs.reference.Reference` objects representing tags, heads and remote references. :return: ``git.IterableList(Reference, ...)`` )rrs rVrefsz Repo.refssrUct|S)a6 :return: A :class:`~git.index.base.IndexFile` representing this repository's index. :note: This property can be expensive, as the returned :class:`~git.index.base.IndexFile` will be reinitialized. It is recommended to reuse the object. rrs rVindexz Repo.indexsrUct|dS)zq :return: :class:`~git.refs.head.HEAD` object pointing to the current head reference r)rrs rVheadz Repo.heads D&!!rUc,tj|S)zA list of :class:`~git.remote.Remote` objects allowing to access and manipulate remotes. :return: ``git.IterableList(Remote, ...)`` )rrrs rVremotesz Repo.remotess  &&rUcZt||}|jstd|z|S)z:return: The remote with the specified name :raise ValueError: If no remote with such a name exists. zRemote named '%s' didn't exist)rrz ValueError)rnamers rVremotez Repo.remotes/ 4 xxz=DE ErUc,tj|S)z :return: git.IterableList(Submodule, ...) of direct submodules available from the current head )rrrs rV submoduleszRepo.submoduless##D))rUcb |j|S#t$r}td|z|d}~wwxYw)zx:return: The submodule with the given name :raise ValueError: If no such submodule exists. zDidn't find submodule named %rN)r IndexErrorr)rres rV submodulezRepo.submodules<  M??4( ( M=DE1 L Ms .).c4tj|g|i|S)aCreate a new submodule. :note: For a description of the applicable parameters, see the documentation of :meth:`Submodule.add `. :return: The created submodule. )raddrrkwargss rVcreate_submodulezRepo.create_submodules}}T3D3F33rUc8t|j|i|S)zAn iterator yielding Submodule instances. See the :class:`~git.objects.util.Traversable` interface for a description of `args` and `kwargs`. :return: Iterator )rtraversers rViter_submoduleszRepo.iter_submoduless!)z$(($9&99rUc8t|j|i|S)a(Update the submodules, keeping the repository consistent as it will take the previous state into consideration. :note: For more information, please see the documentation of :meth:`RootModule.update `. )rupdaters rVsubmodule_updatezRepo.submodule_update s!'z$&&777rUc,tj|S)zA list of :class:`~git.refs.tag.TagReference` objects that are available in this repo. :return: ``git.IterableList(TagReference, ...)`` )rrrs rVtagsz Repo.tagss&&t,,rUc<|j|}t||S)a :return: :class:`~git.refs.tag.TagReference` object, reference pointing to a :class:`~git.objects.commit.Commit` or tag :param path: Path to the tag reference, e.g. ``0.1.5`` or ``tags/0.1.5``. )_to_full_tag_pathr)rry full_paths rVtagzRepo.tag!s!**40 D),,rUct|}|jtjdzr|S|jtjdzrt jdz|zStjdz|zS)N/)rr startswithr_common_path_default_common_defaultr)rypath_strs rVrzRepo._to_full_tag_path-snt9   |@@3F GO   |;;cA B11C7(B B44s:XE ErUc4tj|||||S)a Create a new head within the repository. :note: For more documentation, please see the :meth:`Head.create ` method. :return: Newly created :class:`~git.refs.head.Head` Reference. )rcreate)rryrIforcelogmsgs rV create_headzRepo.create_head7s {{4vvu==rUc4tj|g|i|S)zDelete the given heads. :param kwargs: Additional keyword arguments to be passed to :manpage:`git-branch(1)`. )rdelete)rrrs rV delete_headzRepo.delete_headIs {{42%2622rUc 6tj|||||fi|S)aCreate a new tag reference. :note: For more documentation, please see the :meth:`TagReference.create ` method. :return: :class:`~git.refs.tag.TagReference` object )rr)rryrefmessagerrs rV create_tagzRepo.create_tagQs""""4sGUMfMMrUc.tj|g|S)z Delete the given tag references.)rr)rrs rV delete_tagzRepo.delete_tagds""4/$//rUc 2tj|||fi|S)zCreate a new remote. For more information, please see the documentation of the :meth:`Remote.create ` method. :return: :class:`~git.remote.Remote` reference )rr)rrurlrs rV create_remotezRepo.create_remotehs}}T4777rUc.tj||S)zDelete the given remote.)rremove)rrs rV delete_remotezRepo.delete_remotess}}T6**rUc | |j}tjdk(r|dk(rd}|dk(ry|dk(rtjj dxs4t jtjj ddd }t jt jt j|d d S|dk(r(t jt jd S|d k(rA|jxs|}|stt jt j|d St|td|y)Nrr^r`z/etc/gitconfigr_XDG_CONFIG_HOMEHOME~z.configrconfigz ~/.gitconfigrazInvalid configuration level: )r[rrrnr|r}rrr expanduserr]NotADirectoryErrorr/r)rrbr[ config_homerepo_dirs rV_get_config_pathzRepo._get_config_pathws ?llG <<7 "|x'?#L 8 ## V #**..):;osxx W]_bHcen?oK<<sxx UH/U VW W X %<<~ >? ? \ )''27H((||CHHXx$@AA :<:JKL rUc&|j|S)a :return: :class:`~git.config.GitConfigParser` allowing to read the full git configuration, but not to write it. The configuration will include values from the system, user and repository configuration files. :param config_level: For possible values, see the :meth:`config_writer` method. If ``None``, all applicable levels will be used. Specify a level in case you know which file you wish to read to prevent reading multiple files. :note: On Windows, system configuration cannot currently be read as the path is unknown, instead the global path will be used. )rb)r~rrbs rVrzRepo.config_readers*"" "==rUc |H|jDcgc]2}tt|r |jtt||4}}n|j||g}t |d|Scc}w)NT) read_onlyrepo)rbr?r+rr )rrbr[ffiless rVr~zRepo._config_readersz  **)1-%%d+t|j|d|dS)au :return: A :class:`~git.config.GitConfigParser` allowing to write values of the specified configuration file level. Config writers should be retrieved, used to change the configuration, and written right away as they will lock the configuration file in question and prevent other's to write it. :param config_level: One of the following values: * ``"system"`` = system wide configuration file * ``"global"`` = user level configuration file * ``"`repository"`` = configuration file for this repository only F)rr merge_includes)r rrs rV config_writerzRepo.config_writers"t44\BeZ^otuurUcl||jjS|jt|dzS)zThe :class:`~git.objects.commit.Commit` object for the specified revision. :param rev: Revision specifier, see :manpage:`git-rev-parse(1)` for viable options. :return: :class:`~git.objects.commit.Commit` z^0)rrIr'rrrrevs rVrIz Repo.commits0 ;99## #~~c#ho..rUc4d|j|i|DS)z:return: Iterator yielding :class:`~git.objects.tree.Tree` objects :note: Accepts all arguments known to the :meth:`iter_commits` method. c34K|]}|jywr)tree).0cs rV z"Repo.iter_trees..sC1Cs) iter_commitsrs rV iter_treeszRepo.iter_treess# D 1 1 14 B6 BCCrUc| |jjjS|jt |dzS)a&The :class:`~git.objects.tree.Tree` object for the given tree-ish revision. Examples:: repo.tree(repo.heads[0]) :param rev: A revision pointing to a Treeish (being a commit or tree). :return: :class:`~git.objects.tree.Tree` :note: If you need a non-root level tree, find it by iterating the root tree. Otherwise it cannot know about its path relative to the repository root and subsequent operations might have unexpected results. z^{tree})rrIr+r'rrr's rVr+z Repo.trees7$ ;99##(( (~~c#h233rUc b||jj}tj|||fi|S)a*An iterator of :class:`~git.objects.commit.Commit` objects representing the history of a given ref/commit. :param rev: Revision specifier, see :manpage:`git-rev-parse(1)` for viable options. If ``None``, the active branch will be used. :param paths: An optional path or a list of paths. If set, only commits that include the path or paths will be returned. :param kwargs: Arguments to be passed to :manpage:`git-rev-list(1)`. Common ones are ``max_count`` and ``skip``. :note: To receive only commits between two named revisions, use the ``"revA...revB"`` revision specifier. :return: Iterator of :class:`~git.objects.commit.Commit` objects )rrIr iter_items)rr(pathsrs rVr/zRepo.iter_commitss28 ;))""C  sEs rVrAzRepo.is_ancestor@sH  HH   ct  D   zzQ  s! A??AcZ |jj|}|jj|}|rN|j|j k(ryt j d|jj|yy#t$rt j dYywxYw)NTzQCommit hash points to an object of type '%s'. Requested were objects of type '%s'FzCommit hash is invalid.) rpartial_to_complete_sha_hexinfotyper_loggerdebugrr)rsha object_type complete_sha object_infos rVis_valid_objectzRepo.is_valid_objectTs 88??DL((-- 5K##{'9'9';;MMk#((//1# !  MM3 4 sAB /B B*)B*c|jr*tj|j|j}tjSr)r[rrDAEMON_EXPORT_FILErz)rrs rV_get_daemon_exportzRepo._get_daemon_exporths2 <<xx d.E.EFHzz(##rUc|jr*tj|j|j}tj}|r|s t |y|s|rt j|yyyr)r[rrrOrzr(rnunlink)rvaluer fileexistss rV_set_daemon_exportzRepo._set_daemon_exportmsU <<xx d.E.EFHZZ)  (O: IIh &rUc"|jS)z.If True, git-daemon may export this repository)rPrs rV daemon_exportzRepo.daemon_exportvs&&((rUc&|j|yr)rU)rrSs rVrWzRepo.daemon_export{s &rUcP|jr"tj|jddd}tjrVt |d5}|j j t}dddjjSgS#1swY)xYw)zThe list of alternates for this repo from which objects can be retrieved. :return: List of strings being pathnames of alternates rmrE alternatesrN) r[rrrzrrrr rr)ralternates_pathr!altss rV_get_alternateszRepo._get_alternatess~ <<!hht||Y UO ::o &ot, /vvxv. /::<**, ,  / /s $BB%cLtj|jddd}|s,tj|rt j |yyt |d5}|jdj|jtdddy#1swYyxYw)aSet the alternates. :param alts: The array of string paths representing the alternates at which git should look for objects, i.e. ``/home/user/repo/.git/objects``. :raise git.exc.NoSuchPathError: :note: The method does not check for the existence of the paths in `alts`, as the caller is responsible. rmrErZrrN) rrrisfilernrrrrr )rr\r[r!s rV_set_alternateszRepo._set_alternatess~((4??Iv|Tzz/* /*+ot, 8 $..v67 8 8 8s 4BB#c"|jS)zPRetrieve a list of alternates paths or set a list paths to be used as alternates)r]rs rVrZzRepo.alternatess##%%rUc&|j|yr)r`)rr\s rVrZzRepo.alternatess T"rUc|jrygd}|s|jd|r|jdt|g|rPt j |j jr't|jjdg|ry|r#t|jj|ry|rt|j|| ryy)a :return: ``True`` if the repository is considered dirty. By default it will react like a :manpage:`git-status(1)` without untracked files, hence it is dirty if the index or the working copy have changes. F)z --abbrev=40z --full-indexz--rawz--ignore-submodules--z--cachedT)ignore_submodules) rr;extendrrrr_rryr8rdiff_get_untracked_files)rr working_treeuntracked_filesrry default_argss rVis_dirtyz Repo.is_dirtys ::@     5 6    s4y 1 2 zz$**//*s=488==3[l3[/\ =488==,/0 4,,T^,TUrUc"|jS)a :return: list(str,...) Files currently untracked as they have not been staged yet. Paths are relative to the current working directory of the git command. :note: Ignored files will not appear here, i.e. files mentioned in ``.gitignore``. :note: This property is expensive, as no cache is involved. To process the result, please consider caching it yourself. )rhrs rVrjzRepo.untracked_filess ((**rUc|jj|dddd|}d}g}|jD]}|jt}|j |s*|t |djd}|d|dcxk(rdk(rJnnG|dd}|jd jd jd jt}|j|t||S) NT) porcelainrj as_processz?? rr"r#asciiunicode_escapelatin1) rr:stdoutrr rr8rrr;r )rrrprocprefixrjr?rs rVrhzRepo._get_untracked_filesstxxdW[f_efKK -D;;v&D??6*CKM*11$7H{hrl1c1#Ab>#??73::;KLSST\]ddekl  " "8 , - rUc |jj|}|j ddj ddj dS#t$r}|jdk(rgcYd}~Sd}~wwxYw)a Checks if paths are ignored via ``.gitignore``. This does so using the :manpage:`git-check-ignore(1)` method. :param paths: List of paths to check whether they are ignored or not. :return: Subset of those paths which are ignored r#Nz\\\rrr\r)r check_ignorerr:replacer)rr4rwr>s rVignoredz Repo.ignoredsq ---u5D||FD)11#r:@@FF zzQ  s#A A1A,%A1+A,,A1c.|jjS)zThe name of the currently active branch. :raise TypeError: If HEAD is detached. :return: :class:`~git.refs.head.Head` to the active branch )r referencers rV active_branchzRepo.active_branchsyy"""rUc+K|jj|d|fdddd|}i}d|jdD} t|}|j}|\} } } } t | } t | }t | }| |vri} t|}|dk(r|jd d \}}|||<|d k(r|}n5t |t| tt|d t|d jdjdt |dtt|dt|djdjdt |d}||| <n+ t|}|jd d \}}|d k(r|}n*t|| t| | |zt|t|||z#t$rYywxYw#t$rYywxYw#t$rYywxYww)aBIterator for blame information for the given file at the given revision. Unlike :meth:`blame`, this does not return the actual file's contents, only a stream of :class:`BlameEntry` tuples. :param rev: Revision specifier. If ``None``, the blame will include all the latest uncommitted changes. Otherwise, anything successfully parsed by :manpage:`git-rev-parse(1)` is a valid option. :return: Lazy iterator of :class:`BlameEntry` tuples, where the commit indicates the commit to blame for the line, and range indicates a span of line numbers in the resulting file. If you combine all line number ranges outputted by this command, you should get a continuous range spanning all line numbers in the file. rdTF)p incrementalstdout_as_stringc3&K|] }|s| ywrrT)r,r?s rVr.z)Repo.blame_incremental..7s=4$=s Nsboundary r#sfilenamesauthors author-mail<>s author-times committerscommitter-mailscommitter-timeauthor authored_date committercommitted_date)rblamernext StopIterationintrr!rr lstriprrHrJ)rr(filerdatacommitsstreamr? split_linehexsha orig_lineno_blineno_b num_lines_blineno num_lines orig_linenopropsrrS orig_filenamer-s rVblame_incrementalzRepo.blame_incremental s_(%dhhnnS$q$afqjpq')=4::e#4= F|J;E 8FM8[]FK(Im,KW$-/#F|{*!!%D!!4JC!&E#Jk)(- "v& #E)$45#E.$9$@$@$F$M$Md$ST#&eN&;"<##E,$78#E*;$<$C$CD$I$P$PQU$VW$'u->'?#@ #$#F|"&D!!4JCk)(- ffy01M*k;#:;  {!  )H)ss?H  G ?H  G+C"H ; G:AH  G(%H 'G((H + G74H 6G77H : HH HH c \|r|j||fi|S|xsg}|jj|g|d|ddd|}i}g}Gddtd} i} d} |j | D]} | j j t} |jj| d}|d }d}|jj|rj|d jd }t|d k(rd|i} |jdgg| d|k7sd|i} |j|j|gg|j j|}|r|j#d }|dk(rP|j%dr |d | d<|j%drt'|d | d<B||k(sI|d | d<S|dk(sZ|j%dr |d | d<u|j%drt'|d | d<||k(s|d | d<|j)dr |d | d<|j)dr |d | d<|d k(s| s| d}|j|}|at+|t-|t/j0| dd | d| dt/j0| dd | d| d}|||<||d d <|d d-|s r | d dk(r| dd} | }n| }|d dj|d|i} |S#t$r d }g}d}YqwxYw)aThe blame information for the given file at the given revision. :param rev: Revision specifier. If ``None``, the blame will include all the latest uncommitted changes. Otherwise, anything successfully parsed by :manpage:`git-rev-parse(1)` is a valid option. :return: list: [git.Commit, list: []] A list of lists associating a :class:`~git.objects.commit.Commit` object with a list of lines that changed within the given commit. The :class:`~git.objects.commit.Commit` objects will be given in order of appearance. rdTF)rrcreZdZUded<ded<ded<ded<ded<ded<ded <ded <ded <ded <y )Repo.blame..InfoTDrrrIidrsummaryr author_emailr author_datercommitter_emailcommitter_dateNrOrTrUrVInfoTDrs8HGMLK  N  rUr)totalr#rr\rq rNrz-mailrz-timerrrrrrr )rrrrArrrr re_whitespacerUnicodeDecodeErrorre_hexsha_onlyrur8r;r}re_author_committer_startgroupendswithrrrr!r _from_string)rr(rrrev_optsrrrblamesrrEkeepends line_bytesline_strparts firstpart is_binarydigitsmrolerIr-r?s rVrz Repo.blame|s. )4))#t>v> >>r$dhhnnSj8jTj4j4Z_jcij%'@B Ye //(3e /J "%,,.55f=**001=!!H ! "")))4 r-v;!# ),DMM4*-$Z9, ),DMM7;;y#92">?2299)D771:Dx'$--g6389D0&//825eBi.D/!Y.-22YDN,$--g66;BiD!23&//858r^D!12!Y.05b D-!++J7+09Z("--i8*/)Y"b"&t*C ' C 0A y$*$($.sO+0+=+=h@PPQRVWeRfQg>h+i26}2E.3.@.@DDUCVVWX\]nXoWpAq.r378H3I %"01 ,-F2JqM &bz!}8'0'/HQK44G3;AB<+3D+5D!'r 1 4 4T :$(#;DKe /T O& !   !s3#LL+*L+c |r t||}|r-|r+tj|stj|d|j |}|j di||||S)aInitialize a git repository at the given path if specified. :param path: The full path to the repo (traditionally ends with ``/.git``). Or ``None``, in which case the repository will be created in the current working directory. :param mkdir: If specified, will create the repository directory if it doesn't already exist. Creates the directory with a mode=0755. Only effective if a path is explicitly given. :param odbt: Object DataBase type - a type which is constructed by providing the directory containing the database objects, i.e. ``.git/objects``. It will be used to access all object data. :param expand_vars: If specified, environment variables will not be escaped. This can lead to information disclosure, allowing attackers to access the contents of environment variables. :param kwargs: Keyword arguments serving as additional options to the :manpage:`git-init(1)` command. :return: :class:`Repo` (the newly created repo) irrT)rrrzrnmakedirsrinit)clsrymkdirrrrrs rVrz Repo.initsbL t[1D T#**T"2 KKe $''-64d##rUc | jd|} t|ts t|}tjrd| vrtj |n|} | j d} | rtj | | d<d} |r$tjdj|} |stjt||s8tjt| j|j|s#|r!tj||j|j| dtj t|| fdddddt!| ||}|r,t#|dt%|j't(d nO|j+\}}t-|d d }t/|}t0j3d ||t)||t5j6|s.|j8 t5j|j8|n|}||| }|j:j<di|j?|j@r`|j@djB5}|jEdtj |j@djFddd|S|S#1swY|SxYw)Nrrkseparate_git_dirr)optionsunsafe_optionsrdT)with_extended_outputrpvuniversal_newlinesF)decode_streamsrr\zCmd(%s)'s unused stdout: %s)stderrrrr rT)$poprsrrrrq polish_urlr}shlexrrcheck_unsafe_protocolscheck_unsafe_optionslistkeysunsafe_git_clone_optionsclonerr rnew_message_handlerr communicategetattrr"rGrHrisabs _working_dirrupdate_environment environmentrr% set_valuer )rrr ryodb_default_typeprogress multi_optionsallow_unsafe_protocolsallow_unsafe_optionsrr clone_pathsep_dirmultirwrvrcmdliner writers rV_clonez Repo._cloneEslzz&"23$$t9D.1]]_6AQS^^D)W[ **/0 ),)@F% & KK 78E%  & &s3x 0#  $ $T&++--@QTQmQm n#  $ $]3KgKg hsyy   NN3s8 $   "&#  631    !$X.BBD $   $//1 VVdFB/G09G MM7& I T& 1yy7:7G7G7S388C,,d3Y]D4d# $##8coo&78 <<a.. M&  t||A7J7J(KL M t  M s =KKc |j|j|j|t|j||f||d|S)aCreate a clone from this repository. :param path: The full path of the new repo (traditionally ends with ``./.git``). :param progress: See :meth:`Remote.push `. :param multi_options: A list of :manpage:`git-clone(1)` options that can be provided multiple times. One option per list item which is passed exactly as specified to clone. For example:: [ "--config core.filemode=false", "--config core.ignorecase", "--recurse-submodule=repo1_path", "--recurse-submodule=repo2_path", ] :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: * ``odbt`` = ObjectDatabase Type, allowing to determine the object database implementation used by the returned :class:`Repo` instance. * All remaining keyword arguments are given to the :manpage:`git-clone(1)` command. :return: :class:`Repo` (the newly cloned repo) rr)rrrrFr)rryrrrrrs rVrz Repo.clonesQ\t{{ HH OO  N    $:!5    rUc |jtj} || jdi||j| ||t ||f||d|S)aCreate a clone from the given URL. :param url: Valid git url, see: https://git-scm.com/docs/git-clone#URLS :param to_path: Path to which the repository should be cloned to. :param progress: See :meth:`Remote.push `. :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 empty string as its value. :param multi_options: See the :meth:`clone` method. :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: See the :meth:`clone` method. :return: :class:`Repo` instance pointing to the cloned directory. rrT)rrnrprrr ) rr to_pathrenvrrrrrs rV clone_fromzRepo.clone_fromso\'' 4 ? "C " " )S )szz        $:!5    rUc R||jj}|r d|vr||d<||d<|jdg}ttt t t tt dff|}t|ttfs|g}|jjd|g|i||S)aArchive the tree at the given revision. :param ostream: File-compatible stream object to which the archive will be written as bytes. :param treeish: The treeish name/id, defaults to active branch. :param prefix: The optional prefix to prepend to each filename in the archive. :param kwargs: Additional arguments passed to :manpage:`git-archive(1)`: * Use the ``format`` argument to define the kind of format. Use specialized ostreams to write any format supported by Python. * You may specify the special ``path`` keyword, which may either be a repository-relative path to a directory or file to place into the archive, or a list or tuple of multiple paths. :raise git.exc.GitCommandError: If something went wrong. :return: self rx output_streamry.rd) rrIrr?r>r,r5r<rstuplerrarchive)rostreamtreeishrxrrys rVrz Repo.archivesB ?ii&&G hf,%F8 ")zz&"%E(DNE(C-4HHI4P$ .6Dw888 rUc|jry|jr3tjtj|jdSy)ai :return: True if our :attr:`git_dir` is not at the root of our :attr:`working_tree_dir`, but a ``.git`` file with a platform-agnostic symbolic link. Our :attr:`git_dir` will be wherever the ``.git`` file points to. :note: Bare repositories will always return ``False`` here. Frj)rkrrr_rrs rVhas_separate_working_treezRepo.has_separate_working_treeAs: 99  ::chht'<') __class__rQrPr[)rclazzs rV__repr__z Repo.__repr__Us&$//NNrUc&|jr tj|jd}tjsyt |d5}|j j }ddd|jS#1swYxYw)z :return: The commit which is currently being replayed while rebasing. ``None`` if we are not currently rebasing. REBASE_HEADNrt)r[rrr_rreadlinerrI)rrebase_head_filer!contents rVcurrently_rebasing_onzRepo.currently_rebasing_onYsu <<"xx mD zz*+ "D ) +Qjjl((*G +{{7## + +s BB) ryrYrzType[LooseObjectDB]rboolrr returnNone)r 'Repo')rr0r r )r r )robjectr r )r r)r rr)rrrr r )r rY)r r,)r r )r z'IterableList[Head]')r z'IterableList[Reference]')r z 'IndexFile')r z'HEAD')r z'IterableList[Remote]')origin)rrrr 'Remote')r z'IterableList[Submodule]')rrrr z 'Submodule')rr0rr0r r)rr0rr0r zIterator[Submodule])r z'IterableList[TagReference]')ryr,r r)ryr,r rr)rFN) ryr,rIz!Union['SymbolicReference', 'str']rr rrLr z'Head')rz'Union[str, Head]'rr0r r )rNF) ryr,rzUnion[str, 'SymbolicReference']rrLrr rr0r r)rrr r )rrrr rrrr0r r)rrr rrr)rbr+r[rYr rr)rbOptional[Lit_config_levels]r r )NN)rbrr[rYr r )ra)rbr+r r )r(zUnion[str, Commit_ish, None]r r)rr0rr0r zIterator['Tree'])r(zUnion[Tree_ish, str, None]r z'Tree')Nr\)r(z-Union[str, Commit, 'SymbolicReference', None]r4z#Union[PathLike, Sequence[PathLike]]rr0r zIterator[Commit])r(r-rr0r z List[Commit])rBrr(rr r )rIrrrJzUnion[str, None]r r )rSrr r )r  List[str])r\rr r )TTFTN) rr rir rjr rr ryrYr r )rr0rr0r r)r4r,r r)r r)r(zstr | HEAD | Nonerrrrr0r zIterator['BlameEntry'])FN) r(zUnion[str, HEAD, None]rrrrr rOptional[List[str]]rr0r zKList[List[Commit | List[str | bytes] | None]] | Iterator[BlameEntry] | None) ryzUnion[PathLike, None]rr rType[GitCmdObjectDB]rr rr0r r )NNFF)rz'Git'r r,ryr,rrrzPUnion['RemoteProgress', 'UpdateProgress', Callable[..., 'RemoteProgress'], None]rrrr rr rr0r r )ryr,rzOptional[CallableProgress]rrrr rr rr0r r )NNNFF)r r,rr,rr)rzOptional[Mapping[str, str]]rrrr rr rr0r r ) rzUnion[TextIO, BinaryIO]rrLrxrLrr0r r)r z Commit | None)^rPrQrR__doc__rOr?rrSrZr]rtcompilerrre_hexsha_shortenedrvrre_tab_full_linerrbrrr rrrrrrrrpropertyrsetterrrrkrrrrrrrrrrrrrrr staticmethodrrrr r rrrrr~r%rIr0r+r/r9rArMrPrUrWr]r`rZrlrjrhr}rrr classmethodrrrrrrr'rr rTrUrVrrisN 0 ud C3,0)0 ,KBJJv&MRZZ 45N$"**%;<TUJ * +A B!rzz+.  &PL"OE  $($2*/ S& S&"S&$( S&  S&  S&j  $"55 44 &&00%%**  ""'' ** M 4 :8-- -FF5; $ >>2> >  >  >$306!% NN-N N  N  N N&0 8+:59>1> >259&* A1 A$ A  Av" /D40>B57= :=3= =  =B)V(($  ))'' 8*&&## ! %#' ''' '  ' ! ' 'R++"(G0 # #Z@"(, W #WW W & W  W UWr'+%3 -$#-$-$# -$  -$  -$ -$-$^fj-1',%*T TT T / T c T+T!%T#TT TTr04-1',%* 8 8 -8 + 8 !% 8 # 8 8  8 t &*+/-1',%*: : : # : ) : + : !%: #: :  : : ~"& $ ,(,, ,  ,  ,\$IO $rU)e __future__r__all__rloggingrnos.pathryrpathlibrrtrrrwrgitdb.db.looser gitdb.excrgit.cmdrr git.compatr r git.configr git.dbr git.excrrr git.indexr git.objectsrrrgit.refsrrrr git.remoterrrgit.utilrrrr r!r"funr$r%r&r'r( git.typesr)r*r+r,r-r.r/typingr0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBgit.objects.submodule.baserCgit.refs.symbolicrDrErF getLoggerrPrGrHrrTrUrVr4s # (    (.*&!  5588AA&2 93)% '  H %}$}$rU