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
Summary:
Apply some auto-generated clang-tidy fixes to the C/C++ code.
This corresponds to Facebook diff D5588668.
Test Plan: Confirmed the code still builds and passes tests.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D509
Summary:
Clean up the include guards to be more consistent and unique.
Some files used include guards like "KEY_H" and "STORE_H" which were not very
unique, and are more likely to collide with definitions provided by header
files from other projects. Some of the py-*.h files were missing include
guards altogether.
This corresponds to Facebook diff D5588670.
Test Plan: Confirmed the code still builds and passes tests.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D508
Summary:
Update the copyright headers in most of the C/C++ code consistently use the
GPLv2 copyright message. This allows these files to pass Facebook's internal
C/C++ linters.
Some of the files in fbcode/scm/hgext/cstore/ appear to have actually been
copied from the hg-crew repository, and were not originally authored by
Facebook. I have not modified the copyright statements in these files:
- cstore/bitmanipulation.h
- cstore/compat.h
- cstore/mpatch.h
- cstore/mpatch.c
I also have not modified any of the cfastmanifest code.
This corresponds to Facebook diff D5588677.
Test Plan:
Confirmed that Facebook's C++ linters no longer complain about the copyright
messages.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D507
Summary:
Define the ManifestPtr class in its own header file, to eliminate some of the
nasty circular dependencies between manifest.h, manifest_entry.h, and
manifest_fetcher.h
This makes the include process for these files much simpler, and prevents
manifest.h and manifest_entry.h from both trying to include each other at
different locations in their files.
This corresponds to Facebook diff D5588672.
Test Plan: Confirmed "make local" succeeds and the unit tests pass.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D506
Summary:
Convert the C and C++ files in cdatapack, clib, cstore, and ctreemanifest
to always include files from the root of fb-hgext. This simplifies the build
process by no long requiring a variety of separate include directories to be
specified on the compiler command line.
This will also make it easier to re-use these extensions in other projects
with different build systems.
This corresponds to the Facebook diff D5588676.
Test Plan: Confirmed that "make local" succeeds from a clean build.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D505
Summary:
Keepset computation algorithm added tuples to the keepset that are the results
of diffs between two manifests. Now it has been fixed and only new node from
the tuple is added to the keepset.
Test Plan:
* Run hg gc on www, fbsource
* Ensure the unit tests pass
Reviewers: simonfar, durham, #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D519
Which packs get cleaned up is non-deterministic in some cases, so grepping for
the 'x' in this test did not catch when a non-x pack was left behind, which
caused flakey output. Let's instead check that 3 packs were left behind and one
of them was from the small generation.
Summary:
Pull --rebase when you have local draft commits moves your commits,
your working copy, and your active bookmark to the new branch head
(or whatever destination you specify with -d). If you don't have
any local draft commits, it doesn't do any of that.
This change makes it so that it does everything except moving the
commits.
Test Plan: Added new unit tests. Re-ran existing ones.
Reviewers: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D518
If a bunch of packs are the same size, the ones repack chooses to pack is
non-deterministic. This was causing flakiness in the test as different packs
were being left behind. Let's remove that dependency.
Summary:
We have an internal linter that keeps yelling at me about this spelling error.
I created this by running:
```
hg grep -l 'commited' | xargs sed -i -e 's#Changes commited as#Changes committed as#g'
```
Test Plan: CI
Reviewers: durham, quark
Reviewed By: quark
Subscribers: medson, mjpieters, stash, jeroenv
Differential Revision: https://phabricator.intern.facebook.com/D5699238
Signature: t1:5699238:1503596778:de5e4f26daeaf3649c6c09ded6bd2b459b0e5f97
chg runs a mercurial command, we want to see which actual commands are run and
don't want to wrap at the chg level.
Differential Revision: https://phab.mercurial-scm.org/D504
Disables line wrapping for interactive ui. This makes sure the line count is
correct and the output is clear.
Differential Revision: https://phab.mercurial-scm.org/D503