2biFSSKrSSKrSSKrSSKrSSKrSSKrSSKJ r J r J r SSK J r Jr SSKJrJrJr SSKJr SSKJrJrJrJrJrJrJr \R:R<r\R:R>r\R@"\!5r"\RF"S5r$\RF"S5r%\RF"S \RL5r'S \(S \)4S jr*"S S\5r+\RX"\+5 g)N)ListOptionalTuple) BadCommandInstallationError) HiddenText display_pathhide_url) make_command)AuthInfoRemoteNotFoundErrorRemoteNotValidError RevOptionsVersionControl(find_path_to_project_root_from_repo_rootvcsz(^git version (\d+)\.(\d+)(?:\.(\d+))?.*$z^[a-fA-F0-9]{40}$a/^ # Optional user, e.g. 'git@' (\w+@)? # Server, e.g. 'github.com'. ([^/:]+): # The server-side path. e.g. 'user/project.git'. Must start with an # alphanumeric character so as not to be confusable with a Windows paths # like 'C:/foo/bar' or 'C:\foo\bar'. (\w[^:]*) $shareturnc>[[RU55$N)bool HASH_REGEXmatch)rs ڇ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_internal/vcs/git.pylooks_like_hashr7s    % &&c ^\rSrSrSrSrSrSrSrSr \ S\ S \ \ 4S j5r S \ S \ S \4S jrS \\S44Sjr\S\ S \\ 4Sj5r\S \ S\ S \\\ \44Sj5r\S \ S\ S \4Sj5r\S \ S \S\S \4Sj5r\S \ S\\ S \4Sj5rS \ S \S\S\S S4 SjrS \ S \S\S S4SjrS \ S \S\S S4Sjr\S\ S \ 4Sj5r\ S \ S \ 4Sj5r \S\ S\ S \4Sj5r!\S(S\ S\\ S \ 4S jj5r"\S\ S \\ 4S!j5r#\S \ S \\ \\ \$44U4S"jj5r%\S\ S S4S#j5r&\S\ S \\ 4U4S$jj5r'\ S%\ S \4S&j5r(S'r)U=r*$))Git;gitz.gitclone)zgit+httpz git+httpszgit+sshzgit+gitzgit+file)GIT_DIR GIT_WORK_TREEHEADrevrcU/$rr%s rget_base_rev_argsGit.get_base_rev_argsKs u rurldestcUR[U55up4UR(dgURX$R5(dg[ UR X$R5S5nU(+$)NFr)get_url_rev_optionsr r%is_commit_id_equalrget_revision_sha)selfr+r,_ rev_optionsis_tag_or_branchs ris_immutable_rev_checkoutGit.is_immutable_rev_checkoutOsf11(3-@&&t__==  5 5dOO LQ OP###r.cURS/SSSS9n[RU5nU(d[R SU5 g[ UR S55[ UR S 554$) Nversionz git versionFT) command_desc show_stdout stdout_onlyzCan't parse git version: %sr') run_commandGIT_VERSION_REGEXrloggerwarningintgroup)r1r8rs rget_git_versionGit.get_git_version]sq"" K& #  "''0 NN8' BEKKN#SQ%899rlocationc/SQnURUSSSUS9nUR5nURS5(aU[S5S$g)zT Return the current branch, or None if HEAD isn't at a branch (e.g. detached HEAD). )z symbolic-ref-qr$r<FTextra_ok_returncodesr:r;cwdz refs/heads/N)r>strip startswithlen)clsrFargsoutputrefs rget_current_branchGit.get_current_branchjs]. !% ! lln >>- ( (s=)+, ,rcURSU/USSSS9n0nUR5RS5H4nURS5nU(dMURSS S 9upgXdU'M6 S U3nS U3n UR U5n U bU S4$UR U 5n U S4$![a [ S U<35ef=f)z Return (sha_or_none, is_branch), where sha_or_none is a commit hash if the revision names a remote branch or tag, otherwise None. Args: dest: the repository directory. rev: the revision name. zshow-refFTignore)rLr:r; on_returncode   r=)maxsplitzunexpected show-ref line: zrefs/remotes/origin/z refs/tags/)r>rMsplitrstrip ValueErrorget) rPr,r%rRrefslineref_sharef_name branch_reftag_refrs rr0Git.get_revision_shas  " ! LLN((.D;;t$D H$(JJsQJ$?! %N/,C51 se$hhz" ?; hhwU|! H!#=dX!FGG Hs B&&CcURS5(ag[U5(dgURX5(agg)z Return true if rev is a ref or is a commit that we don't have locally. Branches and tags are not considered in this method because they are assumed to be always available locally (which is a normal outcome of ``git clone`` and ``git fetch --tags``). zrefs/TF)rNr has_commit)rPr,r%s r _should_fetchGit._should_fetchs9 >>' " "s## >>$ $ $rr3c URnUceURX5upVUb)URU5nU(aXClU$SUlU$[ U5(d[ R SU5 URX5(dU$UR[SSX#R55US9 URUSS9nURU5nU$)z Resolve a revision to a new RevOptions object with the SHA1 of the branch, tag, or ref if found. Args: rev_options: a RevOptions object. Nz:Did not find branch or tag '%s', assuming revision or ref.fetchrHrL FETCH_HEADr() arg_revr0make_new branch_namerr@rArjr>r to_args get_revision)rPr,r+r3r%r is_branchs rresolve_revisionGit.resolve_revisions!!--d8 ?%..s3K-6c # =AK # s## NNL    ++   $-@-@-B C  t6!**3/ rnamec:U(dgURU5U:H$)z Return whether the current commit hash equals the given name. Args: dest: the repository directory. name: a string name. F)rt)rPr,rxs rr/Git.is_commit_id_equals %--r verbosityNcdUR5n[RSX%[U55 US::aSnO US:XaSnOSnUR 5S:a!UR [ SS /UQUPUP765 OUR [ S/UQUPUP765 UR(aURXU5n[US S5n[RS X75 UcKURXR5(d*[ S S UR55nUR XS9 OSURU5U:waSU3n S SUSU /nUR XS9 O"URU5n URU 5n[RSX#R5 UR!U5 g)NzCloning %s%s to %sr)z--quietr<r')z --verbosez --progress)r=r!z--filter=blob:nonerrzRev options %s, branch_name %scheckoutrHrnzorigin/z-bz--trackzResolved %s to commit %s) to_displayr@infor rDr>r r%rvgetattrdebugr/rsrTrtrqupdate_submodules) r1r,r+r3r{ rev_displayflagsrrcmd_args track_branchrs r fetch_new Git.fetch_news",,.  (#L%1E !^E/E    !W ,   (       \'EEE3EE F ??//;GK!+}dCK LL9; T"..t__EE+"#++- H $$X$8((.+=") 6     4##D)C%..s3K .__E t$rcUR[SSU5US9 [SSUR55nURXAS9 URU5 g)Nconfigzremote.origin.urlrnr~rH)r>r rsrr1r,r+r3rs rswitch Git.switchDs]  #6 <   D+2E2E2GH , t$rcUR5S:aUR/SQUS9 OURSS/US9 URXU5n[SSSUR 55nURXAS9 UR U5 g)N)r< )rmrHz--tagsrnrmrHresetz--hard)rDr>rvr rsrrs rupdate Git.updateNs    !V +   6D  A   gt_$  7++D{C 49L9L9NO , t$rc,UR/SQSSSUS9nUR5nUSnUHnUR S5(dMUn O UR S5S nUR UR55$![a [ef=f) z Return URL of the first remote encountered. Raises RemoteNotFoundError if the repository does not have a remote url configured. )rz --get-regexpzremote\..*\.urlrIFTrJrzremote.origin.url r[r<)r> splitlines IndexErrorr rNr]_git_remote_to_pip_urlrM)rPrFstdoutremotes found_remoteremoter+s rget_remote_urlGit.get_remote_url\s :!% ! ##% &"1:LF  !566%   %a())#))+66 &% % &s BBc>[R"SU5(aU$[RR U5(a$[ R "U5R5$[RU5nU(aURS5$[U5e)a Convert a remote url from what git uses to what pip accepts. There are 3 legal forms **url** may take: 1. A fully qualified url: ssh://git@example.com/foo/bar.git 2. A local project.git folder: /path/to/bare/repository.git 3. SCP shorthand for form 1: git@example.com:foo/bar.git Form 1 is output as-is. Form 2 must be converted to URI and form 3 must be converted to form 1. See the corresponding test test_git_remote_url_to_pip() for examples of sample inputs/outputs. z\w+://z ssh://\1\2/\3) rerospathexistspathlibPurePathas_uri SCP_REGEXexpandr)r+ scp_matchs rrGit._git_remote_to_pip_urlzsw" 88Is # #J 77>>#  ##C(//1 1OOC( ##$45 5!#&&rcVURSSSSU-/USS9 g![a gf=f)zE Check if rev is a commit that is available in the local repository. rev-parserHz--verifyzsha^F)rLlog_failed_cmdT)r>r)rPrFr%s rriGit.has_commitsG  OOdJ =$  !  s  ((cTUcSnURSU/SSUS9nUR5$)Nr$rFTr:r;rL)r>rM)rPrFr% current_revs rrtGit.get_revisionsA ;Coo #  &   ""rc\URSS/SSUS9R5n[RR U5(d[RR X5n[RR [RR US55n[X5$)zy Return the path to Python project root, relative to the repo root. Return None if the project root is in the repo root. rz --git-dirFTrz..)r>rMrrisabsjoinabspathr)rPrFgit_dir repo_roots rget_subdirectoryGit.get_subdirectorys// + & " %'  ww}}W%%ggll85GGGOOBGGLL$$?@ 7LLrc>[U5up#pEnURS5(aUS[URS55*nU[R R U5RSS5RS5-nURS5S-n USU [X)SX8XV45-nSU;a?SU;deURS S 5n[T U]-U5upn URS S 5nO[T U]-U5upn XU 4$) a Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'. That's required because although they use SSH they sometimes don't work with a ssh:// scheme (e.g. GitHub). But we need a scheme for parsing. Hence we remove it again afterwards and return it as a stub. fileN/\+r<z://zfile:zgit+z git+ssh://zssh://) urlsplitendswithrOlstripurllibrequest url2pathnamereplacefind urlunsplitsuperget_url_rev_and_auth) rPr+schemenetlocrqueryfragmentinitial_slashesnewpath after_plusr% user_pass __class__s rrGit.get_url_rev_and_auths19 -X ??6 " ""#;c$++c*:&;%;s"C Ci++h+C"''">s"C Ci""rc[RR[RRUS55(dgUR /SQUS9 g)Nz .gitmodules) submodulerz--initz --recursiverHrn)rrrrr>)rPrFs rrGit.update_submoduless>ww~~bggll8]CDD   B  rc  >[TU]U5nU(aU$URSS/USSSSS9n[RRURS55$![a [R SU5 g[ a gf=f) Nrz--show-toplevelFTraise)rLr:r;rXrzKcould not determine if %s is under git control because git is not availablez ) rget_repository_rootr>rr@rrrrnormpathr^)rPrFlocrrs rrGit.get_repository_rootsg)(3 J /0! %$  A"ww 011  LL/     sA B  B  B repo_urlcg)zEIn either https or ssh form, requirements must be prefixed with git+.Tr')rs rshould_add_vcs_url_prefixGit.should_add_vcs_url_prefixsrr'r)+__name__ __module__ __qualname____firstlineno__rxdirname repo_nameschemes unset_environdefault_arg_rev staticmethodstrrr)rr5rrBrD classmethodrrTr0rjrrrvr/rrrrrrirtrr rrrr__static_attributes__ __classcell__)rs@rrr;s0 DGIG1MOstCy $S $ $ $ :sCx :#(3-0+C+c+eHSM4rs ((BGG7 <<  \\ $ $    8 $JJ ZZ+ ,  JJ  JJ  '''P.Pf Sr