tests/printenv.py
changeset 13404 31a256ffe9e5
parent 12642 bb35840e965c
child 13405 682edefe7dbb
equal deleted inserted replaced
13403:8ed91088acbb 13404:31a256ffe9e5
    37 # them now for portability sake.
    37 # them now for portability sake.
    38 env = [k for k, v in os.environ.iteritems()
    38 env = [k for k, v in os.environ.iteritems()
    39        if k.startswith("HG_") and v]
    39        if k.startswith("HG_") and v]
    40 env.sort()
    40 env.sort()
    41 
    41 
    42 # edit the variable part of the variable
       
    43 url = os.environ.get("HG_URL", "")
       
    44 if url.startswith("file:"):
       
    45     os.environ["HG_URL"] = "file:"
       
    46 elif url.startswith("remote:http"):
       
    47     os.environ["HG_URL"] = "remote:http"
       
    48 
       
    49 out.write("%s hook: " % name)
    42 out.write("%s hook: " % name)
    50 for v in env:
    43 for v in env:
    51     out.write("%s=%s " % (v, os.environ[v]))
    44     out.write("%s=%s " % (v, os.environ[v]))
    52 out.write("\n")
    45 out.write("\n")
    53 out.close()
    46 out.close()