3
_Af                 @   s^   d dl mZ d dlmZ d dlZd dlmZmZ d dlm	Z	 d dlm
Z
 G dd deeZdS )	    )print_function)SUPPRESS_HELPN)CommandMirrorSafeCommand)_PostRepoUpgrade)_PostRepoFetchc               @   s,   e Zd ZdZdZdZdZdd Zdd Zd	S )

SelfupdateFz!Update repo to the latest versionz
%prog
z
The '%prog' command upgrades repo to the latest version, if a
newer version is available.

Normally this is done automatically by 'repo sync' and does not
need to be performed by an end-user.
c             C   s4   |j d}|jdddddd |jdd	d
td d S )Nzrepo Version optionsz--no-repo-verifyrepo_verifyTstore_falsezdo not verify repo source code)destdefaultactionhelpz--repo-upgradedrepo_upgraded
store_true)r   r   r   )add_option_group
add_optionr   )selfpg r   D/home/qytech/356xLinux510-101server/.repo/repo/subcmds/selfupdate.py_Options(   s    
zSelfupdate._Optionsc             C   sb   | j j}|j  |jr"t| j  n<|j sBtdtjd tj	d |j
jd t||jdd d S )Nzerror: can't update repo)file   z--autoT)r	   verbose)manifestrepoProjectPreSyncr   r   Sync_NetworkHalfprintsysstderrexitbare_gitgcr   r	   )r   optargsZrpr   r   r   Execute1   s    
zSelfupdate.ExecuteN)	__name__
__module____qualname__commonhelpSummary	helpUsagehelpDescriptionr   r(   r   r   r   r   r      s   	r   )
__future__r   optparser   r!   commandr   r   Zsubcmds.syncr   r   r   r   r   r   r   <module>   s   