Summary:
Previously we allowed a sync commit to happen at any time, but imported the
full repository to bring it into sync. This is slow for very large repositories
and might be accidentally triggered. We change this behavior to only do a sync
commit if only the imported client changed but nothing else.
Reviewed By: dsp
Differential Revision: D6838370
fbshipit-source-id: eecdfb0ea295585058784f8d1f70de5f8c733645
Summary: Adds output to hg sparse --refresh for long running calculations, --verbose adds more notes on progress.
Reviewed By: ryanmce
Differential Revision: D6886545
fbshipit-source-id: 9fe176724bec0cb56bc8da4939f42a6e7745cf41
Summary:
lfutil contains a lot of code that works for `largefiles` extension,
which has been removed. Since we only need its `link` feature now,
write an alternative `link` function and remove `lfutil`.
Reviewed By: ryanmce
Differential Revision: D6901622
fbshipit-source-id: ec66f78a97ec443fbd29a9b93c297d15675f4694
Summary:
Previously there is no way to disable the global cache, since an empty
`lfs.usercache` means a default location.
This patch changes the meaning of an empty `lfs.usercache` to "disable".
This is useful for cases when the user cannot write to `~/.cache` and is
using the default configuration.
Reviewed By: ryanmce
Differential Revision: D6890047
fbshipit-source-id: 352dea5142178d5331e37a48957d9d2b8af26ab5
Summary:
Previously a stress test that runs a single test in parallel will have race
condition on HGPORT. This patch randomizes the port so the race becomes
unlikely.
Reviewed By: DurhamG
Differential Revision: D6900641
fbshipit-source-id: 2ad741032e3aa9b0cc9fa831fa57907cc493ce37
Summary:
We have seen bad `hg gc` behavior on Lego-Windows, caused evidently by the fact
that we currently use plain Python `open` and `os.unlink` instead of
Mercurial's advanced `posixfile` and `unlink`.
Reviewed By: DurhamG
Differential Revision: D6900689
fbshipit-source-id: cd7ebbbb734a6163d062622d1d4606fad43c91ac
Summary:
When simplecache is configured to use `local` cache, it tries to write files
into a cache directory on a machine. The file names are the key names and they
can contain ':' characters, which are prohibited in Windows filenames. Let's
replace them with '!' which are equivalently unlikely to be parts of actual
files in the repo, yet are allowed on Windows.
Reviewed By: ryanmce
Differential Revision: D6900184
fbshipit-source-id: d901f2ff6e0e6e8b2a0ca93db32b4a836dccd048
Summary:
Convert apparently greps commit messages to replace hashes with the new
version. There can exist hash looking strings that aren't actually in the
repository though, so let's catch that and prevent convert from crashing.
Reviewed By: quark-zju
Differential Revision: D6887531
fbshipit-source-id: 26397ce11f03146b2fe9fbf45174af892cc14e66
Summary: commit cloud: consider hidden revisions as well on hg up by default
Reviewed By: markbt
Differential Revision: D6899232
fbshipit-source-id: 2b160e7c90c4fde2a7d757d4239a5316115d42b0
Summary:
This assert appears to have always been wrong, but only respected when
built by clang. The SubtreeIterator class is created with an empty string in the
path member, and the only entry to the class is the next function which
immediately asserts that path is not empty. Since the only place path is set is
later in the function, there's no way it could start off as anything other than
empty.
Reviewed By: quark-zju
Differential Revision: D6891356
fbshipit-source-id: c55e616461d4a29308ca6e22be51ea02962d9df3
Summary: This was just plain broken before. I added a test.
Reviewed By: DurhamG
Differential Revision: D6882388
fbshipit-source-id: 5450b50fa81d22ce0b6e9e4ed5aab1abc6755edc
Summary:
This solves issues when the binary is linked with another C library that define
those functions.
Reviewed By: DurhamG
Differential Revision: D6888242
fbshipit-source-id: d714c7eb18bc4c281912df50567e7f176d64a669
Summary:
The ShellCheck linter:
- Conflict with hg check-code. ex. on "$()" vs "``".
- Over picky. ex. SC2148 should only run on scripts with `x` bit.
Therefore disable it for scm/hg.
Reviewed By: zertosh
Differential Revision: D6887739
fbshipit-source-id: 9447a4582ab5d2798a382d9dc715eb319d4255c0
Summary: `fastverifier` was sometimes being overriden by `shallowverifier` when remotefilelog was enabled. Since the latter is a subset of the former, let's just fold both into the core verifier code backed by a config, `verify.skipmanifests`, that we can default to true.
Reviewed By: DurhamG
Differential Revision: D6882222
fbshipit-source-id: 9f337ca031a070425ccdc9ee02f6765e68436da9
Summary:
Backport the build script so it's now buildable on Linux.
Add a hard-coded fallback version `4.4.2` in `setup.py` when `hg` cannot be
found. This makes the build not depending on hg - to allow bootstrapping on
Arch Linux - you can scp the files needed to do the build, without requiring
a special hg that can read fbsource.
Note: an hg that can work with the LFS extension is still needed. But that
is just `sudo pacman -S mercurial`.
Reviewed By: DurhamG
Differential Revision: D6827349
fbshipit-source-id: 45ea75175d8890a845d987cfe2be33251cd1a806
Summary:
A lot of tests rely on `python` interpreter being able to do
things like `import mercurial`. This becomes tricker if hg is
built as a single binary by buck.
Therefore also add a interpreter target that can be used as
a drop-in replacement of `python` in tests.
Reviewed By: DurhamG
Differential Revision: D6879868
fbshipit-source-id: 2b1d2b6306e74ceff86750d1f86387b9fa493f9a
Summary:
The old mercurial.dispatch entry point works, except it breaks
extensions wrapping `dispatch.*` (ex. `dispatch.runcommand`).
That is because things happen in this order:
- Buck's python wrapper imports `mercurial.dispatch` as mod1.
- hgdemandimport is enabled.
- An extension imports `mercurial.dispatch` and it got mod2.
- mod2 != mod1. So any changes to mod2 won't be used.
Using a separate module (`mercurial.main`) as the entry point
solves the problem.
Reviewed By: DurhamG
Differential Revision: D6879873
fbshipit-source-id: 9779edac64bbeb53dd98dfab1b21575c3a60af01
Summary:
The script is intended to be used in `python_unittest` target
in buck.
Reviewed By: DurhamG
Differential Revision: D6879870
fbshipit-source-id: 9ed27a691aa23b41dd2620be7871c0a005df60d0
Summary:
Newer dulwich will issue warnings that break hggit tests, like:
```
--- hg/tests/test-hggit-merge.t
+++ hg/tests/test-hggit-merge.t.err
@@ -32,6 +32,26 @@
Initialized empty Git repository in $TESTTMP/gitrepo2/
$ hg clone gitrepo hgrepo | grep -v '^updating'
+ hggit/git_handler.py:1250: DeprecationWarning: Use FetchPackResult.refs instead.
+ return ret if ret else {}
+ hggit/git_handler.py:278: DeprecationWarning: Use FetchPackResult.refs instead.
+ if refs:
+ hggit/git_handler.py:1285: DeprecationWarning: Use FetchPackResult.refs instead.
+ for ref, sha in refs.iteritems():
+ hggit/git_handler.py:1295: DeprecationWarning: Use FetchPackResult.refs instead.
+ return util.OrderedDict((r, refs[r]) for r in filteredrefs)
+ hggit/git_handler.py:1379: DeprecationWarning: Use FetchPackResult.refs instead.
+ keys = refs.keys()
+ hggit/git_handler.py:1415: DeprecationWarning: Use FetchPackResult.refs instead.
+ heads = dict([(ref[11:], refs[ref]) for ref in refs
+ hggit/git_handler.py:1416: DeprecationWarning: Use FetchPackResult.refs instead.
+ if ref.startswith('refs/heads/')])
+ hggit/git_handler.py:285: DeprecationWarning: Use FetchPackResult.refs instead.
+ symref = refs['HEAD']
+ hggit/git_handler.py:289: DeprecationWarning: Use FetchPackResult.refs instead.
+ rnode = refs['refs/heads/%s' % rhead]
+ hggit/git_handler.py:1451: DeprecationWarning: Use FetchPackResult.refs instead.
+ for ref_name, sha in refs.iteritems():
importing git objects into hg
```
Since hggit code still needs to support newer and older dulwich,
Ignore the warnings to make the test pass.
Reviewed By: DurhamG
Differential Revision: D6881696
fbshipit-source-id: 576940be99bcce1ee194cff0cdc655b16c8a6e83
Summary:
So the use of `os.path.dirname(__file__)` which won't work in buck
python binary can be removed.
Reviewed By: DurhamG
Differential Revision: D6881306
fbshipit-source-id: b6504beaf07fe9853abff08b9721a17b31ac7515
Summary:
This allows `HGDATAPATH` to override where to look for data files
like builtin configs, templates, help texts.
It'll be useful for running tests with a packed hg binary.
Reviewed By: DurhamG
Differential Revision: D6879865
fbshipit-source-id: 4638a9eff62a5fab088215cbeb72740bb67cac04
Summary:
Both chg and a packed python binary can add extra traceback
entries. So let's grep out the important lines.
Reviewed By: DurhamG
Differential Revision: D6879869
fbshipit-source-id: e97de7d2cfe512de2340ebb25e8ac93c360d5b9e
Summary:
With `buck build`, the single hg binary won't be guarnateed to have
access to i18n messages because directories like `mercurial/locale`
do not exist on filesystem. It could also mess up with `PYTHONPATH`
somehow because the python binary wrapper sometimes ignores
`PYTHONPATH`.
So let's add a hghave feature for it. And gate troublesome tests
with `#if normal-layout`.
Reviewed By: DurhamG, phillco
Differential Revision: D6879876
fbshipit-source-id: 3d63605b55c8f7096093b89be824add2ec491f81
Summary: This allows CHG to override the chg program being used in tests.
Reviewed By: DurhamG
Differential Revision: D6879866
fbshipit-source-id: c6955609e2b6938d7e26d9b42aa0f6221396a4ad
Summary:
This can be used by a wrapper script running a single test
to detect whether the test is skipped or not.
Reviewed By: DurhamG, phillco
Differential Revision: D6879864
fbshipit-source-id: 8bc535fccdbc6ad32eec870bd9e503b6f84f694b
Summary:
run-tests.py creates the `python` symlink. Let's do the same for `hg`.
This means tests can just use `hg` and do not worry about it being a
wrong one (like, the system hg). And there is no need to create fragile
shell alias, or set `ui.remotecmd`.
The check to ensure `--with-hg` provides either `hg` or `hg.exe` was
removed since it's no longer necessary.
Reviewed By: DurhamG
Differential Revision: D6879879
fbshipit-source-id: 59255102ea3c4c646afc7900696403242bcfb4db
Summary:
With the upcoming `buck test` change, the default timeout is
not enough because of the python wrapper overhead. Let's double
the limits.
Reviewed By: DurhamG
Differential Revision: D6879874
fbshipit-source-id: 19175be8c4f48dda1fc8917d75798d840d4082da
Summary:
When `--with-hg` and `-l` are both provided. `-l` will override
`--with-hg`, which is unfriendly. Let's do the reverse.
Reviewed By: DurhamG
Differential Revision: D6879863
fbshipit-source-id: 00ea9805431cc7afa6dd521cfb9059c898ed6d1f
Summary:
This fixes `test-check-module-imports.t` running under `buck test`
because `lz4` is not treated as a system module.
Reviewed By: DurhamG
Differential Revision: D6881307
fbshipit-source-id: 26a7e2d36c1ae6815064de15c6bdcb6e762c8ddf
Summary:
`test-check-help.t` could run `hg help` and that command shouldn't be affected
by the current repo requirement. So let's add `--cwd /`.
`helpers-testrepo.sh` uses `-R path` and that only works if path is the repo
root. It's not guarnateed now. So let's use `--cwd` instead.
Reviewed By: DurhamG
Differential Revision: D6879867
fbshipit-source-id: 0b40ab71acf7eb215834ce323fc16156da9afcd3
Summary:
`lz4.block` needs to be imported explicitly before being able to
use `lz4.block.compress`.
We didn't notice this because we're using an old version of
`python-lz4`.
Reviewed By: DurhamG
Differential Revision: D6879877
fbshipit-source-id: 37e8fdc00386bef3733753f925ad308f42e5a740
Summary: This should be removed with D6865042.
Reviewed By: phillco
Differential Revision: D6879861
fbshipit-source-id: 960a9ab643f63d6d4a01dfb0ab7af77616cf9ea2
Summary:
Let's collect how long we wait for a pager so that we can later subtract it
from the elapsed time.
Currently, it's impossible to compute `elapsed - pager - editor - stdio`, which
would include startup time.
Reviewed By: quark-zju
Differential Revision: D6875447
fbshipit-source-id: d055e4ba5bf1ab7ee9e567c99b6708321ab7705b
Summary:
When building a changegroup, sometimes we need to access the list of
files changed by each commit. To do so we need to inspect the manifest.
Previously this would end up downloading each tree one-by-one, producing a bunch
of pack files. With this patch we now do one bulk download at the very
beginning.
Reviewed By: quark-zju
Differential Revision: D6873076
fbshipit-source-id: b916c15efca0770129340f798d3e7b165da6aec9
Summary:
A future diff will add tree prefetching during changegroup creation. This
requires access to the tree prefetch function from the shallowbundle class.
let's move the prefetch functions onto the repo object in preparation for that.
Reviewed By: quark-zju
Differential Revision: D6873055
fbshipit-source-id: 18de0ee0f6ab566587509f9e23ebb2e5779ed1c8
Summary:
treedirstate: bugfix
Incorrect usage of write function that can cause corrupted files in some cases.
Write doen't guarantee all data will be written. Function write_all should be used instead.
https://doc.rust-lang.org/1.0.0/std/io/trait.Write.html#tymethod.write
See: It is not considered an error if the entire buffer could not be written to this writer.
Function returns number of bytes written.
Reviewed By: markbt
Differential Revision: D6883057
fbshipit-source-id: 4bc18cc9fa6e5db0ae8516d67dd6ba92c1facf21
Summary:
setuptreestores caters to a lot of configurations through the `ui`
instance. It makes sense to store the `ui` instance once instead of referring
to it through `repo.ui` every time.
Reviewed By: DurhamG, quark-zju
Differential Revision: D6867843
fbshipit-source-id: 3ffca85332ec4ae3ec8a54bf0dacc7e7cf423b53
Summary:
Now they are unnecessary since `run-tests.py` will set up `PYTONPATH`
correctly.
Differential Revision: D6865042
fbshipit-source-id: ca95314f725968e14349a9d916434aa832c596f9
Summary:
`hg rebase -i` only works if the source revision is ancestor of the working
directory parent. This updates the code to fail with an error message in this
case instead of rebasing nothing and reporting success.
Note that attempting to change the revset calculation to use `src::` instead
of `src::.` doesn't help fix anything--the histedit code simply rejects the
histedit operation when it finds commits that are not ancestors of the working
directory.
Reviewed By: quark-zju
Differential Revision: D6853548
fbshipit-source-id: 14600f31a5f4ca43c89a81e7b522656b65a056dc
Summary: test-p4fastimport-import-badsymlink.t is failing the regex match P58977427, and this fixes it.
Differential Revision: D6836164
fbshipit-source-id: df43a9e5e30a2745a5dbb36bc6cc07ab81179525
Summary: backout: use only first line of original commit message (title) for backout default message.
Reviewed By: phillco
Differential Revision: D6846109
fbshipit-source-id: 68efbff9db698599a12cef45de7ab4af96cf184f
Summary:
Improve UX for short hash infinitepush feature
I would like to provide some suggestions in case there are several with the same prefix,
so we can provide better user experience.
Reviewed By: markbt
Differential Revision: D6845233
fbshipit-source-id: 4868c1dc599f60e4ac495b71a4aed2d57c36ffa4
Summary:
Adds telemetry showing the status of watchman during an invocation of HG.
The new key, `fsmonitor_status` takes the value:
* `exception` if an exception occurred during the call to watchman.
* `unavailable` if watchman was unavailable.
* `fresh` if a fresh instance of watchman was encountered.
* `normal` if watchman was available normally.
Differential Revision: D6845070
fbshipit-source-id: 5ccf61a1009cdccbc0d1786b2533c3a7fc6ac2c9
Summary:
D6827925 deletes drawdag.py from the tests directory; because the
tests in that revision were run on a repo with .pyc files left behind, the test
failure never happened. Move the test to the new location
Differential Revision: D6845181
fbshipit-source-id: 33c2836d81f66c9cc2a8e82a78b2d6835278a2ac