Commit Graph

2948 Commits

Author SHA1 Message Date
Jun Wu
7e8b62aef6 lfs: add retry logic for transferring a single object
Summary:
We got TCP RESETs frequently. It's hard to pinpoint the root cause so let's
just add retry for now.

Test Plan: eyes

Reviewers: #mercurial, #ovrsource_warroom, steaphan

Reviewed By: steaphan

Subscribers: steaphan, mjpieters, medson

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

Tasks: 19419154

Signature: t1:5265928:1497635499:17cf5d5cb69b406330326d693a9eceb1d22861f8
2017-06-16 10:54:07 -07:00
Jun Wu
e271251a2b setup: fix linelog build on Windows
A wrong change was mistakenly committed.
2017-06-16 10:25:28 -07:00
Jun Wu
9e364a3220 cython: check-in generated c/cpp code from cython
Summary:
This removes Cython as a build dependency as requested by our users.

Added a test to prevent check-in files with `/home/`.

Modified check-code to skip checking Cython generated files.

Test Plan:
Run `make clean local` with Cython installed and uninstalled.

Also run `make clean local` with `USECYTHON=1` and `0`.

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters, medson

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

Signature: t1:5252935:1497525190:402798077d44e39e24fcb037535ec7ffd1af9c4b
2017-06-15 12:55:17 -07:00
Jun Wu
3556ad01c5 fbamend: rename conflicted evolve commands instead of removing them
Summary: This unbreaks `experimental.evolutioncommands`.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, medson

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

Signature: t1:5256903:1497547902:9af6930776fc272db0c7d1bbfca2f4e76342255a
2017-06-15 10:35:28 -07:00
Felix Merk
88a744be9e smartlog: let smartlog revset take recentday argument
Summary: Add an optional `recentdays` parameter to smartlog revset.

Test Plan: Added test to test-smartlog.t

Reviewers: #mercurial, durham, quark

Reviewed By: quark

Subscribers: durham, stash, mjpieters, medson

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

Tasks: 19179819

Signature: t1:5211513:1497487196:f7d59ec32c09680ed769977890f3031369f7652e
2017-06-15 10:06:09 -07:00
Stanislau Hlebik
0d9f759213 infinitepush: add debugfillinfinitepushmetadata method
Summary:
Special command that fills optional metadata about infinitepush nodes. For now
it's info about changed files + info about how many lines were
added/removed. Since information is saved in json format it's easily
extensible.

It's a separate command so that we will be able to run it asynchronously:
during infinitepush push separate `hg debugfillinfinitepushmetadata` process
will be started. Push process won't wait for `debugfillinfinitepushmetadata`
process.

sqlindexapi will be implemented in the next diffs.

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, medson, azich, #sourcecontrol

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

Tasks: 19103180

Signature: t1:5237547:1497397211:569d1ffe3be37c8d14fb7e07e42cd085ad5686d4
2017-06-15 05:19:37 -07:00
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
31e9c3d80b copytrace: fix logging
ctx.node() is None, so it's bettter to use ctx.hex()
2017-06-15 04:08:49 -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
Olivier Trempe
602a765fe6 pushrebase: bring variable initialization closer to first usage 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
8d58d00052 fbamend: move restack to a separate file
Summary: This makes `__init__.py` smaller.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, medson

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

Signature: t1:5223421:1497387183:9ce70419c3c63ca55f1a225192ae7a6556316ea3
2017-06-13 17:09:34 -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
e1f58d87e3 fbamend: move unamend to a separate file
Summary:
Going to split fbamend into individual files by commands. `unamend` seems
self-contained to be moved out.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

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

Signature: t1:5221159:1497261013:d371bcf4406277228fc4f3f6c6aaa4600dab4823
2017-06-13 17:08:50 -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
Durham Goode
87bcf32bed remotefilelog: fix exponential dfs
Creating a remotefilelog blob does a walk of the ancestors, but the walk had
poor checking for if a node was already queued (instead it checked if it had
already been processed, which it may not have been processed yet, despite being
queued). This resulted in extremely long wait times for files with lots of
merges in history because it became exponential.

This fixes that.
2017-06-13 10:21:30 -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
300bc72abd absorb: fix test
Upstream e0fc50267c46 removed makememctx() function and requires filectxfn to
be an instance of patch.filestore.
2017-06-13 07:17:36 -07:00
Stanislau Hlebik
6ba65159c6 slqdirstate: fix test
Summary:
In 800bf9b727017002bcfcb8b558344403cc9ca938 _identity() method was added.
If `_identity()` property is not set in read() function then we get and endless
recursion P57511905.

Test Plan: Run test-sqldirstate-shelve.t

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters, medson, #sourcecontrol

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

Signature: t1:5236514:1497362573:0418ece747c2d44f386242e82c99cefdb45be10d
2017-06-13 07:17:03 -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
0077886854 copytrace: do not log if file contexts were the same
Summary:
One one more improvement to logging to better measure the impact. Do not log if
file contents are the same as it is explained in the comment.

Depends on D5217007

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, medson, #sourcecontrol

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

Tasks: 18508761

Signature: t1:5218112:1497317521:e73e8ebe01a4a8ca73ad9fc87b5608d4c9f5484c
2017-06-13 01:57:07 -07:00
Stanislau Hlebik
cb9f3c9a22 copytrace: log file paths and hashes
Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters, medson

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

Tasks: 18508761

Signature: t1:5217007:1497020693:a42d44bf26ca991e3143f41b77148e3803c0267d
2017-06-12 02:49:20 -07:00
Stanislau Hlebik
f7fdb06f79 copytrace: remove unnecessary test that was failing 2017-06-09 09:23:06 -07:00
Durham Goode
355498c9c9 infinitepush: handle invalid remotenames
Summary:
Remotenames can return a name that has no nodes (it may exist in the remotename
store, but when we go to resolve the node the node doesn't exist). So we need to
check for existence after fetching the nodes.

Test Plan: This was crashing for a user. After the fix they no longer crash.

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: mjpieters, medson

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

Signature: t1:5194317:1496847686:ab05335284b83a2060c2bfea4beec6bf0453905c
2017-06-07 12:55:29 -07:00
Durham Goode
dcc33315d5 remotefilelog: prevent exponential ancestor walk
Summary:
The remotefilectx ancestor walk did not check if it had already walked a node,
and therefore very mergey history would cause this to be exponential runtime.
Let's add a visited check.

Test Plan: hg log on a file with very mergey history

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mjpieters, medson

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

Tasks: 19121837

Signature: t1:5191981:1496865201:66b58b6831e9ae1707f834965456d95ec339cc86
2017-06-07 12:55:29 -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
cfcb6fc5c9 infinitepush: refactoring to add BackupBookmarkNamingManager
Summary:
Previously there were many small functions that were used to create backup
bookmark name. Changing the logic was quite onerous because one would need to
change function signature in a few places.

This diff introduces special class that incapsulates this behaviour.
With this class making changes to naming scheme would be less problematic.


Depends on D5180390

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: #sourcecontrol

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

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
Stanislau Hlebik
84ab17a89a copytrace: exlude added files
Summary:
Previously if file was added in source then it would be considered missing in
destination. This behaviour won't add incorrect copies, but it would do
additional work of checking move candidates for the added file. This diff fixes
it.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: #sourcecontrol

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

Tasks: 18508761
2017-06-07 03:40:54 -07:00
David Soria Parra
b0d59e858a p4fastimport: implement transaction.find and .replace
Summary:
revlog uses transaction.find and transaction.replace in cases where a
datafile is separated from an index (>= revlog._maxinline). In these cases the
importer broke as we did not implement find and replace in filetransaction.

We implement the two methods. However we ned a save way to store the data
portion which find must correclty return. We cannot store json as some
serializations aren't bidirecitonal. We can't store pickle as \n is a common
separator in pickle, and we use that to separate our entries. So we use pickle
and then base64 encode it. This is cumbersome but works.

The fix is aimed to make things "work" and I want to explore options to better
implement find and replace.

Test Plan:
- Working on a test that correclty triggers inline -> separation.
- Deployed it to our test system with test data and see commits comming in.

Reviewers: #idi, #ovrsource_warroom, #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D5189308
2017-06-06 19:54:29 -07:00
Kostia Balytskyi
afad4c3c15 inhibitwarn: stop using strftime('%s') because it is wrong
Summary:
%s is not supported, works on Linux by accident, does not work on Windows.
https://stackoverflow.com/questions/11743019/convert-python-datetime-to-epoch-with-strftime

Test Plan: - run tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5191450
2017-06-06 12:02:00 -07:00
Kostia Balytskyi
666b06e763 obsshelve: get rid of isobsshelve function and its uses
Summary:
Since it is now an independent extension, we don't need to have a knob
to enable/disable obs-based shelve, we can just enable/disable the entire
extension itself.

Test Plan: - run a test

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5181001
2017-06-06 05:50:19 -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
Kostia Balytskyi
222003b2ac obsshelve: copy the patched shelve.py from core
Summary:
Grand goal is to remove all of the shelve-related hotfixes and just have
a separate extension, obsshelve, which we could roll out to all FB users
without worrying about upstream.

This commit just copies current version of core's shelve.py with FB hotfixes
applied on top of it. The only changes are changes in testedwith and a
description at the top of the file and an import of rebase from hgext rather
than '.'.

Test Plan: - it is not enabled and tests are added in a later commit in this stack

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5180947
2017-06-06 05:43:39 -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
Stanislau Hlebik
b03156c294 tweakdefault-blame: fix test
Upstream 135567a9d3e46a5686343e3a40f15482f7787a48 changed blame formatting.
This diff fixes tweakdefault to use this new formatting.
2017-06-05 14:56:36 -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
Durham Goode
5a8edc4d30 treemanifest: only perform prefetch if nodes are missing
Summary: Only do the tree prefetch if there are nodes we don't have.

Test Plan: manual testing

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:5108667:1495580154:393125986ce4ce307f299f8ee3856fc76c52a25f
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