Summary: Disabling rollback in tweakdefaults to replace the hook
Test Plan: testing the message
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2515138
Tasks: 8578898
Summary:
If a user gets stuck in a stopped rebase, give some details to the user when
they run `hg status` about how to move forward.
Let's see if we can get some bike shedding done on one command.
Notes on behaviour:
* it there exists any unresolved conflicts, no matter, they'll be shown.
* there is no way to only show what state the user is in (and not the conflicts). You either turn more status on or off.
Example for rebase:
10/05 19:34 cdelahousse@dev4253 ~/local/clearmereg/testrepos/states/rebasestate
$ hg status
M a
# The repository is in an unfinished *rebase* state.
# Unresolved merge conflicts:
#
# a
#
# To mark files as resolved: hg resolve --mark FILE
# To continue: hg rebase --continue
# To abort: hg rebase --abort
Repo in rebase state after the all files have been resolved:
$ hg status
M a
# The repository is in an unfinished *rebase* state.
# No unresolved merge conflicts
# To continue: hg rebase --continue
# To abort: hg rebase --abort
Test Plan: See tests
Reviewers: #sourcecontrol, rmcelroy, durham
Reviewed By: durham
Subscribers: dancol, pyd, akushner
Differential Revision: https://phabricator.fb.com/D2502125
Tasks: 8563305
Signature: t1:2502125:1444189728:d6abf28f09bcc0360628497db8d896025967827f
Summary: Disabling merge in tweakdefaults to replace the hook
Test Plan: enable, disabled, disabled and meaasge modified
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2515407
Tasks: 8593074
Summary:
This is an MVP to give the user more information about the state of the repo. We'll grow the functionality in other diffs.
for example, if the repo is in a state after a stalled graft, then hg status outputs a bit more
$ hg status
M a
? a.orig
# The repository is in an unfinished graft state.
Test Plan: See the tests.
Reviewers: #sourcecontrol, durham, rmcelroy
Subscribers: akushner, rmcelroy
Differential Revision: https://phabricator.fb.com/D2495659
Tasks: 8563305
Summary: Adding config to disable the branch command and still forcing users to pass --new if it's enabled
Test Plan: Testing branch alone, branch when it's disabled and when it's enabled (with the --new options in both cases)
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2478915
Tasks: 8500803
Summary:
To do so, we had to change some path variables and change the output of some
tests. Removed a few dependencies that provided by hg.
Test Plan:
Ran the tests. There was some ignorable output changed (about devel-warn) caused by other code not
related to this change.
Reviewers: #sourcecontrol, pyd, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, durham
Differential Revision: https://phabricator.fb.com/D2499721
Signature: t1:2499721:1443745230:9d4e53e83356807f3343c8343e28d10f1b9dc35f
Summary:
Also added an additional test to show a case that fails now (and should fail),
but would have succeeded with the previous code.
Test Plan: Additional unit test
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D2502396
Signature: t1:2502396:1443809922:18ec6697b7c135c37c10f7bdd9544901c4a54c99
Summary:
The old check moved the bookmark old node after the prepushkey hooks
had ran, bypassing the non-ff prevention logic. This moves the old node rewrite
to before the prepushkey hook and also checks that old node is moved in a
ff-only way.
Test Plan: updated unit test
Reviewers: #sourcecontrol, mitrandir
Reviewed By: mitrandir
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D2499633
Signature: t1:2499633:1443733890:4c84150bd0f21adb97feb23e54727bb4e8be38cf
Summary:
By removing the part on the pushrebase client instead of ignoring it on the
pushrebase server, the server can still run this check for non-pushrebase
pushes so it will be safer against divergent heads.
Test Plan: Updated unit tests
Reviewers: #sourcecontrol, pyd, durham
Reviewed By: pyd, durham
Differential Revision: https://phabricator.fb.com/D2499115
Signature: t1:2499115:1443736440:001ceb79a4692abbd4c6b208124f6576f10f680c
Summary: Changing tag disabled by default to tag enabled by default
Test Plan: tag default policy, tag when disabled with or without default message
Reviewers: rmcelroy
Differential Revision: https://phabricator.fb.com/D2486970
Tasks: 8500389
Summary:
In pushrebase, we expect bookmarks to be moving after discovery but
before we grab the lock. With this patch, we rewrite the incoming bookmark
changes so that they do not fail if the bookmark moves after discovery.
Test Plan:
Wrote a new test to cover this behavior and verified that the test failed before
this change but works afterwards.
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D2488675
Signature: t1:2488675:1443503039:660f88da9727a74f7c9a21f0767efb5d7379d16d
Summary:
This check was causing pushes to fail when heads change during a push, but that
is expected in pushrebase pushes.
Test Plan: ran existing tests
Reviewers: ericsumner, #sourcecontrol, durham
Reviewed By: #sourcecontrol, durham
Differential Revision: https://phabricator.fb.com/D2482254
Signature: t1:2482254:1443468591:23dc9ad24e1c7d3b3ec04be678d346dfed6d98a7
Summary:
The tag cache can be pretty expensive to populate, and in many of our repos we
do not even allow tags, so let's allo disable it entirely.
Test Plan: Added a test
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: #sourcecontrol, rmcelroy
Subscribers: rmcelroy
Differential Revision: https://phabricator.fb.com/D2481606
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.
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 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:
`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:
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:
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:
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
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 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
Summary:
If the user is using remote bookmarks, let's hide the public heads from the
smartlog output. This allows the server to do a non-fastward bookmark move,
without having the old heads cluttering the user's smartlog output.
Test Plan: Added a test
Reviewers: mitrandir, rmcelroy, ericsumner, lcharignon
Reviewed By: lcharignon
Differential Revision: https://phabricator.fb.com/D2264878
Signature: t1:2264878:1437505970:664348ed91ba8d8b1018299e282ed4308bfbdbc0
Summary: as per @ericsumner's comment, changed the port from 8000.
Test Plan: passed unit test
Reviewers: ericsumner, durham, rmcelroy
Subscribers: mitrandir, ericsumner
Differential Revision: https://phabricator.fb.com/D2247429
Summary:
# added a backingrepo list configuration variable that enumerates the backing repos.
# wrote a bunch of unit tests to cover this functionality.
Test Plan: passed unit tests.
Reviewers: rmcelroy, durham, ericsumner
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2247419
Summary: Test mirrornode and gitnode as a rev selector.
Test Plan: passed unit tests. D2246978 is required for these tests to pass.
Reviewers: lcharignon, rmcelroy, durham, ericsumner
Reviewed By: ericsumner
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2246986
Signature: t1:2246986:1436993629:3098c741aabaeeccb81e4e9c03c36c6435c3ccf0
Summary: Exercises the existing fbconduit functionality in a unit test.
Test Plan: it runs!
Reviewers: lcharignon, rmcelroy, durham, ericsumner
Reviewed By: ericsumner
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2244924
Signature: t1:2244924:1436983026:d743d67c90138f4b6f4eeddc96abf5f89f4d0287
Summary:
Built a http server that serves as a mock fbconduit server. It
answers the normal requests that fbconduit makes, as well as:
PUT /from_repo/from_scm/to_repo/to_scm/from_hash/to_hash
DELETE /from_repo/from_scm/to_repo/to_scm/from_hash/to_hash
Test Plan: used in later diffs
Reviewers: lcharignon, rmcelroy, durham, ericsumner
Reviewed By: ericsumner
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2244917
Signature: t1:2244917:1436982657:bde0c04ea21299970dfb782b43ed13ab1f3e17b0
Summary:
Previously pushrebase could not create new bookmarks, because the rebase target
did not exist. This fixes that.
Also fixes some output text to match the core Mercurial behavior, so tools can
rely on the text in certain cases.
Test Plan: Added a test
Reviewers: lcharignon, pyd, rmcelroy, ericsumner
Reviewed By: ericsumner
Differential Revision: https://phabricator.fb.com/D2240418
Signature: t1:2240418:1436895571:2f56298969e09490f6f5e6a44857eedc2bfcace4
Summary:
Previously reseting from above a remote bookmark to below it would delete the
commit that the remote bookmark pointed to. This fixes that and adds a test.
Test Plan: Added a test
Reviewers: rmcelroy, ericsumner, lcharignon
Differential Revision: https://phabricator.fb.com/D2233971
Summary:
In the vast majority of cases, our workflows should not use branches.
Let's make sure people know what they're doing when they create a branch by
failing by default.
Test Plan: added a new test
Reviewers: durham, #sourcecontrol
Reviewed By: durham, #sourcecontrol
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D2213677
Summary:
This makes the pushrebase extension work with the remotenames extension. It does
a few things:
1) rename --onto to be --to for consistency
2) configures remotenames to allow non-fastforward pushes
3) changes the push wrapper to happen after remotenames is loaded
Test Plan: Added a test
Reviewers: pyd, rmcelroy, lcharignon, ericsumner
Reviewed By: ericsumner
Differential Revision: https://phabricator.fb.com/D2200222
Signature: t1:2200222:1435695629:a92d8b20d158aa40bad1f3963af0348b6680d52d
Summary:
This adds the ability to rebase changegroups that contain merge commits. It
works by identifying the maximum bundle root that is an ancestor of the desired
`onto` and rebases only things that are on top of that root.
Test Plan: Added a test
Reviewers: lcharignon, pyd, ericsumner
Reviewed By: ericsumner
Subscribers: rmcelroy
Differential Revision: https://phabricator.fb.com/D2194350
Signature: t1:2194350:1435695516:3a1f62bda7de0da9536a538da0bbb6deceb192f6
Summary:
I realized that a test I wrote affects the tests later in the test suite because
it cd's into a directory and does not cd out. This fixes that.
Depends on D2171752
Test Plan: run tests
Reviewers: durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: pawelbara
Differential Revision: https://phabricator.fb.com/D2172941
Signature: t1:2172941:1434735023:70a829cf4eede8e5aa909d10995bfd5d823b9cb6
Summary:
'git show' now corresponds to 'git diff -r .^' for paths.
For everything else it still resolves to 'git export'.
Test Plan: take a look at the unit tests.
Reviewers: marcelo, durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: nmote, durham, rmcelroy, owenc
Differential Revision: https://phabricator.fb.com/D2171752
Tasks: 6860395
Signature: t1:2171752:1434682344:cf1af959e0da788efa0a526459ee64590b09a00e
Summary:
Before this patch: hg githelp -- reset HEAD~ returned hg reset .~ which was
wrong. With this patch it retuns hg reset .~1.
Test Plan: added a test
Reviewers: mitrandir, durham
Subscribers: scottf
Differential Revision: https://phabricator.fb.com/D2166551
Summary:
Reset didn't use scmutil to parse revision number given on the command line.
Inhibits plugs in the scmutil logic to enable direct access and therefore reset
was not benefiting from it. This caused the revive logic in reset to create
a new commit instead of reusing the old one.
Test Plan: Added test
Reviewers: durham, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D2032910
Tasks: 6696106
Signature: t1:2032910:1430339529:47e2c7d7c2ea76e4ab1114e7215e8517ee9f4356
Summary:
Previously we would have to decompress the entire manifest to check if each
sparse profile existed. This slowed hg status down by 500ms (2x).
This patch adds caching when simplecache is enabled.
Test Plan:
Added a test. Also tried it in fbsource. Verified repeated hg
status's did not parse the manifest
Reviewers: rmcelroy, ericsumner, lcharignon, akushner, mitrandir
Differential Revision: https://phabricator.fb.com/D2158178
Summary:
1) moves the memcache prefix part of the key into mcget and mcset, so callers
don't have to care about it.
2) added a stringserializer for storing simple strings
3) removes _ from _memoize so it can be used by other extensions
4) moves key version into memoize function
Test Plan: Ran the tests
Reviewers: rmcelroy, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2158102
Summary:
Having a simple on disk cache is useful in some cases, like when it can prevent
us from having to read a full manifest. Let's add local caching support to
simplecache.
Test Plan:
Added a test
Perf numbers for a basic export
no cache=0.7s
local only=0.46s
memcache only=0.48s
memcache+local=0.48s
local+memcache=0.46s
Reviewers: ericsumner, lcharignon, sid0, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2149605
Signature: t1:2149605:1434139712:c8a524ece9bdd91dca122e1305e81aa02912a8d9
Summary:
There can be situations where the sparse extension has run uisetup, but the repo
object doesn't have sparse enabled so it doesn't run reposetup. We need to make
sure all the work uisetup does can condition on whether reposetup has done it's
work or not.
Test Plan: Added a test
Reviewers: lcharignon, pyd, ericsumner, sid0, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2129966
Signature: t1:2129966:1433522840:90029011ac8bbb2e1efbaf9fb317c1e55aa18737
Summary:
Previously, if you did 'hg reset .' it would invalidate the entire dirstate,
making every entry 'lookup' so it had to read the entire working copy on the
next run. This fixes that.
Technically this is a bug in core mercurial since rebuilddirstate() should
invalidate anything if an empty list is passed.
Test Plan: Added a test
Reviewers: pyd, lcharignon, sid0, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2129095
Signature: t1:2129095:1433520638:e05ee86dedcc9f87d5c3fd65e3e2374ecbac5dfb
Summary:
fbamend: use strip.strip instead of repair.strip
This allows fbamend to work better with evolve as evolve overrides the command
strip.strip to prune.
Test Plan: Changed test and ran it.
Reviewers: durham, pyd
Differential Revision: https://phabricator.fb.com/D2082137
Summary:
There was a bug where rebasing a commit that contained a file that was not
currently in the working copy would cause an exception. This is because the
'temporarily include a file' logic tries to bring the file back to life
immediately, regardless of if the file actually exists yet or not (it may be an
incoming file from the upcoming merge, so it doesn't exist yet).
Test Plan: Added a test
Reviewers: sid0, rmcelroy, pyd, lcharignon
Reviewed By: lcharignon
Differential Revision: https://phabricator.fb.com/D2083802
Signature: t1:2083802:1432075849:7a90c94a97322ca619d481477fcc8812e7a26e93
Summary:
The master revset config was not using scmutil.revrange/revsingle so it wasn't
able to handle bookmark names like 'foo-bar'. Let's use them.
Test Plan: Added a test
Reviewers: rmcelroy, sid0, lcharignon, ericsumner
Differential Revision: https://phabricator.fb.com/D2082328
Tasks: 7116971
Summary:
Create an extension that allows shell variables to be passed to the
server via command line option. When pushing with the following command:
hg push --pushvars "DEBUG=1"
will make HG_SCM_DEBUG=1 available to the hooks. Note the prepending of HG_SCM_
Test Plan: Run run_tests
Reviewers: pyd, rmcelroy, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1991994
Tasks: 4841351
Signature: t1:1991994:1430417209:9a05fb11f9ecdeab3a1d89cf331014dafe7d959f
Summary:
This adds an extension which will allow a user to specify commit 'extras' from
the command line. This will allow our repo sync script to include extra metadata
in the commits.
For instance, this is required in order to not lose git's committer info when
syncing into mercurial (which is required in order to make sure two commits with
the same content but different committers will produce a different hash in
Mercurial).
Test Plan: Added a simple test
Reviewers: pyd, lcharignon, mpm, sid0, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2027341
Signature: t1:2027341:1430255572:6866d0ba5564ca977c8fce41e55988883e15ce5b
Summary:
With the new evolve+inhibit ecosystem, we want to allow amend and amend --rebase
to continue working even when evolve is on. Let's move the evolve check to be
inside the amend command, and only complain when we see the evolve commands
enabled.
Test Plan: Added a test
Reviewers: lcharignon, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D2033649
Signature: t1:2033649:1430346833:3116b704e49f634709a6fea32e217b94e731b96f
Summary:
The smartlog rev option wasn't resolving names right because it used
the wrong internal api. Fixes that.
Test Plan: Adds a test
Reviewers: lcharignon, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D2033646
Signature: t1:2033646:1430346864:be69cfb5fe3892f51340546b1fbb341fabfffe14
Test Plan: Updated tests, ran tests many times with no more failures
Reviewers: ttung, durham, mitrandir, #sourcecontrol
Reviewed By: durham, mitrandir, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2003040
Signature: t1:2003040:1430327993:b5b439becb928f45a7594fb727b1335f95f992d0
Summary:
We want to be able to more seamlessly update sparse profiles when adding files.
This patch adds a `--sparse` flag to `hg add` that ensures the directory of the
added file is included in the sparse profile.
Test Plan: updated test
Reviewers: ttung, durham, #sourcecontrol
Reviewed By: durham, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2003039
Tasks: 6733090
Signature: t1:2003039:1430327770:295f1ac9960ca9dcb4ce84f76458faad68106272
Summary:
hgwatchman keeps a hash of the ignore matcher. Since we wrap the ignore
matcher to simulate a sparse checkout, we need to provide a hash that changes
as well.
Test Plan:
Adds a test. Verified the test failed without the change, and passed
with it.
Reviewers: rmcelroy, lcharignon, ericsumner, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D2022219
Signature: t1:2022219:1429912457:51bf4677e1894ecca6da47a9fa6c4110f132c937
Summary:
There was a bug where if you included 'dir1/dir2/' in your sparse checkout, then
status would not show newly added files in that directory. The problem is that
dir1 is considered ignored, so the status walker would not walk down dir1.
The fix is to explicitly match subdirectories of specified include patterns.
Test Plan: Added a test
Reviewers: pyd, rmcelroy, lcharignon, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D2021037
Tasks: 6773875
Signature: t1:2021037:1429899282:3e305afa9ed395473dbe11d80abc43becb9eaa4a
Summary:
Previously, reseting to bookmarks with '-' in the name did not work. We need to
use scmutil.revrange instead of repo.revs to make this happen correctly.
Test Plan: Added a test
Reviewers: ericsumner, rmcelroy, pyd, lcharignon, sid0
Reviewed By: sid0
Subscribers: dreiss
Differential Revision: https://phabricator.fb.com/D2021737
Signature: t1:2021737:1429906581:c8deaf61920fad5fd9c9faea16b867685d3be7ad
Summary:
Upstream has removed all the b2x flags, so let's do the same to pushrebase. Also
fixes pushrebase's use of manifest._intersectfiles() which has been removed
upstream (in favor of a matcher).
The tests had a bunch of hardcoded hooks which were very messy and became
impossible to maintain when upstream changed what args were passed. Let's just
get rid of all that noise.
Test Plan: Ran the tests
Reviewers: sid0, rmcelroy, lcharignon, ericsumner, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D2003033
Signature: t1:2003033:1429832524:c0de8ebea7e6348ba9b55c109ca71bb3a301b625
Summary:
Since hg grep and git grep are similar for basic usage (pattern first and then
paths), just copy all the git arguments to the suggested hg command.
Test Plan: Test added to test-githelp.t
Reviewers: rmcelroy, durham
Reviewed By: durham
Subscribers: elenapr
Differential Revision: https://phabricator.fb.com/D2009460
Tasks: 6524222
Signature: t1:2009460:1429647852:2bfaf32b8c7849e948e5da03989fad32c1b06780
Summary:
Upstream has finalized bundle2 and removed the experimental flags. So let's
upgrade along with it.
Test Plan: Ran the tests
Reviewers: sid0, rmcelroy, lcharignon, pyd, ericsumner
Differential Revision: https://phabricator.fb.com/D2003046
Summary:
The command `git checkout foo` uses a heuristic to determine whether to treat
'foo' as a revision or a path. We try to mimic that behavior as best we can, but
there will still be corner cases where it does not work.
In particular, if there is a file that is present in a previous revision but not
the current one, this will incorrectly assume that it's a revision.
Test Plan:
Added tests to make sure that it behaves properly for untracked files, tracked
files, deleted files, removed files, and names which are both revisions and
files.
Reviewers: durham, sid0, mitrandir, rmcelroy
Reviewed By: rmcelroy
Subscribers: elenapr
Differential Revision: https://phabricator.fb.com/D1996393
Tasks: 6751516
Signature: t1:1996393:1429306520:2f13c194a8fe2a721bac501c5479250b2afe3f9e
Summary:
Adds a --sparse option to log that limits the output to commits that
affect the working copy.
Test Plan: Added a test.
Reviewers: sid0, lcharignon, pyd, ericsumner, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2002484
Signature: t1:2002484:1429299577:a66f88157acc7136be9fe3b60f7fb02f830ae447
Summary:
Upstream histedit has moved all it's actions to classes. Let's do the same for
stop.
The hashes change because upstream changed graft to include a little more
information in the commit metadata.
Test Plan: Ran tests
Reviewers: rmcelroy, sid0, lcharignon, pyd, ericsumner
Differential Revision: https://phabricator.fb.com/D2001830
Test Plan: ran it locally with chef_tested devbox and D2002135
Reviewers: durham, ericsumner, mitrandir, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D2002175
Signature: t1:2002175:1429295959:535d264ebd9a2d23c8e1eebefb313b1654f28196
Summary: Soemone noticed that this was missing
Test Plan: updated test
Reviewers: sid0, mitrandir, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1994587
Tasks: 6773162
Signature: t1:1994587:1429116229:64c8d9bcca1f7de7566d5a53e5f822e1658c1758
Summary:
This extension will let use change bundl2 in core while still supporting old
client and server for a week or two.
Test Plan: I've running it for a day, I can successfully pull and push to server using HG2Y.
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.fb.com/D1973281
Summary:
Now that we store a list of temporarily include files, and the ability to
clean them up, we now add the logic to add them in the first place. This watches
the actions provided by calculateupdates and adds any missing files to the
sparse checkout temporarily
Mucking with the dirstate and files on disk in the middle of calculateupdates
seems a little risky, but it seems to work.
Test Plan: Added new tests that require bringing in non-sparse changes as part of the merge. Tests both the merge and rebase scenarios, using both normal checkouts and profiles.
Reviewers: sid0, pyd, lcharignon, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D1982951
Signature: t1:1982951:1428636508:e5bcf4e6fbd635d49ff1ce7a90e9b5e1378537c9
Summary: Treat all arguments after -- as path arguments.
Test Plan: Several test cases added to tests/test-githelp.t
Reviewers: rmcelroy
Reviewed By: rmcelroy
Subscribers: elenapr
Differential Revision: https://phabricator.fb.com/D1988585
Tasks: 6199146
Signature: t1:1988585:1428960924:02ad487b9e17fecd7e98c045eeb01d8420247d33
Summary:
Suggest 'hg amend' because it does not pull up an editor, whereas 'hg commit
--amend' does.
Test Plan: Added test cases to tests/test-githelp.t to test for desired behavior.
Reviewers: rmcelroy
Reviewed By: rmcelroy
Subscribers: elenapr
Differential Revision: https://phabricator.fb.com/D1987860
Tasks: 6199146
Signature: t1:1987860:1428949599:cdc1d66426ea343a7b0ed1bfcc2d28cbb685810d
Summary: Previously, we would discard a message with passed to hg amend.
Test Plan: added a test
Reviewers: sid0, ericsumner, durham, #sourcecontrol
Reviewed By: durham, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D1973794
Tasks: 6705470
Signature: t1:1973794:1428457860:68075660f34eff2c757757aad9ca11fb5ae040c0
Summary:
Previously, hg update would fail if your sparse profile was not present in the
destination of the update. This had the affect of preventing users from rebasing
newly created sparse profiles. Let's allow it (with a warning). This will allow
them to perform the rebase as long as all of the files they've changed exist in
the other sparse rules they have enabled. If they have no others, the sparse
profile will revert to a full checkout.
Test Plan: Added a test
Reviewers: rmcelroy, pyd, lcharignon, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D1967834
Signature: t1:1967834:1428106927:04ef3a91a0f9f57f0a917d3a48e62e5e38341264
Summary: githelp: add git rebase --skip
Test Plan: Wrote and ran test
Reviewers: mathieubaudet, rmcelroy, sid0
Differential Revision: https://phabricator.fb.com/D1946751
Summary: Bug fixed by enclosing raw array remove with try-except block.
Test Plan: Run /tests/run-tests.py . It should finish without errors.
Reviewers: rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, sigmix
Differential Revision: https://phabricator.fb.com/D1927784
Tasks: 6463098
Signature: t1:1927784:1426810833:b9a549d41eaaa55c420b480018298b725cc69aaf
Summary: Allows the user to specify a date and only a date on the command line, and still get to the commit they want
Test Plan: Use hg up -d in a few of the normal ways, such as hg up -d 'Jan 1', hg up -d '<Mar 1' and they should all work.
Reviewers: rmcelroy
Subscribers: nmead
Differential Revision: https://phabricator.fb.com/D1881685
Tasks: 6015872
Summary:
Previously smartlog failed when a branch head was not public.
Fix this and add a test to prevent regression.
Test Plan: New test, ./run-tests.py
Reviewers: ericsumner, sid0, mitrandir, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1866905
Tasks: 6120552
Signature: t1:1866905:1424799838:51d5f8501b20dc3757f825ba8a13d38eccec0bff
Summary:
--continue was pretty broken before, in several ways:
1) It popped the rule after the 'exec'. I'm pretty certain this meant that rule
wasn't even running (two exec's in a row definitely weren't running).
2) 'exec' as the last step of the histedit would make it unrecoverable since
bootstrapcontinue tried to pop an empty list (because it popped the entry
ahead, see #1).
3) The replacements list it built associated any new commits from the exec with
the following commit instead of the previous. I just fixed this by not creating
any replacements in the exec --continue case, since it's currently not possible
to look backwards at what the original hash was.
4) That repo lock wasn't actually being released when doing further exec's in a
continue/abort. Upstream histedit creates a new histedit state object that
doesn't contain the actual locks, so we weren't actually unlocking it.
The fix is to most of this is to just delete all the copy/paste and make
--continue/--abort literally do nothing special when recovering from an exec.
If there are still pending changes, we just abort and tell people to fix it.
I sent a fix upstream to fix the locking issue.
Test Plan: Added tests
Reviewers: mitrandir, davidsp, sid0, rmcelroy, ericsumner
Differential Revision: https://phabricator.fb.com/D1853944
Summary: Templates are not supposed to abort when there's no data for them. Ensure that the `{gitnode}` template has the same behavior.
Test Plan: tests, and tested by hand on a local commit in fbcode
Reviewers: davidsp, rmcelroy, akushner, pyd, daviser, mitrandir, ericsumner, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1851847
Tasks: 6235780
Signature: t1:1851847:1424199479:3e2d7fb7fb7b8a60f36605279f9e2a706a42dfbd
Summary:
Previously, fbamend allowed all sorts of atrocities during histedits, literally
destroying the world. Literally. Make fbamend histedit-aware -- it will now
give correct advice and refuse to delete old commits during a histedit.
Test Plan: Updated tests
Reviewers: sid0, daviser, davidsp, ericsumner, pyd, mitrandir, durham
Reviewed By: mitrandir, durham
Differential Revision: https://phabricator.fb.com/D1844984
Signature: t1:1844984:1423768068:edc85af8b203aefdcdac9d7fee0425fc1f1c5281
Summary:
Previously, without a bookmark, the preamend bookmark would get out of date
with a second hg amend. Be more intelligent here and fix up the preamend
bookmark when re-amending.
Test Plan: updated unit test
Reviewers: sid0, mitrandir, ericsumner, daviser, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1844331
Signature: t1:1844331:1423864952:fdc9f0c232407d5e6aa98a3030c7f4d28e6ad169
Summary:
While working with fbandroid folks working in OSX, it looked like there were
some issues with escaping parentheses in the console. Also, parens are annoying
to type even in Linux. Let's have a lighter-weight suffix to the preamend
bookmarks.
Test Plan: ./run-tests.py
Reviewers: durham, sid0, mitrandir, daviser, ericsumner
Differential Revision: https://phabricator.fb.com/D1844272
Summary:
I wanted a way to see a commit in relation to the other smartlog entries, so
I refactored smartlog to provide a revset function for its default selections.
Test Plan: ##run-tests##
Reviewers: durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1794762
Tasks: 6057467
Signature: t1:1794762:1421888058:9b96d26f68b9b3bac24ef43db58fe8aa0299de37
The sparse checkout extension had a pretty bad flaw where rebasing across
certain no-op file changes would fail the rebase. This was due to Mercurial
adding a 'keep' action on those files and that action getting translated to a
'remove' by the sparse extension, then failing to edit the dirstate during the rebase
branchmerge.
The fix is to only issue 'remove' actions if we're not in a branchmerge
and the file in question is in the workingcopy but shouldn't be.
I also added more validation for the branchmerge scenario to make sure we aren't
losing any dirstate data. It will basically abort if any action besides 'keep'
is performed on a file outside the sparse checkout.
Upstream Mercurial has changed the return value of merge.calculateupdates in two
ways: 1) actions is now a file->action mapping instead of a
actiontype->list-of-files mapping, 2) it now returns actions, diverge,
renamedelete where the last two are just used for displaying to the user and can
be pretty much ignored by the sparse extension.
Summary:
strip -r . -k rebuilds the dirstate and was inserting filtered entries
into the dirstate. This fixes rebuild to exclude sparse files.
Test Plan: Added a test
Reviewers: sid0, pyd, davidsp, mitrandir, rmcelroy
Differential Revision: https://phabricator.fb.com/D1743331
Summary:
https://www.facebook.com/groups/sourcecontrol/permalink/759079160808373/
Many thanks to @sid0 for guidance here.
Test Plan:
Ran this script:
hg up master
echo a >> README.txt
arc feature foo
Before it failed, now it works.
Also a new test.
Reviewers: sid0
Reviewed By: sid0
Subscribers: hannesr, sid0
Differential Revision: https://phabricator.fb.com/D1738821
Tasks: 5810509
Signature: t1:1738821:1418669776:18cd358a99254f7552dacb9b9aa1599364b2d47d
Summary:
The rebase extension bypasses the changegroup processing hooks, so they need to
be called explicitly.
Test Plan: Added hooks to the existing test
Reviewers: pyd, durham
Reviewed By: durham
Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner
Differential Revision: https://phabricator.fb.com/D1726408
Signature: t1:1726408:1418241039:4e51a6dcbf3134f12d55c8e902de9ca7086883d1
Summary:
Through experiments we've found that for highly interleaved histories, generating a changegroup2 can be 6-7x as slow as generating a changegroup1.
While we work this out upstream, ship an extension to write changegroup2s out to disk.
Note that we'll only write cg2s for strips (and related operations like amend) -- for regular bundles we'll continue to write changegroup1 for maximum compatibility.
Test Plan:
Ran the included tests. Also ran the full Mercurial test suite with:
```
python run-tests.py -j32 --extra-config-opt extensions.writecg2=/home/sid0/local/fb-hgext/writecg2.py
```
Finally, tried it out in fbobjc. Found a 6x gain in strip performance with this extension enabled.
Reviewers: durham, davidsp, rmcelroy, akushner, daviser, mitrandir, ericsumner, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D1774334
Signature: t1:1774334:1420844207:461b830aafd7728ea3b5593fe0a02f6f66444ec3
Test Plan:
* New test
* Ran all mercurial tests with this extension enabled. Most tests passed, and the ones that failed were due to additional output thansk to the enabled extension (eg, help screens mentioning the extenstion, and config dumps listing the extension as enabled).
Reviewers: sid0, davidsp, pyd, durham
Reviewed By: durham
Subscribers: ps
Differential Revision: https://phabricator.fb.com/D1691116
Tasks: 5503905
Signature: t1:1691116:1418066154:9d0950b7395038a7fa95b4ec26f9360ea2db9fc6
Summary:
After discussion in https://www.facebook.com/groups/sourcecontrol/permalink/755390834510539/ and playing around with the behavior,
I'm convinced this is the more user-friendly option for people. It's not git's behavior, but it's safer than git's and *way* safer
than mercurial's default.
Test Plan: Updated test
Reviewers: sid0, pyd, davidsp, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1717431
Signature: t1:1717431:1417654306:a584a85cfe76fd03d29a3391f83892af41d26cb6
Summary:
Adds a sparse checkout extension that allows you to checkout just part of the
working copy. This only affects the working copy, it does not affect history,
or what is pushed and pulled from the server.
The basic api is:
hg sparse --include PATTERN... # add a pattern to the sparse checkout
hg sparse --exclude PATTERN... # excludes files from the sparse checkout
hg sparse --delete PATTERN... # deletes an include/exclude rule
hg sparse --enable-profile # enables a predefined sparse profile
hg sparse --disable-profile # disables a predefined sparse profile
hg sparse --reset # makes the repository full again
hg sparse --refresh # refreshes the working copy if .hg/sparse was
modified manually
hg sparse # show the current sparse rules
Test Plan:
Added tests. Ran them. Also deploy it to a couple users for a bit
without major issues.
Reviewers: pyd, sid0, rmcelroy, davidsp, mpm
Subscribers: mitrandir, akushner
Differential Revision: https://phabricator.fb.com/D1698824