Commit Graph

10 Commits

Author SHA1 Message Date
Durham Goode
44ef67cc59 tracing: record lfs download size
Summary:
Adds tracing support for recording how many bytes we download for lfs,
including the download speed.

Reviewed By: kulshrax

Differential Revision: D15167587

fbshipit-source-id: fb76bbf15cd44dcef2601d9e750794816d273120
2019-05-03 13:09:33 -07:00
Mark Thomas
528a5b064e util: extract makerandomidentifier from clienttelemetry
Summary: Extract the `makerandomidentifier` function from the `clienttelemetry` extension so that we can use it elsewhere.

Reviewed By: quark-zju

Differential Revision: D14725866

fbshipit-source-id: 0b3ed2e8c9698e892ad0f524f6dde7bf7337f85c
2019-04-04 11:29:49 -07:00
Jun Wu
3039c8dbfb util: trust st_nlink for known filesystems
Summary:
The check was added to "distrust" st_nlink, to workaround issues on CIFS [1].
The check only works for filesystem supporting hardlinks.

If a filesystem is marked as "st_nlink cannot be trusted", then vfs.py will take
a conservative approach to break hardlinks when writing, by copying the file
followed by a rename.

Therefore, filesystems without hardlink support (esp. edenfs) would go through
the slow path - every file written via vfs.py would be copied unnecessarily.

Fix it by skipping the check for known filesystems, including edenfs.

[1]: https://bz.mercurial-scm.org/1866

Reviewed By: DurhamG

Differential Revision: D14527370

fbshipit-source-id: 579111f5c72fa3d016f98c248b29c96afdc59086
2019-03-19 15:39:19 -07:00
Johan Schuijt-Li
3e436ef80b util: increase chunk size from 128KB to 2MB
Summary:
On connections that might experience higher latency the throughput for a clone
is easy to spike, raising the chunk size results in more consistent throughput.

Given that hardware these days has plenty of memory, this change shouldn't make
any significant difference either.

Reviewed By: farnz

Differential Revision: D14502443

fbshipit-source-id: 0e90f955304e9955df0ec69b5733db7c34b09e83
2019-03-18 07:30:23 -07:00
Jun Wu
c0d96cde7d hook: make "mercurial" module available for Python hooks
Summary:
Some hooks (ex. mergedriver) are checked in old release branches. Provide
"mercurial" module compatibility so they won't break.

Reviewed By: mitrandir77

Differential Revision: D14366343

fbshipit-source-id: d47cc4fd512f63e4f6cdc5d7e5ab2c4398216b2f
2019-03-08 16:04:38 -08:00
Mark Thomas
78d4d4ce49 mutation: look-up entries in the store when traversing mutations
Summary:
When traversing mutation entries, if we don't have any information for a
commit, then look instead in the store to see if we have a cached entry
from a non-local commit there.

There aren't any ways of putting entries there, yet.  Those will come in
later commits.

Reviewed By: DurhamG

Differential Revision: D12980776

fbshipit-source-id: 63ff12382eb9294aa43ff100a4fe19b7c05f9e61
2019-03-08 03:05:57 -08:00
Jun Wu
eb0ce36ac2 util: make timer return constant on tests
Summary:
Lots of places use it to print some thing like "fetched x files in y seconds (1KB/s)".

In tests, these have to be manually replaced to "* (glob)" patterns.

This diff makes test output static without using globs. So `run-tests.py -i` would just fix things.

Reviewed By: phillco

Differential Revision: D13954456

fbshipit-source-id: d139c7c5e268d3bab562c266335d740986780924
2019-02-05 20:36:03 -08:00
Mark Thomas
ae0a81f2c2 rust: move bindings to a single python extension
Summary:
Move all Rust bindings to a single python extension, `bindings`.  This should
improve compilation time and make things simpler.

Reviewed By: quark-zju

Differential Revision: D13923866

fbshipit-source-id: 560592b5a6c0c4f1b836c755ef123666a1059164
2019-02-01 17:53:22 -08:00
Jun Wu
9dc21f8d0b codemod: import from the edenscm package
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.

Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.

Reviewed By: phillco

Differential Revision: D13868981

fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
2019-01-29 17:25:32 -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