Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
mercurial /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
cext
[ DIR ]
drwxr-xr-x
cffi
[ DIR ]
drwxr-xr-x
defaultrc
[ DIR ]
drwxr-xr-x
dirstateutils
[ DIR ]
drwxr-xr-x
helptext
[ DIR ]
drwxr-xr-x
hgweb
[ DIR ]
drwxr-xr-x
interfaces
[ DIR ]
drwxr-xr-x
locale
[ DIR ]
drwxr-xr-x
pure
[ DIR ]
drwxr-xr-x
revlogutils
[ DIR ]
drwxr-xr-x
templates
[ DIR ]
drwxr-xr-x
testing
[ DIR ]
drwxr-xr-x
thirdparty
[ DIR ]
drwxr-xr-x
upgrade_utils
[ DIR ]
drwxr-xr-x
utils
[ DIR ]
drwxr-xr-x
__init__.py
416
B
-rw-r--r--
__modulepolicy__.py
61
B
-rw-r--r--
__version__.py
60
B
-rw-r--r--
ancestor.py
12.51
KB
-rw-r--r--
archival.py
11.59
KB
-rw-r--r--
bookmarks.py
34.74
KB
-rw-r--r--
branchmap.py
31.58
KB
-rw-r--r--
bundle2.py
86.74
KB
-rw-r--r--
bundlecaches.py
13.6
KB
-rw-r--r--
bundlerepo.py
23.29
KB
-rw-r--r--
cacheutil.py
827
B
-rw-r--r--
changegroup.py
65.72
KB
-rw-r--r--
changelog.py
19.72
KB
-rw-r--r--
chgserver.py
26.25
KB
-rw-r--r--
cmdutil.py
131.98
KB
-rw-r--r--
color.py
17.93
KB
-rw-r--r--
commands.py
257.93
KB
-rw-r--r--
commandserver.py
24.59
KB
-rw-r--r--
commit.py
18.52
KB
-rw-r--r--
config.py
8.59
KB
-rw-r--r--
configitems.py
46.49
KB
-rw-r--r--
context.py
100.53
KB
-rw-r--r--
copies.py
46.01
KB
-rw-r--r--
crecord.py
70.99
KB
-rw-r--r--
dagop.py
39.57
KB
-rw-r--r--
dagparser.py
15.13
KB
-rw-r--r--
debugcommands.py
154.84
KB
-rw-r--r--
destutil.py
17.07
KB
-rw-r--r--
diffhelper.py
2.32
KB
-rw-r--r--
diffutil.py
4.52
KB
-rw-r--r--
dirstate.py
51.01
KB
-rw-r--r--
dirstateguard.py
3.09
KB
-rw-r--r--
dirstatemap.py
23.77
KB
-rw-r--r--
discovery.py
22
KB
-rw-r--r--
dispatch.py
46.19
KB
-rw-r--r--
dummycert.pem
2.19
KB
-rw-r--r--
encoding.py
22.89
KB
-rw-r--r--
error.py
17.88
KB
-rw-r--r--
exchange.py
94.65
KB
-rw-r--r--
extensions.py
30.6
KB
-rw-r--r--
exthelper.py
11.83
KB
-rw-r--r--
fancyopts.py
11.3
KB
-rw-r--r--
filelog.py
8.58
KB
-rw-r--r--
filemerge.py
39.67
KB
-rw-r--r--
fileset.py
18.66
KB
-rw-r--r--
filesetlang.py
10.34
KB
-rw-r--r--
formatter.py
26.34
KB
-rw-r--r--
graphmod.py
16.76
KB
-rw-r--r--
grep.py
7.26
KB
-rw-r--r--
hbisect.py
10.89
KB
-rw-r--r--
help.py
36.74
KB
-rw-r--r--
hg.py
51.95
KB
-rw-r--r--
hook.py
11.53
KB
-rw-r--r--
httpconnection.py
4.27
KB
-rw-r--r--
httppeer.py
20.71
KB
-rw-r--r--
i18n.py
4.05
KB
-rw-r--r--
keepalive.py
27.1
KB
-rw-r--r--
linelog.py
14.94
KB
-rw-r--r--
localrepo.py
140.97
KB
-rw-r--r--
lock.py
11.89
KB
-rw-r--r--
logcmdutil.py
42.53
KB
-rw-r--r--
logexchange.py
4.98
KB
-rw-r--r--
loggingutil.py
3.93
KB
-rw-r--r--
lsprof.py
4.25
KB
-rw-r--r--
lsprofcalltree.py
2.74
KB
-rw-r--r--
mail.py
17.09
KB
-rw-r--r--
manifest.py
75.45
KB
-rw-r--r--
match.py
52.06
KB
-rw-r--r--
mdiff.py
17.37
KB
-rw-r--r--
merge.py
90.09
KB
-rw-r--r--
mergestate.py
31.37
KB
-rw-r--r--
mergeutil.py
502
B
-rw-r--r--
metadata.py
32.33
KB
-rw-r--r--
minifileset.py
3.54
KB
-rw-r--r--
minirst.py
29.13
KB
-rw-r--r--
namespaces.py
8.19
KB
-rw-r--r--
narrowspec.py
11.57
KB
-rw-r--r--
node.py
2.07
KB
-rw-r--r--
obsolete.py
36.76
KB
-rw-r--r--
obsutil.py
35.84
KB
-rw-r--r--
parser.py
25.68
KB
-rw-r--r--
patch.py
102
KB
-rw-r--r--
pathutil.py
12.21
KB
-rw-r--r--
phases.py
32.54
KB
-rw-r--r--
policy.py
4.74
KB
-rw-r--r--
posix.py
23.05
KB
-rw-r--r--
profiling.py
8.64
KB
-rw-r--r--
progress.py
10.92
KB
-rw-r--r--
pushkey.py
1.67
KB
-rw-r--r--
pvec.py
6.01
KB
-rw-r--r--
pycompat.py
16.33
KB
-rw-r--r--
rcutil.py
3.57
KB
-rw-r--r--
registrar.py
17.78
KB
-rw-r--r--
repair.py
18.46
KB
-rw-r--r--
repocache.py
4.49
KB
-rw-r--r--
repoview.py
16.89
KB
-rw-r--r--
requirements.py
4.64
KB
-rw-r--r--
revlog.py
117.08
KB
-rw-r--r--
revset.py
87.27
KB
-rw-r--r--
revsetlang.py
28.47
KB
-rw-r--r--
rewriteutil.py
8.47
KB
-rw-r--r--
scmposix.py
2.57
KB
-rw-r--r--
scmutil.py
75.72
KB
-rw-r--r--
scmwindows.py
3.37
KB
-rw-r--r--
server.py
7.05
KB
-rw-r--r--
setdiscovery.py
18
KB
-rw-r--r--
shelve.py
38.04
KB
-rw-r--r--
similar.py
3.97
KB
-rw-r--r--
simplemerge.py
16.86
KB
-rw-r--r--
smartset.py
33.65
KB
-rw-r--r--
sparse.py
26.37
KB
-rw-r--r--
sshpeer.py
22.56
KB
-rw-r--r--
sslutil.py
35.54
KB
-rw-r--r--
stack.py
762
B
-rw-r--r--
state.py
11.99
KB
-rw-r--r--
statichttprepo.py
7.92
KB
-rw-r--r--
statprof.py
32.16
KB
-rw-r--r--
store.py
25.27
KB
-rw-r--r--
streamclone.py
30.73
KB
-rw-r--r--
strip.py
8.72
KB
-rw-r--r--
subrepo.py
70.89
KB
-rw-r--r--
subrepoutil.py
17.42
KB
-rw-r--r--
tagmerge.py
11.29
KB
-rw-r--r--
tags.py
29.67
KB
-rw-r--r--
templatefilters.py
15.11
KB
-rw-r--r--
templatefuncs.py
30.14
KB
-rw-r--r--
templatekw.py
34.12
KB
-rw-r--r--
templater.py
37.7
KB
-rw-r--r--
templateutil.py
35.66
KB
-rw-r--r--
transaction.py
25.97
KB
-rw-r--r--
treediscovery.py
5.92
KB
-rw-r--r--
txnutil.py
1.02
KB
-rw-r--r--
ui.py
80.23
KB
-rw-r--r--
unionrepo.py
9.72
KB
-rw-r--r--
upgrade.py
14.59
KB
-rw-r--r--
url.py
24.56
KB
-rw-r--r--
urllibcompat.py
5.94
KB
-rw-r--r--
util.py
95.18
KB
-rw-r--r--
verify.py
21.8
KB
-rw-r--r--
vfs.py
24.93
KB
-rw-r--r--
win32.py
22.04
KB
-rw-r--r--
windows.py
21.77
KB
-rw-r--r--
wireprotoframing.py
64.95
KB
-rw-r--r--
wireprotoserver.py
17.38
KB
-rw-r--r--
wireprototypes.py
13.07
KB
-rw-r--r--
wireprotov1peer.py
21.51
KB
-rw-r--r--
wireprotov1server.py
26.33
KB
-rw-r--r--
worker.py
15.47
KB
-rw-r--r--
zstd.cpython-310-x86_64-linux-...
570.78
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : dagparser.py
# dagparser.py - parser and generator for concise description of DAGs # # Copyright 2010 Peter Arrenbrecht <peter@arrenbrecht.ch> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import re import string from .i18n import _ from . import ( error, pycompat, ) from .utils import stringutil def parsedag(desc): '''parses a DAG from a concise textual description; generates events "+n" is a linear run of n nodes based on the current default parent "." is a single node based on the current default parent "$" resets the default parent to -1 (implied at the start); otherwise the default parent is always the last node created "<p" sets the default parent to the backref p "*p" is a fork at parent p, where p is a backref "*p1/p2/.../pn" is a merge of parents p1..pn, where the pi are backrefs "/p2/.../pn" is a merge of the preceding node and p2..pn ":name" defines a label for the preceding node; labels can be redefined "@text" emits an annotation event for text "!command" emits an action event for the current node "!!my command\n" is like "!", but to the end of the line "#...\n" is a comment up to the end of the line Whitespace between the above elements is ignored. A backref is either * a number n, which references the node curr-n, where curr is the current node, or * the name of a label you placed earlier using ":name", or * empty to denote the default parent. All string valued-elements are either strictly alphanumeric, or must be enclosed in double quotes ("..."), with "\" as escape character. Generates sequence of ('n', (id, [parentids])) for node creation ('l', (id, labelname)) for labels on nodes ('a', text) for annotations ('c', command) for actions (!) ('C', command) for line actions (!!) Examples -------- Example of a complex graph (output not shown for brevity): >>> len(list(parsedag(b""" ... ... +3 # 3 nodes in linear run ... :forkhere # a label for the last of the 3 nodes from above ... +5 # 5 more nodes on one branch ... :mergethis # label again ... <forkhere # set default parent to labeled fork node ... +10 # 10 more nodes on a parallel branch ... @stable # following nodes will be annotated as "stable" ... +5 # 5 nodes in stable ... !addfile # custom command; could trigger new file in next node ... +2 # two more nodes ... /mergethis # merge last node with labeled node ... +4 # 4 more nodes descending from merge node ... ... """))) 34 Empty list: >>> list(parsedag(b"")) [] A simple linear run: >>> list(parsedag(b"+3")) [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))] Some non-standard ways to define such runs: >>> list(parsedag(b"+1+2")) [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))] >>> list(parsedag(b"+1*1*")) [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))] >>> list(parsedag(b"*")) [('n', (0, [-1]))] >>> list(parsedag(b"...")) [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))] A fork and a join, using numeric back references: >>> list(parsedag(b"+2*2*/2")) [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [0])), ('n', (3, [2, 1]))] >>> list(parsedag(b"+2<2+1/2")) [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [0])), ('n', (3, [2, 1]))] Placing a label: >>> list(parsedag(b"+1 :mylabel +1")) [('n', (0, [-1])), ('l', (0, 'mylabel')), ('n', (1, [0]))] An empty label (silly, really): >>> list(parsedag(b"+1:+1")) [('n', (0, [-1])), ('l', (0, '')), ('n', (1, [0]))] Fork and join, but with labels instead of numeric back references: >>> list(parsedag(b"+1:f +1:p2 *f */p2")) [('n', (0, [-1])), ('l', (0, 'f')), ('n', (1, [0])), ('l', (1, 'p2')), ('n', (2, [0])), ('n', (3, [2, 1]))] >>> list(parsedag(b"+1:f +1:p2 <f +1 /p2")) [('n', (0, [-1])), ('l', (0, 'f')), ('n', (1, [0])), ('l', (1, 'p2')), ('n', (2, [0])), ('n', (3, [2, 1]))] Restarting from the root: >>> list(parsedag(b"+1 $ +1")) [('n', (0, [-1])), ('n', (1, [-1]))] Annotations, which are meant to introduce sticky state for subsequent nodes: >>> list(parsedag(b"+1 @ann +1")) [('n', (0, [-1])), ('a', 'ann'), ('n', (1, [0]))] >>> list(parsedag(b'+1 @"my annotation" +1')) [('n', (0, [-1])), ('a', 'my annotation'), ('n', (1, [0]))] Commands, which are meant to operate on the most recently created node: >>> list(parsedag(b"+1 !cmd +1")) [('n', (0, [-1])), ('c', 'cmd'), ('n', (1, [0]))] >>> list(parsedag(b'+1 !"my command" +1')) [('n', (0, [-1])), ('c', 'my command'), ('n', (1, [0]))] >>> list(parsedag(b'+1 !!my command line\\n +1')) [('n', (0, [-1])), ('C', 'my command line'), ('n', (1, [0]))] Comments, which extend to the end of the line: >>> list(parsedag(b'+1 # comment\\n+1')) [('n', (0, [-1])), ('n', (1, [0]))] Error: >>> try: list(parsedag(b'+1 bad')) ... except Exception as e: print(pycompat.sysstr(bytes(e))) invalid character in dag description: bad... ''' if not desc: return # pytype: disable=wrong-arg-types wordchars = pycompat.bytestr(string.ascii_letters + string.digits) # pytype: enable=wrong-arg-types labels = {} p1 = -1 r = 0 def resolve(ref): if not ref: return p1 # pytype: disable=wrong-arg-types elif ref[0] in pycompat.bytestr(string.digits): # pytype: enable=wrong-arg-types return r - int(ref) else: return labels[ref] chiter = pycompat.iterbytestr(desc) def nextch(): return next(chiter, b'\0') def nextrun(c, allow): s = b'' while c in allow: s += c c = nextch() return c, s def nextdelimited(c, limit, escape): s = b'' while c != limit: if c == escape: c = nextch() s += c c = nextch() return nextch(), s def nextstring(c): if c == b'"': return nextdelimited(nextch(), b'"', b'\\') else: return nextrun(c, wordchars) c = nextch() while c != b'\0': # pytype: disable=wrong-arg-types while c in pycompat.bytestr(string.whitespace): # pytype: enable=wrong-arg-types c = nextch() if c == b'.': yield b'n', (r, [p1]) p1 = r r += 1 c = nextch() elif c == b'+': # pytype: disable=wrong-arg-types c, digs = nextrun(nextch(), pycompat.bytestr(string.digits)) # pytype: enable=wrong-arg-types n = int(digs) for i in pycompat.xrange(0, n): yield b'n', (r, [p1]) p1 = r r += 1 elif c in b'*/': if c == b'*': c = nextch() c, pref = nextstring(c) prefs = [pref] while c == b'/': c, pref = nextstring(nextch()) prefs.append(pref) ps = [resolve(ref) for ref in prefs] yield b'n', (r, ps) p1 = r r += 1 elif c == b'<': c, ref = nextstring(nextch()) p1 = resolve(ref) elif c == b':': c, name = nextstring(nextch()) labels[name] = p1 yield b'l', (p1, name) elif c == b'@': c, text = nextstring(nextch()) yield b'a', text elif c == b'!': c = nextch() if c == b'!': cmd = b'' c = nextch() while c not in b'\n\r\0': cmd += c c = nextch() yield b'C', cmd else: c, cmd = nextstring(c) yield b'c', cmd elif c == b'#': while c not in b'\n\r\0': c = nextch() elif c == b'$': p1 = -1 c = nextch() elif c == b'\0': return # in case it was preceded by whitespace else: s = b'' i = 0 while c != b'\0' and i < 10: s += c i += 1 c = nextch() raise error.Abort( _(b'invalid character in dag description: %s...') % s ) def dagtextlines( events, addspaces=True, wraplabels=False, wrapannotations=False, wrapcommands=False, wrapnonlinear=False, usedots=False, maxlinewidth=70, ): '''generates single lines for dagtext()''' def wrapstring(text): if re.match(b"^[0-9a-z]*$", text): return text return b'"' + text.replace(b'\\', b'\\\\').replace(b'"', b'\"') + b'"' def gen(): labels = {} run = 0 wantr = 0 needroot = False for kind, data in events: if kind == b'n': r, ps = data # sanity check if r != wantr: raise error.Abort(_(b"expected id %i, got %i") % (wantr, r)) if not ps: ps = [-1] else: for p in ps: if p >= r: raise error.Abort( _( b"parent id %i is larger than " b"current id %i" ) % (p, r) ) wantr += 1 # new root? p1 = r - 1 if len(ps) == 1 and ps[0] == -1: if needroot: if run: yield b'+%d' % run run = 0 if wrapnonlinear: yield b'\n' yield b'$' p1 = -1 else: needroot = True if len(ps) == 1 and ps[0] == p1: if usedots: yield b"." else: run += 1 else: if run: yield b'+%d' % run run = 0 if wrapnonlinear: yield b'\n' prefs = [] for p in ps: if p == p1: prefs.append(b'') elif p in labels: prefs.append(labels[p]) else: prefs.append(b'%d' % (r - p)) yield b'*' + b'/'.join(prefs) else: if run: yield b'+%d' % run run = 0 if kind == b'l': rid, name = data labels[rid] = name yield b':' + name if wraplabels: yield b'\n' elif kind == b'c': yield b'!' + wrapstring(data) if wrapcommands: yield b'\n' elif kind == b'C': yield b'!!' + data yield b'\n' elif kind == b'a': if wrapannotations: yield b'\n' yield b'@' + wrapstring(data) elif kind == b'#': yield b'#' + data yield b'\n' else: raise error.Abort( _(b"invalid event type in dag: ('%s', '%s')") % ( stringutil.escapestr(kind), stringutil.escapestr(data), ) ) if run: yield b'+%d' % run line = b'' for part in gen(): if part == b'\n': if line: yield line line = b'' else: if len(line) + len(part) >= maxlinewidth: yield line line = b'' elif addspaces and line and part != b'.': line += b' ' line += part if line: yield line def dagtext( dag, addspaces=True, wraplabels=False, wrapannotations=False, wrapcommands=False, wrapnonlinear=False, usedots=False, maxlinewidth=70, ): """generates lines of a textual representation for a dag event stream events should generate what parsedag() does, so: ('n', (id, [parentids])) for node creation ('l', (id, labelname)) for labels on nodes ('a', text) for annotations ('c', text) for commands ('C', text) for line commands ('!!') ('#', text) for comment lines Parent nodes must come before child nodes. Examples -------- Linear run: >>> dagtext([(b'n', (0, [-1])), (b'n', (1, [0]))]) '+2' Two roots: >>> dagtext([(b'n', (0, [-1])), (b'n', (1, [-1]))]) '+1 $ +1' Fork and join: >>> dagtext([(b'n', (0, [-1])), (b'n', (1, [0])), (b'n', (2, [0])), ... (b'n', (3, [2, 1]))]) '+2 *2 */2' Fork and join with labels: >>> dagtext([(b'n', (0, [-1])), (b'l', (0, b'f')), (b'n', (1, [0])), ... (b'l', (1, b'p2')), (b'n', (2, [0])), (b'n', (3, [2, 1]))]) '+1 :f +1 :p2 *f */p2' Annotations: >>> dagtext([(b'n', (0, [-1])), (b'a', b'ann'), (b'n', (1, [0]))]) '+1 @ann +1' >>> dagtext([(b'n', (0, [-1])), ... (b'a', b'my annotation'), ... (b'n', (1, [0]))]) '+1 @"my annotation" +1' Commands: >>> dagtext([(b'n', (0, [-1])), (b'c', b'cmd'), (b'n', (1, [0]))]) '+1 !cmd +1' >>> dagtext([(b'n', (0, [-1])), ... (b'c', b'my command'), ... (b'n', (1, [0]))]) '+1 !"my command" +1' >>> dagtext([(b'n', (0, [-1])), ... (b'C', b'my command line'), ... (b'n', (1, [0]))]) '+1 !!my command line\\n+1' Comments: >>> dagtext([(b'n', (0, [-1])), (b'#', b' comment'), (b'n', (1, [0]))]) '+1 # comment\\n+1' >>> dagtext([]) '' Combining parsedag and dagtext: >>> dagtext(parsedag(b'+1 :f +1 :p2 *f */p2')) '+1 :f +1 :p2 *f */p2' """ return b"\n".join( dagtextlines( dag, addspaces, wraplabels, wrapannotations, wrapcommands, wrapnonlinear, usedots, maxlinewidth, ) )
Close