Summary:
One one more improvement to logging to better measure the impact. Do not log if
file contents are the same as it is explained in the comment.
Depends on D5217007
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5218112
Tasks: 18508761
Signature: t1:5218112:1497317521:e73e8ebe01a4a8ca73ad9fc87b5608d4c9f5484c
Summary:
Remotenames can return a name that has no nodes (it may exist in the remotename
store, but when we go to resolve the node the node doesn't exist). So we need to
check for existence after fetching the nodes.
Test Plan: This was crashing for a user. After the fix they no longer crash.
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5194317
Signature: t1:5194317:1496847686:ab05335284b83a2060c2bfea4beec6bf0453905c
Summary:
The remotefilectx ancestor walk did not check if it had already walked a node,
and therefore very mergey history would cause this to be exponential runtime.
Let's add a visited check.
Test Plan: hg log on a file with very mergey history
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5191981
Tasks: 19121837
Signature: t1:5191981:1496865201:66b58b6831e9ae1707f834965456d95ec339cc86
Summary:
There is a problem with socket.gethostname() because it can return
inconsistent names. See attached task for details.
Instead this diff lets us specify any hostname.
Depends on D5180633
Test Plan: arc unit
Reviewers: #mercurial, simpkins, tja
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180665
Tasks: 18528165
Summary:
Previously there were many small functions that were used to create backup
bookmark name. Changing the logic was quite onerous because one would need to
change function signature in a few places.
This diff introduces special class that incapsulates this behaviour.
With this class making changes to naming scheme would be less problematic.
Depends on D5180390
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180633
Tasks: 18528165
Summary:
Let's add an option that can be used to trigger full clean backup.
It can be useful in many situations, for example, in case of bug in
infinitepush backup or if the naming scheme of backup bookmarks were changed.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180390
Tasks: 15389402
Summary:
Previously if file was added in source then it would be considered missing in
destination. This behaviour won't add incorrect copies, but it would do
additional work of checking move candidates for the added file. This diff fixes
it.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5190369
Tasks: 18508761
Summary:
revlog uses transaction.find and transaction.replace in cases where a
datafile is separated from an index (>= revlog._maxinline). In these cases the
importer broke as we did not implement find and replace in filetransaction.
We implement the two methods. However we ned a save way to store the data
portion which find must correclty return. We cannot store json as some
serializations aren't bidirecitonal. We can't store pickle as \n is a common
separator in pickle, and we use that to separate our entries. So we use pickle
and then base64 encode it. This is cumbersome but works.
The fix is aimed to make things "work" and I want to explore options to better
implement find and replace.
Test Plan:
- Working on a test that correclty triggers inline -> separation.
- Deployed it to our test system with test data and see commits comming in.
Reviewers: #idi, #ovrsource_warroom, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5189308
Summary:
Since it is now an independent extension, we don't need to have a knob
to enable/disable obs-based shelve, we can just enable/disable the entire
extension itself.
Test Plan: - run a test
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5181001
Summary:
We do not want to switch people to obsshelve and then find out that their
traditional shelves cannot be unshelved.
Test Plan: - check that added test passes
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180998
Summary: Just for an early detection of bad config being distributed.
Test Plan: - add a test case
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180986
Summary:
See bottom commit of the stack for the motivation.
This commit copies obsshelve-related tests from hotfixed core and cleans them
up a little bit.
Test Plan: - run just added test
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180981
Summary:
Grand goal is to remove all of the shelve-related hotfixes and just have
a separate extension, obsshelve, which we could roll out to all FB users
without worrying about upstream.
This commit just copies current version of core's shelve.py with FB hotfixes
applied on top of it. The only changes are changes in testedwith and a
description at the top of the file and an import of rebase from hgext rather
than '.'.
Test Plan: - it is not enabled and tests are added in a later commit in this stack
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180947
Summary:
With upstream bab25235cfb5daf578a598bd7ae08f7a70ef7acd `hg strip` also strips
markers too. This diff just accepts the test changes since they seems not dangerous
Test Plan: arc unit
Reviewers: #mercurial, kulshrax, simpkins, quark
Reviewed By: quark
Subscribers: net-systems-diffs@fb.com, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5185690
Signature: t1:5185690:1496700479:a230a2861c8d3cafda3867c81b8fc90a7cfcc4df
Summary:
Previously, we would only look at the node parents to determine what the base
node would be for a prefetch. This didn't work so well when we started
prefetching arbitrary revs, like only prefetching master. This patch allows us
to scan the changelog back a bit to find the nearest base tree.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5108686
Signature: t1:5108686:1495565589:1729bfae7198e8db2223446b81e3bdbf77cf3db6
Summary:
This adds a config option that allows clients to prefetch only certain trees
after a pull. This is useful if the user wants to download just master. A future
patch will make it only download the portion of the master tree that is new.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5108677
Signature: t1:5108677:1495565526:a443c41ccbf55e529c93aa0c021849396d611ac6
Summary: Only do the tree prefetch if there are nodes we don't have.
Test Plan: manual testing
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5108667
Signature: t1:5108667:1495580154:393125986ce4ce307f299f8ee3856fc76c52a25f
After upstream commit bab25235cfb5daf578a598bd7ae08f7a70ef7acd strip now also
deletes obsmarkers that are related to the stripped commits and saves them in
the bundle.
Summary:
Previously we logged every time there is a changed/deleted file conflict.
This generates lots of useless log entries. Most of these entries are valid
conflicts where one file was deleted and another was added. Besides analyzing
these log entries is manual and very time consuming. Let's instead log cases
where copytracing actually helped.
Test Plan:
arc unit
Run with hg-crew test suite with --extra-config-opt
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5175656
Tasks: 18508761
Signature: t1:5175656:1496651487:fe710731213b21aefd1b957d259dc93470c9545c
Summary:
Simple copy tracking for draft commits. It doesn't use db to save move info
because getting move info is quite fast already.
Depends on D5137372
Test Plan: Run tests
Reviewers: #mercurial, durham, quark, rmcelroy
Reviewed By: quark
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5137886
Tasks: 18508761
Signature: t1:5137886:1496348869:8f4a9761fdeb26ddee5e18a318cc85582ef4adbb
Summary: This will be safer if upstream API ever changed again.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5147881
Signature: t1:5147881:1496326141:c70559ffe2bb43953a1a0584163ca24c3235c5f3
Summary:
Copytracing that is based on a simple idea: most moves are either directory
moves or moves of the file inside the same directory. That means that either
basename of the moved file or the dirname of the moved file is the same.
More details in the comments.
Test Plan: Run unit-tests
Reviewers: #mercurial, durham, quark, rmcelroy
Reviewed By: quark, rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5137372
Tasks: 18508761
Signature: t1:5137372:1496243148:8d229c1593da196b674318ee8b37af15a60831c8
Summary:
Fix the tweakdefaults code to extract the --tool argument when extracting
--rebase, and to pass it in to the rebasemodule.rebase() function correctly.
Test Plan: Included a new test.
Reviewers: #mercurial, rmcelroy, quark
Reviewed By: quark
Subscribers: quark, net-systems-diffs@fb.com, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5134466
Tasks: 18770938
Signature: t1:5134466:1495848690:308a8d3fbad39e6ecfeaee04b1b3267c1fa1118c
Summary: It was added by mistake, let's remove it.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D5155301
Tasks: 18508761
Signature: t1:5155301:1496246623:a650cbffa7edf4311f96071e57c61697dae8014e
Summary:
1) Log commit hashes. Since we have infinitepush we may see the actual commits that caused the problems.
2) Log reponame
3) Wrap logging code in try/catch so that any errors in this code won't affect clients
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5146976
Tasks: 18508761
Signature: t1:5146976:1496241350:1d8a921527a0e2d984f6a46452697428df1757be
Summary:
`gdbm` is unavailable on Windows. Python provides module called `anydbm` which
abstracts the implementation of `dbm` and is even capable of using a dump
Python-only implementation if nothing is installed.
Test Plan: - rt
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5154620
Summary:
It has bitten us a few times already. Failing `_adjustlinknode()` only because
we couldn't download file from the server seems incorrect. There may be a
transient network issue for example.
Let's wrap this code in try/catch and warn in the case of failure.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5147669
Signature: t1:5147669:1496225752:3cd6d9758e447b7f91b246a9ed1a20e6f73ed176
Summary:
This diff makes the tests use the vendored directaccess and inhibit instead the
foreign ones.
Test Plan: arc unit
Reviewers: #mercurial, sid0
Reviewed By: sid0
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5142981
Signature: t1:5142981:1496173851:3a8f3a1c689711dbef517c893bf72c90ab144761
Summary: Fix lint errors and make the test pass.
Test Plan: arc unit
Reviewers: #sourcecontrol, sid0
Reviewed By: sid0
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5142477
Signature: t1:5142477:1496173824:bf941d895d3259fc788c09d4fefca7dddd11a33b
Summary:
Vendored using GPL2 license from https://bitbucket.org/marmoute/mutable-history
changeset c9f1118b33d60f8faa4b89988a8155c544f5bb0d without modification.
Test Plan: N/A. The code was imported as is.
Reviewers: #sourcecontrol, sid0
Reviewed By: sid0
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5142063
Signature: t1:5142063:1496173803:d0a9fa50a8423a531432ac3cff378b50952684b1
Summary:
This adds the `skiprevs` parameter to all `filectx.annotate` methods
to match the upstream change.
For fastannotate, things is a bit more complex since it's a mix of two
algorithms. For now we just fallback to the slow path for correctness.
I'll think about adding back a fast path later.
Test Plan: arc unit
Reviewers: sid0, #mercurial, quark
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5128392
Summary:
copytracing extension is going to be simpler than I expected in the beginning.
There is no need to separate folder, let's move it to hgext3rd
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5146585
Tasks: 18508761
Signature: t1:5146585:1496147733:ad6ad14f663a8b9bf4b687f0767395321f9840b7
Summary:
Previously `_getrevstobackup()` would load manifest for each commit in memory
only to check if a file was deleted in this commit or not. Manifest can be
quite big and since every loaded flatmanifest is cached in fastmanifest then
memory usage can be huge.
Since we are doing this only to check if there are any commits that were
downloaded to the client without filelogs and then were stripped server-side.
This cases are rare and it would be easier to track these commits in the
config file.
Test Plan: arc unit
Reviewers: #mercurial, mjpieters, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5111372
Tasks: 15389402
Signature: t1:5111372:1495848867:4028bd48313ac0e2022c3695195bedc6eda80abf
Summary:
`revlog.ancestor` is expensive on long changelog, but is only called a few
(about 30) times for smartlog usage. Therefore we could simply cache the
result in a key-value database.
This speeds up smartlog by about 200ms.
Test Plan: Added a new test
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5135746
Signature: t1:5135746:1495783503:411260551fd29fda42c9fc809b56f8f77fb2eaf4