o ÔÀgp ã@s<dZddlmZddlmZddlmZGdd„deƒZdS)z*Base class representation of a repository é)ÚExternalsDescription)Ú fatal_error)Ú EMPTY_STRc@sbeZdZdZdd„Zdd„Zdd„Zdd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dS)Ú RepositoryzE Class to represent and operate on a repository description. cCsà||_|tj|_|tj|_|tj|_|tj|_ |tj |_ |tj |_ |j tur0tdƒ|jturC|jturC|j turCtdƒd}|jturN|d7}|jturW|d7}|j tur`|d7}|dkrntd |j¡ƒdSdS)z2 Parse repo externals description zrepo must have a URLz0{0} repo must have a branch, tag or hash elementérz6repo {0} must have exactly one of tag, branch or hash.N)Ú_namerÚPROTOCOLÚ _protocolÚTAGÚ_tagÚBRANCHÚ_branchÚHASHÚ_hashÚREPO_URLÚ_urlÚSPARSEÚ_sparserrÚformat)ÚselfÚcomponent_nameÚrepoÚ ref_count©rúX/lfs/h1/nco/ptmp/ethan.collins/aqm/aqm.v7.0.11/sorc/manage_externals/manic/repository.pyÚ__init__s2       ÿ   ÿÿzRepository.__init__cCsd |jj¡}t|ƒdS)a„ If the repo destination directory exists, ensure it is correct (from correct URL, correct branch or tag), and possibly update the source. If the repo destination directory does not exist, checkout the correce branch or tag. NB: is include as an argument for compatibility with git functionality (repository_git.py) zMDEV_ERROR: checkout method must be implemented in all repository classes! {0}N©rÚ __class__Ú__name__r)rÚ base_dir_pathÚ repo_dir_nameÚ verbosityÚ recursiveÚmsgrrrÚcheckout,s ÿ zRepository.checkoutcCsd |jj¡}t|ƒdS)z'Report the status of the repo zKDEV_ERROR: status method must be implemented in all repository classes! {0}Nr)rÚstatÚ repo_dir_pathr#rrrÚstatus9s ÿ zRepository.statusNcCsdS)z"Stub for use by non-git VC systemsNr)rÚ repo_pathrrrÚsubmodules_fileAszRepository.submodules_filecCó|jS)z#Public access of repo url. )r©rrrrÚurlFózRepository.urlcCr*)z"Public access of repo tag )r r+rrrÚtagKr-zRepository.tagcCr*)z&Public access of repo branch. )r r+rrrÚbranchPr-zRepository.branchcCr*)z$Public access of repo hash. )rr+rrrÚhashUr-zRepository.hashcCr*)z$Public access of repo name. )rr+rrrÚnameZr-zRepository.namecCr*)z(Public access of repo protocol. )r r+rrrÚprotocol_r-zRepository.protocol)N)rÚ __module__Ú __qualname__Ú__doc__rr$r'r)r,r.r/r0r1r2rrrrr s  rN) r5Úexternals_descriptionrÚutilsrÚglobal_constantsrÚobjectrrrrrÚs