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
Summary:
Previously, the tracer extracts file name, function name from Python code
objects and stores them as std::string. And frame the de-duplication logic
hashes those strings, which is actually quite expensive.
`hg id` takes 1.0 seconds without frame de-duplication, and 2.5 seconds with
de-duplication.
This diff assumes Python code object is unique (i.e. Python won't generate two
code objects for a single code segment). That seems reasonable and `lsprof`
seems to make a same assumption.
With that assumption, just store `PyCodeObject` (contains file, method name and
line number) instead of `std::string` (for file, method names) and line numbers
for code identity and use the raw address of `PyCodeObject` to do frame
de-duplication.
That is helpful during profiling and de-duplication:
- During profiling, no need to copy strings (convert to std::string),
therefore less overhead
- During frame de-duplication, no need to read long strings and hash them,
therefore much faster
Debug flag during compilation is added to make debugging easier as the code
starts to mix of C++ and Python objects, which means mistakes could be made
more easily.
Test Plan:
With this patch, `hg id` with frame de-duplication takes 1.0 seconds.
There is no visible overhead doing de-duplication. Cheers!
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5112636
Signature: t1:5112636:1495562232:dd0724198ebb7f2eb4e9fd3a83517fc9160fa01e
Summary:
Like other profilers in Mercurial, provide a standalone script to measure
performance of other scripts directly.
Test Plan: Run the new script to profile ipython and it works.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5112547
Signature: t1:5112547:1495562125:0d15b48b3aa9e6ead43fbb8166dabf13b6273ef2
Summary:
It's a small C utility. It should belong to `clib` directory.
Also, `#include "../foo"` does not seem to be a good pattern. It makes
include files harder to follow and make code movement more difficult. Since
`clib` is already included in `-I` during compilation, remove `../`.
Test Plan: `make clean local`. It still builds.
Reviewers: ikostia, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, vsutaria
Differential Revision: https://phabricator.intern.facebook.com/D5113236
Signature: t1:5113236:1495562436:e8d64083ab0417c67b63223a092470739f4c1176
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
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
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
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
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
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
Summary:
Upstream has added an optional operation argument to createmarkers, which we
need to also accept. This argument is currently only processed if a config
option is set, so for now we will still put the operation in the metadata dict
manually.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5106511
Signature: t1:5106511:1495485044:23d45d9ba389cf0d49b31705ae36902310c5056c
Summary: Upstream has deprecated begin/endparentchange in favor of a context object.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5106500
Signature: t1:5106500:1495485058:8377335a0f678de7bb50cb93fff29bcfeb53fe1d
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
Summary:
Previously, the progress bar is file-level - it moves when a file is transferred.
When uploading or downloading a single giant file, progress bar matters. And
this diff adds it to make people more patient.
Test Plan:
Manually upload and download several big files.
Make sure the progress bar appears in both cases.
Also make sure the output is sane with `-v`.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5100014
Signature: t1:5100014:1495316719:c500ccd63d3a495e41575cadd72419a41f5fb259
Summary:
The `cmp` logic does not look special from the original `basefilectx.cmp` so it
could be removed. This means we will benefit from LFS's override of
`basefilectx.cmp` and have a fast path for LFS binary diff.
Test Plan: Added a test. Make sure the old code fails that test.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5100529
Signature: t1:5100529:1495468055:ff7fa30f3277b942bf49ba1e9b8764effacd972a
Summary:
This adds a simple progress bar while the client receives a pack. We don't know
ahead of time how large it will be, so we can only provide the bouncy bar kind.
But we can show an increasing number of things downloaded, so they know
something is actually happening.
Test Plan:
Ran hg pull with the extension enabled, verified there was a progress
bar during the tree prefetch.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5098564
Signature: t1:5098564:1495235358:0020b28da890813f11dba70b157e526e7be418f8
Summary:
Previously our data packs would have incredibly long delta chains, where to read
the last entry in the file you had to read every previous delta all the way to
the beginning. This was very expensive for chains of 2+ million deltas. Let's
add a config option to limit how long the deltas get, and for now we'll default
it to 1000.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5095603
Signature: t1:5095603:1495213707:737d63129cf459ad6927a1f4deb0dda5a8ce0a7f
Summary:
The newly added config option could skip LFS revision checks. Let's use it
so `hg verify` passes.
Test Plan: arc unit
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5091709
Signature: t1:5091709:1495163508:3f36dfa221ab0896e1dc49d30c762d7957ac9826
Summary:
This allows automation to know which modified or added files are LFS for
specific changesets.
Test Plan: Added a test
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5091591
Signature: t1:5091591:1495163606:138638d8ccc57b8ed6c1e324750ec5dc15c198a0
Summary:
This diff disables or rewrites problematic parts in linelog code on Windows -
`mmap`, `ftruncate`, `sysconf`, `htonl` so the linelog module could be built
without on-disk linelog support. That means `absorb` can work. `fastannotate`
needs extra effort.
Test Plan:
`python setup.py install` and check in Python shell:
```
>>> import linelog
>>> linelog.linelog()
<open linelog (in-memory) at 0x3ab07bb5c8>
```
Also check the test pass:
```
fb-hgext\linelog\pyext>%PYTHONHOME%\python test-random-edits.py
```
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5093192
Signature: t1:5093192:1495161776:06e05544cff808b03546f753a553ecc66fafc79f
Summary:
When remotestore is a null store, uploading is a no-op and can be skipped.
This diff makes it so.
Test Plan: arc unit
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5090686
Signature: t1:5090686:1495144964:956549307912f4a44201aa305959bf8de26ac028
This test had non-deterministic ordering, which caused it to fail sometimes.
Let's make the test check more explicitly, by checking that the bad commit hash
is not present.
Summary:
conduit HTTP POST request did not have correct content-type header set.
Now they do. Ideally we should use python-request package to do HTTP
but I do not know enough how to import these dependencies so I just went
with the minimal changes.
Test Plan:
ran hg log from dev environment and eventually got it all working.
{P57411895}
Reviewers: simpkins
Reviewed By: simpkins
Subscribers: net-systems-diffs@fb.com, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5080725
Tasks: 18294945
Signature: t1:5080725:1495052201:1bbd6edad4c1c4b3482a7479259460a815947630
Summary:
One of the heads may point to filtered commit and isbackedup command fails in
this case. Let's use repo.unfiltered()
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5001977
Signature: t1:5001977:1493907725:f6a138bd4e2cae48b64152fceaf73660ea91f43b
Summary: Infinitepush didn't clean up temp files during pulls.
Test Plan:
Choose any hg server that's not in vip (for example, hg014.lla2).
Run `hg pull ssh://hg014.lla2.facebook.com//data/scm/fbsource -r INFINITEPUSH_COMMIT_HASH`
Check that new /tmp/tmp* file has appeared.
Install fixed infinitepush extension on the server.
Run the same command again, make sure it works fine.
Note: no new unittests, because temp filenames are random and that's difficult to test.
Reviewers: #mercurial, dschatzberg, tja
Reviewed By: tja
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5077767
Tasks: 17599765
Signature: t1:5077767:1495025042:d209d1e5342442ac8b05a4c80748780bbf36846c
Summary:
`repair.strip` removes required revisions and their children unconditionally.
That means innocent children may be removed. This patch fixes it.
We may want to have an in-core function for this feature to not strip innocent
children.
Thanks Zibi Braniecki from Mozilla for reporting [1]!
[1]: https://bitbucket.org/facebook/hg-experimental/issues/6/hg-absorb-merges-diverged-commits
Test Plan: Added a test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5073342
Signature: t1:5073342:1494972231:ca2a9881415119047771c8f35e059f4bfb1749e5
Summary:
remotefilelog needs to wait for changelog creation to get the commit hash so
all filelog appending operations are pending if linkrev is an integer.
That is better done in the `addrawrevision` layer since it will catch more code
paths. Besides, that means remotefilelog won't need to hash a same revision
twice.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5061330
Signature: t1:5061330:1494871717:a7224ebdc0f221fbaabbd2a58de975caec0e4b05
Summary: This is required (but not complete) to allow LFS fast path.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D5061283
Signature: t1:5061283:1494959731:2d7ed7465c1724cd1f231a206f949da16f90649c
Summary: This makes the next patch cleaner to read.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5061271
Signature: t1:5061271:1494869273:967b647281847fa39e88558805bcf3b9a9e2b57b
Summary:
Core HG code uses revlog.nodemap to test node existence. We will hit some
code path about LFS in the future. So let's add a nodemap to remotefilelog.
Currently, the code path won't be hit. In the future, it should only be hit by
`repo._filecommit` when a `remotefilectx` is used (which is an LFS fast path).
That means, `nodemap` test won't connect remote server for missing nodes.
In the future, we could add some "hints" to get/getmeta API to let it not look
for the remote store.
Test Plan:
Real test will be added when we do can hit that code path. But the new code is
short and looks fine.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5061254
Signature: t1:5061254:1494869146:88a0e1d04d292e2a64f29fdf52660f48b906665c
Summary:
When a bundle is created, the bundle could be exchanged via copy and possibly
eventually reach to a publishing repo. If we don't upload LFS blobs, hg server
could have revisions that can never be checked out or verified.
So let's just assume bundles generated by `hg bundle` will be public, and
upload LFS blobs automatically, without depending on other code review tooling.
Note: there is a `preoutgoing` hook which will be triggered in this case,
however it's not useful since it does not have the `outgoing` information.
Test Plan: Will add a new test
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5050945
Signature: t1:5050945:1494958648:0c46ab1d85755838ba189bbb1e0673882922bb58
Summary:
`util.py` only contains 2 small things: `lfsvfs` and `sha256`. Both of them
only have one user (in terms of files). Therefore just move the code to
related files to make it simpler.
Test Plan: arc unit
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067862
Signature: t1:5067862:1494955824:b99021f1bb44568dc0c738b0e472eb732f2bc91a
Summary:
The error was renamed to `InvalidPointer`. This diff updates error handling
to catch that instead.
Test Plan: arc unit
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067496
Signature: t1:5067496:1494955510:5f0162a8cc6f1d0d83e3ab6319ec3202028684d8
Summary:
This simplifies code a bit, and could be useful for 3rd party code. We already
have `isbinary`, `islink`, `isexec`, `isabsent`. So another `is` method looks
fine.
Test Plan: Run existing tests
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067369
Signature: t1:5067369:1494955466:ae17e310e743c704cc0d9bb73e0d2e82adcffff8
Summary:
The `filectx.cmp` fast path allows us to show "binary file changed" diff output
when two binaries have the same size but different content.
Test Plan: Added a test case
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067266
Signature: t1:5067266:1494954783:a41e8213782afe24618ef2930c9576f21610fd3e
Summary:
When the server performs a repack, it would read all the data from all the
revlogs. This was very slow and expensive. Let's add a --incremental option that
makes it only read the revlog entries that have a linkrev newer than the latest
linkrev data that's already in a pack file.
Test Plan: Adds a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4997260
Signature: t1:4997260:1493904216:c4f5b6c9652bbf8f66c1bc2b2547c898324d22cd