Commit Graph

3540 Commits

Author SHA1 Message Date
Phil Cohen
c259f16e35 copytrace: update _filemerge signature, add wctx
I changed this in D449 to add wctx to _filemerge.

Differential Revision: https://phab.mercurial-scm.org/D700
2017-09-13 14:24:49 -07:00
Kostia Balytskyi
62e1ad3898 remotefilelog: make style-checker happy
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
2017-09-13 08:42:08 -07:00
Durham Goode
d476572384 remotefilelog: make backwards compatible with older changegroup api
Upstream has changed the changegroup API, and we updated to use it. Let's also
support the old API though.
2017-09-12 12:30:24 -07:00
Durham Goode
26e92d8ffe tests: update tests for upstream changes
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.
2017-09-12 10:10:06 -07:00
Durham Goode
b5deda8de4 changegroup: update to match upstream makechangegroup change
Upstream has refactored the changegroup creation APIs so we need to update our
usages.
2017-09-12 10:10:06 -07:00
Ryan McElroy
ca9289cb2a fbconduit: properly pass through params on local hit
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
2017-09-12 08:04:17 -07:00
Mihails Smolins
eeb8047815 cstore: py-datapackstore build bug fix
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
2017-09-11 11:24:38 -07:00
Mihails Smolins
bbbb8e96dd cstore: uniondatapackstore support for python stores
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
2017-09-11 09:23:10 -07:00
Mark Thomas
5d730d772d infinitepush: don't use only() to compute not-backed-up revs
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
2017-09-11 09:00:56 -07:00
Kostia Balytskyi
25d520fbe5 rage: remove unused variable
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
2017-09-11 03:27:39 -07:00
Saurabh Singh
a55e107c0e copytrace: handle modification of config from disablecopytrace to copytrace
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
2017-09-08 18:46:24 -07:00
Andres Suarez
cac17da0e4 rage: use conduit instead of arc cli
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
2017-09-08 23:11:06 +01:00
Saurabh Singh
cd4903b1fb amend: fix test-treemanifest-treeonly.t after amend's redundant commit removal
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>
2017-09-08 11:24:24 -07:00
Saurabh Singh
a995eb2fd1 amend: removing redundant commitfunc parameter in amend wrappers
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
2017-09-08 10:07:41 -07:00
Saurabh Singh
a6ec1d2188 dirsync: fixing mirroring following removal of redundant commit in amend
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.
2017-09-08 10:01:05 -07:00
Saurabh Singh
7daa1a0dda copytrace: fixing amend wrapper following removal of redundant commit in amend
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.
2017-09-08 10:00:09 -07:00
Saurabh Singh
7f3e8286a8 amend: fixing tests following the removal of redundant commit in amend
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.
2017-09-08 09:58:14 -07:00
David Soria Parra
9787efd179 p4fastimport: add --base option to define branchpoint
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
2017-09-07 19:44:16 -07:00
Phil Cohen
e3d9d9e6d3 drop: update -r description from 'revs' to 'rev'
Differential Revision: https://phab.mercurial-scm.org/D658
2017-09-07 12:47:43 -07:00
Mihails Smolins
38c4cde5a3 cstore: extend and refactor deltachain class
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
2017-09-07 08:07:30 -07:00
Durham Goode
0f55351745 tests: update test-infinitepush-pullbackups.t due to upstream
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.
2017-09-06 21:57:19 -07:00
Durham Goode
69c8748ee2 test: fix pushvars check code failures 2017-09-06 21:46:16 -07:00
Durham Goode
b91fc3d106 remotefilelog: make pack cleanup more robust
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
2017-09-05 13:07:23 -07:00
Mihails Smolins
d65b5a13b9 cstore: pythonkeyiterator refactor
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
2017-09-05 08:04:55 -07:00
Andres Suarez
6a6c71a9f2 tweakdefaults: support -I and -X in grep
Summary:
Pass-through the common `-I`/`--include` and `-X`/`--exclude` flags to
`scmutil.match`. This gives `hg grep` similar semantics to other commands that
support filtering by pattern.

Test Plan:
```
$ hg grep backgroundprefetch
remotefilelog/__init__.py:    ``remotefilelog.backgroundprefetch`` runs prefetch in background when True
remotefilelog/__init__.py:            repo.backgroundprefetch(bgprefetchrevs, repack=bgrepack)
remotefilelog/__init__.py:                                        'backgroundprefetch', False)
remotefilelog/__init__.py:                repo.backgroundprefetch(prefetchrevset, repack=bgrepack)
remotefilelog/shallowrepo.py:        def backgroundprefetch(self, revs, base=None, repack=False, pats=None,
tests/test-remotefilelog-bgprefetch.t:  > backgroundprefetch=True

$ hg grep -X '**/*.py' backgroundprefetch
tests/test-remotefilelog-bgprefetch.t:  > backgroundprefetch=True
```

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5764306

Signature: 5764306:1504535581:ebc8d9f76bbd243d49b1b3306620b88a4f16e818
2017-09-04 15:45:37 +01:00
Simon Farnsworth
9e23886f80 tests: use python instead of echo -e
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
2017-09-04 05:26:23 -07:00
Durham Goode
a60b37e9e5 cdatapack: move ntoh_data_offset out of linux ifdef
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.
2017-09-01 16:03:20 -07:00
Durham Goode
11030d633e ui: update calls to edit() to match upstream
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.
2017-09-01 15:53:54 -07:00
Durham Goode
a1cda97877 perftweaks: fix rebase size tracking
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
2017-08-31 13:28:52 -07:00
Durham Goode
a2cd5ebd96 tests: update test with upstream change 2017-08-31 13:08:41 -07:00
Durham Goode
1893cf283c tweakdefaults: remove order from analyze function
Summary: This broke working with upstream hg.

Test Plan: Ran the tests

Reviewers: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D584
2017-08-31 11:29:02 -07:00
Durham Goode
364ef7af41 tree: don't download flat manifests when cloning in tree only mode
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
2017-08-31 11:14:39 -07:00
Durham Goode
0faa105a6d tree: adds test for pushing a treeonly manifest to a hybrid server
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
2017-08-31 11:14:39 -07:00
Durham Goode
fba182aeee tests: remove orig file from a commit
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
2017-08-31 11:14:39 -07:00
Durham Goode
57571a68f0 treemanifest: fix non-tree repos when treemanifest is loaded
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
2017-08-31 11:14:39 -07:00
Durham Goode
2d3cc1e08b rage: fix lint 2017-08-31 11:11:59 -07:00
Kostia Balytskyi
dce0c8c3ab gitrevset: add a missing import keyword
Summary: Add a missing import statement.

Test Plan: - meh.

Reviewers: #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D580
2017-08-31 08:27:03 -07:00
Wez Furlong
9bfe39b9c7 scm-prompt: fixup extraction of the commit when in eden
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
2017-08-30 14:25:18 -07:00
Jun Wu
30dd85108c rage: replace print with ui.write
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
2017-08-30 14:05:55 -07:00
Jun Wu
d22b57e262 revset: accept additional arguments for stringset
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
2017-08-30 13:17:20 -07:00
Jun Wu
114719fb15 cdatapack: move feature macros before including cdatapack.h
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
2017-08-30 13:17:07 -07:00
Mihails Smolins
4cadb2504b cstore: generic uniondatapackstore
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
2017-08-30 11:37:25 -07:00
Durham Goode
23a8a4a744 tree: fix broken tests
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.
2017-08-29 17:03:50 -07:00
Durham Goode
e187dcbbd6 treemanifest: add test for hg bundle support
A simple test for hg bundle/unbundle
2017-08-29 13:02:22 -07:00
Durham Goode
1ad5d48f77 treemanifest: add test for peer-to-peer push/pull 2017-08-29 13:02:22 -07:00
Durham Goode
bb3289435b treemanifest: add test for histedit in treeonly mode
Test covering a simple histedit in treeonly mode.
2017-08-29 13:02:22 -07:00
Durham Goode
c16a1ef8df treemanifest: fix rebasing in treeonly mode
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.
2017-08-29 13:02:22 -07:00
Durham Goode
be98ac261a treemanifest: support pull in a treeonly repository
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.
2017-08-29 13:02:22 -07:00
Durham Goode
75e615d919 tests: add a test for client side treeonly support 2017-08-29 13:02:22 -07:00
Durham Goode
3507554579 treemanifest: read repo name from config during setup
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.
2017-08-29 13:02:22 -07:00