Commit Graph

17 Commits

Author SHA1 Message Date
Liubov Dmitrieva
10a07cefed add template support to hg cloud sl command
Summary:
add template support to `hg cloud sl` command

it is a bit unusual from user's point of view that it is not supported, now
let's support it

it also provides an easy way to see the full hashes

Reviewed By: markbt

Differential Revision: D41579865

fbshipit-source-id: 92f15394628799ee8f54796387f0055ed8bfac7e
2022-12-06 03:54:57 -08:00
Liubov Dmitrieva
38921ca3a0 add hg cloud log command
Summary:
add `hg cloud log` command to print metadata for commit cloud commits from a
workspace in linear view (without lines to connect nodes)

it used to be possible to get a linear (non graph) view from `hg cloud sl` command with some tricks around templates but it is not possible anymore nowadays, so adding a separate command to make it possible again

the command will be helpful for bulk commit cloud operations without a need of full sync or workspaces switch, see more details here: https://www.internalfb.com/intern/wiki/Commit_Cloud_Sync/#copy-move-all-commits-fr

Reviewed By: mitrandir77

Differential Revision: D41579597

fbshipit-source-id: a08e6c885515318977fc59cd77bdc49fa87ab561
2022-12-06 03:54:57 -08:00
Liubov Dmitrieva
f92f4bcbae clean up token code
Summary:
clean up token code

Client Certs based authentification (user_agent based or X.509 certificate
based, the same as for monoke/edenapi services) is now the only supported way to talk to the Commit Cloud service.

Historically, we had another way to access the Commit Cloud Service, via an
interngraph proxy. The proxy has been shut down a while ago. The auth there was
token based. We supported CAT & OAUth tokens there.

The proxy shut down happened here after all traffic has been migrated to the certs: D29934907

Reviewed By: mzr

Differential Revision: D40098326

fbshipit-source-id: 63a3a8705eb14858ac11c7f8e8784202d08fc481
2022-10-05 10:10:47 -07:00
Jun Wu
00ecfbb16c tests: opt-in new test runner for passing tests
Summary:
A lot of tests are passing with the new test runner.

This is done by `./edit-feature-header.py debugruntest` and paste
the `Passed:` section from `hg debugruntest -v test-*.t` output.

Note: some tests fail with this but pass with debugruntest. They
will be investigated as follow-up.

Differential Revision: D34931992

fbshipit-source-id: 99abc3d9800bb1dd3487dbfa15d715c0bd3ba878
2022-08-16 14:59:23 -07:00
Jun Wu
29e7b751bb dag: use utils::beautify_graph to implement beautify()
Summary:
Replace the old implementation. The new implementation is simpler and handles
"merge" better.

Reviewed By: DurhamG

Differential Revision: D35588646

fbshipit-source-id: 48cbea46ab9aa94d91b1c5b112135f8a9a82aff9
2022-07-18 16:29:16 -07:00
Durham Goode
e9e0539cc1 filepeer: disable use of filepeer by default
Summary:
We want to remove filepeer as part of removing server logic in the
client. To start with, let's disable it by default and only enable it in tests
that need it. The next step will be to update those tests.

Reviewed By: quark-zju

Differential Revision: D30977765

fbshipit-source-id: c56016f017e894a15bf43fb7a8d3a0a417663ad9
2021-09-22 18:03:29 -07:00
Jun Wu
9bf6b674a6 config: use Rust graph render as default
Summary: Change the legacy Python graph render to Rust renderer.

Reviewed By: DurhamG

Differential Revision: D24317802

fbshipit-source-id: 4c3dc3a6dd02b7ebe79596a8e77f4b6b139d2e20
2020-10-19 17:07:30 -07:00
Liubov Dmitrieva
cc2b5c04ca imrove authentication handling
Summary:
There have been lots of issues with user experience related to authentication
and its help messages.

Just one of it:
certs are configured to be used for authentication and they are invalid but the `hg cloud auth`
command will provide help message about the certs but then ask to copy and
paste a token from the code about interactive token obtaining.

Another thing, is certs are configired to use, it was not hard to
set up a token for Scm Daemon that can be still on tokens even if cloud
sync uses certs.

Now it is possible with `hg auth -t <token>` command

Now it should be more cleaner and all the messages should be cleaner as well.

Also certs related help message has been improved.

Also all tests were cleaned up from the authentication except for the main
test. This is to simplify the tests.

Reviewed By: mitrandir77

Differential Revision: D22866731

fbshipit-source-id: 61dd4bffa6fcba39107be743fb155be0970c4266
2020-07-31 10:16:59 -07:00
Mark Thomas
c1e91b47fc cmdutil: remove graph-renderer hint
Summary: This hint has served its purpose.  Remove it.

Reviewed By: farnz

Differential Revision: D21658927

fbshipit-source-id: 0395fa2cb898732b2c64154104c703a428f62864
2020-05-20 08:06:21 -07:00
Jun Wu
b2c1d90f22 commitcloud: use dag operations to simplify 'hide' logic
Summary:
Now we have a virtual DAG that can be queried. Use that to figure out what
heads to hide and add instead of manually traversal through the graph.

Also did some tweaks to fix Python 3 compatibility and make the parent graph
style a bit more correct.

Reviewed By: markbt

Differential Revision: D21554672

fbshipit-source-id: 749d7938a8612e21c5975d9b80a275a059de022d
2020-05-14 12:03:46 -07:00
Jun Wu
791ec223ba commitcloud: use Rust dag abstractions for smartlog rendering
Summary:
This simplifies a lot of the code, and makes it possible to do DAG queries like
ancestors, descendants on the commit cloud graph.

Reviewed By: markbt

Differential Revision: D21554674

fbshipit-source-id: ee08cddfc162a7546d63d4bf385f2948fc799fd3
2020-05-14 12:03:45 -07:00
Jun Wu
285e883c0a commitcloud: only use the Rust graph renderer
Summary:
The only reason that we keep the legacy renderer is that `hg-sl-up` parses
`hg sl` output and breaks with the new Rust renderer. `cloud sl` does not
have such issues so we can switch to the new renderer unconditionally.

Together with the previous change, this allows the upcoming change to render
the graph without using revision numbers.

Reviewed By: markbt

Differential Revision: D21554670

fbshipit-source-id: eee5fbd641096b38e206298f9e716df358a7ab7e
2020-05-14 12:03:44 -07:00
Durham Goode
54484268fb py3: more commit cloud fixes
Summary:
Notably, we drop all the encoding business when dealing with json
objects, and instead use mercurial.json.

Reviewed By: sfilipco

Differential Revision: D19888130

fbshipit-source-id: 2101c32833484c37ce4376a61220b1b0afeb175a
2020-02-28 11:32:16 -08:00
Jun Wu
ae8f6ff8e8 tests: opt-in DUMMYSSH_STABLE_ORDER for more tests
Summary: This should help reduce test flakiness.

Reviewed By: xavierd

Differential Revision: D19872952

fbshipit-source-id: d66f6c404534b3f47903b478e3cdfdda5ed46284
2020-02-27 17:54:08 -08:00
Zeyi (Rice) Fan
92f6f35e7a mark all tests requiring Python 2
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.

After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.

To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:

```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```

or

```
HGTEST_FORCE_PY2=1 python run-tests.py
```

----

Basically this diff are created with the following commands:

```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```

(Note: this ignores all push blocking failures!)

ignore-conflict-markers

Reviewed By: singhsrb

Differential Revision: D19655148

fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
2020-01-30 18:49:21 -08:00
Jun Wu
75a8173a10 tests: enable chg for 572 tests
Summary:
Add `#chg-compatible` to 572 tests that seem to pass with chg enabled.
This should make them run faster.

Reviewed By: xavierd

Differential Revision: D18870507

fbshipit-source-id: fe895e733efffc9286cd3d17c7a156c803124395
2019-12-09 15:26:29 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00