\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s@ddlmZddlZddlZddlZddlmZddlmZ m Z m Z m Z m Z ddlmZdZdZd d Zdd Zdd Zd ZddZdZddZddZdZdZdZdZdZdZ dZ!dZ"ddZ#dS(i(tabsolute_importNi(t_(tmatchtnodetpathutiltscmutiltutil(t stringutilc C@s|j}t|}|dkr*|}n|dkr?|}nid|6d|6}| | g}tj|t|}t}|} x#|rtj| } | |krg|jjD]} |j | ^q} n|j | } x| D]} | dkrqn| |krL|| || <|| r8|d7}ntj || q|| r|| || krd|| <|d8}t }qqW|| r| } |d8}qqW|sdSt | ||S(s Find the last revision that needs to be checked to ensure that a full transitive closure for file copies can be properly calculated. Generally, this means finding the earliest revision number that's an ancestor of a or b but not both, except when a or b is a direct descendent of the other, in which case we can return the minimum revnum of a and b. None if no such revision exists. iiiN(t changelogtlentNonetheapqtheapifytFalsetheappoptdirstatetparentstrevt parentrevstheappushtTruetmin( trepotatbtcltworkingtsidetvisitt interestingthascommonancestortlimittrtpR((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt _findlimitsF          .         cC@s|j}xy|jD]k\}}||krk|||krR||||b(tcopyt iteritemstlisttitems(tsrctdstRRtttktv((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_chainps     icC@swxp|jD]b}|j|jd|jkr;|S|dkr |j|kr |j|kr dSq WdS(sreturn file context that is the ancestor of fctx present in ancestor manifest am, stopping after the first ancestor lower than limitiN(t ancestorstgettpathR tfilenodetlinkrevR(tfctxtamRtf((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt _tracefiles $0cC@sf|jj}|jj}xAt|D]3}||dksT|r+|| r+||=q+q+W|S(Ntanm(t_repoRtcopiesR#R%(tdRtdstcR*((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_dirstatecopiess  #cC@s+|j}|j}|j|d|S(sComputes which files are in b but not a. This is its own function so extensions can easily wrap this call to see what files _forwardcopies is about to process. R(tmanifestt filesnotin(RRRtmatmb((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt_computeforwardmissings  cC@s"|j}|jjo'|jjdd}|jj}|rS|d||fnt||j|j}|d krd}n|r|d|n|j}i}|} |j |kr|j j t j krt j|j|j} tj|| } nt||d| } |jjj|jgdt} |rh|dt| nx| D]} |r|d | n|| }| |_|rtj}nt|||}|r|r|d |jn|j|| 4 another commit | | o ---> 3 commit that modifies a.txt | / o / ---> 2 commit that moves a.txt to b.txt |/ o ---> 1 merge base If we try to rebase revision 3 on revision 4, since there is no a.txt in revision 4, and if user have copytrace disabled, we prints the following message: ```other changed which local deleted``` Returns five dicts: "copy", "movewithdir", "diverge", "renamedelete" and "dirmove". "copy" is a mapping from destination name -> source name, where source is in c1 and destination is in c2 or vice-versa. "movewithdir" is a mapping from source name -> destination name, where the file at source present in one context but not the other needs to be moved to destination by the merge process, because the other context moved the directory it is in. "diverge" is a mapping of source name -> list of destination names for divergent renames. "renamedelete" is a mapping of source name -> list of destination names for files deleted in c1 that were renamed in c2 or vice-versa. "dirmove" is a mapping of detected source dir -> destination dir renames. This is needed for handling changes to new files previously grafted into renamed directories. R]R^t heuristicsN( RR RRHR8RDR`Rt parseboolt_isfullcopytraceablet_fullcopytracingt_heuristicscopytracingR (RRkRltbaset copytracingt boolctrace((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyt mergecopies\s.-  cC@s|jdkr!|j}n|jr|jr|jjdd}t|jd|j|j}||kStS(s Checks that if base, source and destination are all no-public branches, if yes let's use the full copytrace algorithm for increased capabilities since it will be fast enough. `experimental.copytrace.sourcecommitlimit` can be used to set a limit for number of changesets from c1 to base such that if number of changesets are more than the limit, full copytracing algorithm won't be used. R]scopytrace.sourcecommitlimits%d::%dN( RR RHtmutableRDt configintR R~R (RRkRtsourcecommitlimittcommits((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyRs   ' c5 C@s|jdkr|jn|}|jdkrB|jn|}|j| }|j| }|pq|}|} |r|j|} nt||j|j} | dkriiiiifS|jjd| |j} |j} |j} i}i}iid6id6id6|d6|d6}iid6id6id6|d6|d6}| j | |j }| j | |j }t ||@}| |krt |||||\}}||}}nxt |||||dd\}}| j}t |||| j ||j | j ||j dd \}}x-|D]%}t ||||| || |q^Wx-|D]%}t ||||| || |qWt|d}|j|dt|d}|j|d|r t|d|d|||nt|d|d|||i}t}t}xt|jD]\} }!t|!d ks| |ks| |kr|| =| |kr| |krg|!D]$}||ks||kr|^q|| <|j|!qqi|j|!qiW|r=|jjd d j|ni}"i}#i}$iid6id6id6|"d6|#d6}%iid6id6id6|"d6|#d6}&xL|D]D}t ||||| || |%t ||||| || |&qW|rti|%d||"|#}$n%|r:ti|&d||"|#}$nxA|$D]9}|$|}'|'d |rd| n| krA|'|"| dst: '%s' %s s! checking for directory renames t/cS@s'i|]\}}|d|dqS(R((t.0R*R+((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pys s s) discovered dir src: '%s' -> dst: '%s' s' pending file src: '%s' -> dst: '%s' N(RR RHt isancestorofRcR"RDRGR=R>R[RaRst _checkcopiestdicttupdateRtsetR%R&R RjREtdirstaddpathR$Rtdirnametaddt startswith(5RRkRlRt_c1t_c2tdirtyc1tdirtyc2tgraftttcaRtm1tm2R@RRtdata1tdata2RmRntbothnewtu1rtu2rtu1utu2utmtaR4R#Rt renamedeletetrenamedeletesett divergesettoftflt bothdivergetbothincompletedivergeRtboth1tboth2Rtnotetd1td2tinvalidtdirmoveR(R'tdsrctddsttiR9t movewithdirtdf((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyRs*$$             # #   *5      #    &                    c@s$|jd kr!|j}njd krBjni}t}|j|jdjjs|jjdt||S}xj|krt |j dkr|jjdt||S|j |j |j}qWt }x3|jD]%\}} | kr0| ||sR]scopytrace.movecandidateslimitsBskipping copytracing for '%s', more candidates than the limit: %d N(RR RHRR=R~RDRGRR RRRLR\R$t collectionst defaultdictR%R>tosR/tbasenameRtappendRvRtstatusRt_related(RRkRlRR8t changedfilesRztcpR(R'tfiltR4t missingfilestbasenametofilenametdirnametofilenameRRt samebasenamet samedirnametmovecandidatestf2t maxcandidatest candidatetf1((RRlRs6/usr/lib64/python2.7/site-packages/mercurial/copies.pyRsb  ! %       cC@s||kr|S|j|j}}y|j|j}}|dkr`t|}n|dkr{t|}nxctr|j|j}}||krt|}q~||krt|}q~||kSq~WWntk rtSXdS(sFreturn True if f1 and f2 filectx have a common ancestor Walk back to common ancestor to see if the two files originate from the same file. Since workingfilectx's rev() is None it messes up the integer comparison logic, hence the pre-step check for None (f1 and f2 can only be workingfilectx's initially). N(R-R1R tnextRt StopIterationR (RRtg1tg2tf1rtf2r((s6/usr/lib64/python2.7/site-packages/mercurial/copies.pyRs$       cC@s|j}|j} |j} |j} | oL||koL|| k} t|} t|}||| j|kr| rdSd}|h}x| |||jD]~}|j}||kr|j|krPqqn|j|| r||d|s2   ( U   9     #  I  e ]