Commit Graph

16 Commits

Author SHA1 Message Date
Durham Goode
ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -07:00
Durham Goode
3ad4fe7516 manifest: remove manifestdelta optimization
Summary:
Reading filectx info tried to use an optimization to get the filenode
without uncompressing the whole manifest. In a tree world, this optimization
actually hurts performance because it requires downloading the parent tree and
performing a diff. Since everything is now treeonly, let's just drop this
optimization.

This helps in some Eden tests where they prefetch a specific commit then attempt
to access it offline.

Reviewed By: markbt

Differential Revision: D15344433

fbshipit-source-id: 3b6ebc27ce7e263abefaa962856a4c7bea0df793
2019-05-24 10:00:49 -07:00
Durham Goode
1935d046b8 pushrebase: backout change to preload the manifest
Summary:
Backs out D13944829 that add preloading the manifest to pushrebase. In
a situation where you receive tree commits, but the repo is hybrid, this causes
it to try to lookup the bundled tree manifests in the flat manifest revlog.

Let's just back this out for now until we can come up with an appropriate fix,
or move all our repos to treeonly.

Reviewed By: quark-zju

Differential Revision: D14151876

fbshipit-source-id: 0f7419d5b9bcd9d7ce363f4349e9e2e4a86cf713
2019-02-20 13:44:51 -08:00
Durham Goode
3309a8090a pushrebase: read the manifest before looping through files
Summary:
pushrebase has logic that loops through all the files and builds a list
of what has changed. Unfortunately, Mercurial has some optimizations where if
the manifest isn't loaded already, it tries to only load the manifest delta, and
checks if this might be a good idea by first checking if the file is in the
commit metadata file list. The commit metadata is a list, which makes it a O(n)
scan to check containment. Since we do this for every file, it becomes O(n^2).

To avoid this, let's just make sure the actual manifest is loaded.

Once every repo is a tree repo, we can get rid of the manifest delta
optimization and get rid of the need to prefetch here.

Reviewed By: singhsrb

Differential Revision: D13944829

fbshipit-source-id: c0f33ca650b7956a1f39e961c94678a6f7f380b6
2019-02-05 16:05:50 -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
8c4a52d608 config: enable obsstore by default
Summary:
This makes tests closer to production setup and removes a bunch of "saved
backup bundle to ..." messages.

With D9236657, this should not hurt server-side performance.

Unfortunately a lot tests cannot be migrated easily, mostly because revision
numbers are used. They are left with a TODO.

Reviewed By: DurhamG

Differential Revision: D9237694

fbshipit-source-id: c993fce18f07aba09f6d70964e248af8d501575a
2018-10-26 18:54:40 -07:00
Jun Wu
83559cfb29 pushrebase: introduce a stackpush fast path
Summary:
The fast path avoids recreating the bundlerepo in the critical section, which
is like a reliable 0.8s win.

See the docstring in stackpush.py for details. It does not replace all use cases
that the old code path supports. So the old path is preserved.

Since it's a drop-in replacement, make it the default.

Reviewed By: phillco

Differential Revision: D10023543

fbshipit-source-id: eaceb9ae5067ab9040aa10cc65170ae54abd3331
2018-09-25 16:06:21 -07:00
Phil Cohen
a8879d2b36 pushrebase: add a test case demonstrating the "cannot rebase public commit" issue
Summary: We want to add a test for this case before fixing it.

Reviewed By: quark-zju

Differential Revision: D10034448

fbshipit-source-id: 9244c57311d71a0bf1d75643caa31960a2f3519f
2018-09-25 13:21:45 -07:00
Jun Wu
9740116626 lock: use flock on POSIX
Summary:
We recently ran into issues with locks in pid namespaces [1]. Let's fix that
by using flock.

flock is more reliable in Linux's pid namespace use-case than file-existence
test, because it works without a /proc filesystem and does not have deadlock
issue if an hg process is killed unexpectedly (ex. OOM or SIGKILL).

The transition should be transparent:
- If the new code saw a symlink lock file generated by the old code.
  `open(..., O_NOFOLLOW)` will fail and it's considered lock taken by the old
  process correctly.
- If the old code saw a new lock file. It will treat it as system without
  symlink support and it's considered lock taken by the new process correctly.

A non-symlink stale lock (regardless of whether it contains pid information or not)
will be confidently removed automatically by the new code.

The change is complicated because it works when both new and old hg
run at the same time. If we have migrated most users to the new code path,
the code can be cleaned up significantly.

[1]: https://fburl.com/85fxjisi

Reviewed By: DurhamG

Differential Revision: D9004614

fbshipit-source-id: d501c4f3a7bc8ad73c9556be1c6a265ffd0d0686
2018-08-08 16:20:21 -07:00
Jun Wu
9c6167a115 test-fb-hgext-pushrebase-manifests: increase wait time
Summary: It timed out and caused a build failure.

Reviewed By: phillco

Differential Revision: D8878513

fbshipit-source-id: 2f9371da070bbd21d438aa03bc34da366d3de1f5
2018-07-17 12:35:54 -07:00
Jun Wu
d02477d831 sshpeer: forward remote stderr to stderr
Summary:
Some scripts are parsing all hg outputs. The remote stderr output could
contain random noise that break the scripts. Therefore let's forward
remote stderr to local stderr, instead of local stdout.

Reviewed By: DurhamG

Differential Revision: D8514952

fbshipit-source-id: 2f205fdc948fbeacd20b5af9d6d52eaa8212e90e
2018-06-25 08:44:32 -07:00
Mark Thomas
ae9fb09e62 pushrebase: fix occasional test failure
Summary:
test-fb-hgext-pushrebase-manifests.t is flaky, with occasional blank lines
sometimes appearing in the output.  This is another location that recently
caused a build failure.

Reviewed By: ryanmce

Differential Revision: D8517151

fbshipit-source-id: 38e7e87745a971d9734b86bf83b3c0a86d3ba797
2018-06-20 01:20:02 -07:00
Durham Goode
914d474bbf hg: add back flakey test lines
Summary:
A previous diff (143ad029b) lost these lines due to run-tests.py -i overwriting
them. We're seeing flakey test failures, so let's add them back.

Reviewed By: singhsrb

Differential Revision: D7641613

fbshipit-source-id: 4f0807ae88f442cfa3c84106e800ce9eba81e99e
2018-04-16 12:53:41 -07:00
Durham Goode
0ae182a740 hg: default to using bundle2 for pushrebase parts
Summary:
Pushrebase previously defaulted to bundlev1. Now that the server can
support v2, let's default to v2.

Reviewed By: quark-zju

Differential Revision: D7591174

fbshipit-source-id: bc5448490ff319543baedf3f5a1aab160a73ed27
2018-04-13 21:51:53 -07:00
Durham Goode
24653e5e32 hg: add develwarn for bundle1 format
Summary:
We want to deprecate the bundlev1 format, so let's start by adding a
develwarn. Later diffs will update the tests to not use v1, then remove v1 as a
supported outgoing bundle entirely.

Reviewed By: quark-zju

Differential Revision: D7591166

fbshipit-source-id: 143ad029bfe4d141f91d6d5077342dfa44ad2944
2018-04-13 21:51:52 -07:00
Kostia Balytskyi
e75b9fc1b1 fb-hgext: move most of hgext3rd and related tests to core
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.

The things that are not moved are the ones which require some more complex
imports.


Depends on D6675309

Test Plan: - tests are failing at this commit, fixes are in the following commits

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675329
2018-01-09 03:03:59 -08:00