Mercurial > hg
view tests/remotefilelog-getflogheads.py @ 49833:a2356e15200a stable
hghave: add predicates for embedded and filesystem pyoxidizer resources
There are a handful of tests with different output between the two flavors of
pyoxidizer builds (like the location of the modules and templates), and a few
others that avoid `known-bad-output` cases with the embedded resources that
shouldn't cause the tests to fail.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 06 Dec 2022 13:02:54 -0500 |
parents | 6000f5b25c9b |
children | a804242050c4 |
line wrap: on
line source
from mercurial.i18n import _ from mercurial import ( hg, registrar, ) from mercurial.utils import ( urlutil, ) cmdtable = {} command = registrar.command(cmdtable) @command(b'getflogheads', [], b'path') def getflogheads(ui, repo, path): """ Extension printing a remotefilelog's heads Used for testing purpose """ dest = urlutil.get_unique_pull_path(b'getflogheads', repo, ui)[0] peer = hg.peer(repo, {}, dest) try: flogheads = peer.x_rfl_getflogheads(path) finally: peer.close() if flogheads: for head in flogheads: ui.write(head + b'\n') else: ui.write(_(b'EMPTY\n'))