Commit Graph

125 Commits

Author SHA1 Message Date
Puneet Kaushik
19aca3a6b2 edenfsctl starts edenfs in background on Windows
Summary: Until now we were running Edenfs on the console. Now we could use edenfsctl start.

Reviewed By: chadaustin

Differential Revision: D16565624

fbshipit-source-id: 9a12e52234d36d7b8ce4e3741ffb62655ae334b2
2019-08-14 12:11:05 -07:00
Puneet Kaushik
0f54d0eb14 Fixing OSS Eden cli to use the updated fb303_core
Summary: The Windows and Mac cli build scripts were not building the new fb303 thrift file. Also updated few cli code to use the new fb303 module.

Reviewed By: chadaustin

Differential Revision: D16508590

fbshipit-source-id: 386fa1bf77124d258ffb00edf56c9c827f32e795
2019-07-26 11:46:11 -07:00
Adam Simpkins
9e832076a7 enable debug subcommands on Windows
Summary:
Enable the `edenfsctl debug` subcommands on Windows.

The `overlay` subcommand is the only debug subcommand that requires modules
not available on Windows.  The overlay code uses the `fcntl` module for
locking the overlay.  However, EdenFS on Windows does not use the overlay
directory structure used on Linux and Mac, so this subcommand isn't relevant
on Windows.

This moves the `overlay` subcommand to its own module, and changes the code to
avoid importing it on Windows.  This lets us enable the rest of the debug
subcommands on Windows.

Reviewed By: pkaush

Differential Revision: D16354620

fbshipit-source-id: ee7ea01fa3a21018850f5ba590eb143d7a9718cf
2019-07-22 19:05:26 -07:00
Brian Strauch
4319ad2cd0 Aesthetic fixes
Summary:
Centered clock between title and hostname
Removed bar
Defaulted update speed to 1s, with command line option to change
Gave more/less space to certain columns
Decreased padding to 1 character

Reviewed By: chadaustin

Differential Revision: D16195428

fbshipit-source-id: 6dbd6710727bcd3e65e87fc5bd269a39507dca9b
2019-07-22 13:37:38 -07:00
Chad Austin
59784a6d52 fix status checks when running with new CLI and older edenfs process
Summary:
I made the mistake of migrating the Thrift API for edenfs process
checks without a fallback for older edenfs running processes.

If getDaemonInfo() is not available, fall back on getPid().

Reviewed By: strager, pkaush

Differential Revision: D16365848

fbshipit-source-id: aee5c43c8c40db9a38fef7ca601f7639daa4adb8
2019-07-18 20:48:44 -07:00
Chad Austin
ae35e76c9c add a getDaemonInfo() thrift method
Summary:
Open source fb303 will not have getPid() or getCommandLine(), so
introduce a new method for Eden's tests.

Reviewed By: fanzeyi

Differential Revision: D16292993

fbshipit-source-id: 5cdc006ec0ee15f50a3e1cebe9b46a3ea275ff78
2019-07-17 13:47:02 -07:00
Brian Strauch
a6f952a900 eden top persistence
Summary:
`eden top` used to refresh its data every 2 seconds, now process data accumulates and never leaves the screen (unless it is outdated and gets pushed off the screen by other processes).

For the old functionality, you can run `eden top -e` or `eden -top --ephemeral` which constantly refreshes the screen.

{F166770061}

Reviewed By: chadaustin

Differential Revision: D16157909

fbshipit-source-id: 5d739b4c92d1472337301f34dbf6b1f21e10b81b
2019-07-17 11:36:40 -07:00
Brian Strauch
e16179b89b Top class
Summary: Made a top class to better handle state within `eden top`. Right now, the only field is `running`, but later we will want to track the processes and rows.

Reviewed By: strager

Differential Revision: D16188183

fbshipit-source-id: 38e27dc87353f65212fcb47544707a8e34ba4c68
2019-07-15 14:30:25 -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
Puneet Kaushik
22568aa4d0 Removing import debug and rage from Windows main.py
Summary: Taking out debug and rage (which internally imports debug) from Windows. To make debug comply it would take a bunch of ifs.

Reviewed By: strager

Differential Revision: D15997869

fbshipit-source-id: 1ce46c30d00201b351c8fe9100dcef5a490b5a6c
2019-07-03 19:05:24 -07:00
Wez Furlong
66eb606372 eden: add eden redirect subcommand
Summary:
This is part of the effort to make our bind-mount configuration more
visible and easier to change.

The idea is to generalize the concept of redirection and add a command to help
manage it.

The `eden redirect add` subcommand allows creating one of two different kinds
of redirection:

* `bind` - allocate some space using `mkscratch` and mount it into the repo
* `symlink` - allocate some space using `mkscratch` and create a symlink
  that points to it from the repo

On Linux we use bind mounts to implement `bind` but on macOS, which doesn't
have a bind mount concept, we create a sparse disk image file that can grow
to match the size of the disk on which it is created (in practice these are a
7-15MB in size to start and grow as the user stores data into them).

The `eden redirect del` subcommand allows removing a redirection, including
the legacy `bind-mounts` configuration from `.eden/client/config.toml`.

The `eden redirect list` subcommand lists the effective set of redirections,
both from the new redirections configuration and the legacy `bind-mounts`
configuration, along with their state.

The `eden redirect fixup` subcommand iterates over the effective set of
redirections and can remove and reinstate any that are in a broken state.

Reviewed By: strager

Differential Revision: D15707319

fbshipit-source-id: a5dd8c44c9f748482d7b48855b1305d44267885c
2019-06-25 18:42:38 -07:00
Puneet Kaushik
16c3db0b7f Hide the type annotation in _report_error to make status work on Windows
Summary: We don't import fsck_mod on Windows. Hiding the fsck_mod.Error from python to make edenfsctl status work on Windows.

Reviewed By: strager

Differential Revision: D15912061

fbshipit-source-id: 918fd3cc5729b0c98b098de7c85bb340cdb1ca05
2019-06-20 06:30:39 -07:00
Puneet Kaushik
c304b27c31 Excluding the unused/not working imports from windows main.py
Reviewed By: strager

Differential Revision: D15902479

fbshipit-source-id: b7c14d90cd910186566635c9a1adbd4c8bd81375
2019-06-20 06:30:39 -07:00
Puneet Kaushik
b52627c0c8 Define the exit codes for Windows Edencli.
Reviewed By: chadaustin

Differential Revision: D15902168

fbshipit-source-id: 77c5101e746f491404b9216dc87bb2295e3d8bf2
2019-06-19 17:54:55 -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
Matt Glazar
fa4e4cf78e Make 'edenfsctl start' fail if already running (systemd)
Summary:
With systemd integration enabled, if edenfs is running, or if edenfs' systemd service is active, `edenfsctl start` does nothing. This behavior differs from `edenfsctl start` with systemd integration disabled, and can cause `edenfsctl restart` to think that it successfully started edenfs.

Make `edenfsctl start` fail if edenfs is running and healthy, or if edenfs' systemd service is active (yet edenfs is unhealthy).

Reviewed By: chadaustin

Differential Revision: D15703310

fbshipit-source-id: ce0a13780ee03de1f896a938d002901023e5bdd3
2019-06-11 11:02:13 -07:00
Matt Glazar
6ceb5973e2 Refactor 'edenfs is already running' check
Summary:
get_edenfs_start_cmd checks if edenfs is already running, and fails if it is. Most of the time, this check is redundant. This function is effectively called in five places:

* `edenfsctl start`
* `edenfsctl clone` if not running
* `edenfsctl restart` (`_graceful_restart`) with takeover=True
* `edenfsctl restart` (`_start`) if not running
* `edenfsctl restart` (`_finish_restart`) after stopping edenfs

The check is only necessary in one of these places (`edenfsctl start`). Move the check.

This refactor will allow us to run the check if systemd is enabled without duplicating code.

This diff should not change behavior (ignoring unimportant race conditions).

Reviewed By: simpkins

Differential Revision: D15703308

fbshipit-source-id: cbd4a70a3e0eb23da0d65d641d89a5ac022cd79f
2019-06-10 20:45:30 -07:00
Adam Simpkins
df044b9286 make eden start --gdb work even when systemd is the default
Summary:
Update `eden start` to treat the `--gdb` argument like `--foreground`, and
always start in non-systemd mode, even if this would be the default otherwise.
The `--gdb` flag automatically implies `--foreground`

Reviewed By: wez

Differential Revision: D15492158

fbshipit-source-id: 89d65f7aef8c31131c7d95e054995df8a138cc41
2019-05-28 12:55:41 -07:00
Wez Furlong
a96e312aa1 eden: eden doctor no longer fatals on macOS
Summary:
This diff just stubs out some functions that were either
not present or that were doing linux specific things that would
error out when attempted on macOS.

This diff doesn't implement macOS equivalents of the functions;
each of those can be tackled separately in follow up diffs.

Reviewed By: simpkins

Differential Revision: D15453050

fbshipit-source-id: 228044fc416d9170a4ba3aef6cd9b40194707f17
2019-05-22 14:46:37 -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
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
generatedunixname89002005289445
519fbabc9b Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: shannonzhu

Differential Revision: D14426843

fbshipit-source-id: bda3fa62d5af6d4c6c5120e793e0da79c4a145f0
2019-03-12 13:56:33 -07:00
Adam Simpkins
574c34ffbd fix "eden start --if-necessary" when using systemd
Summary:
Update `eden start` to honor the `--if-necessary` flag even when starting
with systemd.

Reviewed By: chadaustin, strager

Differential Revision: D14356541

fbshipit-source-id: b7c12b11a2fd63eeee84026bf4418702f794cbf0
2019-03-08 19:06:04 -08:00
Adam Simpkins
1b7f39fc56 convert most the CLI config code from str to Path
Summary:
Update most of the `eden/cli/config.py` to use `Path` instead of `str` where
appropriate.  This also updates several of the APIs in `util.py` that were
affected as well.

Reviewed By: chadaustin

Differential Revision: D14356543

fbshipit-source-id: a8f6d15b8870bf689eeb78f9fc0e9a0c65c97218
2019-03-08 19:06:04 -08:00
Adam Simpkins
98ef256f4c remove CheckoutConfig.hooks_path
Summary:
Remove the `CheckoutConfig.hooks_path` attribute which is no longer used
anywhere.

Reviewed By: strager

Differential Revision: D14356542

fbshipit-source-id: 28b7e7aeb197aeb5d04edf8adfdcfe7946ffa0c7
2019-03-08 11:10:01 -08:00
Adam Simpkins
4b9b3bf7fd fix exception in eden fsck when no mounts are configured
Summary:
If no mounts are configured `eden fsck` previously threw an exception when
trying to compute the return value.  It called `max(return_codes)` on an empty
return codes list, which would fail.  This changes the code to handle that
code specially and report a warning that there was nothing to check.

Reviewed By: chadaustin

Differential Revision: D14352112

fbshipit-source-id: 3815ef34a12834d642f3eee867dda6dc1117c2ef
2019-03-08 11:10:00 -08:00
Adam Simpkins
e28cceca9f minor clean up to some of the fsck code
Summary:
Update the fsck `check_all()` function to use the newer
`EdenInstance.get_checkouts()` API instead of the older, internal
`_get_directory_map()` method.

Reviewed By: chadaustin

Differential Revision: D14352113

fbshipit-source-id: f1ceae72747833d89d5afd11da585ba96b5615a4
2019-03-08 11:10:00 -08:00
generatedunixname89002005289445
1678b9273e Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: shannonzhu

Differential Revision: D14305975

fbshipit-source-id: 7b54441dc846165fb12bfbe5339e4c917da463ec
2019-03-04 13:03:03 -08:00
Wez Furlong
15e862fafe eden: fixup cli readline dep and mac packaging
Summary:
This diff updates our internal eden packaging to correctly declare
a dep on python3, and to specify that python3 interpreter when building
the CLI.

It also allows importing of `readline` to fail, which is important because
the python3 on the system may not have a functioning readline extension.

Reviewed By: strager

Differential Revision: D14098276

fbshipit-source-id: ad1174e46b9b1c0ec1e602ecaeb59c1f0835472a
2019-02-19 11:26:26 -08:00
Matt Glazar
36348b3173 Kill 'eden config --get' entirely
Summary: It's been a few weeks since we dropped support for `eden config --get` (D13737807), and we've received no reports of this being a problem. Delete the code which handles `eden config --get`.

Reviewed By: chadaustin

Differential Revision: D13772873

fbshipit-source-id: 04e2aa7f193806ee26c2f0ab1fe4246815c581a6
2019-02-15 11:44:43 -08:00
Adam Simpkins
51ba397f47 rename CheckoutConfig.path to backing_repo
Summary:
This renames the CheckoutConfig `path` member variable to `backing_repo`.
The value in this variable is actually the path to the source control backing
repository, and not the path to the Eden checkout, which was confusing.  (The
CLI tests were actually setting this up incorrectly in `create_test_mount()`,
but until now nothing in the tests had been using it, so we hadn't noticed
this problem earlier.)

I also changed `CheckoutConfig` to be a `typing.NamedTuple` as part of this
change.

Reviewed By: strager

Differential Revision: D13935006

fbshipit-source-id: 43b6ba4efa34f8c6fb8264de8bb31a33a6d73036
2019-02-06 20:14:12 -08:00
Matt Glazar
93c0f175d6 Add default parameter to get_config_value
Summary:
`EdenInstance.get_config_value` raises a KeyError if the option or section is not set in any config files. Every caller of `EdenInstance.get_config_value` handles KeyError manually. Simplify code by letting callers specify a default value.

Aside from treating some options with an empty value as if they were unset, this diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D13737806

fbshipit-source-id: fdb7fa75d601de4644704813db38b671b27f73d7
2019-01-25 18:38:36 -08:00
Adam Simpkins
ec0f87fa4d update eden list to report the mount state information
Summary:
Update the `eden list` command to also report the current state for each
checkout if it is not running normally.  Also added a `--json` flag to
print information as JSON so it can be consumed programmatically.

Reviewed By: strager

Differential Revision: D13503053

fbshipit-source-id: 4ef366f5bf4a1157036fdfd7ff1056079588e802
2019-01-25 16:38:28 -08:00
Matt Glazar
5f68fe3e0e Drop support for 'eden config --get'
Summary:
I want to add an array config option to Eden. It's unclear how arrays should be printed by 'eden config --get'.

'eden config --get' is not used anywhere. Instead of figuring out the right way to print arrays, just kill support for the --get option.

If someone *is* using 'eden config --get', make it obvious and greppable that it's now deliberately broken.

Reviewed By: chadaustin

Differential Revision: D13737807

fbshipit-source-id: 7d7e2d0d5e90641c53b2caa463fc9e1854416745
2019-01-22 15:47:04 -08:00
Adam Simpkins
ce93814006 add an eden stop --kill option
Summary:
Add an option to forcibly kill `edenfs` with SIGKILL without ever attempting
to query it over thrift.

This should provide a way for users to reliably kill edenfs even if it is
hung.  This shouldn't be necessary in most cases, but it lets us tell users to
run this command as a last resort if something is wrong.

Reviewed By: chadaustin, strager

Differential Revision: D13744188

fbshipit-source-id: 13378d04b3398e72ed3733d4ebb68b39868007bd
2019-01-22 13:03:55 -08:00
Matt Glazar
82e63507aa Make 'eden config' print valid TOML
Summary:
The 'eden config' command prints output naively. This leads to confusing output when using the hg.extra_hgrc option. For example, in the following output, `mode = off` is part of hg.extra_hgrc's value, but it looks like it's a separate option in Eden's config:

```
$ eden config
[clone]
default-revision=master
[rage]
reporter=pastry --title "eden rage from $(hostname)"
[hg]
extra_hgrc=[fsmonitor]
mode = off

%include /etc/mercurial/repo-specific/eden.rc
[service]
experimental_systemd=True
```

Fix this issue by making 'eden config' output valid TOML:

```
[clone]
default-revision = "master"

[rage]
reporter = "pastry --title \"eden rage from $(hostname)\""

[hg]
extra_hgrc = "[fsmonitor]\nmode = off\n\n%include /etc/mercurial/repo-specific/eden.rc\n"

[service]
experimental_systemd = "True"
```

Reviewed By: simpkins

Differential Revision: D13661229

fbshipit-source-id: 76e4fa83ad186d04451623e3d8d87a78e4b821d8
2019-01-18 11:57:32 -08:00
Sinan Cepel
8d30ff0d6a upgrade fbcode/eden version
Reviewed By: simpkins, dark

Differential Revision: D13617216

fbshipit-source-id: 01066612dfc68cee9283b587fc08f25530857690
2019-01-10 16:13:47 -08:00
Matt Glazar
016bd2bec0 Fix crash in 'eden stop' on Thrift timeout
Summary:
If --config-dir was not specified when running 'eden stop', and edenfs is unresponsive, StopCmd.run calls `check_health_using_lockfile(None)`. This violates check_health_using_lockfile's contract because its argument must be a non-null `str`. The result is that 'eden stop' fails:

```
$ eden stop
warning: edenfs is not responding: Socket read failed: timed out
Traceback (most recent call last):
  File "[snip]/thrift/transport/TSocket.py", line 298, in read
    buff = self.handle.recv(sz)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "[snip]/eden/cli/main.py", line 1221, in run
    pid = client.getPid()
[snip]
  File "[snip]/thrift/transport/TSocket.py", line 305, in read
    message='Socket read failed: {}'.format(str(e))
thrift.transport.TTransport.TTransportException: Socket read failed: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
[snip]
  File "[snip]/eden/cli/main.py", line 1231, in run
    pid = check_health_using_lockfile(args.config_dir).pid
  File "[snip]/eden/cli/util.py", line 104, in check_health_using_lockfile
    lockfile = os.path.join(config_dir, LOCK_FILE)
  File "[snip]/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
```

Make 'eden stop' use the default config directory if --config-dir was not specified.

This issue was not caught by automated tests because they specify --config-dir explicitly.

This issue was not caught by type checkers because the type of argparse.Namespace's attrs unify with any type (including `str`).

Reviewed By: simpkins

Differential Revision: D13568405

fbshipit-source-id: 395aad7e3a80b91fec05969b648a51939281ffec
2019-01-09 20:41:40 -08:00
Matt Glazar
8ab3685f67 Make 'eden clone' start systemd service
Summary: 'eden clone' starts the EdenFS daemon if it's not already running. If the user opted into systemd integration, make sure the daemon is started via systemd.

Reviewed By: wez

Differential Revision: D13498650

fbshipit-source-id: 8c5da579f9b79363e2d825ea7c85d423cbcc6509
2019-01-09 20:07:56 -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
Adam Simpkins
fbc7306e50 rename ClientConfig to CheckoutConfig in the CLI code
Summary:
Rename `ClientConfig` to `CheckoutConfig` to move slightly closer towards
standardizing on the term "checkout" rather than "client" to refer to an Eden
mount point directory.

Reviewed By: chadaustin

Differential Revision: D13437952

fbshipit-source-id: 5086b4187eb975c860d48cadf0ccd4e5dce78e9a
2018-12-12 16:42:56 -08:00
Matt Glazar
4af60a78e0 Refactor should_use_experimental_systemd_mode into EdenInstance
Summary:
I want to allow opting into systemd using a setting in ~/.edenrc. Since should_use_experimental_systemd_mode is a global function, it can't read any configs. Make the config file visible to should_use_experimental_systemd_mode by moving it into EdenInstance.

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D13370823

fbshipit-source-id: b604db66954d0a08973030daae38bf6b1433e821
2018-12-07 18:50:35 -08:00
Matt Glazar
36e609d909 Integrate 'eden restart' with systemd
Summary:
If the user opted into systemd integration, make 'eden restart' restart the systemd service.

Don't support --graceful yet. --graceful will be implemented in a later diff. Mark it as explicitly unsupported for now.

Reviewed By: chadaustin

Differential Revision: D13271438

fbshipit-source-id: e505f00cbc337a2bf4da77bdea4b8faba063607c
2018-12-07 18:50:35 -08:00
Matt Glazar
75d7a135b5 Pass extra daemon args from 'eden start' to systemd
Summary: Several tests for 'eden start', 'eden stop', and 'eden status' need to pass command-line arguments to fake_edenfs. With systemd support enabled, make 'eden start' forward daemon arguments to fake_edenfs, making these tests pass.

Reviewed By: wez

Differential Revision: D13249891

fbshipit-source-id: 9008a361fce7a5629535cc9d245b86073ee70826
2018-12-07 17:07:08 -08:00
Matt Glazar
c20d275a6b Make 'eden start' run a bare minimum systemd service (opt-in)
Summary:
Add the plumbing necessary to make 'eden start' start a systemd user service. This is only enabled if you opt in using EDEN_EXPERIMENTAL_SYSTEMD.

Currently, only fake_edenfs works. The real edenfs doesn't work yet because it needs root access to configure mount points.

'eden restart', 'eden stop', etc. are not affected by this diff (and are probably broken with EDEN_EXPERIMENTAL_SYSTEMD enabled).

Reviewed By: simpkins

Differential Revision: D10849390

fbshipit-source-id: c087a6498951ff100e5c80bd07ad869b2709e1b3
2018-12-06 16:01:43 -08:00
Adam Simpkins
8574164ed5 fsck: add basic framework code for fixing errors
Summary:
Add basic high level logic to fsck to begin fixing problems that are found.
This adds basic checks to decide if we should fix errors or not.

If errors are found and need to be fixed, this creates a new directory inside
the checkout state directory in `.eden` to record the actions taken by this
fsck run.  This directory will contain a log file that records the actions
taken.  In the future the fsck logic will also use this directory to store
copies of the corrupted inode data, and can store extracted orphan inode data
here as well.

Reviewed By: wez

Differential Revision: D12955044

fbshipit-source-id: 06c1e17a0a51fa5e2c0f2aab83b367b9358fd004
2018-11-26 12:28:52 -08:00
Adam Simpkins
b93c29f772 update the CLI to make pyre happy
Summary: Update the CLI code to make the pyre type checker happy.

Reviewed By: wez

Differential Revision: D13035413

fbshipit-source-id: d201f2e65667e0ce1bf4a73fbb05878e8711ad16
2018-11-12 20:25:29 -08:00
Adam Simpkins
a1a79d6271 move fsck error printing code into the main CLI module
Summary:
Move the error printing logic up into the CLI-specific `FsckCmd` class and out
of the lower-level `fsck.FilesystemChecker` class.

Reviewed By: wez

Differential Revision: D12955043

fbshipit-source-id: 4b5a1fcb791e784c736672484990b5406ee29b65
2018-11-09 16:06:55 -08:00
Adam Simpkins
d7882dfa93 improve argument parsing for eden fsck
Summary:
Improve the way `eden fsck` processes its arguments.  Previously it required a
single checkout path as an argument.  If an `--overlay` argument was specified
it used this instead of the checkout path to find the directory to check, but
the checkout path argument was still required (but was ignored).

This changes the code to accept one or more paths as arguments.  These paths
can either be the path to an Eden checkout (which does not have be currently
mounted), or the path to a checkout state directory inside the `.eden` state
directory.  The `fsck` code automatically figures out what type of directory
the argument refers to and processes it correctly.

If no paths are specified `eden fsck` now automatically checks all configured
checkouts that are not currently mounted.

Reviewed By: wez

Differential Revision: D12955041

fbshipit-source-id: c37bc6752746d8ecd0f4a672d0d3b25d1c3a4fa1
2018-11-09 16:06:55 -08:00