Commit Graph

33 Commits

Author SHA1 Message Date
Jan Mazur
8c3c531f2c connect directly to mononoke - remove hgcli
Summary:
I'm:

* adjusting some leftover tests in `fbcode/eden/scm/tests` to speak to mononoke directly
* deleting hgcli from dependencies in `fbcode/eden/mononoke/tests/integration`
* deleting hgcli from dependencies in `fbcode/eden/scm/tests`
* deleting some tests from `fbcode/eden/hg-server/tests`
* removing hgcli usage form scripts like `library.sh` `dummyssh` and `unittestify.pt`

I'm leaving (for now):
* hgcli code and buck rule
* mononoke hgcli codepath

```
➜  tests pwd
/home/mzr/fbcode/eden/scm/tests
➜  tests grep -Ri hgcli
➜  tests cd ~/fbcode/eden/mononoke/tests/integration
➜  integration grep -Ri hgcli | wc
      0       0       0
```

Reviewed By: HarveyHunt

Differential Revision: D33765124

fbshipit-source-id: 46798452f74d59c873449fc6b00445c9558d3ae1
2022-01-28 01:21:32 -08:00
Jun Wu
2a99866d7b codemod: update license headers
Summary:
The "Portions" license cannot be updated automatically. So this is a manual
update using:

  sd -s 'Portions Copyright (c) Facebook, Inc. and its affiliates.' 'Portions Copyright (c) Meta Platforms, Inc. and affiliates.' `rg -l Facebook`
  sd -s 'Copyright (c) Facebook, Inc. and its affiliates.' 'Copyright (c) Meta Platforms, Inc. and affiliates.' `rg -l Facebook`

Differential Revision: D33420114

fbshipit-source-id: 49ae00a7b62e3b8cc6c5dd839b3c104a75e72a56
2022-01-05 14:43:32 -08:00
Yan Soares Couto
4f81b8c165 edenapi: Update mutations on http pull
Summary: This starts using the mutation endpoint I added in previous diffs when doing an edenapi pull, ultimately finishing T102565437.

Reviewed By: StanislavGlebik

Differential Revision: D32175809

fbshipit-source-id: 6cf6c268639cda7f9ee61492deebe67aff3c1489
2021-12-03 11:56:05 -08:00
Jun Wu
deea1aaa91 drawdag: make behavior consistent with obsstore and mutationstore
Summary:
Previously, the `debugdrawdag` command adds bookmarks, then the bookmarks get
removed by the `drawdag` shell function in tests.

The implementation of bookmarks has a subtle difference depending on whether
mutation store is used:
- If mutation store is used, bookmarks are not written for hidden commits.
- If obsstore (legacy) is used, bookmarks are written for all commits.

Some tests rely on the legacy obsstore behavior. Let's make `debugdrawdag`
print all commits and be able to skip writing bookmarks so we can migrate
tests relying on the legacy obsstore.

Reviewed By: DurhamG

Differential Revision: D31877893

fbshipit-source-id: a191957da57e031fa763d654d3ba581b1642901b
2021-11-02 18:01:20 -07:00
Durham Goode
b4ea98b540 remotefilelog: fix repo requirements during clone
Summary:
There was a bug where updating during a clone operation would fail
because remotefilelog was not enabled for the newly cloned repository. We need
to add the remotefilelog requirement to the repo during creation, so the
remotefilelog reposetup function will execute on the repo.

Reviewed By: quark-zju

Differential Revision: D31623319

fbshipit-source-id: 20bce371d82eb4e7e1a715e2d21dcf6911d52067
2021-10-18 14:50:54 -07:00
Jun Wu
d7a5d9a2fc clone: use lazy changelog if server supports it
Summary:
Previously the `clone.force-edenapi-clonedata` config decides whether to use
segments clone. That can be error prone - it will be a crash if the server
doesn't have the segments index.

Change it so we ask about the segments index and automatically use the lazy
changelog clone.

`clone.force-edenapi-clonedata` will be no longer necessary.

Differential Revision: D31358367

fbshipit-source-id: 9fa639d0349d00938c89cc091ea793f20dd714c8
2021-10-12 14:24:29 -07:00
Durham Goode
15311d453d tests: add infra for swapping eager repo in for newserver/clone tests
Summary:
Previously newserver/clone supported ssh and mononoke. Now let's
support eagerrepo as well

Reviewed By: quark-zju

Differential Revision: D31032061

fbshipit-source-id: 5016bb74b317523611c645c040da92c8cbf897c1
2021-09-22 18:03:29 -07:00
Durham Goode
9cb03ed510 tests: add helpers to remove file clones/pulls
Summary:
We want to get rid of server logic in Mercurial, and to do so we want
to get rid of filepeer. To make porting legacy tests easier, let's create some
helper functions to simulate clones, pushes, and pulls.

Reviewed By: quark-zju

Differential Revision: D31004444

fbshipit-source-id: def6fc4fc3d43c313eb4f2a6b0adcba7ddb5e00f
2021-09-22 18:03:29 -07:00
Durham Goode
93844abc0f treemanifest: remove flatcompat feature
Summary: The tests no longer require it, so let's remove all the logic for it.

Reviewed By: quark-zju

Differential Revision: D29643267

fbshipit-source-id: 86b44e3b7b4a4eb19d7f89b54b40957a7648573a
2021-07-13 15:04:57 -07:00
Durham Goode
8fb6b52ac1 treemanifest: move test server logic to separate extension
Summary:
The treemanifest store and pull/push logic is overly complicated.
Untangling it is a bit tricky since it needs to support both server and client
use cases. Since we no longer care about the server code except for tests, let's
copy the treemanifest extension and use it for the server repo in tests.

A future diff will take advantage of this to delete all the server logic from
the main treemanifest extension.

Reviewed By: quark-zju

Differential Revision: D29115069

fbshipit-source-id: 8b7080aa6c7de77be058b34baad5e976cd7c1acf
2021-07-01 09:31:15 -07:00
Andrey Chursin
78f7bab434 tests: add newremoterepoto tinit.sh
Summary: Those shortcuts can be used to setup remote repo via single line

Reviewed By: quark-zju

Differential Revision: D26558187

fbshipit-source-id: c6fd48ed38cc4dbaad4db714c4dfd76ec26bf608
2021-02-20 01:29:10 -08:00
Liubov Dmitrieva
84280e36c3 remove accessed bookmarks feature
Summary:
Remove selectivepullaccessedbookmarks feature because it contains bugs and causes many undesired issues.

This was added to migrate existing repos to selective pull and is not needed anymore.

Main effects are:

* if you enable selectivepull for an existing repo, it won't reduce number of subscribed bookmarks.
* some operations like `hg push` or `hg pull -r` in their underlying implementation update all subscribed bookmarks, not just accessed like before.
This drives changes to the tests. Reminder, the bookmark has been marked as "accessed" if the repo has been ever updated to that bookmark.

All tests fixed accordingly.

Reviewed By: markbt

Differential Revision: D26460435

fbshipit-source-id: f839b9f207bfc478a0336ec807b720d35a0bb12e
2021-02-18 04:02:06 -08: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
Xavier Deguillard
ed4021b8e3 revisionstore: disallow reading LFS pointers from packfiles
Summary:
For repositories that have the old-style LFS extension enabled, the pointers
are stored in packfiles/indexedlog alongside with a flag that signify to the
upper layers that the blob is externally stored. With the new way of doing LFS,
pointers are stored separately.

When both are enabled, we are observing some interesting behavior where
different get and get_meta calls may return different blobs/metadata for the
same filenode. This may happen if a filenode is stored in both a packfile as an
LFS pointers, and in the LFS store. Guaranteeing that the revisionstore code is
deterministic in this situation is unfortunately way too costly (a get_meta
call would for instance have to fully validate the sha256 of the blob, and this
wouldn't guarantee that it wouldn't become corrupted on disk before calling
get).

The solution take here is to simply ignore all the lfs pointers from
packfiles/indexedlog when remotefilelog.lfs is enabled. This way, there is no
risk of reading the metadata from the packfiles, and the blob from the
LFSStore. This brings however another complication for the user created blobs:
these are stored in packfiles and would thus become unreadable, the solution is
to simply perform a one-time full repack of the local store to make sure that
all the pointers are moved from the packfiles to to LFSStore.

In the code, the Python bindings are using ExtStoredPolicy::Ignore directly as
these are only used in the treemanifest code where no LFS pointers should be
present, the repack code uses ExtStoredPolicy::Use to be able to read the
pointers, it wouldn't be able to otherwise.

Reviewed By: DurhamG

Differential Revision: D22951598

fbshipit-source-id: 0e929708ba5a3bb2a02c0891fd62dae1ccf18204
2020-09-09 18:27:42 -07:00
Mark Thomas
2117806dc7 tests: convert dummyssh and get_free_socket to python3
Summary: Convert dummyssh and get_free_socket to full python3 binaries.

Reviewed By: johansglock

Differential Revision: D23105490

fbshipit-source-id: 6c39c32ba0728cde108b42245acece1d7828ac7c
2020-08-17 02:42:14 -07:00
Liubov Dmitrieva
cc2b5c04ca imrove authentication handling
Summary:
There have been lots of issues with user experience related to authentication
and its help messages.

Just one of it:
certs are configured to be used for authentication and they are invalid but the `hg cloud auth`
command will provide help message about the certs but then ask to copy and
paste a token from the code about interactive token obtaining.

Another thing, is certs are configired to use, it was not hard to
set up a token for Scm Daemon that can be still on tokens even if cloud
sync uses certs.

Now it is possible with `hg auth -t <token>` command

Now it should be more cleaner and all the messages should be cleaner as well.

Also certs related help message has been improved.

Also all tests were cleaned up from the authentication except for the main
test. This is to simplify the tests.

Reviewed By: mitrandir77

Differential Revision: D22866731

fbshipit-source-id: 61dd4bffa6fcba39107be743fb155be0970c4266
2020-07-31 10:16:59 -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
Jun Wu
d90be19909 remotenames: disable old autopull if the new autopull is enabled
Summary:
The new auto pull logic can replace the one in remotenames. It it goes well, we
can then remove the code in remotenames doing the auto pull.

Reviewed By: sfilipco

Differential Revision: D20804853

fbshipit-source-id: c87b6b382f4cce3b306648b305a7b6bbaec05df1
2020-04-24 11:16:21 -07:00
Jun Wu
59f7c9532d tests: add more utilities to tinit.sh
Summary:
This makes writing tests easier.

It was part of D20504732.

Reviewed By: sfilipco

Differential Revision: D20829138

fbshipit-source-id: e9309e099a13d0a509eff707ae229bf8b7a9c231
2020-04-06 14:29:57 -07:00
Xavier Deguillard
a7e5557baa test: properly set ui.ssh
Summary:
On Windows, we have to do a bit of dance for Windows to stop complaining
about ui.ssh.

Reviewed By: DurhamG

Differential Revision: D20817712

fbshipit-source-id: acbda636fe114fd616dee89b2c4d1c9ff26470bf
2020-04-02 11:26:54 -07:00
Xavier Deguillard
eaf2f2e9f0 tinit: fix a typo in newserver
Summary: treemanifest was misspelled.

Reviewed By: quark-zju

Differential Revision: D20449488

fbshipit-source-id: 91a3e6533d177083af5c46c09ad09b1a51d8ece5
2020-03-13 17:36:50 -07:00
Jun Wu
ae8f6ff8e8 tests: opt-in DUMMYSSH_STABLE_ORDER for more tests
Summary: This should help reduce test flakiness.

Reviewed By: xavierd

Differential Revision: D19872952

fbshipit-source-id: d66f6c404534b3f47903b478e3cdfdda5ed46284
2020-02-27 17:54:08 -08:00
Lukasz Piatkowski
542d1f93d3 Manual synchronization of fbcode/eden and facebookexperimental/eden
Summary:
This commit manually synchronizes the internal move of
fbcode/scm/mononoke under fbcode/eden/mononoke which couldn't be
performed by ShipIt automatically.

Reviewed By: StanislavGlebik

Differential Revision: D19722832

fbshipit-source-id: 52fbc8bc42a8940b39872dfb8b00ce9c0f6b0800
2020-02-11 11:42:43 +01:00
Mark Thomas
d35692711e tests: convert test-rebase-obsolete to mutation
Summary:
Add `test-rebase-mutation.t`, based on `test-rebase-obsolete.t`, but instead
testing specifically for mutation and visibility behaviour.

Reviewed By: xavierd

Differential Revision: D19549473

fbshipit-source-id: c993686eab47985737eef17ab0f52f31d0929159
2020-01-24 14:47:39 -08:00
Mark Thomas
b361a8d1bd tests: update tests-[a-h]*.t to use new tinit features
Reviewed By: quark-zju

Differential Revision: D19457677

fbshipit-source-id: 9f121837dfc6bf98ff4525c6535496b292409844
2020-01-20 02:45:15 -08:00
Mark Thomas
212cec117b tinit.sh: add configure for setting up standard configurations
Summary:
Add a new `tinit.sh` function: `configure`, which takes over from the
feature-enabling aspect of `enable`.

This provides a few features that are configurable:

  * `dummyssh` sets `ui.ssh` to `dummyssh`.
  * `mutation` and `mutation-norecord` enable mutation and visibility tracking
  * `evolution` enables evolution and disables mutation and visibility.
  * `noevolution` disables evolution, as well as mutation and visibility.

Since `enable` now only refers to extensions, it is joined by a corresponding `disable` to
disable an extension.

Some tests are updated to take advantage of these new functions.

Reviewed By: quark-zju

Differential Revision: D19427595

fbshipit-source-id: 03cc639918b4e667927330d3f3abf16121ebf161
2020-01-20 02:45:14 -08:00
Jun Wu
4a98b00205 changelog: still migrate non-public commits to zstore
Summary:
This makes it safer to do revlog-fallback -> server-fallback switch in the
future, because the server might not know all the draft commits.

Reviewed By: DurhamG

Differential Revision: D19416287

fbshipit-source-id: 8d69c1c5465b50710110370d84d5fb7c8ba6a6c4
2020-01-17 04:01:05 -08:00
Mark Thomas
2815d67f41 mutation: update amend tests to use mutation and visibility
Summary:
Update all amend tests to use mutation and visibility.  For these tests, `mutation.record`
is disabled so that hashes do not change.

Most tests pass as-is.  A few tests have changes which are the results of slight behavioural
changes or bug-fixes compared with obsmarkers.

Reviewed By: quark-zju

Differential Revision: D19413580

fbshipit-source-id: 18696a08db69130b08f829366659783df4c9bcc1
2020-01-16 01:03:23 -08:00
Stefan Filip
eca4fbc75d tests: increase timeout for mononoke starting
Summary:
We started to see a lot of tests failing with mononoke timing out at startup.
Increasing the timeout to mitigate the issue.

Reviewed By: krallin

Differential Revision: D19397440

fbshipit-source-id: a8037102b3c8389b98a7c49824fa013fd3e6a080
2020-01-14 12:52:05 -08:00
Simon Farnsworth
deacaed311 Don't delete bookmarks in drawdag if there are none
Summary: In Mononoke tests, we have failures because `hg book -fd` aborts if it's not given any bookmark names. Fix up this function to not run `hg book -fd` if there are no bookmarks

Reviewed By: quark-zju

Differential Revision: D19251930

fbshipit-source-id: 2f1696d9207ad64a94c28941e72806d9b0e686fe
2019-12-30 15:41:14 -08:00
Durham Goode
e1c73204f6 drawdag: use bookmarks instead of tags
Summary:
A future diff will remove tags entirely, so let's move drawdag to be
bookmark based.

Reviewed By: quark-zju

Differential Revision: D18995059

fbshipit-source-id: 70ef67259b37ef9821009d0145aa1e03c09b1309
2019-12-20 16:14:18 -08:00
Adam Simpkins
46890ae1ec Merge fb-mercurial sources into the eden repository
Summary:
Merge the fb-mercurial code into the Eden repository, under the
`eden/scm` subdirectory.

Reviewed By: quark-zju

Differential Revision: D18445774

fbshipit-source-id: fc3307f9937e0c7e1c8f7d03c5102c4fe5dedb10
2019-11-13 20:20:32 -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