https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/commit.cpython-310.pyc
o

�]LbJ�@s�ddlmZddlZddlmZddlmZmZddlm	Z	m
Z
mZmZm
Z
mZdd�Zdd
d�Zddd
�Zdd�Zddd�Zdd�Z		ddd�Zdd�ZdS)�)�absolute_importN�)�_)�hex�nullrev)�context�
mergestate�metadata�phases�scmutil�subrepoutilcCs@|jdkr
d}d}||fS|j�dd�}|dk}|dv}||fS)z�return a (changelog, filelog) boolean tuple

    changelog: copy related information should be stored in the changeset
    filelof:   copy related information should be written in the file revision
    �changeset-sidedataT�experimentalscopies.write-to�changeset-only)rs
compatibility)�filecopiesmode�ui�config)�repo�writechangesetcopy�writefilecopymeta�
writecopiesto�r�2/usr/lib/python3/dist-packages/mercurial/commit.py�_write_copy_metas
�rFc
Cs�|��}|��|��}}|��}|����|�d���}t||||d�\}}	|����}
|
dur;dD]}|
�	|d�q2|j
jdkrGt||
|	�}
|j
�
�}|j�td��|j
�|�|j
�||	|��||��|��||��|
�	}
||
��}||j
�
�kr�|�||j
�|��|��|r�|��p�d}}|jdd	t|
�||d
�t�|j|�}||j
�
�ko�||��}|r�|s�t�||||g�|
Wd�Wd�S1s�wYWd�dS1s�wYdS)a�Add a new revision to the target repository.
    Revision information is passed via the context argument.

    ctx.files() should list all files involved in this commit, i.e.
    modified/added/removed files. On merge, it may be wider than the
    ctx.files() to be committed, since any file nodes derived directly
    from p1 or p2 are excluded from the committed ctx.files().

    origctx is for convert to work around the problem that bug
    fixes to the files list in changesets change hashes. For
    convert to be the identity, it can pass an origctx and this
    function will use the same files list when it makes sense to
    do so.
    scommit)�error�origctxN)�p1copies�p2copies�
filesadded�filesremovedsextrascommitting changelog
�spretxncommitT)�throw�node�parent1�parent2) �
unfiltered�p1�p2�user�lock�transaction�_prepare_files�extra�copy�pop�	changelog�_copiesstorage�_extra_with_copies�tiprevr�noter�delayupdate�add�descriptionr"�date�rev�register_changeset�changelogrevisionr�hookr�newcommitphase�phaser
�registernew)r�ctxrrr&r'r(�tr�mn�filesr,�name�oldtip�nr8�xp1�xp2�targetphase�	waspublicrrr�	commitctx-sT
��R�rJcCst|��}|��}t|�\}}t��}tj�|�}	t||	|�}
|
D]}|�|�q i}|���	��
�sJ|	����D]\}
}|�
d�}|durI|||
<q8|��rr|sr|j�d�|��}|�|���|rq|�|���|�|���n|��s�|s�|j�d�|��}n
t|||	|||d�}|r�|��|kr�|��}|j�|�s�J�|�|�|r�|�|���|�|���||fS)Nsoutside-narrow-merge-actionsreusing known manifest
s*reusing manifest from p1 (no file change)
)r)rr&rr	�
ChangingFilesr�read�
_get_salvaged�
mark_salvaged�narrowmatch�always�	allextras�items�get�manifestnoder�debug�update_touchedrB�update_added�
filesadded�update_removed�filesremoved�_process_files�touched�issubset�update_copies_from_p1�p1copies�update_copies_from_p2�p2copies)r@r?rrrr&rrrB�ms�salvaged�s�narrow_files�f�e�actionrA�	origfilesrrrr+~sF
��

r+cCsng}|jdk}|r5t|���dkr5|��r5t|�����D]}|�|��d�}|dkr4||vr4|�	|�q|S)zzreturns a list of salvaged files

    returns empty list if config option which process salvaged files are
    not enabledr
r�merge-removal-candidate�yes)
r�len�parents�active�sortedrQ�keys�extrasrS�append)rrbr?rc�copy_sd�fname�
might_removedrrrrM�s

�rMcst|��}|��}|��}t|�\}	}
|��}|��}|��}
|
���|���|���g}t|���}t	|�}|j
�td��t
�|�}|��|��}|�|���|��|D�]
}|j
�||�d�||vr�|�|�}|tjkr~|�|�|�|�nY|tjkr�|�|�|�|��|�|<|�|�dp�d}��||�n4|tjkr�|�|�|�|��|�|<|�|�dp�d}��||�ntd�}td�}|j||d��qXzJ||}|dur�|�|�n:|�|�t ||��|||
|�\�|<}|�r|dk�r	|�|�n|d	k�r|�!|�n|�|���||�"��WqXt#�y7|j
�$td
�||���t%�yc}z t&|dt'j(�}|�sR|�r^|t'j(k�r^|j
�$td
�||���d}~ww��fdd
�|D�}t)�fdd
�|D��}|D]}�|=�q{|�*�t+k�r�|�,|�nt-�.|||��f�}|D]
}||��s�|�|��q�t/||||
�|j0||t1|��	}|S)Nscommitting files:
�
rr s/corrupted mergestate, unknown narrow action: %bsrestart the merge)�hint�added�mergedstrouble committing %s!
�errnocs g|]}|�vs|�vr|�qSrr��.0rf)�m1�m2rr�
<listcomp>s z"_process_files.<locals>.<listcomp>csg|]}|�vr|�qSrrr{)�mrrrs)2rr&r'r�manifestctxr-rL�list�removedrlrr3rr�getuipathfn�modifiedrx�extendrp�sortrSr�CHANGE_REMOVED�mark_removedrr�CHANGE_ADDED�
mark_added�find�setflag�CHANGE_MODIFIED�mark_touched�Abort�_filecommit�mark_merged�flags�OSError�warn�IOError�getattrrz�ENOENTror8rrYr	�get_removal_filter�_commit_manifestr\�bool)r@r?rbrBrerrr&r'rr�m1ctx�m2ctx�mctxrxr��linkrev�uipathfn�	all_filesrf�
narrow_actionr��msgrw�fctx�
is_touched�inst�errcode�drop�rfrAr)r�r}r~rr[�s�











�


���


��r[cCs
|��}|�||j�}	|�||j�}
d}|	|
kr|jkr#nnd}t|tj�r]|��}||	|
fvr]|j�d|�|	|jkrI|�	|�|�	�ksW|
|jkrY|�	|�|�	�krYd}||fS|�
|�}
i}|��}d}|r�||kr�|�|�}|
}|r�|
|jks�|dur�||vr�||}|	}|r�|j�d||t|�f�|r�||d<t|�|d<|j|}	}
nc|j�
td�||f�nV|	|jkr�|
|j}	}
nJ|
|jk�r|��r�|�|��d	�d
kr�|
|j}	}
n/|��r�|�|��d�dkr�|	|j}	}
n|
�|	|
�}|	|v�r	|
|j}	}
n|
|v�r|j}
d
}|j�dd��r-|���r-|�|��d�dk�r-d}|��}|
|jk�sJ|	|jk�sJ|�sJ|
�|	|��sJ|�rh|du�rZ|
|jk�rXd}nd}|
�|||||	|
�}||fS||v�r|�	|�|�	�k�rd}|	}||fS|	}||fS)a
    commit an individual file as part of a larger transaction

    input:

        fctx:       a file context with the content we are trying to commit
        manifest1:  manifest of changeset first parent
        manifest2:  manifest of changeset second parent
        linkrev:    revision number of the changeset being created
        tr:         current transation
        includecopymeta: boolean, set to False to skip storing the copy data
                    (only used by the Google specific feature of using
                    changeset extra as copy source of truth).
        ms:         mergestate object

    output: (filenode, touched)

        filenode: the filenode that should be used by this changeset
        touched:  one of: None (mean untouched), 'added' or 'modified'
    Nrxsreusing %s filelog entry
r�s %s: copy %s:%s
scopyscopyrevs8warning: can't find ancestor for '%s' copied from '%s'!
sfilenode-sourcesothersmergedrkFrsmerge-track-salvagedrjTry)�pathrS�nullid�
isinstancer�filectx�filenoderrUr��file�
copysourcerr�rrnrq�commonancestorsheads�
configbool�data�cmpr5)rr��	manifest1�	manifest2r�r@�includecopymetarbrt�fparent1�fparent2r\r"�flog�meta�cfname�fnode�cnode�
newfparent�fparentancestors�force_new_node�textrrrr� s�



���


���
��
��r�c		Cs�|��}	d}
|��}|��}|��}
|
��}|s$|�|t�|	|����}
|s.|
r.|	j	�
d�|s2|
rU|	j	�td��|r?d}n|	�
�}|j|||��|��|||d�}|S|	j	�
d�|��}|S)amake a new manifest entry (or reuse a new one)

    given an initialised manifest context and precomputed list of
    - files: files affected by the commit
    - added: new entries in the manifest
    - drop:  entries present in parents but absent of this one

    Create a new manifest revision, reuse existing ones if possible.

    Return the nodeid of the manifest revision.
    NsInot reusing manifest (no file change in changelog, but manifest differs)
scommitting manifest
)�matchs;reusing manifest from p1 (listed files actually unchanged)
)rr&r'r�rL�diffr�
matchfilesrBrrUr3rrO�writerT)r@r�r?r��manifestrBrxr��has_some_narrow_actionr�mdr&r'r�r}r�rArrrr��s@����r�cCs�|j}|j}|j}|j}t|j�}t|�ds'|pd}|pd}|p"d}|p&d}||||f}|dur<tdd�|D��r<i}|durJt�	||�}||d<|durXt�	||�}||d<|durft�
||�}||d<|durtt�
||�}||d<|S)	z2encode copy information into a `extra` dictionnaryrNcss�|]}|duVqdS)Nr)r|�xrrr�	<genexpr>!s�z%_extra_with_copies.<locals>.<genexpr>rrrr)�copied_from_p1�copied_from_p2rxr�ror\r�anyr	�encodecopies�encodefileindices)rr,rBr_rarXrZ�
extrasentriesrrrr1s4
r1)FN)NF)F)�
__future__rrz�i18nrr"rr�rrr	r
rrrrJr+rMr[r�r�r1rrrr�<module>s 


Q+
f/
�J

https://t.me/RX1948 - 2025