Summary:
Previously we ran auto backups in txnclose hook. But commands like histedit and
rebase create many transactions, and that means that lots of backup processes
are started at the same time. That means that sometimes backup processes use
too much memory.
Instead let's start it once per command if any transaction was opened
during the command.
Test Plan:
Run unit-test.
Run histedit with autobackup enabled, and make sure just one backup process
was started.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D678
Upstream has changed local bundles to use the highest available changegroup
version, which means we're using changegroup3 for strips now. So we need to
handle that in shallowbundle.
Summary:
This functionality allows to add delays between background prefetches after
operations that change the working copy parent. By default background
prefetches will be run no often than every 2 minutes, but this is configurable.
This allows to reduce the load on CPU(because prefetch is followed by repack).
Test Plan:
Tested manually on fbsource repo by running hg co bookmark several
times and ensuring that only 1 background prefetch is running if 2 minute
timeout has not expired.
Reviewers: durham, simonfar, ryanmce, #fbhgext
Reviewed By: simonfar, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D712
Summary:
Reorganising the imports in the file gitlookup.py to comply with the
recommended way.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D702
Summary:
I was reorganising the imports of gitlookup.py. After reorganising, the test
test-check-code-hg.t was probably able to recognise the imports and suggested
that we should using util.urlreq instead of urllib. Therefore, I am making the
suggested change in this commit and removing the urllib dependency.
I will be reorganising the imports in a later commit.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D701
Summary:
The gitlookup extension allows for only requesting the complete file
from the server. This leads to download of large files (hg-git map file
specifically in this case) when only the missing chucks of the file would have
sufficed.
This commit makes changes to allow for downloading only the missing parts of
the map file. A config option 'onlymapdelta' has also been added to allow for
switching between the two different modes of operation: serving complete file
and serving only the missing chunks. The tests were subsequently updated to
cater to the new scenario and also, checking for interoperability of the two
modes.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D695
Summary:
There is no description of the 'gitlookup' extension when 'hg help
gitlookup' in invoked. I just changed the existing code comments to form a
description.
Test Plan: Checked output of 'hg help gitlookup'
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Differential Revision: https://phab.mercurial-scm.org/D693
Summary:
This commit just refactors some code to setup nicely for handling a
new type of bundle part. The refactoring essentially moves out the parts that
can be reused later.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Differential Revision: https://phab.mercurial-scm.org/D692
Summary:
test-git-getmeta.t has some basic tests to check that the git metadata
syncing works as expected. I have added some tests for more complicated
scenarios for robust testing. Also, I did some refactoring of the test for
readability.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Differential Revision: https://phab.mercurial-scm.org/D685
Summary: `test-check-code-hg.t` complains about long lines here.
Test Plan: - rt, make sure it does not complain anymore
Reviewers: durham, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D697
5d45a997d11 in upstream changed rebase to use unfiltered repositories, which
changes the definition of tip in these two tests. Let's update the test output.
Summary:
Previously, we didn't pass through additional parameters, which resulted in
errors complaining about insufficient arguments.
Test Plan: Added a new test that previously crashed
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D689
Summary: Build failed because there were no brackets in switch statement
Test Plan: * Rebuild and ensure unit tests pass
Reviewers: simonfar, #fbhgext
Reviewed By: simonfar, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D681
Summary:
Now uniondatapackstore can also hold python data stores. PythonDataStore
wrapper simply passes function calls to underlying python objects and marshals
the output.
Test Plan:
* Added test case
* Tested on fbsource with treemanifest.usecunionstore=True
Reviewers: durham, simonfar, ryanmce, #fbhgext
Reviewed By: durham, simonfar, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D631
Summary:
The infinitepush backup smartlog summary uses only(a, b) to determine which
revisions have not been backed up. However, if the set of backup heads is
empty, only() behaves as if it were called as only(a), which is wrong and slow.
Instead, use ::a - ::b, which is always correct, even if b is empty.
Test Plan: Re-run UTs. Test perf on a repo with no backup heads.
Reviewers: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D676
Summary: This makes test-check-pyflakes-hg.t complain, so let's fix it.
Test Plan: - run this test, see it stop complaining.
Reviewers: #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D675
Summary: In mercurial core, the config for disabling copytrace was changed from
disablecopytrace (boolean) to copytrace which can be on or off. As a result of
this change, there were some breaks which need to be modified to work with the
new config. This commit acheives the same.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D662
Summary:
The arc cli often depends on some checked-in code. If the repo is in a bad
state (when `hg rage` is most often needed), then arc may fail to load. A
less flaky approach is to create the paste by calling conduit directly instead
of relying on the arc cli.
* The paste now has a title – it's "hg rage for path/to/repo".
* If the paste creation fails, then the rage content is saved to a temp file.
Test Plan:
Confirmed that the paste and the temp files had the `hg rage` content:
* Success:
```
$ hg rage
Please post your problem and the following link at xxx (xxx) for help:
xxx/P58168469
```
* Failures:
```
# Missing "hosts" in ~/.arcconfig:
$ hg rage
arcconfig configuration problem.
No paste was created.
Saved contents to /var/folders/jr/_rg2cglx58z6_fnksmnlmc2w71b1w9/T/hg-rage-fMVgGr
# Bad "user" in ~/.arcconfig:
$ hg rage
Error talking to phabricator.
No paste was created.
Saved contents to /var/folders/jr/_rg2cglx58z6_fnksmnlmc2w71b1w9/T/hg-rage-HeWjHA
# Off the corporate network:
$ hg rage
Bad response from phabricator.
No paste was created.
Saved contents to/var/folders/jr/_rg2cglx58z6_fnksmnlmc2w71b1w9/T/hg-rage-x4IBMT
```
Reviewers: #mercurial, medson, rmcelroy, mitrandir
Reviewed By: medson, rmcelroy, mitrandir
Subscribers: #mercurial, mitrandir, rmcelroy, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5793911
Tasks: T19966776
Signature: 5793911:1504883514:29dc2c388819ba0d570a69f97eacb77884a2f983
Summary: cmdutil.amend was changed recently to get rid of the redundant commit
during the amend operation. As a result, we need to update this test as it was
aware of the redundant commit. This commit achieves the same.
Test Plan: Executed the test after the changes.
Reviewers: #fbhgext, durham, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D661
message empty to abort commit. HG: -- HG: user: Saurabh Singh <singhsrb@fb.com>
Summary: cmdutil.amend was recently changed and the commitfunc parameter was
removed. This commit fixes the wrappers on the amend function by removing the
redundant parameter.
Test Plan: Ran the existing test suite
Summary: The dirsync extension was relying on the redundant commit in amend to
achieve the mirroring. Now with that commit removed, I decided to wrap the
cmdutil.amend itself so that we can still do the mirroring correctly during the
amend.
I added a new test file test-dirsync-amend.t to test the wrapper over amend.
The test-dirsync.t was an existing test that was broken after the amend
behavior change and has been added again with some changes. It would be best to
review it against its old version.
Test Plan: Ran the test suite.
Summary: I just had to ensure that the we were storing the amend information by
checking against the working copy instead of the intermediate commit.
The test-copytrace-amend.t wasn't added in this revision. It is actually an
existing test which was broken after the change in amend behavior. I have added
the test again with minor changes. I think it would be best to diff the test
against its old version for the review.
Test Plan: Ran the test suite.
Summary:
cmdutil.amend was changed recently to get rid of the redundant commit during
the amend operation. As a result, we need to update the tests which were aware
of the redundant commit. This commit achieves the same.
Note that as a result of the amend behavior change, the dirsync and copytrace
extensions were broken. They will be be fixed in subsequent commits on top of
this commit. For now, the broken tests for these extensions were removed from
the commit. Eventually, I will fold all the fixes together so that revision
history of the tests is not messed up. This is primarily done only to aid the
review.
Test Plan: Ran the test suite after updating the tests.
Summary:
We are adding an option --base to define a starting point for a
new branch. We define --bookmark as the head of the branch (we
might introduce a --dest option in addition). This allows us to create
new branches for release branches and others.
Note that for some reason, `arc unit` is generating different test
results than running the run-test.py manually, causing branch updates in
different situations. Therefore we have to glob a bunch of tests.
Test Plan:
python ../../hg-crew/tests/run-tests.py test-p4fastimport-* test-check*
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5769328
Signature: 5769328:1504763221:78eb81f32ec46fc56619d77537c2b1944e938466
Summary:
Extended DeltaChain with CDeltaChain and PyDeltaChain which are wrappers around
c and python delta chains respectively. The declaration and implementation
of c and python delta chains as well as DeltaChainLink were put in a different
file.
Test Plan: * Ensure that unit tests pass
Reviewers: ryanmce, durham, simonfar, #fbhgext
Reviewed By: ryanmce, durham, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D630
These lines were added in D485 but the diff indicates they weren't sure why
these lines were needed. D608 fixes the upstream bug that caused this, so now
the lines aren't necessary.
Summary:
We're seeing exceptions from the unlink cleanup logic hide the actual exception
from the code. In order to debug the actual exception, we need to eat the
cleanup exceptions and in any place where we eat an exception inside of a catch
block, we need to manually rethrow the original exception, otherwise we end up
throwing the second caught exception (from the cleanup logic).
Test Plan:
Ran the tests. This is a particular odd edge case, so I need to run
these bits in the production environment where it was occuring before I can
understand why it was happening.
Reviewers: #fbhgext, ms2316
Reviewed By: ms2316
Subscribers: ms2316
Differential Revision: https://phab.mercurial-scm.org/D586
Summary:
PythonKeyIterator has been moved to a separate file, because we will need to
include it in several places in future commits.
Test Plan: * Ensure unit tests pass
Reviewers: ryanmce, durham, simonfar, #fbhgext
Reviewed By: ryanmce, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D629
Summary:
BSD echo doesn't support -e. The lint rule says to use Python instead,
so follow its advice
Test Plan: Ran tests locally on Mac and Linux.
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D619
08f1c7171e8a broke osx builds because it moved the declaration of
ntoh_data_offset into a linux specific ifdef. I think this was a mistake, so
let's move it back out to the not-ifdef portion.
Upstream has added devel warnings around edit, so we need to update our usage.
In particular, the action parameter is now required, and the suffix extra will
soon be ignored.
Summary: Upstream change the rebase signature, so let's change our wrapper.
Test Plan: Ran the tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D585
Summary: This broke working with upstream hg.
Test Plan: Ran the tests
Reviewers: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D584
Summary: Prevents downloading any manifest revlogs when the client is in treeonly mode.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D575
Summary:
This adds a test that pushes a treeonly commit from a treeonly client to a
hybrid server, and verifies the result is written to the server flat and tree
manifests. Also tests that hooks can access the tree data.
This also changes the server to read the treemanifest if a tree was provided in
the bundle. Previously the server would only read trees if the forcereceivetrees
flag was on, which meant we couldn't accept flat and trees at the same time,
which made migrating harder.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D571
Summary:
An orig file was getting added to a commit in a test accidentally, which makes
it harder to test the contents of that commit in a future diff. Let's purge that
file before we make the commit. This affects some of the later output because
the hash changes.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D570
Summary:
If the treemanifest is loaded, but not enabled for a repo, it was still
executing tree code for that repo, which would break. This adds checks to
prevent tree code from running in non-tree repositories.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Subscribers: simonfar
Differential Revision: https://phab.mercurial-scm.org/D568