Summary: Using python native base85 encode/decode by removing old implemented reference.
Reviewed By: sggutier
Differential Revision: D43700467
fbshipit-source-id: 8bc223bd9cb0054c0f227557bea719d6f6f91165
Summary:
We've had reports of users getting "cached" permission errors because the pfc/chg server process has a out-of-date list of groups cached.
Linux seems to cache groups for the lifetime of the process, but MacOS seems to update them dynamically. This check shouldn't hurt on MacOS, though.
Reviewed By: sggutier
Differential Revision: D43676809
fbshipit-source-id: 7e4439465410567d83ceeaa4ad58bd332a03a4f7
Summary:
Add completion for sapling
Make completion work for `sl` by adding `sl=hg` to the compdef
Pull Request resolved: https://github.com/facebook/sapling/pull/369
Test Plan:
Manually
```sh
$ ln -sv ~+/eden/scm/contrib/zsh_completion /usr/local/share/zsh/site-functions
$ exec zsh # might have to clear compinit cache
$ sl g
gc githelp goto graft grep
```
(and this does not work on main at the time of writing)
Reviewed By: muirdm
Differential Revision: D43329103
Pulled By: quark-zju
fbshipit-source-id: a8220efa64acda0e988b92418321675a6e3dd7a5
Summary:
Instead of just showing `?` or `*`, show one of each symbol in the
dirty status. This means there will be a maximum of 5 characters at the end of
the prompt, which is fine.
Pull Request resolved: https://github.com/facebook/sapling/pull/349
Test Plan:
Seems to work:
```
fbsource>scm % setopt PROMPT_SUBST
fbsource>scm % source contrib/scm-prompt.sh
fbsource>scm % export SHOW_DIRTY_STATE=1
fbsource>scm % export PS1='$(_scm_prompt)$USER@%m:%~%% '
(158b00d6b? M)muirdm@muirdm-mbp:~/fbsource/fbcode/eden/scm%
Reviewed By: muirdm
Differential Revision: D43326525
Pulled By: quark-zju
fbshipit-source-id: 94c0a85e4cf4ffcc5c7c8db9ed64f6ea6d1564a2
Summary:
`KeyboardInterrupt` is ineffective after D42876257. Migrate off them.
- For cases like interrupting threads, re-raise, pass, just drop them.
- For cases like `rmtree`, migrate to `AtExit.rmtree` instead.
Reviewed By: muirdm
Differential Revision: D42909987
fbshipit-source-id: 11851cb8fc33227b9ad28d6fb6dd0150dc782477
Summary:
The test was intended to check that the nonnormalset is a subset of files
tracked by dirstate. Previously the nonnormalset is tracked separately so
it can be buggy and include files not in the main dirstate map. But the
TreeState format enforces the nonnormalset to be a subset of files tracked
by TreeState (dirstate). Therefore the test is no longer relevant.
Reviewed By: sggutier
Differential Revision: D42818816
fbshipit-source-id: 24277f4cd16efc82ac803e1ff2b5b53941289abd
Summary: Clarify that the specified patterns filter "files" rather than "names".
Reviewed By: bolinfest
Differential Revision: D41222451
fbshipit-source-id: c67cedc3e3b656771e6d7bd88a72a102c1758073
Summary: The makefile no longer works as chg is not a standalone executable.
Reviewed By: sggutier
Differential Revision: D40128265
fbshipit-source-id: 7e04ab320b612e018cf0db0b3f8fa0680492edf7
Summary:
Update chg to be aware of identity:
- Append socket name with "-<cli_name>" so clients with different identities
won't share a same server.
- Fallback to the identity's "cli_name" when deciding the main executable to
execute.
Differential Revision: D40127989
fbshipit-source-id: 5d48b030f8dde3b12a6fd63f189c4d1639150042
Summary:
The timeout was set via `CHGTIMEOUT` from the telemetry wrapper.
We're going to remove related logic from telemetry. So let's change
the default directly.
Differential Revision: D39678770
fbshipit-source-id: 64b8d4a242f3bcfcd0f82e965660673a134e5b52
Summary: `chg` is no longer a standalone program. Remove outdated docs about them.
Differential Revision: D39678299
fbshipit-source-id: 372d743956851672386a61c1147475a30ddfe282
Summary: Doesn't seem to be used and it contains some ".hg" references I no longer have to deal with.
Reviewed By: quark-zju
Differential Revision: D39867742
fbshipit-source-id: b12163ce51cebcf576b35d1f00c79142cc81f3cd
Summary: This is no longer used and we are purging the "hg" name, so now is a good time to clean it up.
Reviewed By: jordanwebster
Differential Revision: D39867739
fbshipit-source-id: f92508235f22d4f22fc563e3a40ad7f85d3f957e
Summary:
Remove `feature=python2` stuff from `Cargo.toml` and `TARGETS` files.
Ran `autocargo` to update `Cargo.toml` files, as appropriate.
Reviewed By: quark-zju
Differential Revision: D39229202
fbshipit-source-id: 7762d13f070035cfc7ce9559c3cc2dd0e228b4a8
Summary:
Although D39042765 (a04fc2e9b3) appeared to successfully produce `.deb` files, it turns
out that they would only work if you already had the requisite package
dependencies installed. For example, running `hg --version` on a clean
Ubuntu instance would yield:
```
hg: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
```
It turned out that our `DEBIAN/control` file was missing a key `Depends:` line
to tell `dpkg` what dependencies to install. Once again, I decided to look and
see how wezterm deals with this, and the solution appears to be `dpkg-shlibdeps`:
https://github.com/wez/wezterm/blob/97eaa58112a4/ci/deploy.sh#L234,L240
`dpkg-shlibdeps` looks at your executables and, based on the symbols, determines
what the appropriate packages are. For our Ubuntu 22.04 `.deb`, this turns out to be:
```
Depends: libc6 (>= 2.34), libgcc-s1 (>= 4.2), libpython3.10 (>= 3.10.0), libssl3 (>= 3.0.0~~alpha1), zlib1g (>= 1:1.1.4)
```
Apparently you cannot have a package in the `Depends:` line that comes from a PPA,
so if you want to make your `.deb` easy for users to install, that means you should
limit your dependencies to "standard" packages for the distro. In our case, that meant
that our Ubuntu 22.04 `.deb` should use Python 3.10 instead of Python 3.8 (which we
previously fetched from `ppa:deadsnakes/ppa`).
In order to support this, this diff makes a number of changes:
- Adds logic to `setup.py` to check the `PY_VERSION` environment variable to decide
whether to use Python 3.10 or something else.
- Updates `gen_workflows.py` to define different Python deps based on the Ubuntu version.
- Updates `gen_workflows.py` to remove the logic that uses the `ppa:deadsnakes/ppa`.
- Ran `buck2 run //eden/oss/ci:gen_workflows -- eden/oss/.github/workflows/` to update the GitHub Actions
- Moved the logic for the `deb` target in the `Makefile` into a separate shell script because
it was getting too complex to express directly in Make.
- Introduced separate `deb-ubuntu-20.04` and `deb-ubuntu-22.04` targets in the `Makefile`.
- Updated `bytearrayobject.rs` to support Python 3.10 in addition to Python 3.9.
- Updated `pick_python.py` to consider `python3.10` if `python3.8` is not found before going
down the rest of the list.
As you can see in the Test Plan, we are *really close* to things "just working," but we also have
to register `git` as a dependency, which is not discovered by `dpkg-shlibdeps`. This will be
addressed in D39156794.
Reviewed By: DurhamG
Differential Revision: D39156794
fbshipit-source-id: ca1e0a73096e0de97230804a97f316114b8bfc2e
Summary:
We want to rename away from "mercurial". Rather than rename the "mercurial" Python package, we opted to just collapse it into the parent "edenscm" package. This is also a step towards further organizing we want to do around the new project name.
To ease the transition wrt hotfixes, we now replace "edenscm.mercurial" with "mercurial" to fix imports within base64-python extensions.
Reviewed By: sggutier
Differential Revision: D38943169
fbshipit-source-id: 03fa18079c51e2f7fac05d65b127095da3ab7c99
Summary: We since internally we will start to refer to `hg` as `sapling`, the `hgext` directory does not make that much sense now. This diff renames the `hgext` directory to `ext`, as well as all the references to it.
Reviewed By: jordanwebster
Differential Revision: D38914577
fbshipit-source-id: 2d01fc9ead26f309d9021ffe34e0812e0f2a13b7
Summary:
The suggestions of using `pycompat` was to use the `bytes` type instead of
Python 3 stdlib `str` type. We use Python 3 stdlib `str` widely so those
suggestions are no longer needed.
Reviewed By: DurhamG
Differential Revision: D38722187
fbshipit-source-id: 0023ddc31aa082dd18592102964a0416be65c483
Summary:
Currently the memctx constructor takes parent nodes, which means a
memctx can't be on top of another memctx. Let's change it to take a context
instead.
This is causing a bug in 'hg amend --to' which expects to be able to create a
stack of memctxs and perform a rebase like operation onto them.
Reviewed By: quark-zju
Differential Revision: D36872499
fbshipit-source-id: 04a3d0ab6841f5e125592da033013591e890ef72
Summary:
Applies the black-fbsource codemod with the new build of pyfmt.
paintitblack
Reviewed By: lisroach
Differential Revision: D36324783
fbshipit-source-id: 280c09e88257e5e569ab729691165d8dedd767bc
Summary:
From https://www.mercurial-scm.org/repo/hg/rev/f554f89a2038 it seems
the `seq.py` is for OS X <= 10.10 compatibility. We don't care about
such old systems so let's just use the standard seq. This also improves
test performance and compatibility with the new Python .t runner.
Reviewed By: DurhamG
Differential Revision: D34790216
fbshipit-source-id: 38dcc8d671773725784c9f774c0a6f8fc2239b46
Summary:
This removes the historical check in our Mercurial codebase that
disallows underscores in names (modulo a substantial allowlist).
Incidentally, upstream Mercurial also relaxed this restriction in Oct 2019:
https://phab.mercurial-scm.org/D2010 (40bbe7b4da).
Note it is neither the goal nor the expectation that we start going around
renaming existing members to include underscores. We expect files to
maintain internal consistency, at least as far as their API names are
concerned. Inevitably, code authored under the old convention may
call into other APIs that favor underscores (and vice versa) such that
we cannot demand 100% consistency within a file.
Reviewed By: quark-zju
Differential Revision: D35597630
fbshipit-source-id: 5e3c02ec2e5810aa58123b5e75b59241a4a1bdbb
Summary:
The old-style class warning only applies to Python 2. I want to use Python 3
dataclass in a future diff.
Reviewed By: DurhamG
Differential Revision: D33518830
fbshipit-source-id: 89a8b653f1ff083975911af7e3e095737635d622
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
Summary:
CentOS 8 `python3` defaults to Python 3.6, which has issues with IPython
shell tab completion. Prefer Python 3.8 to avoid issues.
Note: I also tried Python 3.9 but it seems the Cython we use generates
incompatible code. So I'm sticking to Python 3.8 for now.
Reviewed By: markbt
Differential Revision: D33339419
fbshipit-source-id: 4708a6713ce9ce63ed4bd5e3cc08a3086ae57edb
Summary:
We've been off Python 2 for almost a year. Let's remove the py2
requirement on some tests.
Note, this deletes a few unused extensions: edrecord, gpg, perfsuite, repogenerator, and grepdiff
Reviewed By: quark-zju
Differential Revision: D32654701
fbshipit-source-id: 31d93180d9b2db0b8a92a024f4b80592940a69e4
Summary:
The `edenscm.mercurial.patch.diffhunks`, which is the heart of functionalities like `hg diff` and `hg show`, takes two nodes, and then gets the `changectx` from them to compare the changes.
That works for most cases, but doesn't allow things like `memctx` to be used, as it doesn't have a node.
This refactors so that function (and functions that call it) take a `ctx` instead.
---
EDIT: I just found out `repo[ctx]` returns `ctx`, so I could just pass in context as if it was a node (that is, only fix `changeset_printer` to pass `ctx` to `diffordiffstat`), but the fix on this diff still seems better, more consistent and less unclear, so I still think it should be merged.
Reviewed By: DurhamG
Differential Revision: D31802139
fbshipit-source-id: bc9d23a5e666cd0f57b69bce3ed9d58ae79e92d0
Summary: This is no longer used, now that configerator does it's sync via SCS.
Reviewed By: quark-zju
Differential Revision: D31006839
fbshipit-source-id: ddf7923a3c80ad47519bce0e5cb3895f62e7ae2e
Summary:
Per comment in D30017261 (e9c039ab4a)
> [...] we can get rid of this ESTALE check. That dates back to when edenfs had a bug that returned ESTALE when reading the .eden directory sometimes.
Reviewed By: xavierd
Differential Revision: D30024979
fbshipit-source-id: 645097c8f689c916245845561fd3d824ff7df8b4
Summary:
Non-buck build cannot succeed if Python.h is missing.
Let's check it explicitly so we don't pick a bad Python.
Reviewed By: DurhamG
Differential Revision: D29179295
fbshipit-source-id: 421c824053d066914a6611f05815527768f257ee
Summary:
It turns out that `python3` might be a symlink to a fbcode Python that cannot
perform the build in some (not all) environment. Let's try more names like
`python3.8`, `python3.7`, etc.
Reviewed By: DurhamG
Differential Revision: D29178933
fbshipit-source-id: da6cae351f25a90ab8a9da85282d09f79505c5e7
Summary:
Our BigSur mactest machines have python3 defaulting to some internal
fbprojects python install. This is breaking our OSS builds. Let's change
pick_python to avoid that install.
Note, sys.stdout was changed to print because during my manual testing on Mac,
sys.stdout did not actually print the value, despite the flush. Using print()
did work.
Reviewed By: quark-zju
Differential Revision: D28101632
fbshipit-source-id: 2907d644b2baa8a53a9a2d7da176d33cd83dfbd5
Summary:
The `python` in `PATH` might be the fbcode Python that has `-nostdinc` in its
`CFLAGS`. That Python is problematic because it cannot compile C extensions.
Reviewed By: DurhamG, markbt
Differential Revision: D27661488
fbshipit-source-id: 243205522fcaf53d5af6a3c9afc4d28160072de5
Summary:
a [git worktree](https://git-scm.com/docs/git-worktree) allows for a single repository to have multiple local checkouts in different directories (allowing parallel work on multiple branches of the same repo).
in such a worktree, `.git` is a file and not a directory:
```
$ cat .git
gitdir: /path/to/actual/repo/.git/worktrees/name
```
the `_git_prompt` helper in `scm-prompt.sh` expects only directories:
```
$ echo "$(_git_prompt /path/to/worktree/.git)"
# (output is empty)
```
this amends the helper to support them:
```
$ echo "$(_git_prompt /path/to/worktree/.git)"
f140443f|REBASE-i|T123456
$ echo "$(_git_prompt /path/to/parent/.git)"
T54321
```
Reviewed By: quark-zju
Differential Revision: D27509147
fbshipit-source-id: 9a4ab55af99538c6425ad5721c3266386dbda453
Summary:
Copied from D17312417 (e1f4dbeb3d), because that did what I needed done, but incremented by 1.
I would like to change the length of the displayed hash in scm-prompt
to 9. Why such an impactful diff? Because hg sl shows 9 characters, and I
always get confused when the hash in my prompt doesn't match hg sl
Reviewed By: kulshrax
Differential Revision: D25934253
fbshipit-source-id: 15f2bc8bc7d666de1a077d2bafd74ab3c9753341
Summary: We don't use obsstore. Its size is irrelevant.
Reviewed By: singhsrb
Differential Revision: D25876066
fbshipit-source-id: 5657c3ca08f5ed1cb5a3d1a5b3395ab74756b7e5
Summary: editmergeps.bat was separating a filename with spaces into args[0] and args[1] when calling editmergeps.ps1. Use proper quoting to send files with spaces as a single argument.
Reviewed By: ikostia
Differential Revision: D25194324
fbshipit-source-id: 065f677c9015681b310e1cfc46f52ff563a35f99
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
Summary: It is handy to test edenapi methods directly.
Reviewed By: kulshrax
Differential Revision: D23750709
fbshipit-source-id: 33c15cecaa0372ba9e4688502e7d8f3fdda7c3b8
Summary:
Those tests are going to break with the latest changelog. We're moving away
from revlog so let's just remove the tests.
Reviewed By: DurhamG
Differential Revision: D22657198
fbshipit-source-id: 6d1540050d70c58636577fa3325daca511273a2b