File: //usr/lib/python3/dist-packages/hgext/__pycache__/uncommit.cpython-310.pyc
o
�]Lb�( �
@ s$ d Z ddlmZ ddlmZ ddlmZmZmZm Z
mZmZm
Z
mZmZmZmZ i Ze�e�Zi Ze�e�Zedddd� edd dd� d
Z d#dd
�Zedddded�fddded�fddded�ed�fgej ej ej ej ed�ejd�dd� �Zdd� Zedg ejdd �d!d"� �ZdS )$aH uncommit part or all of a local changeset (EXPERIMENTAL)
This command undoes the effect of a local commit, returning the affected
files to their uncommitted state. This means that files modified, added or
removed in the changeset will be left unchanged, and so will remain modified,
added and removed in the working directory.
� )�absolute_import)�_)�cmdutil�commands�context�copies�error�obsutil�pathutil�pycompat� registrar�rewriteutil�scmutil� experimental� uncommitondirtywdirF)�default�
uncommit.keeps ships-with-hg-coreNc
s� |� � }t|�� �}�fdd�|D �} | sdS |s|� � �� S || �t�||�� �fdd�t�� �D �� |df� fdd� }
�sH| j� t
d �� |du rP|�� }|sV|�� }|s\|�
� }tj| |�� | jg|�|
|||�� d
�}| �|�S )zrRecommit ctx with changed files not in match. Return the new
node identifier, or None if nothing changed.
c s h | ]}� |�r|�qS � r ��.0�f)�matchr �0/usr/lib/python3/dist-packages/hgext/uncommit.py� <setcomp>G s z"_commitfiltered.<locals>.<setcomp>Nc s i | ]\}}|� v r||�qS r r )r �dst�src)�filesr r �
<dictcomp>T s z#_commitfiltered.<locals>.<dictcomp>r c
sF ||vrd S || }t j| ||�� |�� |�� |�� � �|�d�}|S )N)�
copysource)r �
memfilectx�path�data�islink�isexec�get)�repo�memctxr �
contentctx�redirect�fctx�mctx)�copiedr r � filectxfnX s � z"_commitfiltered.<locals>.filectxfns note: keeping empty commit
��parents�textr r, �user�date�extra)�p1�setr �node� copiesmod�
pathcopiesr � iteritems�ui�statusr �descriptionr0 r1 r r&