| Server IP : 118.27.122.248 / Your IP : 216.73.216.124 Web Server : Apache System : Linux web0264.sh.tyo1 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64 User : c9415830 ( 11735) PHP Version : 8.4.17 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python36/lib64/python3.6/Tools/scripts/__pycache__/ |
Upload File : |
3
x2_S � @ s� d Z ddlZddlZddlZddlZdadadadada dd� Z
dd � Zd
d� ZdZ
dd� Zdd� Zdd� Zddd�Zdd� Zddd�Zedkr�e
� dS ) a� Script to synchronize two source trees.
Invoke with two arguments:
python treesync.py slave master
The assumption is that "master" contains CVS administration while
slave doesn't. All files in the slave tree that have a CVS/Entries
entry in the master tree are synchronized. This means:
If the files differ:
if the slave file is newer:
normalize the slave file
if the files still differ:
copy the slave to the master
else (the master is newer):
copy the master to the slave
normalizing the slave means replacing CRLF with LF when the master
doesn't use CRLF
� N�ask�yes�noc C s� t j tjdd � d�\} }xp| D ]h\}}|dkr4da|dkr@da|dkrL|a|dkrX|a|d krd|a|d
krp|a|dkr | a a aaq W y|\}}W n@ tk
r� t dtjd
p�ddd� t ddd� t d� d S X t
||� d S )N� znym:s:d:f:a:z-yr z-nr z-sz-mz-dz-fz-az
usage: pythonr ztreesync.py� )�endz5[-n] [-y] [-m y|n|a] [-s y|n|a] [-d y|n|a] [-f n|y|a]zslavedir masterdir)�getopt�sys�argv�default_answer�write_slave�write_master�create_directories�create_files�
ValueError�print�process)Zopts�args�o�a�slave�master� r �;/opt/alt/python36/lib64/python3.6/Tools/scripts/treesync.py�main# s0 r c C s� t jj|d�}t jj|�s0td|� td� d S tdd � td| � td|� t jj| �s�td| td �s�td|� td
| � d S td| � yt j| � W n. tk
r� } ztd| d
|� d S d }~X nX td| � d }g }t j |�}x`|D ]X}t jj||�}t jj| |�}|dk�r|}q�t jj|�r�t jj
|� r�|j||f� q�W |�r�t jj|d�} xjt| �j
� D ]Z}
|
jd�}|d dk�rl|dd � �rl|d }t jj| |�}t jj||�}
t||
� �qlW x|D ]\}}
t||
� �q�W d S )NZCVSzskipping master subdirectoryz-- not under CVS�-�( zslave r zcreate slave directory %s?)�answerz-- no corresponding slavezcreating slave directoryzcan't make slave directory�:zmade slave directoryZEntries�/r � r )�os�path�join�isdirr �okayr �mkdir�OSError�listdir�islink�append�open� readlines�split�comparer )r r Zcvsdir�msgZsubdirs�names�nameZ
masternameZ slavenameZentries�eZwords�s�mr r r r ? sT
r c C sf yt | d�}W n tk
r& d }Y nX yt |d�}W n tk
rN d }Y nX |s�|sftd|� d S td| � t|| td� d S |s�td|� d S |r�|r�t||�r�d S t|�}t|�}||kr�|j� |j� td|� td| � t|| td� d S td || d
� |j d� t
|�}|j� |j� |�rJtd� t| |dtd� ntd
� t| |dtd� d S )N�r�rbzNeither master nor slave existszCreating missing slave)r zNot updating missing masterzMaster zis newer than slavezSlave iszseconds newer than masterr z#***UPDATING MASTER (BINARY COPY)***z***UPDATING MASTER***)r+ �IOErrorr �copyr � identical�mtime�closer �seek�
funnycharsr
)r r �sf�mfZsftZmftZfunr r r r. m sP
r. � i c C s0 x*| j t�}|j t�}||kr"dS |sP qW dS )Nr r )�read�BUFSIZE)r>