There's no need to do this and not doing so speeds up IMM tremendously when the sparse profile had to be adjusted.
(This is the grafted version from the fb-hgext repo)
Test Plan:
I ran an IMM before and after this change. Both succeeded but the later version was
much faster.
Differential Revision: https://phab.mercurial-scm.org/D1805
Summary: This is a quick way to ensure that if IMM goes wrong in a way that isn't conflict related (e.g. an uncaught exception) we restart and log to scuba.
Test Plan: ./run-tests.py
Reviewers: durham, quark, #mercurial
Reviewed By: durham, quark
Differential Revision: https://phabricator.intern.facebook.com/D6734117
Signature: 6734117:1516152432:5620b12579d41dca2ea8f15b08a8007e2f6467fc
Summary:
This if statement is testing whether we ever set any data, not whether the data is truthy.
This can cause a bug where rebasing an empty file can cause IMM to fail and restart.
Test Plan: ./run-tests.py
Reviewers: durham, #mercurial
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D6687459
Signature: 6687459:1515535581:c2018237f3ca9daed6a0cb2f5a1475d1dc8e4865
Summary:
Before, we would raise whenever the `usemergedriver` condition was set when merging in-memory,
which equated to "any merge with (cd, dc, or m) actions in a repo with a mergedriver script".
This was done to be as conservative as possible.
However, a better solution is to run the preprocess() script and only raise if any files are
marked to actually be driver-resolved. That way we only restart the merge if we absolutely need
to.
Since some of our preprocess() scripts aren't ready yet, I also added
experimental.inmemory.nomergedriver in a previous change so we can deploy this in a build before the preprocess scripts are good to go.
Test Plan: ./run-tests.py
Reviewers: quark, #sourcecontrol
Reviewed By: quark
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6668426
Signature: 6668426:1515185050:a640208454caf053f8213b831d0f8e645ebe682c
Summary:
This gives us an easy way to ensure IMM is disabled automatically if the user configures a
mergedriver script.
Test Plan: run-tests.py
Reviewers: durham, #sourcecontrol
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6668421
Signature: 6668421:1515185587:a190311f1d57a9a604cb609a63ebc296dad11db3
If the user specifies a ui.origbackuppath, we used to always copy the file
there, but if the source file is in memory we must write it instead of copying.
Differential Revision: https://phab.mercurial-scm.org/D1806
Summary: Log whichever paths were driver-resolved but not in experimental.inmemorydisallowedpaths, so we can update experimental.inmemorydisallowedpaths and keep the experience of rebasing with IMM and
mergedriver a pleasant one.
Test Plan: .
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6656159
Summary: Fixing a bug that causes a fatal crash when a user attempts to delete a bookmark by inputting it's name twice, for example:
# hg bookmark --delete name name
Test Plan: The following test has been added in the test/test-bookmarks.t file
https://pxl.cl/bmTf
to test the new functionality:
~~~
kosullivan-mbp:hg-crew kosullivan$ hg diff tests/test-bookmarks.t
diff --git a/tests/test-bookmarks.t b/tests/test-bookmarks.t
--- a/tests/test-bookmarks.t
+++ b/tests/test-bookmarks.t
@@ -288,6 +288,10 @@
abort: bookmark 'A' does not exist
[255]
+ensure bookmark names are deduplicated before deleting
+ $ hg book delete-me
+ $ hg book -d delete-me delete-me
+
bookmark name with spaces should be stripped
$ hg bookmark ' x y '
~~~
Reviewers: rmcelroy,rafeca
Subscribers: suiting
Tags: python,bootcamp,source_control
Tasks: 22525999
Differential Revision: https://phabricator.intern.facebook.com/D6711774
Summary:
Our new build process is slow because of all the rust and everything. I've seen
test-hghave.t time out a couple of times already.
Test Plan:
- `./run-tests.py -l test-hghave.t` - pass
- `./run-tests.py test-hghave.t` - pass
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6726709
Summary:
The initial value of lastdestnode should be the commit onto which the rebase is
happening.
It should be updated whenever a new commit is added for which the p1 parent is
the old last dest node.
Test Plan: Run the new test, and show it now works.
Reviewers: durham, rmcelroy, #mercurial
Reviewed By: rmcelroy
Subscribers: mitrandir
Differential Revision: https://phabricator.intern.facebook.com/D6709108
Signature: 6709108:1515760332:32bef9892792c7c94117b8fe14364937d98ebbac
Summary:
If pushrebase is asked to rebase a commit where the p2-parent is the route to
the commit onto which the rebase is being made, then it is supposed to flip the
parents. This is what ensures that the changes from the server-only commits
are not lost.
This doesn't work. In this test, the "other" file, created on the server, is
lost in the final merged commit.
Test Plan: Added a test which demonstrates a failure.
Reviewers: quark, #mercurial
Reviewed By: quark
Subscribers: quark
Differential Revision: https://phabricator.intern.facebook.com/D6709096
Signature: 6709096:1515794007:0908765c24b18a7dcaf3672953e816095b0acf68
Summary:
This was leading to 'mercurial.error.ForeignImportError' while running
some tests like 'test-fb-hgext-phabstatus.t' during hgbuild. Thanks @quark for
the fix!
Test Plan:
```python setup.py install --user && cd ~/.local && find -type d -name 'phabricator'```
contains `hgext/extlib/phabricator`
Reviewers: quark, #mercurial, #sourcecontrol
Reviewed By: quark
Subscribers: quark, awestern
Differential Revision: https://phabricator.intern.facebook.com/D6716979
Signature: 6716979:1515801243:77b9681c15617c88a2b2b9e1f1e15ca19c3b0346
Summary:
Demonstrate the full power of this batte station with the first extension to be default-enabled, `githelp.py`. This also lets us write a test for `DEFAULT_EXTENSIONS`
(`test-extensions-default.t`)
All other test changes are actual fallout from enabling the githelp extension.
Test Plan: Added a test.
Differential Revision: https://phabricator.intern.facebook.com/D6717098
Summary:
Based on in-person discussion in the warroom, we think this is the right path forward to "upstream" certain extensions without actually folding them into the mercurial/ codebase.
Enabling extensions by default achieves most of our goals (testing _everything_ in tests, reducing configuration permutations) without having to pay an up-front cost of fixing all the code today or accepting subpar code in mercurial/.
Test Plan: ./run-tests.py.
Reviewers: quark, #mercurial
Reviewed By: quark
Subscribers: quark
Differential Revision: https://phabricator.intern.facebook.com/D6716674
Signature: 6716674:1515803845:a209ec288341e4de8e79fd3759250e834a3573e3
Summary: Based on feedback to D6687860.
Test Plan: n/a
Reviewers: durham, #mercurial
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D6714211
Signature: 6714211:1515788399:386b8f7330f343349234d1f317e5ac0a594142cf
Summary: The text was wrong.
Test Plan: Make sure the new text match the function signature.
Reviewers: mitrandir, #mercurial
Reviewed By: mitrandir
Differential Revision: https://phabricator.intern.facebook.com/D6710509
Signature: 6710509:1515758961:65184b83ddda417c9125c675986093ef52660fbb
Summary:
These import statements are actually broken -- I don't know how they were working before. (Perhaps because `demandimport` tries a few different paths.)
But this makes them work without demandimport.
Test Plan: HGDEMANDIMPORT=disable ./hg st
Reviewers: quark, singhsrb, #mercurial
Reviewed By: singhsrb
Subscribers: quark
Differential Revision: https://phabricator.intern.facebook.com/D6713858
Signature: 6713858:1515787418:23a78b8a439e7d114ead81dc9a136478f98f7e50
Summary: Seems like an oversight
Test Plan: hg status
Reviewers: singhsrb, #mercurial
Reviewed By: singhsrb
Differential Revision: https://phabricator.intern.facebook.com/D6713825
Signature: 6713825:1515786595:2cd62e8f86bac3ab7d5dbf6e7bd59bca05ddc634
Summary:
The vendored crates currently untar to build/build. Now that the build script
chdirs to build/, there's no need to pass that to tarfile.extractall.
Test Plan: `make clean ; make local`
Reviewers: quark, #mercurial
Reviewed By: quark
Differential Revision: https://phabricator.intern.facebook.com/D6713510
Signature: 6713510:1515785178:042124a6592aa04ab1e6748596f6615cd61e8df3
Summary: When running hg ssl, if the .arcrc file is not proper JSON
(e.g., has a trailing comma), json.loads raises an exception that
was not being caught and lead to a stacktrace.
Test Plan: Locally run hg ssl with a bag .arcrc and the stack trace was gone.
Also write a test in test-fb-hgext-phabstatus.t
Reviewers: simonfar
Subscribers: luizmramos
Tasks: T24993088
Tags:
Summary: Switch from dewey to in-repo LFS utility.
Test Plan:
Run `make local` on my Arch Linux. Check `hg-vendored-crates.tar.gz` was
downloaded and stored in `build/`. Run `make local` again and make sure it
says:
hg-vendored-crates.tar.gz was already downloaded and up-to-date
Reviewers: mbthomas, #mercurial
Reviewed By: mbthomas
Differential Revision: https://phabricator.intern.facebook.com/D6706906
Signature: 6706906:1515723430:233ccbb47286dbc4e5d856ff4b20c848b281928c
Summary:
This allows the lfs module to be enabled via path like `lfs=.../hgext/lfs`.
It's used by the next patch.
In the future, we will likely just delete largefiles extension so the duplication
is temporary.
Test Plan: Ran all tests.
Reviewers: mbthomas, #mercurial
Reviewed By: mbthomas
Differential Revision: https://phabricator.intern.facebook.com/D6700815
Signature: 6700815:1515722229:a3a331ca8a73491070ffe6c6af1f9919e2cdbaab
Summary:
The 'svnadmin' version on the system can be different from the one
expected the tests which leads to issues. Using the same logic as in commit
'39750dc6a11476d1a967311bef21f205f306f67d'.
Test Plan: cd tests/hgsubversion && ./run.py test_svnwrap.py
Reviewers: durham, #mercurial, #sourcecontrol
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D6708715
Signature: 6708715:1515718219:178b69a72193057214586d1618c6dc8846bf2f52
Summary:
In three places hgsubversion was assigning a mutable object as a default parameter, a risky construct that was causing test-check-pylint.t to
fail. The pylint test is useful, so let's just fix these call sites.
Test Plan:
Run `test-check-pylint.t` before and after, see the following block disappear:
```
+ ************* Module hgext.hgsubversion.util
+ W:225, 0: Dangerous default value [] as argument (dangerous-default-value)
+ ************* Module hgext.hgsubversion.wrappers
+ W:405, 0: Dangerous default value [] as argument (dangerous-default-value)
+ ************* Module hgext.hgsubversion.svnrepo
+ W:115,12: Dangerous default value [] as argument (dangerous-default-value)
+ [4]
```
Reviewers: durham, quark, #sourcecontrol
Reviewed By: durham, quark
Differential Revision: https://phabricator.intern.facebook.com/D6701282
Signature: 6701282:1515649087:4edc2442bc3efea5d402d7a5ab6c552c7e43e61d
Summary: Some files had missing imports; fix them.
Test Plan: Test suite now has fewer failures.
Reviewers: singhsrb, #sourcecontrol
Reviewed By: singhsrb
Subscribers: singhsrb
Differential Revision: https://phabricator.intern.facebook.com/D6701257
Signature: 6701257:1515648742:cf402234bbe67b08138f942ead8240a596298b7e
Summary:
Moving stuff into fb/packaging broke a few tests since they're
trying to apply the Mercurial linters on scripts that don't conform.
Let's exclude these directorites for now.
Test Plan: This fixes a test.
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6701215
Summary: D6700784 encoded the the incorrect path. This commit addresses that.
Test Plan: Ran all the tests
Reviewers: singhsrb, #mercurial, #sourcecontrol
Reviewed By: singhsrb
Differential Revision: https://phabricator.intern.facebook.com/D6700869
Signature: 6700869:1515643366:9de76782a770b7ddc42b09bd06d07038f25c20b7
Summary:
D6700605 exposed new code to tests which resulted in some issues. This
commit addresses those test failures.
Test Plan: Ran all the tests.
Reviewers: phillco, #mercurial, #sourcecontrol
Reviewed By: phillco
Differential Revision: https://phabricator.intern.facebook.com/D6700784
Signature: 6700784:1515640770:034c3ccd602abc0b546d3936a31418803c17247b
Summary:
We'd like to have a lightweight, portable tool to upload and download certain
binaries without checking them in.
This diff makes LFS do that. It's intended to be used for Rust vendored assets,
Cython and other dependencies' tarballs, and a prebuilt Python using MSVC on
Windows.
Comparing with dewey, this would unblock our Windows build.
Test Plan: Added a test.
Reviewers: durham, #mercurial
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6699099
Signature: 6699099:1515633647:2fb90c8ecb4395b0b12e8e8baf1c5ee7fa4d84b0
Summary:
A remote blobstore should have nothing to do with a local repo. It only
cares about certain configs. Let's make it so.
This makes the next change cleaner.
Test Plan: Ran all tests.
Reviewers: phillco, #mercurial
Reviewed By: phillco
Differential Revision: https://phabricator.intern.facebook.com/D6698999
Signature: 6698999:1515630172:e759b5dabfe21f141e58e29c8b7cece576105be7
Summary:
This makes the upcoming change easier. `file:` URL is only used by test code
so it should not affect end-user experience. Currently tests using it use
absolute path so they are unaffected.
Test Plan: LFS tests are passing.
Reviewers: durham, #mercurial
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D6698286
Signature: 6698286:1515633318:c8f911172380596ffd934ac569316ab881d0ad58
Summary: They are no longer used.
Test Plan: LFS tests are passing. Also check the config being used today.
Reviewers: durham, #mercurial
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D6698242
Signature: 6698242:1515633277:0b8ab80c1c182c0c28066f85be56934c30fe0457
Summary:
D5617283 requires test-lfs-test-server.t to be able to resolve an internal
domain and also requires some certain implementation detail at the endpoint
(ex. set error.code).
That will not work outside internal network. Let's change the test to just
use `lfs-test-server`. Note the logic also needs to be changed sicne
lfs-test-server does not set error.code to 404 but just removes "download"
from "actions".
Test Plan: Ran all tests.
Reviewers: durham, davidsp, #mercurial
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D6698170
Signature: 6698170:1515633241:2496a4c02de6916a8f74ac67c4628e6e3a049b1b
Summary: Tests should not refer to hgext3rd directly.
Test Plan: Ran tests.
Reviewers: durham, #mercurial
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6698786
Signature: 6698786:1515632845:9a63120fb13eab17f268facd2be9b374506f665c
Summary:
Make chg an executable to install. Respect `HGNAME` so `chg` uses the
specified name as a fallback when the user does not provide `CHGHG`
explicitly.
Test Plan:
`HGNAME=hg-foobar setup.py install --user`. Make sure `chg` gets installed
and `strings .local/bin/chg | grep foobar` returns `hg-foobar`.
Reviewers: durham, phillco, #mercurial
Reviewed By: durham, phillco
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6695939
Signature: 6695939:1515621683:9ac10e65af5c124bef5c4a4306f61d27e9abf41f
Summary:
Previously, the main script is hard-coded as `hg`. We use a wrapper named
`hg` for logging. Therefore make the name more flexible by reading `HGNAME`.
The name is enforced starting with `hg` and cannot have strange characters.
Test Plan:
`HGNAME=hg-foobar python setup.py install --user`. Make sure the `hg-foobar`
script gets installed in `~/.local/bin`, has the correct `libdir` set, is
working, and the working copy does not have `hg-foobar`.
Also make sure `make local` does not write `$HGNAME` in the working copy.
Reviewers: durham, #mercurial
Reviewed By: durham
Subscribers: durham, phillco
Differential Revision: https://phabricator.intern.facebook.com/D6695942
Signature: 6695942:1515633395:dec1d46590a1210f2012de964f4b4ad830af9292
Summary:
Newer gcc might add new warnings without notice. Having `-Werror` might break
build with newer gcc. For example, I got the following error with gcc 7.2:
```
In file included from /usr/include/python2.7/Python.h:80:0,
from hgext/extlib/cstore/py-cstore.cpp:14:
./hgext/extlib/cstore/py-treemanifest.h: In function ‘PyObject* treemanifest_hasdir(py_treemanifest*, PyObject*)’:
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
/usr/include/python2.7/boolobject.h:27:31: note: in expansion of macro ‘Py_INCREF’
#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
^~~~~~~~~
./hgext/extlib/cstore/py-treemanifest.h:536:5: note: in expansion of macro ‘Py_RETURN_TRUE’
Py_RETURN_TRUE;
^~~~~~~~~~~~~~
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
/usr/include/python2.7/boolobject.h:28:32: note: in expansion of macro ‘Py_INCREF’
#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
^~~~~~~~~
./hgext/extlib/cstore/py-treemanifest.h:538:5: note: in expansion of macro ‘Py_RETURN_FALSE’
Py_RETURN_FALSE;
^~~~~~~~~~~~~~~
./hgext/extlib/cstore/py-treemanifest.h: In function ‘PyObject* treemanifest_text(py_treemanifest*, PyObject*, PyObject*)’:
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
./hgext/extlib/cstore/py-treemanifest.h:1309:5: note: in expansion of macro ‘Py_INCREF’
Py_INCREF(Py_False);
^~~~~~~~~
hgext/extlib/cstore/py-cstore.cpp: In function ‘void initcstore()’:
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
hgext/extlib/cstore/py-cstore.cpp:37:3: note: in expansion of macro ‘Py_INCREF’
Py_INCREF(&cdatapack_type);
^~~~~~~~~
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
hgext/extlib/cstore/py-cstore.cpp:45:3: note: in expansion of macro ‘Py_INCREF’
Py_INCREF(&treemanifestType);
^~~~~~~~~
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
hgext/extlib/cstore/py-cstore.cpp:53:3: note: in expansion of macro ‘Py_INCREF’
Py_INCREF(&datapackstoreType);
^~~~~~~~~
/usr/include/python2.7/object.h:769:22: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
((PyObject*)(op))->ob_refcnt++)
^
hgext/extlib/cstore/py-cstore.cpp:61:3: note: in expansion of macro ‘Py_INCREF’
Py_INCREF(&uniondatapackstoreType);
^~~~~~~~~
```
Explicitly suppressing warnings might break older gcc that does not support
those flags. Ideally the fix would be changing the source code. But in this
case it's in a library that cannot be easily fixed here in this repo.
Therefore just remove `-Werror`.
Test Plan: Confirm `make build` works after the change.
Reviewers: durham, #mercurial
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6695948
Signature: 6695948:1515633376:67f40f0489b69a70700e181313d8ad837a76a2c9
Summary: This avoids issues where a wrong (outside the repo) extension was used.
Test Plan: Ran all tests
Reviewers: durham, #mercurial
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.intern.facebook.com/D6690534
Signature: 6690534:1515632034:1353c9272650cf925dd299d252592afd52970e98
Summary:
A test was failing because the template it was using contained colors. Let's
just set HGPLAIN for all hgsubversion tests.
This also changes the module import checker to not just check for modules that
start with hgsubversion, since now we have modules like hgext.hgsubversion.
Test Plan: Ran the tests
Reviewers: singhsrb, #mercurial
Reviewed By: singhsrb
Differential Revision: https://phabricator.intern.facebook.com/D6698665
Signature: 6698665:1515628674:68d16f5560575a3623edea9919ec9e610bedd369
Summary:
hgsubversion now exists in hgext.hgsubversion, so the imports need to
be updated everywhere.
Test Plan: Ran the tests
Reviewers: singhsrb, #mercurial
Reviewed By: singhsrb
Differential Revision: https://phabricator.intern.facebook.com/D6698653
Signature: 6698653:1515628610:daad45a0e7566c784a4f5c8d7e6e5fed8976b92b
Summary:
This test discovers what python files are available and ensures help
text is available. Since hgsubversion is now in the repo, we need to enable it
so `hg help subversion` works.
Test Plan: Ran the tests
Reviewers: singhsrb, #mercurial
Reviewed By: singhsrb
Differential Revision: https://phabricator.intern.facebook.com/D6698628
Signature: 6698628:1515629061:5cc01e14e6884010e76608f51dbc675d79374568