HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/lib64/python2.7/site-packages/hgext/journal.pyc
�
1�3\c@@sdZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZddlmZmZmZiZeje�ZdZdZdZ d	Z!iej"e 6Z#d
�Z$d�Z%d�Z&d
�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d�Z.dej/dd�fd��YZ0de1fd��YZ2d(Z3edd)d*ggej5D]Z6e6d$e3kr�e6^q�d%d&ej7�d'��Z8dS(+s�track previous positions of bookmarks (EXPERIMENTAL)

This extension adds a new command: `hg journal`, which shows you where
bookmarks were previously located.

i(tabsolute_importN(t_(t	bookmarkstcmdutiltdispatchtencodingterrort
extensionsthgt	localrepotlockt
logcmdutiltnodetpycompatt	registrartutil(tdateutiltprocutilt
stringutilsships-with-hg-coretbookmarkt
wdirparentcC@sitjtdt�tjtjdt�tjtj	dt
�tjtdt�tjtdt
�dS(Nt
runcommandt_writetdirstatet	postsharet	copystore(RtwrapfunctionRRRtbmstoretrecordbookmarkst
wrapfilecacheR	tlocalrepositorytwrapdirstateRt
wrappostsharetunsharejournal(tui((s3/usr/lib64/python2.7/site-packages/hgext/journal.pytextsetupCscC@s`|j�r\t|�|_|jjd�tj|d�\}}|r\t||�q\ndS(NtnamejournalR(tlocaltjournalstoragetjournalt_wlockfreeprefixtaddR	tisfilecachedt_setupdirstate(R"trepoRtcached((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt	reposetupKscG@s#tj|�||||||�S(s;Track the command line options for recording in the journal(R&t
recordcommand(torigtluiR,tcmdtfullargstargs((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyRWs
cC@s |j|_|jdt�dS(NR'(R'R&taddparentchangecallbacktrecorddirstateparents(R,R((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR+\scC@s2||�}tj|d�r.t||�n|S(s5Make journal storage available to the dirstate objectR'(RtsafehasattrR+(R0R,R((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyRascC@s�t|�}t|�}tj|d�r�|dtjkrG|d n|}|dtjkrj|d n|}|jjtd||�ndS(s3Records all dirstate parent changes in the journal.R&it.N(tlistRR7RtnullidR&trecordtwdirparenttype(Rtoldtnewt	oldhashest	newhashes((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR6hs##	cC@s�|j}tj|d�r�tj|�}xZ|j�D]I\}}|j|tj�}||kr7|j	j
t|||�q7q7Wn|||�S(s,Records all bookmark changes in the journal.R'(t_repoRR7RRt	iteritemstgetRR:R'R;tbookmarktype(R0tstoretfpR,toldmarkstmarktvaluetoldvalue((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyRts	#cC@sVy t|jjd�j��SWn/tk
rQ}|jtjkrJ�nt�SXdS(s,A set of shared features for this repositorytsharedN(tsettvfstreadt
splitlinestIOErrorterrnotENOENT(R,tinst((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt_readsharedfeatures�s co@s�|jdt�}g|D]}t|�^q}i}xKt|�D]=\}}yt|�||g||<WqDtk
r�qDXqDWx]|r�||j��\}}}|Vyt|�||d<Wq�tk
r�||=q�Xq�WdS(s�Given a set of sorted iterables, yield the next entry in merged order

    Note that by default entries go from most recent to oldest.
    torderiN(tpoptmaxtitert	enumeratetnextt
StopIterationt
itervalues(t	iterablestkwargsRUtittiterable_maptkeyRI((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt_mergeentriesiter�s
	
c
K@sO|j��=||||�|jdd��}|jd�WdQXWdQXdS(s<Mark this shared working copy as sharing journal informationRKtasjournal
N(twlockRMtwrite(R0t
sourcerepotdestrepoR^RF((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR �s
c
@s0|j|kr |j�r tj|d�r tj|�}t|��|r �dhkr |jjd�r�|jj	d�}tj
||d�n|j}|j|jdddt
�}�fd�|j|jdt
�D�}x3t||dt�D]}	|j|j|	�q�Wq n||||�S(	s9Copy shared journal entries into this repo when unsharingR'R$s.baktfilenamesnamejournal.bakt_newestfirstc3@s-|]#}tj|j��kr|VqdS(N(tsharednamespacesRCt	namespace(t.0te(tsharedfeatures(s3/usr/lib64/python2.7/site-packages/hgext/journal.pys	<genexpr>�sRU(tpathRKRR7RtsharedreposourceRTRMtexiststjointrenameR't_opentFalseRbtminR(
R0R"R,trepopatht
sharedrepotjournalpathtstorageR%RKtentry((Rns3/usr/lib64/python2.7/site-packages/hgext/journal.pyR!�s	(tjournalentryujournalentryu9timestamp user command namespace name oldhashes newhashescB@s5eZdZed��Zd�Zeje�ZRS(s�Individual journal entry

    * timestamp: a mercurial (time, timezone) tuple
    * user: the username that ran the command
    * namespace: the entry namespace, an opaque string
    * name: the name of the changed item, opaque string with meaning in the
      namespace
    * command: the hg command that triggered this record
    * oldhashes: a tuple of one or more binary hashes for the old location
    * newhashes: a tuple of one or more binary hashes for the new location

    Handles serialisation from and to the storage format. Fields are
    separated by newlines, hashes are written out in hex separated by commas,
    timestamp and timezone are separated by a space.

    cC@s�|jd�\}}}}}}}|j�\}	}
t|	�t|
�}	}
td�|jd�D��}td�|jd�D��}||	|
f||||||�S(Ns
cs@s|]}tj|�VqdS(N(Rtbin(Rlthash((s3/usr/lib64/python2.7/site-packages/hgext/journal.pys	<genexpr>�st,cs@s|]}tj|�VqdS(N(RR}(RlR~((s3/usr/lib64/python2.7/site-packages/hgext/journal.pys	<genexpr>�s(tsplittfloattintttuple(tclstlinettimetusertcommandRktnameR?R@t	timestampttz((s3/usr/lib64/python2.7/site-packages/hgext/journal.pytfromstorage�s$cC@s�djttj|j��}djg|jD]}tj|�^q.�}djg|jD]}tj|�^q\�}dj||j	|j
|j|j||f�S(s bytes representation for storaget Rs
(
RrtmapR
tbytestrR�R?RthexR@R�R�RkR�(tselfR�R~R?R@((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt	__bytes__�s..(	t__name__t
__module__t__doc__tclassmethodR�R�Rt	strmethodt__str__(((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR|�s		R&cB@s�eZdZdZd
Zd�Zed��Ze	d��Z
d�Zd�Zd�Z
d�Zd
d
d�Zd	�Zd
ed�ZRS(seStorage for journal entries

    Entries are divided over two files; one with entries that pertain to the
    local working copy *only*, and one with entries that are shared across
    multiple working copies when shared using the share extension.

    Entries are stored with NUL bytes as separators. See the journalentry
    class for the per-entry structure.

    The file format starts with an integer version, delimited by a NUL.

    This storage uses a dedicated lock; this makes it easier to avoid issues
    with adding entries that added when the regular wlock is unlocked (e.g.
    the dirstate).

    cC@s�tj�|_|j|_|j|_d|_|_|j�r�t	|�}t
j|�}|dk	r�d|kr�|j|_||_q�ndS(NR'(RtgetuserR�R"RMtNoneRnt	sharedvfsRKRTRRp(R�R,tfeaturesRx((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt__init__scC@sHdjttjtj��}d|krD|jd�dd}n|S(NR�s
is ...(RrR�Rt
shellquoteR&t_currentcommandt	partition(R�t
commandstr((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR�s
cG@s
||_dS(s:Set the current hg arguments, stored with recorded entriesN(R�(R�R3((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR/scC@s7|dkrdS|�}|dks/|jr3dS|S(soReturns the lock if it's held, or None if it's not.

        (This is copied from the localrepo class)
        N(R�theld(R�tlockreftl((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt_currentlock!s	cC@s�|j|j�d
k	r0tjtd���ntd�|j}ytj|ddd|�}Wn�tjk
r�}|j	j
td�||jf�tj|d|j	jdd�d|�}|j	j
td	�|j
�nXtj|�|_|S(s"Create a lock for the journal files%journal lock does not support nestings
journal of %ssnamejournal.lockitdescs"waiting for lock on %s held by %r
R"ttimeoutsgot lock after %s seconds
N(R�t_lockrefR�RtAbortRtbaseR
tLockHeldR"twarntlockert	configinttdelaytweakreftref(R�RMR�R�RS((s3/usr/lib64/python2.7/site-packages/hgext/journal.pytjlock-s	!cC@s�t|t�s|g}nt|t�s6|g}nttj�|j|j||||�}|j}|jdk	r�t
j|�|jkr�|j}q�n|j
||�dS(s�Record a new journal entry

        * namespace: an opaque string; this can be used to filter on the type
          of recorded entries.
        * name: the name defining this entry; for bookmarks, this is the
          bookmark name. Can be filtered on when retrieving entries.
        * oldhashes and newhashes: each a single binary hash, or a list of
          binary hashes. These represent the old and new position of the named
          item.

        N(t
isinstanceR9R|RtmakedateR�R�RMR�R�RjRCRnR(R�RkR�R?R@R{RM((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR;?s	cC@s�|j|���d}|ddd���}|jdtj�|jd�jd�d}|r�|dtkr�|jj	t
d�|�dS|s�|jdtd�n|jdtj�|jt
|�d�WdQXWdQXdS(	NR$tmodesa+biiss%ds&unsupported journal file version '%s'
(R�R�tseektostSEEK_SETRNR�tstorageversionR"R�RRetSEEK_ENDtbytes(R�RMR{tversiontf((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR]s	cc@s�|dk	r"tj|�d}n|dk	rDtj|�d}nxW|D]O}|dk	rs||j�rsqKn|dk	r�||j�r�qKn|VqKWdS(sUYield all journal entries with the given namespace or name

        Both the namespace and the name are optional; if neither is given all
        entries in the journal are produced.

        Matching supports regular expressions by using the `re:` prefix
        (use `literal:` to match names or namespaces that start with `re:`)

        i����N(R�Rt
stringmatcherRkR�(R�RkR�R{((s3/usr/lib64/python2.7/site-packages/hgext/journal.pytfilteredts

c@sT�j�j�}�jdkr%|S�fd��j�j�D�}t||�S(slIterate over the storage

        Yields journalentry instances for each contained journal record.

        c3@s0|]&}tj|j��jkr|VqdS(N(RjRCRkRn(RlRm(R�(s3/usr/lib64/python2.7/site-packages/hgext/journal.pys	<genexpr>�sN(RtRMR�R�Rb(R�R%RK((R�s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt__iter__�s
"R$c	c@s�|j|�sdS||��}|j�}WdQX|jd�}|oP|d}|dtkr�|prtd�}tjtd�|��n|d}|r�t|�}nx(|D] }|s�q�ntj	|�Vq�WdS(Nsis%ds
not availables!unknown journal file version '%s'i(
RqRNR�R�RRR�treversedR|R�(	R�RMRhRiR�trawtlinesR�R�((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyRt�s 

(N(R�R�R�R�R�R�R�tpropertyR�R�R/R�R�R;RR�R�tTrueRt(((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR&�s							s	no-mergestgraphR'ttallsshow history for all namestctcommitssshow commit metadatais[OPTION]... [BOOKMARKNAME]thelpcategoryc@s�tj|�}d}|jd�rK|rBtjtd���nd}n|r^|d}n|jd|���fd�}|jd�dkr�|dkr�td	�}n
d
|}|jtd�|�nt	j
|�}d}|jd�x�t|j
jd|��D]�\}	}|	|kr-Pn�j��j|jd
d||j���jdd||j���j|jdd|j��j|jd�p�|jd�dd|j��j|jdd�j|jd���jdd|j�|jd�r�j�r3t	j|||�}
n$t	j||�jd�d|�}
x_|jD]T}y||}|
j|�Wqatj k
r�}
�j!dtj"|
��qaXqaW|
j#�qqW�j$�|dkr�|jtd��ndS( szshow the previous position of bookmarks and the working copy

    The journal is used to see the previous commits that bookmarks and the
    working copy pointed to. By default the previous locations for the working
    copy.  Passing a bookmark name will show all the previous positions of
    that bookmark. Use the --all switch to show previous locations for all
    bookmarks and the working copy; each line will then include the bookmark
    name, or '.' for the working copy, as well.

    If `name` starts with `re:`, the remainder of the name is treated as
    a regular expression. To match a name that actually starts with `re:`,
    use the prefix `literal:`.

    By default hg journal only shows the commit hash and the command that was
    running at that time. -v/--verbose will show the prior hash, the user, and
    the time at which it happened.

    Use -c/--commits to output log information on each commit hash; at this
    point you can use the usual `--patch`, `--git`, `--stat` and `--template`
    switches to alter the log output for these.

    `hg journal -T json` can be used to produce machine readable output.

    R8R�s/You can't combine --all and filtering on a nameiR'c@s%�jt�j|�dddd�S(NR�RtsepR(t
formatlistR�thexfunc(tnodes(tfm(s3/usr/lib64/python2.7/site-packages/hgext/journal.pytformatnodes�sttemplatetjsonsthe working copy and bookmarkss'%s'sprevious locations of %s:
R�toldnodess%s -> tnewnodess%sR�s %-8ssre:s  %-8stdates %ss%Y-%m-%d %H:%M %1%2R�s  %s
R�t
changesetstdiffoptss%s

sno recorded locations
N(%R
tbyteskwargsRCRR�RR�t	formattertstatusRtgetlimittpagerRYR'R�t	startitemt	condwritetverboseR?ReR@R�t
startswithR�t
formatdateR�R�tisplaintchangesetdisplayertchangesetformattertnestedtshowtRepoLookupErrortplainR�tclosetend(R"R,R4toptsR�R�tdisplaynametlimitR{tcountt	displayerR~tctxRm((R�s3/usr/lib64/python2.7/site-packages/hgext/journal.pyR'�s` 	


(

"
(s	no-mergesR�(R�R�Nsshow history for all names(R�R�Nsshow commit metadata(9R�t
__future__RtcollectionsRQR�R�tmercurial.i18nRt	mercurialRRRRRRRR	R
RRR
RRtmercurial.utilsRRRtcmdtableR�t
testedwithR�RDR<tsharedbookmarksRjR#R.RR+RR6RRTRbR R!t
namedtupleR|tobjectR&t_ignoreoptsR�tlogoptstopttCATEGORY_CHANGE_ORGANIZATIONR'(((s3/usr/lib64/python2.7/site-packages/hgext/journal.pyt<module>sN^
													(�*