Summary:
There was a bug where hg pullbackups could result in commits being
marked as public when they shouldn't have. The issue was the the server side
loop iterates over heads, inspecting bundles as it goes, but it would only mark
the phase root for the head it was currently processing. While processing a
given head's bundle, it would take note of any other heads in the bundle and
mark them for bundling as well, but it wouldn't take note of their phase roots.
The fix is to just record all the heads found in that bundle and use them all in
the draft computation.
Reviewed By: ikostia
Differential Revision: D7648746
fbshipit-source-id: 93e6feb903fea49b6312c58dce4a6208105d002f
Summary:
Some services like sandcastle want to be able to correlate their job
with specific hg commands in our scuba data. Let's allow them to specify a job
id we can filter on.
I considered having multiple columns, like job type and job id, but I figured
the service can use whatever format they like, and we can used derived columns
to filter on different parts of the string as needed.
Reviewed By: mjpieters
Differential Revision: D7672264
fbshipit-source-id: e4723274bad2812358176e71da791e759b346ac0
Summary:
Update `fbsparse.reposetup()` to avoid attempting to wrap the localrepo object
in Eden repositories. The fbsparse extension is normally disabled in Eden
repositories, but this ensures the code does the correct thing even if the
fbsparse extension has been explicitly loaded.
Reviewed By: ryanmce
Differential Revision: D7642679
fbshipit-source-id: d0a229091d794fb326ab1db1c01e5a0a271092c4
Summary:
Update the sparse command to fail early if the repository in question is not a
sparse repository.
Reviewed By: ryanmce
Differential Revision: D7642680
fbshipit-source-id: eaf765d38b45acf17d7c755f95083371f43f7259
Summary:
```
$ hg sparse explain some/profile
[...]
hint[sparse-explain-verbose]: use 'hg sparse explain --verbose some/profile' to include the total file size for a give profile
hint[hint-ack]: use 'hg hint --ack sparse-explain-verbose' to silence these hints
```
Differential Revision: D7669896
fbshipit-source-id: c700fbc2f42044a9b15371278305f03e9e6c989f
Summary: Tweak the help output to reflect the now-complete subcommand information.
Differential Revision: D7667900
fbshipit-source-id: a5a04e8bcbfe4a90266c30e25ffd705de0bdc8a9
Summary:
Change the schema for the commit cloud service to understand the structure of
obsmarkers, and store them that way, rather than as encoded strings. This
allows the commit cloud service to index the obsmarkers, and for other services
to examine their contents.
Differential Revision: D7653162
fbshipit-source-id: ff0ea86758e3e56feae2216508ac763d0d7578cc
Summary:
The ancestorcache function requires a db in the cache directory, but if
the cache directory did not exist, the db would fail to get created, resulting
in slow smartlogs forever. Let's ensure the cache directory exists first.
This also switches to using cachevfs, which causes it to use the source repo's
cache directory instead of the shared one, which will mean better cache hits.
Reviewed By: quark-zju
Differential Revision: D7664296
fbshipit-source-id: b99acc22ba4f87af6e1edac1c9f15d39e8451ecc
Summary: Similar with D7440249. See D7440254 for motivation.
Reviewed By: DurhamG
Differential Revision: D7562195
fbshipit-source-id: b11eb4f47375a2a2d70be96ebcfe2fefe1e0aaad
Summary: Similar with D7440249. See D7440254 for motivation.
Reviewed By: DurhamG
Differential Revision: D7562196
fbshipit-source-id: e90c623bd9576de49c3d4990ac93c105238d219c
Summary:
Now it's possible to filter tests like:
cargo bench --bench index --verbose -- TEST_KEYWORD
Useful for profiling specific test.
Reviewed By: DurhamG
Differential Revision: D7562174
fbshipit-source-id: 9c7fe13a0541bd3dda7a9c1acf95c91513b633f2
Summary:
Add a test that bitflips the index content, and make sure reading the index
would trigger an error.
Due to run-time performance difference, the release version tests 2-byte key
while the debug version only tests 1-byte key.
The header byte was not verified. Now it is verified.
Reviewed By: DurhamG
Differential Revision: D7517134
fbshipit-source-id: b3d8665ff4ac08c1a70db8d21122ba241913a2ed
Summary:
In "split_leaf" "Example 3" case, the old leaf entry (and its key) becomes
unused. Writing them to disk is unnecessary. This patch adds "unused" marker
so they could be marked and skipped inside flush().
No visible performance change:
index insertion 3.710 ms
index flush 3.717 ms
index lookup (memory) 1.128 ms
index lookup (disk, no verify) 1.993 ms
index lookup (disk, verified) 7.866 ms
Reviewed By: DurhamG
Differential Revision: D7517139
fbshipit-source-id: 253c878bc4b3762382c424777dfa779b3868e851
Summary:
The document was for ".title()". The code finally uses ".capitalize()" so
it's not capitalizing each word.
Quoting is changed to be consistent with the surrounding style.
Reviewed By: ryanmce
Differential Revision: D7658780
fbshipit-source-id: 4ad99d41cd8104dd382058a50752f88aa2116a0d
Summary: Let's report that this lock cannot be read by Mercurial
Reviewed By: markbt
Differential Revision: D7653196
fbshipit-source-id: c5b7889cdde9c0ecc03a8c961aeba92f426648b1
Summary:
Quick experimentation shows that existing lock file logic is not enoug for
frequently run and killed Mercurial processes (Mercurial run by tools, such as
Nuclide is an example of such scenario)
I wrote the following two files:
```
c:\Code\tries\pythontries λ cat lockcreator.py
import os, random
def makelock(info, pathname):
ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL)
os.write(ld, info)
# os.fsync(ld)
os.close(ld)
name = os.path.join('locks', 'lock.pid' + str(os.getpid()) + ".rand" + str(random.randint(0, 10000)))
makelock('contents', name)
```
and
```
c:\Code\tries\pythontries λ cat lockracer.py
import os, subprocess, time, random
for i in xrange(10000):
proc = subprocess.Popen('python lockcreator.py')
time.sleep(0.001*random.randint(0, 500))
proc.terminate()
```
After runnning `python lockracer.py`, I did `ls -l locks | grep "0 Apr"`, this way it showed all the 0-byte files created in April. This shows a non-empty output. Uncommenting the `os.fsync` line does not help much.
Rewriting `lockcreator.py` to use temp lock file approach helps greatly.
Reviewed By: quark-zju
Differential Revision: D7653186
fbshipit-source-id: 48e9eeeca34075ea2ec78f3319491bcebc0e88c7
Summary:
Since we have other short variables like `cl`, `mf`. It makes sense to also
assign `m` as a shortcut to `mercurial`. It's handy to test methods like
`m.mdiff.allblocks` etc.
Reviewed By: markbt
Differential Revision: D7627705
fbshipit-source-id: 167bdef9cd6319d233b18aa0ad046a3055e92ffb
Summary: They are duplicated in the ipdb/pdb code paths. Extract them to a method.
Reviewed By: markbt
Differential Revision: D7627706
fbshipit-source-id: 65fd97fcbcac91b7a6997802f259779603cf92be
Summary:
Sometimes it's handy to test a Mercurial function (ex. xdiff, re2) without
a repo. This patch allows that.
Reviewed By: markbt
Differential Revision: D7627704
fbshipit-source-id: a5ccfc9ef47d79b4c3242eaeb1634cd3f83adcc1
Summary:
This allows us to build hg with a bundled re2. It can avoid issues like ABI
incompatibility with a shared re2 library. That might happen, if the RPM
dependencies are not strongly guaranteed (which might happen, although
shouldn't).
Reviewed By: simpkins
Differential Revision: D7622815
fbshipit-source-id: da6199aab7982f1e72466c676ebb0d1ed2100d6f
Summary:
This avoids potential SEGSEGVs when the system re2 is ABI incompatible.
See D7622774 for more details.
Reviewed By: markbt
Differential Revision: D7622771
fbshipit-source-id: bae1500e7468881a7a19d3cb9074db583b2444a6
Summary:
We recently found issues where it seems "hg" in some environment uses an
ABI-incompatible re2 library and segfaults. pyre2 is small and was
originally written by Facebook for Mercurial use-case. So let's just vendor
it.
Reviewed By: markbt
Differential Revision: D7622774
fbshipit-source-id: db01183c9881bf9c3ed21fceed195b2059d40208
Summary:
`install_requires` is not well supported. And the subverty detection is not
meaningful - it checks at package build time, not package install time.
```
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
```
Reviewed By: markbt
Differential Revision: D7626055
fbshipit-source-id: 061147f02698ad46561c95d2039f0a8ad26182d2
Summary: The attribute is called 'hex', not 'hash'. Oops.
Reviewed By: markbt
Differential Revision: D7600689
fbshipit-source-id: 027031000e6481f353ceaad79c7dc2c46a16a3cf
Summary:
Suspending the progress bar is achieved by taking the progress lock. This has
a cost, which reduces performance even when there are no progress bars to
suspend. This is particularly bad for commands that output lots of lines, e.g.
`hg files`.
Don't take the lock during suspend when there aren't any progress bars to
suspend.
Reviewed By: mjpieters
Differential Revision: D7652389
fbshipit-source-id: 627d893261228087b4cc84b90bf05b034cc60a40
Summary:
Similar to the previous patch, this allows us to get more information about
conflicts being resolved.
Reviewed By: phillco
Differential Revision: D7648933
fbshipit-source-id: 5b8c3dde385ace4c2a7cff7455e11436e5afd8cd
Summary:
This helps debugging watchman related issues. In particular, the order of
watchman state-enter/leave events and other events.
Reviewed By: singhsrb
Differential Revision: D7648928
fbshipit-source-id: 527a7bef9a07c2526bdd40ad802d5ba06bc27226
Summary:
Some log messages might not end with "\n". Append it automatically so it
looks good in blackbox.log.
Reviewed By: singhsrb
Differential Revision: D7648930
fbshipit-source-id: f5262e0c77a3bde952c3963ac5298b850f38d9db
Summary:
There are certain code paths that passes an empty `msg` that would crash
blackbox code:
```
error in exit handlers:
Traceback (most recent call last):
File "mercurial/dispatch.py", line 73, in _runexithandlers
func(*args, **kwargs)
File "hgext/sampling.py", line 118, in telemetry
generaldelta=str('generaldelta' in repo.requirements).lower())
File "hgext/blackbox.py", line 170, in log
formattedmsg = msg[0] % msg[1:]
IndexError: tuple index out of range
```
Fix it by ignoring those messages.
Reviewed By: singhsrb
Differential Revision: D7648932
fbshipit-source-id: be9f8327fd476399e4b762c92ea5f31cb174e189
Summary:
This was broken by D7604500 because the format for infinitepush
bookmark names doesn't expect a double slash when the reporoot begins with a
slash. For instance, the bookmark name is
`infinitepush/backups/UNIXNAME/HOST/path/to/repo/heads/...` but we were querying
for `infinitepush/backups/UNIXNAME/HOST//path/to/repo/heads...`.
Reviewed By: singhsrb
Differential Revision: D7647924
fbshipit-source-id: 11abc38e44998d9164b474b9acce7bef7a011fe1
Summary: Commit 23f4cd4264ef broke a bunch of tests. Let's back it out.
Reviewed By: singhsrb
Differential Revision: D7646736
fbshipit-source-id: ace9b7be2c50f64ea382eaa72a350ead67b2a2a6
Summary: These matchers provide better values than the default now provided by mercurial.match.basematcher.
Reviewed By: quark-zju
Differential Revision: D7635868
fbshipit-source-id: c826390b3a5e3a2da897eeb54be22850e14403f6
Summary:
A previous diff (143ad029b) lost these lines due to run-tests.py -i overwriting
them. We're seeing flakey test failures, so let's add them back.
Reviewed By: singhsrb
Differential Revision: D7641613
fbshipit-source-id: 4f0807ae88f442cfa3c84106e800ce9eba81e99e
Summary: Let's report that this lock cannot be read by Mercurial
Differential Revision: D7617178
fbshipit-source-id: 23f4cd4264ef6c685762d8f89e2c24ed2f224211
Summary:
The recent changes to Mercurial made us less tolerant to wrongly-formatted
lock files.
Reviewed By: farnz
Differential Revision: D7586684
fbshipit-source-id: d7fa2151b8bb20f49c83941f7d3ef751fdbab2de
Summary:
{F123775861}
Improve smartlog extension for Commit Cloud Users.
The difference with the current smartlog implementation is that in Commit Cloud world
a commit can be modified by a sequence of operations on another host and smartlog doesn't handle it.
After `hg cloudsync` run command we should be able to 'explain' in smartlog what has happened
this is important for user who opt out from 'updateonmove' feature because they will see two version of their stack all the time.
Reviewed By: DurhamG, quark-zju
Differential Revision: D7492969
fbshipit-source-id: 9ac2180f9abaa9ae596620b7f25d9ad8212deb28
Summary:
Previously, when searching for base trees (i.e. trees that we already
have that we can tell the server so it can send us only parts we don't have) we
did a naive changelog scan for public commits. If the phases were messed up and
a local commit was marked public, this would result in us sending the server a
base commit it didn't have which would error out.
Let's make two changes to fix this.
1. Let's scan by history instead of by revision number. This will
work in the future when we don't have rev numbers, and will hopefully also get
us closer base trees. It should also mean that if we fetch a server commit we
are less likely to encounter a local accidentally-public commit.
2. Let's only use commits that are ancestors of a remotename. This will help us
avoid local accidentally-public commits as well.
Reviewed By: quark-zju
Differential Revision: D7593363
fbshipit-source-id: 1df8f4fbc56a4c11ccb6d444c3d08297206ad91f
Summary:
Currently if there is a bookmark ends with *, adding and removal such
a bookmark, removes all the bookmark with the same prefix from the table.
I made similar url encoding encode.
Reviewed By: StanislavGlebik
Differential Revision: D7631967
fbshipit-source-id: 607a37bd7761d65e0f3a21c44fb137a98a79a1bf
Summary:
Make it clear that all that messages are about autobackup (in background)
Even if it is disabled, manual `hg pushbackup` works
Also, since we announced publicly about renaming infinitepush we should not use it in user facing messages.
Also, that commands enable/disable background cloudsync, probably later we should check if cloudsync is enabled and improve messages to be more precise.
Reviewed By: StanislavGlebik
Differential Revision: D7635640
fbshipit-source-id: 2461b1b45e181c6e24b59f707a17f2fd60d4bb0e
Summary:
Replace the background `hg pushbackup` with a background `hg cloudsync` when
the repo is connected to a workspace.
Reviewed By: StanislavGlebik
Differential Revision: D7586412
fbshipit-source-id: 667ce46ffe83c654b642872633d9b86f29a2d788
Summary:
Make commitcloud push unsynced commits to the server before modifying the cloud
state.
At the moment, this uses an infinitepush push, calling the underlying push
functions directly (since commitcloud knows exactly which commits to push,
there is no point performing discovery to calculate them). Infinitepush pushes
require the full draft stack to be included, but in the future, this will be
replaced with an even smaller push of just the changed commits to Mononoke.
The re-use of infinitepush's internal functions is a bit hacky. Later on I
will refactor the common functionality out to a utility library.
Reviewed By: StanislavGlebik
Differential Revision: D7535890
fbshipit-source-id: 975028a63bd6d9377a37e224a0cfd95ae1f1e16d
Summary:
We may want to use an experimental store for remotefilelog data. This store may
return incorrect data, and cache is going to be poisoned. To prevent it from
hapenning let's add an option that makes it possible to prevent cache
poisoning.
Reviewed By: farnz
Differential Revision: D7615453
fbshipit-source-id: 0ade7407b92a3a32c841f6f0214dc353c30bff59