Commit Graph

20 Commits

Author SHA1 Message Date
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
66f2e5f45e branch: disable branchcache and drop all branches other than "default"
Summary:
This hardcodes several perftweaks configs that have been enabled for major FB
repos for months:

  [perftweaks]
  disablebranchcache = True
  disablebranchcache2 = True
  disableresolvingbranches = True
  disableupdatebranchcacheoncommit = True

Practically, this means the branchmap is now just `{'default': heads}`. (i.e.
there are no named branches other than `default`), and branchcache is removed
(i.e. `.hg/cache` does not exist without clindex or in-repo tags).

This diff only makes easy-to-verify logic changes by assuming the configs and
removing dead code. Things can be further cleaned up. They will be done by
upcoming changes.

Most test changes are due to the fact that `.hg/cache` is no longer created.

Reviewed By: singhsrb

Differential Revision: D14179858

fbshipit-source-id: 479f7427168eb1d9614a973e273a229e50f5620a
2019-02-22 21:02:41 -08:00
Jun Wu
047b1a05f4 exchange: kill checkheads
Summary:
We had `ui.checkheads=false` set for a long time. Let's remove the feature
entirely and update the tests.

This is necessary before killing the branch cache, as some tests still use
different branches and there would be suddently more "heads" that cause
test issues.

Reviewed By: sfilipco

Differential Revision: D14179861

fbshipit-source-id: 0de76566799a9560b45e823cc5f49cfda9e3dd30
2019-02-22 21:02:41 -08:00
Kostia Balytskyi
da3e429150 wireproto: add unbundlereplay command
Summary:
This is to be used from Mononoke->hg sync.
Currently expects only `pushrebase` bundles, e.g. one head and one book to
move.

Reviewed By: StanislavGlebik

Differential Revision: D14116130

fbshipit-source-id: 959a6e51f51e21da5592c84188e294a33057ffaa
2019-02-19 01:57:39 -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
Mark Thomas
088e0a8ed6 pushrebase: only prevent phase updates if replacements received
Summary:
If the commits being pushrebased don't actually need to be rebased, pushrebase
will accept them like a normal push.  In this case we shouldn't prevent them
from be changed to public commits on the client.

Track this by detecting whether we receive a changegroup part from the server.
If we do, only the commits that are marked as replaced with obsmarkers (if
enabled) can be marked as public.

Reviewed By: quark-zju

Differential Revision: D12944851

fbshipit-source-id: 44f8fc17b36397d949cba5d3e787fad813bab4ea
2018-11-07 04:32:46 -08:00
Mark Thomas
9b4c89abe5 pushrebase: add test demonstrating pushrebase phase change failure
Summary:
When pushrebase is enabled, pushing a commit that doesn't result in any
rebasing action acts like a normal push (the commit is not modifed and a new
hash is not returned), however the phase update doesn't apply, so the commit
remains draft.

Reviewed By: quark-zju

Differential Revision: D12944850

fbshipit-source-id: 2145d9b7eebc27bfdff34544e73802c13f30dbd2
2018-11-07 04:32:46 -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
Mark Thomas
0b425b5f11 txnutil: add HG_SHAREDPENDING and trysharedpending
Summary:
Add `HG_SHAREDPENDING` which contains the path to the shared primary repository,
similar to how `HG_PENDING` contains the path to the local repository.

Repositories that are not shared check whether either of these refer to the
local repository path.  Repositories that are shared check whether the pending
directory matches their own path, or the shared-pending directory matches their
shared path, via the new `trysharedpending` function.

This fixes the asymmetry in shared repos where pending changes made in a shared
repo were not visible in the primary repo, even though they were visible the
other way around.

Reviewed By: quark-zju

Differential Revision: D9699164

fbshipit-source-id: 31bc5fb2df6e9b9468b6ef39aabf877045c2a011
2018-09-28 07:23:00 -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
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
Durham Goode
e3f8f7fc38 clone: add stream_clone_options wireprotocol endpoint
Summary:
We want to allow blocking full repo streaming clones in certain
repositories (since they can take the lock and take a very long time) unless the
client has explicitly asked for it. The existing stream_out wire protocol has no
way of passing an option, so let's create a new endpoint.

Reviewed By: quark-zju

Differential Revision: D7763717

fbshipit-source-id: eace47143f8fdcc4c6e302b5c26678ccf56ca5d4
2018-04-25 13:54:54 -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
Durham Goode
8038c6ea27 hg: support cg2 in pushrebase
Summary:
Previously pushrebase would only send changegroups using the cg1
format. remotefilelog will soon require cg2 (and it results in better deltas
anyway), so let's change pushrebase to allow using cg2.

Initially it is off by default. We will change it to be on by default once the
server has been upgrade to to handle the received part.

Reviewed By: mjpieters

Differential Revision: D7108732

fbshipit-source-id: ff4ad3a3fc2801aec4876db30c8130ce743b2e6a
2018-04-13 21:51:19 -07:00
Jun Wu
1cde63d99c codemod: drop hacks changing PYTHONPATH in tests
Summary:
Now they are unnecessary since `run-tests.py` will set up `PYTONPATH`
correctly.

Differential Revision: D6865042

fbshipit-source-id: ca95314f725968e14349a9d916434aa832c596f9
2018-04-13 21:51:00 -07:00
Jun Wu
effa0da8de test-helpers: add a helper to run test using chg
Summary:
The helper could be used in individual tests to enable chg if chg exists.
This allows us to have more precise control on what tests to use chg instead
of using a global flag in run-tests.py.

This makes certain tests containing many hg commands much faster. For example,
`test-revset.t` took 99 seconds before:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  99.990  86.410  12.000  99.990   test-revset.t

And 10 seconds after:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  10.080   0.380   0.130  10.080   test-revset.t

Also enable it for some other tests. Note the whitelist is not complete.  We
probably want to whitelist more tests in the future.

The feature could be opted out by deleting `contrib/chg/chg`.

Reviewed By: phillco

Differential Revision: D6767036

fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
2018-04-13 21:50:54 -07:00
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -07:00
Kostia Balytskyi
b27a46c987 fb-hgext: fix copied fb-hgext tests
Summary:
This is a big bulk of generally almost-obvious fixes to the moved tests. Mostly
these fixes have to do with correct importing of the actual extensions.

Depends on D6675329

Test Plan:
- ./run-tests.py fails less after this commit
- see further commits for more test fixes

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675344
2018-01-09 03:06:09 -08: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