diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2011-10-01 20:49:36 +0000 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-09-27 13:27:51 +0000 |
commit | 921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch) | |
tree | 3c4a89176ea67fe4c7bf7b375488361a823c95fa /tests/printenv.py | |
parent | 9039c805b0a7e36220101323f82735f08a104b37 (diff) | |
download | mercurial-tarball-921ced43c48c1d170452a7b251b94cc96ec8dd44.tar.gz |
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'tests/printenv.py')
-rw-r--r-- | tests/printenv.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/printenv.py b/tests/printenv.py index d00e149..befa546 100644 --- a/tests/printenv.py +++ b/tests/printenv.py @@ -3,7 +3,7 @@ # put something like this in the repo .hg/hgrc: # # [hooks] -# changegroup = python "$TESTDIR/printenv.py" <hookname> [exit] [output] +# changegroup = python "$TESTDIR"/printenv.py <hookname> [exit] [output] # # - <hookname> is a mandatory argument (e.g. "changegroup") # - [exit] is the exit code of the hook (default: 0) @@ -32,17 +32,13 @@ if len(sys.argv) > 2: # variables with empty values may not exist on all platforms, filter # them now for portability sake. -env = [(k, v) for k, v in os.environ.iteritems() +env = [k for k, v in os.environ.iteritems() if k.startswith("HG_") and v] env.sort() out.write("%s hook: " % name) -if os.name == 'nt': - filter = lambda x: x.replace('\\', '/') -else: - filter = lambda x: x -vars = ["%s=%s" % (k, filter(v)) for k, v in env] -out.write(" ".join(vars)) +for v in env: + out.write("%s=%s " % (v, os.environ[v])) out.write("\n") out.close() |