2018-03-15 21:00:26 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [ui]
|
|
|
|
> ssh = $PYTHON "$TESTDIR/dummyssh"
|
|
|
|
> [extensions]
|
|
|
|
> clienttelemetry=
|
2018-04-13 18:25:44 +03:00
|
|
|
> [clienttelemetry]
|
|
|
|
> announceremotehostname=true
|
2018-03-15 21:00:26 +03:00
|
|
|
> EOF
|
|
|
|
|
|
|
|
set up the server repo
|
|
|
|
$ hg init server
|
|
|
|
$ cat >> server/.hg/hgrc << EOF
|
|
|
|
> [extensions]
|
|
|
|
> sampling=
|
|
|
|
> [sampling]
|
|
|
|
> filepath = $TESTTMP/sampling.txt
|
|
|
|
> key.clienttelemetry = client
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
set up the local repo
|
|
|
|
$ hg clone 'ssh://user@dummy/server' local -q
|
|
|
|
$ cd local
|
|
|
|
$ hg pull
|
|
|
|
pulling from ssh://user@dummy/server
|
|
|
|
connected to * (glob)
|
|
|
|
no changes found
|
2018-04-13 18:25:44 +03:00
|
|
|
$ hg pull -q
|
2018-03-15 21:00:26 +03:00
|
|
|
$ hg pull --config clienttelemetry.announceremotehostname=False
|
|
|
|
pulling from ssh://user@dummy/server
|
|
|
|
no changes found
|
|
|
|
|
|
|
|
check telemetry
|
|
|
|
>>> import json
|
|
|
|
>>> with open("$TESTTMP/sampling.txt") as f:
|
|
|
|
... data = f.read()
|
|
|
|
>>> for record in data.strip("\0").split("\0"):
|
|
|
|
... parsedrecord = json.loads(record)
|
|
|
|
... for key in "command", "fullcommand":
|
|
|
|
... print("%s: %s" % (key, parsedrecord["data"]["client_%s" % key]))
|
|
|
|
command: clone
|
2018-04-03 14:14:26 +03:00
|
|
|
fullcommand: clone 'ssh://user@dummy/server' local -q
|
2018-03-15 21:00:26 +03:00
|
|
|
command: pull
|
|
|
|
fullcommand: pull
|
|
|
|
command: pull
|
2018-04-13 18:25:44 +03:00
|
|
|
fullcommand: pull -q
|
|
|
|
command: pull
|
2018-04-03 14:14:26 +03:00
|
|
|
fullcommand: pull --config 'clienttelemetry.announceremotehostname=False'
|
2018-03-15 21:00:26 +03:00
|
|
|
|