^cXddlmZddlmZmZddlmZdZdZ dZ dZ d d Z d Z d ZdS) )hex)utilvfs)urlutils logexchangec#Ktj|jt}||sdS||}d}|D]U}|}|s|dkr|dz } |d\}}}|||fVF#t$rYRwxYw|dS)z reads a file from .hg/logexchange/ directory and yields it's content filename: the file to be read yield a tuple (node, remotepath, name) Nr) vfsmodrjoin remotenamedirexistsstripsplit ValueErrorclose) repofilenamerflinenolinenoderemoternames 7/usr/lib/python3/dist-packages/mercurial/logexchange.pyreadremotenamefilers *TX]]=11 2 2C ::h   H A F  zz||   Q;; aKF "&**U"3"3 D&%% % % % %    D GGIIIIIs? B  B-,B-c#fKt|dD]}|Vt|dD]}|VdS)a read the details about the remotenames stored in .hg/logexchange/ and yields a tuple (node, remotepath, name). It does not yields information about whether an entry yielded is branch or bookmark. To get that information, call the respective functions. bookmarksbranchesN)r)rbmentry branchentrys rreadremotenamesr!4s^&dL99 )$ << c`tj|jt}||dd}|dt t ||}t|D]'\}}} ||kr|d||| fz(t|D]O\} }|dkr!|D]} |d| || fz,|dkr|r|d||| fzP| dS)NwT) atomictemps0 s %s%s%s rr) r rr r writesetrsorteditemsr) r remotepathnamesnametyperrolddataroldpathrnamens rwriteremotenamefiler1BsS *TX]]=11 2 2C Hdt,,,AGGH$T84455G &w>>gu j GGOtWe&<< = = =U[[]]++DD d { " " A A1j$*??@@@@ A  % % D4T*BBCCCGGIIIIIr"Nc|} |rt|||d|rt|||d|dS#|wxYw)z save remotenames i.e. remotebookmarks and remotebranches in their respective files under ".hg/logexchange/" directory. rrN)wlockr1release)rr*branches bookmarksr3s rsaveremotenamesr7Zss JJLLE  K j)\ J J J  I j(K H H H  s (AA*c|}|}|rtj|jj}nt |t s|j}|j dD]^\}}tj |}tjt |}tj|}||ks||kr|}n_|S)zreturns remote pathspaths) localrpconvert_reporoot isinstancebytes_urlui configitemsr removeauth)rrr9rpathpathurl noauthurls r activepathrGis LLNNE E  fl/00  & & W((22   c&s++ mE#JJ''M),, %<<9--E E. Lr"ct||}|5}|dddi}dddn #1swxYwYi}|}|5}|di}dddn #1swxYwY|D]U\}} g||<| D]H} | |vrB|| s(||t| IVt||||dS)z pulls bookmarks and branches information of the remote repo during a pull or clone operation. localrepo is our local repository remoterepo is the peer instance slistkeyss namespacerNs branchmap) rGcommandexecutor callcommandresult unfilteredr)obsoleteappendrr7) localrepo remoterepor*er6bmapr branchmapbranchnodesrs rpullremotenamesrVsIz22J  # # % %MM l   &((  D    ! !D  # # % %=MM,33::<< ===============#**// V  / /Dt||DJ$7$7$9$9|V ##CII... /Iz4;;;;;s#+AA #A )CC  C )NN)rrrrr utilsrr rr!r1r7rGrVr"rrZs  8   0    :!<!<!<!<!