3
Q'íc$ ã @ sÔ d dl mZ d dlZd dlZd dlZd dlmZ d dlm Z d dl
mZmZ d dl
mZ d dlmZmZ ejdZejd Zejd
ZejdZejdZejd
ZejeZG dd deZdd Zeje dS )é )Úabsolute_importN)Úparse)ÚLink)ÚrmtreeÚdisplay_path)Ú
indent_log)ÚvcsÚVersionControlz
url="([^"]+)"zcommitted-rev="(\d+)"z URL: (.+)zRevision: (.+)z\s*revision="(\d+)"z<url>(.*)</url>c s e Zd ZdZdZdZd"Zdd Zd
d Zdd
Z dd Z
dd Zdd Zdd Z
fddZdd Zdd Zdd Zdd Zed d! Z ZS )#Ú
SubversionÚsvnz.svnÚcheckoutúsvn+sshúsvn+httpú svn+httpsúsvn+svnc C s´ |j dj| j s td| | jd|gdddid}tj|}|sftjdt | tj
d | d
S |jdj }t
j|}|s¦tjdt | tj
d | |d
fS ||jdfS )z/Returns (url, revision), where both are stringsú/zBad directory: %sÚinfoFÚLANGÚC)Úshow_stdoutÚ
extra_environz'Cannot determine URL of svn checkout %sz!Output that cannot be parsed:
%sNé z,Cannot determine revision of svn checkout %s)NN)ÚrstripÚendswithÚdirnameÚAssertionErrorÚrun_commandÚ_svn_url_reÚsearchÚloggerÚwarningr ÚdebugÚgroupÚstripÚ_svn_revision_re)ÚselfÚlocationÚoutputÚmatchÚurl© r* ú1/tmp/pip-build-l_bcah40/pip/pip/vcs/subversion.pyÚget_info s,
zSubversion.get_infoc C st | j \}}t||}| j|}tjd|| t 6 tjj|rJt | | j
dg| ||g dd W dQ R X dS )z@Export the svn repository at the url to the destination locationz!Exporting svn repository %s to %sÚexportF)r N)Úget_url_revÚget_rev_optionsÚremove_auth_from_urlr r r ÚosÚpathÚexistsr r )r% r&