Commit Graph

7610 Commits

Author SHA1 Message Date
Jun Wu
a2694e29d0 config: drop pest for parsing hgrc
Summary:
The hgrc format is quite simple. Writing a parser directly actually has similar
complexity to the pest parser, but with improved performance. Therefore let's
migrate off pest.

Before:
  % buck2 run @//mode/opt :bench --
  parse 645KB file                                   89.872 ms
  load system and user                                1.877 ms
  load repo                                           4.107 ms

After:
  % buck2 run @//mode/opt :bench --
  parse 645KB file                                   31.501 ms
  load system and user                                0.757 ms
  load repo                                           2.360 ms

Reviewed By: zzl0

Differential Revision: D42054371

fbshipit-source-id: 7dc84154cabec52ed7910e12fbac894845770076
2022-12-15 20:04:29 -08:00
Jun Wu
6088810cc0 config: clean up based on debugduplicatedconfig output
Summary: Manual clean up based on `debugduplicatedconfig` output.

Reviewed By: muirdm

Differential Revision: D42036005

fbshipit-source-id: 4a32dd284ade2e10e826afad6e97981322b4f040
2022-12-15 18:24:16 -08:00
Jun Wu
93cf6a2938 commands: add debugduplicatedconfig
Summary: Add a way to find duplicated or overridden configs for cleanup purpose.

Reviewed By: muirdm

Differential Revision: D42035995

fbshipit-source-id: 138964ffcfb9896ea69a850d1a9369405cedfa99
2022-12-15 18:24:16 -08:00
Jun Wu
f2847d7eb9 config: drop configs.remote_allowlist
Summary:
It's a super long (>4K) config. Code search shows it's not used anywehere.
Therefore let's drop it.

I checked that `configs.legacylist` is also unused.

Reviewed By: muirdm

Differential Revision: D42036006

fbshipit-source-id: 82b886b9eb6abb50cacef7ee0f868280d45ab0a8
2022-12-15 18:24:16 -08:00
Jun Wu
f0e24b5c97 config: move part of dynamicconfig to static config
Summary:
Part of the internal dynamicconfig logic is actually just static. Move the most
obvious function common() to static config to avoid parsing overhead.

I dropped "DO NOT ADD NEW ENTRIES IN THIS FUNCTION !!!" since it no longer
applies - there is no function, and the static config macro is the right place
to update static configs.

Reviewed By: muirdm

Differential Revision: D42036002

fbshipit-source-id: a815715c83b751340e0181e4630371fe3b6f7932
2022-12-15 18:24:16 -08:00
Jun Wu
58a215681d config: move opensource as static sapling config
Summary:
Move the opensource dynamicconfig to statically compiled config used by the
Sapling identity. This should reduce parsing time and make the internal `sl`
behave more closely with the external `sl`.

Reviewed By: muirdm

Differential Revision: D42036011

fbshipit-source-id: d45d6de0bac49d2d9397ff0556a4130cf7c93a84
2022-12-15 18:24:16 -08:00
Jun Wu
9ac87d66b7 config: drop HG_NO_DEFAULT_CONFIG
Summary:
The TESTTMP check is sufficient. All places setting HG_NO_DEFAULT_CONFIG
already have TESTTMP set.

Reviewed By: muirdm

Differential Revision: D42036001

fbshipit-source-id: a1cf4f7a02917fcfee51d581b1bb6d5a81572c70
2022-12-15 18:24:16 -08:00
Jun Wu
72a9940312 config: move merge-tools and core to static_config!
Summary:
Use the `ConfigSet::secondary` added by D42023337 to include statically
compiled builtin merge-tools and core python configs. This avoids parsing cost.

Reviewed By: muirdm

Differential Revision: D42036010

fbshipit-source-id: 20bd724c31c4b5924c7124a35c859c9c66784c5d
2022-12-15 18:24:16 -08:00
Jun Wu
8e6ba3b0a8 config: make ensure_location_supersets print full path in tracing messages
Summary:
The "dropping" tracing messages would be useful to figure out exactly what
parts of config files are ignored.

Reviewed By: muirdm

Differential Revision: D42035997

fbshipit-source-id: 7f9f92510d445b23d357ff3fd6f891f14dbc4f80
2022-12-15 18:24:16 -08:00
Jun Wu
7fe0ef4d21 pyconfigloader: drop validate
Summary:
The underlying Rust method `ensure_location_supersets` only needs to be called once.
It's already called for `load` and `reload` paths. Therefore it's unnecessary
to call `ensure_location_supersets` again.

Reviewed By: muirdm

Differential Revision: D42036012

fbshipit-source-id: e181775a88880ea95da6399996367d1e30a8b31e
2022-12-15 18:24:16 -08:00
Jun Wu
56b43fea0b config: remove SupersetVerification
Summary: See the previous diff for context. Remove it since it's no longer used.

Reviewed By: muirdm

Differential Revision: D42025934

fbshipit-source-id: 31598893c78b103fa09d262f107c660aeb3a566a
2022-12-15 18:24:16 -08:00
Jun Wu
8036cae2fc config: remove unused logic in ensure_location_supersets
Summary:
`ensure_location_supersets` has 2 features:
1. Verify hgrc.dynamic matches /etc configs. Report mismatches. This was the
   initial purpose as you can see from the function docstring. At that time
   the idea was that dynamicconfig matches /etc configs exactly (we no longer
   do that).
2. Enforce `configs.allowedlocations` and `configs.allowedconfigs`. This was
   added later - wasn't mentioned in docstring.

Feature 1 does not actually work, since the filenames of the /etc configs are
supposed set by `configs.validationsubset`, but is empty in production setup.

Worse, the existing logic would treat all config items as "mismatch" and
`uiconfig.reportissues` will report near 1000 config items.

Since feature 1 is already not working as intended, this diff drops it.
Logging via Rust tracing is added for changes by feature 2. Note we cannot
rely on Python `uiconfig.reportissues` logging because
`ensure_location_supersets` is called multiple times and it can only report
mismatches the first time, while the Python code does not call it the first
time.

Reviewed By: muirdm

Differential Revision: D42024668

fbshipit-source-id: fbe5cf42e45fb1e68e2d32ec27fbdfe00cb62170
2022-12-15 18:24:16 -08:00
Jun Wu
ce7a311b1a config: add benchmarks loading real configs
Summary:
Add a way to get some ideas about the overhead of config loading.

An example benchmark run shows:

  $ cargo bench --bench bench -- system
  load system and user                                1.873 ms
  load repo                                           2.052 ms

Reviewed By: muirdm

Differential Revision: D42036000

fbshipit-source-id: 3f566fb0c3f8369d3e257f845b4d803a6742dd26
2022-12-15 18:24:16 -08:00
Jun Wu
7637c9cae0 config: fix configloader benchmark
Summary: Fix compile of the benchmark logic.

Reviewed By: muirdm

Differential Revision: D42035999

fbshipit-source-id: 00d59f033bd3caf128d72b127908e952e6fb1aac
2022-12-15 18:24:16 -08:00
Jun Wu
6d961bd3f8 config: support abstracted secondary config as fallback
Summary:
This makes ConfigSet more flexible. It can include other kind of configs
(ex.  staticconfig, unionconfig, etc) to form layers of configs.

Reviewed By: muirdm

Differential Revision: D42023337

fbshipit-source-id: 436b688bb4aa661a5dbaf5086e11f6edf7affb7b
2022-12-15 18:24:16 -08:00
Michael Bolin
e77e67bba7 reserve GitHub issue number for new pull request
Summary:
Historically, I was under the impression that it was impossible
to create a pull request with a specific number. As you can see
in this diff, we had a `guess_next_pull_request_number()` helper
function that had a "pretty good" heuristic for guessing the next
pull request number, which made it likely that we could make
the number encoded in the branch name match that of the PR.
Unfortunately:

- This heuristic was not guaranteed to work 100% of the time,
  due to either races or deleted issues that could throw off the count.
- Using this heuristic required that we create the pull requests
  serially [from bottom to top of the stack] rather than in parallel.

However, today while reading the REST API docs for creating a
pull request (https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#create-a-pull-request),
I noticed it was possible to specify an `issue`:

> An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified.

Ah ha! This meant we could first create a number of GitHub
issues (in parallel!) with placeholder data and then use the numbers
from these issues when creating pull requests (also in parallel)!
This also means we know the PR number when choosing the branch
name (recall the branch cannot be changed after creating the PR).

This diff updates the existing `sl pr` command to take advantage
of this information.

Reviewed By: muirdm

Differential Revision: D42050143

fbshipit-source-id: a52694f6599c4ba99f568c538d557e6d10db72a6
2022-12-15 11:54:11 -08:00
Michael Bolin
6e9c3d7a66 add --draft option to sl pr submit
Summary:
With this change, running `sl pr submit --draft` will create any *new*
pull requests in draft mode. Commits already associated with a pull
request will not have their draft status changed.

Reviewed By: muirdm

Differential Revision: D42048510

fbshipit-source-id: fd1d1f1f1268b4deb9135f0f75115bbcc48d9ebe
2022-12-15 11:54:11 -08:00
generatedunixname89002005325677
6e51f16156 Daily arc lint --take RUSTFMT
Reviewed By: muirdm

Differential Revision: D42063430

fbshipit-source-id: b8d8c3c376385e1539ab4640121f71ae3f5755f7
2022-12-15 07:22:15 -08:00
generatedunixname89002005307016
6f4ce82bee Add annotations to eden/scm/edenscm/ext/lz4revlog.py
Reviewed By: yancouto

Differential Revision: D41996356

fbshipit-source-id: bcecf60bc784e81159483e42e7237e65df8366f1
2022-12-15 07:13:32 -08:00
generatedunixname89002005307016
6bd0b690ad Add annotations to eden/scm/edenscm/eden_dirstate_map.py
Reviewed By: yancouto

Differential Revision: D42068065

fbshipit-source-id: 197270808a20a0043fdef5f3b206265443048fe3
2022-12-15 07:12:38 -08:00
generatedunixname89002005307016
fba6e0daf7 Add annotations to eden/scm/edenscm/ext/gitrevset.py
Reviewed By: yancouto

Differential Revision: D42032097

fbshipit-source-id: a3c5d8227acb3080325ddcccc02aab9dc5bdb1f1
2022-12-15 07:10:45 -08:00
generatedunixname89002005307016
b031a64e72 Add annotations to eden/scm/edenscm/hintutil.py
Reviewed By: yancouto

Differential Revision: D41942602

fbshipit-source-id: 5e73bc406ab66460c16ac45025184dbfbc54c600
2022-12-15 07:10:45 -08:00
Michael Bolin
56b5e3e180 remove default subcommand for sl pr but add s as alias for submit
Summary:
As we are going to add more flags for `sl pr submit`, it no longer
works well to use `submit` as the default command. Though we
add `s` as an alias for `submit` so it does not require much typing.

Reviewed By: zzl0

Differential Revision: D42047829

fbshipit-source-id: 782339a44ec5b548b6fc5e61a32f8fb05c0c8fe4
2022-12-14 22:49:34 -08:00
Jun Wu
c05420d362 config: make configmodel::Config require Send + Sync
Summary: This makes it easier to use for trait objects.

Reviewed By: muirdm

Differential Revision: D42024292

fbshipit-source-id: 490f817c368d472f4741830d2d7269ee38f9ada2
2022-12-14 14:53:51 -08:00
Jun Wu
32ca0ddd21 config: add ConfigSet::named
Summary: Add a way to specify a name to `ConfigSet`.

Reviewed By: muirdm

Differential Revision: D42024078

fbshipit-source-id: bb530e8fa6d2bf3ac7f73ca0ff076e60ac2887ea
2022-12-14 14:53:51 -08:00
Jun Wu
ce428d0917 config: add UnionConfig::push
Summary:
This makes it possible to modify a UnionConfig on the fly without recreating it
from scratch.

Reviewed By: muirdm

Differential Revision: D42024079

fbshipit-source-id: 7c583cacc7a4602b29ec1ad1a4cef910ffc8a357
2022-12-14 14:53:51 -08:00
Jun Wu
086800fca1 config: preserve %unset in ConfigSet::to_string
Summary: Preserve `%unset` in String -> ConfigSet -> String round-trip.

Reviewed By: muirdm

Differential Revision: D42022087

fbshipit-source-id: 6803b4a1c988d228d0db2e4e73b7f2ffccf2ccf6
2022-12-14 14:53:51 -08:00
Jun Wu
e382aa9d77 config: impl Default for UnionConfig
Summary: This will be used by the next change.

Reviewed By: muirdm

Differential Revision: D42022088

fbshipit-source-id: 0df90da6a0a515e1a0e0030d94aa86ea6950b9b5
2022-12-14 14:53:51 -08:00
Jun Wu
853cd5a192 config: rename parser to loader
Summary:
The name "parser" no longer accurately reflects what the code does. Rename it
to "loader" to clarify.

Reviewed By: muirdm

Differential Revision: D42018937

fbshipit-source-id: 22a115b2277e78e48c4ac75d75c97d0ec0ff1a37
2022-12-14 14:53:51 -08:00
Jun Wu
3bf3d98f0d config: move ConfigSet to a standalone crate
Summary:
The configparser became too bloat with dynamicconfig logic.

Move its core structure `ConfigSet` to a standalone crate so code using
`ConfigSet` have a lightweight alternative, and `ConfigSet` logic can
be developed independently without coupling with dynamicconfig.

Reviewed By: muirdm

Differential Revision: D42018678

fbshipit-source-id: 45d1e9458fdaa65b0242bad59dfd76c46dd516d1
2022-12-14 14:53:51 -08:00
Jun Wu
b8b85e53da config: remove parser/CMakeLists.txt
Summary: It is no longer referred in other CMakeLists files.

Reviewed By: muirdm

Differential Revision: D42021268

fbshipit-source-id: d172a8ecf82c4764fc4477d0391015a3ec89961e
2022-12-14 14:53:51 -08:00
Jun Wu
b90a24fedc configparser: move set_overrides to hg.rs
Summary:
It is only used by hg.rs. Move it to decouple the core ConfigSet features from
hg's business logic (`--config` flags).

Reviewed By: muirdm

Differential Revision: D42018679

fbshipit-source-id: a33b9adf0217288ec7bea997a6e3b81fb35cc123
2022-12-14 14:53:51 -08:00
Jun Wu
0ce132f975 config: change Config::layers definition
Summary:
Previously it requires the sub-configs to match their parent config.
That actually seems inflexible. Relax the requirement so it can be
used in more places.

Reviewed By: muirdm

Differential Revision: D42018680

fbshipit-source-id: bf2be4cfe23175ce32738872a16efe906fbc5d29
2022-12-14 14:53:51 -08:00
Jun Wu
3842c4accc pyrevisionstore: migrate off ConfigSet
Summary: Use abstraction to be more flexible.

Reviewed By: muirdm

Differential Revision: D42011185

fbshipit-source-id: 419edb17376a6939a8eac98653b6cac20464544f
2022-12-14 14:53:51 -08:00
Jun Wu
f7a2a78c8c auth: migrate off ConfigSet
Summary: Use lighter weight `static_config!` for testing.

Reviewed By: muirdm

Differential Revision: D42011187

fbshipit-source-id: 3aadc94c5e06889d5de6a7435f90bb775074b393
2022-12-14 14:53:51 -08:00
Jun Wu
e5777d8a76 workingcopy: use abstraction for config reading
Summary:
This allows `workingcopy` to work with other config implementations like
`UnionConfig` not just `ConfigSet`.

Reviewed By: muirdm

Differential Revision: D42011186

fbshipit-source-id: a721922511b900a977e9e629088197f0742ea21c
2022-12-14 14:53:51 -08:00
Zhaolong Zhu
c503c7e3d7 github: move GraphQL queries into consts module
Summary: move GraphQL queries into consts module, so they can be reused by tests.

Reviewed By: bolinfest

Differential Revision: D42035497

fbshipit-source-id: 0f43e6b43a43c15b61f696858abdd5ae230a2c45
2022-12-14 14:39:39 -08:00
Andres Suarez
7496bd072c update various deps
Reviewed By: davidbarsky

Differential Revision: D42005719

fbshipit-source-id: 2b587ec2afda5d2f21d5ca5ff409262426489241
2022-12-13 13:37:15 -08:00
Zhaolong Zhu
27b08f102a tests: add sl shell function
Summary: define `sl` as a shell function to `HGIDENTITY=sl hg`

Reviewed By: quark-zju

Differential Revision: D41965294

fbshipit-source-id: eb3eebb0dc184a3aae4bcb6ab541a42f9e8b82f8
2022-12-13 13:03:36 -08:00
Muir Manders
3da7d0b7f2 goto: log "update_distance" on edenfs
Summary: Move the update_distance log up so it fires for the Edenfs case as well.

Reviewed By: quark-zju

Differential Revision: D41750022

fbshipit-source-id: 48df0a58c009bc5bb87d76495d942a53f3089d1a
2022-12-13 10:22:25 -08:00
Michael Bolin
7ae28228a3 honor signed commits in sl pr
Summary: Pass `-S` with the keyid when `sl pr` calls `git commit-tree`, if appropriate.

Reviewed By: quark-zju

Differential Revision: D41914284

fbshipit-source-id: cd9a4333ef1a5b377595da8aa97b6936b4253cd8
2022-12-12 14:26:34 -08:00
Michael Bolin
0bbd19f6d9 honor signed commits in ghstack
Summary: Pass `-S` with the keyid when `ghstack` calls `git commit-tree`, if appropriate.

Reviewed By: quark-zju

Differential Revision: D41791483

fbshipit-source-id: 7384d5dfc2775e5268b6c3a221bc64a54ac32804
2022-12-12 14:26:34 -08:00
Michael Bolin
f6bef0c4c6 support signing Git commits using a GPG key
Summary:
This was requested for `sl pr` in
https://github.com/facebook/sapling/issues/218,
though this diff adds support for signing commits in general, in Sapling.
Here's how it works:

- `sl config --local gpg.key <KEY>` to specify your key
- Now `gitcommittext()` takes an optional `str` for the `gpgsigningkey` if `gpg.key` is set and `gpg.enabled` is `true` (which is the default).
- The text of the unsigned commit object is constructed and then signed using `gpg --status-fd=2 -bsau <KEY>` with the text passed via stdin.
- The resulting signature is embedded into the original text to sign it. Note that the original PGP key goes through some minor formatting (`\r` is removed; lines must start with a space to avoid a `\n\n` sequence) before it is embedded.

I documented things to the best of my knowledge in `eden/website/docs/git/signing.md`.

Follow-up items:

- Show signed status in smartlog?
- Update `sl ghstack` to honor signing configuration when running `git commit-tree`.
- Update `sl pr` to honor signing configuration when running `git commit-tree`.

Reviewed By: quark-zju

Differential Revision: D41778874

fbshipit-source-id: 5018a0d8bea1b5e9293c05954db65f35dd3c7aff
2022-12-12 14:26:34 -08:00
Michael Bolin
313ec4baf4 autoformat
Summary:
This was flagged in D41921132 (a443a6cfef), but I ignored it so I could
land the diff without commandeering to give sggutier credit
for authoring it while he's OOO.

Reviewed By: quark-zju

Differential Revision: D41972389

fbshipit-source-id: 9e0a4e6aff9371f70a4fba8257a88c4c77e2d190
2022-12-12 13:23:26 -08:00
Saul Gutierrez
a443a6cfef bump Python in Github macOS actions to 3.11 (#319)
Summary:
The latest Homebrew bottles for Apple Sillicon macOS built by our Github Actions were broken, as mentioned in https://github.com/facebook/sapling/issues/315 . This was caused due to updating the Formula template used by our Github actions to 3.11 but not updating the Github actions themselves to Python 3.11. This commit fixes that last part.

Pull Request resolved: https://github.com/facebook/sapling/pull/319

Test Plan:
Triggered a [build on a fork of the sapling repo](https://github.com/sggutier/sapling/releases/tag/0.1.20221211-120017-rcd410769), downloaded the bottle built by it, and checked that it ran properly on my M1 mac:

```
$ sl --version
Sapling 0.1.20221211-120017-rcd410769

$ file $(which sl)
/Users/sggutier/homebrew/bin/sl: Mach-O 64-bit executable arm64

$ otool -L $(which sl)
/Users/sggutier/homebrew/bin/sl:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60158.100.133)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
        /Users/sggutier/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
        /Users/sggutier/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
        /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 1163.100.19)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1141.1.0)
        /Users/sggutier/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/Python (compatibility version 3.11.0, current version 3.11.0)
        /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)

$ sl dbsh -c "import sys; print(sys.version)"
3.11.0 (main, Nov 28 2022, 13:49:33) [Clang 14.0.0 (clang-1400.0.29.202)]

$ sl clone https://github.com/sggutier/sapling/ saplingtest && cd saplingtest && sl
remote: Enumerating objects: 677771, done.
remote: Counting objects: 100% (2847/2847), done.
remote: Compressing objects: 100% (1469/1469), done.
remote: Total 677771 (delta 1396), reused 2692 (delta 1261), pack-reused 674924
Receiving objects: 100% (677771/677771), 175.60 MiB | 2.59 MiB/s, done.
Resolving deltas: 100% (454743/454743), done.
From https://github.com/sggutier/sapling
 * [new ref]               2857ac6b96 -> remote/main
6535 files updated, 0 files merged, 0 files removed, 0 files unresolved
@  2857ac6b9  Today at 11:33  mbolin  https://github.com/facebook/sapling/issues/317  remote/main
│  Add build instructions for Windows (https://github.com/facebook/sapling/issues/317)
~

$ touch something && sl st
warning: watchman has recently started (pid 1093) - operation will be slower than usual
? something

$ cd eden/scm && sl root
/Users/sggutier/saplingtest
```

Reviewed By: bolinfest

Differential Revision: D41921132

Pulled By: sggutier

fbshipit-source-id: 0ed4f2d6f214f02669e45c9c4b8cced7de9caa2e
2022-12-12 12:52:55 -08:00
Liubov Dmitrieva
8713ca868d fix "repo changed while backing up" errors for non best effort
Summary:
fix "repo changed while backing up" errors for non best effort runs

metalog reloads on transaction, so let's add a transaction

before that, we had lots of **false positives** "repo changed while backing up" errors because we read cached values

also, enable best effort mode for scm daemon, it locks the whole working copy after https://www.internalfb.com/diff/D34797187 (2e1b3436b3), which is not expected

Reviewed By: markbt

Differential Revision: D41871718

fbshipit-source-id: 14e222d0ccbcd6aa4a6dd773f2889aa0721c9842
2022-12-12 03:22:23 -08:00
Michael Bolin
ba00990cdc rename update to goto in hints/messages/etc.
Summary:
Created this diff by running:

```
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#update --clean#goto --clean#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#update --clean#goto --clean#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#update --continue#goto --continue#g'
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#update --continue#goto --continue#g'
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#prog@ update#prog@ goto#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's# hg update # hg goto #g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#hg update -C#hg goto -C#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's# hg update$# hg goto#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's# update HASH# goto HASH#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#hg update 1#hg goto 1#g'
find eden/scm/tests -name \*.t | xargs sed -i -e "s#'hg update'#'hg goto'#g"
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#:prog:`update`#:prog:`goto`#g'
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#:prog:`update .::`#:prog:`goto .::`#g'
sed -i -e 's#commit or update#commit or goto#' eden/integration/hg/update_test.py
arc f
```

Though then I had to manually update `eden/integration/hg/update_test.py`
to use `assertRegex()` instead of `assertEqual()`, but as noted,
that is a temporary issue due to how we run that
test for EdenFS for Windows internally.

Fixes https://github.com/facebook/sapling/issues/149
Fixes https://github.com/facebook/sapling/issues/293

Reviewed By: zzl0, yancouto

Differential Revision: D41859668

fbshipit-source-id: 3bdf4e342fc1a751335960a3216651a5ce35225f
2022-12-09 13:16:27 -08:00
Zhaolong Zhu
7eebc29dcc pr_status: use GitHubEndpoint instead of make_request
Summary: use GitHubEndpoint instead of low level async make_request, then we will be able to use a fake GitHubEndpoint in testing environment.

Reviewed By: bolinfest

Differential Revision: D41818264

fbshipit-source-id: 4ec511821a2e0fddf17bf384b73f0fc72dccb5b4
2022-12-09 09:50:49 -08:00
Zhaolong Zhu
9825e9dc54 github: add async graphql method in GitHubCLIEndpoint
Summary: Add `async graphql` method in GitHubCLIEndpoint, so other code can use GitHubEndpoint instead of low level `async make_request`, then we will be able to use a fake GitHubEndpoint in testing environment.

Reviewed By: bolinfest

Differential Revision: D41818267

fbshipit-source-id: f3b299d67ff23f4be12e3b19a27c1937030d2d98
2022-12-09 09:50:49 -08:00
Zhaolong Zhu
9bae4a1e45 github: remove github_real.py
Summary: this is not used by current code, remove it so we don't need to refactor this unused code in following diffs.

Reviewed By: quark-zju

Differential Revision: D41818266

fbshipit-source-id: 32674b89e0cdadaa2c1509aa84911d0ce0d58465
2022-12-09 09:50:49 -08:00