annotate tests/dummyssh @ 26362:3bfc473f4d33

gitweb, monoblue: fix vertical align of spans in .sourcelines Empty lines in file view could produce an inexplicable margin before the next line (most noticeable in browsers on webkit/blink engine). That was making empty lines seem taller than the rest. Instead of using default vertical align, let's set it to 'top'. This issue is actually present in paper, and only recently got into gitweb (2239626369f5) and monoblue (119202d4d7a4). There's a bit more to it in paper, so that will be dealt with in a future patch. Recipe to see live: preferably using a webkit/blink browser, such as chromium, browse a file with empty lines, e.g. https://selenic.com/hg/file/3.5/README#l8 Selecting a block of text that includes empty lines will reveal white "breaks" in the selection. Highlighted line (#l8) also shows such a break below itself.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Sep 2015 03:02:38 +0800
parents f266cb3f1c2b
children 26d4ce8ca2bd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14186
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
1 #!/usr/bin/env python
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
2
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
3 import sys
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
4 import os
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
5
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
6 os.chdir(os.getenv('TESTTMP'))
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
7
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
8 if sys.argv[1] != "user@dummy":
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
9 sys.exit(-1)
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
10
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
11 os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
12
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
13 log = open("dummylog", "ab")
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
14 log.write("Got arguments")
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
15 for i, arg in enumerate(sys.argv[1:]):
19320
f266cb3f1c2b dummyssh: fix check-code nit
Augie Fackler <raf@durin42.com>
parents: 15768
diff changeset
16 log.write(" %d:%s" % (i + 1, arg))
14186
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
17 log.write("\n")
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
18 log.close()
15768
cdf9c43445df tests: make simple single quotes work with dummyssh on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 14186
diff changeset
19 hgcmd = sys.argv[2]
cdf9c43445df tests: make simple single quotes work with dummyssh on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 14186
diff changeset
20 if os.name == 'nt':
cdf9c43445df tests: make simple single quotes work with dummyssh on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 14186
diff changeset
21 # hack to make simple unix single quote quoting work on windows
cdf9c43445df tests: make simple single quotes work with dummyssh on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 14186
diff changeset
22 hgcmd = hgcmd.replace("'", '"')
cdf9c43445df tests: make simple single quotes work with dummyssh on windows
Mads Kiilerich <mads@kiilerich.com>
parents: 14186
diff changeset
23 r = os.system(hgcmd)
14186
8513bd2e7259 tests: share dummyssh
Mads Kiilerich <mads@kiilerich.com>
parents:
diff changeset
24 sys.exit(bool(r))