^cH|ddlmZddlmZmZddlmZmZmZm Z m Z m Z dZ ddZ ddZd Zdd Zd Z dd Zd ZdS))_)hexnullrev)context mergestatemetadataphasesscmutil subrepoutilct|jdkrd}d}n%|jdd}|dk}|dv}||fS)zreturn a (changelog, filelog) boolean tuple changelog: copy related information should be stored in the changeset filelof: copy related information should be written in the file revision changeset-sidedataT experimentalscopies.write-tochangeset-only)rs compatibility)filecopiesmodeuiconfig)repowritechangesetcopywritefilecopymeta writecopiestos 2/usr/lib/python3/dist-packages/mercurial/commit.py_write_copy_metarsb  333! 8JKK )->>*/   0 00FNc >|}||}}|}|5|d5}t ||||\}} |} | dD]} | | d|j j dkrt|| | } |j } |jt!d|j ||j || ||||||| } || }| |j kr.|||j |||r|pd}}|dd t3| || t7j|j|}| |j ko|| }|r|st=j||||g| cdddcdddS#1swxYwYddddS#1swxYwYdS) aAdd a new revision to the target repository. Revision information is passed via the context argument. ctx.files() should list all files involved in this commit, i.e. modified/added/removed files. On merge, it may be wider than the ctx.files() to be committed, since any file nodes derived directly from p1 or p2 are excluded from the committed ctx.files(). origctx is for convert to work around the problem that bug fixes to the files list in changesets change hashes. For convert to be the identity, it can pass an origctx and this function will use the same files list when it makes sense to do so. scommit)errororigctxN)p1copiesp2copies filesadded filesremovedsextrascommitting changelog rs pretxncommitT)thrownodeparent1parent2) unfilteredp1p2userlock transaction_prepare_filesextracopypop changelog_copiesstorage_extra_with_copiestiprevrnoter delayupdateadd descriptionr"daterevregister_changesetchangelogrevisionrhookr newcommitphasephaser registernew)rctxrrr&r'r(trmnfilesr,nameoldtipnr8xp1xp2 targetphase waspublics r commitctxrJ*sr ??  D VVXXsvvxxB 88::D ::d&&y11:R"2s%III E   ""   & &  $%%%% > (H 4 4&tUE::E&&((  Q011222 ""2&&& N     OO    GGII GGII  HHJJ  1gkkmm T^**,, , ,  # #C)I)I#)N)N O O O6688R_BFFHH3S Q    "0#>> dn33555Od3ioo>O>O:O  =y =  tRse < < <u:::::::::::::::::::::::::::::::::::::::::s7%L;I&K:! L:K> >LK> LLLc|}|}t|\}}tj}t j|} t|| |} | D]} || i} | sH| D]!\} }| d}||| | <"|r| s|jd|}|||rN||||nZ|s1| s/|jd|}nt/||| || |}|r]||krE|}|j|sJ|||rN||||||fS)Nsoutside-narrow-merge-actionsreusing known manifest s*reusing manifest from p1 (no file change) )r)rr&rr ChangingFilesrread _get_salvaged mark_salvaged narrowmatchalways allextrasitemsget manifestnoderdebugupdate_touchedrB update_added filesaddedupdate_removed filesremoved_process_filestouchedissubsetupdate_copies_from_p1p1copiesupdate_copies_from_p2p2copies)r@r?rrrr&rrrBmssalvageds narrow_filesfeactionrA origfiless rr+r+{s 88::D B,tSj*|||f}|D]"}||s||#tW|||| |j,||t[| }|S) Nscommitting files:  rrs/corrupted mergestate, unknown narrow action: %bsrestart the merge)hintaddedmergedstrouble committing %s! c$g|] }|vs|v | Sr~).0rgm1m2s r z"_process_files..s&888QQ"WWRqrcg|]}|v| Sr~r~)rrgms rrz"_process_files..s000a1r).rr&r'r manifestctxr-rMlistremovedrnrr3rr getuipathfnmodifiedr{extendrrsortrTrCHANGE_REMOVED mark_removedrt CHANGE_ADDED mark_addedfindsetflagCHANGE_MODIFIED mark_touchedAbort _filecommit mark_mergedflagsOSErrorwarnrqr8rrZrget_removal_filter_commit_manifestr]bool) r@r?rcrBrfrrr&r'rrm1ctxm2ctxmctxr{rlinkrevuipathfn all_filesrg narrow_actionrmsgrzfctx is_toucheddroprfrArrrs @@@rr\r\s 88::D B B, ? ? & &A2a55 &""1%%%         \  B Is CP?Qc|}|||j} |||j} d} | | cxkr |jkrnnd} t|tjr|} | | | fvr|jd|z| |jkr+| || ks6| |jkr-| || krd} | | fS| |} i}| }d}|r||kr||}| }|r| |jks|||vr ||}| }|rQ|jd||t|fz|r||d<t||d<|j|} } n|j td||fzn| |jkr | |j} } n| |jkr|r6||d d kr | |j} } ny|r6||d d kr | |j} } n/| | | }| |vr | |j} } n | |vr|j} d }|jddrB|r.||dd krd}|}| |jks%| |jks|s| | |s|r-| | |jkrd} nd} | ||||| | }n6||vr0| || krd} | }n| }|| fS)a commit an individual file as part of a larger transaction input: fctx: a file context with the content we are trying to commit manifest1: manifest of changeset first parent manifest2: manifest of changeset second parent linkrev: revision number of the changeset being created tr: current transation includecopymeta: boolean, set to False to skip storing the copy data (only used by the Google specific feature of using changeset extra as copy source of truth). ms: mergestate object output: (filenode, touched) filenode: the filenode that should be used by this changeset touched: one of: None (mean untouched), 'added' or 'modified' Nr{sreusing %s filelog entry rs %s: copy %s:%s scopyscopyrevs8warning: can't find ancestor for '%s' copied from '%s'! sfilenode-sourcesothersmergedrmFrsmerge-track-salvagedrlTr|)pathrTnullid isinstancerfilectxfilenoderrVrfile copysourcerrrrprscommonancestorsheads configbooldatacmpr5)rr manifest1 manifest2rr@includecopymetarcrvfparent1fparent2r]r"flogmetacfnamefnodecnode newfparentfparentancestorsforce_new_nodetexts rrrs^> IIKKE}}UDK00H}}UDK00HG8****t{*****$((!}} Hh' ' ' GMM7%? @ @ @DK''OOE**djjll::DK''OOE**djjll::$= 99U  D D __  F E D'&E//( f%%  *DK''5=Y&&%f-E!)J   GMM.%U1LL M M M . &W #&u::Z !%jhHH GLL+&/ "     T[ %t{( T[ 99;; '299U++//0BCCxOO!)4;hHH YY[[ 'RYYu--11)<<FF!)4;hHH $888LL +++%-t{(---;N ?,CDD IIKK IIe   !; < < F F 99;;DDK t{ " "  # 88Hd # # #  # ?4;&&$"tR(HEE )    6 6$**,, F F '>rc |} d} |} |} | } | }|s;||t j| |} |s| r| j d|s| r| j td|rd}n| }|||| | |||}n.| j d| }|S)amake a new manifest entry (or reuse a new one) given an initialised manifest context and precomputed list of - files: files affected by the commit - added: new entries in the manifest - drop: entries present in parents but absent of this one Create a new manifest revision, reuse existing ones if possible. Return the nodeid of the manifest revision. NsInot reusing manifest (no file change in changelog, but manifest differs) scommitting manifest )matchs;reusing manifest from p1 (listed files actually unchanged) )rr&r'rrMdiffr matchfilesrBrrVr3rrPwriterU)r@rr?rmanifestrBr{rhas_some_narrow_actionrmdr&r'rrrrAs rrrss, 88::D B B B NN  E B FWWXw1$ DD E E  R    2      Q/00111 " 'EE$$&&E ZZ   OO   OO        O   __   Irc|j}|j}|j}|j}t |j}t |ds|pd}|pd}|pd}|pd}||||f}|td|Dri}|tj ||}||d<|tj ||}||d<|tj ||}||d<|tj ||}||d<|S)z2encode copy information into a `extra` dictionnaryrNc3K|]}|duV dS)Nr~)rxs r z%_extra_with_copies..s&BBqQd]BBBBBBrrrrr ) copied_from_p1copied_from_p2r{rrqr]ranyr encodecopiesencodefileindices)rr,rBr`rbrYr[ extrasentriess rr1r1s.#H#HJ=L 5= ! !E D ! !! $, #t#t'4 #+t h L@M }BBMBBBBB}(99%k(99%k/zBB )m1%FF !-o Lr)FN)NF)F)i18nrr"rrrrrr r r rrJr+rNr\rrr1r~rrrs@ 111&NNNNb((((V"^^^^Bbbb\!GGGGT     r