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
Summary:
We changed the format a little while back, but neglected to
adjust this script.
Test Plan: run it locally and saw the correct hash. Revised test case.
Reviewers: simpkins, akushner, mbolin
Reviewed By: mbolin
Subscribers: medson, mjpieters, net-systems-diffs@fb.com, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5738750
Tasks: T21489553
Signature: 5738750:1504122070:43595555652c35e721ff4248a83d615fdc330e6e
Content written by `print` may not get flushed (especially in chg's case).
Use `ui.write` so Mercurial is responsible for flushing `ui.fout`.
Differential Revision: https://phab.mercurial-scm.org/D572
D451 is going to add an `order` parameter so let's update our code.
Also remove the wrapping of `revset.symbols['stringset']`, which is no
longer needed by the current Mercurial.
Differential Revision: https://phab.mercurial-scm.org/D543
On Arch Linux, glibc 2.25-7, `cdatapack.h` includes `stdint.h`, which
includes `bits/libc-header-start.h`, which includes `features.h`. Therefore
`_DEFAULT_SOURCE` and `_BSD_SOURCE` must be defined before including
`cdatapack.h`.
`ntoh_data_offset` was moved to `.c` to make sure `.c` is the only direct
and indirect user of `be64toh`.
Test Plan:
Make sure `make local` works on Arch Linux.
Differential Revision: https://phab.mercurial-scm.org/D559
Summary:
Implementation of uniondatapackstore that can hold generic stores.
This diff doesn't support python data stores yet, but provides an abstraction
to the stores that can be used by uniondatapackstore.
DeltaChain and DeltaChainLink wrappers will allow to use C and python chains
and chain links.
Test Plan:
* Ensure that unit tests pass
* Test on fbsource to ensure new code is executed by printfing to stdout
* Ensure the code is built successfully on macOS
Reviewers: durham, ryanmce, simonfar, #fbhgext
Reviewed By: durham, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D560
I made a last minute change to the treemanifest code to match a change that went
into @, but I forgot to run the tests and I broke it pretty badly. This fixes
the code.
Adds a test for rebasing in tree only mode and fixes a bug in readdelta where it
was returning the parent's file nodes instead of the current file nodes. The
test covers this case.
In order to support pulling from the main server, we need to:
- ignore the flat manifest part of the changegroup
- change our treeonlymanifestlog to do store.get() instead of
store.getmissing(), since only get() fetches from the remote server.
Previously we set repo.name during reposetup. Soon we're going to support
bundlerepositories though, which will need access to the tree store (and
therefore the repo.name) during repo contruction (before reposetup). So let's
have the tree store setup logic manually read the repo name from the config
instead of waiting for the reposetup to do it.
When performing a strip or other bundle operation, the bundle2 generator doesn't
use the normal part generator functions. Instead it has a custom function that
adds each part individually. We need to hook into that code to add our tree
packs to bundle files.
When building a changegroup, the logic relies on processing each manifest to
discover what files to send. In the new tree-only world we don't include the
trees as part of the changegroup, so we don't process the manifests anymore. So
we need to iterate over the tree manually to figure out what files to send.
When writing a series of treemanifests, future trees may need to reference trees
that have already been written. It can't look in the pack file like normal
because the pack file hasn't been finalized yet. To make those written trees
accessible, let's put them in a temporary memory set that the treemanifestlog
knows to look in.
Summary: on merge during rebase, check to see if source and destination are both draft commits. If so, use full copytrace to support more functionality.
Test Plan:
In tests/test-copytrace.t, added two tests:
- Change a file name and move containing directory in one branch. Modify contents of original file name in other branch. Rebase modded file into new file name in new directory.
- Move directory in one merge parent. Add new file to original directory in other merge parent. File moved to new directory on rebase.
Reviewers: stash, #fbhgext
Reviewed By: stash, #fbhgext
Subscribers: pulkit, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D481
Summary:
This is required so that eden is able to see the pending trees using the
HG_PENDING mechanism when eg: `hg amend` is used. The eden dirstate
`setparents` implementation invokes `writepending` so this is part is
pretty straightforward.
What was a bit more difficult to trace through and understand was that
`hg amend` invokes setparents more than once in my simple
manual test scenario (a commit off master, plus a change to a file not
in that existing commit).
Since the pending callback is removed after the first `writepending` call
the subsequent call(s) to `setparents` had a NOP `writepending` and then
eden failed to resolve the data.
Re-establishing the callback after writing the data seems to do the job.
Test Plan: manual testing with `hg amend --debug` in an eden repo
Reviewers: simpkins, mbolin, durham
Reviewed By: durham
Subscribers: medson, mjpieters, net-systems-diffs@fb.com
Differential Revision: https://phabricator.intern.facebook.com/D5711177
Signature: t1:5711177:1503789059:04c06ffb6e7006a5188d5426ae706dd73cd4b150