Commit Graph

1321 Commits

Author SHA1 Message Date
Stanislau Hlebik
6c09d4ce19 rage: add a hack to make rage work on osx
Summary: Add a config option to specify rpm binary

Test Plan: arc unit

Reviewers: #mercurial, quark, ikostia, luk

Reviewed By: ikostia, luk

Subscribers: luk, mjpieters, medson, #sourcecontrol

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

Tasks: 19361425

Signature: t1:5255174:1497518216:d78a66e27a1073921f06d9dd0e7036bab3e4010a
2017-06-15 04:20:52 -07:00
Stanislau Hlebik
39c7c58e93 infinitepush: make sure infinitepush works well with gitlookup
Summary:
Previously infinitepush lookup function didn't call original lookup function.
It made it impossible to work with extension like gitlookup that also
overwrite lookup. This diff fixes it.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: #sourcecontrol

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

Tasks: 17733144
2017-06-15 02:44:27 -07:00
Stanislau Hlebik
55969ebfa3 infinitepush: update schema
Summary:
Let's add a special field that would store arbitrary metadata in json format.
It can be used to store, for example, lists of changes files, file diffs etc.

Depends on D5236375

Test Plan: arc unit

Reviewers: #mercurial, azich

Subscribers: #sourcecontrol

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

Tasks: 19103180
2017-06-15 02:36:40 -07:00
Felix Merk
5c4ff4f39f tweakdefaults: add --inactive flag to update command
Summary:
People want update to optionally not activate a bookmark.
This diff adds an `--inactive` flag to do that.

Test Plan: Added test-update-i.t

Reviewers: durham, #mercurial, quark

Reviewed By: quark

Subscribers: mitrandir, mjpieters, medson, durham, akushner, quark

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

Tasks: 8097957

Signature: t1:5228552:1497396566:16322e1a2dfdab30a213ddc37cbde4fc71bffcc0
2017-06-14 16:42:39 -07:00
Olivier Trempe
7b57890313 pushrebase: make pretxnchangegroup and changegroup hook arguments consistent with mercurial hook documentation
Before this patch, the pretxnchangegroup 'node' argument would be the last
added node whereas mercurial documention specifies that it should be the first
new changeset. The 'node_last' argument has also been added to both
pretxnchangegroup and changegroup hooks as per mercurial documentation.
2017-06-14 16:29:16 -07:00
Olivier Trempe
e08fcc30c1 test-pushrebase: Enhance test to bring out hook arguments inconsistency in pretxnchangegroup hook
The 'node' argument points to the last new changeset. Mercurial documentation
state that it should be the first new changeset.

This will be fixed with the following changeset
2017-06-14 16:29:16 -07:00
Durham Goode
69a5078ba6 treemanifest: enable minimal downloading for on demand downloads
Summary:
Previously, if a tree needed to be downloaded on demand (like during hg
show), it would download the entire tree. With this patch, we look backwards in
the changelog for a tree we already have and then download only the new parts of
the tree.

Test Plan:
The existing demanddownload test changed because of this. I've added
more output to the test to show that only new items are downloaded (to be
specific subdir/ is not downloaded again since it did not change).

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, medson

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

Signature: t1:5210268:1497299426:195517184d53396849d0ba8c75216d07741e5863
2017-06-13 17:31:47 -07:00
Jun Wu
3ab3ee018a fbamend: move next, previous to a movement.py
Summary:
Move movement commands (next, previous) to `movement.py`. Some common utilities
were moved to `common.py`. I did some minor cleanups on the help output.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

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

Signature: t1:5222981:1497265815:5dbba53fe7a16dbf924898331496a5c50b54b9f2
2017-06-13 17:09:16 -07:00
Jun Wu
f1b6191c18 fbamend: move to a package
Summary: `fbamend.py` is already long. It will become more complex so let's move it.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

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

Signature: t1:5209475:1497260957:e84aec4a2f90c8dd1d247b2b0caef48cfbb59c55
2017-06-13 17:08:20 -07:00
Olivier Trempe
0e2e9efbc7 pushrebase: add node_onto argument to prepushrebase hook
This helps doing some validation before accepting a pushrebase.
For example, if you want to prevent users to accidentally pushrebase
changesets to the wrong branch by checking if all pushed changesets are
on the same branch as the destination (--to)
2017-06-13 16:32:25 -07:00
Stanislau Hlebik
defa69c1d8 extorder: fix test
Summary:
There was a change in core mercurial b319e3173a9534a2b7750b69ef446a803c3145ff
that catches all exception from uisetup and extsetup. Let's throw subclass of
BaseException in this case.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters, medson, #sourcecontrol

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

Signature: t1:5236650:1497363414:9bbde3cabb696bb77a7ffddcb576923e5743c993
2017-06-13 09:13:41 -07:00
Stanislau Hlebik
db25e443da pushrebase: fix test
Logged message was changed in f0652919303c1e090e6c26517ec3b8a116cb7142
upstream.
2017-06-13 07:16:35 -07:00
Stanislau Hlebik
b82acd87f7 conflictinfo: fix test
There was a bug that was introduced upstream in 469914605447 and fixed in
758d59a5f3515b18c767af69f4ed28060f8af56c. This diff reflects the changes.

Also filestat was changed in 4091c920ac07e27ee8536715297127e56d536dab.
2017-06-13 07:15:54 -07:00
Stanislau Hlebik
5a69e3d88a tweakdefaults: dump per file diff statistic in json
Summary:
Upstream mercurial --stat option shows only aggregated statistics for all
files. This diff make it possible to get diff statistics per file.
It can be used by automation.

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, medson, #sourcecontrol

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

Tasks: 18508761

Signature: t1:5203835:1496981602:c8a649158892d05442d8d0aa717589974b92ff6b
2017-06-13 03:38:54 -07:00
Stanislau Hlebik
f7fdb06f79 copytrace: remove unnecessary test that was failing 2017-06-09 09:23:06 -07:00
Stanislau Hlebik
8917054b74 infinitepush: fix test 2017-06-07 07:06:24 -07:00
Stanislau Hlebik
96be9a5870 infinitepush: add config option to set a hostname
Summary:
There is a problem with socket.gethostname() because it can return
inconsistent names. See attached task for details.

Instead this diff lets us specify any hostname.

Depends on D5180633

Test Plan: arc unit

Reviewers: #mercurial, simpkins, tja

Subscribers: #sourcecontrol

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

Tasks: 18528165
2017-06-07 05:26:29 -07:00
Stanislau Hlebik
d3a3074811 infinitepush: add option to trigger re-backups
Summary:
Let's add an option that can be used to trigger full clean backup.
It can be useful in many situations, for example, in case of bug in
infinitepush backup or if the naming scheme of backup bookmarks were changed.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: #sourcecontrol

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

Tasks: 15389402
2017-06-07 05:26:29 -07:00
Kostia Balytskyi
04e65fdacd obsshelve: add a test to check unshelving traditional shelves
Summary:
We do not want to switch people to obsshelve and then find out that their
traditional shelves cannot be unshelved.

Test Plan: - check that added test passes

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5180998
2017-06-06 05:49:37 -07:00
Kostia Balytskyi
cc087222de obsshelve: make sure shelve and obsshelve cannot be enabled same time
Summary: Just for an early detection of bad config being distributed.

Test Plan: - add a test case

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5180986
2017-06-06 05:48:28 -07:00
Kostia Balytskyi
3c6b5b868d obsshelve: copy test-obsshelve.t from core hotfixes
Summary:
See bottom commit of the stack for the motivation.

This commit copies obsshelve-related tests from hotfixed core and cleans them
up a little bit.

Test Plan: - run just added test

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5180981
2017-06-06 05:47:16 -07:00
Stanislau Hlebik
4054350b21 fb-hgext: fix tests
Summary:
With upstream bab25235cfb5daf578a598bd7ae08f7a70ef7acd `hg strip` also strips
markers too. This diff just accepts the test changes since they seems not dangerous

Test Plan: arc unit

Reviewers: #mercurial, kulshrax, simpkins, quark

Reviewed By: quark

Subscribers: net-systems-diffs@fb.com, mjpieters, medson, #sourcecontrol

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

Signature: t1:5185690:1496700479:a230a2861c8d3cafda3867c81b8fc90a7cfcc4df
2017-06-06 00:23:49 -07:00
Durham Goode
81aa94b7e4 treemanifest: introduce fallback for prefetch base nodes
Summary:
Previously, we would only look at the node parents to determine what the base
node would be for a prefetch. This didn't work so well when we started
prefetching arbitrary revs, like only prefetching master. This patch allows us
to scan the changelog back a bit to find the nearest base tree.

Test Plan: Added a test

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:5108686:1495565589:1729bfae7198e8db2223446b81e3bdbf77cf3db6
2017-06-05 13:48:58 -07:00
Durham Goode
2374a09fee treemanifest: add pullprefetchrevs option
Summary:
This adds a config option that allows clients to prefetch only certain trees
after a pull. This is useful if the user wants to download just master. A future
patch will make it only download the portion of the master tree that is new.

Test Plan: Added a test

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:5108677:1495565526:a443c41ccbf55e529c93aa0c021849396d611ac6
2017-06-05 13:48:58 -07:00
Stanislau Hlebik
940deb5e34 fastannotate: fix tests
In 135567a9d3e46a5686343e3a40f15482f7787a48 there was a change to annotate json
formatter. Reflect it in fastannotate tests.
2017-06-05 02:45:29 -07:00
Stanislau Hlebik
40a144610a inhibit: fix test
After upstream commit bab25235cfb5daf578a598bd7ae08f7a70ef7acd strip now also
deletes obsmarkers that are related to the stripped commits and saves them in
the bundle.
2017-06-05 02:37:21 -07:00
Stanislau Hlebik
318a8cd988 conflictinfo: fix tests
There was a bug in require-ext.sh and because of it test-merge-conflictinfo.t
was skipped. This diff fixes the test failure.
2017-06-05 02:16:28 -07:00
Jun Wu
2e143f9478 require-ext: fix the script
It should use `$modname` instead of `$1`.
2017-06-02 12:59:00 -07:00
Stanislau Hlebik
ce077253b5 copytracing: trace copies in draft commits
Summary:
Simple copy tracking for draft commits. It doesn't use db to save move info
because getting move info is quite fast already.

Depends on D5137372

Test Plan: Run tests

Reviewers: #mercurial, durham, quark, rmcelroy

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 18508761

Signature: t1:5137886:1496348869:8f4a9761fdeb26ddee5e18a318cc85582ef4adbb
2017-06-02 01:27:13 -07:00
Stanislau Hlebik
9e8ca3ae43 copytrace: use filename heuristics to quickly find moves
Summary:
Copytracing that is based on a simple idea: most moves are either directory
moves or moves of the file inside the same directory. That means that either
basename of the moved file or the dirname of the moved file is the same.
More details in the comments.

Test Plan: Run unit-tests

Reviewers: #mercurial, durham, quark, rmcelroy

Reviewed By: quark, rmcelroy

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 18508761

Signature: t1:5137372:1496243148:8d229c1593da196b674318ee8b37af15a60831c8
2017-06-01 04:39:27 -07:00
Adam Simpkins
1b9a5fdc5c tweakdefaults: fix hg pull --rebase with a --tool argument
Summary:
Fix the tweakdefaults code to extract the --tool argument when extracting
--rebase, and to pass it in to the rebasemodule.rebase() function correctly.

Test Plan: Included a new test.

Reviewers: #mercurial, rmcelroy, quark

Reviewed By: quark

Subscribers: quark, net-systems-diffs@fb.com, mjpieters

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

Tasks: 18770938

Signature: t1:5134466:1495848690:308a8d3fbad39e6ecfeaee04b1b3267c1fa1118c
2017-05-31 10:58:49 -07:00
Jun Wu
01a471b159 codemod: use vendored directaccess and inhibit extension in tests
Summary:
This diff makes the tests use the vendored directaccess and inhibit instead the
foreign ones.

Test Plan: arc unit

Reviewers: #mercurial, sid0

Reviewed By: sid0

Subscribers: mjpieters

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

Signature: t1:5142981:1496173851:3a8f3a1c689711dbef517c893bf72c90ab144761
2017-05-30 12:56:40 -07:00
Jun Wu
cc95aa58ff test-inhibit: fix the test
Summary: Fix lint errors and make the test pass.

Test Plan: arc unit

Reviewers: #sourcecontrol, sid0

Reviewed By: sid0

Subscribers: mjpieters

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

Signature: t1:5142477:1496173824:bf941d895d3259fc788c09d4fefca7dddd11a33b
2017-05-30 12:56:20 -07:00
Jun Wu
e3e36e37ec inhibit: vendor inhibit and directaccess from mutable-history
Summary:
Vendored using GPL2 license from https://bitbucket.org/marmoute/mutable-history
changeset c9f1118b33d60f8faa4b89988a8155c544f5bb0d without modification.

Test Plan: N/A. The code was imported as is.

Reviewers: #sourcecontrol, sid0

Reviewed By: sid0

Subscribers: mjpieters

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

Signature: t1:5142063:1496173803:d0a9fa50a8423a531432ac3cff378b50952684b1
2017-05-30 12:55:33 -07:00
Stanislau Hlebik
23e41d98e5 copytrace: move to hgext3rd
Summary:
copytracing extension is going to be simpler than I expected in the beginning.
There is no need to separate folder, let's move it to hgext3rd

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 18508761

Signature: t1:5146585:1496147733:ad6ad14f663a8b9bf4b687f0767395321f9840b7
2017-05-30 06:39:31 -07:00
Stanislau Hlebik
bbe014cb96 perftweaks: remove newhiddencache
Summary: Upstream dropped hidden cache in 2f38ac4af04e70af3ffce4700c5a15252391e391, let's drop newhiddencache too

Test Plan: arc unit

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters, #sourcecontrol

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

Signature: t1:5146661:1496140799:a5a4ddeac577f58a7e1998a5f9fb2eac305cc9d2
2017-05-30 03:42:56 -07:00
Stanislau Hlebik
4136d61d32 infinitepush: reduce pushbackup memory usage
Summary:
Previously `_getrevstobackup()` would load manifest for each commit in memory
only to check if a file was deleted in this commit or not. Manifest can be
quite big and since every loaded flatmanifest is cached in fastmanifest then
memory usage can be huge.
Since we are doing this only to check if there are any commits that were
downloaded to the client without filelogs and then were stripped server-side.
This cases are rare and it would be easier to track these commits in the
config file.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters, quark

Reviewed By: quark

Subscribers: mjpieters

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

Tasks: 15389402

Signature: t1:5111372:1495848867:4028bd48313ac0e2022c3695195bedc6eda80abf
2017-05-29 12:54:26 -07:00
Jun Wu
3ed8d7b512 smartlog: add a simple ancestor cache
Summary:
`revlog.ancestor` is expensive on long changelog, but is only called a few
(about 30) times for smartlog usage. Therefore we could simply cache the
result in a key-value database.

This speeds up smartlog by about 200ms.

Test Plan: Added a new test

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: stash, mjpieters

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

Signature: t1:5135746:1495783503:411260551fd29fda42c9fc809b56f8f77fb2eaf4
2017-05-26 09:03:58 -07:00
Stanislau Hlebik
78dc07eef8 fix tests after upstream change
b2eb5bb9709893ebd015b97c06f4242b3b4c7b48 in upstream broke our tests.
This commit fixes it
2017-05-25 09:55:51 -07:00
Durham Goode
b8b200a148 tests: add globs to sqldirstate times
Glob out the times so tests aren't flakey.
2017-05-24 12:53:33 -07:00
Durham Goode
1d5a3cb03f tests: fix fastannotate tests 2017-05-23 15:38:09 -07:00
Jun Wu
6f5f9b9c0d convert: unify two sources and clean it up
Summary:
There are two `convert.h`. This patch unifies them and does cleanups so it's
a valid header file which could be included by multiple .c and .cpp files
and linker won't complain re-definition (by adding `static` to everything).

Besides, reformat the code so it could pass check-code. Also fix a compiler
warning about comparing an unsigned integer with a signed integer.

Test Plan: `make clean local`. It still builds.

Reviewers: durham, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:5113550:1495565413:e399f898ac513e64af37dab5daf55cedbabfc703
2017-05-23 11:57:12 -07:00
Jun Wu
c41d432bb1 fastannotate: move to hgext3rd
Summary: Extensions should belong there.

Test Plan: Updated existing tests

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:5113146:1495562344:47bae69e6b22c14b32a8a9511878e88e89759d8f
2017-05-23 11:47:22 -07:00
Jun Wu
a97e026674 remoteid: move to hgext3rd
Summary: This is what extensions should belong to.

Test Plan: Changed existing test.

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:5113042:1495561987:d1af0f7cebfdb8b0c1a6bb71cdc826d817a4e441
2017-05-23 11:47:04 -07:00
Jun Wu
7c24b5d437 cmake: remove CMakeLists.txt
Summary:
We now use setup.py to do the build so this is outdated. It does not seem to be
useful so just remove it.

Test Plan: eyes

Reviewers: durham, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, ttung, mjpieters

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

Signature: t1:5112853:1495561149:a4ee408e1fe06dea32f96ae93abb38d7d21d3619
2017-05-23 11:46:44 -07:00
Jun Wu
8235136ede statprof: remove statprof.py
Summary:
statprof is now part of core hg. And core hg will import its own version
instead of the external one. So it's no longer to have a separate version.

I did a comparison. The version in fb-hgext is falling behind - it lacks of
Chrome support. The upstream version is also cleaner in terms of Python3 code
standard and error handling.

Test Plan: eyes

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:5112666:1495562274:7e1ca7d964bf617695dbefd59c3843a3ebf47f9e
2017-05-23 11:46:25 -07:00
Stanislau Hlebik
2a0abb9dd0 copytrace: add monitoring
Summary:
Let's log whenever one merge parent was deleted and another was modified.
It will help us find out how much disabled copytracing affects users.

Test Plan: test-copytrace-errormsg.t

Reviewers: #mercurial

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

Tasks: 18508761
2017-05-23 06:54:52 -07:00
Stanislau Hlebik
2adea9a0aa copytrace: change error msg
Summary:
First step to get better copytracing. For now let's just change merge error
message to suggest re-running command with enabled copytracing.

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Subscribers: rmcelroy, mjpieters

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

Tasks: 18508761
2017-05-23 06:54:26 -07:00
Ben Godfrey
668afbd5d2 Add remoteid extension (prints FQDN of remote host during remote session)
Summary:
Wrap the capabilities wire protocol command to print the hostname to stderr.

This commit contains the implementation of the extension but not code to register it on a particular repo.

Test Plan: `rt`

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: durham, wez, stash, simonfar, mjpieters

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

Tasks: 16758829

Signature: t1:5087634:1495498748:213a32c5c474145371bbbc43b0463dee31868a9a
2017-05-22 17:20:16 -07:00
Durham Goode
e34660b057 commands: update to use registrar instead of cmdutil
Summary: Upstream has deprecated cmdutil.commands() in favor of registrar.commands()

Test Plan: Ran the tests

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters

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

Signature: t1:5106486:1495485074:0e20f00622cc651e8c9dda837f84dd84cc51099e
2017-05-22 13:38:37 -07:00