a +b @sdZddlmZddlmZddlmZddlmZm Z m Z m Z m Z m Z mZddlmZmZe jZiZeeZdZedd d ged ed fd ddedfd ddedfd ddedfgejejejedejddddZdS)z2pull, update and merge in one command (DEPRECATED))absolute_import)_)short)cmdutilerrorexchangehglockpycompat registrar)dateutilurlutilsships-with-hg-corefetchrrevs*a specific revision you would like to pullsREVeditNs invoke editor on commit messagess force-editors edit commit message (DEPRECATED)s switch-parentsswitch parents when mergingshg fetch [SOURCE])Z helpcategorydefaultc st|}|d}|r&t||d<jj}z|}Wnt j y`d}Yn0|krt j t dt ddd}}z2 }}t|} fdd| D} t| dkrt t d td ||d } t|| |t d t| d} |d rhzfdd|d D} Wn(t jyft d} t | Yn0tj| dj} | d krWt||d S|}jg|d}t|dkrt|r|d krt |d Wt||SWt||d Sfdd|D}|r4|d t!fdd|D}t|dkr~|t dt|dWt||dS|sWt||d Sd} |r(|dr|d }}n0|d }}|t dj"|t#|ft!||}|t d|"t#|ftj$|dd} | st%||pLdt&'}|dpb|d}tj(|d d}j)||d|d|d}|t d j"|t#|f| Wt||St||0dS)!apull changes from a remote repository, merge new changes if needed. This finds all changes from the repository at the specified path or URL and adds them to the local repository. If the pulled changes add a new branch head, the head is automatically merged, and the result of the merge is committed. Otherwise, the working directory is updated to include the new changes. When a merge is needed, the working directory is first updated to the newly pulled changes. Local changes are then merged into the pulled changes. To switch the merge order, use --switch-parent. See :hg:`help dates` for a list of formats valid for -d/--date. Returns 0 on success. sdateNs#working directory not at branch tips'use 'hg update' to check out branch tip)hintcs$g|]}t|dkr|qS)r)lenZchildren).0head)repo1/usr/lib64/python3.9/site-packages/hgext/fetch.py grzfetch..sHmultiple heads in this branch (use "hg heads ." and "hg merge" to merge)rrspulling from %s rcsg|]}|qSr)lookup)rrev)otherrrrvrsOother repository doesn't support revision lookup, so a rev cannot be specified.)Zheadscsg|]}|kr|qSrrrn)parentrrrrcsg|]}|kr|qSrrr!) newparentrrrrs[not merging with %d other new branch heads (use "hg heads ." and "hg merge" to merge them) Fs switch_parentsupdating to %d:%s smerging with %d:%s )ZremindsAutomated merge with %srs force_editor)ZeditZeditformsuser)editors5new changeset %d:%s merges remote changes with local )*r Z byteskwargsgetr Z parsedateZdirstateZp1branchZ branchtiprZRepoLookupErrorZAbortrwlockr rZ bailifchangedZ branchheadsrr Zget_unique_pull_pathrZpeerstatusZ hidepasswordZCapabilityErrorrZpullZcgresultreleaseZ changelogZ nodesbetweenupdateZcleanrrmergeZ logmessageZ removeauthurlZgetcommiteditorZcommit)ZuirsourceZoptsdater'Z branchnoder(r ZbheadspathZrevserrZmodheadsZnewheadsZ newchildrenZ firstparentZ secondparentZp2ctxmessageZeditoptr%r"r)r$rr#rrfetch&s(          F  ? =   , )    r3)r)__doc__Z __future__rZmercurial.i18nrZmercurial.noderZ mercurialrrrrr r r Zmercurial.utilsr r r*ZcmdtableZcommandZ testedwithZ commitoptsZ commitopts2Z remoteoptsZCATEGORY_REMOTE_REPO_MANAGEMENTr3rrrrs>   $