Commit Graph

3356 Commits

Author SHA1 Message Date
Mateusz Kwapich
5c80b1b5fe [prune] advertise "hg hide"
Summary: "hg hide" is the user friendly command for hiding commits

Test Plan: ran tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D725
2017-09-20 07:55:56 -07:00
Stanislau Hlebik
8bc5444998 infinitepush: run at most one backup per hg command
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
2017-09-20 07:25:52 -07:00
Durham Goode
8bb86ab225 shallowbundle: handle changegroup3
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.
2017-09-19 16:48:19 -07:00
Aaron Shotkin
0d2cd6bff2 p4fastimport: used retry decorator
Summary: added in references to replace the broken references to retries

Test Plan: run https://phabricator.intern.facebook.com/P58253036

Reviewers: davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: T21960796

Tags: bootcamp

Signature: 5866393:1505861463:ec22714d52586d5c42df80fd291712d2d9dc2895
2017-09-19 15:57:33 -07:00
Aaron Shotkin
3c316aa224 p4fastimport: added retry decorator
Summary: added a new decorator that will replace the broken retries function

Test Plan: run https://phabricator.intern.facebook.com/P58253036

Reviewers: davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: T21960796

Tags: bootcamp

Signature: 5866346:1505861561:c633d79b6485333b4b8a6ae9201ff3b59a3a6d05
2017-09-19 15:57:33 -07:00
Durham Goode
c075197c2b shallowbundle: update addgroup usage
Upstream has changed it's api again, so we need to accomodate.
2017-09-18 19:24:49 -07:00
Durham Goode
9140192e73 tests: update with upstream orig changes 2017-09-18 19:24:49 -07:00
Durham Goode
9573391792 changegroup: update generatemanifest api
Upstream added the source keyword to the generatemanifest api. We need to add it
as well.

Differential Revision: https://phab.mercurial-scm.org/D711
2017-09-18 09:21:44 -07:00
Durham Goode
f59fb364bc changegroup: update addgroup to match upstream
Upstream has refactored the changegroup application APIs so we need to update
our usages.

Differential Revision: https://phab.mercurial-scm.org/D710
2017-09-18 09:21:44 -07:00
Mihails Smolins
cb788cc931 remotefilelog: create delay for background prefetches
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
2017-09-15 07:28:07 -07:00
Saurabh Singh
c2bf4500f9 gitlookup: reorganising the imports
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
2017-09-13 17:17:55 -07:00
Saurabh Singh
bf363c4fd9 gitlookup: using util.urlreq instead of importing urllib
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
2017-09-13 17:17:55 -07:00
Saurabh Singh
5106edcb35 gitgetmeta: enable serving only missing hg-git map data
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
2017-09-13 17:17:55 -07:00
Saurabh Singh
6da8dca955 gitlookup: creating description for the extension
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
2017-09-13 17:17:55 -07:00
Saurabh Singh
3c0deb116c gitgetmeta: refactor code in gitlookup.py
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
2017-09-13 17:17:55 -07:00
Saurabh Singh
285ded5861 gitmeta: refactor and add more test cases to test-git-getmeta.t
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
2017-09-13 17:17:55 -07:00
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