Commit Graph

1668 Commits

Author SHA1 Message Date
Phil Cohen
d4642ef2ca debugdatapack: suppport passing multiple files
Also print the name of the packfile being inspected, and \itweak newlines a bit.

This simplies debugging several packfiles in tests.

Differential Revision: https://phab.mercurial-scm.org/D1326
2017-11-06 19:09:15 -08:00
Durham Goode
5987282c25 treemanifest: test commit hooks with pushrebase 2017-11-06 17:26:08 -08:00
Phil Cohen
ef47b31d2f debugdatapack: print delta and blob size totals and compression %
Also print "(empty name)" if the filename is empty.

Differential Revision: https://phab.mercurial-scm.org/D1259
2017-11-05 21:45:40 -08:00
Phil Cohen
a8cfab1484 repack: add blob size to metadata if it's missing
When trees are fetched from the server as packs, metadata isn't included, as
it's not supported in the protocol. Fast size information is useful, since
we have access to the fulltext during a repack, add the metadatan then.

This will be needed for sized-based sorting of manifest entries.

Differential Revision: https://phab.mercurial-scm.org/D1255
2017-11-05 18:49:10 -08:00
Phil Cohen
53d2c02095 debugdatapack: add blob size
It's useful to know the size of the resultant object, not just the delta entry.

Differential Revision: https://phab.mercurial-scm.org/D1254
2017-11-05 18:45:21 -08:00
Durham Goode
d89d7b5249 tests: update with upstream obsmarker changes
Upstream has enabled the effect flag metadata by default. Add it to our test
output.
2017-11-03 12:40:04 -07:00
Durham Goode
8f4b8e3894 treemanifest: add sendtrees config back
It turns out we have some machines that don't have treemanifest enabled, so we
need to add back the config that prevents a client from sending trees.
2017-11-03 09:24:39 -07:00
Pulkit Goyal
d3b6e1c63c fbhistedit: add support for json input to histedit
This patch adds support to histedit command to take input from json. The JSON
should be of following format:

{ "histedit": [
                {"action": "...", "node": "..."},
                {"action": "...", "command": "..."},
                {...}
              ]
}

For actions except "exec" and "execr", "node" is required and for "exec" and
"execr", "command" should be there.

The support is plugged in directly and is not hidden behind a config flag. After
this support, the parser which parses the commands file will assume that JSON is
given and will fallback to original parsing if it fails to convert the data in
the file to JSON.
In case where input is JSON but a key is missing, status message is shown and we
fallback to normal parsing.

Both small and large verbs are supported for the action part in JSON.

Differential Revision: https://phab.mercurial-scm.org/D1263
2017-11-03 05:30:12 +05:30
Jun Wu
09af39ffe1 check-ext: ignore pyc files
`.pyc` files could cause false positive. Scan `.py` and `.pyx` files
explicitly.

Test Plan:
Make sure `uncommit.pyc` will not break check-code but `uncommit.pyx`,
`uncommit.py` will.

Differential Revision: https://phab.mercurial-scm.org/D1283
2017-11-02 12:00:11 -07:00
Jun Wu
47b9325724 restack: use multidest rebase to implement restack
With the multidest rebase (D470), restack could be implemented as specifying
the source (`orphan() - obsolete()`) and a revset specifying destination for
each source revision.

This patch changes restack implementation to use that. The revset is
implemented as a private function `_destrestack`, like `_destrebase` in
`rebase.py`.

Most test changes are because the topo-sort in `rebase.py` removes some
unnecessary steps. So the resulting revision numbers are smaller.

There is one interesting test case that gets changed:

```
    D
    |      # amend: B1 -> B2 -> B1
 B2 B1 B3  # amend: B1 -> B3
  \ | /
    A
```

Previously, restack will move D to be on top of B3. Now restack will not
move it because `D` is considered stable (not orphaned) since none of its
ancestors are obsoleted. The new behavior seems to be more desirable.

More tests are added to test restack source revisions (should be in a same
stack) and some "prune" cases.

The transaction logic is also made more robust so `test-copytrace-amend.t`
does not cause a broken rebase state.

Since the rebase operation runs in a same rebase state, restack can be
continued via `rebase --continue` correctly after resolving merge conflicts.
This is reflected in a newly added test.

Test Plan:
With hg-dev, run `./script/unit.py`

Differential Revision: https://phab.mercurial-scm.org/D1139
2017-11-02 11:54:31 -07:00
Durham Goode
8ab92efa9a tests: fix check code 2017-11-02 10:37:38 -07:00
Simon Whitaker
10200ac057 tests: handle case in test-remotefilelog-clone.t where output is out of order
test-remotefilelog-clone.t is flaky, and fails sporadically as follows:

     $ hg clone --noupdate ssh://user@dummy/shallow full
     streaming all changes
  +  abort: unexpected response from remote server: empty string
     remote: abort: Cannot clone from a shallow repo to a full repo.
  -  abort: unexpected response from remote server: empty string
     [255]

The issue happens because the line starting "abort" and the line starting
"remote: abort" come from different processes, and there's no way to
guarantee the order in which they are output.

This change attempts to address the issue by capturing the output of the
local process and examining it separately.

Test Plan:
rt test-remotefilelog-clone.t

Differential Revision: https://phab.mercurial-scm.org/D1279
2017-11-02 14:29:03 +00:00
Simon Whitaker
ae59d3ef08 tests: fix test-tweakdefaults-update.t test failures
Test Plan:
rt test-tweakdefaults-update.t

Differential Revision: https://phab.mercurial-scm.org/D1284
2017-11-02 14:11:25 +00:00
Durham Goode
d6440bad3c treemanifest: test for pulling normal scratch branch into treeonly repo
Adds a test and improves output for dealing pulling a normal scratch branch into
a treeonly repo (so the manifest doesn't exist).

In the future we could fix this by having the server generate the trees on the
fly for infinitepush branches that don't already have them.

Differential Revision: https://phab.mercurial-scm.org/D1268
2017-11-01 17:10:05 -07:00
Durham Goode
0ea3abac80 infinitepush: send treepack parts with the client push
This makes the client side pushes also include tree packs in the push.

Also adds a test to see that the tree parts round trip between two tree-only
clients.

This was reverted in D921 because clients couldn't push old non-tree commits to
infinitepush anymore. I've fixed the issue and added a test to this commit.

Differential Revision: https://phab.mercurial-scm.org/D1017
2017-11-01 17:10:05 -07:00
Durham Goode
5f4f65474d treemanifest: update test for pushing a treeonly commit to a server
The old version of this test relied on the sendflat config being set to false so
it would only send the trees. Since that config is gone, the test then started
sending flat manifests, so it wasn't actually testing what it should've been.

This patch fixes that by making it push a tree only commit and ensuring the
commit hook executes correctly. The test changed a bit, because the hash changed
after the push, because it was a tree only commit on the client (and therefore
used the tree hash) but a hybrid commit on the server (and therefore used the
flat hash).

Differential Revision: https://phab.mercurial-scm.org/D1267
2017-11-01 17:10:05 -07:00
Durham Goode
2f95e6e9ca treemanifest: remove sendflat config
Previously the sendflat config decided if we should send flat manifests or not.
To reduce the number of config permutations we have to handle, let's change the
code to always send the flat manifests, if it exists.

Differential Revision: https://phab.mercurial-scm.org/D1266
2017-11-01 17:10:05 -07:00
Durham Goode
df82fc6557 treemanifest: remove sendtrees
Previously we were relying on config values to determine when to send or not
send tree and flat manifests. This resulted in complicated permutations to test.
Let's remove these config values and always send trees if we have them. A future
patch will do the same for flat manifests.

Differential Revision: https://phab.mercurial-scm.org/D1265
2017-11-01 17:10:05 -07:00
Jun Wu
4f2096a46a hiddenoverride: work with scmutils.cleanupnodes
Previously, hiddenoverride only unpins nodes when createmarkers gets called.
However, with scmutils.cleanupnodes, createmarkers will not get called when
the nodes are already obsoleted. This patch makes hiddenoverride check
cleanupnodes too to unpin nodes properly.

Differential Revision: https://phab.mercurial-scm.org/D994
2017-11-01 11:49:13 -07:00
Jun Wu
aff5472dda hiddenoverride: add a test demonstrating an visibility issue
The last `uncommit` should make `B` invisible. This is from a user report.

Differential Revision: https://phab.mercurial-scm.org/D993
2017-11-01 11:49:13 -07:00
Maxime Montinet
f21203a7a7 infinitepush: fix test that broke test build
Summary:
Use python instead of jq in pullbackup test
fixes breakage reported in D6186148

Test Plan:
Run unit tests
Verify build runs without a hitch

Reviewers: swhitaker

Differential Revision: https://phabricator.intern.facebook.com/D6208705
2017-11-01 07:56:44 -07:00
Pulkit Goyal
decf98e505 fold: add support to get json output for node changes
This patch adds support to fold for outputting node changes as a part of it's
json output.

The nodechanges is a dictionary having predecessor as key and list of successors
as value. The successor is a list as we can have multiple successor for a
predecessor in case of split and having a generic format will be helpful.

After this patch, if you want json output from fold, do
  `hg fold ..args.. -Tjson -q`

To just get the dictionary of hash changes, do
  `hg fold ..args.. -T '{nodechanges|json}' -q`

-q is required to prevent the ui.status output coming from hg.update and rebase
part.

Since we have added support to fold for nodechanges, it has been added to
blacklist for cleanupnodes wrapper in tweakdefaults.

Differential Revision: https://phab.mercurial-scm.org/D1041
2017-10-31 13:22:06 -07:00
Durham Goode
2857c2351f tests: fix lint 2017-10-31 13:20:03 -07:00
Pulkit Goyal
0e479f3794 pushvars: move config setting in tweakdefaults and drop the extension
The logic of pushvars extension was moved to core and the extension here just
used to set a config which defaults to False in core. Let's move that config
setting to tweakdefaults and drop the extension.

Differential Revision: https://phab.mercurial-scm.org/D1275
2017-11-01 01:41:55 +05:30
Maxime Montinet
ae3b7f2364 infinitepush: prevent hg pullbackup from doing an automatic backup
Summary:
Instead of making an autobackup, make hg pullbackup simply
write the backup state from the recently restored backup.

Test Plan:
cd ~/facebook-hg-rpms/fb-hgext/tests
source ../../hg-dev
rt test-infinitepush-*.t

Reviewers: #mercurial, cdown, stash

Reviewed By: stash

Subscribers: mjpieters, medson

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

Tasks: T22856338

Tags: bootcamp

Signature: 6186148:1509457565:e66cefc6e95d9b1cfb91e9bf8fa5c40b05e4fb82
2017-10-31 07:00:31 -07:00
Phil Cohen
9d8a77b7df tests: remove the unused blacklist-sqldirstate file
Differential Revision: https://phab.mercurial-scm.org/D976
2017-10-30 20:56:08 -07:00
Durham Goode
f64fb99447 pushrebase: fix support for tree manifests
pushrebase can't use the standard rev.manifest() or rev[filepath] accessors
because they aren't aware of treemanifests. Let's refactor our manifest and
filectx accessor patterns into a separate function and use it in the two places
that need manifests.

test-treemanifest-server.t was failing before this. One test was modified
because the does-it-have-the-tree check is now done earlier, before the lock is
taken, so we abort before the output is printed.

Differential Revision: https://phab.mercurial-scm.org/D1251
2017-10-26 14:29:55 -07:00
Durham Goode
0ea8bce203 pushrebase: update fastmanifest test
This test looked like it's been funky since it was introduced. It harded code
an exception from a bug.  The bug was that we're storing bundle manifests in a
cache during pushrebase, and because those manifests are hybrid manifests they
haven't actually loaded from disk. Later we close the bundle, then after that we
try to access these cached manifests, which throws because they can't read from
the file.

The recent change to read the copied files from the manifest before the lock is
taken, forces these manifests to be in loaded, thus fixing the problem. So let's
update the test.
2017-10-26 13:40:59 -07:00
Mark Thomas
7098f7d4b5 pushrebase: check sources of renames when looking for conflicts
When checking the bundle contents against the revisions it is being rebased
over, include the sources of renames, as changes made in those files also
conflict with the bundle.

Differential Revision: https://phab.mercurial-scm.org/D1199
2017-10-26 02:47:39 -07:00
Phil Cohen
8b5727a6d0 tests: fix missing entry in test-merge-conflictinfo.t 2017-10-25 22:25:24 -07:00
Phil Cohen
ca7d60b943 conflictinfo: add more information about the conflict-causing command
In the old version of this extension it was too difficult to determine how to
resume or abort the command that generated conflicts. Let's add that
information so consumers can programatically continue or abort.

Differential Revision: https://phab.mercurial-scm.org/D713
2017-10-25 22:20:32 -07:00
Kostia Balytskyi
a3dca2b53f test-merge-conflictinfo: include expected failures according to sid's hotfix 2017-10-24 17:54:02 -07:00
Durham Goode
29bb657526 tests: fix fastmanifest tests
Changing the config defaults to be part of the config registrar caused the unit
tests to fail (since they don't load the registrar).
2017-10-23 20:13:13 -07:00
Durham Goode
f260c80298 configs: register more of our configs
Upstream has added devel warnings that require us to register all the configs
and remove the defaults that are specified at read time. This doesn't fix all
the cases, but is the start.

Differential Revision: https://phab.mercurial-scm.org/D1206
2017-10-23 20:02:57 -07:00
Durham Goode
6db0ad3d03 config: rename allowdivergence to evolution.allowdivergence
Upstream has renamed this config. Since the old config name was still an alias
for the new name, it was technically only breaking the test output where we
hardcoded the config name in the output. But I went ahead and updated every
place anyways.

Differential Revision: https://phab.mercurial-scm.org/D1209
2017-10-23 19:31:43 -07:00
Stanislau Hlebik
808ae58590 pushrebase: handle pushing phases through separate bundle2 part
In 272dd7d8a1bb1b2e93697b5b65183b08c8bf0853 upstream hg commit phase pushes
started to use separate bundle2 part. Because of that:
1) pushkey hook is not called when updating phases.
2) pushkey bundle2 part doesn't process phases anymore, 'phase-heads' part do
it instead.

It caused breakages in pushrebase. This diff fixes it.

Test Plan:
Run tests test-pushrebase*  and test-treemanifest*

Differential Revision: https://phab.mercurial-scm.org/D1204
2017-10-23 10:36:16 -07:00
Jun Wu
ef11eb995c test-pushrebase: add a test case about modifying copy source
This is what happened to D1048 and D1050. Pushrebase should ideally check
the copy source in additional to modified files and block the push.

Differential Revision: https://phab.mercurial-scm.org/D1172
2017-10-20 17:15:01 -07:00
Martijn Pieters
3044b639af phabricator: if no cert file has been specified, suppress the urllib3 warning
Differential Revision: https://phab.mercurial-scm.org/D1202
2017-10-20 18:27:43 +01:00
Martijn Pieters
6753dfa28e phabricator: use urllib3 to handle conduit HTTP
urlgrabber is not available on Windows machines; urllib3 is MIT licensed so can
safely be bundled.

Test Plan:
Run the tests, run hg ssl against a repository with valid arcanist config.

Differential Revision: https://phab.mercurial-scm.org/D1026
2017-10-18 11:47:16 +01:00
Saurabh Singh
3de34cd5f6 test-fbhistedit-graft: fix the test after removal of 'histeditng' config
Summary:
This is a new test which is broken due to D1118. Ideally, this would
have been fixed in D1118 itself but since it was introduced later, it has to be
fixed now.

Test Plan: Ran the test again.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D1171
2017-10-17 14:51:43 -07:00
Jun Wu
5b2261bcad test-infinitepush: allow database password to be empty
When mysql password is empty, we should not pass `-p` flag.
2017-10-17 13:05:18 -07:00
Jun Wu
602840105f test-p4fastimport-import: update with latest p4 output
It seems the output might be different:

```
   $ p4 files test.c
-  //depot/test.c#2 - edit change 4 (ktext)
+  //depot/test.c#2 - edit change 4 (text+k)
```
2017-10-17 13:05:18 -07:00
Jun Wu
145b5fd5d5 test-smartlog: only test template keywords exported by fb-hgext
`successorsset` is not from fb-hgext and should not affect the test output.
2017-10-17 13:05:18 -07:00
Jun Wu
090d0eb5b7 tests: update tests output
Upstream 4a405ffd8b20 ("transaction-summary: show the range of new revisions
upon pull/unbundle (BC)", 2017-10-12) has changed the output.
2017-10-17 13:05:18 -07:00
Saurabh Singh
73f2ea65a0 fbhistedit: removing the experimental config 'histeditng'
Summary:
The config 'histeditng' was removed in upstream recently and is
therefore, no longer required. This commit removes the config and fixes some
tests which were dependent on it.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D1118
2017-10-17 11:56:27 -07:00
Catherine Gasnier
796266c8c5 hg show --stat should not show patch
Summary: show extension: 'hg show --stat' should not show patch, just like 'git show --stat'
Test Plan: test-show.t
'hg show --stat' shoes diffstat, not patch
'hg show' shows patch, but no stat
Reviewers: rmcelroy,phillco
Subscribers: ianj
Tags:
Tasks: 22546204
Blame Revision:
2017-10-16 02:07:53 -07:00
Ryan McElroy
5e93d8bd89 obsshelve: register maxbackups config
Summary:
Renaming this config to `obsshelve.maxbackups` for now eliminates the overlap with the
`shelve.maxbackups` config and fixes the root problem that D995 was trying to solve.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D1054
2017-10-16 01:58:29 -07:00
Jun Wu
fedc57fd93 tests: remove uncommit tests
It should be removed with D751.
2017-10-13 14:57:59 -07:00
Jun Wu
87e672961e sparse: rename to fbsparse
This avoids conflict with the core extension (`hgext/sparse.py`). In
development mode, the `hgext` version takes precedence and people can easily
use the wrong sparse extension.

`sparse.py` is kept for compatibility.

Differential Revision: https://phab.mercurial-scm.org/D1048
2017-10-13 14:51:27 -07:00
Mark Thomas
f14cd2e5d5 infinitepush: always read local backup state from source shared repo
With shared working directories, infinitepush must always read the backup state
from the source repo.  Currently it does that for pushing backups, but not for
commands that just query the backup state.

Differential Revision: https://phab.mercurial-scm.org/D1052
2017-10-13 06:59:27 -07:00