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 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:
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
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:
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:
`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:
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:
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
Summary:
Calculating what blobs to upload should be fast since we use changelog `files`
information. Users will see `lfs: uploading ...` very soon. So let's downgrade
`lfs: computing set of blobs to upload` to a debug message to make `-v`
cleaner.
Test Plan: Updated existing test.
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5066600
Signature: t1:5066600:1494954115:c00925a1930f9b53e914078d32b6c4e4161099ee
Summary:
Downloading or uploading a single LFS object could take long. Instead of
showing a summary of what objects are downloaded or uploaded, print a message
per object if --verbose is provided.
Test Plan: Added a test
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5066327
Signature: t1:5066327:1494953894:3593436ff53eaff117a2932476dfc4b867fb9f17
Summary:
Previously, when an object is not found server-side, we error out during the
basic transfer API. This diffs move the check to the batch metadata API so the
check is preformed earlier.
That also means, when batch fetching many LFS objects, we could report multiple
objects being missing instead of just one.
Test Plan: Modified an existing test
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5065623
Signature: t1:5065623:1494952131:cb1df73e1cea21e07bfd0ec630bacec60e5b385c
Summary:
We are adding a simple transaction that works only with filelogs but
allows for concurrent access from multiple workers. This allows for a proper
rollback in case of a failure in a worker process, which previously would result
in bad data in the repositoriy.
Test Plan: rt test-p4* test-check*
Reviewers: #mercurial, durham, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5070340
Signature: t1:5070340:1494958313:b10b1eac5b42b36d1a587c4ae1c95fc2f8b5ad35
Summary:
The LFS uploading or downloading process consists of 2 parts: a batch API to
get metadata about objects, followed by `len(objects)` requests.
This diff moves the first metadata API out from a giant `_batch` method to
make the code structure easier to maintain. Later diffs will further split
`_batch` method.
A side effect is `lfs: mapping blobs to #{action} URLs` message is removed.
More user-friendly message will be added back in a later patch.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057541
Signature: t1:5057541:1494949989:d510c3d9369744e7ee776c0d0a26d263dfaf8352
Summary:
Displaying total bytes to upload is currently inaccurate - the server could
already have some objects so only a subset of selected objects will be
uploaded.
Besides, we pass `pointers` to related upload and download APIs so `total`
could be calculated from them.
This diff removes the inaccurate "need to upload" message and unnecessary
parameters. An accurate message will be added in a later patch.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057470
Signature: t1:5057470:1494949554:07e637a8b58c894598b3f0c2dd53f80a5ade25a8
Summary:
Upstream shelve now writes simplekeyvaluefile for shelvedstate. This means
that tests which relied on ordered state files need to be adjusted.
Test Plan: - rt
Reviewers: durham, mitrandir, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5069982
Summary: Added -U/--unified NUM to fbshow.py, and used that to set diff.unified=NUM.
Test Plan: hg show --help; hg show -U 1; hg show -U 2; hg show -U by induction.
Reviewers: mburman, simonfar, ikostia
Differential Revision: https://phabricator.intern.facebook.com/D5052156
Tasks: 10006036
Tags: python
Summary:
The server or the HTTP library may provide more detailed error message.
Let's use them. `RequestFailedError` is also renamed to `LfsRemoteError` to
make it clear it's related to LFS and network.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057014
Signature: t1:5057014:1494634052:00c1cb1b337a0e4cb92828cd49e95b7b0ff7e540
Summary:
move p4fastimport under hgext3rd as that's where it belongs.
Also has the benefit that we package it up.
Test Plan: rt test-p4*
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5056664
Signature: t1:5056664:1494631758:4892f47922d8fbbd2c1f7793f3f29ee73fa8fa42
Summary:
Read the Git-LFS specification [1] and implement most checks to prevent
programming error and detect data corruption.
The new code should be stronger than what was before the refactoring, since the
old code only checks keys but not values.
[1]: https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md
Test Plan: Added a new test
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5046740
Signature: t1:5046740:1494543072:2f0dbfc07cd52a10572550a277d850bdf3f78d27
Summary:
This diff adds a shared `p4setup.sh` that de-duplicates common logic among
tests. It also uses absolute path to make sure the extension being tested is
the version being developed.
The LFS test is also workarounded temporarily waiting for upstream change.
Test Plan: Run existing tests
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5049279
Signature: t1:5049279:1494547832:28222fd2034115faca73860d6dd2f19206701aaa
Facebook probably doesn't want external users reaching out to them directly
for support, so this should be customizable to specify other possible courses
of action (especially in cases where githelp is further extended to document
git-related company-internal commands in other companies).
It looks like there is some flakeyness in racing pushes during this test. Seems
to be caused by hg serve loading the initial repo state while other processes
are writing new commits, which results in a missing master. Introducing a slight
sleep to the beginning of the transaction allows all the processes to load the
correct initial state and gets rid of the flakeyness.
Summary:
This hooks into the strip code to allow stripping revisions from treemanifests
as well. This will make it easier to clean up server repos when mistakes happen.
Test Plan: Adds a test
Reviewers: #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5031489
Summary:
Previously, when creating a new manifestrevlog for the trees, we attempted to
copy the opener options and insert the treemanifest value for the manifestrevlog
class to pick up. It turns out that the opener we copied was actually just a
wrapper around the same underlying object that the real repo used, so when we
did opener.options = oldopener.options.copy(), we were actually putting the new
copy on both the old and new opener. This meant we enabled treemanifest for the
entire repo.
This wasn't a problem in most cases because the manifestlog had already been
loaded. But in a pushrebase world, all the data structures are refreshed when
the lock is obtained (after waiting for the other push to finish). In this
situation, the refreshed repo.manifestlog was now a treemanifest so the second
commit was pushed to the main manifest as a tree.
The fix is to not use the opener.options hack to configure the tree. Instead we
are refactoring upstream to take an explicit options to the manifestrevlog
constructor. This patch makes our internal treemanifest extension use this new
api and adds a test for push contention.
Test Plan: Added a test. It failed before, and passes after.
Reviewers: #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5026019
Summary:
`filelog.filenode` could be `None` when it's unknown - like working copy. That
breaks `isbinary` test. Let's modify `_islfs` check to return False to disable
lfs code path in that case.
Test Plan: Added a new test.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5034058
Signature: t1:5034058:1494431790:a02b69addf5d2f9b6b9a27ad71ed4f136b2bfd2b
Summary: `revdiff` should use raw revisions. 5d11b5ed in core hg is a similar fix.
Test Plan: Added a test.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5031916
Signature: t1:5031916:1494366439:80d496ed6f69a784d345510147eab6c479496f84
Summary:
77b66b03be changed how pushrebase and obsmarkers worked, which apparently causes
this test to change. Updating the test.
Test Plan: ran it
Reviewers: quark
Reviewed By: quark
Differential Revision: https://phabricator.intern.facebook.com/D5030830
Signature: t1:5030830:1494360593:e0c9ce9a8466cb725b3dcc22a9161c9f02b00f15
Summary:
The config option was designed to be used server-side to avoid accessing remote
LFS blob stores. However, we now have `lfs.url=null:` as a clean alternative,
which will explicitly raise if the server ever tries to download remote
content. So `bypass` is no longer needed.
`bypass` could also be used for displaying raw content. That is doable using
`debugdata`.
Test Plan: Modified existing tests
Reviewers: #mercurial, rmcelroy, davidsp
Reviewed By: davidsp
Subscribers: davidsp, rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009725
Signature: t1:5009725:1494260384:332d7bd658359c004342efd01e4f13b6fc5499b1
Summary:
`lfs.blobstore` is a path used to store local blobs. Some of the blobs are not
uploaded yet so they couldn't be easily discarded. Although blobs downloaded
from the server could be removed if necessary.
It does not make much sense to make this a config option - the data should be
stored reliably. It's also dangerous to allow write to arbitrary paths under
`repo.vfs`.
This diff makes the local blob store fixed path at `.hg/store/lfs/objects`.
The choice is similar to `.git/lfs/objects`, but with `store`, shared repo
could share their lfs stores.
Test Plan: Modified existing test.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009664
Signature: t1:5009664:1493978440:c3f6351d0ea0cca2ce3caa9f7260c5d65bcc0e5f
Summary:
lfs-test-server is a reference implementation by GitHub [1]. Testing against it
will give us more confidence.
[1]: https://github.com/git-lfs/lfs-test-server
Test Plan: Added a test
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009346
Signature: t1:5009346:1494042196:86e8c2e0e5c4296b1afc72efa84a9c1b9030e6fc
Summary:
Per discussion with @davidsp, we want to stick to Git-LFS specification and
avoid non-standard behavior. The chunking behavior will happen at LFS server
transparently.
The direct motivation for this is to make it possible to implement an
efficient `filectx.cmp` that just compares hashes.
Test Plan: Updated existing test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters, davidsp
Differential Revision: https://phabricator.intern.facebook.com/D5001827
Signature: t1:5001827:1493914639:c58694873e79a8ca910bb8ee01bf593885896664
Summary:
Usually LFS files are binary files. But there could be exceptions. This diff
adds a new customized field `x-is-binary` to record those exceptions.
The `filectx.isbinary` API is changed to use that metadata as a fast path.
This allows us to provide a transparent user experience (whether a file is
stored in LFS or not does not affect its original `isbinary` property),
while still being able to skip loading the LFS blob if the file is binary.
Test Plan: Added a new test case
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5001117
Signature: t1:5001117:1493892406:2a8ebd42d0ae0dbae39b87b9ea16db22b99f3d12
Summary: Like _config, _import needs to restore the pre-existing profile if refreshing failed. Otherwise we have marked new rules as imported and applying without that actually being true.
Test Plan: rt test-sparse*
Reviewers: #sourcecontrol, rmcelroy, durham, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4985415
Tasks: 17793415
Tags: autosparse
Signature: t1:4985415:1493893462:ee4bcbf558706c3d2f58367dd7bf2533ccf1b824
Summary:
D4865150 and D4934720 aren't effective in our current setup. The direct
cause in the code is because the server couldn't find common marker version:
```
# old server-side code, returns empty in our current setup
obsolete.commonversion(bundle2.obsmarkersversion(reply.capabilities))
```
Upon investigation, it's because there is no `exchange` enabled client-side.
But we do want one-way (server->client) markers for the rebased commits, as
long as obsstore is enabled (createmarkers is set, without exchange).
The upstream expects the server to have obsstore enabled, and exchange
enabled, to send markers. Since we are generating markers without an
obsstore (see D4865150), we are on our own way. This diff makes it one step
further.
This diff adds an explicit parameter to the `b2x:rebase` part to tell the
server what obsmarker format the client supports so the server could make a
right decision without relying on the "standard" `reply.capabilities`, which
is affected by the exchange option.
Test Plan: Change the existing test, make sure the old code fails.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4997972
Signature: t1:4997972:1493848751:14c29654b2e8246bd12a8de8820af5b3773e2fb7
The main rationale for this change is that I've got years of use
patterns on bisect where I *start* bisect by running 'hg bisect
--reset', not *finish* with that command, so `hg status` with
morestatus enabled is spewing annoyances in nearly every repository
I've ever used. It wasn't any harder to allow people to ignore
anything they want, but (at least for now) bisect is the only state
that seems "special" in that it doesn't have a definite "end" that
Mercurial can detect and automatically clean up. I'd also be fine with
adding something like morestatus.ignorebisect if we want to avoid a
potential footgun where a user could ignore rebase state.
Summary:
The tests were still testing version 0. Let's update it to version 1 and fix the
bad version check test.
Test Plan: Ran the tests
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4991404
Signature: t1:4991404:1493802873:def4135219d731f7c0cb542012e439e79192c54f
Summary:
Previously looking up a particular node in a histpack required a bisect to find
the file section, then a linear scan to find the particular node. If you needed
to look up the latest 3000 nodes one by one, that involved 3000 linear scans,
many of which traversed the same nodes over and over.
This patch adds additional index at the end of the current histidx file. In a
future patch, we will change getnodeinfo() to use this index instead of the
linear scan logic.
Test Plan:
Ran the tests. I haven't actually verified that the data in these
indexes is correct. My next patch will add logic that reads these indexes and
will add tests around it. I won't land this until I've confirmed it's correct.
Reviewers: quark, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4983690
Signature: t1:4983690:1493798877:ae0802b4896b54bf066df9f684d94554855fd35a
Summary:
Previously, we used the length of the index file to determine the upper bounds
of the bisect. In a future patch we'll want to add more data to the end of the
index file, so we need to record how long the index portion of the index is.
This patch adds that information.
Test Plan: Ran the tests.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4983682
Signature: t1:4983682:1493693255:57ab9af2030847fedff05b6755113ba8ce0c933b
Summary:
This patch just bumps the histpack version number to 1 and adds a config flag to
enable writing v1 pack files. The format hasn't actually changed in this patch,
I'm just doing the verison bump so I can update all the hashes in the tests
without working about functionality change.
In the next patch I will modify the index format, which won't affect the hashes.
Test Plan:
Ran the tests. I also ran the tests with some debug code to manually
force the sha to include 0 instead of 1 and verified that the hash didn't change
(which confirms that all of these hash changes are just because of that one byte
version change).
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4983675
Signature: t1:4983675:1493692444:5d88df4d46ce487f1b791417754ba000ecf10a1e
Summary:
The newly changed `LZ4_decompress_safe` is unhappy about empty buffer. So let's
check empty revision explicitly.
Test Plan: Added a test
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4986277
Signature: t1:4986277:1493743735:be2ad6047bb0b983425c6e49b7c5ddf2c94d1c1a
Summary:
This test won't be run unless it is in the right directory.
#m brownpaperbag
Test Plan: run arc unit
Reviewers: #sourcecontrol, jeroenv
Reviewed By: jeroenv
Subscribers: jeroenv, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4985738
Tasks: 17796162
Signature: t1:4985738:1493736355:4c9358fbf536661dc6b1f11c546332cda54f21b2
Summary:
Support the action archive. 'archive' means that a revision was
"archived" to a different depot. We must ensure we support the action correctly
in order to have a smooth import.
Test Plan: run it && rt test-p4* test-check*
Reviewers: #sourcecontrol, #idi, wlis
Reviewed By: wlis
Subscribers: wlis, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4980571
Signature: t1:4980571:1493676115:ad0d3748c52747aeb6427fd25ece9d4987886936
Summary:
When passing --limit we are processing N Perforce changelists at a time.
The goal is to provide savepoints for large imports.
Test Plan: rt test-p4* test-check*
Reviewers: #sourcecontrol, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4980482
Signature: t1:4980482:1493688071:800a0bafda33a17cb2ef54c9f399db7055a8cbf9
Summary:
This diff makes 2 changes to v1 packfile metadata:
1. Move `key` in a metadata entry to before `size`.
```
old: [entry-size: 2 byte] [key: 1 byte] [data: var length]
new: [key: 1 byte] [data-size: 2 byte] [data: var length]
```
Previously `entry-size == 0` does not make sense.
2. Use binary to represent sizes, instead of ASCII.
Related utility methods are cleaned up a bit so it's harder to make mistakes.
Test Plan: Updated existing tests
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4983189
Signature: t1:4983189:1493689852:22d544d73ed63fac83f849786de035af304161ce
Summary:
This shows how much overhead the `getmeta` call introduces.
Initial investigation shows the C version is about 10x as fast as than `get` or `getdeltachain`.
Test Plan: Run `hg perfdatapack` in an repo.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4909157
Signature: t1:4909157:1492667211:e82a14e12d04f60c0cee4124e83845ec166a78cc
Summary:
This diff implements getmeta in C and enables related tests.
Now all content stores support `getmeta`.
Test Plan: Run existing tests.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4960926
Signature: t1:4960926:1493611048:55095c32927fac74e698f21d47173cb8a7523fb6
The bundle2 part was always being generated, even for non-treemanifest repos
(because fastmanifest imports the treemanifest module, so the b2partsgenerator
gets registered). This cause pushes to break in any repo with fastmanifest
enabled.
Summary: We've made changes to arcanist configuration recently. Need to do the same in the tests.
Test Plan: arc unit
Reviewers: #scmquery, rmcelroy, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4969670
Signature: t1:4969670:1493376937:536470162c52c8be953c813c1fea54f3e506f1e9
Summary:
To enable pushing between peers (and eventually pushing to the server), let's
teach bundle creation to include the trees being pushed.
Test Plan: Adds a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4957456
Signature: t1:4957456:1493266296:67f98a2b3d691644bde9098a713d05266f349cde
Summary:
Previously, history stores only had getancestors() apis which returned all the
ancestors. This was expensive if there was a lot of ancestors, like for the root
tree of treemanifests. Let's add an api for accessing a single history entry.
This will be useful in pack generation for only fetching the history related to
the trees we're sending at that time.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4957432
Signature: t1:4957432:1493263124:a155ac5a70c35f7e25a5cc48c9d9c2126d4c5858
Summary:
Previously, a local commit would only write data packs, and it just threw away
the history data entirely. Let's add history packs and record them on commit.
Test Plan:
The tests are updated to show these new packs. In some cases the
datapacks got smaller as well, since they can now take advantage of history data
for delta choices.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4956105
Signature: t1:4956105:1493265399:d3fa1052c207fba0045cbb92b4d833d18d48e099
Summary:
Previously, the logic that added data to a mutable history pack was required to
add it in the correct order (all entries for a certain file at once, and in
newest-first order). This required the callers to jump through weird hoops if
the data came in out of order or at different times in the transaction.
This patch moves the ordering logic to be inside MutableHistoryPack, so callers
can add the data in any order they wish, and it will get sorted before being
serialized.
This does add memory pressure to things that read a lot of history, like repack.
If this becomes a problem we may want to add a 'historypack.flush()' api that
let's us tell the history pack it's ok to flush it's current contents to disk.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4956096
Signature: t1:4956096:1493264693:a2275a49e35565d4b11244e3e5dd82c25de7e16e
Summary:
Adds a config option that will automatically download the last N trees from the
server during pull. It efficiently decides what bases to set, based on what
commit parents it already has.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4923211
Signature: t1:4923211:1493200730:39872db6aabb48c12131ff8501a950c8ee60e2b0
Summary:
This allows a third-party tool like Buck report more detail on what a sparse
command actually achieved.
Test Plan: Run the test suite.
Reviewers: #sourcecontrol, durham, rmcelroy, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4962550
Tasks: 17150508
Tags: autosparse
Signature: t1:4962550:1493307403:d14e16d079121688a4eb69f0d69cd02ab55c4936
Summary:
The test covers common workflows like clone, commit, push, update, pull. It
exercises the remotefilelog plain store and Python datapack store to make sure
they won't lose the revlog flag. The test also tries to verify rename works
correctly.
Since the lfs extension may be eventually upstreamed, it seems a good idea to
make remotefilelog call `lfs.wrapfilelog` so lfs is free from remotefilelog
code.
Test Plan: Added a test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4904281
Signature: t1:4904281:1492560308:5fd9f214ada6de795735ea7d737d30c1bf39812a
Summary:
This diffs add a `getmeta` method to all content stores. The cdatapack code is
modified to pass the tests, it needs further change to support `getmeta`.
The datapack format is bumped to v1 from v0. For v1, we append a `metadata`
dict at the end of each revision. The dict is currently used to store revlog
flags and rawsize of raw revlog fulltext. In the future we can put more data
like a second hash etc, without changing API or format again.
This diff focuses on correctness. A datapack caching layer to speed up
`getmeta` will be added later.
Tests are updated since we write new v1 packfile now and the format change
leads to different content and packfile names.
`Makefile`, `ls-l.py` are added to make tests easier to maintain.
Test Plan: Updated existing tests.
Reviewers: #mercurial, rmcelroy, durham
Reviewed By: durham
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4903917
Signature: t1:4903917:1493255844:7ef5d487096cd2f78f2aaae672a68d49f33632ee
Summary: Today is a bad day. I don't even know how this got in there.
Test Plan: y
Reviewers: durham, #mercurial
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4957784
Summary: Otherwise, the test requires hg-dev and will break third-party developers.
Test Plan: Reran test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4957662
Signature: t1:4957662:1493242115:7e83b130791b07b1e45f04ce199e5c4ee9d58d77
Summary:
allows users to have JSON progress bar information written to a path
Controlled by the `ui.progressfile` config. Mercurial will overwrite this file
each time the progress bar is updated.
The schema of this file is (JSON):
- topics: array of topics from oldest to newest. (last is always the active one)
- state: map of topic names to objects with keys:
- topic (e.g. "changesets", "manifests")
- pos: which item number out of <total> we're processing
- total: total number of items
- unit: name of the type of unit being processed (e.g., "changeset")
- item: the active item being processed (e.g., "changeset #5")
- active: whether this is the currently active progress bar
- units_per_sec: if active, how many <unit>s per sec we're processing
- speed_str: if active, a human-readable string of how many <unit>s per sec
we're processing
- estimate_sec: an estimate of how much time is left, in seconds
- estimate_str: if active, a human-readable string estimate of how much time
is left (e.g. "2m30s")
Test Plan: added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: rmcelroy, quark, stash, asriram, mjpieters, durham
Differential Revision: https://phabricator.intern.facebook.com/D4752788
Signature: t1:4752788:1493233878:b49095237d32233c78cd0e0aaaa7b94e0e9e7011
Summary:
Make the unpacked file format to include the revlog flag information, and make
the getfile(s) protocol support it.
Note: The `getpackv1` protocol and packfile format is not changed yet.
Test Plan:
Run existing tests. Stronger tests and lfs integration test will be added when
this area is more complete.
Reviewers: #mercurial, rmcelroy, durham
Reviewed By: durham
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4903772
Signature: t1:4903772:1493152451:ab393b0208f0eee199ffc4c8fcfdfd5dd6d0f3ac
Summary:
The extension was a quick hack from me to make it easier to locate non-core
code when doing extension development. It seems a good idea to add colors in
general so it's named "morecolors" with the hope that we can colorize more
places in the future.
Test Plan: Added a test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4884999
Signature: t1:4884999:1492473666:89a6756b231eac4274fa05d489480229146bdab8
Summary:
This imports a SHA1 hash function implementation from
https://github.com/cr-marcstevens/sha1collisiondetection, commit hash
0572d8a302b1f62f25c1559b0de74908550ab2c3, using the MIT License.
This allows us to decouple from an external crypto library like openssl. The
new library's "safe hash" feature could also mitigate known SHA1 collisions.
test-check-code is modified accordingly to skip checking the sha1 code
without modifying them.
Test Plan: Run test-check-code.t and make sure it's not complaining.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: ikostia, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4945012
Signature: t1:4945012:1493154822:be0deb451d50f3a8b6cc42addf091349bf6554f4
Summary:
We now use `check-code.py` directly from core mercurial. It's no longer
necessary to have it in our repo.
Test Plan: `arc unit`
Reviewers: #sourcecontrol, jeroenv, rmcelroy
Reviewed By: jeroenv, rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4945054
Signature: t1:4945054:1493122097:5880dc2c0caac215cb10db40d30691dc1a147315
Summary:
Previously we ignore "draft -> public" phase move, and new nodes returned by
the server may remain "draft" until the next pull. This diff records the
obsmarkers and updates phases of the new nodes correctly so they become
public without an extra hg pull.
Test Plan: Modified an existing testcase
Reviewers: #mercurial, durham, rmcelroy
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4934720
Signature: t1:4934720:1493076241:9b23da1140b68aece9e838c604e64611b3498794
Summary:
This basically takes the last upstream version of my conflictinfo patch and makes it an extension, so we can get it out to FB/Nuclide users
a bit faster. @asriram has already been developing with this version as a personal extension for a couple of weeks.
I still plan to ship the upstream version through after the freeze ends -- when that happens, we can delete this extension. During the time the two
versions overlap, they shouldn't conflict. (The extension version will still run over the internal version until it's disabled, though.)
Review-wise, this is similar to the last upstream version, except it adds the "command" key that indicates which command generated the conflicts (based on which mutually-exclusive state file exists), and incorporates most of the feedback.
Test Plan: Added a test and ran associated tests.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, asriram, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4944709
Signature: t1:4944709:1493148790:a4e798f5bd17ada767ae6c96fe8c8ab973960383
Summary: I was using """_dotfiles_scm_info '[%s] '""" in my prompt, which broke after the refactoring. Add a unit test and fix the code.
Test Plan: wrote a test for the breakage, edited code until they all passed
Reviewers: rmcelroy, tja
Reviewed By: rmcelroy
Subscribers: mjpieters, #pe_security
Differential Revision: https://phabricator.intern.facebook.com/D4945132
Signature: t1:4945132:1493136425:4516151982d173584cf874985de9de1fed0962d5
Summary:
Implement an option to set a bookmark after we imported successfully.
We used to try to calculate this for continuous imports in a wrapper around the
importer. However it's much easier to just do it inside the importer itself, in
particular when we add branch support later
Test Plan: rt test-p4*
Reviewers: #idi, #sourcecontrol, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4935717
Signature: t1:4935717:1493127835:262955b3288d9bd03ca08a45d7ec1667d786430a
Summary:
correct PYTHONPATH to allow running tests without having to
source hg-dev. This was suggested by @durham
Test Plan: rt tests-p4*
Reviewers: #sourcecontrol, #idi, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, durham
Differential Revision: https://phabricator.intern.facebook.com/D4921199
Signature: t1:4921199:1492696261:ca70d837a9f273433b21fb10e3f4ff1afc6a5698
Summary:
Perforce client support a view. A view maps a server side path to a client side
path, e.g.: the view '//depot/A/B/... //myclient/foo/...' maps every file in
//depot/A/B/ on the server side to a local checkout foo/ inside the root for
checkouts defined for the client 'myclient'.
We are using §p4 where§ to support these mappings. We do the mapping inside the
FileImporter at the moment as this runs nicely in parallel. It's a bit hacky
but get's the job done. We use this mostly to ommit the common prefix
//depot/... and remove branch indicators such as Main.
So in our case a view looks like
//depot/Software/OculusSDK/PC/Main... //client/Software/OculusSDK/PC/...
resulting in a file
//depot/Software/OculusSDK/PC/Main/test.txt
being imported as
Software/OculusSDK/PC/test.xt
Test Plan: rt test-p4*
Reviewers: #sourcecontrol, #idi, ikostia
Reviewed By: ikostia
Subscribers: ikostia, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4913483
Signature: t1:4913483:1492702356:b97b691343b8a1d52940445934730b31d411db4c
Summary:
We do not write the blobs to local cache anymore. We want our LFS
server to import them from Perforce directly or serve them from Perforce
directly. In order to do so, we need the correct mapping from oid to perforce
file + cl. This is generally useful metainformation that other LFS
implementation can use. We simple write the data to sqlite because it's simple
and built in.
Test Plan: rt test-p4*
Reviewers: #sourcecontrol, #idi, quark
Reviewed By: quark
Subscribers: quark, durham, wlis, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4913469
Signature: t1:4913469:1492796253:1e3b389c7cb0ba3acf9504410d267a1cf9651118
Summary:
Add a special mode to the importer that patches the LFS extension to
not write blobs to local disc. In our case we do have the files already in
Perforce and do not have to write them again to disk. This is currently breaking
verify and therefore we are patching verify.
Test Plan: rt test-p4*
Reviewers: #sourcecontrol, #idi, durham, quark
Reviewed By: quark
Subscribers: quark, durham, wlis, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4913455
Signature: t1:4913455:1492979419:204c1075376fe975ddea880b22e6984684e7ff25
Summary:
Command that checks if a commit was backed up.
It does it by checking if revisions are in local backup state.
Test Plan: Run unit tests and lints
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4938072
Tasks: 17519836
Signature: t1:4938072:1493072854:291765bb59d327db8504feb47d6089818ae1e11a
Summary:
infinitepushbackup.tempcleanworkingcopiesbackups option sends special command
to clean backup bookmarks from the server for the shared working copy (i.e.
if we have main repo `fbsource` and shared working copy `fbsource2` we want
to have backups only for `fbsource` not for `fbsource` and `fbsource2`).
Before this diff cleanup commands were send for every backup.
This diff makes them send only if backup state file is present.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4929489
Signature: t1:4929489:1493075761:a408300338a10864043b538540d03880a49c4e1a
This allows us to turn off the obsolescence warning altogether, since we still
use strip together with obsolescence in some situations (e.g. changing the
narrowspec for narrowhg, in which case we "insert" revisions which were
previously not relevant in the middle of the change log and then have to
strip and re-create their children to repoint p1).
Summary:
There was a recent change in mercurial and revsets
shouldn't return lists anymore. This diff fixes it.
This diff also fixes git diff handling. It returned not even a list,
but a single rev number. Unfortunately it's not tested because we need to
mock conduit response.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: ikostia, kulshrax, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4938930
Signature: t1:4938930:1493051696:cfb278773e5932d5f38942b0a0ca49f018ec5083
Summary:
This diff changes lfs `revision(raw=False)` output to include hg filelog
metadata. The LFS blob does not contain filelog metadata as before.
This hurts performance if there is a rename, or the binary starts with the
magic `\1\n`. But compatibility is greatly improved - it's now possible to swap
a non-lfs revision with mercurial rename to a lfs revision, and easier to be
compatible with remotefilelog (namely, remotefilelog defers filelog.add until
commit hash is known).
Test Plan: Modified existing test.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: rmcelroy, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4906074
Signature: t1:4906074:1492559513:09b25fc1026d4ce8fd784a044d6724f12e8bda45
Summary:
There was a bug that caused commits with file deletions to not be backed up.
This diff fixes it by first checking if file exists in the commit and only
then downloading context of the file.
Note:
In tests I had to ignore stdout of `hg pushbackup` because the output was
different on macs and linux.
On linux there was an additional line
remote: abort: data/committostripfirst.i@091b63e5e4: no match found!
Probably mac's remotefilelog closes stdout/stderr earlier, but I wasn't
able to find a root cause.
Test Plan: Run unit tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4929244
Tasks: 15389402
Signature: t1:4929244:1492791804:77b2baa9eb54a53120a955e72e6c132be5db6b44
Summary:
BSD and GNU ls behave differently in case of a missing dir:
- exit code is [1] vs [2]
- message is also slightly different
We want this to be unified for both platforms.
Test Plan:
- run the test on Linux
- hope for the best on OSX
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4921369
Summary:
Implement incremental imports.
1. Find the last imported perforce changelist.
2. Set startctx and use it in all importers
3. Import filelogs from their current position (we "should" add an additional check here, but we don't)
4. Import manifests and changelists.
Manifests are a bit tricky because we must obtain the original filelog revision
*BEFORE* we imported them, but manifest imports come "after". We could read the
most recent entry from manifests, but that won't cover the case in which files
are added. So instead we know the changelist that we are currently importing,
and looking for the rev with the correct linkrev in filelogs. That's a big ugly,
but it works. We could instead return the original offset from the worker and
pass it into the manifest importer, but I feel that is not much better and
evenutally more errorp rone.
Test Plan: cd tests && rt test-p4*
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #idi
Differential Revision: https://phabricator.intern.facebook.com/D4890110
Signature: t1:4890110:1492662991:0e141e62734e1224ac8e1c11f4e8794452455b18
Summary:
More detailed debug output for manifests. For changelog we don't
use it at the moment as changelog imports uses the perforce date, causing
changelog hashes not being stable. Will fix this in the future.
Test Plan: cd tests && rt test-p4*
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #idi
Differential Revision: https://phabricator.intern.facebook.com/D4890093
Signature: t1:4890093:1492474213:2b410da985fdd5d0786ef9dde05ecbb96f157e14
Summary:
Use repo lookup to get p1 and p2 and use their manifestnodes instead.
We will use this for incremental imports in order to correctly optain the
manifestnode.
Test Plan: cd tests && rt test-p4*
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #idi
Differential Revision: https://phabricator.intern.facebook.com/D4890084
Signature: t1:4890084:1492474086:91658b5c57b4e58af88ee14673ffa3516bc2d88a
Summary:
Previously a streaming clone would pick up the 00manifesttree.i file. This patch
adds a config to prevent that file (and other meta/ manifests) from being
transfered. The config defaults to False since Google is currently depending on
the previous behavior.
Test Plan: Add a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4915481
Signature: t1:4915481:1492641427:6c8a91da4c8c6e00e23f96a93807d3c426b50532
Summary: Now that prefetching supports base nodes, let's add a simple test covering it.
Test Plan: Ran the test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4911537
Signature: t1:4911537:1492641400:752c52acfb264ec42c5d05865bf87ebfc2558801
Summary:
The old test output had some flakiness where:
1. The linknode for y:1406e7411862 would flicker between commit 0 and commit 6,
even though y never existed in commit 0. This is caused by some ambiguity in how
the store represents the ancestor list (it's keyed on node instead of (name,
node)). To fix the test let's just modify file y so it doesn't have the same
hash as file x at any point.
2. The order of nodes in the histpack would flicker because there was no link
between the two separate histories of file y. This is caused by a lack of
sorting of the separate roots before writing to the histpack.
Test Plan: Ran the test many times
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4915472
Signature: t1:4915472:1492641328:d4542665e3a69fe2fc188b450f75ff10e6d681de
Summary:
The gettreepack protocol already had the arguments for the client to specify
what nodes they want and what nodes they have, but it wasn't implemented (we
just always returned the entire tree). This patch adds support for only sending
parts of the tree that are new. In addition, if the client requests many nodes,
we will only send the portion of each node that is not contained in the other
nodes. For instance if you ask for X and Y, where X is the parent of Y, then we
will send all of X and only the part of Y that is new.
The order changed a bit, probably because we stopped over delivering data.
Test Plan:
Ran and updated the tests. The next patch will actually add a test
for this code.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4911531
Signature: t1:4911531:1492643897:58aabe5a32f156dd7424cc07c990301dbd5dc1c7
Summary:
A future patch will make tree prefetching more efficient. Let's change the
prefetch test to have changes in two separate directories so we can observe that
one directory is not downloaded when doing an efficient prefetch.
Test Plan: Ran the test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4911523
Signature: t1:4911523:1492641009:ac108ebac9573444c87c403f0be0b246d734dda7
Summary:
Accessing treemanifests in revlogs is incredibly slow. This patch adds the
ability for `hg repack` to repack the revlog content into a data pack file, and
teaches the getserverpack code to look in the pack file first.
Test Plan: Need to add a test. Sent out anyway for review
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4901298
Signature: t1:4901298:1492640706:2850b9f0e9bbee77952f46af3b784aa81253e626
Summary:
Future tests showed that backfilltree was not populating the fncache, which
meant the files were not streamed during a clone or read during a repack. This
fixes this by using the actual repo store (which handles fncache serialization)
instead of a creating a new store.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4916070
Signature: t1:4916070:1492647129:4deeb70c63dd414f6d5c06e4259a0bbf899f3425
Summary:
The name being passed to the store was wrong, because it had a trailing slash.
This wasn't caught before because the code was reading and writing the paths
with a slash at the end, so it matched as long as we only interacted with packs
produced by the code. The issue became more obvious when I tried to have packs
generated from revlogs interact with this code.
All the tests are affected since the entry keys changed.
Also use 'const ManifestFetcher &x' to pass the ref to avoid the copy.
Test Plan: Tests updated
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4901274
Signature: t1:4901274:1492638476:ff28f8976657baec99effbd82ecd436f6282ea5b
Summary:
The server treemanifest reading code was super slow because it used the pure
python treemanifest implementation. Let's switch it to use the ctreemanifest
implementation on top of a revlog store class.
The tests change because the output is now in reverse topological order (deepest
trees first).
Test Plan: Tests updated
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4901268
Signature: t1:4901268:1492637601:371a2303ac4f6e2b81f69a85ca657849150abcf7
Summary:
Previously, walksubtree would segfault if you ran it on a tree that had
non-finalized entries, since they contain node pointers that point to NULL.
Let's fix this by having serialization refer to the nullid if the pointer is
null.
Test Plan: Updated the tests to cover this
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4901257
Signature: t1:4901257:1492637151:803b3183ad766e34f0ad24f14a8ec1b784600879
Summary:
Adds a walksubtrees api that returns a set of subtrees from the given
treemanifest. This will be used in a later patch to return just the subtrees
that are new in one treemanifest. For now it's only used by the unit tests
Test Plan: Added unit test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4901241
Signature: t1:4901241:1492645063:5b3617cd36f3205bef8e09c4d37dd132e0bece4e
Summary:
Adds a test for when a tree is modified, then modified back to the original
content. When serializing, it should not result in new trees for that directory,
but should result in a new root tree since p1 has changed.
Test Plan: Ran the test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4880087
Signature: t1:4880087:1492629218:93de40aede28b6b0f5b02e7015d96c61e531cc6a
Summary:
The current tests test some undefined behavior of manifest.finalize() where it
can rewrite immutable Manifest instance's with a new node. This happens if you
call finalize without passing the appropriate parent that the manifest was
copied from. So the new tree contains unmodified subtrees from the original
manifest, and since we don't pass the original manifest to finalize, it doesn't
realize these trees already existed and tries to give them a new node.
A future patch makes tree mutability more strict and caught this. Fixing the
tests now, so I can show that future patches don't break this.
Test Plan: Ran the test
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4880057
Signature: t1:4880057:1492589057:a7026bc791ea2cd12aa790513cf46d5180cb0638
Summary:
This adds a remote tree datastore to the store, so if we don't have a tree on
local disk, we can reach out to the server for it.
This also makes a small change to fastmanifest to use get() instead of
getmissing() to test if the tree is available. getmissing() would indicate the
tree is missing if it wasn't local, while get() will attempt to fetch it from
the server.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4864645
Signature: t1:4864645:1492627823:7afff5db54c895507507e57ab7263f4dbf10b5f7
Summary:
The treemanifest tests were setting the configs on both the client and the
server, without telling the server it was a server and without setting it up
appropriately to be a client. This caused the tests to fail in a future patch.
Let's move the treemanifest config to the clients, since that's the only bits
being tested here.
Test Plan: Ran the tests
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4864766
Signature: t1:4864766:1491903651:ab91eed5a2eb8a60db8e230c2ba5c0ee29b5adc9
Summary:
This adds a new prefetchtrees command and gettrees wireprotocol command for
receiving trees from the server. The actual wire protocol is a custom request
format, with a normal pack file response format (same as used in remotefilelog).
The request args can specify which manifest nodes are wanted, for which
directory and which subdirectories.
I attempted to use the changegroup3 response format instead of the pack format,
but changegroup is extremely intertwined with revlogs and with producing
changegroups for linear swaths of the repo history, instead of random parts of
just the manifest.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: stash, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4864435
Signature: t1:4864435:1492626392:c3603eeb261a1f9b9d836f0d44614025b58d45ea
Summary: The --merge flag is relatively new; we shouldn't add --check if it is specified.
Test Plan: Unit test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4916396
Tasks: 17490374
Signature: t1:4916396:1492647440:d9955931cb9177719a58325c08a715d4d51d1226
Summary: Sometimes restack attempts to clear preamend bookmarks on hidden commits. This only happens when the user has a configuration error (typically inhibit is disabled) which would mess up other parts of restack. Nonetheless, there is no reason to crash here.
Test Plan: Disable inhibit, perform an amend, and run `hg restack`. Unit test is forthcoming.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4856640
Tasks: 16726367
Signature: t1:4856640:1491816803:56beeb11360a7a2f6bc6243069c562b08a015afc
Summary: Require perforce during all tests.
Test Plan:
run tests with and without Perforce in PATH. Tests correctly run with
P4D and P4 in path and were correctly skipped without.
Reviewers: #sourcecontrol, #idi, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4899085
Signature: t1:4899085:1492475858:3bd1443c707e56461835d278a9c6bf3e034b5f4a
Summary: Noticed this minor gramatical error when using absorb.
Test Plan: Unit tests.
Reviewers: quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4887040
Signature: t1:4887040:1492123047:dcae53cabd64f1df13d80a20953c712ce0aaaa09
Summary:
`p4fastimport` is a fast convert extensions for Perforce to Mercurial. It
is designed to generate filelogs in parallel from Perforce. It tries to
minimize the use of Perforce commands and reads from the the Perforce
store on a Perforce server directly.
The core of p4fastimport is the idea to generate a Mercurial filelog
directly from the underlying Perforce data, as a Perforce file in most
cases matches a filelog directly (per-file branches is an exception). To
generate a filelog we are reading each file for an imported revision. A
file in Perforce is locally either stored in RCS, as a compressed GZIP
or as an flat file (binaries). If we do not find a version locally on
disk we fallback to downloading it from Perforce.
We are generating manifests after all filelogs are imported. A manifest
is constructed by adding and removing files from an initial state. We
are generating the correct offset from a manifest into the filelog by
keeping track of how often a file was touched.
We then generate the changelog.
Linkrev generation is a bit tricky. For every file in Perforce know
to which changelist it belongs, as it's stored revisions contains the
changelist. E.g. 1.1422 is the file changed in the changelist 1422 (this
refers to the "original" changelist, before a potential renumbering,
which is why we use the -O switch). We use the CL number obtained
from the revision to reverse lookup the offset in the sorted list of
changelists, which corresponds to it's place in the changelog later,
and therefore it's correct linkrev.
Parallel imports: In order to run parallel imports we MUST keep one lock
at a time, even if we import multiple file logs at the same time. However
filelogs use a singular `fncache`, which will be corrupted if we generate
filelogs in parallel. To avoid this, repositories must be generated with
*fncache* disabled! This restricts `p4fastimport` with workers to run
only on case sensitive file systems.
Test Plan:
The included tests as well as multiple imports from a small testing
Perforce client. Afterwards successfully run `hg verify`
make tests
Reviewers: #idi, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4776651
Signature: t1:4776651:1492015012:0161c4f45eab4d3b64597d012188c5f2007e8f7d
Summary:
Previously we had separate backup per working copy. That's very confusing
since all these working copies shares the same repo. This diff fixes it and
also adds config option to clean unnecessary working copy server-side.
Test Plan: Run infinitepush unittest
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: rmcelroy, quark, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4876230
Signature: t1:4876230:1492025747:3579e5046efc2ed309044fc3335c36ac4f7bdd04
Summary:
Update the fixcorrupt extension to look back as far as necessary in the revlog
to find a good entry. Previously the user had to supply a good value using the
--checklen argument. If --checklen was too small, fixcorrupt could end up
trying to truncate in the middle of a corrupted section of the revlog, which
would cause problems as it was still using corrupted data.
This change ensures that fixcorrupt always looks back far enough to find a good
entry. We start by looking at the last 10 entries, and double that amount each
time the first item in the list is still bad.
Test Plan:
Used it to fix a corrupted fbsource repository where the corruption was 36
commits back.
Reviewers: #mercurial, quark, stash
Reviewed By: stash
Subscribers: stash, net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4874243
Signature: t1:4874243:1492007518:7406b03a9967815a496a8c2fae394c5f21f7e60a
Summary: Only one exact form on "hg" invocation with --stdio is now allowed
Test Plan: tests are passing now
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4877162
Summary: Check owner of a log file before writing to it. See comments for details
Test Plan: arc unit
Reviewers: #mercurial, simpkins
Reviewed By: simpkins
Subscribers: net-systems-diffs@fb.com, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4842933
Tasks: 17155924
Signature: t1:4842933:1491861137:e8a027fb7a930c0c5f553c75cb84214d24f66ce3
Summary:
`wc` in OSX has different padding behavior that breaks the test:
```
$ wc -c .hg/store/00changelog* .hg/store/00manifest* | sort
- 99 .hg/store/00manifest.d
- 110 .hg/store/00changelog.d
- 128 .hg/store/00changelog.i
- 128 .hg/store/00manifest.i
- 465 total
+ 99 .hg/store/00manifest.d
+ 110 .hg/store/00changelog.d
+ 128 .hg/store/00changelog.i
+ 128 .hg/store/00manifest.i
+ 465 total
```
This patch fixes it.
Test Plan: The fix was verified manually on an OS X machine.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4872689
Signature: t1:4872689:1491954172:92178178deea88ec3545c42ad0cdecc8099a1db6
Summary:
Previously when the client has obsstore enabled, and the server has obsstore
disabled, clients won't get the obsmarkers, which is suboptimal. This diff
makes the server send obsmarkers in that case.
Practically, this means people will no longer need to run `strip` after landing
a diff in this repo.
Note: `test-pushrebase-manifests.t` is somehow flaky about the empty lines. I
guess they are not related to the change. But the test change is not 100%
reproducible.
Test Plan: Added a new test case
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: rmcelroy, ikostia, stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4865150
Signature: t1:4865150:1491895844:afbc3079a40a9a9fa9af1eab4eeaca91091e8d2d
Summary:
We sometimes get reports about corrupted repos. Usually the corrupted part
is just at the end of changelog or manifest.
Truncating them manually works but people need to be very careful. This
extension is like the manual fix but automatized.
Test Plan:
Run `hg debugfixcorrupt --no-dryrun` on a reported corrupted repo and check
it truncates files correctly and the repo passes `hg verify` afterwards.
Reviewers: #mercurial, durham, stash
Reviewed By: stash
Subscribers: stash, rmcelroy, durham, lcharignon, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3408396
Signature: t1:3408396:1491897232:fc17a105124b568963441adfec97e26735df3258
Summary:
Add some basic unit tests for extutil.runbgcommand().
This also changes the behavior to throw an OSError if we fail to execute the
process, instead of a subprocess.CalledProcessError. This matches the behavior
of the subprocess module when it fails to execute the command.
Test Plan: Ran the tests.
Reviewers: stash, quark
Reviewed By: quark
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4864999
Signature: t1:4864999:1491874918:c03edafe02af217e41c28a770137bfd72bcbba9b
Summary:
Based on the recent commit wez made, but centralized to the scm-prompt
source-of-truth.
Test Plan: updated test
Reviewers: #sourcecontrol, wez, simpkins, simonfar
Reviewed By: simonfar
Subscribers: net-systems-diffs@fb.com, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4867662
Tasks: 17110799
Signature: t1:4867662:1491916786:647edb819a059a3a6baa09c8d189ea706933687b
Summary:
The "chunking" feature is not specified by [the current Git LFS standard](21e1695220/docs/spec.md).
Therefore avoid using it if possible - if there is only one chunk, use the
standard specification (`https://git-lfs.github.com/spec/v1`).
An upload message is slightly changed to be more accurate.
Test Plan: Changed existing tests
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4856527
Signature: t1:4856527:1491638822:1c6f555b706e7bb22dd9090afa156f2161bf9f7f
Summary:
This diff adds bundle support for lfs:
- Let `hg bundle` use changegroup3 instead of changegroup2 to record revlog
flags.
- Hook related functions so `hg -R bundle.hg` works with LFS.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4856335
Signature: t1:4856335:1491638660:d56ba54ea5f59262f009418b9c7e48c8f2a25ed6
Summary:
Per discussion with @davidsp, it's better for LFS to not store Mercurial
filelog metadata, which is currently used to store rename information. That has
many advantages:
- Large blobs could be reused across renames
- No need to special handle files starting with `\1\n`
- P4 LFS server implementation is much easier
- remotefilelog LFS support is easier and cleaner
That said, the rename information is stored as lfs metadata using the
non-standard `x-hg-copy`, `x-hg-copyrev` keys. So they still exist and are
functional.
The disadvantage is that rename gets no longer hashed, which is probably fine.
Test Plan: Added a test
Reviewers: davidsp, #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: jsgf, rmcelroy, stash, mjpieters, davidsp
Differential Revision: https://phabricator.intern.facebook.com/D4849764
Signature: t1:4849764:1491580506:1d80ad476b9cbd6773843cb52aee6745f478a0b0
Summary:
a user may want to use a special-purpose 'editor' to do chunk selection, but not
have to use that same 'editor' to write commit messages and resolve merge conflicts
This is hacked together to make it work. I'm not super familiar with the correct way to do this in python.
Test Plan: added test case
Reviewers: rmcelroy, simonfar, most, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4832207
Tasks: 15728734
Signature: t1:4832207:1491519433:82a3e62d5ae03f456abe97caf1bd352a02fe35c3
Summary:
Upstream recently introduced show as an extension. Because the file
name is the same and it lives in core, extensions.show now points to it.
It behaves differently. Rename our extension. In the next diff I'll update
facebook.rc to make extensions.show point to our version.
Test Plan: Ran tests
Reviewers: durham, #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4845959
Summary:
The diff cleans up messages shown to the user. It makes verbose messages
gated by `if ui.verbose`, and simplifies some words.
The resulting user experience is, when there is no large file involved, lfs
shows nothing. When there are largefiles being downloaded or uploaded, show
progress bar if it takes long. The progress bar is the only user visible
output from lfs by default.
Test Plan: `rt test-lfs.t`
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4813297
Signature: t1:4813297:1491213089:c9ec363eb65df4c85282c90b230da3321b93b5e0
Summary:
Previously, the remote blobstore could be either `git-lfs` or `dummy`. The
application code does not really care, it only wants a "remote" blobstore.
This diff adds a factory method and makes `git-lfs` and `dummy` stores private.
The `@staticmethod get(vfs)` interface is also removed as it's duplicated and
unnecessary - as long as mercurial calls `reposetup`, the blob store objects
are set, and they cannot be missing.
The error message about an unsupported store is also changed to be consistent
with mercurial style. A test was added to test the error.
Test Plan: `rt test-lfs.t`
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4813023
Signature: t1:4813023:1491382755:b9d8ec6518141d0ba8263e16c53f430ce80c39f0
Summary:
It's a good way to check if backup is consistent. If backup is not consistent
then we set special exit code that will be logged. It let's us easily find users
with inconsistent backups and fix it.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4810442
Tasks: 15389402
Summary:
Previously we backed up extinct node if bookmark pointed to them. But this not
is not present in the bundle because `findcommonoutgoing()` intentionally skips
extinct and secret commits. In this case we'll have infinitepush bookmark that
points to non-existent infinitepush commit. To fix it let's filter extinct heads
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4803322
Tasks: 15389402
Summary:
The bypass option limits lfs's functionality to only skip hash checks. It is
intended to be used server-side, to make it more predictable - the server
never interacts with the lfs blob service.
Test Plan: Added a test case
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4811828
Signature: t1:4811828:1491301114:c2e3c4200ce4cc84b9c5872a8b9a040176bb002a
Summary:
fbhistedit changes was reverted upstream, revert it here too.
remove username from the test
Test Plan: arc unit
Reviewers: #sourcecontrol, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4830371
Signature: t1:4830371:1491343205:9d7aebd603136fb90ccd3199df60c3e0a5772428
Summary:
Previously errorredirect swallows errors in some cases. This diff makes it
more robust.
- Always log commandexception. `blackbox.log` will probably catch it.
- Print the trace if the handler script cannot be executed.
- Print the trace if the handler script exits with non-zero.
- Add exception for the Ctrl+C case, to not pollute user's terminal.
Test Plan: Added some test cases
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4824767
Signature: t1:4824767:1491299807:3fd863cb99ce71a6c2b59643b0c89eece7985d4b
Summary:
7687edc2cef224a3a5ad4961e11073aa2ea73af8 added HG_HOOKNAME and HG_HOOKTYPE info
Let's update the test
Test Plan: arc unit
Reviewers: #sourcecontrol, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4826767
Signature: t1:4826767:1491319207:a1c9e9af20cc237ff02bedcb9072f2c0816a1fbe
Test Plan:
arc unit
Note: making sure that int is passed in repo.lookup(...) is not easy.
For example `hg log -r 1` does not pass an int value to repo.lookup().
But `hg bundle` actually does it so use `hg bundle` to verify that fix works.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4825996
Signature: t1:4825996:1491292671:9bd0897205dff93cb6dee75498827b3826f894da
Summary:
The ideal interactive mode couldn't be implemented trivially. Move `absorb`
to a directory so we can add related, but decoupled components as separate
files.
Test Plan: `make local`
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4813909
Signature: t1:4813909:1491211561:e9c40b1242c9b74230c0b8937723a2d4548e22c3
Summary:
@simpkins fixed up some of the tech debt accumulated in our
Phabricator interfaces, which results in a minor change to output. Most tests
are fixed, but this one got missed.
Fix the test to match his fixes.
Test Plan: Run the fixed test locally
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters, simpkins
Differential Revision: https://phabricator.intern.facebook.com/D4809914
Signature: t1:4809914:1490955858:bd2c942b9744a5529e8f4fd87bfb50666b53ae6a
Blame Revision: HGEXT8a071fbd26ed6fabf443953183c507606b027bbc
Summary:
This diff makes the `test-lfs.t` much more stronger. It reveals a lot of core
hg issues in this area. I'll send patches to fix them all.
Regarding on lfs, there are some changes:
- An existence check in its push hook was added. Otherwise pushing a revision
with rename will cause crash.
- The "read" processor is responsible for downloading blobs, and translate
raw revision to lfs text. It should always return lfs text. But it may
return raw revision text on error currently. That error handler was
removed to avoid further damage.
Test Plan: Added new test cases. I also added `hg verify` to sanity check things are good.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4792641
Signature: t1:4792641:1490868946:8f09c84dc9ebda3889d6a1ea04c49a06acbf38a3
Summary:
If the user does not have necesary credentials defined in their arc
configuration, catch the KeyError and convert it into an ArcConfigError.
The existing call sites in the phabstatus and arcdiff extensions catch and
handle ArcConfigError, but not generic KeyErrors.
This also fixes the phabstatus warning messages to end with a newline.
Test Plan: Added a unit test.
Reviewers: #sourcecontrol, quark, simonfar, wez, rmcelroy
Reviewed By: wez, rmcelroy
Subscribers: rmcelroy, net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4800977
Tasks: 17002914
Signature: t1:4800977:1490847078:e18bba042e3ff57100e0a7b25c610b5cad17fa2e
Summary:
The traceback changed due to an upstream change, but it's still doing
what we expect.
Change the test to be less sensitive to code changes.
Test Plan: `../../hg-crew/tests/run-tests.py` locally.
Reviewers: #mercurial, quark, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4802376
Signature: t1:4802376:1490872606:8c9b357de7bd65a33abf1d5a3b0568751210aad4
Summary: Let's add a table that will store metadata about infinitepush nodes.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4778867
Tasks: 16899722
Summary:
I forgot to insert it, fixing it now. It didn't cause problems before because
we delete bookmarks only during backups and backups usually have different
bookmark names
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4795310
Tasks: 15389402
Signature: t1:4795310:1490810441:0a044ebe776c65b03c633017c33771d32bfa3e77
Summary:
Neither gitnode() template nor gitnode() revset worked on the server. They
both called `hg.peer(repo, {}, 'default)` and since 'default' is not a valid
url these calls failed. To fix it let's wrap `localrepo.lookup()` and call
local repo instead of peer repo if we can't find default path.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4794488
Tasks: 16848812
Signature: t1:4794488:1490795600:24269507f24613883406f0c1838fce302f86df58
Summary:
Previously we don't set findcommonincoming to True, and that bug was unnoticed
because we send this info anyway in server-side `getbundlechunks()` function.
But next diff in the stack uses a fast path server-side which won't work if
fincommonincoming is not set to True.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4770830
Tasks: 15389402
Signature: t1:4770830:1490719209:c251002d992e244580b7dbfeca0c30dff95734d2
Summary:
Command to list available backups for the user.
--json will be used by automation
Test Plan: arc unit
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4728729
Tasks: 15389402
Signature: t1:4728729:1490005762:41b9683cb7dfc9d84ae1032c807d1f0c3fe60dbf
Summary:
Only match the "Differential Revision" label at the start of a line. We
have some diffs that include legitimate-looking Differential Revision label
strings inside parts of their test plan, which previously confused the phabdiff
output.
Test Plan: Included a unit test.
Reviewers: #sourcecontrol, quark, akushner
Reviewed By: akushner
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4793483
Signature: t1:4793483:1490756514:05b2c49d5d65e1a3eadd5eb78ed0b91ef3bea42c
Summary:
From diff:
```
This test does two things:
1/ Simulate a common condition of pushrebase under load. Normally pushrebase
caches data before acquiring the write lock (if lazy locking is enabled).
Under load, however, when a push has to wait for the lock more often than not,
much of this data becomes out of date and must be refetched once the lock is
acquired. This test simulates that particular case.
Specifically, we create two clients, client1 and client2, both with
nonconflicting changesets to push. client1's push is artificially blocked by a
`prepushrebase` hook (post-caching, pre-lock) that is only released after
client2's push succeeds.
2/ Checks how often we call manifest.read() inside the lock (and outside).
This way we can prevent regressions on manifest reads and test improvements.
manifest.read() is wrapped by an extension that prints a short trace. read calls
inside the lock are marked with a ":(".
```
This test is a bit of a doozy, simplification suggestions are encouraged.
Test Plan: this is, in fact, a test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: quark, rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4785464
Signature: t1:4785464:1490737637:79d77f6b2e49a428d63b8e1b13d769c82149ee72
Summary:
Previously `lfs.blobstore` must be a relative path. If an absolute
blobstore path is set, it will traceback because vfs audit fails:
```
File "hg/mercurial/revlog.py", line 1356, in _processflags
text, vhash = writetransform(self, text)
File "fb-hgext/hgext3rd/lfs/wrapper.py", line 69, in writetostore
blobstore.local.get(self.opener).write(storeid, chunk)
File "fb-hgext/hgext3rd/lfs/blobstore.py", line 41, in write
fp = self._opener(self.filename(storeid), 'w+', atomictemp=True)
File "hg/mercurial/vfs.py", line 344, in __call__
self.audit(path)
File "hg/mercurial/pathutil.py", line 64, in __call__
raise error.Abort(_("path contains illegal component: %s") % path)
Abort: path contains illegal component: /home/quark/lfslocalblobstore/d7/dbc611df1fe7dfacfe267a2bfd32ba8fc27ad16aa72af7e6c553a120b92f18
```
That was because the code was using `repo.vfs`. This diff adds a new `lfsvfs`
to avoid the issue. The `lfsvfs` also did the correct filename check (the
old `re.match` check will not match the whole string), so `blobstore.local`
could be simplified a lot.
Test Plan:
A new test case was added to make sure absolute blobstore path works. I also
did some cleanups for the test file to de-dup hgrc, and avoid writing files
outside `$TESTTMP`.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, remi
Differential Revision: https://phabricator.intern.facebook.com/D4785084
Signature: t1:4785084:1490693306:b42eef8e53af107897c2e1bc2984c090bdd2e465
Summary:
It's the upstream mutable-history that handles the "--fold" case now.
It doesn't have the fix that avoids touching wd in that case.
Test Plan:
tests are passing when mutable-history is updated to default-upstream-tip
I'll delete the actual mutable-history hotfixes once this is accepted.
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4779366
Summary:
A bunch of modifications to get the test pass with the new lfs code.
- Move `lfs` to `hgext3rd`. The code was supposed for hg-core. For now, we do
them in fb-hgext to speed up the process
- Remove the windows test, which is not supported by `run-tests.py` and is
duplicated with `test-lfs.t`.
- Do import `mercurial.i18n._` correctly.
- Change some i18n logic a bit so it's more translator-friendly.
- Change `revlog.RevlogError` to `error.RevlogError`.
- Avoid direct symbol import of `mercurial.util.bytecount`, which will fail the
upstream importchecker test.
- Fix various lint issues like lines being too long etc.
- Document lfs config options.
Test Plan: `arc unit`
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4772216
Signature: t1:4772216:1490401458:1ad3c18ab80e1d31085d0b6b4c630e62a7dc7930
Summary: test-check-code.t now dislikes our docstrings. Fix them up
Test Plan: Run the test locally on my devserver
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4773908
Signature: t1:4773908:1490394131:9d9e5f85b4243119a3615044605bcc5abdecbe4f
Summary: Just as in D4762189. Fixes to match upstream changes
Test Plan: arc unit
Reviewers: #sourcecontrol, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4762596
Signature: t1:4762596:1490286227:004ed0a7055aab64769893e80a995975b62d5ea0
Summary:
changeset: 06d6fecfdb713e3a2e2013de046af0bce4005b96 (@)
user: Jun Wu <quark@fb.com>
date: Mon, 13 Mar 2017 22:19:06 -0700
histedit: use safecleanupnode in _finishhistedit
This simplifies code a lot.
causes significant changes to the test output. Update to match
Test Plan: Run tests locally
Reviewers: #sourcecontrol, quark, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4762189
Signature: t1:4762189:1490281032:6a48429f60584c4318bd1e247ce2eeb2775d623c
Upstream added __bool__ to manifestdict, and the test checking that
hybridmanifest matches the functions of manifestdict started failing. Let's add
it.
The check-code.py change matches the one in upstream to support the addition of
__bool__.
Summary:
It will allow sparse to not ignore the file, and is more consistent with
other special files.
Test Plan: Updated existing tests
Reviewers: rmcelroy, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4738766
Signature: t1:4738766:1490032493:199f3fef9c74a137b16ae7637b87de625ca5115d
Summary:
This diff just restores the code that was reverted before. Next diffs will fix
it
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4714397
Tasks: 16558840
Signature: t1:4714397:1489717436:9777d783d1443dea46460450e8f3da862c147483
Summary:
This code that reused deltas if the delta parent wasn't available was bugged
because it meant you could end up with a cycle in the delta chains. This was an
old optimization from before trees had history, so let's drop the optimization
(since trees now have history and can be correctly repacked).
Test Plan:
Ran repack on a packfile that previously caused cycles. Verified the
new version did not with `hg debugdatapack foo.datapack'
Reviewers: #mercurial
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4724520
Summary:
It'd be nice to have dirsync config in the repo, since it's better synced, and
easier to be modified.
Test Plan: Added a test case
Reviewers: #sourcecontrol, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4732054
Signature: t1:4732054:1489793650:ca6c63ef47a1d9ebd181fbaee5554975801324eb
Summary:
Upstream converted all array.array usages to bytearray, and in doing so they
also changed mdiff.textdiff(array1, array2) to be
mdiff.textdiff(util.buffer(array1), util.buffer(array2)), which we did not do in
our internal implementation.
This fixes that.
Test Plan: Adds a test
Reviewers: #mercurial, quark, simonfar
Reviewed By: quark, simonfar
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4724350
Signature: t1:4724350:1489697253:8f63350bfc30b3079bf38410054b4763942a82f6
Summary:
On macos sshpeer flushes remote output later and it causes tests to fail. Let's
add a call to cleanup() to make sure the output is flushed.
This diff also makes remotefilelog test more robust.
Test Plan: Run tests on macos
Reviewers: #mercurial, tja, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4721276
Tasks: 15389402
Signature: t1:4721276:1489669109:4ce59f4a1d224d57dbb7c1eb341c4e6a659d2e8c
Summary:
By default debugcheckbackup checks only one backup for the user.
With --all option it checks all backups for the user from all host/reporoots
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4700993
Tasks: 15389402
Signature: t1:4700993:1489548921:800d08f420acc8ef4f807ffd17b31837dbb3fe82
Summary:
Backing up very big repo can cause problems. And very often old commits are
not necessary at all. Let's add a config option to limit the number of heads
that are being backed up.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4700965
Tasks: 15389402
Signature: t1:4700965:1489549163:4e2c121f01debd7b495486a1f3b062926873399d
Summary:
Previously we saved bookmark hash and revision number as state of
the last backup. Storing last backed up revision is error-prone. I saw
a few corrupted backups where bookmarks pointed to non-backed up
nodes. Also this approach puts more pressure on mysql bundle index.
On every backup it first deletes all existing backup bookmarks and then it
writes new bookmarks. Even if user changed one head or one bookmark
(and that is the usual case) current approach still deletes bookmarks first
and then rewrites them.
Instead let's store all backed up heads and bookmarks locally in json format.
Json was chosen because it's simple and human-readable. Then during backup
let's compare last backed up state to the current state of the repo, and send
to the server only the difference.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4700930
Tasks: 15389402
Signature: t1:4700930:1489613249:a34369bf53e0718c22258304493dfa27b578857f
Summary:
We have encountered a kernel issue where `rmdir` a non-empty directory may race
with other things and hang in kernel for a long time.
This patch changes `os.rmdir` to avoid `rmdir` non-empty directories. It is
written in Cython calling the low-level `readdir` libc friends to make overhead
minimal.
Test Plan: Added a new test
Reviewers: #sourcecontrol, clm, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, simpkins, osandov, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4716711
Tasks: 16647532
Signature: t1:4716711:1489627923:7c7432748c1fd8c070ce257bd172feebd3807f65
test-check-code doesn't like sed -i, so let's switch to a tiny batch script.
Also fix the test importing the extension directly instead of relying on the
path to be right.
Summary:
It's just copy-paste from my mutable-history patch series that ended up as
persistent hotfix.
The wrapping logic is very simple: it redirects '--fold' calls to original
metaedit and handles all the rest.
Test Plan:
Included a big copy-pase from test-evolve.t preserving only cases that were
executing metaedit and modified for the smaller test repo (the metaedit tests
were at the end of evolve test file).
Reviewers: #sourcecontrol, quark, simonfar
Reviewed By: quark, simonfar
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4708017
Signature: t1:4708017:1489524494:d682aab857e8422bb1a23adc22dddfb9f505b6b3
Summary: New logging will have rotation and will separate different users and repos
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4689191
Tasks: 16474976
Signature: t1:4689191:1489172091:d304d4b19ae6cf52f86c11f442fa760b50d1fdf9
Summary:
For now these command will be used in test because
`wait_for_background_backup.py` tied to the backup state file. And every change
to this file requires change to wait_for_background_backup.py. Let's create
simple internal backup command.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4667056
Tasks: 15389402
Signature: t1:4667056:1489024344:6c43241e42b7c418baa4e1542f303239ba887c45
Summary:
Upstream has added a matcher arg to manifest.filesnotin, so let's support it in
our native treemanifest implementation.
Test Plan: Added unit tests for filesnotin with and without matchers.
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4677030
Signature: t1:4677030:1489076599:23ab67d85bb4fa689f05349253a4d2c4e7d496cc
Summary:
Upstream has added a matcher argument to the diff API which allows diff to avoid
traversing certain parts of the tree. This adds support for that to our native
treemanifest implementation.
Test Plan: Added tests for diff with matches
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4677023
Signature: t1:4677023:1489076627:dbcea209d300a68fa050f68c52b4fd9949b85302
Summary:
Upstream has added a new match argument to manifest.diff() and removed the
existing manifest.matches() function, so we need to update our internal usage.
A separate diff will update treemanifest to support the new diff() api.
Test Plan:
Ran the tests, some still fail because of the upstream changes, but
future patches fix those.
Reviewers: #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D4677002
Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`.
Test Plan:
Here is an example of basic usage. Also see test file.
```
$ hg debugbuilddag "+5 *2 +2"
$ hg book -r 4 feature1
$ hg book -r 7 feature2
$ hg up 0
$ hg sl
o 92eaf3 debugbuilddag feature2
| r7
|
o 8bbe84 debugbuilddag
| r6
|
o 914970 debugbuilddag
| r5
|
| o bebd16 debugbuilddag feature1
| | r4
| |
| o 2dc09a debugbuilddag
| | r3
| |
| o 012414 debugbuilddag
|/ r2
|
o 66f7d4 debugbuilddag
| r1
|
@ 1ea734 debugbuilddag
r0
$ hg next 3 --towards feature1
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[2dc09a] r3
$ hg sl
o 92eaf3 debugbuilddag feature2
| r7
|
o 8bbe84 debugbuilddag
| r6
|
o 914970 debugbuilddag
| r5
|
| o bebd16 debugbuilddag feature1
| | r4
| |
| @ 2dc09a debugbuilddag
| | r3
| |
| o 012414 debugbuilddag
|/ r2
|
o 66f7d4 debugbuilddag
| r1
|
o 1ea734 debugbuilddag
r0
```
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4695861
Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
Summary:
We are relying on pushrebase to replay each of the incoming commits so they
produce both flat and treemanifests. This patch blocks any commits that don't
come through pushrebase, by intercepting manifest.addgroup calls (which is what
a normal push would use) and throwing an exception.
Test Plan: Added a test
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4093745
Signature: t1:4093745:1478100170:79b1eea6668cd3efb27742323e11a45bde930440
Summary:
When a server is a treemanifest enabled server, we want to ensure that every
commit that comes in will be added to the treemanifest as well as the flat
manifest. This patch accomplishes that by hooking into the addmanifest logic and
applying the new manifest to the tree as well.
Test Plan: Added a test
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4093738
Signature: t1:4093738:1478260442:58f77bd88ab09ccda4ac238a065388be8f4a271d
Summary:
This adds a command for producing tree manifests for existing manifests in the
repository. The tree manifests are stored similar to how vanilla mercurial
stores them, but the root revs are in 00manifestree.i instead of 00manifest.i
and we fake the root node to be the same as the flat manifest node, so we can
reference either the flat or the tree easily.
Test Plan: Added a test. Also began converting fbsource
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4092252
Signature: t1:4092252:1478260394:a55360a8ba83ad85b1694cb93f0788f1f672ef61
Summary:
The computehidden caching functionality doesn't seem to be correct, and breaks
my repository. "hg log -r head()" now incorrectly reports some obsolete
commits, which causes various mercurial commands to crash. (They incorrectly
think that these commits aren't obsolete, but their parents are obsolete, which
breaks things.)
This diff reverts the new functionality until it gets fixed.
Test Plan: Confirmed that "hg-dev pull" no longer crashes in my repository.
Reviewers: #mercurial, stash, durham, quark
Reviewed By: quark
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4676573
Tasks: 16558840
Signature: t1:4676573:1489008220:f730da69ec0f8d7220cad16ea6956944cfeb670d
Summary: Previously, we were relying on the `allowunstable` extension to wrap various instability-inducing commands and set the appropriate config option to cause the `tweakdefaults` extension to write the correct operation metadata into the obsmarkers produced by each respective command, causing commits to show up as "amended as", "rebased as", etc, in `hg sl`. Since the operation name was based on the command being run, if a user ran `hg amend --fixup` instead of `hg restack`, for example, smartlog would say "amended as" instead of "rebased as". This diff fixes the problem by always setting the operation to "rebase" during a restack.
Test Plan:
1. Create a stack of two commits.
2. Amend the bottom one without `--rebase`.
3. Run `hg amend --fixup` with the `fbamend.userestack` config option enabled.
4. Run `hg sl --hidden` and observe that the rebased commit is marked as "rebased".
See test file for an example.
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4670066
Tasks: 16529478
Signature: t1:4670066:1488991076:58c139c50a1aab2aa4fc7e28b1efd57a67bdfb08
Summary:
Sometimes the hg process gets stuck, and we want to get the stack traces to
learn what it's doing. It's not a big issue if gdb can be used with python
debugging support [1]. However, that feature could not be easily set up on
OS X. This extension will make debugging on OS X easier by providing the
Python stack traces on SIGUSR1.
It's similar to OpenStack's "GuruMeditationReport" feature [2].
Unlike `contrib/showsstack.py`, this extension uses SIGUSR1 instead of SIGQUIT,
and writes to a file, instead of stderr, and prints all threads, instead of
just the current one. So it's more practically useful. We may want to
replace `showstack.py` eventually.
[1]: https://wiki.python.org/moin/DebuggingWithGdb
[2]: https://wiki.openstack.org/wiki/GuruMeditationReport
Test Plan: Added a new test
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4660938
Signature: t1:4660938:1488927878:c751856681816a739160c361ed5cc10bab325000