^c? dZddlmZddlmZddlmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZdZiZejeZejZGddejZeZedd d d d ed fgedejd dZedddZedddZeddZedddZdZ d!dZ!dZ"e"dS)"ajunified command to show various repository information (EXPERIMENTAL) This extension provides the :hg:`show` command, which provides a central command for displaying commonly-accessed repository data and views of that data. The following config options can influence operation. ``commands`` ------------ ``show.aliasprefix`` List of strings that will register aliases for views. e.g. ``s`` will effectively set config options ``alias.s = show `` for all views. i.e. `hg swork` would execute `hg show work`. Aliases that would conflict with existing registrations will not be performed. )_)nullrev) cmdutilcommandsdestutilerror formattergraphmod logcmdutilphasespycompat registrarrevset revsetlangscmutilsships-with-hg-coreceZdZdZdZddZdS) showcmdfuncz;Register a function to be invoked for an `hg show `.s%s -- %sNc"||_||_dS)aCalled with decorator arguments to register a show view. ``name`` is the sub-command name. ``func`` is the function being decorated. ``fmtopic`` is the topic in the style that will be rendered for this view. ``csettopic`` is the topic in the style to be used for a changeset printer. If ``fmtopic`` is specified, the view function will receive a formatter instance. If ``csettopic`` is specified, the view function will receive a changeset printer. N)_fmtopic _csettopic)selfnamefuncfmtopic csettopics ,/usr/lib/python3/dist-packages/hgext/show.py _extrasetupzshowcmdfunc._extrasetupAs"  #NN)__name__ __module__ __qualname____doc__ _docformatrrrrr;s5EEJ$$$$$$rrshowTtemplatersdisplay with templatesTEMPLATEsVIEW) helpcategoryNc||r4|s2td}tjtd|tj}|s|d|td|dt| D]4\}}|dtj |j z5|dtjtdtd ||vr3tjtd |ztd |pd}||}|d|j rId |j z} || d |i5} |||| cdddS#1swxYwYdS|jrEd |jz} tj|| |} t#j||| d} |||| S|||S)ashow various repository information A requested view of repository data is displayed. If no view is requested, the list of available views is shown and the command aborts. .. note:: There are no backwards compatibility guarantees for the output of this command. Output may change in any future Mercurial release. Consumers wanting stable command output should specify a template via ``-T/--template``. List of available views: s2invoke with -T/--template to control output formats%must specify a template in plain mode)hintr&savailable views:  s%s sno view requesteds#use "hg show VIEW" to choose a viewsunknown view: %ss$run "hg show" to see available viewssshow%sr(NT)buffered)plainrrAbortshowview_tablepagerwritesorteditemsr sysbytesr#rr rlookuptemplater changesettemplater)uirepoviewtemplater+viewsrrfnrfmrefspec displayers rshowrCYs> xxzz ( FGGk 6 7 7d     OE    ())***  // @ @JD$ HHWx0>>> ? ? ? ? k " # #9::     5k ! " "T ):;;    "7H tBHHW { bk) \\'K#: ; ; $r2b$## $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ "-''C::1"dD4PPP r"dI&&&r"d||s? GG Gs bookmarks)rcj}t|s>t|tjs"|t ddSfd|D}j}td|D}t|}t| D]\}} | || |dd||d|| || |||k|| dS) z(bookmarks and their associated changesets(no bookmarks set) NcDg|]}|Sr%)rev).0noder:s r z!showbookmarks..s' 8 8 8DJNN   8 8 8rc34K|]}t|VdSN)len)rGbs r z showbookmarks..s(,,c!ff,,,,,,r)ctxsbookmarks%snode)activelongestbookmarklennodelen) _bookmarksrL isinstancer jsonformatterr3rvalues_activebookmarkmaxlongestshortestr4r5 startitemcontexthexfuncdata) r9r:r?marksrevsrQ longestnamerSbmrHs ` r showbookmarksrcsf OE u::"i566 1 HHQ.// 0 0 0 8 8 8 8 8 8 8D  !F,,e,,,,,KdD))G5;;==))  D  tDz """ eR((( "**T**BJJt,<,<=== .shortest s'))3*K*KLLLr)stoprevc|SrKr%)x revdistances rzshowstack..3s KNr)keyrgs: s so )rSr,s:/s /s (s%d commits aheadsstack.commitdistance)labels; shg rebase --source %s --dest %ssstack.rebasehints) s: : s (stack head) s stack.labels \ / s(multiple children) s | @os:/ s / s (stack base))$rFrrr/rphaser publicr3r stackbasesetr`p1 changelog descendantsaddrLchildrenlistr4rZrfindcmdrtableAmbiguousCommandUnknownCommandr templateresources maketemplater ancestors enumerate writenoi18nrCflush)r9r:rBwdirctxbaserevbasectx stackrevsrObranchpointattipclrFnewheadsallrevsrS haverebasetresrmheadr sourcectx sortedheadsisymbolrrrls @@r showstackrs4jG{{}}k %     }}&-''          T**GG++--[[]]O  (G4455 w-C vvxx||~~  &&(( B~~w{{}}o..3i 99;;&- ' ' E cggii    s||~~   " "#  E #VIt44455I II3W[[]]I     55)nnx'7)3GdG,,G 8>222  "E$8 9   &r4 0 0D* #g -LMMMMM 6=  5 5D dVW[[]] CCI #DOO 4 4K  2'  2222D    ,,# # FAss)C  NN6 " " " NN3N 0 0 0 OOC HHUOOO  HHX    HH%&&S)99-      :#8I.. >?.  HHV      $%%^<<<  +,,NCCC   3i --4   HHUOOOO HHUOOO sG,,,     HHX     HHX    ?##U.AAA vw000      s=J>s!_underway([commitage[, headage]])ctj|dd}d|vrd|d<d|vrd|d<d}g}|dr@|dz }|tj|dt d|j|g|R}tj|}||d|z }d }g}|dr@|dz }|tj|dt d ||j|g|Rz }|d }|tkr|tj|hz }||zS) Nsunderwayscommitage headages commitagesheadagesnot public() and not obsolete()s and date(%s)scommitage requires a strings parents(%ld)shead() and not closed()sheadage requires a stringre) r getargsdictappendr getstringrr`basesetrFr) r:subsetrqargsrsrsargsmutablerelevantwdirrevs runderwayrevsetrs  a.B C CD4!\Z ,B F L    \"A&D$E$E     di$V$$$G~g&&H  /7333H $B F J    Z !$@"A"A       "&v&&&&H4jnnG'FNG9--- H rsworkc |d}t||}tj||}|dddt j||||tjd|idS)zchangesets that aren't finishedssort(_underway(), topo)s experimentals graphshortenTsnodelen)propsN)r`rZr dagwalker setconfigr displaygraph asciiedges)r9r:rBr`rSrevdags rshowworkrs 99/ 0 0DdD))G  d + +FLL/4888  7# rc|ddD]u}tjD]f}d||fz}tj|t jd\}}||vr2|d|drJ|d|d|zd gvdS) Nscommandssshow.aliasprefixs%s%sT)strictsaliassshow %sr&)source) configlistr0r1r findpossiblerrconfigr)r9prefixr;rchoice allcommandss rextsetuprs-- -@AALLO L LDfd^+D")"6hnT### FK v~~yy4..  LL4d):7L K K K K LLLrcX|sSjtfd|DS)aReturn the length of the longest shortest node to identify revisions. The result of this function can be used with the ``shortest()`` template function to ensure that a value is unique and unambiguous for a given set of nodes. The number of revisions in the repo is taken into account to prevent a numeric node prefix from conflicting with an integer revision number. If we fail to do this, a value of e.g. ``10023`` could mean either revision 10023 or node ``10023abc...``. c 3K|]:}ttj|V;dSrK)rLrshortesthexnodeidprefixrH)rGrrminlenr:s rrNz"longestshortest..sX  G +D"''!**f E EFFr)r}rY)r:r`rrs` `@rrZrZs]  B   rc ttttj}g}t tjD]W}|dtj | |dtj|j Xtj dtddj tj d|fztdd_ dS)Nz z s %s %s r&rs )rYmaprLr0r1keysr4rr sysstrljust_origdoccmdtabler#rstripjoin)longestentriesrts r_updatedocstringrs #c8?//112233GGho**,,--   ' 2 23333$--     $,?3D#E#E!$++--  %%g..I$HWa   rr)r)#r#mercurial.i18nrmercurial.noder mercurialrrrrr r r r r rrrr testedwithrcommandrevsetpredicate_funcregistrarbaserr0CATEGORY_CHANGE_NAVIGATIONrCrcrrrrrZrr%rrrs*""""""(#  ) H % %+)+--$$$$$).$$$6 ;==   {C!911[>>J AgJJ3   @@@  @F , ---  .- 4 (h'''{{('{|56655765p 'W%%%&%&LLL*4$r