Skip to content
Snippets Groups Projects
Commit 21a8947cb513 authored by Georges Racinet's avatar Georges Racinet
Browse files

hooks.dev_util: removing HEPTAPOD_HG_NATIVE from output

(this is used to test the presence of environment variables,
notably for user hooks).

The result would be inconsistent between SSH and HTTP access.
Another solution would be to add the variable to the HTTP case
(forwarding in WSGI wrapper), but that's an implementation detail
for real consumers, so we did not.
parent b4a6ffb16f81
No related branches found
No related tags found
No related merge requests found
Pipeline #12939 passed with warnings
......@@ -8,8 +8,14 @@
def print_heptapod_env(repo, *args, **kwargs):
# this environment variable is present on invocation from Heptapod Shell
# but is not forwarded in the WSGI wrapper (and shouldn't).
# Removing it for consistency
to_print = dict(repo.ui.environ)
to_print.pop(b'HEPTAPOD_HG_NATIVE', None)
# repr() does the job for us to format the list
# sysstr decodes from latin-1 (no failures), and we need to reencode
# for ui.status
repo.ui.status(repr(sorted(
(pycompat.sysstr(k), pycompat.sysstr(v))
......@@ -11,8 +17,8 @@
# repr() does the job for us to format the list
# sysstr decodes from latin-1 (no failures), and we need to reencode
# for ui.status
repo.ui.status(repr(sorted(
(pycompat.sysstr(k), pycompat.sysstr(v))
for (k, v) in repo.ui.environ.items()
for (k, v) in to_print.items()
if k.startswith(b'HEPTAPOD_'))).encode('latin-1'))
return 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment