yL i¶ bdZgdZddlZddlZddlZddlmZmZddlm Z m Z ddl m Z m Z mZddlmZddlmZmZmZmZmZdd lmZmZmZmZmZmZdd lmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.m/Z/e'rdd l0m1Z1dd l2m3Z3ddl4m5Z5e.dZ6ejne8Z9dedede)ede defdfdefdZ:e+dddefdZ;e+de defdefdZ;e+dedefdZ;de)e defedfde)eeffdZ;GddeZ<Gddee<Z=Gdd eZ>Gd!d"eeZ?y)#zHModule implementing a remote object allowing easy access to git remotes.)RemoteProgressPushInfo FetchInfoRemoteN)Githandle_process_output)defenc force_text)GitConfigParserSectionConstraintcp)GitCommandError)Head ReferenceRemoteReferenceSymbolicReference TagReference)CallableRemoteProgress IterableList IterableObj LazyMixinr join_path) AnyCallableDictIteratorListNoReturnOptionalSequence TYPE_CHECKINGTypeUnioncastoverload) AnyGitObjectLiteralPathLike)Commit)UpdateProgress)Repo) !+-*=t?kwargsgitprogressr*.returnc<||jdd}|dk\rd|d<|S)aAdd the ``--progress`` flag to the given `kwargs` dict if supported by the git command. :note: If the actual progress in the given progress instance is not given, we do not request any progress. :return: Possibly altered `kwargs` N)Tr6) version_info)r4r5r6vs P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/git/remote.py add_progressr?>s4   Ra  ;!%F:  McyNr6s r>to_progress_instancerEYsrErE]sRUr@cyrBrCrDs r>rErEasFIr@cJt|r t|S| tS|S)zaGiven the `progress` return a suitable object derived from :class:`~git.util.RemoteProgress`.)callablerrrDs r>rErEes/ %h//   Or@c<eZdZdZdZdZedDcgc]}d|z c}}\ ZZZ Z Z Z Z ZZZZe e deeeedZ dd ed eedfd ed d deededdfdZededfdZedeeeffdZed d deddfdZeddde de de!fdZ"ycc}}w)rah Carries information about the result of a push operation of a single head:: info = remote.push()[0] info.flags # bitflags providing more information about the result info.local_ref # Reference pointing to the local reference that was pushed # It is None if the ref was deleted. info.remote_ref_string # path to the remote reference located on the remote side info.remote_ref # Remote Reference on the local side corresponding to # the remote_ref_string. It can be a TagReference as well. info.old_commit # commit at which the remote_ref was standing before we pushed # it to local_ref.commit. Will be None if an error was indicated info.summary # summary line providing human readable english text about the push ) local_refremote_ref_stringflags_old_commit_sha_remotesummarypushinfo r:r)Xr/r0r.r,r1r-NrMrKrLremoter old_commitrPr7cX||_||_||_||_||_||_y)zInitialize a new instance. local_ref: HEAD | Head | RemoteReference | TagReference | Reference | SymbolicReference | None N)rMrKrLrOrNrP)selfrMrKrLrTrUrPs r>__init__zPushInfo.__init__s0 "!2 ) r@)r)Nc|jxr/|jjj|jxsdSrB)rNrOrepocommitrWs r>rUzPushInfo.old_commits4##V (9(9(@(@AUAU(V^Z^^r@c|jjdr*t|jj|jS|jjdrmt |jj|j}t |jjdt|jd|jStd|jz)z :return: Remote :class:`~git.refs.reference.Reference` or :class:`~git.refs.tag.TagReference` in the local repository corresponding to the :attr:`remote_ref_string` kept in this instance. z refs/tagsz refs/headsz refs/remotes//zCould not handle remote ref: %r) rL startswithrrOrZrrstrname ValueError)rW remote_refs r>rczPushInfo.remote_refs  ! ! , ,[ 9 1 143I3IJ J  # # . .| <"4<<#4#4d6L6LMJ" !!(+DLL(9:??K  >AWAWWX Xr@linec|jdd\}}}d} ||j|z}|jd\}} ||jzrd} n(|dk(rd} n t j |j|} d} |jd rxd |vr||jz}nd |vr||jz}nd |vr||jz}nmd |vr||jz}nYd|vr||jz}nEd|vrA||jz}n1d} |dk(rd} |jddj| \} }| } t|| | || |S#t$r}td|d||d}~wwxYw)zCreate a new :class:`PushInfo` instance as parsed from line which is expected to be like refs/heads/master:refs/heads/master 05d2687..1d0568e as bytes. rControl character  unknown as parsed from line N:z(delete)[z [rejected]z[remote rejected]z[remote failure]z [no match]z [new tag]z [new branch]...r,..)split _flag_mapKeyErrorrbDELETEDr from_pathrZr_REJECTEDREMOTE_REJECTEDREMOTE_FAILUREERRORNEW_TAGNEW_HEADr)clsrTrdcontrol_characterfrom_torPrMefrom_ref_string to_ref_stringfrom_refrU split_tokenold_sha_new_shas r> _from_linezPushInfo._from_lines/3jjq.A+7G w S]]#45 5E *1s);& 3;; 7;H*,$..v{{OL%)   c "w&%$/,,,#w.+++("'$7*%  K C'" ' c 21 5 ; ;K H GX Jx GTTS wVgimnouv v wsE E&E!!E&rZr+argsr4ctrBNotImplementedErrorryrZrr4s r> iter_itemszPushInfo.iter_items !!r@)N)#__name__ __module__ __qualname____doc__ __slots___id_attribute_rangerwrxNO_MATCHrsrtrurq FORCED_UPDATE FAST_FORWARD UP_TO_DATErvrointr#rr`rrXpropertyrUrrrc classmethodrrrr.0xs00r>rrvs I Nr#Aa#        I %)*D01    SM  (_E.1__YE/<"?@YY(2U2U2U 2U2Uh"f"S"C"H""_ $s Brc4eZdZdZddZdfd ZddZxZS) PushInfoListz=:class:`~git.util.IterableList` of :class:`PushInfo` objects.cJtttj|dSN push_infos)r$rr__new__rys r>rzPushInfoList.__new__sL,"6"6sL"IJJr@c2t|dd|_yr)superrXerror)rW __class__s r>rXzPushInfoList.__init__s &*. r@c4|jr |jy)z-Raise an exception if any ref failed to push.N)rr\s r>raise_if_errorzPushInfoList.raise_if_errors ::**  r@)r7rr7N)rrrrrrXr __classcell__rs@r>rrsGK/r@rc eZdZUdZdZdZedDcgc]}d|z c}}\ZZZ Z Z Z Z Zej dZee de e e dZeeefed <ed ed fd Z ddedededeed fdeed d f dZ d efdZ!e"d efdZ#e"d dZ$edddeded dfdZ%eddde&de&d e'fdZ(y cc}}w)!ra* Carries information about the results of a fetch operation of a single head:: info = remote.fetch()[0] info.ref # Symbolic Reference or RemoteReference to the changed # remote head or FETCH_HEAD info.flags # additional flags to be & with enumeration members, # i.e. info.flags & info.REJECTED # is 0 if ref is SymbolicReference info.note # additional notes given by git-fetch intended for the user info.old_commit # if info.flags & info.FORCED_UPDATE|info.FAST_FORWARD, # field is set to the previous location of ref, otherwise None info.remote_ref_path # The path from which we fetched on the remote. It's the remote's version of our info.ref )refrUrMnoteremote_ref_path fetchinfor:zK^ *(?:.{0,3})(.) (\[[\w \.$@]+\]|[\w\.$@]+) +(.+) -> ([^ ]+)( \(.*\)?$)?r)r-r.r0r1r,r/ror7Tctjt5|jd=dddtjt5|jd=dddt j dddk\r|j |jd<y|j |jd<y#1swYxYw#1swYcxYw)zUpdate information about which :manpage:`git-fetch(1)` flags are supported by the git executable being used. Called by the :func:`git.refresh` function in the top level ``__init__``. r2Nr/r9)r9 T) contextlibsuppressrprorr< TAG_UPDATErs r>refreshzFetchInfo.refreshJs  * # c" #   * # c" # 5  bq !W ,!$CMM# "%CMM#  # # # #sB- B9-B69CNrrMrrUrcJ||_||_||_||_||_y)zInitialize a new instance.N)rrMrrUr)rWrrMrrUrs r>rXzFetchInfo.__init___s(  $.r@c|jSrBrar\s r>__str__zFetchInfo.__str__n yyr@c.|jjS)z:return: Name of our remote ref)rrar\s r>razFetchInfo.nameqsxx}}r@c.|jjS)z!:return: Commit of our remote ref)rr[r\s r>r[zFetchInfo.commitvsxxr@rZr+rd fetch_linec |jj|}|td|z|j\}}}}} t t |} |j d\} } } | j dd\} } d} ||j|z}d}d }d |vr||jz}d |vr||jz}d }d|vr||jz}d }d|vr||jz}d|vsd|vr/d}|dk(r|dd}|j|j |d}d}|dk(rt}n2| dk(s|rt}n$| dvrt }nd| vrt"}nt%d| z|tur ||d}nd}|j'}|j)t*j,dzr3|}|turf|j)t j,dzsDt*}n=|turd|vrt/t j,|}nt/|j,|}|||d }| xr| j'xsd} |||| ||S#t$r}td|z|d}~wwxYw#t$r}td|d ||d}~wwxYw)aParse information from the given line as returned by ``git-fetch -v`` and return a new :class:`FetchInfo` object representing this information. We can handle a line as follows:: %c %-*s %-*s -> %s%s Where ``c`` is either a space, ``!``, ``+``, ``-``, ``*``, or ``=``: - '!' means error - '+' means success forcing update - '-' means a tag was updated - '*' means birth of new branch or tag - '=' means the head was up to date (and not moved) - ' ' means a fast-forward `fetch_line` is the corresponding line from FETCH_HEAD, like:: acb0fa8b94ef421ad60c8507b634759a472cd56c not-for-merge branch '0.1.7RC' of /tmp/tmpya0vairemote_repo NzFailed to parse line: %rrfr,r:z#Failed to parse FETCH_HEAD line: %rrrhriFrejectedznew tagTz tag updatez new branchrlrm FETCH_HEADtag)zremote-trackingbranchr^z Cannot handle reference type: %rztags/) check_pathr)_re_fetch_resultmatchrbgroupsr$flagKeyLiteralrnrorprsrwrrx rev_parserrrr TypeErrorstripr_r_common_path_defaultr)ryrZrdrrrz operationlocal_remote_refremote_local_ref_strr _new_hex_sha_fetch_operation fetch_note ref_type_namer|rMrUis_tag_operationrref_typeremote_local_refref_paths r>rzFetchInfo._from_line{s,$$**40 =7$>? ? LLN      1BC X9C9I9I$9O 6L*J(2(8(8a(@ %M:  w S]]#45 5E15    " S\\ !E  ! S[[ E#  9 $ S^^ #E#  9 $ S\\ !E I !2K C')#2.   (DQ(GHJ7; < /(H e #'7$H ; ;'H M !H>NO O ( ('l; ,0H#7#=#=#? #..y/M/MPS/ST0</8L8W8W#883>9 )H\)g9M.M$_%I%IK_`$X%B%BDXY (h5I %,"#UD*>NOO XBZOPVW W X wVgimnouv v ws0*II" I II" J+I==Jrr4ctrBrrs r>rzFetchInfo.iter_itemsrr@)rNN)r7r)))rrrrrrrrwrx HEAD_UPTODATErrsrrrvrecompilerrorrr__annotations__rr'rrr`r#r&rr(rXrrrar[rrrrrs00r>rr s JI Nq"Aa"  "rzz"pq      ,ItNC'( 004.2 /  / / / ,,- / "(+ /  /cEPfEPCEPSEP[EPEPN"f"S"C"H""O #s B<rc>eZdZUdZdZdZdgZdgZddgZe e d< dd de d d fd Z d e d e ffd Z d e fdZd e d d ffd Zd e fdZd e fdZded efdZded efdZd efdZd efdZedd de de d edfdZ d>de dee dede d df dZd?de dede d dfdZde de d dfd Ze d ee fd!Z!e d e"e#fd"Z$e d e"e%fd#Z&ed?dd de de dede d df d$Z'edd de de de d df d%Z(edd de d e fd&Z)edd de d e fd'Z*d(e d dfd)Z+de d dfd*Z, d@d+d,d-e-e.d.e fe/d fd/e-d e0fd e"d0fd1Z1 d@d+d,d-e-e.d.e fe/d fd/e-d e0fd e2fd2Z3dAd3Z4 dBd4e-e e5e d fd-e-e/d d5fd6ed/e-d e0fded7ede d e"e6fd8Z7 dCd4e-e e5e d fd-e-e/d5d fd/e-d e0fded7ede d e"e6fd9Z8 dCd4e-e e5e d fd-e-e/d5e.d.e/fd fd/e-d e0fded7ede d e2fd:Z9e d e:e;fd;ZxZ?S)Dra^Provides easy read and write access to a git remote. Everything not part of this interface is considered an option for the current remote, allowing constructs like ``remote.pushurl`` to query the pushurl. :note: When querying configuration, the configuration accessor will be cached to speed up subsequent accesses. )rZra_config_readerraz --upload-packz--receive-packz--execurlrZr+r7Nc ||_||_y)zInitialize a remote instance. :param repo: The repository we are a remote of. :param name: The name of the remote, e.g. ``origin``. N)rZra)rWrZras r>rXzRemote.__init__+s  r@attrc|dk(rt||S |jj|S#tj $rt||cYSwxYw)zwAllows to call this instance like ``remote.special(*args, **kwargs)`` to call ``git remote special self.name``.r)r __getattr__rgetr NoOptionErrorrWrrs r>rzRemote.__getattr__7s_ # #7&t, , -&&**40 0 -7&t, , -s2"AAc d|jzS)Nz remote "%s"rr\s r>_config_section_namezRemote._config_section_nameEstyy((r@c|dk(r9t|jjd|j|_yt ||y)Nr repository)r rZ config_readerrrr _set_cache_rs r>rzRemote._set_cache_HsH # ##4 '' 5))+#D  G  %r@c|jSrBrr\s r>rzRemote.__str__Srr@cPd|jjd|jdS)Nz)rrrar\s r>__repr__zRemote.__repr__Vs"&.."9"9499EEr@othercbt|t|xr|j|jk(SrB) isinstancetyperarWrs r>__eq__z Remote.__eq__Ys%%d,Hejj1HHr@c||k( SrBrCrs r>__ne__z Remote.__ne__\sEM""r@c,t|jSrB)hashrar\s r>__hash__zRemote.__hash___sDIIr@c |jjdy#tj$rYytj$rYywxYw)z :return: ``True`` if this is a valid, existing remote. Valid remotes have an entry in the repository's configuration. rTF)rrr rNoSectionErrorr\s r>existsz Remote.existsbsG      " "5 )     sAAArr4c/K|jdjD]b}|jds|jd}|j d}|dk(s|dk(rt d|zt |||dz|dyw)zJ:return: Iterator yielding :class:`Remote` objects of the given repositoryrzremote "rz%Remote-Section has invalid format: %rr:N)rsectionsr_findrfindrbr)ryrZrr4sectionlboundrbounds r>rzRemote.iter_itemsqs)),7@@B =G%%i0\\#&F]]3'F|v| !H7!RSSwvzF;< < =sBBnew_urlold_urlallow_unsafe_protocolsc |stj|d}||d<|r7|jjj|d|j ||fi||S|jjj|d|j |fi||S)aConfigure URLs on current remote (cf. command ``git remote set-url``). This command manages URLs on the remote. :param new_url: String being the URL to add as an extra remote URL. :param old_url: When set, replaces this URL with `new_url` for the remote. :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ``ext``. :return: self zset-urlinsert_kwargs_after--)rcheck_unsafe_protocolsrZr5rTra)rWr r r r4scmds r>set_urlzRemote.set_url~s&&  & &w /(,$%  DIIMM tTYY SF S  !DIIMM tTYY J6 J r@c *|j|d|S)aAdds a new url on current remote (special case of ``git remote set-url``). This command adds new URLs to a given remote, making it possible to have multiple URLs for a single remote. :param url: String being the URL to add as an extra remote URL. :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ``ext``. :return: self T)addr r)rWrr r4s r>add_urlzRemote.add_urls||CTBX|YYr@c (|j|dS)aJDeletes a new url on current remote (special case of ``git remote set-url``). This command deletes new URLs to a given remote, making it possible to have multiple URLs for a single remote. :param url: String being the URL to delete from the remote. :return: self T)deleter)rWrr4s r> delete_urlzRemote.delete_urls||C|--r@c#$K |jjjdd|j}t |t sJ|j dD]}|y #t$r }dt |vr |jjjd|j}t |t sJ|j dD]}d|vs|j ddn#t$rtfd d Dr`|jjjd d |jz}t |t sJ|j dD]}|nYd n d wwxYw|Yd }~y Yd }~y d }~wwxYww)zL:return: Iterator yielding all configured URL targets on a remote as stringszget-urlz--all zUnknown subcommand: get-urlshowz Push URL:z: rc38K|]}|tvywrB)r`)rmsg_exs r> zRemote.urls..sbs3#c(?bs)zcorrect access rightszcannot run sshz --get-allz remote.%s.urlN) rZr5rTrarr`rnranyconfig)rWremote_detailsrdexrs @r>urlsz Remote.urlsst !YY]]11)WdiiPNnc2 22&,,T2     -B7"%)YY]]%9%9&$))%LN%nc::: . 4 4T :7)T1"&**T"22"667'"b6abb)-)=)=k?]a]f]fKf)g).#>>>$2$8$8$>'D"&J'" ' " '7 saFAA#"F# F -F FF  Fcttjd|jz}|j tj |j |j|S)a7 :return: :class:`~git.util.IterableList` of :class:`~git.refs.remote.RemoteReference` objects. It is prefixed, allowing you to omit the remote path portion, e.g.:: remote.refs.master # yields RemoteReference('/refs/remotes/origin/master') %s/)rT)rrrraextend list_itemsrZ)rWout_refss r>refsz Remote.refssI3??]?]_dgkgpgp_p2q22499TYYOPr@c2ttjd|jz}|jj j dd|jddD]}d}|j|s|j|d}|jtjdzr0|jtj|j|{tjd|}|jt|j||S) a :return: :class:`~git.util.IterableList` of :class:`~git.refs.remote.RemoteReference` objects that do not have a corresponding head in the remote reference anymore as they have been deleted on the remote side, but are still available locally. The :class:`~git.util.IterableList` is prefixed, hence the 'origin' must be omitted. See :attr:`refs` property for an example. To make things more complicated, it can be possible for the list to include other kinds of references, for example, tag references, if these are stale as well. This is a fix for the issue described here: https://github.com/gitpython-developers/GitPython/issues/260 r&prunez --dry-runr9Nz * [would prune] rr^)rrrrarZr5rT splitlinesr_replacerrappendrr)rWr)rdtokenref_namefqhns r> stale_refszRemote.stale_refss"-99W9WY^aeajajYj,kIIMM((+tDOOQRSRTU BD(E??5)||E2.H""9#A#AC#GH 3 3DIIx HI"1"F"FQ 4 @A Br@c d}||d<tj|}|stj||jj|d||fi||||S)aCreate a new remote to the given repository. :param repo: Repository instance that is to receive the new remote. :param name: Desired name of the remote. :param url: URL which corresponds to the remote's name. :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ``ext``. :param kwargs: Additional arguments to be passed to the ``git remote add`` command. :return: New :class:`Remote` instance :raise git.exc.GitCommandError: In case an origin with that name already exists. rr r)r polish_urlrr5rT)ryrZrarr r4rs r>createz Remote.create s\2(,$%nnS!%  & &s +dD#884r@c ,|j|||fi|SrB)r6)ryrZrarr4s r>rz Remote.add/sszz$c4V44r@cv|jjd|t||r|j|S)znRemove the remote with the given name. :return: The passed remote name to remove rm)r5rTr _clear_cacheryrZras r>removez Remote.remove3s1 d# dC     r@c&|j||S)zAlias of remove. Remove the remote with the given name. :return: The passed remote name to remove )r<r;s r>r9z Remote.rm?szz$%%r@new_namec|j|k(r|S|jjjd|j|||_|j |S)zPRename self to the given `new_name`. :return: self rename)rarZr5rTr:)rWr>s r>r@z Remote.renameIsK 99 K Xtyy(;   r@c xd}||d<|jjj||jfi||S)a@Fetch all changes for this remote, including new branches which will be forced in (in case your local remote branch is not part the new remote branch's ancestry anymore). :param kwargs: Additional arguments passed to ``git remote update``. :return: self updater )rZr5rTra)rWr4rs r>rBz Remote.updateXs<(,$% T49977 r@proczGit.AutoInterruptr6.kill_after_timeoutrct|}td}g}ttjj }|j }t|d|dd||jxrdj|jxsd}|j||rtjd||jD]F} t| } |D]4} t| dkDs| d d k(s| d| k(s$|j!| 6Ht#|j$d } t'| j(d 5} | j+D cgc]} | j-t.} } dddt|}t }||k7rd }|dz }|dz }|||fz}tj1|tj1dt3|j5dztj1dt3| j5dz||kr| d|} n|d|}t7|| D]6\}} |j!tj9|j$||8|Scc} w#1swY xYw#t:$rD}tj1d|tjd|j=Yd}~d}~wwxYw)NraF finalizerdecode_streamsrDrrstderr'Error lines received while fetching: %sr:rr,rrbzFFetch head lines do not match lines provided via progress information zKlength of progress lines %i should be equal to lines in FETCH_HEAD file %i z5Will ignore extra progress lines or fetch head lines.s info lines: zUTF-8s head info: z#Caught error while parsing line: %szGit informed while fetching: %s)rErsetrrokeysnew_message_handlerr error_linesjoinwait_loggerwarning other_linesr lenr/rrZopenabspath readlinesdecoder debugr`encodeziprrbr)rWrCr6rDoutputfetch_info_linescmdsprogress_handler stderr_textrdcmd fetch_headfpfetch_head_infol_fill_fhirerr_linerexcs r>_get_fetch_info_from_stderrz"Remote._get_fetch_info_from_stderrhs (1-9,@ 9&&++-.#779    1  **Ntyy9M9M/NTRT   %  OOE{ S(( Dd#D t9q=T!W^Q3$++D1  'tyy,? *$$d + Or?A||~Ntt{{62NON O$%O$ E>[C a aC J JC E5> !C MM#  MM/C0@,A,H,H,QQ R MM.3+?+F+Fw+OO Pu}"1&5"9#3FU#; %((8/$J U Hj U i22499h ST U  3O O O. U CSI A8>>CSTT Us69I1 I,(I180I>,I11I;> K :KK ct|}|j}tdtddffd }t |||dd||j xrdj |j xsd} |j|S#t$r-}s|rtjd ||_ Yd}~Sd}~wwxYw) Nrdr7cp jtj|y#t$rYywxYwrB)r/rrrb)rdr^rWs r>stdout_handlerz-Remote._get_push_info..stdout_handlers3  h11$=>  s %) 55FrFrrrIrK) rErOrr`rrPrQrR ExceptionrSrTr) rWrCr6rDrarnrbr|r^s ` @r>_get_push_infozRemote._get_push_infos (1 $779+~        1  **Ntyy9M9M/NTRT  ! II[I )  ! I;W    !s6B C"B;;Cc|j}d} |jd||ur0d}|dz }|dz }t||j|jfz |j y#|j wxYw)z?Turns out we can't deal with remotes if the refspec is missing. placeholderfetch)defaultz Remote '%s' has no refspec set. zYou can set it as follows:zA 'git config --add "remote.%s.fetch +refs/heads/*:refs/heads/*"'.N)r get_valueAssertionErrorrarelease)rWr!unsetrs r>_assert_refspeczRemote._assert_refspecs## 75@933\\$SDIItyy+A%ABB A NN FNN s AA''A9refspecr*verboseallow_unsafe_optionsc ^||jt||jj|}t |t r|}n|g}|s|D]} | st j| |s8t jt |j|j|jjjd|g|ddd|d|} |j| ||} t|jjdr$|jjj| S)aFetch the latest changes for this remote. :param refspec: A "refspec" is used by fetch and push to describe the mapping between remote ref and local ref. They are combined with a colon in the format ``:``, preceded by an optional plus sign, ``+``. For example: ``git fetch $URL refs/heads/master:refs/heads/origin`` means "grab the master branch head from the $URL and store it as my origin branch head". And ``git push $URL refs/heads/master:refs/heads/to-upstream`` means "publish my master branch head as to-upstream branch at $URL". See also :manpage:`git-push(1)`. Taken from the git manual, :manpage:`gitglossary(7)`. Fetch supports multiple refspecs (as the underlying :manpage:`git-fetch(1)` does) - supplying a list rather than a string for 'refspec' will make use of this facility. :param progress: See the :meth:`push` method. :param verbose: Boolean for verbose output. :param kill_after_timeout: To specify a timeout in seconds for the git command, after which the process should be killed. It is set to ``None`` by default. :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 to be passed to :manpage:`git-fetch(1)`. :return: IterableList(FetchInfo, ...) list of :class:`FetchInfo` instances providing detailed information about the fetch results :note: As fetch does not provide progress information to non-ttys, we cannot make it available here unfortunately as in the :meth:`push` method. optionsunsafe_optionsrTF) as_process with_stdoutuniversal_newlinesr=rD update_cache)ryr?rZr5rlistrrcheck_unsafe_optionsrNunsafe_git_fetch_optionsrsrkhasattrodbr) rWrzr6r{rDr r|r4rrrCress r>rsz Remote.fetchsn ?  "fdiimmX> gt $,3D9D% 4..s3 4$  $ $T&++--@QUQnQn o"tyy}}"" $  *.EVZ^e io ..tXRd.e 499==. 1 IIMM & & ( r@c Z||jt||jj|}t j |xsg}|s|D]}t j ||s8t jt|j|j|jjjd||fddddd|}|j|||} t|jjdr$|jjj| S)aPull changes from the given branch, being the same as a fetch followed by a merge of branch with your local branch. :param refspec: See :meth:`fetch` method. :param progress: See :meth:`push` method. :param kill_after_timeout: See :meth:`fetch` 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: Additional arguments to be passed to :manpage:`git-pull(1)`. :return: Please see :meth:`fetch` method. r~rFT)rrrr=rr)ryr?rZr5r _unpack_argsrrrrNunsafe_git_pull_optionspullrkrrr) rWrzr6rDr r|r4rrCrs r>rz Remote.pull9sB ?  "fdiimmX>""7=b1% 0**3/ 0$  $ $T&++--@QUQmQm n!tyy}}!! $ -2tX\`d hn ..tXRd.e 499==. 1 IIMM & & ( r@c t||jj|}tj|xsg}|s|D]}tj ||s8tj t|j|j|jjjd||fddd|d|}|j|||S)aPush changes from source branch in refspec to target branch in refspec. :param refspec: See :meth:`fetch` method. :param progress: Can take one of many value types: * ``None``, to discard progress information. * A function (callable) that is called with the progress information. Signature: ``progress(op_code, cur_count, max_count=None, message='')``. See :meth:`RemoteProgress.update ` for a description of all arguments given to the function. * An instance of a class derived from :class:`~git.util.RemoteProgress` that overrides the :meth:`RemoteProgress.update ` method. :note: No further progress information is returned after push returns. :param kill_after_timeout: To specify a timeout in seconds for the git command, after which the process should be killed. It is set to ``None`` by default. :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ``ext``. :param allow_unsafe_options: Allow unsafe options to be used, like ``--receive-pack``. :param kwargs: Additional arguments to be passed to :manpage:`git-push(1)`. :return: A :class:`PushInfoList` object, where each list member represents an individual head which had been updated on the remote side. If the push contains rejected heads, these will have the :const:`PushInfo.ERROR` bit set in their flags. If the operation fails completely, the length of the returned :class:`PushInfoList` will be 0. Call :meth:`~PushInfoList.raise_if_error` on the returned object to raise on any failure. r~rT) porcelainrrrDr) r?rZr5rrrrrrNunsafe_git_push_optionspushrp) rWrzr6rDr r|r4rrCs r>rz Remote.pushosnfdiimmX>""7=b1% 0**3/ 0$  $ $T&++--@QUQmQm n!tyy}}!!     #1    ""4FX"YYr@c|jS)z :return: :class:`~git.config.GitConfigParser` compatible object able to read options for only our remote. Hence you may simply type ``config.get("pushurl")`` to obtain the information. )rr\s r>rzRemote.config_readers"""r@c( |`y#t$rYywxYwrB)rAttributeErrorr\s r>r:zRemote._clear_caches #   s  c|jj}|jt||j S)a :return: :class:`~git.config.GitConfigParser`-compatible object able to write options for this remote. :note: You can only own one writer at a time - delete it to release the configuration file and make it usable by others. To assure consistent results, you should only query options through the writer. Once you are done writing, you are free to use the config reader once again. )rZ config_writerr:r r)rWwriters r>rzRemote.config_writers:((*  )B)B)DEEr@)NF)FrBr)NNTNFF)NNNFF)@rrrrrrrrrr`rrXrrrrrrobjectboolrrrrrrrrrrrrrr$rrr*rr3r6rr<r9r@rBr#rrfloatrkrrpryrrrsrrr r rr:rrrs@r>rrs3IN      H, V 3 4  - - -)c) & & &F#FIFItI#F#t##   =f =S =C =HXDV = =[`%-c]SWkn :Z3ZZPSZX`Z" .c .S .X .hsm@ l?3   L3  D&#tgjowB5v5S5s5c5h55 &    &f&C&C&& s x sx(26 E!Ec*ND@AE"$+. E k " EV26 *!*c*ND@A*"$+. *  *X 04BF15',%*OsDIt+,O.>>?O O "$+. O !% O#OO i Of04BF15',%* 4sDIt+,4(8$>?4"$+. 4 !% 4 # 44 i 4p04ae15',%* KZsDIt+,KZ(8(3CV:WY]]^KZ"$+. KZ !% KZ # KZKZ KZZ#0A##F0FFr@r)@r__all__rloggingrgit.cmdrr git.compatr r git.configr r r git.excrgit.refsrrrrrgit.utilrrrrrrtypingrrrrrrrr r!r"r#r$r% git.typesr&r'r(git.objects.commitr)git.objects.submodule.baser* git.repo.baser+r getLoggerrrSr?rErrrrrCr@r>rs O ? .)==#VV 65)9"?@ '  H %   N$4hsN?R6SUYYZ 6 ?4?N? ? U8CH#5U:PU U I>InI IHS#X&<= >1 12"W"{W"t <)  e" e"PX FY X Fr@