Summary: Adding tag tweak and warning on the tags command
Test Plan:
Testing the tag command if allowed, not allowed with default message and not allowed with custom message
Testing if the default warning message or custom message prints when tags is called
Reviewers: durham, #sourcecontrol, rmcelroy
Reviewed By: #sourcecontrol, rmcelroy
Subscribers: cdelahousse, durham
Differential Revision: https://phabricator.fb.com/D2477368
Tasks: 8500389
Summary:
This tests were A) unreadable, and B) not deterministic. Let's remove all that
text and have a special test just for making sure the hook vars we care about
are present.
Also break the output into multiple lines for easier reading and diffing.
And fix a change in order for the remotenames test.
Test Plan: Ran the tests
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2479274
fbamend was using the python system rebase instead of the one loaded by
Mercurial. This broke the tests when the installed rebase differed from the
version of Mercurial we were running the tests with.
Summary:
Status on large repos got slow due to using re: and not '' and clowny
matcher behavior.
Test Plan:
In a large repo, I ran hg status with the old tweakdefaults and it consistently
took 10 seconds. Using the new tweakdefaults, it took 10 seconds the first time,
and was much faster afterwards.
I removed .hg/watchman.state and ran `hg status re:` with the old watchman and
it remained slow after multiple invocations. I ran `hg status re:` twice with
the new tweakdefaults and it was fast on the second invocation.
Reviewers: sid0, wez, #sourcecontrol, durham
Reviewed By: #sourcecontrol, durham
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D2479154
Test Plan:
updated test; made sure to include `HGPLAIN`
ran `arc diff` from repo root and from subdir; both worked
In `fbsource/fbobjc` I ran `arc lint` and there were no warnings but it did fail to find `/usr/bin/xcrun` (which is the same behavior as before).
I repeated this in `fbsource/fbobjc/Configurations` to check for path issues; same result.
In `www` I ran `arc lint` and there were no warnings. I repeated this in `www/flib` and got the same result.
Reviewers: durham, #sourcecontrol
Reviewed By: durham, #sourcecontrol
Subscribers: durham, akushner
Differential Revision: https://phabricator.fb.com/D2457648
Tasks: 8432204
Signature: t1:2457648:1442622676:611ad3072d11b91feb947c0eb7eb25b621c61eb1
Summary: I thought we had already done this
Test Plan: Used new tweakdefaults and the rebase abort issue was fixed!
Reviewers: #sourcecontrol, durham
Reviewed By: #sourcecontrol, durham
Differential Revision: https://phabricator.fb.com/D2457645
Summary:
The completion hint writing logic didn't account for repos where the user
doesn't have write access. Let's add a try/catch for that.
Test Plan: chmod a-w .hg/completionhints && hg sl
Reviewers: gulshan
Differential Revision: https://phabricator.fb.com/D2461444
Summary: The test-fbamend.t test is failing because of some error codes that no longer happen with an unsuccessful 'hg amend' command. The command prints out 'nothing changed' and no longer throws an error.
Test Plan: After the change, I ran the tests and confirmed the test-fbamend.t test is now passing.
Reviewers: cdelahousse, jetzhao, ttung, romanchadnov, matwood, durham, #sourcecontrol
Reviewed By: durham, #sourcecontrol
Subscribers: rmcelroy, pyd, mitrandir
Differential Revision: https://phabricator.fb.com/D2446352
Signature: t1:2446352:1442536997:e0d7ec996062f8bba5ee125c51091168750f1472
Summary: An empty repo will cause the smartlog extension to have errors. SCM is trying to iterate through an empty dataset. Smartlog needs to catch the exception and abort if the current repo is empty.
Test Plan: Added tests to make sure 'hg smartlog' on a newly created repo doesn't explode. Confirmed that tests failed before the fix, and they pass with the fix in place.
Reviewers: cdelahousse, jetzhao, romanchadnov, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, ericsumner
Differential Revision: https://phabricator.fb.com/D2446132
Tasks: 8118567
Signature: t1:2446132:1442512709:6a666351a02639f6e0b15c6c7476a8cdd25370c9
Summary:
Before this patch, we were using grandparent's implementation in python that
was copied from core. With this patch, we are leveraging reachableroots
implemented in C to make grandparent's computation faster.
Test Plan:
Tests are passing + checked on facebook-hg-rpms and configerator-hg
that smartlog behaves as expected
Reviewers: durham, pyd, rmcelroy
Differential Revision: https://phabricator.fb.com/D2442208
Summary: The hashes in .hg/hashes can be used for bash/zsh completion
Test Plan: Run `hg sl` in a repo. Check that .hg/completionhints contains the same hashes shown by `hg sl`.
Reviewers: durham
Reviewed By: durham
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2440503
Tasks: 8331035
Signature: t1:2440503:1442268630:c3bb3a52a301d2b6fa461158ccbd087c87e883a5
Summary:
This is hacky way of executing user shell in interactive mode so they get their aliases, bash functions, output coloring and more...
I put this behind config knob so if this doesn't work for user with very obscure shell they can always turn it off.
Test Plan: Tested it in my shell - used my shell aliases with exec (can't write unit tests since it's very environment specific - suggestions welcome).
Reviewers: ericsumner, rmcelroy, #sourcecontrol
Reviewed By: rmcelroy, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2433238
Tasks: 5852393
Signature: t1:2433238:1441961664:e4a9cb804dfb4f714278865e3abf370277836e5b
Summary: return 0 on amend/commit with nothing changed
Test Plan:
Make or checkout a mercurial repository and make a commit. Run the following commands and make sure the output is the same:
$ hg ci; echo $?
nothing changed
0
$ hg amend; echo $?
nothing changed
0
Reviewers: #sourcecontrol, durham
Reviewed By: #sourcecontrol, durham
Differential Revision: https://phabricator.fb.com/D2427283
Tasks: 8313450
Summary:
exchange.check_heads is used to verify that the server's heads haven't changed
between when the client does discovery and when it obtains the lock. With
pushrebase we want to allow concurrent pushes, so this is a scenario we want to
support.
So let's disable that check.
Test Plan: Ran the tests and verify that the wrapfunction call was hit.
Reviewers: ericsumner, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2419949
statprof attempts to save data to the user's home dir, for future investigation.
If this fails (because of permission issues, or because the home dir doesn't
exist), it was failing the command entirely. Let's catch and eat those
exceptions.
Summary:
`githelp` supported `git checkout -f xyz` but not the same command with out a
path or a rev. Added support for it and wrote a test.
Test Plan:
Added tests and ran them.
Task: #7499727
Reviewers: ericsumner, durham
Reviewed By: durham
Subscribers: joesavona
Differential Revision: https://phabricator.fb.com/D2372309
Signature: t1:2372309:1440530832:cb32553b2ef7f7ff0e09cb80ff6449a8c26c2caf
Summary:
Facebook disables naked "hg up" as found in many googled mercurial docs.
https://www.selenic.com/hg/help/updatehttps://www.selenic.com/mercurial/hg.1.htmlhttp://hginit.com/01.html
etc.
We should have our error/abort messages make suggestions to correct course when
our configs conflict with upstream.
Test Plan:
"hg up --config extensions.tweakdefaults=~/fb-hgext/tweakdefaults.py"
in a repo that both needs updating to master and one in which it doesn't.
Results:
In repo needing an update:
/home/thm/fbsource/fbcode/tupperware/config/pe-security [thm@devvm1531]
> hg up --config extensions.tweakdefaults=~/fb-hgext/tweakdefaults.py
abort: You must specify a destination to update to, for example "hg up master".
(If you're trying to move a bookmark forward, try "hg rebase -d <destination>".)
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D2348818
Summary:
FBConduit used to throw a conduit error when a rev didn't map.
Now, it just returns an empty string for the mapping. This updates the
fbconduit extension so that it matches the server behavior.
Test Plan: passed unit tests.
Reviewers: mitrandir, ericsumner, durham
Reviewed By: ericsumner
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2331464
Tasks: 7970302
Signature: t1:2331464:1439500203:cbf79e9b9c54aebdf33bbad82c1982b5a69e8bc9
Summary:
Different repos have different notions of important bookmarks. Allow
configuring it.
Test Plan: added a new test
Reviewers: #sourcecontrol, durham
Reviewed By: #sourcecontrol, durham
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D2340061
Tasks: 7955325
Summary:
It turns out commit.files() does not return all the affected files during a
merge commit. It only returns files which differ from both p1 and p2, so in a
merge commit where we accept the changes from p2, the changes were lost during
the rebase.
This fixes it by performing a manifest diff if we're grafting a merge commit.
Test Plan:
Updated the tests to check the file contents (this test would fail
before)
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2331586
Summary: Just in case someone trys to use 'git whatchanged', at least tell them why it's not supported
Test Plan: added a test
Reviewers: rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2329289
Tasks: 7966012
Signature: t1:2329289:1439242809:56fb56704e1110dc95a6366ee9c3eb948e1bf415
Summary:
We had some complain about the warning message, this is a rework of
the wording to make it clearer. The diff is not complete until we have the
link for the Source Control FYI post coming this morning.
Test Plan: N/A
Reviewers: pyd, durham
Differential Revision: https://phabricator.fb.com/D2315002
Summary:
Adds an xr/execr action that executes the command relative to the
current working directory. This allows our users to run 'arc diff' and pick up
whatever the current arc project is (instead of whatever arc project is at the
root of the repository).
Test Plan: Added a test
Reviewers: davidsp, #sourcecontrol, lcharignon
Reviewed By: #sourcecontrol, lcharignon
Subscribers: rmcelroy, lcharignon
Differential Revision: https://phabricator.fb.com/D2311298
Tasks: 7795286
Summary:
Before this patch we were not taking a lock when dealing with bookmarks.
Which means that any process running while fbamend was running would lead to
corruption / loss of bookmark. This patch makes sure that we have a lock for
the whole duration of the fbamend run and avoids corruption.
Test Plan:
Tests are passing and this fixes an issue that we have
been seeing with inhibit where inhibit would take a lock on bookmark write
and overwrite the .preamend bookmark
The following repro does not show the issue anymore:
mkcommit a ; mkcommit b ; hg book b ; hg up .^ ; hg book a ; echo "OO" > r ; hg commit --amend --rebase -Am 'oo'
Reviewers: durham, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D2303299
Signature: t1:2303299:1438623825:e8160001600449cf5f505cc55a078d30c1e75a14
Summary:
pushrebase doesn't support pushing non-fastward heads when remotenames is on
(since --to implies both remotenames and do a rebase). Long term we want --new
and --replace to indicate bookmark movements, but for now we can use the
existing -f to imply that we don't want a rebase to happen.
Test Plan: Added a test
Reviewers: #sourcecontrol, lcharignon
Reviewed By: #sourcecontrol, lcharignon
Subscribers: lcharignon
Differential Revision: https://phabricator.fb.com/D2307585
Summary:
This is testing more failing case involving command creating obsmarkers during interruption.
More corner case testing could be added, but this is a good start.
Test Plan: test crash before update of core. Properly pass with the series current in review on mercurial-devel
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2307305
Summary:
This extension was a temporary hack to help people move from the experimental
bundle2 format to the final one. All user have been moved so we can put this
very hacky extension to the sword.
Test Plan: ran setup.py install --prefix /tmp/foobar, b2xcompat was no longer there.
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2298571
It is a best practice for Mercurial extensions to contain a "testedwith"
attribute to define which Mercurial versions they are compatible with.
The tests pass with Mercurial 3.4.1 (but not 3.3.3 - there are
references to missing symbols), so mark 3.4 as the only compatible
version.
Evolve isn't a part of core Mercurial nor is it part of this repository.
Make it easier to run tests for pushrebase by removing the evolve
dependency.
This does drop a workflow test that `hg evolve` after a rebased push
does the right thing. But, evolve's behavior in the presence of
specific obsolescence markers should be pretty well tested and it
shouldn't be strictly necessary to test this behavior.
Summary:
The reasoning here is that evolve users probably want to have the
exact same experience as before. Plus, we lack test coverage for
evolve + directaccess
Test Plan: warning message only
Reviewers: durham, pyd, rmcelroy
Differential Revision: https://phabricator.fb.com/D2294762
Summary:
This was crashing in some situation when using push rebase, the repro
is too complicated to put in a test.
Test Plan:
Check that the crash is not here and all the tests already in place
behave as expected
Reviewers: pyd, ericsumner, durham
Differential Revision: https://phabricator.fb.com/D2292875
Summary:
The tail check was flagging by mistake scenarios where the push was
possible. This patch adds one of these scenario.
Test Plan: Add new test and all former tests are passing
Reviewers: ericsumner, durham
Differential Revision: https://phabricator.fb.com/D2292866
Summary:
Before this patch, pushrebase was not supporting some cases of fast
forward push. This patch fixes the issue.
Test Plan:
Added a new test. Check that the test failed before and is fixed
with the code change.
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D2279800
Summary:
It's possible that the sparse extension might be loaded, even if the sparse
extension is not enabled for the particular repo (like if you're cloning from a
sparse repo to a non-sparse repo on the same machine). Previously it broke,
because we assumed all repo's had sparsematch(). Now we check for it before
using it.
Test Plan:
Added a test. The old test wasn't sufficient since it didn't have any
commits, so the dirstate was not interacted with
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2278657
Summary:
Before this patch we were not recording all the information for file
copy, executable bit and link. This patch fixes the issue.
Test Plan: Add a new test with a copy
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D2277575
Summary:
I saw this error when using pushrebase with fbsource on a commit
that deleted a file. We were trying to access it even if it was not in the
manifest.
Test Plan:
Modified the test
Before the code fix the new test fails with:
remote: abort: b@46a2df24e272: not found in manifest!
Reviewers: durham, ericsumner, pyd
Differential Revision: https://phabricator.fb.com/D2274792
Summary:
The old order fix was not quite right, since it modified a local copy of _order
instead of the extension modules copy.
Test Plan:
Added a test that verifies the hooks can see a pushvar even through
remotenames
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2275767