Summary:
Tests are redirected, but we still want colors in them (to verify that ANSI
escape code works). Since VT mode will always fail, simply do not try to
enable it in this case.
Reviewed By: DurhamG
Differential Revision: D20875423
fbshipit-source-id: bd6b0046de9558d957e0df082d4392ad00e0b551
Summary:
Previously `eden top` shows metrics for imports that are queued
and fetching data (though there is a bug here fixed above), we
want to provide more granularity to help with debugging:
This explicitly separates "current" and "pending" imports:
- "live": The import is live, ie it is currently importing data
- having this metric allows debugging the case that there
is a problem fetching data
- "pending": The import is queued, live, or getting data from the
cache
- having this metric allows debugging the case that there is a
problem initiating the request, for example a request is being
starved on the queue
**note**: I moved the watches closer to the import function call
instead of renaming the currently broken pending import watches
to make it more clear in the code what these are suppose to be
timing
Reviewed By: chadaustin
Differential Revision: D20629833
fbshipit-source-id: 84ef75057149a648a51418a5cc93be87e3b3d6b5
Summary:
Somehow the constant isatty and config reading shows up in my profile. Since
this is not intended to change, just cache it.
Reviewed By: DurhamG
Differential Revision: D20830511
fbshipit-source-id: de36c0a958f6a6046a05db0abf976994435b9e3c
Summary:
The IndexedLog code uses a lock file to lock a directory on Windows, make
sure we account for that.
Reviewed By: DurhamG
Differential Revision: D20818882
fbshipit-source-id: 7e9aa255354d36899ad57168311a4276d448dc07
Summary: Add default implementations for samplingblobs put and is_present handlers to save some boilerplate
Reviewed By: farnz
Differential Revision: D20868507
fbshipit-source-id: 40275cc832870019238c0635e097e53671b76783
Summary:
This way we'll never select more than (no_of_stores * limit) rather than
potentially unbounded output.
NOTE: This diff has to be landed and rolled out **after** D20557702 is rolled out. I'm assuming that after some time since D20557702 rollout all the rows in the production db will have proper `operation_key` value set so we can make queries based on them.
Reviewed By: krallin
Differential Revision: D20557700
fbshipit-source-id: 5a1d4b69949b425915214f5227c5c0dcce374360
Summary: So we're sure that all the quries work not only in sqlite.
Reviewed By: krallin
Differential Revision: D20839958
fbshipit-source-id: 9d05cc175d65396af7495b31f8c6958ac7bd8fb6
Summary:
When we have more entries with a single blobkey we always select all of them
regardles when and how they were added. That's why we need to select basing on
operation_key.
Reviewed By: krallin
Differential Revision: D20557699
fbshipit-source-id: 77ccf992bb24d1a46ea28a13ab0780e6c92935ae
Summary:
Now that we have a proper back-channel to retry failures in Python, the
failures will be retried at a later time, when the anti-virus would have
hopefully release any locks it has on the file.
Reviewed By: DurhamG
Differential Revision: D20847006
fbshipit-source-id: 4fad0e773f69ddff27a23bc86dbbd3ce47bb3b46
Summary:
For our HgExternalSync jobs that pull from git, we don't really use most of the
bells and whistles of hggit. Notably, we don't care about bookmarks: we only
ever pull master, we never update to it, we only ever look at `-r tip`.
However, we do care about things that are actually much harder to fit in a
world where we try to pretend the remote git repository is actually a hg
repository we can pull from.
Notably, we'd like to enforce limits on how many commits we pull (and convert)
at a time, so that if we fall behind a little bit, we don't start falling even
more behind by having to convert bigger and bigger batches of commits. If we're
trying to pretend fetching from git and converting commits is actually a pull,
then that seems harder to pull off (we'd need to somehow rewind the remote head
we're pulling before importing it).
So, this adds a new external-sync command to hggit that basically the bare
minimum that we do need. It lets you specify a git remote and a head you care
about, and import up to N commits from it. That's it — no bookmarks are updated
or anything (but the git-mapfile is, of course). The only thing that changes is
your commits.
If you actually want to interact with your git repository on an ongoing basis
as if it were a remote hg repository, this is completely useless, but that
isn't what we actually do, so that should be OK.
As part of this, I've modified a few other parts of git_handler to remove
places where we called a `uri` `remote_name` (which is a bit confusing), and a
place where we were asking for a `remote_name` parameter that I don't have
here, but which we also didn't actually need (in `import_git_objects`).
Reviewed By: farnz
Differential Revision: D20836601
fbshipit-source-id: 96230e6e8269d0472404414948fd2f02aa98d79c
Summary:
Evolution crashes if you try to create obsmarkers in a repo where obsmarkers
are not enabled. Instead, check before reviving commits with obsmarkers that
it is enabled.
Reviewed By: krallin
Differential Revision: D20868173
fbshipit-source-id: b3a08ef05ddc13e9b78df8ac7c1ca1ef808b7602
Summary: Log errors to scuba regardless of the error_as_data setting, as as finding the logs is much easier from scuba than stderr.
Reviewed By: farnz
Differential Revision: D20838462
fbshipit-source-id: b78e3a3213ed4aee4e4b2feb871ad7e42e25ed00
Summary:
Add methods to check if a process ID is alive, and if it looks like an EdenFS
process.
This also adds an initial version of ProcUtils for Windows, and implements
these two methods on Windows. I have moved parts of the `winproc.py` module
to the new `proc_utils_win.py` module, to help better manage dependencies
between our modules. This keeps all of the Windows-specific `ctypes` code
together in `proc_utils_win.py`. The functionality that is still left on
`winproc.py` depends on `config.py`, and the `proc_utils` code should not
depend on `config.py` to help avoid circular dependencies.
Reviewed By: wez
Differential Revision: D20833245
fbshipit-source-id: 43e9b6dd1b520dcb6b2da7701de885058f0f7ea2
Summary:
Migration from Future-returning executor-erasing collectX forms to
SemiFuture-returning forms, that are less risky in particular with coroutines.
Earlier changes added collectXSemiFuture and collectXUnsafe as a migration
path. We then migrated collectX callsites to collectXSemiFuture or
collectXUnsafe and switched the implementation of collectX to the SemiFuture
form.
This diff renames uses of collectXSemiFuture to collectX, as the two are
identical.
Reviewed By: simpkins
Differential Revision: D20833464
fbshipit-source-id: c14aa40f8cce121632ff922300ef271721c1d695
Summary:
This renames the `ProcessFinder` class to `ProcUtils`, in preparation for
adding some more generic process management utilities into this class.
This class was originally just used for finding stale processes in
`edenfsctl doctor`. However, it seems like a good place to consolidate all
platform-specific process querying logic. We are currently need
platform-specific querying to tell if specific process IDs are still running
for `edenfsctl status` and `edenfsctl stop`, and we also already have some
Windows-specific spawning logic in `edenfsctl start`. I plan to move all of
that logic into this `proc_utils.py` module.
This renames `ProcessFinder` to `ProcUtils` just to better reflect its
expanded purpose.
Reviewed By: genevievehelsel
Differential Revision: D20833243
fbshipit-source-id: 8d33460b7468d877bc327e855af5c620ac5b80a7
Summary:
Update out platform checks to use `sys.platform` instead of `os.name`
Python type checkers (mypy and Pyre) currently understand checks against
`sys.platform`, and know that code guarded by these checks is platform
specific. They don't understand the `os.name` checks.
This code should behave the same, but allows type checkers to do a better job
checking this code.
Note that there is also `platform.system()`, but this has drawbacks that it
apparently does runtime-checks to determine the platform, whereas `sys.platform`
is baked-in at compile time. Additionally, the typecheckers do not appear to
support checking based on `platform.system()` for now. There is an open
feature request for this for mypy, but it is not implemented yet.
One caveat for `sys.platform` is that the results on Linux are not consistent
across Python versions: older versions of Python used to report `linux2` while
new versions report simply `linux`.
Reviewed By: chadaustin
Differential Revision: D20830149
fbshipit-source-id: d173e41f1ae84951a84b87e2dc05787fe8b01407
Summary:
Update the `edenfsctl.exe` binary to find `edenfs.exe` relative to itself.
This ensures that when you run `edenfsctl.exe` from a development build that it
finds the associated development build of `edenfs.exe`, rather than the current
system-installed version.
Reviewed By: wez
Differential Revision: D20821419
fbshipit-source-id: 29ff0b587800f1b76c0b729512bc19f5aef648a7
Summary:
Let's mandate a 256 color terminal in Windows. We also update less to default
to using VT mode: https://github.com/gwsw/less/pull/29
With this, the colors appears to be working as expected on Windows!
Reviewed By: quark-zju
Differential Revision: D20826922
fbshipit-source-id: 5d2a149e2698b3ccc7bf6388b5cd97da20898eb7
Summary:
I'm not exactly sure why, but my guess is that by writing the py files first,
the pyc might be copied and not generated, causing Python to not read the pyc
at import time, leading to slow startup time.
Reviewed By: quark-zju
Differential Revision: D20829130
fbshipit-source-id: e838ff18b9fbf65d1a9437e0a8ef58d57803d2fa
Summary:
Fix some call sites to use collectAllUnsafe().
It looks like these were missed in D20331206.
Reviewed By: genevievehelsel
Differential Revision: D20833198
fbshipit-source-id: 511f6115a5bfeb5b82f9416d5d54bef25a7209a0
Summary:
Combined with the unbundle resolver stats, we will be able to say which
percentage of pushrebases fails, for example.
Reviewed By: StanislavGlebik
Differential Revision: D20818224
fbshipit-source-id: 70888b1cb90ffae8b11984bb024ec1db0e0542f7
Summary:
We need this to be able to monitor how frequently we get pushes vs
infinitepushes, etc. A furhter diff will add a similar reporting to
`processing.rs`, so that we can compute a percentage of successful pushes to
all pushes, for example.
Reviewed By: StanislavGlebik
Differential Revision: D20818225
fbshipit-source-id: 7945dc285560d1357bdc6aef8e5fe50b61622254
Summary:
For whatever reason, ncurses doesn't interpret the arrow keys properly... Use
whatever is returned from it instead.
Reviewed By: kulshrax
Differential Revision: D20821432
fbshipit-source-id: 019426a1333538a479fb3dd8d147fb9cb4ba6559
Summary:
Our phases caching wasn't great. If you tried to ask for a draft commit then
we'd call mark_reachable_as_public method, bu this method was bypassing
caches.
The reason why we had this problem was because we had caching on a higher level
than necessary - we had SqlPhases struct which was "smarter" (i.e. it has a
logic of traversing ancestors of public heads and marking these ancestors and
public) and SqlPhasesStore which just did sql access. Previously we had our
caching layer on top of SqlPhases, meaning that when SqlPhases calls
`mark_reachable_as_public` it can't use caches anymore.
This diff fixes it by moving caching one layer lower - now we have a cache
right on top of SqlPhasesStore. Because of this change we no longer need
CachingPhases, and they were removed. Also `ephemeral_derive` logic was
simplified a bit
Reviewed By: krallin
Differential Revision: D20834740
fbshipit-source-id: 908b7e17d6588ce85771dedf51fcddcd2fabf00e
Summary:
Very small refactoring to store MemcacheHandler (i.e. an enum which can either
be a real Memcache client or a mock) instead of a memcache client.
It will be used in the next diff to create mock caches
Reviewed By: krallin
Differential Revision: D20834916
fbshipit-source-id: cb1e3e8f0ae0e2c0f7018d3a003ada56725c65c6
Summary: SelectPhases does the same thing - no need to keep two queries
Reviewed By: krallin
Differential Revision: D20817379
fbshipit-source-id: 8cc56ea4a94e81f110a286899a8f5c596566a142
Summary: I'm going to refactor it soon, for now just move it to another file.
Reviewed By: krallin
Differential Revision: D20817293
fbshipit-source-id: 6fb44b4be858ebbd0e8c9dfee160b91806f78285
Summary:
Move the attribute so it won't cause an AttributeError when remotenames is not
enabled.
As we're here, also move it to repo._remotenames from repo. This makes the repo
object a bit clearner and avoids loading the accessed bookmarks if remotenames
are not accessed at all.
Reviewed By: singhsrb
Differential Revision: D20821070
fbshipit-source-id: b5a01016451ee202f778cadb2dd418400406fa6b
Summary:
This diff turns off the support_old_nightly feature of async-trait (https://github.com/dtolnay/async-trait/blob/0.1.24/Cargo.toml#L28-L32) everywhere in fbcode. I am getting ready to remove the feature upstream. It was an alternative implementation of async-trait that produces worse error messages but supports some older toolchains dating back to before stabilization of async/await that the default implementation does not support.
This diff includes updating async-trait from 0.1.24 to 0.1.29 to pull in fixes for some patterns that used to work in the support_old_nightly implementation but not the default implementation.
Differential Revision: D20805832
fbshipit-source-id: cd34ce55b419b5408f4f7efb4377c777209e4a6d
Summary:
This isn't actually a Mercurial extension, so we can't be importing Mercurial
imports here. I'm not sure this is actually being used because we apparently
have 2 copies of this (see D20793452, which is also how I came upon this), but
it's probably worth not breaking it.
Reviewed By: farnz
Differential Revision: D20794695
fbshipit-source-id: daaf0f5822567b55a787669073421fd1ce604e08
Summary:
We've seen a number of recent cases where hg stops using watchman for
status because state-enter or state-leave fail because multiple enters or leaves
are called out of order. The root cause needs to be found, but in the mean time
we should not allow such errors to block of from using watchman entirely.
Let's eat these gracefully and just log that the issue happened.
Reviewed By: quark-zju
Differential Revision: D20807004
fbshipit-source-id: 517d9562febc226ce7db836435ca2ca9db1c68fb
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
Summary:
On shared devservers, all users in svnusers should be able to read/write onto
the stores, set the umask to properly reflect this.
Reviewed By: ikostia
Differential Revision: D20817266
fbshipit-source-id: 8a865f499a35313afd3cbeb5f989175862a3549f