view tests/dummyssh @ 28639:64ed9f904532

tests: fix for failure of test-convert-p4-filetypes.t Before this patch, test-convert-p4-filetypes.t fails (at least with 2015.2/1366233 version of p4/p4d), because some files below are omitted in expected output for revision 1. - file_tempobj - file_xtempobj These files are: - add-ed at revision 0, and - edit-ed at revision 1 According to perforce command reference below, file type 'tempobj' and 'xtempobj' imply '+S' modifier, which indicates that "Only the head revision is stored". This means that these files should appear only in the most recent revision (= revision 1). https://www.perforce.com/perforce/doc.current/manuals/cmdref/file.types.html BTW, test-convert-p4-filetypes.t with 2015.2/1366233 version of p4/p4d fails similarly also at recent revisions for hgext/convert/p4.py in 2015. Therefore, this patch should be reviewed by perforce guru, to examine whether this failure depends on version (and/or configuration) of p4/p4d or not.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 26 Mar 2016 12:55:52 +0900
parents f266cb3f1c2b
children 26d4ce8ca2bd
line wrap: on
line source

#!/usr/bin/env python

import sys
import os

os.chdir(os.getenv('TESTTMP'))

if sys.argv[1] != "user@dummy":
    sys.exit(-1)

os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"

log = open("dummylog", "ab")
log.write("Got arguments")
for i, arg in enumerate(sys.argv[1:]):
    log.write(" %d:%s" % (i + 1, arg))
log.write("\n")
log.close()
hgcmd = sys.argv[2]
if os.name == 'nt':
    # hack to make simple unix single quote quoting work on windows
    hgcmd = hgcmd.replace("'", '"')
r = os.system(hgcmd)
sys.exit(bool(r))