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
Summary: Use the bundle2 reply stream to send changes back to the client
Test Plan: Ran test
Reviewers: pyd, durham
Reviewed By: durham
Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner
Differential Revision: https://phabricator.fb.com/D1689551
Signature: t1:1689551:1416948875:987c7440298aa57d5cf46d420feab151ce9340b1
Summary: Use the bundle2 reply stream to send changes back to the client
Test Plan: Ran test
Reviewers: pyd, durham
Reviewed By: durham
Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner
Differential Revision: https://phabricator.fb.com/D1689551
Signature: t1:1689551:1416948875:987c7440298aa57d5cf46d420feab151ce9340b1
Summary:
Adds a new bundle2 parttype to accept a linear changegroup and rebase it onto
the designated position on the server.
Future work:
* Issue the new parttype from ##hg push## (under what circumstances?)
* Return new revisions to client in the bundle2 response
* Write automated tests
* Support v2 changegroup packing?
* Test compatibility with the extensions we commonly use
Test Plan:
Diff includes an hg command that issues the new parttype; have used it to test
manually on a repository with 2 files.
Reviewers: akushner, sid0, davidsp, mpm, daviser, rmcelroy, pyd, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1670811
Signature: t1:1670811:1416335316:05c5ae8a35ba28cab87c474bab28afe91e8702d2
Summary:
Adds a new bundle2 parttype to accept a linear changegroup and rebase it onto
the designated position on the server.
Future work:
* Issue the new parttype from ##hg push## (under what circumstances?)
* Return new revisions to client in the bundle2 response
* Write automated tests
* Support v2 changegroup packing?
* Test compatibility with the extensions we commonly use
Test Plan:
Diff includes an hg command that issues the new parttype; have used it to test
manually on a repository with 2 files.
Reviewers: akushner, sid0, davidsp, mpm, daviser, rmcelroy, pyd, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1670811
Signature: t1:1670811:1416335316:05c5ae8a35ba28cab87c474bab28afe91e8702d2
Summary: `hg sl/slog/smartlog` has a new flag `--commit-info`, which shows the files changed in currently active commit.
Test Plan:
Modified & added & removed a file to in commit.
The deleted, unknown, ignored and clean are not relevant, when we are talking about a change in a commit - right?
hg sl
hg sl --commit-info
hg sl -T "blaa" --commit-info
hg slog
hg slog --commit-info
hg slog -T "blaa" --commit-info
Commit-info flag adds info under current commit about the added, modified & removed files.
hg sl --commit-info --stat
This looks weird as it shows the current commit changes twice. Should I care about this?
#in fb-hgext/tests
./run-tests.py test-smartlog.t
test passes.
Reviewers: sid0, pyd, davidsp, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1677101
Tasks: 5418936
Signature: t1:1677101:1415833805:975ce43aaaf1ccabe6a054d09a9e5f236447340f
Summary:
When evolve is enabled, reset should use prune and touch instead of
strip and unbundle.
Test Plan: Added tests.
Reviewers: pyd, sid0
Differential Revision: https://phabricator.fb.com/D1641160
Summary: The named branches support adds a new file called git-named-branches. Support that.
Test Plan: Ran the tests.
Reviewers: durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1655756
Signature: t1:1655756:1415047400:14a3a082390af25c713ef4d9f8721efb05e20875
Summary:
This adds a 'hg reset' command that acts similar to 'git reset'. It moves your
active bookmark to the desired location, along with your working copy parent. If
no flags are specified, the working copy contents is left alone. If --clean is
specified, the working copy contents is overwritten.
By default we will attempt to recover the commit from the backup bundles if it
is not in the repository. A future commit will add support for using touch/prune
when evolve is enabled.
Test Plan: Added tests, and ran them
Reviewers: sid0, davidsp, pyd, mpm, akushner, rmcelroy
Differential Revision: https://phabricator.fb.com/D1637658
Summary:
Use `first()` instead of `[0]`.
Also fix coloring under non-ANSI terminals (required to get the test working).
Test Plan: Ran the tests. Also ran `hg sl` with this in a few of my repos.
Reviewers: durham, davidsp, akushner, daviser, rmcelroy, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D1623808
Tasks: 5375006
Summary: Make stop compatible with the new hg tip
Test Plan: run tests, worked.
Reviewers: pyd, durham, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D1623384
Summary:
Add an execute command. This works similar to git's exec. However this
patch is a bit hacky but I want to get a first version out to our users. We have
to change some parts in histedit to make it easier to hook into
bootstrapcontinue and verifyrules. At the moment we can't get around copying
the implementation. Also need to add tests for obsolence.
Test Plan: Run tests, see it works.
Reviewers: pyd, sid0, durham
Reviewed By: durham
Subscribers: akushner, rmcelroy
Differential Revision: https://phabricator.fb.com/D1611838
Summary:
The phabdiff template mapping returns the phabricator diff id for the commit
(based on commit message).
for example:
$ hg log -r master --template '{phabdiff}\n'
D1485506
Test Plan: - unit tests addded
Reviewers: sid0, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1622192
Tasks: 5124920
Summary:
Use `first()` instead of `[0]`.
Also fix coloring under non-ANSI terminals (required to get the test working).
Test Plan: Ran the tests. Also ran `hg sl` with this in a few of my repos.
Reviewers: durham, davidsp, akushner, daviser, rmcelroy, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D1623808
Tasks: 5375006
Upstream no longer always uses bookmark.write to write. Sometimes it goes
through the transaction API and uses bookmark._write. So now we wrap that
instead.
Also adds a test that would have caught this, since the existing commit/bookmark
tests did not exercise this new write path.
Summary:
Add 'stop' verb to histedit. This is the version I submited to the ML
which got rejected because it doesn't preserve hashes. However as arc will
always modify the hash anyway that's save for us anyawy.
Test Plan: run tests, worked.
Reviewers: durham, sid0
Subscribers: akushner
Differential Revision: https://phabricator.fb.com/D1606075
Summary:
This adds an extension that tracks the locations of the working copy and
bookmarks over time. It's still a proof of concept, but I want to get it
deployed to start getting feedback.
Running `hg reflog` by default shows the previous locations of the working
copy (most recent first).
~/myrepo> hg reflog
Previous locations of '.':
35a5fcfee452 rebase -d master
32eee5e2d406 up .^
b5d6dab4f900 up foo -C
Specifying a bookmark name shows the locations of that bookmark over time.
~/myrepo> hg reflog foo
Previous locations of 'foo':
d1a696044ec0 rebase -d master
35a5fcfee452 rebase -d master
32eee5e2d406 book foo -f
--verbose will show more information about each entry.
~/myrepo> hg reflog foo -v
Previous locations of 'foo':
35a5fcfee452 -> d1a696044ec0 durham 2014-10-01 18:32:14 rebase -d master
32eee5e2d406 -> 35a5fcfee452 durham 2014-10-01 17:28:54 rebase -d master
000000000000 -> 32eee5e2d406 durham 2014-10-01 17:28:30 book foo -f
It's currently stored as a single .hg/reflog file that is append only. Each
entry can store an arbitrary number of hashes (like storing 2 hashes for a merge
state working copy), which means we could also potentially use this to track
heads in branches as well.
It also (sorta) works with '-T json' for machine readable output:
~/myrepo> hg reflog foo -T json
[
{
"command": "up .^",
"date": "2014-10-02 13:54:45",
"newhashes": "474ff61d1a36",
"oldhashes": "d1a696044ec0",
"user": "durham "
},
{
"command": "book foo",
...
]
Test Plan: Added tests. Ran them.
Reviewers: sid0, pyd, mpm, davidsp, akushner
Differential Revision: https://phabricator.fb.com/D1592875
Summary:
Add a bunch of features to make `hg grep` full-featured.
- Support for basic, extended and Perl regexps.
- Support for filter patterns, including filesets.
- Support for color in the output.
Test Plan: Ran the tests, and ran `hg grep` against the repo.
Reviewers: davidsp, akushner, pyd, daviser, durham
Reviewed By: durham
Subscribers: robarnold
Differential Revision: https://phabricator.fb.com/D1578743
Summary: I added a grep command that does the wgrep alias. I also moved the traditional functionality of grep to histgrep. One thing missing is the help strings.
Test Plan:
I used both wgrep and my new grep on a couple queries in www. They returned the same results. I did similar things with the traditional grep and my histgrep.
I wrote tests in fb-hgext/tests/test-tweakdefaults.t and they passed.
Reviewers: pyd, davidsp, akushner, durham, sid0
Reviewed By: durham, sid0
Subscribers: akushner, micha
Differential Revision: https://phabricator.fb.com/D1572855
Tasks: 5162839
Summary: Allow git hashes to work with a `g` suffix, sort of like Subversion's `r`.
Test Plan: Ran the tests, and tested it out in fbandroid-hg.
Reviewers: davidsp, akushner, pyd, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1571258
Summary: With tweakdefaults `hg rebase` broke when the destination contained a hyphen. This made me sad :(
Test Plan: Tested rebase with hyphen, and ran tests.
Reviewers: pyd, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1565265
Summary: The location of `bundle2caps` changed.
Test Plan: Ran the tests, saw that they no longer failed.
Reviewers: durham, davidsp, akushner, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D1562466
Tasks: 5170539
Summary: This makes the error easier to read.
Test Plan: Ran `hg update`, saw that the error was printed across two lines.
Reviewers: durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1542591
Summary:
The tweakdefaults extension broke 'hg update -r'. This fixes it and
adds a test.
Test Plan: Added a test.
Reviewers: sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D1506040
Summary:
This makes tweaks to the Mercurial defaults, to improve the user experience:
- hg update without arguments now aborts
- hg log now defaults to -f
- hg rebase without -d now aborts
- hg rebase will fast forward a bookmark if possible
Test Plan: Added a test, ran it.
Reviewers: mpm, sid0, davidsp, dschleimer, akushner
Differential Revision: https://phabricator.fb.com/D1501398
Summary:
When a machine is newly set up, it needs to have the git mapfile available. Generating it from scratch is prohibitively slow for large repos like `configerator`, so instead add a command that can download the entire git metadata from a server that has it.
This is a temporary hack while I work on a real fix to upstream to hg-git. A real fix would be
- part of hg-git
- not send the entire git metadata over, just the bits that are needed based on a common/heads computation
- be dependent on bundle2
- (probably) be part of the pull operation, not a separate command
- be configurable with an option
This isn't part of hg-git, even in a private branch, to emphasize its temporary nature. `gitlookup` might also not be the best fit, but I want to avoid adding yet another extension for a temporary hack.
Test Plan:
Ran the following commands. Note that the current version of `hg` deployed to devservers is broken, so we need to deploy an updated hg before enabling this. These commands were tested against 1ced7c762592
(in `fbandroid-hg`, with `gitlookup` enabled on both ends and the remotefilelog fix in D1341059)
hg gitgetmeta ../fbandroid-from-git
Saw that 3 files were written out.
hg gitgetmeta ssh://localhost//data/users/sid0/fbandroid-from-git
Saw that 3 files were written out.
Reviewers: dschleimer, davidsp, akushner, durham, pyd
Reviewed By: pyd
Differential Revision: https://phabricator.fb.com/D1341166
Tasks: 3751836