sapling/eden/scm/tests/test-scmstore-activitylog.t
Jun Wu 1d676720f3 tests: fix windows compatibility
Summary:
Fix common issues running tests on Windows:
- Deletion problem: On Windows files being mmapped cannot be directly deleted.
  In-process hg + object leak can prevent `rm -rf`. Change related code to not
  delete things, or actually release things like the blackbox.
- Path quoting: Use double quote for paths. Also accept different forms of
  `$TESTTMP`.
- EOL changes: Use `dos2unix` or change related script to not output `\r`.
- `getpass.getuser()` imports `pwd` which does not exist: Fix by avoiding
  `getpass`.

`test-update-unknown-files.t` probably requires further investigation.
It tries `hg add B` where B is untracked and b is marked as removed
(`? B` `R b`). It seems there are multiple layers (matcher, pendingchanges)
that casefold normalize B to b, causing the case collision test to
use `b` instead of `B` and report no collision. It was worked around
by disabling in-process-hg. But related logic might require further
thinking (for example, it does not seem that the pattern matcher
should do a "pat in dirstate" check).

Differential Revision: D38853387

fbshipit-source-id: 40c83bedc04fd6ee2c6ff67edc4d767d191ffc6b
2022-08-19 08:42:02 -07:00

24 lines
994 B
Perl

#chg-compatible
#debugruntest-compatible
$ newserver server
$ newremoterepo
$ setconfig scmstore.enableshim=True
$ echo c > f
$ hg ci -A -m 0 -q
$ hg cat f --config scmstore.activitylog=log
c
(Fetches twice for some reason)
$ cat log
{"op":"FileFetch","keys":[{"path":"f","node":*}],"attrs":{"content":true,"aux_data":false},"start_millis":*,"duration_millis":*} (glob)
{"op":"FileFetch","keys":[{"path":"f","node":*}],"attrs":{"content":true,"aux_data":false},"start_millis":*,"duration_millis":*} (glob)
Use activity log to verify that replay triggers fetches
$ hg debugscmstorereplay --path log --config scmstore.activitylog=log2
Fetched 2 keys across 2 fetches in * (glob)
$ cat log2
{"op":"FileFetch","keys":[{"path":"f","node":*}],"attrs":{"content":true,"aux_data":false},"start_millis":*,"duration_millis":*} (glob)
{"op":"FileFetch","keys":[{"path":"f","node":*}],"attrs":{"content":true,"aux_data":false},"start_millis":*,"duration_millis":*} (glob)