Commit Graph

13630 Commits

Author SHA1 Message Date
Jun Wu
54d5d24c00 test-convert-svn-branches: rewrite parts related to named branch
Summary:
Change the test to test extras instead of branches so it could still work
once `hg branches` gets removed.

Reviewed By: phillco

Differential Revision: D13934439

fbshipit-source-id: 60860936f60e177e12547345cbbd7591b1161a6f
2019-02-06 14:43:37 -08:00
Jun Wu
8a72b3e097 test-convert-svn-move: rewrite part related to named branch
Summary:
Change the test to test extras instead of branches so it could still work
once `hg branches` gets removed.

Reviewed By: phillco

Differential Revision: D13934445

fbshipit-source-id: e15c5b652481fcf95df851cdda8998764a98660c
2019-02-06 14:43:37 -08:00
Jun Wu
c54158e546 test-convert: remove part related to named branch
Summary: Named branch is going away globally.

Reviewed By: phillco

Differential Revision: D13934441

fbshipit-source-id: 74802d7bc118b8a379a9fde3b7ac74dfc4627cac
2019-02-06 14:43:37 -08:00
Jun Wu
a6a3bea200 test-fb-hgext-tweakdefaults: remove part related to named branch
Summary: Named branch is going away globally.

Reviewed By: phillco

Differential Revision: D13934434

fbshipit-source-id: c66f3370c09967d152524148f5ba403a7cecd928
2019-02-06 14:43:37 -08:00
Jun Wu
d0ec549a08 test-fb-hgext-treemanifest-treeonly-copyamend: stabilize the test
Summary:
Not sure why it's unstable. But the fetch stat gets printed sometimes. Add it
as an optional line.

Reviewed By: phillco

Differential Revision: D13934444

fbshipit-source-id: 3c39737fe95b1572ffcf672a7d8d431218202402
2019-02-06 14:43:37 -08:00
Jun Wu
515d86cdd7 test-issue842: remove the test
Summary:
The test was about warning of "heads". We allow multiple heads and have already
disabled some checkheads code paths (ex. D8148016). With commit cloud multiple
heads are a norm and not something that should be warned.

Reviewed By: phillco, singhsrb

Differential Revision: D13934438

fbshipit-source-id: e2e4971e05c5e0ca3ed4a5160c16d90f4f847e5f
2019-02-06 14:43:37 -08:00
Jun Wu
3febfb99dc test-issue619: remove the test
Summary:
The test was testing "fast-forward" merge, like:

  b
  |
  a (working copy, run "hg merge b && hg ci -m merge")

It's a no-op without branches. But if "a" and "b" have different branches, the
merge would do something and create a merge commit.

Without named branches, fast-forward merge would always be a no-op. Therefore
remove the test.

Reviewed By: phillco, singhsrb

Differential Revision: D13910539

fbshipit-source-id: 9f5a7817a3ff012d429810da3d54ab2174371bd0
2019-02-06 14:43:37 -08:00
Jun Wu
f48c2ace51 test-histedit-outgoing: drop branch related test cases
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco

Differential Revision: D13910540

fbshipit-source-id: 9d9c778afcb585197134adfa173103e81ae9ddcd
2019-02-06 14:43:37 -08:00
Jun Wu
15fd077a20 test-histedit-commute: avoid using branches
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco

Differential Revision: D13909733

fbshipit-source-id: 38c0dd487fa0756413d21de2990e76c5a6d321f7
2019-02-06 14:43:37 -08:00
Jun Wu
82116cc8ef test-verify: avoid using branches
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco

Differential Revision: D13910538

fbshipit-source-id: 971484beb7788d827892da958873f455b1ee34a3
2019-02-06 14:43:37 -08:00
Jun Wu
518db59b95 test-bundle: avoid using branches
Summary: Branches will be disabled. Remove usage of them.

Reviewed By: phillco, singhsrb

Differential Revision: D13909728

fbshipit-source-id: 2a4ae06f012e79979f6bebc285e841a88d5dc3a1
2019-02-06 14:43:37 -08:00
Aida Getoeva
996ac6da37 prefetch: add requestpacks
Summary: Implemented logic for fetching data from the scmmemcache and the server in pack files format. By default `prefetch` will still use loose files, unless the `remotefilelog.fetchpacks` config flag will be set to true.

Differential Revision: D13905733

fbshipit-source-id: cc559f5bc600067199a91efe6cf44b1bde6bf69b
2019-02-06 10:43:15 -08:00
Durham Goode
163704f80a disablesymlinks: add extension to disable symlinks
Summary:
In some cases we are mounting ntfs in a linux host using ntfs.3g and we
want to prevent it from writing symlinks that can't be read from Windows.

Some background, ntfs.3g supports symlinks, but it produces IntxLNK which cause
problems when mounted into a real Windows machine. We don't support symlinks on
Windows anyway, so we want to just disable this. Unfortunately it's difficult to
detect if we're on a ntfs.3g fuse mount, so instead we're just going to have the
machine set up the repo with this extension enabled.

Differential Revision: D13964546

fbshipit-source-id: 7545538e51be4c986a50161165d7cc2e64280555
2019-02-06 08:41:34 -08:00
Jun Wu
eaebf8d02d commands: drop unnecessary "config(..., default=...)"
Summary:
The default value is specified in configitems.py. Remove the `default`
argument.

Reviewed By: phillco

Differential Revision: D13909730

fbshipit-source-id: ca45c63be7d48e04e71a6f5b3b682f625a3030f6
2019-02-05 20:36:03 -08:00
Jun Wu
50932456ad tests: drop experimental.single-head-per-branch feature
Summary:
This reverts the upstream changeset:

  changeset:   66ecde8a704d9fa92bd99720923524c4bd3f315b
  user:        Boris Feld <boris.feld@octobus.net>
  date:        Wed, 15 Nov 2017 18:52:42 -0800
  summary:     server: introduce a 'experimental.single-head-per-branch' option

Named branches are going to be removed. Remove experimental dependent feature.

Reviewed By: phillco

Differential Revision: D13909727

fbshipit-source-id: 3baf101e5a038b58bc01506826b631a2a58a7782
2019-02-05 20:36:03 -08:00
Jun Wu
57079875b1 tests: remove tests mainly related to named branches
Summary: Named branches are going to be removed. Remove directly related tests.

Reviewed By: phillco

Differential Revision: D13909726

fbshipit-source-id: 6f7f39b4129bb5840a90501ef251b3f5971c82fe
2019-02-05 20:36:03 -08:00
Jun Wu
f8f8e3962a status: add a way to log more details about why hg thinks a file was modified
Summary:
We're seeing issues where a file show up as "M" while it isn't expected so. When
running "hg status" again, the file disappeared. Existing logs suggest that
watchman does not think anything has changed between the two "status" commands.
Therefore add more logs of the internals to try to get more insights.

Differential Revision: D13954209

fbshipit-source-id: 0b89a6da5e8702e707440ef2e1823eb4968c10be
2019-02-05 19:41:35 -08:00
Durham Goode
3309a8090a pushrebase: read the manifest before looping through files
Summary:
pushrebase has logic that loops through all the files and builds a list
of what has changed. Unfortunately, Mercurial has some optimizations where if
the manifest isn't loaded already, it tries to only load the manifest delta, and
checks if this might be a good idea by first checking if the file is in the
commit metadata file list. The commit metadata is a list, which makes it a O(n)
scan to check containment. Since we do this for every file, it becomes O(n^2).

To avoid this, let's just make sure the actual manifest is loaded.

Once every repo is a tree repo, we can get rid of the manifest delta
optimization and get rid of the need to prefetch here.

Reviewed By: singhsrb

Differential Revision: D13944829

fbshipit-source-id: c0f33ca650b7956a1f39e961c94678a6f7f380b6
2019-02-05 16:05:50 -08:00
Durham Goode
f3a5d55c2b changelog: cache commit files list
Summary:
During pushrebase there is code that says 'for each file, do some work
that involves listing the changed files'. Because we reparse the list each time,
this becomes n^2 behavior. Let's cache the list to avoid this.

Reviewed By: singhsrb

Differential Revision: D13944830

fbshipit-source-id: 4fd0dbf26b6cee9d0c01879cafb9837262f7afa0
2019-02-05 15:52:00 -08:00
Stanislau Hlebik
ff74d1cc82 remotefilelog: add an option to verify all the hashes
Reviewed By: DurhamG

Differential Revision: D13838772

fbshipit-source-id: e7220ba8a0e07f3003693199086e3a3512023857
2019-02-05 15:03:24 -08:00
Fatih Aydin
64bd91b7f4 commands: add option to disable the outgoing command
Summary: Extend the option to disable `incoming` to also disable `outgoing`.

Reviewed By: markbt

Differential Revision: D13877971

fbshipit-source-id: c4f994d536dda5db7c0e9f14656be48fc757c237
2019-02-04 14:25:27 -08:00
Fatih Aydin
7e7faeea81 commands: add option to disable the incoming command
Summary: In repositories which change quickly, the incoming and outgoing commands aren't useful.  Add an option to disable these commands.

Reviewed By: markbt

Differential Revision: D13859604

fbshipit-source-id: c4784b7eafbe3c4a6cf03686f1431204089b0155
2019-02-04 07:09:37 -08:00
Mark Thomas
b44e2103d7 simplecache: don't use memcache in tests
Summary:
The simplecache test attempts to connect to a memcache instance on localhost.
This means the test fails if a memcache instance is not available.

Remove the use of memcache in the test.  We still test local files, and assume
that memcache itself works.

Also corrupt the correct key when testing corruption handling, and document the
config options.

Reviewed By: quark-zju

Differential Revision: D13818471

fbshipit-source-id: 6ca7f575aa813f95773144be5337796f029ffd90
2019-02-01 19:19:36 -08:00
Mark Thomas
ae0a81f2c2 rust: move bindings to a single python extension
Summary:
Move all Rust bindings to a single python extension, `bindings`.  This should
improve compilation time and make things simpler.

Reviewed By: quark-zju

Differential Revision: D13923866

fbshipit-source-id: 560592b5a6c0c4f1b836c755ef123666a1059164
2019-02-01 17:53:22 -08:00
Mark Thomas
87ba57b104 doctest: use new package path
Reviewed By: DurhamG, ikostia

Differential Revision: D13932057

fbshipit-source-id: 3b7cb640c7c510bd60ee2a3d1de737743686878b
2019-02-01 17:53:22 -08:00
Saurabh Singh
1752853929 commit: remove option to specify secret phase
Summary:
We will probably not be supporting secret phase in the future anyway
so lets get rid of it.

Reviewed By: quark-zju

Differential Revision: D13928907

fbshipit-source-id: 7edcd84d2ee3c37124dcf9d3ba92c0610d074157
2019-02-01 15:36:44 -08:00
Stanislau Hlebik
6adfda0e99 pushrebase: move selecting commit date in a separate file
Summary:
Add an option that let's us specify the date of each commit in a pushrebase.
It should be specified via a config option, which accepts a name of a file in
which json dictionary should be stored. Key of this dictionary is a commit hash, value
is a date.

Reviewed By: ikostia

Differential Revision: D13803174

fbshipit-source-id: 6271c18c61399b89c92dce7a4fe63c8fae8dae7c
2019-02-01 09:42:57 -08:00
Durham Goode
f176bf5b5f tests: fix p4fastimport tests
Summary:
The rename to edenscm broke the test.

(Note: this ignores all push blocking failures!)

Reviewed By: phillco, ikostia

Differential Revision: D13900989

fbshipit-source-id: ad04fcb6889a273bb39901b2288ae1aef74531a6
2019-01-31 11:35:24 -08:00
Liubov Dmitrieva
aadd79c27f Back out "Back out "[mercurial] enable modern way to transport phases on client side""
Summary:
Original commit changeset: 1cdd43658889

Trying to enable this again.

The details are in the original diff: D13622994

Reviewed By: quark-zju

Differential Revision: D13801916

fbshipit-source-id: a7a1aee6faa0d1db7535dfd3cfab523829c62900
2019-01-29 21:47:11 -08:00
Jun Wu
9dc21f8d0b codemod: import from the edenscm package
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.

Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.

Reviewed By: phillco

Differential Revision: D13868981

fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
2019-01-29 17:25:32 -08:00
Kostia Balytskyi
401eff3cda bundle2: fix debugging output for input parts
Reviewed By: quark-zju

Differential Revision: D13819208

fbshipit-source-id: 373d9669395a08f46e5801f822486ba2f10fd36b
2019-01-28 21:47:17 -08:00
Jun Wu
c12e300bb8 codemod: move Python packages to edenscm
Summary:
Move top-level Python packages `mercurial`, `hgext` and `hgdemandimport` to
a new top-level package `edenscm`. This allows the Python packages provided by
the upstream Mercurial to be installed side-by-side.

To maintain compatibility, `edenscm/` gets added to `sys.path` in
`mercurial/__init__.py`.

Reviewed By: phillco, ikostia

Differential Revision: D13853115

fbshipit-source-id: b296b0673dc54c61ef6a591ebc687057ff53b22e
2019-01-28 18:35:41 -08:00
Xavier Deguillard
5485ecc185 revisionstore: proper permissions for pack files
Summary:
The tempfile rust crates opens the file with RW permissions for the user only,
but once written out to disk, the permissions needs to be readable by everyone.
Unfortunately, rust doesn't have a portable way of doing this, so we have to
resort to using `if cfg!(unix)` conditions for doing this.

Reviewed By: DurhamG

Differential Revision: D13703406

fbshipit-source-id: 688bc679b5c1a7943ceab723c1f649d555b61a7a
2019-01-25 09:42:39 -08:00
Xavier Deguillard
1538e82829 remotefilelog: use python's repack logic for loosefiles
Summary:
Loosefiles are still being fetched from memcache, and thus until we switch
memcache to provide pack files, repack needs to be able to handle loosefiles.
We could either implement the loosefile repack logic in rust, or we could just
let the python code do it. Since we plan on having memcache serve pack files
soon, the second approach is prefered as it result in the least amount of work.

Reviewed By: DurhamG

Differential Revision: D13707886

fbshipit-source-id: 5373b61f9749c158e6dfb026f6b12a7dd2a67802
2019-01-24 16:02:22 -08:00
Mark Thomas
ddecddf074 commitcloud: improve specification of workspace names
Summary:
Replace the `-w` option of the commit cloud commands that process workspace
names with general options of the form:

 * `-u` or `--user` - to select the workspaces of a particular user.
 * `-w` or `--workspace` - to select a particular workspace for that user.

A (hidden) `--raw-workspace` option is provided to allow use a workspace
by its exact name, should that be needed.

The `-w` option still accepts full user workspaces, but shows a warning.

These options apply uniformly to any command that takes a workspace.

Reviewed By: liubov-dmitrieva

Differential Revision: D13730839

fbshipit-source-id: d1b884b100caf909619511db4861eb1b880a0d3e
2019-01-21 03:33:31 -08:00
Mark Thomas
c4a1a1bae4 commitcloud: exclude omitted heads from infinitepush backup state
Summary:
Commit cloud maintains the infinitepush backup state to match what it has
synced to commit cloud.  It should only include locally backed-up heads.
When syncing with the server and omitting some heads, don't include the omitted
ones.

Reviewed By: liubov-dmitrieva

Differential Revision: D13719477

fbshipit-source-id: 817c1a73a34af6b5550f6254e2b08d01283760a5
2019-01-17 16:31:21 -08:00
Durham Goode
5a3d8f24e7 lfs: fix copy metadata in pack files during lfs moves
Summary:
We should not be attaching copy headers to lfs metadata blobs since
they store the data separately. All this logic was a little overly complicated.
The file text we receive should be passed through unmodified in all cases except
when storing in the loose file format, which needs to strip the copy metadata
from the blob.

Reviewed By: ikostia

Differential Revision: D13703708

fbshipit-source-id: d7e4eb703599d2355009efe070833013d1fcd4fc
2019-01-17 04:30:31 -08:00
Durham Goode
3293cc8526 lfs: add test demonstrating local data corruption for lfs moves
Summary:
Enabling packlocaldata is causing local move data contents to be
corrupted by the copy header being tacked on the front. Let's add a test
demonstrating the failure.

Reviewed By: ikostia

Differential Revision: D13703709

fbshipit-source-id: d891042a5cab639a4533a89a508865115c482ba1
2019-01-17 04:30:31 -08:00
Wez Furlong
f517200115 hg: add eden import helper debug command
Summary:
In our linux deployments it was relatively straightforward
to import the mercurial runtime from a python process running the
system python executable.   Our macOS deployments are a lot more
complex because they do not use the system python and do not install
the mercurial python packages in the python path of the target
python executable.

It is simpler to move the import helper functional into a mercurial
command that we can invoke instead of our own helper program.

This diff moves the script to be a debug command and adjusts its
argument parsing to match the mercurial dispatcher requirements.

There are some stylistic mismatches between this code and the
rest of mercurial; I'm suggesting that we ignore those as the
medium term solution is that this command is replaced by eden
directly consuming the rust config parsing code and by native
rust code to perform the data fetching that we need.

Reviewed By: pkaush

Differential Revision: D13522225

fbshipit-source-id: 28d751c5de4228491924df4df88ab382cfbf146a
2019-01-16 19:49:27 -08:00
Xavier Deguillard
33688947c6 revisionstore: sort pack files in list_packs
Summary:
Directory listing is different in every OS, and due to the current repack
implementation, this directly affect the order in which the packfiles are added
to the new one. Since the resulting packfile name depends on the hash of its
content, the name was influenced by the directory order.

By sorting the files in list_packs, the packfile name will be independent of
the directory listing and thus be the same for all the OSes.

Reviewed By: singhsrb

Differential Revision: D13700935

fbshipit-source-id: 01e055a0c1bcf7fb2dc4faf614dfb20cd4499017
2019-01-16 15:18:24 -08:00
Wez Furlong
30058f0170 eden: port the Eden hg extension to core Mercurial
Summary:
This ports the logic from `eden/hg/eden/` to `scm/hg/mercurial/`.
Note this does not delete the logic from `eden/hg/eden` as part of this
change because we may continue to do Eden releases before we roll out a
version of Hg with this code. Only once Hg has been rolled out everywhere
[that is using Eden] can we consider removing
`/usr/local/fb-mercurial/eden/hgext3rd/eden`.

Reviewed By: quark-zju

Differential Revision: D10316761

fbshipit-source-id: cae1dfad831ad6505590628cf969897167e84b30
2019-01-16 14:37:48 -08:00
Mark Thomas
a4b964e12c crdump: correctly encode fields
Summary:
The user, description, and bookmarks must be converted from the local encoding
before they can be included in the JSON object, as JSON can only contain UTF-8
strings.

Note that `crdump` will not work with filenames that are not UTF-8 encoded.
This doesn't fix that.

Reviewed By: HarveyHunt

Differential Revision: D13635999

fbshipit-source-id: 5379656e39b73d7d7f905d06de50851f17c54e8b
2019-01-16 10:58:35 -08:00
Xavier Deguillard
87cf0f533b revisionstore: Add a basic rust incremental repack.
Summary: For now, combine all files smaller than 100MB that accumulate to less than 4GB.

Reviewed By: DurhamG

Differential Revision: D13603760

fbshipit-source-id: 3fa74f1ced3d3ccd463af8f187ef5e0254e1820b
2019-01-16 09:47:09 -08:00
Mark Thomas
c6c99b4777 configparser: update pest to 2.1.0
Summary:
Update pest to 2.1.0.

This version has a new behaviour for parser error messages: the line feed at
the end of the line is shown in the error output.

Reviewed By: wez

Differential Revision: D13671099

fbshipit-source-id: b8d1142a44a56a0b21b3b72cf027f3f8a30f421e
2019-01-16 03:52:09 -08:00
Xavier Deguillard
f88c807aad remotefilelog: repack can now call the rust implementation
Summary: In D13363853, a basic rust based repack was implemented, but couldn't be called from Python. For now, this version will be called when the repack.userust config is set, and when requesting a pack-only repack, as the rust version doesn't support loose objects (?).

Reviewed By: DurhamG

Differential Revision: D13555855

fbshipit-source-id: 83d53b33f2d3b6ae3167801d0594cd1490a0a09d
2019-01-15 17:02:38 -08:00
Saurabh Singh
3649a1fbef repack: fix test by using compatible flag in touch command
Summary:
D13646642 used the `--date` flag for the `touch` command which
unfortunately does not work on our prod OSX hosts. Therefore, lets switch to
the more compatible `-t` flag.

Reviewed By: DurhamG

Differential Revision: D13673021

fbshipit-source-id: 6f9e0234e7fd3d4c345bedecdd2197949d71c420
2019-01-15 09:47:17 -08:00
Maksim Solovjov
a42978939e Add exclude functionality to dirsync
Reviewed By: DurhamG

Differential Revision: D13607512

fbshipit-source-id: 80d48eab8fb49d209f856dd82ba084bf2c059150
2019-01-15 07:14:23 -08:00
Mark Thomas
9d6b58b5cd localrepo: add automigrate mechanism
Summary:
Generalise the `migrateonpull` mechanism of `treestate` into a generic
`automigrate` step that is invoked at the start of pulling.  This will be used
for other migrations in the future.

Reviewed By: liubov-dmitrieva

Differential Revision: D13608718

fbshipit-source-id: d558dc21176a6b8d786836d06414e3fc88a20d47
2019-01-15 07:05:46 -08:00
Xavier Deguillard
678fd5c0fe remotefilelog: Remove old temporary files.
Summary:
We've observed some users with very large hgcache directories that were filled
with temporary pack files that for some reasons were not removed/renamed on a
previous repack.

These files can appear due to a variety of reasons, such as forcibly killing
hg, or a host power-off, or simply due to a bug in mercurial. It is likely that
the later case is what causes some of the hgcache directories to grow and this
patch doesn't attempt on finding the underlying mercurial issue. Rather, let's
alleviate the issue by simply removing the temporary files older than 24h.

Reviewed By: ikostia

Differential Revision: D13646642

fbshipit-source-id: faa0605e322d440a75187e2517cbbcb13031dae0
2019-01-14 14:56:54 -08:00
Aida Getoeva
7046f81a00 bisect -c: fix empty changeset after sparse skip
Summary: If the there is no changeset left after sparse skip in `--command` mode, show the result and return, as it's done in manual testing mode.

Reviewed By: markbt

Differential Revision: D13650568

fbshipit-source-id: 8e867a38858d84d9a10078b74e2087318c81b01e
2019-01-14 11:55:11 -08:00