Ejemplo n.º 1
0
    context,
    error,
    node,
    obsolete,
    pycompat,
    registrar,
    scmutil,
    tags as tagsmod,
)

cmdtable = {}
command = registrar.command(cmdtable)

_pipechars = b'\\/+-|'
_nonpipechars = b''.join(
    pycompat.bytechr(i) for i in range(33, 127)
    if pycompat.bytechr(i) not in _pipechars)


def _isname(ch):
    """char -> bool. return True if ch looks like part of a name, False
    otherwise"""
    return ch in _nonpipechars


def _parseasciigraph(text):
    r"""str -> {str : [str]}. convert the ASCII graph to edges

    >>> import pprint
    >>> pprint.pprint({pycompat.sysstr(k): [pycompat.sysstr(vv) for vv in v]
    ...  for k, v in _parseasciigraph(br'''
Ejemplo n.º 2
0
def unmangle(s):
    return b''.join(pycompat.bytechr(ord(c) - 1) for c in pycompat.bytestr(s))
Ejemplo n.º 3
0
 def getFakeHash(self):
     return b''.join(
         pycompat.bytechr(random.randint(0, 255)) for _ in range(20))