📂 Advanced File Manager
Multi-Root Navigation System
⚡ Quick Jump
Server (/)
Home (/home)
Var_www (/var/www)
Current (/home4/shelley/public_html/shelleycutler.com/wp-content/mu-plugins)
📍 Go
⬆ Ke Atas
🏠 Root Server
🏠 Root App
🔄 Refresh
📀 /
›
usr
›
lib64
›
python3.9
›
site-packages
›
mercurial
›
📁 __pycache__
📍
Lokasi:
/usr/lib64/python3.9/site-packages/mercurial/__pycache__
💾
Free:
45.8 GB
⚠️ Direktori ini
tidak writable
.
✏️ Mengedit: simplemerge.cpython-39.pyc
a �+�bpC � @ s� d dl mZ ddlmZ ddlmZmZmZ ddlm Z dd� Z dd � ZG d d� de�Z dd � Zdd� Zdd� Zdd� Zd&dd�Zdd� Zdd� Zdd� ZG d d!� d!e�Zd'd$d%�ZdS )(� )�absolute_import� )�_)�error�mdiff�pycompat)� stringutilc C sd | d | d ksJ �|d |d ks(J �t | d |d �}t| d |d �}||k r\||fS dS dS )a Given two ranges return the range where they intersect or None. >>> intersect((0, 10), (0, 6)) (0, 6) >>> intersect((0, 10), (5, 15)) (5, 10) >>> intersect((0, 10), (10, 15)) >>> intersect((0, 9), (10, 15)) >>> intersect((0, 9), (7, 15)) (7, 9) r r N)�max�min)Zra�rbZsaZsb� r �;/usr/lib64/python3.9/site-packages/mercurial/simplemerge.py� intersect s r c C sR || || krdS t t�||�t�||��D ]\}}| | || kr. dS q.dS )z:Compare a[astart:aend] == b[bstart:bend], without slicing.FTN)�zipr Zxrange)�aZastart�aend�bZbstart�bend�ia�ibr r r � compare_range5 s �r c @ s2 e Zd ZdZddd�Zdd� Zdd� Zd d � ZdS )� Merge3Textz�3-way merge of texts. Given strings BASE, OTHER, THIS, tries to produce a combined text incorporating the changes from both BASE->OTHER and BASE->THIS.Nc C s^ || _ || _|| _|d u r$t�|�}|d u r6t�|�}|d u rHt�|�}|| _|| _|| _d S �N)�basetext�atext�btextr Z splitnewlines�baser r )�selfr r r r r r r r r �__init__H s zMerge3Text.__init__c c s� | � � D ]�}|d }|dkr:|| j|d |d � fV q|dksJ|dkrh|| j|d |d � fV q|dkr�|| j|d |d � fV q|dkr�|| j|d |d � | j|d |d � | j|d |d � ffV qt|��qd S )a� Yield sequence of line groups. Each one is a tuple: 'unchanged', lines Lines unchanged from base 'a', lines Lines taken from a 'same', lines Lines taken from a (and equal to b) 'b', lines Lines taken from b 'conflict', (base_lines, a_lines, b_lines) Lines from base were changed to either a or b and conflict. r � unchangedr � � a� same� b� conflict� � � � N)� merge_regionsr r r � ValueError)r �t�whatr r r �merge_groupsV s �� zMerge3Text.merge_groupsc c s� d } }}| � � D �]�}|\}}}}} } || }|dks>J �||| ksNJ �|| | ks^J �|| }| | } || }|dks�J �| dks�J �|dks�J �|s�| �r^t| j||| j||�}t| j|| | j||�}t| j||| j|| �}|r�d||fV n^|�r|�sd|| fV nD|�r,|�s,d||fV n*|�sN|�sNd|||||| fV ntd��|}| }|}|dkr||k�sxJ �|| k�s�J �||k�s�J �d||fV |}|}| }qdS ) a� Return sequences of matching and conflicting regions. This returns tuples, where the first value says what kind we have: 'unchanged', start, end Take a region of base[start:end] 'same', astart, aend b and a are different from base but give the same result 'a', start, end Non-clashing insertion from a[start:end] 'conflict', zstart, zend, astart, aend, bstart, bend Conflict between a and b, with z as common ancestor Method is as follows: The two sequences align only on regions which match the base and both descendants. These are found by doing a two-way diff of each one against the base, and then finding the intersections between those regions. These "sync regions" are by definition unchanged in both and easily dealt with. The regions in between can be in any of three cases: conflicted, or changed on only one side. r r"