Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.9/site-packages/hgext/__pycache__/ |
Upload File : |
a �+�b�c � @ s0 d Z ddlmZ ddlZddlZddlZddlZddlZddlm Z ddl mZmZ ddl mZmZmZmZmZmZmZmZmZmZmZ ddlmZmZ i Ze�e�Zi Ze�e�Zedd d dd� edd dd� eddddd� edddd� dZ dd� Z!dd� Z"dGdd�Z#dd� Z$dd� Z%dd� Z&dHd d!�Z'd"d#g e d$�e d%�fd&d'g e d(�e d)�fd d*d e d+�e d,�fd d-d e d.�e d/�fd0d1d e d2�e d)�fd d3de d4�fd d5de d6�fd d7de d8�fgej( ej) Z*edd9d:d e d;�e d<�fge* e d=�ej+dd>�d?d@� �Z,G dAdB� dBe-�Z.dCdD� Z/dEdF� Z0e.gZ1dS )IaB command to allow external programs to compare revisions The extdiff Mercurial extension allows you to use external programs to compare revisions, or revision with working directory. The external diff programs are called with a configurable set of options and two non-option arguments: paths to directories containing snapshots of files to compare. If there is more than one file being compared and the "child" revision is the working directory, any modifications made in the external diff program will be copied back to the working directory from the temporary directory. The extdiff extension also allows you to configure new diff commands, so you do not need to type :hg:`extdiff -p kdiff3` always. :: [extdiff] # add new command that runs GNU diff(1) in 'context diff' mode cdiff = gdiff -Nprc5 ## or the old way: #cmd.cdiff = gdiff #opts.cdiff = -Nprc5 # add new command called meld, runs meld (no need to name twice). If # the meld executable is not available, the meld tool in [merge-tools] # will be used, if available meld = # add new command called vimdiff, runs gvimdiff with DirDiff plugin # (see http://www.vim.org/scripts/script.php?script_id=102) Non # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in # your .vimrc vimdiff = gvim -f "+next" \ "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))" Tool arguments can include variables that are expanded at runtime:: $parent1, $plabel1 - filename, descriptive label of first parent $child, $clabel - filename, descriptive label of child revision $parent2, $plabel2 - filename, descriptive label of second parent $root - repository root $parent is an alias for $parent1. The extdiff extension will look in your [diff-tools] and [merge-tools] sections for diff tool arguments, when none are specified in [extdiff]. :: [extdiff] kdiff3 = [diff-tools] kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child If a program has a graphical interface, it might be interesting to tell Mercurial about it. It will prevent the program from being mistakenly used in a terminal-only environment (such as an SSH terminal session), and will make :hg:`extdiff --per-file` open multiple file diffs at once instead of one by one (if you still want to open file diffs one by one, you can use the --confirm option). Declaring that a tool has a graphical interface can be done with the ``gui`` flag next to where ``diffargs`` are specified: :: [diff-tools] kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child kdiff3.gui = true You can use -I/-X and list of file or directory names like normal :hg:`diff` command. The extdiff extension makes snapshots of only needed files, so running the external diff program will actually be pretty fast (at least faster than having to compare the entire tree). � )�absolute_importN)�_)�nullrev�short)�archival�cmdutil�encoding�error� filemerge� formatter� logcmdutil�pycompat� registrar�scmutil�util)�procutil� stringutil� extdiffs opts\..*� T)�default�generics gui\..*)r � diff-toolss .*\.diffargs$s .*\.gui$s ships-with-hg-corec C s t j�|j�}|dkrd}|dur2d|t|�f }t j�||�}t �|� g }|durv| �td�t |�t|�f � n| �td�t |� � |�r|j �ddd � tj |||d t�||�|d� t|�D ]N} t�| �} | �d| � |du r�t j�|| �}|�||�| �t �|�f� q�||fS ) z�snapshot files as of some revision if not using snapshot, -I/-X does not work and recursive diff in tools like kdiff3 and meld displays too many files.r � rootNs %s.%ss( making snapshot of %d files from rev %s s3 making snapshot of %d files from working directory s uis archivemetaFs files)�match�subreposs %s )�os�path�basename�rootr �join�mkdir�noter �len�uiZ setconfigr �archiver Z matchfiles�sortedr Zpconvert�appendZwjoin�lstat)r# �repo�files�node�tmproot�listsubrepos�dirname�base� fnsandstat�fnZwfn�dest� r2 �3/usr/lib64/python3.9/site-packages/hgext/extdiff.py�snapshot� sH ���� � r4 c sN ||||||||d��� �fdd�} d} � s@t �| | �s@| d7 } t �| | | �S )N)s parents parent1� parent2s plabel1s plabel2s childs clabelr c s6 | � d�}| � d�}� s$|dkr$|S |t��| � S )N� � r5 )�groupr � shellquote)r Zpre�key��do3way�replacer2 r3 �quote� s zformatcmdline.<locals>.quotesJ (['"]?)([^\s'"$]*)\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)\1s $parent1 $child)�re�search�sub)�cmdline� repo_rootr<