Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
ÝPf�
ã @ s„ d dl mZ d dlZd dlZd dlZd dlmZmZ d dlm Z m
Z
d dlmZ d dl
mZ ejeƒZG dd„ de
ƒZe jeƒ dS ) é )Úabsolute_importN)Údisplay_pathÚrmtree)ÚvcsÚVersionControl)Úpath_to_url)Úconfigparserc @ sd e Zd ZdZdZdZdZdd „ Zd
d„ Zdd
„ Z dd„ Z
dd„ Zdd„ Zdd„ Z
dd„ Zdd„ ZdS )Ú MercurialÚhgz.hgÚcloneúhg+httpúhg+httpsúhg+sshúhg+static-httpc C s> t jddƒ}| j|ƒ z| jd|gd|d� W dt|ƒ X dS )z?Export the Hg repository at the url to the destination locationz-exportzpip-ÚarchiveF)Úshow_stdoutÚcwdN)ÚtempfileZmkdtempÚunpackÚrun_commandr )ÚselfÚlocationZtemp_dir© r ú/usr/lib/python3.6/mercurial.pyÚexport s
zMercurial.exportc C s¨ t jj|| jdƒ}tjƒ }y<|j|ƒ |jdd|ƒ t|dƒ�}|j |ƒ W d Q R X W n6 t
tjfk
rŒ } ztj
d||ƒ W Y d d }~X nX | jddg| |d� d S ) NZhgrcÚpathsÚdefaultÚwz/Could not switch Mercurial repository to %s: %sÚupdatez-q)r )ÚosÚpathÚjoinÚdirnamer ZSafeConfigParserÚreadÚsetÚopenÚwriteÚOSErrorZNoSectionErrorÚloggerZwarningr )r ÚdestÚurlÚrev_optionsZrepo_configÚconfigZconfig_fileÚexcr r r Úswitch s
zMercurial.switchc C s, | j ddg|d� | j ddg| |d� d S )NZpullz-q)r r )r )r r) r+ r r r r / s zMercurial.updatec C sz | j ƒ \}}|r |g}d| }ng }d}| j||||ƒrvtjd||t|ƒƒ | jddd||gƒ | jddg| |d� d S ) Nz (to revision %s)Ú zCloning hg %s%s to %sr z
--noupdatez-qr )r )Zget_url_revZcheck_destinationr( Úinfor r )r r) r* Zrevr+ Zrev_displayr r r Úobtain3 s
zMercurial.obtainc C s2 | j ddgd|d�jƒ }| j|ƒr*t|ƒ}|jƒ S )NZ
showconfigz
paths.defaultF)r r )r ÚstripZ_is_local_repositoryr )r r r* r r r Úget_urlE s
zMercurial.get_urlc C s | j ddgd|d�jƒ }|S )NÚparentsz--template={rev}F)r r )r r2 )r r Zcurrent_revisionr r r Úget_revisionM s zMercurial.get_revisionc C s | j ddgd|d�jƒ }|S )Nr4 z--template={node}F)r r )r r2 )r r Úcurrent_rev_hashr r r Úget_revision_hashS s zMercurial.get_revision_hashc C sT | j |ƒ}|jƒ jdƒs d| }|jƒ jddƒd }|s