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:
Both remotenames and directaccess work best if they wrap tweakdefaults
instead of the other way around. While directaccess already takes care of this,
remotenames does not. Since remotenames is a more "general use" extension than
tweakdefaults, it feels better to change the order in this extension.
Test Plan:
Manually tested configs where tweakdefaults came before and after
remotenames. Before this change, remotenames rebase implicit tracking target
failed if tweakdefaults was listed after remotenmaes; after this change, it
worked regardless of the order the two extensions are listed inside of config
files.
Reviewers: lcharignon, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D2212774
Signature: t1:2212774:1435854403:c651c73d806bcb9515a540c4e8f161a0f42ead69
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:
Fix node computation in overridechangegroupsubset(). Previously it could
return many nodes that weren't descendants of any of the roots.
Say you had a tree like this:
A E
| |
B D
|/
C
If you tried to strip A and B, the old code would set discbases to [C],
and incorrectly include D and E in the returned results.
This bug also exists in the upstream changegroup.changegroupsubset() function.
We should probably fix it there too.
Test Plan:
Confirmed that 'hg strip -v' didn't grossly overreport how many commits needed
to be included in the bundle. In my test case the old code incorrectly put
15k+ commits in the bundle, instead of just the 4 commits being stripped.
Reviewers: pyd, mpm, ericsumner, durham
Reviewed By: durham
Subscribers: ericsumner, net-systems@, exa
Differential Revision: https://phabricator.fb.com/D2150067
Tasks: 7391096
Signature: t1:2150067:1434410675:f7e2520e9b7783e97b69c898b3f447a3e7cb2763
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:
Before this patch, we were displaying one directaccess warning per repo.
With this patch we display only one warning for the lifetime of the hg process.
Test Plan: checked manually
Reviewers: pyd, mitrandir, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D2165815
Tasks: 7403121
Signature: t1:2165815:1434578693:fc471d67aa0f567fa234b020827a68673364d870
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:
inhibit: fix plan for evolve users
As @sid0 pointed out, this was missing from the help message
Test Plan: N/A
Reviewers: durham, sid0, pyd
Subscribers: sid0
Differential Revision: https://phabricator.fb.com/D2160236
Summary:
The dirstate wrapping functions were being run as part of reposetup, which
caused them to be wrapped multiple times, resulting in it exceeding the stack
size in some cases.
This moves the dirstate wrapping to be at extsetup time.
Test Plan:
histedit in facebook-hg-rpms used to break with stack overflow
errors. Now it doesn't. It seems the issues is more likely in repos with lots of
subrepos.
Reviewers: rmcelroy, ericsumner, lcharignon, pyd
Differential Revision: https://phabricator.fb.com/D2152047
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: inhibit: add extension to warn evolve beta users
Test Plan:
Checked with and without cutoff date set in hgrc that the message
is displayed when it has to.
Reviewers: durham, pyd
Differential Revision: https://phabricator.fb.com/D2080693
Tasks: 6634899
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:
backups: make hg backups evolve aware
With this patch: hg backups urges evolve user to look at hg reflog to recover
hidden commits. This is because evolve's commands are using obsolescence
markers to hide commits instead of stripping them.
Test Plan: Cross repo dependency, not sure how to make an automated test
Reviewers: durham, pyd
Differential Revision: https://phabricator.fb.com/D2088486
Tasks: 6534705
Summary:
This copies a bunch of logic from ##gitrevset.py## which should allow the
##fbconduit## extension to be a complete replacement for ##gitrevset##.
Overall, execution times are comparable for the revset and will be much
better for the template (assuming >20% cache hit rate)
Test Plan:
hg log -r 'gitnode("32cb236d579acb48668f8575205c0611b859e883")' -T '{node}\n'
hg log -r 'g32cb236d579acb48668f8575205c0611b859e883' -T '{node}\n'
hg log -r 'master~50::master' -T '{gitnode}\n'
Reviewers: #sourcecontrol, sid0
Reviewed By: #sourcecontrol, sid0
Subscribers: sid0
Differential Revision: https://phabricator.fb.com/D2074214
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:
phrevset: fix because of changes in core
Core changed the definition of stringset, it broke git and phabricator revset
that we define in fb-hgext. This is the same fix than the one we did for
the git revset.
Test Plan: N/A
Reviewers: durham, mitrandir
Differential Revision: https://phabricator.fb.com/D2065005
Summary:
Bookmarks apis are changing in core, need to update these extensions to not
break across that change.
Test Plan: ran tests against current and latest hg with bookmarks patches applied.
Reviewers: #sourcecontrol, durham
Reviewed By: #sourcecontrol, durham
Differential Revision: https://phabricator.fb.com/D2059856
Summary:
We changed the way stringset work in core and we need to update our wrapping
in gitrevset. All the tests pass with this patch.
Test Plan: All tests are passing now
Reviewed By: pyd
Reviewers: durham, pyd
Differential Revision: https://phabricator.fb.com/D2055557
Summary:
Instead of wrapping the system histedit, lets wrap the one that was loaded by
mercurial. This makes it easier to test fbhistedit against development versions
of histedit.
Test Plan:
Ran a histedit with --config extensions.fbhistedit=/data/... --config
extensions.histedit=/data/... and verified fbhistedit wrapped the custom
histedit. Also ran the tests.
Reviewers: davidsp, rmcelroy, sid0, lcharignon, pyd
Differential Revision: https://phabricator.fb.com/D2040653
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
The remotefilelog extension just passes the ctx.rev() it was given down to
sparse. Sometimes this value is None. In this situation we would previously puke
(we expected calls to be repo.sparsematch() instead of repo.sparsematch(None)).
This change fixes that by allowing repo.sparsematch(None).
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:
When using evolve with the inhibit extension, calling a revset can change the
changelog (since which revs are filtered can change). This affects smartlog
because it tries to cache the changelog functions early on, and there operates
on an old changelog.
Fix this by caching the changelog functions after we've performed the revset.
Test Plan: hg sl -r '<hidden commit> + .'
Reviewers: lcharignon, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D2033643
Signature: t1:2033643:1430357541:21c7a8c07ea8d145af4db40b835a3309239bbe6a