Summary:
Right now `hg pull -r REV` marks all pulled revs as visible.
This makes sense for regular commits (if they exist in the cloud, then they are not hidden).
For snapshots, it is wrong, thus we need not to mark snapshots as visible when pulling.
Differential Revision: D17289438
fbshipit-source-id: d16237b9e471f49bb44317104bc445472bedc16c
Summary:
Add a warning when a user enables a sparse profile on the command line that does not exist.
Triggering the check from multiple places, to not have to clutter the `_config` function. The `_config` function is called from other places as well (eg cloning a sparse repo) and I didn't want to add another guard parameter to it for such a benign functionality.
Besides the `_checknonexistingprofiles` function is only called in 3 situtations:
1. `hg sparse {enable|enableprofile}`
2. `hg sparse --enable-profile` (which is actually deprecated)
3. `hg clone --enable-profile`
Special care has been taken when cloning a sparse repo to do the check after the clone.
Reviewed By: markbt
Differential Revision: D17571442
fbshipit-source-id: 882dbe8b142bf192754dd17d0729d1bb0b472a83
Summary:
Similar to Log, this somehow stress tests RotateLog behavior in a multi-thread
environment.
Reviewed By: xavierd
Differential Revision: D17542324
fbshipit-source-id: 35ea358157cf141bec3802b959c9f921eca3143a
Summary:
Add a simple stresstest that calls sync() in multiple threads. This should
give us some confidence that `sync()` has expected behavior when called in
an multi-thread environment.
Reviewed By: xavierd
Differential Revision: D17538980
fbshipit-source-id: 1793a3f871f0377c452807efa466d65d0da4b1f6
Summary:
Getting "parents" in revlogindex is used in a very hot loop. So avoiding
allocation matters. With this patch, it's roughly 5x faster, and matches
C code doing whole changelog scan.
Before:
In [3]: %time cl.index2.headsancestors([1,len(cl)-1])
CPU times: user 330 ms, sys: 68 µs, total: 330 ms
Wall time: 330 ms
Out[3]: [5584666]
After:
In [3]: %time cl.index2.headsancestors([1,len(cl)-1])
CPU times: user 52.9 ms, sys: 0 ns, total: 52.9 ms
Wall time: 53 ms
Out[3]: [5584665]
C code doing whole changelog scan:
In [5]: %time cl.index.clearcaches(); cl.index.headrevs(); 1
CPU times: user 54.2 ms, sys: 187 µs, total: 54.4 ms
Wall time: 54.4 ms
`smallvec` was not used, as it has extra overhead tracking whether it's
stack or heap allocated, which makes it 2x slower than this diff.
Reviewed By: sfilipco
Differential Revision: D17581248
fbshipit-source-id: cf6e36e0000759f41410f1e3a1d252920711fb79
Summary:
Add a config option, `devel.debugger`. If set, enter ipdb session automatically for
uncaught exceptions.
The motivation is to debug issues that cannot be easily reproduced (so running the
same command again with `--debugger` is not a choice).
Reviewed By: xavierd
Differential Revision: D17578249
fbshipit-source-id: 253eea6cfd2324f485152a28ed922eb499d560cd
Summary: Make the test use the modern features.
Reviewed By: sfilipco
Differential Revision: D17199835
fbshipit-source-id: 7301b6178e20b6286d765f12ffadb111bb348113
Summary:
With visibility and narrow-heads, undo can just track visible heads and replace
visible heads without messing up with mutation records. This diff implements
that.
Support for `--branch` is dropped. If it is actually used, we can implement a
visible head-based version in the future.
Reviewed By: sfilipco
Differential Revision: D17244563
fbshipit-source-id: 55b62a277018f456fa88903d9cc7c0edc9f7006b
Summary:
Copy the test with modern configs: visibility, mutation, remotenames, and
narrow-heads.
It does not pass right now, which will be fixed by upcoming diffs.
Reviewed By: sfilipco
Differential Revision: D17244559
fbshipit-source-id: 178a105d28dd6064ea040b2baba303493c700e25
Summary:
`tip` and `default` are changed to `master` (bookmark) to make it more
explicit. `log --hidden` was changed to `log -r predecessors(all())`.
I didn't investigate why `(+1 heads)` message get missing. I think we
should probably just remove the message.
Reviewed By: sfilipco
Differential Revision: D17199838
fbshipit-source-id: 0dbe982300f4c4c5e7429c0bf017e0cc97af6872
Summary:
Use narrow-heads for the test so we get some confidence that it works with our
production setup.
Some test changes:
- `predecessors()` revset now shows all commits regardless of "hidden" or not.
Reviewed By: sfilipco
Differential Revision: D17244564
fbshipit-source-id: 9053adbbb913c28d1e7b421155e6325c15790fc5
Summary:
Use narrow-heads for the test so we get some confidence that it works with our
production setup.
A `master` bookmark was added to mark commit public on the server repo.
Reviewed By: sfilipco
Differential Revision: D17244551
fbshipit-source-id: bf65c3aaf0a2fb46c9e7f1af36cc845ae40f44c6
Summary:
If `narrow-heads` is turned on, there are no "filtered revs", and `cl.hasnode`
returns Ture for previously "filtered revs". By definition, `cl.hasnode` should
check `::head()`.
I looked at users of `cl.hasnode` and other users seem to be unaffected. This
diff changes mutation's usecases of `cl.hasnode` to use `::head()` instead.
`::head()` is practically `draft() + public()`. The phases revsets are
pre-calculated. Therefore use them to speed up the calculation.
Reviewed By: sfilipco
Differential Revision: D17264381
fbshipit-source-id: a1bef495d74ade8f074855c149748c999ad246f6
Summary:
To preserve the `--hidden` behavior, make `cl.headrevs` return all heads ever
tracked. Besides, phase revsets like `draft()` also requires extra calculation
if `--hidden` is set.
Reviewed By: sfilipco
Differential Revision: D17264380
fbshipit-source-id: 3590e993f745dce8b1718af4fb12308b2fbf1549
Summary:
This will be used to preserve the `--hidden` behavior by using a more complete
list of heads.
A test introduced by 6563438219
was removed as it does not make sense to me to force changing read size from 65536 to 1.
That commit itself does not have useful commit message, and I cannot find email review thread for it.
Reviewed By: sfilipco
Differential Revision: D17264382
fbshipit-source-id: cc17e98eef4a4743e5207795a7054db59aa71fc0
Summary:
This test is causing trouble in upcoming changes. We don't really care about
the code path - they are migrating *ancient* formats to some formats that we've
been using for years.
For modern migration, like flat dirstate -> tree dirstate, we have seperate
code paths and seperate tests.
Reviewed By: sfilipco
Differential Revision: D17581267
fbshipit-source-id: 7154489ccf46bb4add1c1ec882eafae507af94d3
Summary:
D17429691 made blackbox reuse session_id unconditionally. That has an
undesirable side effect that chg processes are all logged as a same session id.
Fix that by detecting pid change and avoid reusing session_id in that case.
Reviewed By: singhsrb
Differential Revision: D17532555
fbshipit-source-id: cf11bb66f7d7242429b90ab5e5ea85ca307f92c3
Summary:
Sandcastle folks have recently seen the number of unhealthy host going up due
to `hg repack` failing when a corrupted packfile is present on disk. When a
corrupted packfile is detected, let's simply ignore the failure.
Reviewed By: DurhamG
Differential Revision: D17582128
fbshipit-source-id: 64a589a165605791d207e4029cccb93a8bcd3c24
Summary:
Add some context around "invalid read offset" to make errors slightly more
useful.
Reviewed By: xavierd
Differential Revision: D17577202
fbshipit-source-id: d51ba30abf6c462102be8bec1b60668ee66e07f2
Summary:
Instead of removing them unconditionally, keep one copy that failed to `open`
so we can have a look later.
Reviewed By: xavierd
Differential Revision: D17576432
fbshipit-source-id: 4f967d61aa602e6d3cac90d411e1971893c162bd
Summary:
Revise some error handling details so it covers corner cases more acurately and
provides more detailed error messages.
Since D16554090, RotateLog::open unconditionally attempts to create an empty
log at 0/ and reset latest to 0 if read_latest_and_log fails. That could be
undesirable if latest can be read but logs cannot, since it can silently reset
latest to 0 and might cause trouble in the future (For example, failed to
create an empty log at 1/ because it already exits).
This diff splits read_latest_and_log to read_latest and read_logs and handles
their errors individually.
The table summaries changes:
| latest | logs | old behavior | new behavior |
| okay | okay | return both | return both |
| okay | error | create log 0 | create log latest+1 |
| missing | whatever | create log 0 | create log 0 |
| error | whatever | create log 0 | error |
Reviewed By: xavierd
Differential Revision: D17576431
fbshipit-source-id: c9ab1fca5fb60eecf9e326baf90dfa98560a2b32
Summary:
It's possible for a file to appear in the `added` list but is not actually
changed. In that case the Rust manifest has a different behavior that returns
None that breaks the code. Fix it by "correcting" to p1 manifest node.
Reviewed By: sfilipco
Differential Revision: D17512350
fbshipit-source-id: 7c74ffb4e73ed1af5378fe509ed4f06a512995ae
Summary:
Walker should own matcher instead of storing a reference, so the walker can be
stored as a member of a struct by itself
Reviewed By: xavierd
Differential Revision: D17511588
fbshipit-source-id: 039c6c3cced7feec4e9141c31e5333c43879484a
Summary: It will be needed to sync snapshots while bypassing the `sync` transaction.
Reviewed By: markbt
Differential Revision: D17571650
fbshipit-source-id: ff6c0382a1b1e763c3e37610d188f5bbfb382510
Summary:
The current way of opening the lock file and creating it on demand is racy.
Fix it by making it one operation.
Reviewed By: singhsrb
Differential Revision: D17552687
fbshipit-source-id: 5469862902ccab2d317f2c0ac61867c365e22aba
Summary:
AR/VR Engineering does AOSP development using Git and Google Repo. This is rough at times because FB Dev Infra doesn't support these tools in a lot of critical use cases. This commit contains a very rough prototype of a hg convert extension to support Google Repo as a source.
What this commit does:
1. Finds all of the heads in all of the git projects in the Grepo and imports their commit histories into mercurial.
2. Merges those commits into a single commit history that represents the default manifest in the current branch.
What this commit doesn't do:
1. Explore the space of all manifests that have ever existed in the manifest project and update directory branches based on those.
Reviewed By: tchebb
Differential Revision: D14944252
fbshipit-source-id: b292025ccac06d02b347e35839215eedfd151a5d
Summary:
Finalize is asking the cursor to traverse into directories that haven't changed.
This is bug introduced when updating finalize to support being called on
"Durable" nodes. Until then directories would always be traversed if they were
in the processing path. The path would only be chosen for "Ephemeral"
directories which we knew were different from a parent that is assumed to be
"Durable". I later learned that `finalize` is expected to return the manifests
that are directly fetched from storage. The update meant that we would skip
the directory that is processed if the "Node" (hash) is present and matches a
parent. The problem is that didn't update the point at which the parent cursor
is advanced.
Reviewed By: xavierd
Differential Revision: D17537448
fbshipit-source-id: 9c71a8f8f5a70c600031bc9d32535e59f2f32700
Summary:
Now we can show test status of a diff in super-smartlog!
Users can customize this by tweaking their `.hgrc`:
For example, if the want to use Emojis (and their terminal supports it), they can add the following lines to their `.hgrc`:
```
[templatealias]
sl_signal_warning = "⚠️"
sl_signal_in_progress = "⌛️"
```
{F211469447}
(Unfortunately my set up does not handle some of the Emojis properly :( This is the best I can get)
If they dislike fancy Unicode characters, they can switch back to plan old text as well:
```
[templatealias]
sl_signal_okay = "Okay"
sl_signal_failed = "Failed"
sl_signal_warning = "Warning"
sl_signal_in_progress = "In Progress"
```
Reviewed By: quark-zju
Differential Revision: D17540182
fbshipit-source-id: fdaf87f2f4e0977ca0b171c0b48514e764c57553
Summary:
This updates readauthforuri to allow for multiple credentials for the same
host, with a preference for credentials that do exist on the filesystem, and
otherwise a fallback to configurable priorities.
Reviewed By: farnz
Differential Revision: D17528631
fbshipit-source-id: 0b8f255572415b9f60c1aa687728282451f637c4
Summary:
By ignoring unknown working parent, and treating working parent as `null`,
various operations wouold be painfully slow, because `status` would return the
entire working copyp as "untracked".
I hit it today due to some transaction related issues. What I did:
- `hg commit` from one terminal, keeping the editor
- `hg revert -i` from another terminal, waiting for lock
- `hg commit` completed
- `hg revert -i` appears to have loaded the updated dirstate, but not the
updated changelog. So it cannot find the new commit and prints the `ignoring
unknown working parent` message.
It's very hard to reason about the current related code. We'll probably get a
better transaction model to make this less likely to happen. So I didn't write
a test for the legacy code.
Reviewed By: xavierd
Differential Revision: D17532554
fbshipit-source-id: a06b56d78ef4cc129ee7d302c179668747881a69
Summary:
The `import gdbm` statement may or may not be enough to detect missing
modules, let's try to access the `open` method to force load it.
Reviewed By: quark-zju, singhsrb
Differential Revision: D17539167
fbshipit-source-id: be0271224b28afb5f0a525d86420c1a12994c0d2
Summary: This will be used to store "invisible heads".
Reviewed By: sfilipco
Differential Revision: D17264837
fbshipit-source-id: a450b5c10cc961d43ec8eb852cb2fb22849a8c00
Summary:
The new `narrow-heads` feature only makes sense for new clients. The hg servers
have hard dependency on revlog (because of hgsql) and cannot be migrated to any
fancier changelog structure easily. Therefore just unconditionally disable
`narrow-heads` for them. This makes it easier to change tests.
Reviewed By: sfilipco
Differential Revision: D17244554
fbshipit-source-id: ee6e7e8cab726ccb27814683447ea6271e41cc3e
Summary:
Phases are going to be defined by remote names. That means `hg phase -f` no
longer works. To workaround it, add a debug command to mangle remote names.
Reviewed By: sfilipco
Differential Revision: D17244553
fbshipit-source-id: efca1be22f5ab2ff9f39965ed0e98712cc944d1c
Summary:
`hg log` without arguments are used frequently in tests. Use `all()` to hide
invisible commits.
Note: this does not change end-user behavior, since tweakdefaults adds `-f`
and `log` without arguments will be logging `:.` instead (which, should
probably be changed to log `::.`).
Reviewed By: sfilipco
Differential Revision: D17244555
fbshipit-source-id: d5a0da0355ece850f4969cb244f4ebf23da040d1
Summary:
With 'narrow-heads', repoview filtering is bypassed. So we need another
way to make 'invisible' commits disapper from 'all'.
Reviewed By: sfilipco
Differential Revision: D17244549
fbshipit-source-id: 6fd4d4ff5ca96f300a5d79a796fb643060662e9b
Summary:
With 'narrow-heads', repoview filtering is bypassed. So we need another
way to make 'invisible' commits disapper from 'children'.
Reviewed By: sfilipco
Differential Revision: D17244556
fbshipit-source-id: 47d6f59523d910e5d9865d40251954d8de0ee055
Summary:
This resolves an issue where commits get selected incorrectly in the `x::`
case.
Reviewed By: sfilipco
Differential Revision: D17244561
fbshipit-source-id: e9e633509c0e335d24e13cef0ac06e242816e479
Summary:
I'm removing the `depth` support for `descendants` and `ancestors`, since the
new DAG code doesn't implement them - they cannot be sped up by using high
level segments. Let's use `limit` instead.
Reviewed By: xavierd
Differential Revision: D17244552
fbshipit-source-id: f474c5171c84542dbe6d7a606f75089cb37e2c4f
Summary:
See the test change. Basically, phases are defined by visibility heads and
remotenames. This resolves the issue after disabling repoview, `draft()`
contains unwanted commits.
Reviewed By: sfilipco
Differential Revision: D17244558
fbshipit-source-id: 84fc4a8b7830d613babf101079cb3c5b7909f23f
Summary:
The SpanSet can include a large amount of revs. Iterating through it by putting
everything in a PyList is suboptimal. Therefore add a dedicated native iterator
for it. This speeds up iteration greatly, which can be verified via debugshell:
Before:
In [1]: s=m.smartset.spansset(b.dag.spans(xrange(5000000)))
In [2]: %time s.slice(0,10)
CPU times: user 135 ms, sys: 42.9 ms, total: 178 ms
Wall time: 180 ms
After:
In [1]: s=m.smartset.spansset(b.dag.spans(xrange(5000000)))
In [2]: %time s.slice(0,10)
CPU times: user 49 µs, sys: 6 µs, total: 55 µs
Wall time: 58.2 µs
Reviewed By: sfilipco
Differential Revision: D17305350
fbshipit-source-id: 0db00aa57fb6bf2141ccea94b2536da78f103cef
Summary:
For some reason, `null` appears in `obsolete()`:
% hg log -Gr 'obsolete() & null'
x changeset: 0000000000000000000000000000000000000000
user:
date: Wed, 31 Dec 1969 17:00:00 -0700
That's undesirable because `null` should be considered immutable, public.
public commits are not obsolete.
Reviewed By: xavierd
Differential Revision: D17531824
fbshipit-source-id: 69c83be0c24bec179ffcd64ea264aa9208a5fe21
Summary:
The fbcode runtime Python unfortunately isn't compiled with the _bsddb module
in, and thus when using the packman built Mercurial binary, renaming a file and
performing an amend will cause it to crash. Unfortunately, we can't simply use
gdbm everywhere as Windows doesn't support it, so let's hack around this by
trying both anydbm and gdbm.
Reviewed By: quark-zju
Differential Revision: D17512253
fbshipit-source-id: 3717b691e715084b7c3488425ae20dcf7e9ad2bd