Commit Graph

3499 Commits

Author SHA1 Message Date
Phil Cohen
bef53b0ff4 rage: include contents of packdirs
Example output:
```
shared packs (files):
---------------------------
/var/cache/hgcache/fbsource/packs:
total 64K
drwxrwsr-x. 2 phillco svnuser 36K Oct 26 14:09 manifests
...

shared packs (trees):
---------------------------
/var/cache/hgcache/fbsource/packs/manifests:
total 741M
-r--r--r--. 1 phillco svnuser 1.8K Oct  9 00:37 0a0d759b468bf3766b1596d133d7dcf5c55db702.dataidx
-r--r--r--. 1 phillco svnuser  77K Oct  9 00:37 0a0d759b468bf3766b1596d133d7dcf5c55db702.datapack
-r--r--r--. 1 phillco svnuser  33K Oct  9 12:54 0b233c54960ad32a75238334b18bdb8176b95dae.dataidx
-r--r--r--. 1 phillco svnuser 1.7M Oct  9 12:54 0b233c54960ad32a75238334b18bdb8176b95dae.datapack
-r--r--r--. 1 phillco svnuser  74K Oct  8 23:40 0b33a64b257bee2583ded9d38f13404f52a33670.dataidx
...

local packs (files):
---------------------------
/data/users/phillco/fbsource/.hg/store/packs/:
total 856K
drwxrwsr-x. 2 phillco svnuser 856K Oct 26 14:14 manifests


local packs (trees):
---------------------------
/data/users/phillco/fbsource/.hg/store/packs/manifests:
total 27M
-r--r--r--. 1 phillco svnuser 1.2K Oct  3 13:37 000004931915fa871abb373503d0e8656f543d59.dataidx
-r--r--r--. 1 phillco svnuser 4.4K Oct  3 13:37 000004931915fa871abb373503d0e8656f543d59.datapack
-r--r--r--. 1 phillco svnuser 1.2K Oct  3 13:34 0009e3182c6268d64a3c6d9cb79ba74a0f5e3fa2.dataidx
-r--r--r--. 1 phillco svnuser 3.1K Oct  3 13:34 0009e3182c6268d64a3c6d9cb79ba74a0f5e3fa2.datapack
...
```

Differential Revision: https://phab.mercurial-scm.org/D1261
2017-10-30 20:48:06 -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
Kyle Lippincott
8d138fe9ce basepack: do not keep fd open
Once `mmap` succeeded, it's no longer necessary to keep the underlying fd
open. Therefore just close them as an attempt to reduce file descriptors
opened by the process.

This is similar to 592c614a259f, but on the pure python side.
2017-10-25 17:02:48 -07:00
Mateusz Kwapich
0db7fe6449 crdump: fix the binary file dumping on windows
Summary:
Stupid bug corrupted files with extra \r on windows.

From python manual:



>On Windows, 'b' appended to the mode opens the file in binary mode, so there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a distinction between text and binary files; the end-of-line characters in text files are automatically altered slightly when data is read or written. This behind-the-scenes modification to file data is fine for ASCII text files, but it’ll corrupt binary data like that in JPEG or EXE files. Be very careful to use binary mode when reading and writing such files. On Unix, it doesn’t hurt to append a 'b' to the mode, so you can use it platform-independently for all binary files.


Test Plan: the crdump tests should now pass on windows as well (didn't actually run them on Windows because I don't really know how)

Reviewers: #mercurial, rmcelroy, ikostia, medson

Reviewed By: medson

Subscribers: mjpieters, medson

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

Tasks: T23027803

Signature: 6151931:1508964509:65806961cbde26884cd45def17767135ceeac05f
2017-10-25 13:59:24 -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
13b21a28eb configs: remove config defaults for registered configs 2017-10-24 17:54:02 -07:00
Stanislau Hlebik
be4f75067d infinitepush: fix tests
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 infinitepush, because phases handling is not skipped even during
infinitepush.  This diff fixes it.

Test Plan:
Run infinitepush tests

Differential Revision: https://phab.mercurial-scm.org/D1225
2017-10-24 09:33:41 -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
Durham Goode
7600b6f0d5 smartlog: fix wrapping of _show
Upstream has added a new parameter, so let's wrap it more generically.

Differential Revision: https://phab.mercurial-scm.org/D1207
2017-10-23 19:31:43 -07:00
Saurabh Singh
4285fc47b4 repack: fix the hg executable location for background repack
Summary:
The background repack uses the incorrect executable while running the
repack command due to which there are no logs for the background repack. This
commit fixes that by specifying the correct executable.

Test Plan:
  - Ran all the tests.

  - Tested the output of `util.hgexecutable()` with system hg and chg, and
    verified that it returns the correct path. As expected, `util.hgcmd()`
    returns the corresponding path for hg and chg in this case.

  - Did a `hg pull` on one of the repos and verified that it triggered a
    background incremental repack.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D1221
2017-10-23 16:50:46 -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
Stanislau Hlebik
1eebe223d0 tests: register some config options
Previously test-treemanifest-treeonly.t was hanging. Now it doesn't hang (but
still fails).

It obviously doesn't fix the real issue, but at least it doesn't make test
hang.

Test Plan:
Run test-treemanifest-treeonly.t

Differential Revision: https://phab.mercurial-scm.org/D1205
2017-10-23 10:07:38 -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
0c66c99dcd phabricator: pass in the cacerts file if configured
Some environments configure a separate certificate store, and SSL connections
can fail if the wrong store is auto-discovered or no store exists.

This makes the client tied to the specific certificates used, so update the
client cache to key on the ca_certs value passed in.

Differential Revision: https://phab.mercurial-scm.org/D1194
2017-10-19 14:03:48 +01:00
Martijn Pieters
01e88aa757 phabricator: use the timeout parameter when connecting
This was lost somewhere along the urlgrabber / urllib3 conversion path.

Differential Revision: https://phab.mercurial-scm.org/D1193
2017-10-19 14:03:48 +01:00
Martijn Pieters
8e1f6e378c phabricator: handle exceptions better
The error number is only present on *some* exceptions, and only on the wrapped
argument, like `SSLError()` wrapping a `IOError` exception.

Differential Revision: https://phab.mercurial-scm.org/D1192
2017-10-19 14:03:48 +01:00
Jun Wu
cd2f9f4715 cdatapack: do not keep fd open
Once `mmap` succeeded, it's no longer necessary to keep the underlying fd
open. Therefore just close them as an attempt to reduce file descriptors
opened by the process.

Thanks for spectral from Google for pointing out that fd could be closed.

Test Plan:
```
make clean local
rt test-cstore.t test-*pack*.t
```

Differential Revision: https://phab.mercurial-scm.org/D1185
2017-10-18 16:52:58 -07: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
06b664a1b9 edrecord: workaround configitem devel-warn 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
Jun Wu
7775848489 codemod: use pycompat.is* to check platforms
This solves check-code issues:

  fastmanifest/concurrency.py:144:
   > if platform.system() == 'Windows':
   don't use platform.system(), use pycompat
  hgext3rd/extutil.py:15:
   > if platform.system() == 'Windows':
   don't use platform.system(), use pycompat
  remotefilelog/basepack.py:44:
   > if pycompat.osname == 'posix':
   use pycompat.isposix
2017-10-17 13:05:18 -07:00
Jun Wu
b2e4e96574 treemanifest: workaround configitem devel-warn 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
Jun Wu
3a2db13cb1 fbsparse: reapply D1050 to the renamed file
D1050 got lost by landing D1048 via pushrebase, because pushrebase does not
check the source of copied files.

The graph looks like:

  o  D1048 sparse: rename to fbsparse  (after pushrebase)
  o  D1050 mbthomas sparse: fix for upstreamed path conflicts changes
  | x  D1048 sparse: rename to fbsparse  (before pushrebase)
  |/
  o
  |
  ~
2017-10-16 17:53:16 -07:00
Pulkit Goyal
4b12e3fa7c fold: use scmutil.cleanupnodes()
Differential Revision: https://phab.mercurial-scm.org/D1039
2017-10-17 03:56:15 +05:30
Pulkit Goyal
9e5aa0d659 tweakdefaults: add capability to skip some commands in cleanupnodes wrapper
The goal to show hash changes is to add support for json output printing full
hashes to increase support for automation and Nuclide. To achieve the goal in
best and clean way, we must use formatter. So support of using formatter and
having json output for commands will be added to commands. Since for those
commands we don't need this wrapper, lets add a functionality to skip the
wrapper for some commands.

We need to update the set introduced in this patch for each command we add
support to show hash changes.

Differential Revision: https://phab.mercurial-scm.org/D1038
2017-10-17 03:56:15 +05:30
Adam Simpkins
e00022c00d phrevset: fix code that was returning commit strings
Summary:
Fix another code path in phrevset that could incorrectly return commit strings
instead of rev numbers.

Test Plan:
Manually tweaked phrevset to force it to hit this code path (to ensure it would
not find the commit from the local log walk first), and confirmed it now
returned a rev ID instead of commit strings.

Reviewers: #fbhgext, quark, durham

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D684
2017-10-16 12:55:16 -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
Mark Thomas
2908eadaa8 conflictinfo: handle path conflicts
Upstream recently added path conflicts as a concept.  Update the
conflictinfo extension to understand and show path conflicts.

Path conflicts are different to other kinds of conflicts, so appear
in a separate list in the form:

    "pathconflicts:" [{
        "path": "path/to/directory",
        "fileorigin": "local",   # or "remote"
        "renamedto": "path/to/renamedfile"
    }]

Differential Revision: https://phab.mercurial-scm.org/D1051
2017-10-13 06:59:27 -07:00
Mark Thomas
fc656972e0 sparse: fix for upstreamed path conflicts changes
Differential Revision: https://phab.mercurial-scm.org/D1050
2017-10-13 06:59:27 -07:00
Mark Thomas
b5903c56c2 fbhistedit: add graft histedit action
Add a new `histedit` verb: `graft`.  This allows grafting (copying) of
changesets from outside of the history that is being edited, using the
node hash of the other changeset.

The other changeset is left intact - its contents are duplicated in a new
changeset.

The other changeset must not be one of the changesets that are being
edited as part of the histedit.

Differential Revision: https://phab.mercurial-scm.org/D1025
2017-10-13 04:05:55 -07:00
Jun Wu
78fd12a098 remotefilelog: ignore EEXIST error of mkdir
This fixes a race-condition reported by Steaphan Greene.

Differential Revision: https://phab.mercurial-scm.org/D984
2017-10-12 23:50:48 -07:00
Pulkit Goyal
7e0360a6af uncommit: drop the extension from fb-hgext as it was moved to core
This patch drops the uncommit extensions which has been moved to core. The
in-core extension does not allow bare `hg uncommit` on dirty working directory.
One need to set `experimental.uncommitondirtywdir = True` to do `hg uncommit` on
dirty working directory.

So this patch also set the required config to True in tweakdeafults.py to
maintain the behaviour.

Differential Revision: https://phab.mercurial-scm.org/D751
2017-10-13 12:15:20 +05:30
Adam Simpkins
db0d906e58 sparse: don't crash in non-sparse repositories
Summary:
Update the workingfilectxdata() to check that this is actually a sparse
repository before trying to call repo.sparsematch()

Test Plan: Update the test to confirm that "hg diff" works instead of crashes now.

Reviewers: #fbhgext, mbthomas

Reviewed By: #fbhgext, mbthomas

Differential Revision: https://phab.mercurial-scm.org/D1023
2017-10-12 14:08:50 -07:00
Adam Simpkins
04525b995f sparse: add a test where sparse gets loaded in an non-sparse repository
Summary:
Add a test to make sure the sparse extension works with non-sparse
repositories.  The share extension can cause the sparse extension to be loaded
even if the current working directory is not sparse.

Currently "hg diff" crashes in this scenario.  After the changes in D788, it
now tries to run `repo.sparsematch()` without first checking to see if the
repository is actually a sparse repository.

Test Plan: Ran it.

Reviewers: #fbhgext, mbthomas

Reviewed By: #fbhgext, mbthomas

Differential Revision: https://phab.mercurial-scm.org/D1022
2017-10-12 14:08:50 -07:00