annotate tests/dummyssh @ 23741:f2893cd8d1e5

largefiles: pass a matcher instead of a raw file list to removelargefiles() This is consistent with addlargefiles(), and will make it easier to get the paths that are printed correct when recursing into subrepos or invoking from outside the repository. It also now restricts the path that the addremove is performed on if a path is given, as is done with normal files. The repo.status() call needs to exclude clean files when performing an addremove, because the addremove override method calling this used to pass the list of files to delete, which caused the matcher to only consider those files in building the status list. Now the matcher is restricted only to the extent that the caller requested- usually directories if at all. There's no reason for addremove to care about clean files anyway- we don't want them deleted.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 28 Nov 2014 19:50:52 -0500
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))