o ]Lb@sJddlmZddlZddlmZddlmZddlmZm Z d dd Z dS) )absolute_importN)_short)errorpycompatFc Cs|jj}g}t}t}t} t} |s0|} | di}Wdn1s+wY|dur8d|d<|j|jkr^| |j||jgkrW|jg|jgt |fS|jgg|fS|j t dg} |D]} || sv| | qj| | qj| st | gt |fSt| }d}|j jt dt dd }|} | d d | i}Wdn1swYt|} | rg}| r| }|d|vrq|j d t|dt|df|d|jkrn|| vr|j d q|dr!||dr!|j dt|dt|df| |dd| |na|d|vrd|d|vrd||drP||drP|j dt|d||d|ddD] }||rb| |qV|ddD]}||vr||s| |||qj||d| s|r|d7}||j d|dtt|ftdt|dD]E}|} | d d |||di}Wdn 1swY|D]}|j dt|dt|df| |qؐq| s|rg}|d7}||} | dd|i}Wdn 1swYt||D]f\}}| |d|d}d}|D]O}|j d|t|t|f||r|dkrk|j dt|||| |n|j dt|t|f| ||fn ||d}}q;|}q(|s|D]}||rtt dt|ddqt | } | |jgkr|r|j t dntt d|j ddd d!|Dd"||j d#||dur||d<| t ||fS)$anReturn a tuple (common, fetch, heads) used to identify the common subset of nodes between repo and remote. "common" is a list of (at least) the heads of the common subset. "fetch" is a list of roots of the nodes that would be incoming, to be supplied to changegroupsubset. "heads" is either the supplied heads, or else the remote's heads. sheadsNrstotal-roundtripsssearching for changes rs searchingsqueries)unitsbranchessnodessexamining %s:%s sbranch already found sfound incomplete branch %s:%s sfound new changeset %s srequest %d: %s  sreceived %s:%s sbetweenspairssnarrowing %d:%d %s sfound new branch changeset %s s narrowed branch search to %s:%s salready have changeset s!warning: repository is unrelated srepository is unrelateds!found new changesets starting at cSsg|]}t|qSr).0frr9/usr/lib/python3/dist-packages/mercurial/treediscovery.py sz&findcommonincoming.. s%d total queries ) changeloghasnodesetcommandexecutor callcommandresulttipnullidaddlistuistatusrappend makeprogress collectionsdequepopleftdebugr incrementjoinmaprxrangelenzipr RepoErrorwarnAbortcomplete)reporemoteheadsforceaudit knownnodesearchfetchseen seenbranchbaseeunknownhreqreqcntprogressbranchesrnpb newsearchbetweenlrirrrfindcommonincomings         $      ! 9        rK)NFN) __future__rr#i18nrnoderrrrKrrrrs