tests/dummyssh
author Laurent Charignon <lcharignon@fb.com>
Fri, 19 Jun 2015 11:04:18 -0700
changeset 1398 7ddcbf5469bc
parent 943 5b8d9c2ab480
permissions -rwxr-xr-x
evolve: make fold aware of allowunstable Before this patch, the fold command was performing the same way regardless of the value of experimental.evolution. With this patch if the configuration does not allow unstability, fold won't create instability.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
943
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     1
#!/usr/bin/env python
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     2
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     3
import sys
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     4
import os
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     5
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     6
os.chdir(os.getenv('TESTTMP'))
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     7
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     8
if sys.argv[1] != "user@dummy":
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
     9
    sys.exit(-1)
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    10
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    11
os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    12
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    13
log = open("dummylog", "ab")
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    14
log.write("Got arguments")
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    15
for i, arg in enumerate(sys.argv[1:]):
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    16
    log.write(" %d:%s" % (i + 1, arg))
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    17
log.write("\n")
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    18
log.close()
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    19
hgcmd = sys.argv[2]
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    20
if os.name == 'nt':
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    21
    # hack to make simple unix single quote quoting work on windows
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    22
    hgcmd = hgcmd.replace("'", '"')
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    23
r = os.system(hgcmd)
5b8d9c2ab480 evolve: test exchange through wireprotocol
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
diff changeset
    24
sys.exit(bool(r))