Commit Graph

15 Commits

Author SHA1 Message Date
Xavier Deguillard
9d7bf6b735 dispatch: SIGPIPE do not exist on Windows
Summary:
On Windows, SIGPIPE isn't present in the signal module. This caused the exit
code to raise an exception when trying to install a handler for it.

Reviewed By: DurhamG, strager

Differential Revision: D14655142

fbshipit-source-id: 68ddfc5250a4b706c5bc6a7ad1add37e1ccbe26e
2019-03-27 19:13:55 -07:00
Jun Wu
077313f1af dispatch: move deferred to atexit handler
Summary:
See D14606986 for context. `repo.close` should be protected by not crashing on
stdout or stderr write errors (SIGPIPE or EPIPE). Move `deferred` to `atexit`
handler to get the protection.

Test changes are caused by ordering changes.

Differential Revision: D14607407

fbshipit-source-id: 5a42aefcec395f48b8ecb67426429ef2e41f5666
2019-03-25 18:33:05 -07:00
Jun Wu
7873db8242 ui: silent stdio write errors during atexit
Summary:
This is the first diff of an alternative fix of D14528603. See also D14603974
for context.

We'd like atexit handlers to not crash with EPIPE or SIGPIPE when writing to
stderr or stdout. Therefore disable SIGPIPE signal handler and patch ui methods
to do so.

Differential Revision: D14607159

fbshipit-source-id: 274c5174813d402a7e0b8b5be7c8fcb0524fcdb3
2019-03-25 18:33:05 -07:00
Durham Goode
ce423933c3 tracing: log perftraces to the blackbox
Summary:
Now that we're recording perftraces, let's log their results to the
blackbox if the command exceeds a configurable threshold.

Reviewed By: sfilipco

Differential Revision: D14426366

fbshipit-source-id: 24f261aaa2b089dbc959d709e51de1c0359d976d
2019-03-25 17:12:42 -07:00
Durham Goode
f2b414c324 tracing: add tracing for command dispatch
Summary:
Adds tracing for the command dispatch.  All other traces will be a
child of this root level trace.

Reviewed By: sfilipco

Differential Revision: D14426369

fbshipit-source-id: 2b996e027a2d6b163162bdceba571a3ee2186f6b
2019-03-25 17:12:42 -07:00
Jun Wu
ea16e76336 metrics: make ui.metrics.gauge log to the sampling extension
Summary:
Make it possible to use `ui.metrics.gauge` to collect metrics for a single
command, via the sampling extension.

Differential Revision: D14515775

fbshipit-source-id: e8a53549b00c1bc7b6509a5990a51d955d767d7e
2019-03-20 22:49:18 -07:00
Jun Wu
9e0a7c41a4 subrepo: remove subrepo support
Summary:
Subrepo is another unloved features that we don't want to support.

Aggressively remove it everywhere, instead of just turning off configs.

I didn't spend much time to split this commit so it's smaller and more friendly
to review. But it seems tests are passing.

Reviewed By: sfilipco

Differential Revision: D14220099

fbshipit-source-id: adc512a047d99cd4bafd0362e3e9b24e71defe13
2019-03-11 10:43:55 -07:00
Mark Thomas
38595d6fe3 dispatch: detect stale virtual checkouts and provide advice
Summary:
If Mercurial detects `ENOTCONN` when trying to open the current directory,
there is a high likelihood this is a disconnected eden virtual checkout.
Provide some advice as to what to do: run `hg fs start`.

Reviewed By: strager

Differential Revision: D13888873

fbshipit-source-id: 7619df0681d15b862d1a6f86d90491aa873bf86b
2019-03-08 06:02:22 -08:00
Mark Thomas
9a19e06fee strip: move extension to core and rename to debugstrip
Summary:
Move the strip extension to core.  Rename the command to `hg debugstrip` as it
is not intended for use by users.  Users should use `hg hide` instead.

Reviewed By: quark-zju

Differential Revision: D14185822

fbshipit-source-id: ef096488cb94b72a7bb79f5bf153c064e0555b34
2019-02-25 03:55:08 -08:00
Jun Wu
2dc2a3d2a2 dispatch: do not show help on CommandError
Summary:
CommandError happens if there is an unknown command flag, or a required
argument is missing. The old behavior is to print an error message to
stderr, then start the pager with the command help printed to stdout.

There are 2 problems with that approach:
1. When using mosh, a long help text might flush the actual error to out of the
   screen. The error message will be missed.
2. When captured in shell scripts, the help text printed to stdout would be
   captured, which is almost always undesirable.

The actual motivation of this change is for 2. Zsh themes like bullet-train [1]
uses `hg id -b 2>/dev/null` and we'd like to remove `id -b` support. After that,
the command should not polluate stdout with help text.

[1]: bd88ade263/bullet-train.zsh-theme (L102)

Differential Revision: D14151200

fbshipit-source-id: edd38e91115f96929438379aa2e40edfba560b41
2019-02-20 18:44:35 -08:00
Jun Wu
fbccd19ed7 patchbomb: remove the extension
Summary:
`test-patchbomb.t` uses named branches and does not look simple to fix.
We don't use email patches internally, and it's not hard to write scripts
around `hg export`. Therefore drop the extension and its tests.

Reviewed By: singhsrb

Differential Revision: D13978577

fbshipit-source-id: 19867ae68c19c996bfce064eb2234705939db9ea
2019-02-12 21:45:10 -08:00
Jun Wu
b74ee0564d chg: make it incompatible with upstream chg server
Summary:
It would be massy if there are 2 chg servers running: one for fb hg, one for
upstream hg, and they share a same socket path.

Change socket path and the commandserver name so fb-hg chg can only talk to
fb-hg chg servers.

Reviewed By: markbt

Differential Revision: D13869319

fbshipit-source-id: f9d42af9bdfc542207f23c536b478fd5ef8d02a0
2019-02-08 16:12:53 -08:00
Jun Wu
c2ef481658 logexchange: delete the experimental component
Summary:
logexchange was a subset of remotenames, added by:

  changeset:   5a62910948d2d4bac5defe305d0ddb22f0fda549  D1547
  user:        Pulkit Goyal <7895pulkit@gmail.com>
  date:        Wed, 04 Oct 2017 10:32:02 -0800
  summary:     remotenames: move function to pull remotenames from the remoterepo to core

Since we use the full remotenames instead, remove logexchange and its test,
which depends on named branch.

Differential Revision: D13954458

fbshipit-source-id: d565c131100ef90f3cf69e9051643ac8e5846f0d
2019-02-07 18:17:18 -08:00
Adam Simpkins
043e2016ac fix some additional edenscm name changes
Summary:
Follow up to D13853115 to fix test failures:
- Update an `__import__` statement in dispatch.py to use the new
  `edenscm.mercurial` package path.
- Make sure the `__version__.py` file is generated at the correct location by
  the buck build files.

Reviewed By: quark-zju

Differential Revision: D13858016

fbshipit-source-id: 54ac4a02274cf921397932e9625f422c5f427623
2019-01-29 12:26:10 -08:00
Jun Wu
c12e300bb8 codemod: move Python packages to edenscm
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.

To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.

Reviewed By: phillco, ikostia

Differential Revision: D13853115

fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e
2019-01-28 18:35:41 -08:00