Commit Graph

18 Commits

Author SHA1 Message Date
Jun Wu
62ba7447f6 ui: switch to Rust IO for default fout, ferr
Summary:
The Rust IO handles progress and streampager stuff. Switch to it so we don't
need to changing the `fout`, `ferr` when handling streampager in Python.

The chgserver logic is updated to just set raw fd 0, 1, 2 to update stdio,
since `fileno` is no longer exposed from Rust.

Manually tested the following commands, both without chg and with chg:
- lhg log -r . (no pager)
- lhg log (with streampager)
- lhg log --config pager.pager=less (with less pager)
- lhg commit (spawns pager)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=off (progress in stderr)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=on --config pager.interface=fullscreen (progress in streampager)
- lhg debugprogress -s 100 --sleep 100 --with-output --pager=on --config pager.pager='LESS= less' (progress is disabled with external pager)

Reviewed By: sfilipco

Differential Revision: D26612487

fbshipit-source-id: 8b4e36b614a0c080b93e41474f9a8fc33f890083
2021-02-23 22:33:48 -08:00
Durham Goode
c80cdf1f49 treemanifest: enable treemanifest.useruststore=True for most tests
Summary:
The remaining test failures are mostly around bundle support, which
I'll fix in a later diff.

Reviewed By: quark-zju

Differential Revision: D23664037

fbshipit-source-id: 2bdde3cb4fcded6e0cf3afdc23269662544821df
2020-09-24 09:46:59 -07:00
Durham Goode
57b422b49a py3: fix hg when there's no stdin
Summary:
Some tools, like ShipIt, close stdin before they launch the subprocess.
This causes sys.stdin to be None, which breaks our pycompat buffer read. Let's
handle that.

Reviewed By: quark-zju

Differential Revision: D23734233

fbshipit-source-id: 0adc23cd5a8040716321f6ede0157bc8362d56e0
2020-09-16 19:41:04 -07:00
Jun Wu
89eb6520d2 scmutil: remove meaningfulparents
Summary:
The "meaningfulparents" concept is coupled with rev numbers.
Remove it. This changes default templates to not show parents, and `{parents}`
template to show parents.

Reviewed By: DurhamG

Differential Revision: D23408970

fbshipit-source-id: f1a8060122ee6655d9f64147b35a321af839266e
2020-09-05 15:06:44 -07:00
Durham Goode
2f5130c882 py3: fix extdiff
Summary:
extdiff uses shutil.rmtree which calls os.rmdir with new python 3
options. Since we pathc os.rmdir, we need to support those options.

Reviewed By: quark-zju

Differential Revision: D23350968

fbshipit-source-id: 081d179dcd67b51ffdeb6b85899adf4e574a8d0f
2020-08-27 19:15:22 -07:00
Jun Wu
99d2054889 changelog: initial support for segmented changelog
Summary:
Add a way to actually try out segmented changelog by setting
`format.use-segmented-changelog`.

The main compatibility issues are assumptions that `0 .. len(repo)` are valid
revision numbers. Segmented changelog uses 2 spans `0 .. len(master_group)`
and `<a large 64-bit int> ..` for the non-master group. Some assumptions
about `len(repo)` were removed.

Segmented changelog also does not support linkrevs since revs can be
re-assigned. Some logic (ex. in treemanifest) that relies on linkrev being
`len(repo)` is changed.

There might be other issues, which will be fixed once we discover them.

Reviewed By: sfilipco

Differential Revision: D22657187

fbshipit-source-id: 688ad718741de0ca15e6aeaf84aced24a20c6b09
2020-08-04 09:59:11 -07:00
Jun Wu
7c87f1259a tests: stop enabling zstore-commit-data
Summary:
The zstore-commit-data code paths are in Python. We want to move them to behind
the Rust HgCommits abstractions. So stop making Python interact with the
low-level details.

Reviewed By: DurhamG

Differential Revision: D22638457

fbshipit-source-id: 435db8425a29ce4eae24a6202ad928f85a5f5ee2
2020-07-30 20:32:33 -07:00
Jun Wu
0562c1220f tests: enable template-new-builtin
Summary: This makes tests depend less on revision numbers.

Reviewed By: DurhamG

Differential Revision: D22468669

fbshipit-source-id: 74a06930faa3e6ee9d246ecc718c2a3740f57a54
2020-07-20 17:27:53 -07:00
Jun Wu
5344951764 tests: turn on mutation, disable obsstore for tests
Summary:
Incompatible tests are blacklisted.

The affects non-tests environment: `proxy-obsstore` is turned on.
That is in theory not very different from having an empty obsstore.
If it becomes an issue we can easily turn it off.

Reviewed By: sfilipco

Differential Revision: D21899139

fbshipit-source-id: e4a87ecced0542e7852b48b1a807775e523b3cc9
2020-06-10 19:30:01 -07:00
Durham Goode
9473b487b5 tests: enable treemanifest for ~100 more tests
Summary:
Enables treemanifest for about 100 more tests. To make them pass I had
to expose the gettreepack capability from peers, which just works, and enable
treeonly and sendtrees by default in the tests, which I probably should've done
before anyway.

Reviewed By: quark-zju

Differential Revision: D21894955

fbshipit-source-id: 7a6a4d453824fb8c81a797a5487bf2ecc2b67761
2020-06-10 19:29:48 -07:00
Durham Goode
df37fef5b3 py3: fix test-basics.t
Summary: Simple fix to output bytes

Reviewed By: xavierd

Differential Revision: D20921348

fbshipit-source-id: befa8abab0a7943fd2d20614dcacf3ef25f1e9ba
2020-04-09 09:23:53 -07:00
Durham Goode
ceca615943 workingcopy: enable rust walker by default in tests
Summary: Let's enable it for tests. We'll slow roll it in production.

Reviewed By: quark-zju

Differential Revision: D19543790

fbshipit-source-id: be7d18dd8ffe51615a27c39ebf4247ec405b4097
2020-03-17 10:39:15 -07:00
Zeyi (Rice) Fan
92f6f35e7a mark all tests requiring Python 2
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.

After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.

To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:

```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```

or

```
HGTEST_FORCE_PY2=1 python run-tests.py
```

----

Basically this diff are created with the following commands:

```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```

(Note: this ignores all push blocking failures!)

ignore-conflict-markers

Reviewed By: singhsrb

Differential Revision: D19655148

fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
2020-01-30 18:49:21 -08:00
Mark Thomas
b654a9aae5 tests: use disable treemanifest in place of setconfig
Summary: Use `disable treemanifest` in place of `setconfig extensions.treemanifest=!`

Reviewed By: quark-zju

Differential Revision: D19457678

fbshipit-source-id: 47c8b3c4f4ed5cfc97275ca67afab4a86ffe7f0d
2020-01-20 02:45:15 -08:00
Jun Wu
9f02e24674 run-tests: turn on format.use-zstore-commit-data
Summary:
This applies the new feature to all tests.

The tests do not use revlog fallback but we plan to use revlog fallback
in production for faster migration.

Reviewed By: DurhamG

Differential Revision: D18737259

fbshipit-source-id: 69633c7b2026fb3d19ca16d40368bded972efd86
2020-01-13 10:06:10 -08:00
Durham Goode
218c83d574 tags: remove tip tag
Summary:
In a future diff we'll be removing tags. The most prevalent tag is
'tip', which shows up in a ton of test output. Let's drop that tag first, so we
can safely update the tests before we drop tags entirely.

Reviewed By: xavierd

Differential Revision: D18995058

fbshipit-source-id: 8c63710cd4ed567ea24e32724b8660f9006a61f1
2019-12-20 16:14:19 -08:00
Jun Wu
75a8173a10 tests: enable chg for 572 tests
Summary:
Add `#chg-compatible` to 572 tests that seem to pass with chg enabled.
This should make them run faster.

Reviewed By: xavierd

Differential Revision: D18870507

fbshipit-source-id: fe895e733efffc9286cd3d17c7a156c803124395
2019-12-09 15:26:29 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00