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
Summary:
Renamed xdiff functions to avoid linking issues when using both libgit2-sys and xdiff.
When using repo_import tool (https://fburl.com/diffusion/8p6fhjt2) we have libgit2-sys dependency for importing git repos. However, when we derive blame data types, we need to use xdiff functionalities (from_no_parents: https://fburl.com/diffusion/pitukmyo -> diff_hunks: https://fburl.com/diffusion/9f8caan9 -> xdl_diff: https://fburl.com/diffusion/260x66hf). Both libgit2 and eden/scm have vendored versions of xdiff library. Therefore, libgit2-sys and eden/scm share functions with the same signatures, but have different behaviours and when we tried to derive blame, it used libgit2-sys's xdl_diff instead of eden's. This resulted in getting segfaults (https://fburl.com/paste/04gwalpo).
Note: repo_import is the first tool that has tried to import both and the first to run into this issue.
Reviewed By: StanislavGlebik
Differential Revision: D22432330
fbshipit-source-id: f2b965f3926a2dc45de1bf20e41dad70ca09cdfd
Summary:
Make zsh_completion complete standard aliases like `checkout`.
This restores the behavior before D18463299 (54451585ce) stack.
Reviewed By: farnz
Differential Revision: D22396737
fbshipit-source-id: 745761041d6d1dec6adba2efb102e2021a01b36b
Summary: Enable the most common autocomplete use cases in zsh hg histedit autocomplete
Reviewed By: fanzeyi
Differential Revision: D22032612
fbshipit-source-id: 1fd47d30564c51a010785d7d0553e3a5d16f163a
Summary:
Added an optional feature to scm-prompt.sh to show the dirty state of the working directory.
Users need to opt in by set the environmental variable `SHOW_DIRTY_STATE` to yes (or whatever nonempty string) in their shell rc file. The idea is that users who do not need/want this feature should see minimal performance hit of their prompt.
Unfortunately, in some (large) repos, calling `hg status` or `git diff` to figure out the dirty state can slow down showing the prompt quite a bit. So, in this case, user can opt out individual repo by setting `shell.showDirtyState` in .hg/hgrc or .git/config.
Reviewed By: ahornby
Differential Revision: D21493543
fbshipit-source-id: 13f7cf2dd2f8d00b58cf2a63dc2cbbf770028411