Summary: This brings the code closer in compliance with Mercurial core.
Test Plan:
Run the tests:
$HGSRC/tests/run-tests.py -l test-smartlog*.t
Reviewers: #sourcecontrol, ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3212394
Tasks: 10804976
Summary: It seems subclassing repo can cause problems when a repo is created before the extension is loaded. This circumvents the issue by directly modifying the data structures in the repo object as needed.
Test Plan: passed test-manifestdiskcache.t
Reviewers: #sourcecontrol, mjpieters
Reviewed By: mjpieters
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3208899
Tasks: 10836392
Signature: t1:3208899:1461336232:617f8b9258f23ba0b34627785dc2cb4bddcee313
Summary:
1) First one is a way to build a checksum from an integer. It's easier to specify this than to come up with a 20B hash.
2) Second one is a quick method to add a bunch of paths to a tree. The checksum is seeded from the checksum mechanism described above.
Test Plan: none
Reviewers: #sourcecontrol, lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3204617
Signature: t1:3204617:1461255135:557bcadd2b7a65797d24d82b0e4335889cb09c15
Summary: I need it for a round-trip manifest iteration test.
Test Plan: used in later diff.
Reviewers: #sourcecontrol, lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3206726
Signature: t1:3206726:1461254828:81ce23f6615ffc007c82aafad79899285c63f219
Summary:
if you run `arc lint --output json` and don't have your environment correctly set up, the failure to run the linter was silently ignored.
I wanted to fix that, but then realized that we could integrate this better without too much effort, hence this diff.
This is a small python script that processes the output from the check code test and captures the appropriate context so that `arc lint` can show you where in the code the problem(s) lie.
Test Plan:
This is the output when the environment is not set up correctly:
```
$ arc lint
>>> Lint for lint.py:
Error (S&RX) ENVIRON
Please either set MERCURIALRUNTEST env var to the full path to
run-tests.py, or add the containing directory to your $PATH
>>> 1
Error (S&RX) ENVIRON
Please either set MERCURIALRUNTEST env var to the full path to
run-tests.py, or add the containing directory to your $PATH
>>> 1
```
This is the same thing but in json output mode:
```
$ arc lint --output json
{".arcconfig":[]}
{"scripts\/lint.py":[]}
{"lint.py":[{"line":"1","char":null,"code":"S&RX","severity":"error","name":"ENVIRON","description":"Please either set MERCURIALRUNTEST env var to the full path to run-tests.py, or add the containing directory to your $PATH","original":null,"replacement":null,"granularity":1,"locations":[],"bypassChangedLineFiltering":null,"context":""},{"line":"1","char":null,"code":"S&RX","severity":"error","name":"ENVIRON","description":"Please either set MERCURIALRUNTEST env var to the full path to run-tests.py, or add the containing directory to your $PATH","original":null,"replacement":null,"granularity":1,"locations":[],"bypassChangedLineFiltering":null,"context":""}]}
```
This shows the lint errors from my `hg publish` stack:
```
>>> Lint for phabricator/arcconfig.py:
Error (S&RX) CheckCode
don't raise generic exceptions
18 def load_for_path(path):
19 homedir = os.getenv('HOME')
20 if not homedir:
>>> 21 raise Exception('$HOME environment variable not found')
22
23 # Use their own file as a basis
24 userconfig = _load_file(os.path.join(homedir, '.arcrc')) or {}
```
Reviewers: #sourcecontrol, ttung, lcharignon
Reviewed By: lcharignon
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3203666
Signature: t1:3203666:1461185075:e9b03c8251d7e3b8e965b81146d17cdeac75d837
Summary: We don't actually need the round-trip conversion tool included in the build.
Test Plan: python setup.py build
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3194060
Signature: t1:3194060:1461230493:df13d543be765ba907048836da2ebb4a0ea25259
Summary: It's the standards-compliant way of formatting integers!
Test Plan: compiles.
Reviewers: #sourcecontrol
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3205016
Summary:
Editorconfig (http://editorconfig.org/) is a file format helping define coding
styles like spaces, tabs etc. It supports a wide range of editors. The upstream
is using it already.
This patch adds a simple .editorconfig, making it clear we use 8-char tabs in
C code, 4-char spaces in Python and Shell scripts, and we don't keep trailing
spaces.
Besides, do a style fixes for `scripts/runcheckcode.sh`. But note that
`scripts/scm-prompt.sh` is left untouched since it was copied from other
repository and we may sync it later.
Test Plan:
Use `gg=G` in vim to format `scripts/runcheckcode.sh` and make sure it does
not showed up in Phabricator with space changes ignored.
Reviewers: #sourcecontrol, durham, ttung
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.fb.com/D3197242
Signature: t1:3197242:1461129423:e24a898370f8e8eb9bea8be414fee8670f06c16d
Summary:
It should have been done in D3191840, which removes the extension without
dealing with the test.
Test Plan: Code Review.
Reviewers: #sourcecontrol, ttung, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3199159
Tasks: 10906130
Signature: t1:3199159:1461128102:38e5c093fa8e36d842936f60bcde90f0846f8d82
Blame Revision: D3191840
Summary:
Core changed the quoting convention in some of the warning messages,
this patch makes fb-hgext up to date with these new conventions.
Test Plan: the tests failing before are passing now
Reviewers: durham, quark, mitrandir
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3198601
Tasks: 10906174
Summary: Living dangerously with a C standard from only 17 years ago!!
Test Plan: make local
Reviewers: #sourcecontrol, akushner
Reviewed By: akushner
Subscribers: akushner, mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3198536
Tasks: 10906159
Signature: t1:3198536:1461103465:3415d87269f703c5cbab51ab3e54f05de6f5b963
Summary:
Before this patch, `runcheckcode.sh` sets an extra config option
`extensions.lz4revlog=`, which will break if lz4revlog is not installed
in the system. This patch drops the config option if the repo does not
require `lz4revlog`.
Test Plan: Run `runcheckcode.sh` in both lz4revlog and non-lz4revlog repos.
Reviewers: #sourcecontrol, ttung
Reviewed By: ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3196200
Signature: t1:3196200:1461088741:11cfc8f3236f471e060e768c01a772072543e6fc
Summary:
Since `handlecommandexception` is in core, wrap it to suppress original
crash text, instead of doing an ugly `sys.exit()`. It's much simpler and
cleaner than before. It also fixes an issue with current chg since chgserver
will print an traceback when it encounters SystemExit.
Although `logtoprocess` are doing very similar things with `errorredirect`,
it currently cannot replace `errorredirect` because we need synchronized
behavior to return the user to their shell prompt correctly. If we can get
the synchronized behavior and a way to disable builtin warning (may be tricky)
in `logtoprocess` upstream, the `errorredirect` extension could be just a thin
wrapper around `logtoprocess` using `setconfig`.
Besides, we no longer need `suppresscommandfailure` since the feature will
be either in `errorredirect` or `logtoprocess`.
Test Plan:
Run `hg crash` with `errorredirect.script` set to confirm it is compatible
with the old behavior.
Also run unittest `test-errorredirect.t`
Reviewers: #sourcecontrol, ttung, mjpieters
Reviewed By: mjpieters
Subscribers: rmcelroy, durham, lcharignon, mjpieters
Differential Revision: https://phabricator.fb.com/D3191840
Signature: t1:3191840:1461088280:77febd539c2f38a55778af3977738c045f63a0d8
Summary:
A couple of clean-ups for rage.py. They are small and easy to review so I'm doing it in one diff:
- Change the default behavior to print instructions asking for help in the support group.
Since only about 20 hg rage (not counting test ones) tasks are created last year.
The old behavior of creating tasks is still accessible by using the `--oncall` flag.
- Collect more information:
- `hg sparse`
- `hg version`
- `obsstore size`
- `rpm -q mercurial`
- network information
- short `hg config` only including local configs
- Adjust the order of detailed message, move hg config down since it's very long.
- Remove atexit error printer. Instead, put them in rage info directly.
- Fix code style: remove underscores in variable names, remove unnecessary indentation.
- Mark it FBONLY since it uses `tasks` and `oncalls` which are not available outside.
Test Plan:
Make sure these all work as expected:
hg rage
hg rage --preview
hg rage --oncall
Reviewers: #sourcecontrol, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: ikostia, ttung, rmcelroy, simonfar, mjpieters, sid0
Differential Revision: https://phabricator.fb.com/D3138673
Tasks: 10654995, 10332733
Signature: t1:3138673:1461070413:4547d8b7e438035d6af73a49094c10eab725af0d
Summary:
This change fixes up tests to track graphmod changes.
The change for the smartlog test is a temporary stop-gap measure, as smartlog
itself will be updated soon to track the changes in better ways.
Test Plan:
Run the test-suite, ignore unrelated failures in test-morestatus.t, test-mergedriver.t
and test-fastmanifest.t
Reviewers: #sourcecontrol, ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3191336
Tasks: 10804976
Summary: It's too common of a name.
Test Plan: compiles && unit tests pass.
Reviewed By: lcharignon
Differential Revision: https://phabricator.fb.com/D3192722
Summary:
This patchs adds a debug flag to test fasmanifest for all operations.
It also fixes the module declaration in the fastmanifest_wrapper
Test Plan: Test pass
Reviewers: ttung, durham, rmcelroy
Differential Revision: https://phabricator.fb.com/D3186826
Summary: They are never read normally, except for checksum calculation. However, we cannot let them be free-floating values because they'll affect the checksums and give us incorrect results.
Test Plan: passed a test (in a later diff) without triggering valgrind
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3155436
Tasks: 10644245
Signature: t1:3155436:1460106747:9b6281490d8fe8cfeeeac8036ca7ca8e68f256d8
Summary: When we create new intermediate nodes as part of add_or_update_path, we add them with max_children=0. However, the next action we do is to add a child, which immediately forces us to expand the node we just created. This is wasteful. We will now hint how many children the node is likely to have. 0 if it's a leaf node, or 1 if it's an intermediate node.
Test Plan: passed unit tests
Reviewers: lcharignon, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3155429
Signature: t1:3155429:1460120985:eb7ba4a3731c717fa6a9c61597a0fc980caa7589
Summary: It doesn't copy the checksum_sz and flags fields over. This is a serious problem as they are used in checksum calculation.
Test Plan: wrote unit test to verify the metadata is copied over. failed. updated code to copy the metadata over. tests pass!
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3155393
Tasks: 10644245
Signature: t1:3155393:1460136520:10d75c5181eda88139df26d57a560af95f8ed69d
Summary: It's only used internally, so it doesn't need to be in tree.h
Test Plan: passed unit tests.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3151313
Signature: t1:3151313:1460139292:ac5918f0d7249c81c31537396434f9b04c4a5a8f
Summary: When we add or remove something to a path, we need to ensure that all the directory nodes leading to that path entry have their checksums invalidated. This test verifies that behavior, and ensures that directory nodes that do *not* lead to the path entry are not invalidated.
Test Plan: pass unit test. found the bug in D3143825
Reviewers: lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3143832
Tasks: 10697482
Signature: t1:3143832:1460587147:1948e6c01a2799d5010174ff8be22830f0cb9c53
Summary: If the changes metadata structure is not updated, then we will not update the directory nodes as we walk up.
Test Plan: pass a unit test in a later diff.
Reviewers: lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3143825
Tasks: 10697482
Signature: t1:3143825:1459971608:9e5d91bf80020cf71cfc5aca6fb72c8cc67dce59
Summary: Not sure it's functional, but once it is, it's benchmark-able!
Test Plan: compiles and runs.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3141571
Signature: t1:3141571:1460071270:5bbb1d32bd97406d2cfd88955fabe29763132c7b
Summary: Incremented the wrong value. Caught this when running a unit test to update the checksum of an empty tree.
Test Plan: passes unit test now.
Reviewers: lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3140684
Tasks: 10697482
Signature: t1:3140684:1459903366:be1b970281e0df91b2a62e7fac2c1d417a8be221
Summary: Since I'm adding a .c file, TEST_HEADER_FILES is not really an accurate description.
Test Plan: pass unit tests.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3140374
Signature: t1:3140374:1460071293:77e11a27249196564f2ee816cc50e67951325a75
Summary: I need this to be able to access directory nodes for checksum testing.
Test Plan: passed unit tests
Reviewers: lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3140368
Tasks: 10697482
Signature: t1:3140368:1460584956:671cd08ca174795445a297ef75bee53d9f09a8ad
Summary: logtoprocess is now in core mercurial as an experimental extension.
Test Plan: -
Reviewers: #sourcecontrol, ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3191121
Tasks: 10805001
Summary:
Support both fsmonitor and hgwatchman for now, until fully rolled over to
fsmonitor.
Test Plan:
Run $HG/tests/run-tests.py test-sparse-extensions.t (disable simplecache lines
if not installed to ensure the fsmonitor test at least runs).
Reviewers: #sourcecontrol, ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3174946
Tasks: 10804941
Summary: This adds end to end proof of concept of manifest caching supporting
different manifest type
Test Plan: Added a test
Reviewers: ttung, durham
Differential Revision: https://phabricator.fb.com/D3129530
Summary:
We got the diagnosis information confirming our assumption but the
test is flaky and outputs different results every time. Let's remove the flaky
part of the test.
Test Plan: The test pass always
Reviewers: durham, rmcelroy, quark
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3163545
Summary:
The automv extension is now in mercurial core. Both dev servers and laptops
already use the upstream extension.
Test Plan:
run `hg debugextensions --config "extensions.automv=" --debug | grep automv` to
confirm that the extension is loaded from `hgext`.
Reviewers: #sourcecontrol, ttung, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.fb.com/D3162775
Signature: t1:3162775:1460388914:20c5afff1dbf191fde476b6f8d2a210e83d33742
Summary: I'm planning on building a find_path traversal that exposes directories, and make it available for tests.
Test Plan: pass unit tests.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3138945
Signature: t1:3138945:1460071138:3eb43a1742c8b0d856f0b97421eb499d9e328310
Summary: It's also in tree.c. Right now, it's a static function, but I'm planning on make it non-static.
Test Plan: pass unit tests
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.fb.com/D3138923
Signature: t1:3138923:1460071054:9105ffcbff2b4330faf22652755dc28d8313c5e2
Summary: As far as the consumers of this library are concerned, directories are a non-entity.
Test Plan: wrote a unit test. unit test fails. made the change in `test.c`, all unit tests pass.
Reviewers: lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3135694
Signature: t1:3135694:1459809348:5b120e527427032857aa976278cca2ef8d3f1372
Summary: Callers of `get_path` do not need to know the internal representation of a node. All they are interested in is the presence, the checksum, and the flags.
Test Plan: passed unit tests
Reviewers: lcharignon
Reviewed By: lcharignon
Subscribers: mitrandir, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D3135625
Signature: t1:3135625:1459809298:4bd982091219fa94a1cfcc18238784c9c6e201b8