Commit Graph

137 Commits

Author SHA1 Message Date
Zhaolong Zhu
c4aedd48c5 copytrace: add debugcopytrace command
Summary:
Add a way to debug copytrace binding, this can be used in .t test for
testing copytrace binding as well

Reviewed By: quark-zju

Differential Revision: D44449566

fbshipit-source-id: 1b5cc6bbf747edd449fb6e98c1bdba9527515353
2023-03-29 08:17:11 -07:00
Jun Wu
3377f02823 debugimportstack: command to import a stack
Summary:
This is the reversed direction of `debugexportstack`, to create commits from
automation. It also supports `goto` and `reset` to support partial commit
(commit, reset), absorb (commit*, reset), amend (commit*, goto) cases.

Reviewed By: muirdm

Differential Revision: D44231010

fbshipit-source-id: 03d2e5a7d577a2c6becb5e7d9f162fea191ad9af
2023-03-27 10:39:27 -07:00
Muir Manders
0d801b07d9 kill phabricator extension
Summary: This doesn't appear used anymore (superseded by phabdiff and phabstatus extensions).

Reviewed By: evangrayk

Differential Revision: D44263215

fbshipit-source-id: 323da45474a6cd1f9df730fdce23f4f42e836fb8
2023-03-23 07:24:46 -07:00
Zhaolong Zhu
5ada2721ca Back out "checkserverbookmark: remove extension and test"
Summary:
Original commit changeset: f120255c4c33

Original Phabricator Diff: D42823312

Reviewed By: quark-zju, mitrandir77

Differential Revision: D44173377

fbshipit-source-id: 91b67299a4eccb6c60d5278bd4b2703d3fc08986
2023-03-17 12:10:13 -07:00
Jun Wu
a2f185cca6 debugexportstack: command to export information of a stack
Summary:
This is intended to be used for ISLv2 stack editing. The command exports
related file contents.

Reviewed By: muirdm

Differential Revision: D43773252

fbshipit-source-id: c8a58c090474efb0e0a79759efc3c7c45e2a97c1
2023-03-07 14:42:13 -08:00
Muir Manders
a46a99bd8c prmarker: collapse this extension into "github"
Summary: The "debugprmarker" command can be part of the github extension.

Reviewed By: quark-zju

Differential Revision: D43208768

fbshipit-source-id: efcba0728d9508c9a02cf1361c5e37b35757ac34
2023-02-16 09:29:54 -08:00
Jun Wu
25aa52bc55 checkmessagehook: inline extension
Summary:
Inline the checkmessagehook extension so it works without using hooks.
Hooks have extra overhead (ex. flushing pending commits, files, metalog, etc so
changes are visible to subprocesses) that is unnecessary for just checking
a commit message.

Reviewed By: zzl0

Differential Revision: D42823936

fbshipit-source-id: 4ca951f4f555ea3b3227656539b4748b83692230
2023-02-01 12:05:24 -08:00
Jun Wu
d7d50df449 checkserverbookmark: remove extension and test
Summary:
`checkserverbookmark` was added by D15450801 (865b8b3a46) for early Mononoke migration.
It is no longer relevant.

Reviewed By: zzl0

Differential Revision: D42823312

fbshipit-source-id: f120255c4c33b919718e46052967d28e7ab772a4
2023-01-30 14:01:19 -08:00
Muir Manders
e8f57d7902 bookmark: support querying remote Git refs
Summary:
Revive the "bookmark --remote" flag to allow querying Git refs. There are some pattern aliases "branches", "tags", and "prs" which can be used for convenience to trim off the leading "refs/*". Or, you can specify "git ls-remote" patterns directly, such as "refs/heads/*", in which case no trimming is done.

Examples:

```
list remote branches:

    sl bookmark --remote

list remote tags:

    sl bookmark --remote tags

list all refs:

    sl bookmark --remote 'refs/*'

list branches from specified path:

    sl bookmark --remote --remote-path my-fork
```

I moved the "--remote-path" flag from the infinitepush extension to the remotenames extension so it can be used for choosing the Git remote. remotenames is a required extension, so this should be safe.

Reviewed By: quark-zju

Differential Revision: D42183496

fbshipit-source-id: 58892fe9203ae7471663faef078e37f90199454c
2022-12-21 13:50:31 -08:00
Muir Manders
8377ef85e6 help: get rid of "hgrc" references in help text
Reviewed By: quark-zju

Differential Revision: D42156408

fbshipit-source-id: ee774e43f979e7ebe61c24cad43a757b8796dc42
2022-12-20 09:23:14 -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
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
Jun Wu
d314974abf test-help: fix test after D41514973
Summary: I forgot to fold this change in D41514973 (a6301adbac).

Reviewed By: zzl0

Differential Revision: D41590388

fbshipit-source-id: 967aaeec1561ce4ed78b16523ce2a0c31aeca1d1
2022-11-29 13:05:04 -08:00
Zhaolong Zhu
197b9343d8 prmarker: move 'debugprmarker' to its own extension
Summary:
Currently, we are using 'debugprmarker' as a post-pull hook,
and if user disables 'github' extension, 'debugprmarker' will become
an undefined command. This diff is to decouple this relationship.

Related issue: https://github.com/facebook/sapling/issues/229

Reviewed By: bolinfest

Differential Revision: D41446533

fbshipit-source-id: 8ec583c123793b97e622b7cb9aeeeca8bd23b0a9
2022-11-22 05:41:22 -08:00
Muir Manders
c4363f362b pull: expand docstring
Summary: Improve docstring to mention Git a bit, give examples and more pointers.

Reviewed By: bolinfest

Differential Revision: D41347502

fbshipit-source-id: 1668be9c18b7e4ef10979d455fb46435cc2b3cd2
2022-11-16 20:31:46 -08:00
Mateusz Kwapich
34470671e2 goto: fix goto command help
Summary: remove mention of checkout, include goto in the main help command

Reviewed By: DurhamG

Differential Revision: D41307245

fbshipit-source-id: dda8ee05d35b1aa2bea6429432bbfe859fe60504
2022-11-15 08:05:54 -08:00
Muir Manders
736e942aeb update various command aliases and synopses
Summary:
- move silly aliases to the legacy list
- simplify some synopses

I left particular flags in the synopsis where I felt the flag was fundamental to the command, or the command had very few flags. Other than that, it doesn't really help much to see a bunch of single letter flags since you have to refer to the help text to see what they do anyway. (Also, the synopses are hand maintained, so they get out of sync easily).

Reviewed By: DurhamG

Differential Revision: D41292832

fbshipit-source-id: e95e70d7d2641bb49ee25683b6ad614d5ef08ae4
2022-11-14 22:21:54 -08:00
Durham Goode
e80e37fc31 init: fix init --git
Summary:
When using `sl`, init --git was failing with a `Invalid config item:
'remotefilelog.reponame' (reponame is not set)` error. This was caused by it
trying to create a treestate before the `git` requirement had been added. This
meant the treestate tried to create a file store which tried to instantiate
eden_api, which tried to read the reponame.

This seems to only have happened in arm64 builds. So far it seems to be because:

- Normally fsmonitor tries to load the dirstate, but fails because of the
  missing git requirement. fsmonitor has special logic that eats all exceptions,
  and instead just silently fallsback to not using fsmonitor.
- During this logic, it actually manages to write some partial dirstate info.
  The presence of this info actually causes later code to avoid trying to write
  a dirstate, and thus avoids the 'loading a dirstate before git requirment has
  been written' issue.
- But, in an arm64 build, fsmonitor fails to load because of a syscall failure
  during watchmanclient::getcanonicalpath(name). On arm64 it gives errno 14 for
  some reason. This causes fsmonitor to simply not load, and all that logic I
  mentioned earlier that does stuff and eats errors, doesn't get loaded at all.

The fix is to not load the treestate until the git store requirement has been
written.

Note, there is still the issue of watchman not loading in arm64 builds. But that
will be fixed later.

Reviewed By: sggutier

Differential Revision: D41288356

fbshipit-source-id: 368826ab2a40bf08db27078cd073baf2e1d2da1f
2022-11-14 17:29:52 -08:00
Muir Manders
0d9527ff6d status: update docstring
Summary:
- minimize aliases
- tweak formatting and wording
- use hashes instead of revision numbers

Reviewed By: bolinfest

Differential Revision: D41271566

fbshipit-source-id: f9190c5d99591f3d2b613685b1a50aba509af284
2022-11-14 14:10:55 -08:00
Muir Manders
785db893ff goto: update docstring
Summary:
- minimize aliases
- tweak wording
- normalize terminology

Note that I ran into really annoying problems due to the existence of this command in Rust and Python. The core problem is that commands are keyed in the command table by the concatenation of the command name and all the aliases. So, Rust and Python have to be exactly in sync, which is extra annoying when legacy aliases are involved. Anyway, I hacked around it for now, but I think the command table should be keyed by just the primary command name and aliases should be data within the table, and perhaps an additional index into the table.

Reviewed By: bolinfest

Differential Revision: D41258862

fbshipit-source-id: b9b3213fa03dc46f4addd5fd8f66ae4da35f3c61
2022-11-14 11:23:45 -08:00
Muir Manders
7832524c0f diff: update docstring
Summary:
- minmize aliases
- normalize some terminology
- replace rev numbers w/ hashes in examples

Reviewed By: bolinfest

Differential Revision: D41229879

fbshipit-source-id: eb8b0418b6cecdeefd61fd5f097b28c83ef93e09
2022-11-13 23:38:55 -08:00
Muir Manders
1c3974b0a9 docs: clarify help for "-I" and "-X" flags
Summary: Clarify that the specified patterns filter "files" rather than "names".

Reviewed By: bolinfest

Differential Revision: D41222451

fbshipit-source-id: c67cedc3e3b656771e6d7bd88a72a102c1758073
2022-11-13 23:38:55 -08:00
Muir Manders
0bdcce807a add: update docstring
Summary:
- Reference .gitignore isntead of .hgignore
- Simplify wording

Reviewed By: bolinfest

Differential Revision: D41222456

fbshipit-source-id: dfbebd671d8616b2e3c30c44f4eae583e4c85a65
2022-11-13 19:24:12 -08:00
Michael Bolin
f04b00a82a rename "bookmarks" command to "bookmark"
Summary:
Note that `bookmarks` will continue to be supported
as an alias of `bookmark` internally.

This sets up the work to declare certain aliases
as "legacy" in D40999729.

Reviewed By: DurhamG

Differential Revision: D40999729

fbshipit-source-id: 20d4dabd1a64ade4d3e71f685f62311be0bff284
2022-11-09 22:58:09 -08:00
Jordan Webster
e34a2ab320 version: fix tests
Summary: In D40979816 (c2804f0d24) we updated the version string from EdenSCM -> Mercurial which broke these tests.

Reviewed By: bolinfest

Differential Revision: D41084451

fbshipit-source-id: 02e05f9b972f69a23d72ea8dc88c13dc05ff750e
2022-11-07 12:02:43 -08:00
Michael Bolin
8202967e20 make "web" the default name for the "isl" subcommand
Reviewed By: evangrayk

Differential Revision: D40724624

fbshipit-source-id: e142a890f31a3a1aa1ce2719c08bb09cfaa10a24
2022-10-26 14:13:56 -07:00
Muir Manders
fbfd276cdb kill hgweb
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
2022-10-05 12:20:12 -07:00
Michael Bolin
d5f0063fd0 move stat extension into core
Reviewed By: quark-zju

Differential Revision: D39866927

fbshipit-source-id: c12c8f7ec191b876fd0a4fd75fa4b195672487b4
2022-09-27 22:40:25 -07:00
Saul Gutierrez
7e1fb849b4 revsets: add debugrevset command
Summary: Adds a debug command for testing the resolution of simple revsets

Reviewed By: DurhamG

Differential Revision: D39486281

fbshipit-source-id: b0c4567e9292d1eb48e208e17bb5f142e0c865a9
2022-09-14 18:02:21 -07:00
Jun Wu
2ce3e0525a debugruntest: add --direct to run without isolation
Summary: This might report test fail as false positive, but could be useful with --profile.

Differential Revision: D38885832

fbshipit-source-id: 11364661b3279faf3dd43395aa3c60b49951ca8a
2022-09-01 17:55:36 -07:00
Muir Manders
44343769f8 collapse edenscm.mercurial package into edenscm
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
2022-08-24 13:45:53 -07:00
Saul Gutierrez
7f8e4f2439 hgext: rename ext to hgext
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
2022-08-23 15:19:05 -07:00
Jun Wu
ccfb75f4c7 debugexportrevlog: command to export a repo to revlog format
Summary:
Now `hg init` can use the "eager repo" format that fully decouples from revlog.
It seems promising to migrate hg's tests off revlog.

However, there is still a revlog dependency in tests: `blobimport` used in
Mononoke tests, and `blobimport` seems having too many features and lacks of
abstraction to be changed confidently.

To continue migrating away from revlog while maintaining Mononoke test
compatibility without O(tests) manual migration, this diff introduces
a `debugexportrevlog` command to export the current repo to the revlog
format that can be read by Mononoke's `blobimport` and upstream hg.

Therefore, the revlog can become just an "export" format (to maintain Mononoke
test compatibility), instead of a "repo" format (to unblock revlog
deprecation).

The code intentionally avoids `revlog.revlog` dependency, by reinventing
revlog in a minimal way - no read, no compression, no delta, no deps on
`revlog.c` or `lz4`, making migrating off revlog easier.

Note the Rust `revlogindex` stays for streaming clone compatibility.

Reviewed By: DurhamG

Differential Revision: D38446492

fbshipit-source-id: 94995bbc0d89e835195e49286e193a8127a314bf
2022-08-15 18:22:28 -07:00
Saul Gutierrez
9d9bcc7d2e help: add type hints to ported Rust commands
Summary: Recently we have partially or entirely ported some Rust commands (`clone`, `config`, `status`), but those commands are missing the type hints for some of its option. These type hints were available in the Python version of these commands, and this diff restores that.

Reviewed By: quark-zju

Differential Revision: D38503325

fbshipit-source-id: f6ef531cf0b655d8fcde1acabc478b866338da79
2022-08-08 15:29:56 -07:00
Saul Gutierrez
90d5d607e0 help: add doctor to help command
Summary: This command was missing from the general help found in the help command for some reason. This adds it to it.

Reviewed By: jordanwebster

Differential Revision: D38440110

fbshipit-source-id: 06c0815be84c429272d45e21c19b3aaf5e9052a8
2022-08-05 07:01:51 -07:00
Jun Wu
0be7ccbb1f patchrmdir: sunset the extension
Summary:
patchrmdir was a workaround to avoid a linux kernel slowness on a particular
workflow (with watchman, on an ext4 filesystem) introduced many years ago.
It's turned off for a while (D36723808) and hasn't caused issues. Let's remove
patchrmdir entirely.

Differential Revision: D38258813

fbshipit-source-id: 125e95a329165453900ad8747459b2bc58933bb2
2022-07-28 17:42:22 -07:00
Carolyn Busch
dee060c433 clone: support cloning non-segmented changelog repos
Summary: Eventually all repos should use the segmented change log, but multibranch support isn't yet ready for the aosp repo. Add a debug command to reuse the wireprotocol streaming revlog download, until we can move onto the segmented changelog format. Note: later on we can optimize this, to write directly into the modern changelog format, instead of migrating from the revlog format afterwards.

Reviewed By: quark-zju

Differential Revision: D37429035

fbshipit-source-id: ae60269ab3aa06fc3dbb4941ebd488e55727209f
2022-07-11 18:51:53 -07:00
Muir Manders
62e883c0dd whereami: kill whereami extension
Summary: This has been double sperseded first by the whereami in the telemetry wrapper, and more recently by an hg Rust implementation.

Reviewed By: DurhamG

Differential Revision: D37348805

fbshipit-source-id: 090630693a84db56ffc84cf2485e1c378ebf7dbf
2022-06-23 16:50:53 -07:00
Jun Wu
8e70abeacf convert: remove extensions and tests
Summary: It's not used in production. Therefore remove it to reduce maintaince burdern.

Differential Revision: D34915616

fbshipit-source-id: 8fa2401336a9b4a709647a11315d11bea9a4b06d
2022-05-24 13:29:39 -07:00
Saul Gutierrez
06e65e9b73 help: fix wrong documentation when running hg help
Summary:
When one tries to get the documentation for commands that exist both in Rust and Python (such as `status` and `clone`), the help documentation for the python one is shown instead of the Rust one. If we have both Rust and Python commands, we should default to the Rust ones.

This also gets rid of the duplicated messages.

Differential Revision: D36173444

fbshipit-source-id: d1bfc8985a0c1edfc5fa9034e1693f811b36c73a
2022-05-16 19:33:08 -07:00
Jun Wu
a6e31de629 debugruntest: initial alternative .t runner
Summary:
An alternative to run-tests.py. Does not shell out to anything
and supports Python code.

Reviewed By: DurhamG

Differential Revision: D34725135

fbshipit-source-id: 686b5996bb6016a8ebad04f804171a9a2fccd6aa
2022-04-20 12:57:30 -07:00
Muir Manders
f895dcbef1 remove taggederror crate and related code
Summary:
taggederror wasn't used and doesn't seem like the direction we want to go in, so excise it.

taggederror allowed for error tagging and error metadata, and was wired around in various places. It tries to solve real problems, but it was too quick to prescribe how things should work without applying the design to see if it works in practice.

Reviewed By: DurhamG

Differential Revision: D34649753

fbshipit-source-id: bc60896f4e1dbe3feb7d5804561392d1f1ebda72
2022-03-17 11:11:53 -07:00
Muir Manders
047722dec9 networkdoctor: add stub CLI "debugnetworkdoctor" command
Summary: Doesn't do anything yet, but will by my entrypoint for functionally testing the network doctor logic.

Reviewed By: DurhamG

Differential Revision: D34649742

fbshipit-source-id: 0b33e5ecf68291c2d8696a5a3a9c08afb7531cfa
2022-03-17 11:11:53 -07:00
Saul Gutierrez
ce24ccc833 top: initial version of hg debugtop
Summary:
This adds a top command for `hg` by leveraging `runlog`. Currently it has four columns:
- `PID`: The process ID of the mercurial command
- `PROGRESS`: In case the process has progress bars, the position of the first one divided by the total of the first one. Otherwise `-`.
- `TIME SPENT`: The number of hours, minutes, seconds, and milliseconds the process has been running for. Has the same format as the original top.
- `CMD`: The `hg` subcommand and its arguments.

By now it prints a table instead of refreshing.

Differential Revision: D33177164

fbshipit-source-id: e2a1f274ca86f392cb086fabb46ddf03c2afdadb
2022-01-06 09:28:04 -08:00
Durham Goode
efe1353320 tests: remove #requires py2
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
2021-12-06 14:59:43 -08:00
Jun Wu
952ba6a66e metalog: add debugexportmetalog
Summary:
The command exports metalog to a git repo for easier investigation (annotate,
log, etc.).

Reviewed By: DurhamG

Differential Revision: D32288414

fbshipit-source-id: 4530810ae9df928274e481585c7c4d99acacb7dc
2021-11-11 12:44:05 -08:00
Durham Goode
b0f3e299fc debug: add debugdiffdirs for watchman
Summary:
Adds a command which prints out which directories were modified between
two diffs. "modified" is defined as "has an immediate child that has been added
or removed". This means just modifying a file will not cause it's parent
directory to be marked changed.

This is used for watchman to report what directories have changed during an eden
checkout.

Reviewed By: quark-zju

Differential Revision: D31698688

fbshipit-source-id: ef90573af3027306501673821ee40b691241b6e4
2021-10-26 14:37:01 -07:00
Durham Goode
222db7daaa git: remove gitgetmeta
Summary:
This was used when we had the legacy hg servers and when we synced with
git. We no longer do either, so let's delete it.

Reviewed By: quark-zju

Differential Revision: D31309315

fbshipit-source-id: 88a6d38b178087d976c44077544af9a5d44172ba
2021-10-18 14:50:53 -07:00
Muir Manders
94ed1c88f5 runlog: add basic runlog CLI command
Summary:
Add runlog command to dump out runlog entries. Supports newline delimited JSON or plain text (currently just outputting pretty debug format).

By default it filters to only show running commands, but --all will show all commands (i.e. including exitted/crashed commands).

Reviewed By: quark-zju

Differential Revision: D31128812

fbshipit-source-id: c5b86f4717c2289a99109ba7754080084d7a3ed0
2021-10-14 09:46:24 -07:00
Durham Goode
556ce94f5d tests: remove filepeer usage from several tests (part2)
Summary:
This is part of removing filepeer. I also enabled treemanifest and
modernclient (i.e. lazy changelog) on a few tests.

Reviewed By: quark-zju

Differential Revision: D31032055

fbshipit-source-id: 6822274ad07303ed86b2ee5dd4e09979f1e215d5
2021-10-12 17:14:09 -07:00