Commit Graph

165 Commits

Author SHA1 Message Date
Genevieve Helsel
f6cfa5f229 remove use of getScmStatusBetweenRevisions in eden doctor
Summary: There is one instace of `getScmStatusBetweenRevisions` in use - it is used in the eden cli in a hacky way to check if a commit hash is valid. Since this is not used anywhere else in a meaningful way, this replaces that use case with a hg call and depreciates `getScmStatusBetweenRevisions`

Reviewed By: simpkins

Differential Revision: D18690026

fbshipit-source-id: 02bd2c20a0f631ec41116f9fd4e18d14369298ef
2019-12-20 16:14:22 -08:00
Jia Chen
a731c7518d Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Differential Revision: D19143864

fbshipit-source-id: 0d2d4ed32423b740a67aae670b7f10691e4f4800
2019-12-20 16:14:21 -08:00
Genevieve Helsel
b86b78fa14 update hg and telemetry wrapper callsites to use getScmStatusV2
Summary: This updates the hg and telemetry wrapper callsites of getScmStatus to first try running getScmStatusV2() with fallback option. This does not retry `hg status` while a checkout is in progress.

Reviewed By: simpkins

Differential Revision: D18209899

fbshipit-source-id: e7a77b902f5a0ee624e4ea3185a1901bdac090e6
2019-12-04 15:46:46 -08:00
Genevieve Helsel
3807e751ca make enforceParents configurable for getScmStatusV2
Summary: This reads `enforceParents` from a config instead of always assuming true for `getScmStatusV2()`. This will allow a easy kill switch in case throwing errors from this thrift call causes issues with something that calls hg status

Reviewed By: simpkins

Differential Revision: D18258164

fbshipit-source-id: 1ae421a941c01a678d25d5453c771262b03558d0
2019-11-20 17:51:21 -08:00
Genevieve Helsel
5d2c5ae60a more helpful error message when calling status with out of date parent.
Summary: make the error message returned in the case of out of date parents during a new status call more user friendly and provide possible remediation instructions

Reviewed By: simpkins

Differential Revision: D18328835

fbshipit-source-id: b214f45bb055d008db8b233ddd2a1843332db838
2019-11-14 16:46:15 -08:00
Genevieve Helsel
495b4394b8 add a new getScmStatusV2() API to replace getScmStatus()
Summary:
Add a new thrift API for computing the difference between the working
directory and a given source control commit.

This has the following differences from the old getScmStatus() commit:

- The parameters are accepted in a GetScmStatusParams structure now.
  This makes it easier for the server-side C++ implementation to tell which
  parameters have actually been specified by the caller.  This will make it
  easier to extend this API in the future without having to replace it with a
  new function call again.

- The return value is a GetScmStatusResult, which includes both the ScmStatus
  and the EdenFS version number.  This will allow code like `hg status` to get
  both the status results and the EdenFS version in a single call, without
  needing to make multiple separate thrift calls.

- This new call will return an error if the caller requests the status against
  a commit that disagrees with EdenFS's view of the current commit.  Because
  the individual `hg` command line processes do not perform any
  synchronization of their own when reading the working directory parent,
  they can often call EdenFS with stale parent information, or while a
  checkout is currently in progress.  This new behavior will reject the
  request with an error, rather than having EdenFS perform a potentially very
  expensive status computation when the results probably aren't actually
  useful to the caller anyway.

Reviewed By: chadaustin

Differential Revision: D15110218

fbshipit-source-id: ebc2f74dafc090d4fd245de8e4d62e2b086500dd
2019-10-29 09:56:31 -07:00
Xavier Deguillard
bf08af091a tests: remove fastmanifest requirement
Summary: Fastmanifest is going away, remove it from the test.

Reviewed By: chadaustin

Differential Revision: D18145000

fbshipit-source-id: ee75ebe4eda19caca92fd0a84bf0ae9f48112167
2019-10-28 11:38:49 -07:00
generatedunixname89002005307016
4c76d686a8 Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: grievejia

Differential Revision: D17956249

fbshipit-source-id: d5c8b5aa73151b3fea67aec35d70f332030da2c9
2019-10-16 16:56:29 -07:00
Xavier Deguillard
245d568520 fix rebase_test.py
Summary:
A recent change removed the revision number from the rebase output, fix the
EdenFS test to not have it too.

Reviewed By: genevievehelsel

Differential Revision: D17954310

fbshipit-source-id: 6c1db48086af4b7b138e6c3f4ef0bb362d2256f8
2019-10-16 10:38:28 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Jun Wu
dcc1c59270 Update hg tests for new update --merge state
Summary: D17766371 added an `update --merge` state. Teach eden tests about it.

Reviewed By: wez

Differential Revision: D17837836

fbshipit-source-id: a95ed326bf435f7340d7910307c8c5c761812514
2019-10-09 18:22:19 -07:00
Adam Simpkins
0b5a1295fc support running the hg status integration tests in CMake builds
Summary:
Update the CMakeLists.txt files to support building the hg integration tests.
At the moment this only includes one of the test files (`status_test.py`).
I have not verified if tests from the other modules pass yet or if they need
any additional tweaks to work in CMake-based builds.

Reviewed By: pkaush, fanzeyi

Differential Revision: D17678991

fbshipit-source-id: 4a5ee5a8d6039d9d2a635c7027897bbeed14f8c0
2019-10-04 08:56:38 -07:00
generatedunixname89002005289445
13e683608d Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: sinancepel

Differential Revision: D17135557

fbshipit-source-id: 07afef940271a277c75834892733901d070bfa5f
2019-08-30 13:37:34 -07:00
Chad Austin
b7caa4fb5a remove flatmanifest integration tests
Summary:
Flatmanifest support is going away. Remove over 100 integration tests
for flatmanifest-only repos.

Reviewed By: fanzeyi

Differential Revision: D17064019

fbshipit-source-id: b578ca14a231f0ee1f2fee8b464038c7e2201392
2019-08-26 18:50:29 -07:00
generatedunixname89002005289445
1be6e4d957 Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: grievejia

Differential Revision: D16183608

fbshipit-source-id: 529a893a021c8101e6ad28b8d88d22d4d05aa732
2019-07-10 14:48:04 -07:00
Adam Simpkins
9bfb48c921 update license headers in .py files
Summary:
Update the copyright & license headers in Python files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487088

fbshipit-source-id: 9f2138dff41048d2c35f15e09a04ae5a9c9c80dd
2019-06-19 17:02:46 -07:00
Adam Simpkins
20f211acb8 remove unused python imports
Summary: Remove a number of unused imports detected by the linter.

Reviewed By: wez

Differential Revision: D15776268

fbshipit-source-id: 221f45d275664d037bbabcac9858b40266b4833e
2019-06-12 14:00:57 -07:00
Sinan Cepel
4547deafca Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: dkgi

Differential Revision: D15283973

fbshipit-source-id: b1451da50dbbee0f71260d50caece21799f008f2
2019-05-09 18:17:36 -07:00
Chad Austin
8ec4c11d3e remove flatmanifest fallback when importing trees fails
Summary: Flatmanifest is on its way out. Remove support for falling back to it if a tree import fails.

Reviewed By: pkaush

Differential Revision: D15056459

fbshipit-source-id: a4df820322ee354d77f50a0ec92e9705d0f152ec
2019-05-02 12:35:20 -07:00
Chad Austin
a9d9689d3d invalidate directory inodes properly on checkout
Summary:
After the kernel added readdir caching, my testing uncovered that Eden
was invalidating TreeInode entries incorrectly when new entries were
added. Change TreeInode to distinguish between directory entry changes
and removals (FUSE_NOTIFY_INVAL_ENTRY) and additions
(FUSE_NOTIFY_INVAL_INODE).

Reviewed By: strager

Differential Revision: D13870422

fbshipit-source-id: 2a6f25bfd9e77436a5aae639fedbfd8a445b2e05
2019-03-22 15:57:33 -07:00
generatedunixname89002005289445
1f369ed67b Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: shannonzhu

Differential Revision: D14525100

fbshipit-source-id: ca27023b89da9eb8f983caaceb78e9fb4fea7bfe
2019-03-19 13:15:29 -07:00
Jun Wu
1f30afc972 config: enable merge.printcandidatecommmits
Summary:
The feature was completed by Phil in D9816270. It's handy and can probably
reduce user support burden like: https://fb.intern.facebook.com/groups/scm/permalink/2039619916087618/

Therefore let's enable it.

Reviewed By: DurhamG

Differential Revision: D14293405

fbshipit-source-id: 54e934e0bf495c090109462e4f743d427df39380
2019-03-08 19:56:07 -08:00
Jun Wu
082fcaab0a Remove tests about hg branches
Summary: Branches are going away. Remove the use of them.

Reviewed By: strager

Differential Revision: D14062107

fbshipit-source-id: 00f6d3666eb3cb6900cd570fa3fcf12ba75c2ae0
2019-02-12 21:42:28 -08:00
Adam Simpkins
9e21449bee move creation of the .hg directory into the Eden CLI
Summary:
Update the `eden clone` command to automatically create the `.hg` directory
when creating a checkout for a Mercurial repository.

Previously this logic was performed by a separate post-clone hook that was
invoked by `eden clone`.  Having this logic in a separate script made the code
slightly more complicated, and meant that configuring Eden was also more
complicated, as the hook also needed to be installed and configured.  Moving
the logic into the Eden CLI will make it easier to re-use this code in
`eden doctor` if the `.hg` directory needs to be repaired.

Reviewed By: wez

Differential Revision: D13447272

fbshipit-source-id: 11c4f8e389aead151dd235eff95c860a326967af
2018-12-19 15:34:01 -08:00
Marco Leogrande
bdccac3ea2 Upgrade pyre version for eden
Reviewed By: shannonzhu

Differential Revision: D13502225

fbshipit-source-id: d21fb9da209e4f376a7fbe4f618954ef43d08fea
2018-12-18 11:15:40 -08:00
Chad Austin
6db3bf461d fix truncation not marking files as modified
Summary:
If a file was partially truncated, it would not always be marked as
materialized. During materialization, the SHA-1 would be cached,
but not invalidated after the truncation.

Write tests that ensure that both ftruncate and O_TRUNC mark files as
modified.

Reviewed By: simpkins

Differential Revision: D13329102

fbshipit-source-id: f09fdc5f11f1da25e1b4453de1b29d1390b3dc71
2018-12-04 16:27:46 -08:00
Adam Simpkins
6ddb0224ec fix the remaining type errors in eden python code
Summary: Fix the remaining set of errors reported by pyre and mypy.

Reviewed By: strager

Differential Revision: D13086855

fbshipit-source-id: 4c2b21352f94ef225a5555aef0f6b95b92e56f6d
2018-11-19 18:30:31 -08:00
Adam Simpkins
9beff99012 add type annotations to most of the integration test functions
Summary:
This updates the integration tests to add type annotations to most functions
that were missing annotations.

In particular this is needed to make pyre happy, as it complains if subclasses
override methods from their parent class and do not specify type annotations
if the parent class did have annotations.

This diff also contains some minor changes to hg_extension_test_base.py to
explicitly declare some abstract methods that it uses.  This was also
necessary to make pyre happy about this ocde.

Reviewed By: strager

Differential Revision: D13051097

fbshipit-source-id: 77567ed2f4d3050f93acefb52e688932d276d587
2018-11-16 19:47:48 -08:00
Adam Simpkins
19ce8cdcd8 update HgRepository.hg() to always return a string
Summary:
Drop the `stdout` and `stderr` arguments, so that this method always return a
string.  Change callers that were previously calling this method with
`stderr=None` to use the `run_hg()` method instead of `hg()`.  `run_hg()`
returns a `subprocess.CompletedProcess` object.

This change simplifies the python type checking, and fixes several existing
type checking errors in the code.  Even though most call sites could be
guaranteed that this function would return a `str`, the type checker wasn't
smart enough to tell that the return type would be fixed based on the argument
values, and so it assumed the result always needed to be checked for `None`.

This also updates the `GitRepository.git()` method in a similar fashion.
However, that was a simpler change since it already returned a `str` in all
cases.

Reviewed By: strager

Differential Revision: D13078095

fbshipit-source-id: a8def2a33edc865ac40279bbcb3ada4dade68374
2018-11-16 19:47:48 -08:00
Adam Simpkins
1b389f52b4 restructure storage_engine_test to make the type checkers happy
Summary:
Restructure storage_engine_test so that the base class derives from
EdenTestCase.

Reviewed By: strager

Differential Revision: D13051096

fbshipit-source-id: e89c4b56e361460b2457d1c2e6a22727a25d7646
2018-11-16 19:47:47 -08:00
Adam Simpkins
a0411b8a51 add member type annotations to make pyre happy
Summary:
Add type annotations for class member variables.  The pyre type checker has
some limited automatic type detection for member variables set in
`__init__()`, but in general it expects member variables to be explicitly
declared at the top-level of the class.

Reviewed By: strager

Differential Revision: D13051092

fbshipit-source-id: 080259ab3f422ffae2b908ed610062237105ccbe
2018-11-14 13:03:09 -08:00
Adam Simpkins
43fb04699f re-enable test_hg_clone_non_eden_repo_within_eden_repo for treemanifest
Summary:
The `test_hg_clone_non_eden_repo_within_eden_repo()` test had been disabled
when running with treemanifest enabled since the treemanifest code did not
correctly detect which repositories should actually use treemanifest.

This issue appears to have since been fixed in the treemanifest code, so this
test passes now.

Reviewed By: quark-zju

Differential Revision: D12927801

fbshipit-source-id: b9e2e041f7eab5e24007888e2dba142e1f0b2251
2018-11-06 18:08:09 -08:00
Adam Simpkins
d08f63df8f tests: change HgRepository.status() to return a dictionary
Summary:
Update the HgRepository.status() function in the integration tests to return
the status information as a dictionary instead of a string.  Only one test was
still using the old string API.

Reviewed By: chadaustin

Differential Revision: D10503168

fbshipit-source-id: 574e4438d23bf6612a70ae5ae3174db3d464d198
2018-10-23 13:39:35 -07:00
Adam Simpkins
daa882b16f move code to find the post clone hook to find_executables.py
Summary:
Update the eden+hg integration test code so that it uses find_executables.py
to find the post clone hook.  Previously it was still using its own one-off
helper function for this.

Moving this code into find_executables.py will make it possible have the
snapshot tool also find the post clone hook.

Reviewed By: chadaustin

Differential Revision: D10503169

fbshipit-source-id: d59e3e517d19e80e0d0c997be09865519b80d34e
2018-10-23 13:39:35 -07:00
Chad Austin
2a9e1e2f29 remove fallback for correcting empty files
Summary:
Now that the import bug has been fixed for some time, it's likely few
people have cached empty files. And if they do, `eden gc; eden
restart` is a fine workaround.

On the other hand, reimporting empty files gums up the importer, and
I've seen several people recently complaining about performance that
could be partially attributed to the fact that their Eden needed to
verify empty files. simpkins has talked about adding a bit to the
cached blob to determine whether it needs reimporting or not, but it's
probably going to take a while for anyone to implement that, and this
reverification logic is hurting people today.

Reviewed By: strager

Differential Revision: D10456519

fbshipit-source-id: 657bc377ee16ce93494075bde4388aed59dceecf
2018-10-22 20:27:26 -07:00
Phil Cohen
16c69525bd filemerge: add number of textual conflicts in each file to error message
Summary:
When you get an error, let's print the number of conflicts in each file. This will give the user some sense of how much work they have to do.

The code change is entirely in `filemerge.py`, and `tests/test-merge-conflict-count.t` adds a new test.

Reviewed By: quark-zju

Differential Revision: D9815243

fbshipit-source-id: 1b73a1db293902ac7242997a7d6ae09478344068
2018-10-22 20:27:26 -07:00
Mark Thomas
a2dd1e594e sparse: add sparse show
Summary:
Add a new sparse show command, which shows the current sparse configuration.
Use common templating, including colors, between sparse show and sparse list.

Reviewed By: phillco

Differential Revision: D10446705

fbshipit-source-id: acb539f80f625945716758c785703b46a81aa6f1
2018-10-22 20:27:26 -07:00
Mark Thomas
870f1cb843 help: categorize sparse and cloud subcommands
Reviewed By: phillco

Differential Revision: D10446706

fbshipit-source-id: ef6dad180930f4203e249583fbf0e913cbf01b14
2018-10-22 20:27:26 -07:00
Mark Thomas
47beebefea tidy up command usage
Summary: Some commands in extensions have incorrectly defined usage.  Correct these.

Reviewed By: phillco

Differential Revision: D10446707

fbshipit-source-id: e606314892a31fa09f4a655042d66d87929fc2ec
2018-10-22 20:27:26 -07:00
Kostia Balytskyi
09c68ebb4a fix sparse tests
Summary: D10335083 renamed `fbsparse` into `sparse` and I forgot to udpate this test.

Reviewed By: simpkins

Differential Revision: D10423192

fbshipit-source-id: a547c403a9461d6923ecfecc931df82bb7887597
2018-10-22 20:27:25 -07:00
Phil Cohen
900e52912d tweakdefaults: port allowbranches to core
Summary:
Note that this is more aggressive than the tweakdefaults version; it doesn't allow named branches to be created or listed at all with the config set. As we want to delete named branches entirely, this seems reasonable.

I ported the `--new` flag, but made it optional, to make it easier to support both the core and tweakdefaults callers.

Saurabh Singh and I chatted with the releng team (Craig).

**tldr:** we can remove named branches from the UI but should keep the innards for now

Today the releng team doesn't make any branches (#continuous), but in the near-term future, they might either:

- create remote bookmarks in hg (similar to fbsource)
- create branches in SVN (which are then synced as hg branches by hgsubversion)
  - We'll leave all the hgsubversion code to do this alone, just remove user-facing entry points
  - They'll also need to be able to query for a commit's branch (`hg log -T '{branch}'` will still work)
  - Once www is on hg, this possibility goes away and we can kill named branches for good

Reviewed By: ikostia

Differential Revision: D10401485

fbshipit-source-id: 6f2f3ae28af249bae1fdf782eb14fe7bfc472bb7
2018-10-22 20:27:25 -07:00
Mark Thomas
91f61a5c6a absorb: display affected commits and prompt user to confirm
Summary:
Update hg absorb to use the templater and display the first line of the
description of the affected commits.

Also change the default behaviour to display the changes and prompt the user to
confirm that absorb is going to do what they want.  Use the new `-a` option to
get the old behaviour.

Reviewed By: quark-zju

Differential Revision: D10366510

fbshipit-source-id: 23df2e5ab2d21a0805a16e7118686a29634d2918
2018-10-13 01:02:05 -07:00
Saurabh Singh
ce30b1e029 amend: replace with the fbamend extension
Summary:
The functionality we care about is provided by the `fbamend`
extension. Therefore, lets replace the `amend` extension with the `fbamend`
extension.

Reviewed By: farnz

Differential Revision: D10320739

fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
2018-10-11 06:59:05 -07:00
Chad Austin
d5c1e599b8 remove support for non-toml configs
Summary:
We've been shipping our RPMs with toml config support turned on for a
while now. Remove support for the old config file format. Continue to
ship the old format configurations. We'll remove those in a later
diff.

Reviewed By: strager

Differential Revision: D10020958

fbshipit-source-id: 11c2ca3b5da086b142042496a2814699880c4f81
2018-10-10 12:49:16 -07:00
Saurabh Singh
72e21b6f57 inhibit: remove the extension
Summary:
The logic we care about has been moved to core so we can delete the
`inhibit` extension.

Reviewed By: markbt

Differential Revision: D10276448

fbshipit-source-id: 44cabe5d561344cf8f196127ce52491e4654b598
2018-10-10 10:01:33 -07:00
Adam Simpkins
13ef80fe54 fix dirstate.walk()'s handling of ignored symlinks
Summary:
Fix the code in `eden_dirstate._call_match_callbacks()` to correctly match
ignored symlinks that are explicitly listed in the matcher's file list.

It looks like this was just a mistake in the original code on my part: I
intended to check both `S_ISREG()` and `S_ISLNK()` but instead incorrectly put
the check for `S_ISREG()` twice.

Reviewed By: wez

Differential Revision: D9476524

fbshipit-source-id: 67e0fa7c2fbaac97598a8e2d028c9ef0999ed88a
2018-08-23 15:07:02 -07:00
Adam Simpkins
a88763ae96 re-verify blob contents for empty blobs loaded from the LocalStore
Summary:
When we load an empty blob from the LocalStore double check with the
BackingStore to confirm that it should actually be empty.

We have seen multiple instances of files being incorrectly imported as empty.
So far this error has always been fixed by a re-import.  We still haven't
tracked down the root cause, but this change should help workaround the issue
by ensuring that we double check the file contents before returning the data.

Reviewed By: chadaustin

Differential Revision: D9476522

fbshipit-source-id: 6d57cf15c42736ecbcb106a731259b77db06d8f1
2018-08-23 14:22:58 -07:00
Chad Austin
164af00a35 run some integration tests across all three LocalStore implementations
Summary:
To prevent the regression fixed by D8323051, make sure we run at least a couple
integration tests with the RocksDB LocalStore implementation.

Reviewed By: wez

Differential Revision: D8408390

fbshipit-source-id: 8fab4041ae39915d8be80e42814aab375c4acdda
2018-08-15 10:22:02 -07:00
Adam Simpkins
a5f811f2eb normalize "hg journal" by stripping off extra profiling flags
Summary:
The eden integration tests currently run hg through the telemetry wrapper.

This wrapper script adds profiling arguments to a percentage of the commands
it runs.  The extra arguments that it adds are not entirely transparent to the
user, and are unfortunately reported in the output of "hg journal".

This was causing occasional test failures in the Eden integration tests that
check the output of "hg journal".

This diff changes the Eden code that checks the journal output to try to strip
off these flags before checking the command output.

Reviewed By: wez

Differential Revision: D8631180

fbshipit-source-id: 004d3bcce291ffc2208f85a29cb34a921f16fdde
2018-06-26 16:54:05 -07:00
Wez Furlong
fdd530c007 ensure .hg has read and search permissions for group/other
Summary:
mkdtemp deliberately removes these bits and doesn't respect
the umask.  We perhaps should respect the umask ourselves here.

Reviewed By: chadaustin

Differential Revision: D8335539

fbshipit-source-id: 98b8f3e2db17c65904b12627e52966d5f6b729ef
2018-06-11 22:33:11 -07:00