Commit Graph

47306 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
a045d9538d backingstore: add backingstore struct
Summary:
This diff adds a new crate `backingstore` that is responsible to help Eden to read data from hgcache.

This diff only implements the initialization logic where it loads the path from hg's configuration files. This diff also contains a struct `CFallible` to help us handling errors from Rust in C++.

Reviewed By: xavierd

Differential Revision: D17593226

fbshipit-source-id: 3dfa8b2b13553cf49ecadd2a589f0ce2e25524b5
2019-10-19 18:48:43 -07:00
Zeyi (Rice) Fan
4bf54d3d37 backingstore: introduce CFallible to handle errors from Rust
Summary:
This diff adds a Rust `repr(C)` struct to pass any errors raised in the Rust
code. So the C++ code can handle these errors.

Reviewed By: chadaustin

Differential Revision: D17859953

fbshipit-source-id: 246a913e558b40980c63f62d06961d3dea5c55ef
2019-10-19 18:48:43 -07:00
Zeyi (Rice) Fan
b5360562b6 easy: [hg] backingstore: add crate
Summary: This commit adds the basic required files for a new crate.

Reviewed By: xavierd

Differential Revision: D17859046

fbshipit-source-id: 3b8ab7fb603114597e037bd5ef1efeb57cd7f86b
2019-10-19 18:48:42 -07:00
Stefan Filip
2621d7dfc4 types: rename Node to HgId
Summary:
`Node` is a name that is overloaded. It means that in our conversations
we always have to constantly define which Node we are talking about.
Is it the type in Mercurial or the generic term in graphs/trees.

It is just an identifier so we rename it such.

Note that this doesn't remove the Node term yet. I will take care of the
longtail of uses incrementally.

Things that are not renamed:
* linknode
* nodeinfo
* WireHistoryEntry
* cdatapack

Reviewed By: quark-zju

Differential Revision: D18010149

fbshipit-source-id: 83b3911e231e4544848391cd3deb6e44ec2b809d
2019-10-18 18:13:31 -07:00
Jun Wu
e925225f16 tweakdefaults: remove op-aware wrapping
Summary:
The operation-aware feature is in core. It does not need extra wrapper.

This change was made because the following code will break by function
wrappers:

    origargs = inspect.getargspec(origcmd)
    try:
        repo_index = origargs.args.index("repo")
        ...

Reviewed By: ikostia

Differential Revision: D17972044

fbshipit-source-id: 863fd2bb37c677d4c7de8955538da551084eeb14
2019-10-18 14:50:26 -07:00
Jun Wu
12e114359b test-export: stablize the test
Summary:
Depending on Python random seed, this test might fail with:

  --- test-export-t.py:251 (expected)
  +++ test-export-t.py:251 (actual)
  @@ -1 +1,2 @@
  -
  +abort: foo/1: both added and removed
  +[255]

Fix it by avoiding "rename".

Reviewed By: xavierd

Differential Revision: D18001839

fbshipit-source-id: efde3d9b6734a84a00a46cb00bbf493d64a460b2
2019-10-18 13:29:31 -07:00
Puneet Kaushik
a5e17d48b7 Fetch the eden root and socket path from config
Summary: Eden on Windows store it's socket path in a toml file instead of using symlinks. This diff will fetch the contents from the toml file and populate the root and symlink.

Reviewed By: fanzeyi

Differential Revision: D17912859

fbshipit-source-id: 46d7a7e39ca4d65df55cb6dc7a3d396c82182b32
2019-10-18 12:39:04 -07:00
Jun Wu
e1808b45e6 rage: try to make "sl (unfiltered)" section shorter
Summary:
The "sl (unfiltered)" section can be very long. To make it less noisy, let's
only show commits that are predecessors of the current visible draft. This
removes commits that are landed (and became hidden), and is more friendly
in the narrow-heads=true world.

Reviewed By: singhsrb

Differential Revision: D18000596

fbshipit-source-id: e7ed773fee10c5dc26b810356dd3d25e61da522b
2019-10-18 07:52:27 -07:00
Jun Wu
6a80791e72 rage: remove noise from "local config" section
Summary:
`/default.d/` configs were moved to hard-coded `<builtin>` config string in
D15307750. Change logic in `rage` so we don't list `<builtin>` configs as
"local config".

Reviewed By: singhsrb

Differential Revision: D18000595

fbshipit-source-id: b3ff0bce6dbb3fae442dc07d7453fa63bc624f7b
2019-10-18 07:52:26 -07:00
Jun Wu
18008a9576 rage: remove fsmonitor state section
Summary:
The fsmonitor state section does not work with treestate or edenfs. Replace it
with `debugtree` and `debugstatus` that works with treestate.

Reviewed By: singhsrb

Differential Revision: D18000597

fbshipit-source-id: 4a4e7434f9d340bd3b44f9a8d19b66ed7b6fa3a6
2019-10-18 07:52:26 -07:00
Jun Wu
9df16613b2 cmdutil: fix commit -i -M . -e
Summary:
Right now `commit -i -M rev -e` crashes saying --reuse-message conflicts with
--message. That seems to be caused by `logmessage` being called twice.

Fix it by setting `reuse_message` to False if its side-effect (setting
`message`) is done.

Reviewed By: singhsrb

Differential Revision: D18000594

fbshipit-source-id: 96a3078fc1d66a6786caa709a935e093eaa469ea
2019-10-18 07:52:26 -07:00
Wez Furlong
b1f52df121 hg grep: fix util.pathto parameter order in biggrep integration
Summary:
we were not producing the correct filter expression when
invoking biggrep, which resulted in incorrect (no!) output.

The `normpath` is needed because `util.pathto` can produce paths like `../../.`
which biggrep doesn't like.

Reviewed By: quark-zju

Differential Revision: D17950451

fbshipit-source-id: 6c29c32b6b4b293fbec820fd76dea51adbefca4e
2019-10-18 04:31:47 -07:00
Wez Furlong
ea7dff0318 hg grep: remove svnmeta stuff from biggrep integration
Summary:
Now that svn is no longer part of our infra, we don't
need this bit, and it simplifies things in a later diff.

Reviewed By: singhsrb

Differential Revision: D17933129

fbshipit-source-id: 6bf7a58e2d0e77c7f4621d85d5947b592eccb678
2019-10-18 04:31:46 -07:00
Durham Goode
02f0092268 filesystem: fix callsite to _ischanged
Summary: The `_ischanged` function takes 3 parameters.  This was introduced due to a mis-merge between two of my other commits that landed, and for some reason CI didn't block the land.

Reviewed By: singhsrb

Differential Revision: D17987996

fbshipit-source-id: ff6f766dbe4b7dc91f16182d6c75e5532a4f6e3c
2019-10-17 15:30:02 -07:00
Jun Wu
424b62941d testutil: use multi-line diff if either actual or expected is multi-line
Summary:
The old code only use multi-line diff if "expected" is multi-line.
That can sometimes show a multi-line message in a single line, which is
unreadable.

Improve it by using multi-line diff if either side is multi-line.

Reviewed By: sfilipco

Differential Revision: D17987723

fbshipit-source-id: a04c13d09d463c1397f45ec34682ef1da75889af
2019-10-17 13:55:26 -07:00
Jun Wu
7697be1e32 diff: add an option to ignore copy/renames with deselected sources
Summary:
This makes it possible to `hg export` a subset of the history that can be
imported into another repo. See added tests for an example.

Reviewed By: sfilipco

Differential Revision: D17966341

fbshipit-source-id: a68c3fe8d43c6790eb3667fd43a80a7247358c7d
2019-10-17 13:53:10 -07:00
Jun Wu
8c0bff1054 export: support pattern matching
Summary: This makes it possible to export a subset of file changes.

Reviewed By: sfilipco

Differential Revision: D17963550

fbshipit-source-id: 0641bdab253a51c0e36a973dc22b662739af8eb6
2019-10-17 13:53:10 -07:00
Jun Wu
dfd2285def tests: fix test-export-t.py
Summary: The test now completes in 1 second, down from 9 seconds.

Reviewed By: sfilipco

Differential Revision: D17963549

fbshipit-source-id: 5cfae80dd1e4165c015c6fc5a04cec98bc71cbad
2019-10-17 13:53:10 -07:00
Jun Wu
beb5699d39 tests: auto translate "test-export.t"
Summary:
This is done by running:

  ./translate "test-export.t"

Reviewed By: sfilipco

Differential Revision: D17963548

fbshipit-source-id: 11f997abb375d70e0d6f1a4cdb5d78422b11482f
2019-10-17 13:53:09 -07:00
Xavier Deguillard
7014e34633 amend: fix unamend with no predecessors
Summary:
When mutation is enabled, and no precessors exists, the predecessors can be
None, leading to hg crashing due to:
  TypeError: object of type 'NoneType' has no len()

Reported by sas: P118684245

Reviewed By: quark-zju

Differential Revision: D17960775

fbshipit-source-id: 05488dbc52edbc32c323612ea86fe9e94076a126
2019-10-17 09:02:42 -07:00
Xavier Deguillard
2cd333f0f7 remotefilelog: remove low-level getancestors
Summary:
The getancestors is handled by the metadatastore via the getnodeinfo method,
thus the lower level stores don't need to implement it.

Reviewed By: quark-zju

Differential Revision: D17946853

fbshipit-source-id: b516fdad15c96882f1898eb2e94b6ddff353d2bf
2019-10-17 08:57:36 -07:00
Xavier Deguillard
b5b835c87c remotefilelog: use getnodeinfo in getancestors
Summary:
The store.getancestors is really just a wrapper over getnodeinfo, let's just
use getnodeinfo instead, which would allow us to remove the getancestors from
all the store code.

Reviewed By: quark-zju

Differential Revision: D17946854

fbshipit-source-id: 4cf6b607464f42d573a5911e3975bdd388592c75
2019-10-17 08:57:35 -07:00
Arun Kulshreshtha
3e52c2114a manifest: add comment to BFS prefetch function
Summary: This function was undocumented. Now that we're enabling BFS prefetching for the team, let's add some comments so that if the new functionality causes problems, readers of the code will have some context as to what's going on.

Reviewed By: quark-zju

Differential Revision: D17966978

fbshipit-source-id: 6078d427829d437064cf23b7af2d0cc0fb0a8627
2019-10-16 18:22:44 -07:00
Jun Wu
65fad5e812 rebase: do not crash rebasing -s secret-commit
Summary: Replace the assertion to an actionable error message.

Reviewed By: sfilipco

Differential Revision: D17932927

fbshipit-source-id: e9522a02be9901a9451f1505df6a19d8e35298a6
2019-10-16 18:22:09 -07:00
Durham Goode
376162f3d3 filesystem: move lookup yielding to a batched location
Summary:
In a future diff we'll move lookup resolution into the filesystem
later. To do so, we need to refactor the lookup reporting logic to batch all
lookup reporting into a single place so that later we can insert remotefilelog
prefetches for those files.

This diff moves lookup detection to put them in a list before yielding them. The
next diff will resolve them instead of yielding lookup.

Reviewed By: quark-zju

Differential Revision: D17749375

fbshipit-source-id: 93f383031600525f137039dc955b5e46346754c5
2019-10-16 17:40:13 -07:00
Durham Goode
815b95c925 dirstate: move dirstate old id generation to before status
Summary:
A future diff will change filesystem.pendingchanges to actually update
the dirstate when lookup files are resolved. Because of this, we need to compute
the old dirstate id before pendingchanges is called. Let's do that, and pass it
down into the poststatusfixup for usage.

Reviewed By: quark-zju

Differential Revision: D17749372

fbshipit-source-id: a7698ff1ef4aab2805e19929ac2f70841dd0fc3c
2019-10-16 17:40:12 -07:00
Xavier Deguillard
66213fa0f2 remotefilelog: remove python repack
Summary:
With loosefiles being gone, we no longer need to repack loosefiles, let's get
rid of the code.

Reviewed By: quark-zju

Differential Revision: D17923874

fbshipit-source-id: 9bc3390d448df4576e4567447a00446d1d1ff717
2019-10-16 14:21:58 -07:00
Xavier Deguillard
5840de16ef remotefilelog: remove format.noloosefile
Summary: This is now dead code.

Reviewed By: quark-zju

Differential Revision: D17923872

fbshipit-source-id: 9a65d13d43f0caa7b25516a7de3bcd7d558dda92
2019-10-16 14:21:57 -07:00
Xavier Deguillard
5132ddaa2c remotefilelog: remove remotefilelog.fetchpacks from the code
Summary:
All the repos, and all the tests have this config enabled, we have no plans of
turning it on again, let's kill it.

Reviewed By: quark-zju

Differential Revision: D17923873

fbshipit-source-id: fb5b16ede63918d9e89dc437dfb5cc3e5aa778bd
2019-10-16 14:21:57 -07:00
Xavier Deguillard
4cdbc8d9f8 remotefilelog: enable format.noloosefile by default
Summary: Loosefiles are dead, no need to test them anymore.

Reviewed By: quark-zju

Differential Revision: D17919277

fbshipit-source-id: 83386f49711d34e42a82b61ff2bb206a4f5afb12
2019-10-16 14:21:57 -07:00
Xavier Deguillard
3ad04bbd86 remotefilelog: make fetchpacks the default
Summary:
This has been enabled for a while now. We won't be going back to using
loosefiles, so let's make fetchpacks the default in the code. A future step
will remove the code paths that are no longer exercised.

Reviewed By: quark-zju

Differential Revision: D17919275

fbshipit-source-id: 0614f5710b630690de92cdb43ec07d3a2888aa1e
2019-10-16 14:21:57 -07:00
Xavier Deguillard
7869cc7b17 remotefilelog: remove hg gc
Summary:
The `hg gc` tries to cleanup old loosefiles from the hgcache, since loosefiles
are no longer being generated, there is no need to keep the code around. The
command is kept around to inform users.

Reviewed By: quark-zju

Differential Revision: D17919276

fbshipit-source-id: bd0adc628fda0f72dacb432c859ef827511e7a69
2019-10-16 14:21:56 -07:00
Durham Goode
5d5d6c679d fsmonitor: don't return generator for pendingchanges
Summary:
Because fsmonitor needs to be able to fallback, we need to consume the
entire pendingchanges list upfront so we can detect a fallback case. Previously
we just returned a generator and would never fallback, which resulted in an
exception for the user.

Reviewed By: quark-zju

Differential Revision: D17961313

fbshipit-source-id: ca11a074631b59e9226936d33f2176894203c29b
2019-10-16 14:16:29 -07:00
Jun Wu
ee5dab41f7 contrib: remove (un)dumprevlog
Summary:
We are migrating away from revlogs. So remove the dump/undump scripts and their
tests.

Reviewed By: DurhamG, xavierd

Differential Revision: D17962551

fbshipit-source-id: ff4738d237550b84c61733834c4c89e3bd08f760
2019-10-16 13:57:44 -07:00
Durham Goode
c80e87dafb eden: notify eden when a transaction is rolled back
Summary:
If a transaction rolls back, it may change the dirstate parent. We need
to tell Eden about it in that case or else it gets out of sync.

Reviewed By: quark-zju

Differential Revision: D17943808

fbshipit-source-id: 7504484e20768d5a0147a774d954004e9549b2d6
2019-10-16 13:54:55 -07:00
Jun Wu
98ea8ba10a changelog: migrate to non-inlined revlog automatically
Summary:
We no longer support inline changelog. This is because:
- D17804370 changed visibility to use the Rust `revlogindex` to normalize heads.
- The Rust `revlogindex` does not support inline revlog and will likely panic.

However, there are still inline changelog in the wild.
- Although D17125922 disabled inline revlog, it only affects newly created
  changelog.
- Repos created before D17125922 can still use inline changelog (if they are
  small).
- There are such repos in production.

This diff fixes the issue by forcing a migration to non-inline changelog.

Reviewed By: sfilipco

Differential Revision: D17957037

fbshipit-source-id: 0690e8c041ee9c0b7100416b5794963582516311
2019-10-16 11:42:07 -07:00
Xavier Deguillard
8ed08b321f rebase: remove rev number from rebase output
Summary:
Revision numbers are deprecated, let's not print them in the rebase output.

The tests were automatically fixed with run-tests.py -i

Reviewed By: quark-zju

Differential Revision: D17936451

fbshipit-source-id: a8f0403b6af4573421ca874e9311f26931eba697
2019-10-15 16:29:51 -07:00
Durham Goode
d1f94e520c dirstate: fix hg diff crashing for deleted adds
Summary:
The new dirstate loops over the nonnormal files and marks them as
added, removed, etc. There was a bug where if a file was added, it was marked
added even if it disappeared from disk. Let's double check that the file exists
before we mark it as added.

I don't believe the other file states (merged and removed mainly) have this issue.

Normally this issue only reproduced in Eden checkouts. This highlighted a bug
where the non-eden filesystem was reporting files that had been
hg-added-then-rm'd as changed, when really pendingchanges should not report that
since that file being missing it not a pending change relative to the originally
checked out tree.

Reviewed By: quark-zju

Differential Revision: D17921401

fbshipit-source-id: a57992b83173c299ba3307d6324dd357cd2b0b24
2019-10-14 20:54:47 -07:00
Durham Goode
4da288ba56 filesystem: only set dirstate to dirty if a file was actually marked clean
Summary:
A recent dirstate refactor made the dirstate get marked dirty if a file
was marked for clean. Unfortunately it also set the dirstate to dirty if the
file was only checked for clean and didn't require marking. This resulted in the
dirstate getting written with no changes, which triggered IDE's to run hg
status, which re-wrote the dirstate, triggered IDE's, etc.

The fix is to use the built in dirstate.clearneedcheck function, which handles
this appropriately.

Reviewed By: xavierd

Differential Revision: D17919381

fbshipit-source-id: 78698f1c82f00a95502d09ad9515bee58b1191fc
2019-10-14 17:01:41 -07:00
Durham Goode
69bf56c75d crdump: fix index error
Summary:
The previous diff that added branch metadata tried to use [0] on a set,
which doesn't work. This fixes it.

Reviewed By: xavierd

Differential Revision: D17913449

fbshipit-source-id: d26a101fb21edf8440b7f6e7f5c355a018df36fc
2019-10-14 14:03:12 -07:00
Carolyn Busch
e0a9e4b89d filesystem: Use rust walker in filesystem pending changes
Summary:
If the config workingcopy - enablewalker is set to true use rust walker to
retrieve matching files in working copy.

Reviewed By: xavierd

Differential Revision: D17481644

fbshipit-source-id: 8436d4cd3a9bd29954c7b2be52e50c53b53f1557
2019-10-14 13:33:36 -07:00
Durham Goode
639fdd2509 crdump: silence stdout from commitcloud backup
Summary:
The diff that added commitcloud backup to crdump didn't take into
account that backups print to stdout, which interferes with parsing the json
from crdump. Let's silence it.

Reviewed By: singhsrb

Differential Revision: D17910359

fbshipit-source-id: 7ed3de8d9c2f9a8a2706f5e9783860fd2cfa2b67
2019-10-14 11:04:38 -07:00
Jun Wu
56d60f6417 phases: consider "." as a draft head
Summary:
This removes the possibility that "." stack becomes accidentally hidden, if
they are not part of tracked visible heads.

Reviewed By: sfilipco

Differential Revision: D17888548

fbshipit-source-id: 2cdd4791925fee2583860d22abd544fbe2538da5
2019-10-14 10:56:41 -07:00
Mark Thomas
57edbf09a3 mutation: ignore non-existent successors when computing foreground
Summary:
Mutation records can refer to commits that don't exist in the local repo, particularly
when commits have been shared between repos, or mutation records have been
backfilled from obsmarkers.

When computing the foreground of a node, ignore any successors that do not exist.

Update the algorithm to cope with and ignore potential cycles from backfilled
obsmarkers by removing all the already-seen nodes from the set of new nodes on
each iteration.

Reviewed By: quark-zju

Differential Revision: D17905952

fbshipit-source-id: 3ab96453c88da9b271a30b83f0748435803861fe
2019-10-14 09:20:17 -07:00
Jun Wu
182ec6ae49 directaccess: disable itself if narrow-heads is enabled
Summary:
If narrow-heads is enabled, commits can all be accessed directly without
using the "directaccess" extension. So let's disable it in that case.

Reviewed By: sfilipco

Differential Revision: D17888725

fbshipit-source-id: 0e316ab86fd5f4eaeb674854619f685058d11ded
2019-10-11 16:55:24 -07:00
Jun Wu
c65364ff95 remotenames: restore "remotenames" on transaction abort
Summary:
Register `remotenames` as "files to backup" so they got restored by the
transaction framework on transaction abort.

Reviewed By: xavierd

Differential Revision: D17888017

fbshipit-source-id: 81e923a250ef8fd95d76d57961ff535d18a81d50
2019-10-11 15:25:37 -07:00
Jun Wu
c0ebd84d24 remotenames: put expull in a transaction
Summary:
This makes sure post-transaction hooks get a consistent view of the repo
(instead of updated changelog, but lagging remtoenames).

Reviewed By: xavierd

Differential Revision: D17888015

fbshipit-source-id: b318b7d26fc8c2b2c85364135ee6a101d47a2778
2019-10-11 15:25:37 -07:00
Jun Wu
5f4b6264c1 remotenames: invalidate revsets after updating remotenames
Summary:
With narrow-heads enabled, remotenames decide public phases. So updating
remotenames should invalide the phase cache.

Reviewed By: xavierd

Differential Revision: D17888016

fbshipit-source-id: 01c2210bf0022c6ad139a4c4453d9920ef5cbb83
2019-10-11 15:25:37 -07:00
Jun Wu
7bb9b23e22 indexedlog: hide test output unless VERBOSE is set
Summary: This makes test output shorter.

Reviewed By: xavierd

Differential Revision: D17883761

fbshipit-source-id: 0b6d5e8ce94ac40c5357e2da90640e2464d21cd7
2019-10-11 13:29:24 -07:00
Xavier Deguillard
be803e9ab8 revisionstore: better handle empty packfile flush
Summary:
On flush, if no data was added to the mutable packfile, Ok(None) should be
returned. This fixes a bug in the PackStore where an attempt was made to open
the newly created packfile, while none existed.

Reviewed By: quark-zju

Differential Revision: D17861327

fbshipit-source-id: 70f3f49f60de5883ca85787c1bb00c16c74e8f2f
2019-10-11 10:00:46 -07:00