Commit Graph

952 Commits

Author SHA1 Message Date
Jun Wu
09c28abd20 graft: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201937

fbshipit-source-id: bad22b741410ef990a709f77de5f843de7c3b5dc
2020-10-08 22:33:08 -07:00
Jun Wu
ec02fad2c6 bisect: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201938

fbshipit-source-id: a6443465feac1ba43962e44a679091f655b24d16
2020-10-08 22:33:08 -07:00
Jun Wu
b01b79cf76 backout: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201935

fbshipit-source-id: e1f4a9c9c82f401cc5b5ed9df464a58da64a0b65
2020-10-08 22:33:07 -07:00
Jun Wu
16aa4415c3 template: remove revnum from children template
Reviewed By: singhsrb

Differential Revision: D24201939

fbshipit-source-id: 573da6fbb1577b5e25566d238dccca33235494cd
2020-10-08 22:33:07 -07:00
Jun Wu
aed62002d1 commit: remove revnum from commitstatus
Summary: Do not show revnum or "changeset" after commit (with --debug or --vrebose).

Reviewed By: singhsrb

Differential Revision: D24201942

fbshipit-source-id: 2f0d15711df67070e50d4bf30f0b1b4401d85524
2020-10-08 22:33:07 -07:00
Jun Wu
f5988c415c tests: enable segmented changelog for supported tests
Summary: Enable segmented changelog for ~400 tests. They pass without changes.

Reviewed By: singhsrb

Differential Revision: D24201934

fbshipit-source-id: 7972c5548fd8b6b6f49b6bb837433d72a6f6cbd9
2020-10-08 22:33:07 -07:00
Jun Wu
140456fc29 bookmarks: remove revnum from non-plain bookmark output
Summary:
Remove revnum from `hg bookmarks` output.
`HGPLAIN=1` output is not changed for compatibility.

Reviewed By: singhsrb

Differential Revision: D24191788

fbshipit-source-id: 3a873b7baba8f1dfe7b3ec690688313ca1134032
2020-10-08 22:33:07 -07:00
Jun Wu
88a6d88b90 tests: remove revnum from aliases
Summary: Remove revnum from `showgraph`, `tglog*` aliases.

Reviewed By: singhsrb

Differential Revision: D24191791

fbshipit-source-id: f60c00289a0c6d06101f1c8645fc9d6e0f0c941e
2020-10-08 20:31:41 -07:00
Stefan Filip
794ea888d7 tests: fix test-casecollision-merge.t
Summary:
A previous change updated all tests to remove the use of rev numbers. The
update to the list of results missed this tests case.

Reviewed By: quark-zju

Differential Revision: D24208236

fbshipit-source-id: 289136f31e66eb74b106d7ea9401419fc369d59f
2020-10-08 17:44:13 -07:00
Jun Wu
83c996cf95 amend: remove revnum from UX
Summary: Change fold and metaedit to not show revnum in editor message.

Reviewed By: kulshrax

Differential Revision: D24191787

fbshipit-source-id: 140ec58c8eb00c067c6e40e1a18187f7801246e9
2020-10-08 13:22:10 -07:00
Jun Wu
026bd9f950 tests: avoid some rev numbers in revsets
Summary: Done by the fix-revnum.py script.

Reviewed By: singhsrb

Differential Revision: D24173575

fbshipit-source-id: e4cf417be759f9898adfd4102984098474ab38a2
2020-10-08 11:08:37 -07:00
Jun Wu
1ce0eea5dc tests: remove some uses of rev numbers in templates
Summary: Done by `sed`.

Reviewed By: singhsrb

Differential Revision: D24173576

fbshipit-source-id: f1d042b3da7f9b64e0e40b19317364e5cb9ae946
2020-10-07 21:22:58 -07:00
Jun Wu
8560a275b2 autopull: do not pull existing commits
Summary: This seems to only affect `diff --since-last-submit`.

Reviewed By: DurhamG

Differential Revision: D24069463

fbshipit-source-id: 8f311834073505310b37371fc07c6c3c4074ccc5
2020-10-06 14:32:16 -07:00
Jun Wu
ecc8e7187a merge: add a config to specify merge tool in interactive mode
Summary:
Add a way to specify different merge tools for interactive and non-interactive
mode.

This will be used for the default `editmerge` merge tool, which pops up the
`EDITOR` (vim) regardless of interactive mode, causing various user complains
and hangs, including `arc pull` running rebase triggering editor, or VS Code
running rebase triggering editor, and some other rebase hangs or vim errors.

Reviewed By: DurhamG

Differential Revision: D24069105

fbshipit-source-id: ec16fdc704cab6daeedb0c23d4028b4309d96d3f
2020-10-06 14:32:16 -07:00
Xavier Deguillard
b693a4aaba tests: fix test-check-code.t
Summary:
A couple of files were moved but test-check-code.t wasn't updated to reflect
this, causing it to fail.

Reviewed By: DurhamG

Differential Revision: D24113079

fbshipit-source-id: 9a0c0b6f07a6532715bf5ee401036ded0a05b16a
2020-10-05 09:08:37 -07:00
Lukas Piatkowski
9c54ea5f22 mononoke/integration tests: use $LOCALIP instead of ::1 or 127.0.0.1 (#65)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/65

Using $LOCALIP will ensure more consistent behavior when setting up the server in ipv4 or ipv6.
The LOCALIP variable was also abused when it was used to override ssh client address, so SSH_IP_OVEERIDE env was created here.
Lastly the result of `curl` call is now printed whenever the test failed to verify that Mononoke is running.

Reviewed By: farnz

Differential Revision: D24108186

fbshipit-source-id: e4b68dd2c5dd368851f0b00064088ffc442e31e0
2020-10-05 07:51:19 -07:00
John Reese
f42333f17c Apply pyfmt to fbcode/eden
Summary:
Formats a subset of opted-in Python files in fbsource.
Black formatting was applied first, which is guaranteed
safe as the AST will not have changed during formatting.
Pyfmt was then run, which also includes import sorting.
The changes from isort were manually reviewed, and
some potentially dangerous changes were reverted,
and the  directive was added to those
files. A final run of pyfmt shows no more changes to
be applied.

Reviewed By: zertosh

Differential Revision: D24101830

fbshipit-source-id: 0f2616873117a821dbc6cfb6d8e4f64f4420312b
2020-10-04 04:51:00 -07:00
Durham Goode
ddf3eeb94a treemanifest: fix fetching trees with Rust store
Summary:
The bfs fetching path in Rust was broken because it directly called
getdesignatednodes. getdesignatednodes returns False if it wasn't able to
succeed, so we need to be able to fall back in that case. The _prefetchtrees
function is meant for that, so let's just call that.

Reviewed By: singhsrb

Differential Revision: D24090946

fbshipit-source-id: d16c2c8f80f690a22046385f0e95785996a62949
2020-10-02 18:51:11 -07:00
Xavier Deguillard
0967eafcba build: remove portability headers
Summary: These aren't included anywhere, we can remove them.

Reviewed By: DurhamG

Differential Revision: D24062627

fbshipit-source-id: 9ff101eb44965ac3502ada3265ffcc8acc09d2e5
2020-10-02 10:47:24 -07:00
Xavier Deguillard
8cc2738aec clib: remove buffer.[ch]
Summary: These are unused, no need to keep the code around.

Reviewed By: DurhamG

Differential Revision: D24055085

fbshipit-source-id: 6246d746983a575c051ddcb51ae02582a764a814
2020-10-02 10:47:23 -07:00
Xavier Deguillard
a4e27d898d lib: remove portability/dirent.h
Summary: This is unused.

Reviewed By: DurhamG

Differential Revision: D24055083

fbshipit-source-id: bc6bbcf765ccb8c277e4a06e9fc3f033cd01733a
2020-10-02 10:47:23 -07:00
Xavier Deguillard
30ef9bdcf1 extlib: remove large parts of cstore/ctreemanifest
Summary:
This code is effectively unused. The only bit still relevant is that EdenFS
still depends on the Manifest class to parse a manifest.

Reviewed By: DurhamG

Differential Revision: D24037723

fbshipit-source-id: 901ae2ffc8960a95ec655a2e14d79afb8d32dcab
2020-10-02 10:47:22 -07:00
Xavier Deguillard
c16ab69c6a build: remove //eden/scm:cstore
Summary: This is unused, let's remove it.

Reviewed By: DurhamG

Differential Revision: D24037722

fbshipit-source-id: bc8a272809cb1f20f54d651a39ee42ff57169534
2020-10-02 10:47:22 -07:00
Durham Goode
42b3a1b6bc py3: support outputing bytes via templater
Summary:
The 'diff()' template needs to be able to output non-utf8 patches.
To enable this, let's change the templater to output bytes instead of strings.

Note, the templater supports json output, which requires utf8 encoded values. In
that situation we escape any non-utf8 binary and clients would have to be aware
and unescape them.

Reviewed By: quark-zju

Differential Revision: D24029105

fbshipit-source-id: aa011696c0d97281b91c6871c116037d76c178e0
2020-10-02 07:27:08 -07:00
Durham Goode
c90936941f schemes: remove schemes extension
Summary:
This is unused code. It broke a test while I was doing python 3 work,
so let's just delete this.

Reviewed By: quark-zju

Differential Revision: D24063953

fbshipit-source-id: 323b323ff2b9717c9c16eed54adac467a321e2ae
2020-10-02 07:27:08 -07:00
Jun Wu
5048a060d6 localrepo: log changelog backend types
Summary: Log changelog backend types so we can filter commands by type.

Reviewed By: DurhamG

Differential Revision: D24022284

fbshipit-source-id: c402aea0ce3bd20d0f310fea167f24cb1b7a3ae6
2020-09-30 16:21:42 -07:00
Arun Kulshreshtha
2016586fe2 pyprogress: add Python bindings for Rust progress crate
Summary: Add Python bindings to the Rust progress wrappers. This may seem pointless since the Rust code just calls right back into Python, but this is a useful step to get the Rust and Python code to use a common interface for progress. (Which, in turn, will allow switching to a Rust progress implementation down the line.)

Reviewed By: markbt

Differential Revision: D23999816

fbshipit-source-id: 9bca0f23170d3ca474a1cb5d547840e63572ec71
2020-09-30 13:01:15 -07:00
Arun Kulshreshtha
8e94a59c67 hghave: update description of py2 feature
Summary: Description erroneously refers to Python 3.X.

Reviewed By: quark-zju

Differential Revision: D24009652

fbshipit-source-id: be6c90514e68dc12f0b8f6b63e58f98f786558e8
2020-09-29 21:46:02 -07:00
Jun Wu
8dc618b1cd runtests: set tracing level before running tests
Summary:
With the new tracing-core (0.1.10 ->  0.1.16), it's no longer effective
to set EDENSCM_TRACE_LEVEL to more verbose within the test.
Let's set it in run-tests.py which spawns the test process instead.

Reviewed By: kulshrax

Differential Revision: D24004327

fbshipit-source-id: db2cadc7334eb59b25a1e0517e3d1a513e31e0fe
2020-09-29 21:19:20 -07:00
Durham Goode
eb5acf9222 tests: disable flakey tests
Summary:
These tests rely on sleep to simulate race conditions. They are the
largest source of hgbuild breakages. Let's just disable them. Most of this code
is going away in a couple months anyway when Mononoke takes over and revlogs go
away.

Also fixes a failure in test-bookmarks-strip.t that showed up.

Reviewed By: singhsrb

Differential Revision: D23922660

fbshipit-source-id: 35cacc19de03c031c84c1ebf2124884f4b4248e6
2020-09-24 21:32:23 -07:00
Xavier Deguillard
dc19397ccc doctor: use the right indexedlog config
Summary:
The remotefilelog.indexedlog{data,history}store configs are no longer in use,
so we shouldn't use them as a way to test whether the indexedlog are present.

Reviewed By: quark-zju

Differential Revision: D23918133

fbshipit-source-id: 902a369f5e1774b8e2fa1e4b3280fbb7cc377775
2020-09-24 16:58:36 -07:00
Durham Goode
eb5ac5b0fc tests: remove flakey test
Summary:
This test relies on precise timing of racing processes. This is flakey
in our automated tests. Since this is mainly about revlog based repos, and we
only have that on the servers now, and we're going to delete them soon, let's
delete this test to make our tests more stable.

Reviewed By: kulshrax

Differential Revision: D23908316

fbshipit-source-id: 3fd110a8267d3bc16bbcb4545b9ff921274f7588
2020-09-24 11:10:07 -07:00
Durham Goode
3fa03cf52c treemanifest: stop passing around linkrevs during recent tree discovery
Summary: Linkrevs are on their way out. Let's switch to linknodes.

Reviewed By: quark-zju

Differential Revision: D23765176

fbshipit-source-id: 0dc1e0db11d732ce1edd24d863f32f08a5a5ce42
2020-09-24 09:47:00 -07:00
Durham Goode
490468403b treemanifest: fix bundle usage with Rust contentstore
Summary:
The rust contentstore doesn't allow runtime manipulation of the list of
stores, which is required in order to insert the bundle store into the store.
Let's continue using the old python union store in these cases. This still let's
us delete the python pack code later, but we'll have to keep around the python
union store until we come up with a better solution.

Reviewed By: quark-zju

Differential Revision: D23689630

fbshipit-source-id: 0c60e6f268e81804149afa24409f64b5303e1e34
2020-09-24 09:46:59 -07: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
58667a3fe7 tests: fix test-commitcloud-sync.t and test-common-commands-fb.t
Summary:
test-commitcloud-sync.t is a new change and just needs to be made cross
platform.

I have no idea how test-common-commands-fb.t ever worked.  When HGRCPATH is set,
I expect the system hgrc to not be loaded, and therefore we can't run hg-clone.
Let's just unset it, since this is meant to test if the new Mercurial can
execute a clone. Ideally we'd redirect the system hgrc to the in-repo
staticfiles, but that's more effort.

Reviewed By: singhsrb

Differential Revision: D23869645

fbshipit-source-id: 66669d9fd9c3a23b01bc43b365723185b7b2ed33
2020-09-23 10:58:19 -07:00
Liubov Dmitrieva
c5328d9d0e move some operations under read path
Summary:
Move some commit cloud operations under infinitepush read path:

those are:
*  `hg cloud check` command
*  `hg cloud sync` command when the local repo is clean
* `hg cloud switch` command will normally use the read path for the dest workspace because we clean up the repo before performing the switch
*  `hg cloud rejoin` command we use in fbclone will normally go through the read path as it runs in a fresh repo

If something is broken, there is always a way to rerun any of these command with '--dest' flag pointing it to the write path.

```
./hg cloud check -r 0c9596fd1 --remote --dest infinitepush-write
./hg cloud sync --dest infinitepush-write
./hg cloud switch -w other --dest infinitepush-write
```

Those use cases are limited and the lag of forward filler shouldn't be noticeable for them but we will be able to collect more signal how Mononoke performs with Commit Cloud.

Sitevar to control the routing of read traffic:
https://www.internalfb.com/intern/sv/HG_SSH_WRAPPER_MONONOKE_ROLLOUT/#revisions_list

Reviewed By: mitrandir77

Differential Revision: D23840914

fbshipit-source-id: 40fbe2e72756e7a4cf8bc5be6a0b94f6cf4906b4
2020-09-23 08:42:13 -07:00
Jun Wu
27f4f7e94c test-commitcloud-sync: fix test on Ubuntu
Summary:
On Ubuntu the output is a bit different:

```
   $ hg cloud sync --use-bgssh
   commitcloud: synchronizing 'server' with 'user/test/default'
-  remote: /bin/sh: trashssh: command not found
-  abort: no suitable response from remote hg!
+  remote: /bin/sh: 1: trashssh: not found
+  abort: no suitable response from remote hg: '[Errno 32] Broken pipe'!
```

Glob them out to make the test pass.

Reviewed By: DurhamG

Differential Revision: D23824735

fbshipit-source-id: 7f96149ee16daff31fd0a1c68975b5edfa27cc46
2020-09-22 15:21:56 -07:00
Jun Wu
bcbacfebf4 dispatch: ensure SIGINT triggers KeyboardInterrupt
Summary:
It seems OSX python2 has SIGINT handler set to SIG_IGN by default when running
inside tests. Detect that and reset SIGINT handler to raise KeyboardInterrupt.

This fixes test-ctrl-c.t on OSX.

As we're here, improve test-ctrl-c.t so it checks a bit more things and run
quicker.

Reviewed By: DurhamG

Differential Revision: D23853455

fbshipit-source-id: 05c47650bc80f9880f724828d307c32786265e2c
2020-09-22 15:10:12 -07:00
Liubov Dmitrieva
c68e928d6f add --fource option to hg cloud backup command to reinitialise the local cache of backed up heads from the server
Summary:
This provides a way to fix the local cache of backed up heads if it is in an
invalid state.

The most important, it will allow early dogfooding of write traffic from Mononoke
without the reverse filler in place for developers or for the team.

You could just run `hg cloud backup -f` assuming the repo is backfilled to fix
any inconsistency when switch between the two backends

Reviewed By: markbt

Differential Revision: D23840162

fbshipit-source-id: bbd331162d65ba193c4774e37324f15ed0635f82
2020-09-22 07:12:28 -07:00
Durham Goode
737c07ca24 tests: fix test-fb-hgext-extutil.py on OSX
Summary:
D23759711 (be51116cf4) changed the way signal handlers work, which apparently causes
this test to fail. The SIGCHLD signal of the child changing state is received
during os.waitpid, which apparently counts as a signal during a system call,
which throws an OSError.

I'm not sure what the real fix should be. Sleeping gets us past the issue, since
presumably the signal is handled before the system call.

Reviewed By: quark-zju

Differential Revision: D23832606

fbshipit-source-id: 70fca19e419da55bbf546b8530406c9b3a9a6d77
2020-09-22 03:37:28 -07:00
Liubov Dmitrieva
584de33443 fix workspace name for fbclone
Summary:
Automigration gets messed up with `hg cloud rejoin` command in fbclone code because it triggered by the pull command.

As a result fbclone ends up to join a hostname workspace instead of the default for some cases.

* make sure that the migration never runs if background commit cloud operations are disabled
* also, add skip the migration in the pull command in fbclone

Once of those would be enough to fix the issue but I prefer to make both
changes.

Reviewed By: markbt

Differential Revision: D23813184

fbshipit-source-id: 3b49a3f079e889634e3c4f98b51557ca0679090b
2020-09-21 05:09:40 -07:00
Jun Wu
34d8dca79a dispatch: run command in non-main thread
Summary:
This extends the Ctrl+C special handling from edenapi to the entire Python
command so Ctrl+C should be able to exit the program even if it's running
some blocking Rust functions.

`edenapi` no longer needs to spawn threads for fetching.

Reviewed By: singhsrb

Differential Revision: D23759710

fbshipit-source-id: cbaaa8e5f93d8d74a8692117a00d9de20646d232
2020-09-18 18:47:24 -07:00
Liubov Dmitrieva
01615ae4de improve scm daemon checks and check workspace name as well
Summary:
Move bunch of code into a separate file (scm daemon related options). Move them
out of cloud sync.

Also introduce additional check that the `hg cloud sync` command scm daemon
runs is intended for the current connected workspace

In theory when we switch a subscription, the SCM daemon gets notified but races possible and it is better to have this additional check, so SCM daemon triggers cloud sync where it is supposed to.

Reviewed By: markbt

Differential Revision: D23783616

fbshipit-source-id: b91a8b79189b7810538c15f8e61080b41abde386
2020-09-18 14:01:11 -07:00
Jun Wu
664fa0b8ec config: remove experimental.head-based-commit-transaction
Summary:
The config is not actually used any more (with rust-commits, it is forced on, without rust-commits,
there is no point to keep it on). Therefore removed.

Reviewed By: singhsrb

Differential Revision: D23771570

fbshipit-source-id: ad3e89619ac5e193ef552c25fc064ca9eddba0c6
2020-09-18 13:28:34 -07:00
Jun Wu
80bf264e24 debugshell: add "api" object
Summary: It is handy to test edenapi methods directly.

Reviewed By: kulshrax

Differential Revision: D23750709

fbshipit-source-id: 33c15cecaa0372ba9e4688502e7d8f3fdda7c3b8
2020-09-18 13:28:33 -07:00
Jun Wu
478e1fe524 commands: add debugrebuildchangelog
Summary:
Add a command to rebuild the changelog without recloning other parts of the
repo. This can be used as a way to recover from corrupted changelog. It
currently uses revlog because revlog is still the only supported format during
streamclone.

In the future this can be used for defragmentation.

Reviewed By: DurhamG

Differential Revision: D23720215

fbshipit-source-id: 6db0453d18dbf553660d55d528f990a4029d9da4
2020-09-18 13:28:33 -07:00
Liubov Dmitrieva
d94f354708 implement a command to reclaim workspaces
Summary: The command will be provided as hint if username changes has been detected in configuration.

Reviewed By: markbt

Differential Revision: D23769942

fbshipit-source-id: 3e84ecef6dd68267022b92bf10f5e68dfc07f270
2020-09-18 04:18:11 -07:00
Liubov Dmitrieva
57e4688aa4 introduce commands for renaming workspaces and rehost workspace
Summary:
`hg cloud join --merge` doesn't really solve rename problem because it doesn't
preserve:

1. old heads
2. history

I added a proper API in Commit Cloud Service for renaming workspaces and now we
can use it to provide a rename command and 'rehost' command which is a version
of renaming to bind the current workspace to the current devserver.
Rehost command is meant to be used after dev server migration. I am plannig to
add this to the dev server migration wiki.

Next diff will cover how we can use the rename command to fix a username in workspaces names after username has been changed.

Reviewed By: markbt

Differential Revision: D23757722

fbshipit-source-id: dc11cb226eb76d347cdab70b3c72566448dcd098
2020-09-17 17:45:05 -07:00
Durham Goode
7c8f9167e1 tests: avoid turning $TESTTMP into a repo
Summary:
Some tests run `hg init` right inside the test directory, turning the
entire $TESTTMP into a repo. In future diffs we'll start to rely more on hgcache
being present during tests, which creates a directory in $TESTTMP. Let's make
sure all repos are created as sub-directories of $TESTTMP.

Reviewed By: kulshrax

Differential Revision: D23662077

fbshipit-source-id: 2b2b974ebfd1bd19ad6acd1ebe3e68dd03a09869
2020-09-17 10:16:03 -07:00