Commit Graph

287 Commits

Author SHA1 Message Date
Jun Wu
0252fce55c hint: add a command to silence hints
Summary:
This allows people to silence hints as they like. It's done by modifying
user hgrc.

Reviewed By: markbt

Differential Revision: D7392133

fbshipit-source-id: 1365294217db92dfb3a0c81332a9fefd164795d4
2018-04-13 21:51:49 -07:00
Phil Cohen
26476a8a58 add megarepo generation script
Summary: This script can be used to generate a large number of commits.

Reviewed By: DurhamG

Differential Revision: D7363243

fbshipit-source-id: 1a1e3ba7fca29dc695446eeffb715474ea2943ad
2018-04-13 21:51:37 -07:00
Phil Cohen
2e5e764e25 a basic perf suite implementation
Reviewed By: DurhamG

Differential Revision: D7341042

fbshipit-source-id: e87bd1bfe198fc4c5e1e2239b761c543d6acbf01
2018-04-13 21:51:36 -07:00
Durham Goode
df8173b17b hg: add --configfile global option
Summary:
This adds the ability to specify a config file to be used during the
command. This is useful during clones for letting the clone command use the
given repositories system specified repo-specific hgrc file.

Reviewed By: quark-zju

Differential Revision: D7311576

fbshipit-source-id: a97d8ebada2e0bea27c75a7650df8ede00dc10c6
2018-04-13 21:51:31 -07:00
Mark Thomas
93b97b7fe1 clienttelemetry: record client details in server telemetry
Summary:
Add a new extension, `clienttelemetry`, which sends information about the
client to the server.  This information is logged by the server, which can use
the `sampling` extension to store this information for later analysis.

Includes a few basic pieces of information by default, including a correlator
which can be used to correlate logs from the client and the server.

Reviewed By: mjpieters

Differential Revision: D7271508

fbshipit-source-id: f152fe177d8bc73179d3a2c4d0d070d468885e2a
2018-04-13 21:51:29 -07:00
Mark Thomas
6660438ea2 commitcloud: add basic cloudsync command
Summary:
Adds the initial skeleton of the `commitcloud` extension to Mercurial, which
will synchronise heads and bookmarks (and later, obsmarkers) with commit cloud.

Current limitations:
  - only supports a stub version of the service that uses local files
  - requires manual pushbackup to send commits to the server via infinitepush
  - doesn't do anything with obsmarkers

Differential Revision: D7167715

fbshipit-source-id: 53443f3fb8dff0fe52257d7b20fc601dbe10c883
2018-04-13 21:51:28 -07:00
Ryan McElroy
7c94c47d99 debugcommands: introduce debugprogress
Summary: Command to help microoptimize the progress bar

Differential Revision: D7210616

fbshipit-source-id: 2f3fb4e3be6b45d51b65051a42e786d5f1ca158b
2018-04-13 21:51:25 -07:00
Jun Wu
3b8120083a changegroup: add a config to tweak deltabase selection
Summary:
This diff adds a config option to tweak deltabase in changegroup. It has 3
options:

  - Always null - always use "null" as delta base, effectively make
    everything full text
  - No external - delta bases cannot be a revision outside the changegroup
  - Default - the current behavior: delta bases can be anything that client
    thinks the server should have.

This gives Mononoke more time to bake delta related logic, as we can
choose "always null" first, then incrementally increase the complexity.

Reviewed By: phillco

Differential Revision: D7158585

fbshipit-source-id: 5f6d9a78d1108093e8d08b9f296568f4f7e7471b
2018-04-13 21:51:22 -07:00
Adam Simpkins
0e49f78053 help: update the test to exclude eden help
Summary:
Some of our internal hg builds include the Eden extension now.  This was
causing the test-help.t test to fail since it included help output for the Eden
extension, but the test code did not expect this.

We unfortunately cannot update the test output to always expect help output for
Eden since the Eden extension is only included in buck-based builds.

Reviewed By: quark-zju, farnz

Differential Revision: D7063937

fbshipit-source-id: e503ddc6889e546b5333a8d9e3555097d689e24c
2018-04-13 21:51:16 -07:00
Mark Thomas
0a7ff59302 diff: add --only-files-in-revs option to limit files diffed
Summary:
Add a new `--only-files-in-revs` option to `hg diff`.  This filters the files
that are considered down to the set of files that are touched in either of the
two revisions.

Reviewed By: ryanmce

Differential Revision: D7070102

fbshipit-source-id: b9140cd3a212af9554ef5b76785210c1dbba8ee0
2018-04-13 21:51:15 -07:00
Kaley Huang
6425129a45 verify: add --rev support
Summary:
Currently, commits adding LFS files are not verified server-side since the LFS
extension explicitly skips hash checking during unbundle, to avoid overhead
downloading/reading LFS objects.

We'd like those commit hashes to be verified.  However, the existing verify
command does not scale with a huge repo.  So let's add `verify -r REV` support
to be able to incrementally verify a repo.

Reviewed By: quark-zju

Differential Revision: D6947227

fbshipit-source-id: 6ffda3a814822942630339fc7de62c3fcb284fda
2018-04-13 21:51:12 -07:00
Jun Wu
3c45a72e2a patchpython: remove the extension
Summary:
It was used to patch Python's `SocketServer`. Since we no longer use
`SocketServer` in command server's code path. The extension can be removed.

Reviewed By: ryanmce

Differential Revision: D6974976

fbshipit-source-id: 52353b55d812e494756833cefba896b6e64eaf9e
2018-04-13 21:51:11 -07:00
Jun Wu
4a7b28d08b serve: assign hg serve ports dynamically in tests
Summary:
Previously `hg server` uses `HGPORT` that might be in use. This patch uses
`-p 0 --port-file ...` so `hg server` always gets assigned a free port.

The change was first made by the following Ruby script:

```
re = /^  \$ hg serve(.*) -p \$(HGPORT[12]?) (.*[^\\])$\n  \$/
Dir['*.t'].each do |path|
  old = File.read(path)
  new = old.lines.map do |l|
    next l if l[/\(glob\)/] or not l['$HGPORT'] or l[/^  [$>]/]
    "#{l.chomp} (glob)\n"
  end.join.gsub re, <<-'EOS'.chomp
  $ hg serve\1 -p 0 --port-file $TESTTMP/.port \3
  $ \2=`cat $TESTTMP/.port`
  $
  EOS
  File.write(path, new) if old != new
end
```

Then there are some manual changes:

run-tests.py: It now treats `$HGPORT` in output as glob pattern `*`, since
it does not know the assigned value in tests.

test-bookmarks-pushpull.t, test-https.t: Some `hg pull`s were changed to use
explicit paths instead of relying on `.hgrc` since the test restarts the
server and `.hg/hgrc` having an outdated URL.

test-schemes.t: The test writes `$HGPORT` to `.hgrc` before assigning it.
Changed the order so the correct `$HGPORT` is written.

test-patchbomb-tls.t: Changed `(?) (glob)` to `(glob) (?)`.

Reviewed By: DurhamG

Differential Revision: D6925398

fbshipit-source-id: d5c10476f43ce23f9e99618807580cf8ba92595c
2018-04-13 21:51:07 -07:00
Adam Simpkins
ee2ff2f2bd help: don't crash when trying to display help for disabled commands
Summary:
Check to see if the module documentation is None before trying to call
`splitlines()` on it.

Reviewed By: singhsrb

Differential Revision: D6919043

fbshipit-source-id: 93c458cde9643a3f1b2d6fe6eb56fa312ae2a192
2018-04-13 21:51:06 -07:00
Jun Wu
7c49ae28cf test-help: update text with sigtrace change
Reviewed By: DurhamG

Differential Revision: D6916334

fbshipit-source-id: 33e6f11d5156bc9bdf2fd8395dfab7cb372dc5a2
2018-04-13 21:51:06 -07:00
Jun Wu
6529990478 debugfilerevision: add a new debug command
Summary:
This is similar to `debugdata`, but instead of taking a file revision (or
file node in remotefilelog's case), it takes a revset.

This is more useful practically, since the user would know commit hashes
easily but file nodes are hidden from the UI.

This is intended to make it easier to investigate LFS contents.

Reviewed By: DurhamG, ryanmce

Differential Revision: D6891770

fbshipit-source-id: 415da9b773c30830a48c09eda9f1854c416e3222
2018-04-13 21:51:05 -07:00
Phil Cohen
0584f5d23f hg: fastverify: unify and fold into core
Summary: `fastverifier` was sometimes being overriden by `shallowverifier` when remotefilelog was enabled. Since the latter is a subset of the former, let's just fold both into the core verifier code backed by a config, `verify.skipmanifests`, that we can default to true.

Reviewed By: DurhamG

Differential Revision: D6882222

fbshipit-source-id: 9f337ca031a070425ccdc9ee02f6765e68436da9
2018-04-13 21:51:03 -07:00
Jun Wu
e92a601d9b hghave: add normal-layout feature
Summary:
With `buck build`, the single hg binary won't be guarnateed to have
access to i18n messages because directories like `mercurial/locale`
do not exist on filesystem. It could also mess up with `PYTHONPATH`
somehow because the python binary wrapper sometimes ignores
`PYTHONPATH`.

So let's add a hghave feature for it. And gate troublesome tests
with `#if normal-layout`.

Reviewed By: DurhamG, phillco

Differential Revision: D6879876

fbshipit-source-id: 3d63605b55c8f7096093b89be824add2ec491f81
2018-04-13 21:51:02 -07:00
Jun Wu
96a9afa2a5 drawdag: inline drawdag
Summary:
Since we have `debugbuilddag` as a builtin command, and `drawdag` is
pretty useful for writing clean test cases. Let's inline it. This would
simplify many tests since `drawdag=..." is no longer needed.

Reviewed By: DurhamG

Differential Revision: D6827925

fbshipit-source-id: b749f57fd5c55b2cb000dd2da2c2f9bc2386a519
2018-04-13 21:50:59 -07:00
Phil Cohen
e98ce2b8c1 moreversion: remove the extension (v2)
Summary:
The last diff lost most of its content after v2 was submitted. Resend.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D6795055

fbshipit-source-id: ed5f6d5eba9f8cfd505ed4ba1724110414b685f8
2018-04-13 21:50:56 -07:00
Phil Cohen
9ae6ff7bdd moreversion: remove the extension
Summary:
`hg version`, as of the last path, currently prints:

```
Mercurial Distributed SCM (version 20180123_174746_5cb750b72031)
Facebook Mercurial release: UNKNOWN-RELEASE
```

There's no need for us to print the second line now that the first represents the internal version ID.

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D6794821

fbshipit-source-id: 499828832a0acb066adc260f852c3a743e41a563
2018-04-13 21:50:55 -07:00
Phil Cohen
265c2610c7 simplecache: enable by default
Summary: Default-on this moderately hard extension.

Reviewed By: DurhamG, quark-zju

Differential Revision: D6792641

fbshipit-source-id: 475135f4f4f295a4e6356443405bd6eb185c310a
2018-04-13 21:50:55 -07:00
Jun Wu
8238de1e82 keyword: drop the extension
Summary:
The keyword extension is rarely used. And it breaks sshaskpass because
Python standard library `collections` (which does not use absolute import)
will import the wrong `keyword` module:

  $ hg pull ssh://localhost/foo --debug
  pulling from ssh://localhost/foo
  running SSH_ASKPASS=/tmp/tmpj_6pDJttysrv/2991364.sh DISPLAY=localhost:10.0 TTYSOCK=/tmp/tmpj_6pDJttysrv/2991364 ssh -oControlMaster=no localhost 'hg -R foo serve --stdio'
  sending hello command
  sending between command
  remote: Traceback (most recent call last):
  remote:   File "/usr/lib64/python2.7/site-packages/hgext/sshaskpass.py", line 43, in <module>
  remote:     import collections
  remote:   File "/usr/lib64/python2.7/collections.py", line 10, in <module>
  remote:     from keyword import iskeyword as _iskeyword
  remote:   File "/usr/lib64/python2.7/site-packages/hgext/keyword.py", line 93, in <module>
  remote:     from mercurial.i18n import _
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/i18n.py", line 15, in <module>
  remote:     from . import (
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/encoding.py", line 15, in <module>
  remote:     from . import (
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/error.py", line 17, in <module>
  remote:     from . import pycompat
  remote:   File "/usr/lib64/python2.7/site-packages/mercurial/pycompat.py", line 22, in <module>
  remote:     import cookielib
  remote:   File "/usr/lib64/python2.7/cookielib.py", line 32, in <module>
  remote:     import re, urlparse, copy, time, urllib
  remote:   File "/usr/lib64/python2.7/urlparse.py", line 123, in <module>
  remote:     from collections import namedtuple
  remote: ImportError: cannot import name namedtuple

Reviewed By: singhsrb

Differential Revision: D6766686

fbshipit-source-id: af67a4d8c736158951c737b790904ba11419d432
2018-04-13 21:50:54 -07:00
Phil Cohen
5cae81a643 extensions: default-on conflictinfo, errorredirect, ...
Summary: ...mergedriver, and progressfile.

Reviewed By: quark-zju, singhsrb

Differential Revision: D6765952

fbshipit-source-id: 8eddcdeffa5d6532f737f45f7e1071c1a563a3cd
2018-04-13 21:50:54 -07:00
Durham Goode
3666ccd6b2 clindex: disable by default for now
fbshipit-source-id: b1af6f49eebfbada4bf9637ea4935c618b0e7bb6
2018-04-13 21:50:53 -07:00
Kostia Balytskyi
486bb40de0 sparse: fix tests, broken by D6755971
Differential Revision: D6759900

fbshipit-source-id: 2629abc2b96e948ed69f0d30628d6a9994a19138
2018-04-13 21:50:53 -07:00
Jun Wu
07522dbb4e clindex: enable by default
Summary:
This enables clindex for its nodemap. Verification is turned off by default
for the performance win since we have been running verification in
production for a while.

Reviewed By: phillco

Differential Revision: D6751412

fbshipit-source-id: bc3e87df86e86a758392bdd4aef3e282f397fe04
2018-04-13 21:50:52 -07:00
Jun Wu
19cda85a3a debugshell: enable it by default
Summary:
It's pretty handy. The implementation is simple and clean. So move it from
contrib and enable it by default. "import"s are adjusted to make the module
checker happy.

Security and UX wise, since we have `--debugger` already, adding another
REPL seems fine.

Test Plan: Ran all tests

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6741283

Signature: 6741283:1516225662:ddc19a663e7ecef2a1fdaa5041f308dc838a8471
2018-01-17 12:54:24 -08:00
Jun Wu
e81c53461e largefiles: remove the extension
Summary:
`lfs` is the better large file solution. `largefiles` is rarely used, and
its implementation is less clean. So let's remove it.

Test Plan:
Ran all tests. A subrepo test was removed instead of cleaned up since the
longer term plan is to also drop subrepo support.

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6740361

Signature: 6740361:1516225594:555e3803571ad05e0434021897a2823ac99347ae
2018-01-17 11:50:44 -08:00
Phil Cohen
ed708bc77f tests: fix for D6717635 2018-01-12 16:58:28 -08:00
Mateusz Kwapich
6da99d7b2a hgsubversion: fix core tests
Summary: Mostly just check code updates.

Test Plan: Ran the tests

Reviewers: singhsrb, #mercurial

Reviewed By: singhsrb

Differential Revision: https://phabricator.intern.facebook.com/D6698640

Signature: 6698640:1515628510:7b80ef593d2007810064d8226a3b45e2a1ee370f
2018-01-10 16:20:45 -08:00
Durham Goode
96101c63b5 moreversion: move to hgext/
Summary:
Moves the moreversion extension to hgext/ and updates the core setup.py
to process it. Eventually we should get rid of this and store the version number
as the normal Mercurial number, but that can happen later.

Test Plan:
make local && ./hg version
Mercurial Distributed SCM (version 4.4.2+8922-aa235b4cbeac+20180110)
Facebook Mercurial release: UNKNOWN-RELEASE

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6696199

Signature: 6696199:1515621476:7835f9110ec143737c488faf49cf547eee8f918e
2018-01-10 16:16:45 -08:00
Saurabh Singh
175ec57a52 infinitepush: modify description to address test-help.t
Summary:
We changed the location of infinitepush which exposed it to the
additional test that failed. This commit fixes infinitepush to address that
test.

Test Plan: Ran all the tests.

Reviewers: rmcelroy, #mercurial, #sourcecontrol

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6691691

Signature: 6691691:1515578616:1ab451468835cc67a35f1d4d6e56a71f48db47e1
2018-01-10 08:10:27 -08:00
Ryan McElroy
4488942ef2 infinitepush: move infinitepush from fb-hgext to hgext
Summary:
This is part of the overall plan to move extensions from fb-hgext to
hgext. Follow up commits will address some of the test issues and move the
infinitepush related tests out of fb-hgext to hgext.

Test Plan: Ran all the tests.

Reviewers: rmcelroy, #mercurial, #sourcecontrol

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6691670

Signature: 6691670:1515578586:8d7836aebb474856559c6dbe6fe2f572c8bdf7f1
2018-01-10 08:10:27 -08:00
Durham Goode
fd68710043 misc: delete unused files 2018-01-09 13:07:22 -08:00
Durham Goode
fbed515666 setup: add directory modules to setup.py
setup.py needs an explicit list of all the directory modules, otherwise it
doesn't build them. This caused test-help to fail when run without -l because
they weren't copied to the target directory. I'm not sure how the tests have
been passing actually. My guess is they were importing the extensions from the
system python.
2018-01-09 12:38:05 -08:00
Durham Goode
253f51f15e treemanifest: move to hgext/
Summary: Moves the extension itself.

Test Plan:
make local && ./run-tests.py

A future patch fixes the tests once
fastmanifest is also moved.

Reviewers: phillco, #mercurial

Reviewed By: phillco

Differential Revision: https://phabricator.intern.facebook.com/D6684580

Signature: 6684580:1515521896:68a4d648d9f5433d6eeda8be01740fbe12abf44e
2018-01-09 11:06:49 -08:00
Ryan McElroy
66bd74e558 hggit: internalize extension
Test Plan: run-tests-.py

Reviewers: mitrandir, #mercurial

Reviewed By: mitrandir

Subscribers: ps, terrelln

Differential Revision: https://phabricator.intern.facebook.com/D6675896

Tasks: T24908724

Signature: 6675896:1515448382:df8d80cd7356ae8f5fb04586dc4a0a651bc498fd
2018-01-09 06:08:01 -08:00
Ryan McElroy
dc858619e0 help: improve extension help messages
Test Plan: run-tests.py

Reviewers: ikostia, #mercurial

Reviewed By: ikostia

Differential Revision: https://phabricator.intern.facebook.com/D6683060

Signature: 6683060:1515505954:91bdc8841c2168bf93e7448cb0fa4d136d7a6e2f
2018-01-09 05:52:58 -08:00
Kostia Balytskyi
9aa3ee0721 fb-hgext: accept new help contents in test-help.t
Summary:
Some new help contents are now generated with test-help.t

Depends on D6675351

Test Plan: - test-help.t is passing now

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675363
2018-01-09 04:40:31 -08:00
Jun Wu
0e18bfbbfa absorb: move to hgext
Summary: Move absorb to hgext.

Test Plan: `run-tests.py -l` with empty `PYTHONPATH`.

Reviewers: durham, #mercurial

Reviewed By: durham

Differential Revision: https://phabricator.intern.facebook.com/D6678562

Signature: 6678562:1515455701:8778bc0ce54ec017483f6826a9792bebcb9464d7
2018-01-08 13:57:01 -08:00
Mateusz Kwapich
799a36213f help: add hgsql to help
Summary: It was missed by whoever was adding hsql to this repo

Test Plan: tests are passing now

Reviewers: rmcelroy, ikostia, #mercurial

Reviewed By: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6674927

Signature: 6674927:1515432467:705219df9ef28e218923aafe720c8f908f16be67
2018-01-08 10:32:01 -08:00
Mark Thomas
5c729581f9 lz4revlog: add lz4revlog to test-help 2018-01-03 10:13:17 -08:00
Stanislau Hlebik
23dd2cf1eb remotenames: accept test failures 2018-01-03 06:28:53 -08:00
Boris Feld
3b270be25b debugformat: add a 'debugformat' command
The command displays basic data about all format variants registered for repo
upgrades. This gives a quick way to peek into a repository format.

The 'fm.write()' calls are very independent because more data will be added in
later changeset. Having more separate call make the later patch clearer.
2017-12-07 16:19:46 +01:00
Rodrigo Damazio Bovendorp
80a38c9b47 help: adding a topic on flags
This is a short topic to explain how command-line flags can be specified.

Some users have been confused by hg offerring different flag syntax than some
other libraries, so it'd be nice to point them to this rather than explaining
it every time.

Differential Revision: https://phab.mercurial-scm.org/D1270
2017-10-30 20:35:30 -07:00
Boris Feld
9554fcac46 debug: add a debugcapabilities commands
This new debugcommand prints the capabilities of any remote in a human friendly
way. Improved bundle2 capabilities support will be introduced in the next
changesets.
2017-10-30 17:08:16 +01:00
Kevin Bullock
0c315becfe internals: update test-help.t for config registrar copy-edit 2017-11-01 15:34:22 -05:00
Matt Harbison
ba66d4513f help: minor copy editing for grammar 2017-10-31 23:09:29 -04:00
Boris Feld
2d8cec51a9 internal-doc: document the config register mechanism
This explains the various usage and feature of the config register introduced
in Mercurial 4.3 and 4.4.
2017-10-27 18:19:07 +02:00