Mercurial > hg
comparison tests/printenv.py @ 16982:9c892c830a72
tests/printenv.py: eliminate trailing spaces on output
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Sun, 17 Jun 2012 00:27:31 +0200 |
parents | c19113e842d3 |
children | e7fdfc702d9f |
comparison
equal
deleted
inserted
replaced
16981:2264e3e39cba | 16982:9c892c830a72 |
---|---|
35 env = [(k, v) for k, v in os.environ.iteritems() | 35 env = [(k, v) for k, v in os.environ.iteritems() |
36 if k.startswith("HG_") and v] | 36 if k.startswith("HG_") and v] |
37 env.sort() | 37 env.sort() |
38 | 38 |
39 out.write("%s hook: " % name) | 39 out.write("%s hook: " % name) |
40 for k, v in env: | 40 if os.name == 'nt': |
41 if os.name == 'nt': | 41 filter = lambda x: x.replace('\\', '/') |
42 v = v.replace('\\', '/') | 42 else: |
43 out.write("%s=%s " % (k, v)) | 43 filter = lambda x: x |
44 vars = ["%s=%s" % (k, filter(v)) for k, v in env] | |
45 out.write(" ".join(vars)) | |
44 out.write("\n") | 46 out.write("\n") |
45 out.close() | 47 out.close() |
46 | 48 |
47 sys.exit(exitcode) | 49 sys.exit(exitcode) |