Beispiel #1
0
def _mergemarkers(orig, self, transaction, data):
    """record new markers so we could know the correct nodes for _phasemove"""
    version, markers = obsolete._readmarkers(data)
    self._pushrebasereplaces = {}
    if version == obsolete._fm1version:
        # only support fm1 1:1 replacements for now, record prec -> sucs
        for prec, sucs, flags, meta, date, parents in markers:
            if len(sucs) == 1:
                self._pushrebasereplaces[prec] = sucs[0]
    return orig(self, transaction, data)
Beispiel #2
0
def debugbase85obsmarkers(ui, markers):
    """Print information about base85 obsolescence markers."""
    data = base85.b85decode(markers)
    version, markers = obsolete._readmarkers(data)

    out = []
    for precursor, successors, flags, metadata, date, parents in markers:
        if parents:
            parents = [hex(n) for n in parents]

        out.append({
            'precursor': hex(precursor),
            'successors': [hex(n) for n in successors],
            'flags': flags,
            'metadata': metadata,
            'date': date,
            'parents': parents,
        })

    # Ideally we'd use the templater. But we only need machine readable output.
    ui.write(json.dumps(out, indent=4, sort_keys=True, separators=(',', ': ')))
def debugbase85obsmarkers(ui, markers, **opts):
    """Print information about base85 obsolescence markers."""
    data = base85.b85decode(markers)
    version, markers = obsolete._readmarkers(data)

    with ui.formatter(b'debugbase85obsmarkers', pycompat.byteskwargs(opts)) as fm:
        for precursor, successors, flags, metadata, date, parents in markers:
            fm.startitem()

            if parents:
                parents = [hex(n) for n in parents]

            successors = [hex(n) for n in successors]

            fm.write(b'precursor', b'precursor: %s\n', hex(precursor))
            fm.write(b'successors', b'successors: %s\n',
                     fm.formatlist(successors, b'successor'))
            fm.write(b'flags', b'flags: %d\n', flags)
            fm.write(b'metadata', b'metadata: %s\n',
                     fm.formatlist(metadata, b'metadata'))
            fm.write(b'date', b'date: %s\n', fm.formatdate(date))
            fm.condwrite(parents, b'parents', b'parents: %s\n', parents)