Summary: The hg equivalent of git grep is hg grep now.
Test Plan: I used the extension and called hg githelp -- git grep and it said hg grep
Reviewers: sid0, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1576499
Tasks: 5162839
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:
The ResponseError exception expect a second argument. Otherwise the code
handling it crashes.
Test Plan: The handling of the response error stop crashing.
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D1581574
Summary:
If the orig function crash before the fileservice is installed, the finally
clause explode, shadowing the original error. We fixes thats.
Test Plan:
crash stopped being shadowed but crash in the finally clause.
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D1581562
Summary: API change
Test Plan: @durham ran an amend.
Reviewers: durham
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D1569510
Summary:
Upstream Mercurial changed the way merging works and added
revlog.commonancestorsheads. This changes remotefilelog to implement the same
API.
Previously we were able to use ancestors.genericancestors to do the graph
traversal. Upstream Mercurial has deleted that function though (since it is now
unused), so remotefilelog must now build a temporary rev graph in order to use
the ancestors.* apis.
Test Plan: Added a test. It failed without the fix, it passes with the fix.
Reviewers: sid0, davidsp, pyd
Differential Revision: https://phabricator.fb.com/D1566787
Summary: This was broken by recent changes.
Test Plan: Ran test suite.
Reviewers: durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1558890
Tasks: 5170539
Summary:
Adds a wip extension which will allow clients to checkout
bookmarks from their peers instead of using arc patch.
This is accomplished by writing metadata about every
commit to a mysql database. When the user attempts to
checkout another user's bookmark, eg `hg checkout mjberger/test`,
the extension queries the mysql server to see if the bookmark
'test' exists on mjberger's dev server. If so, the extension
will use 'hg pull' to download the bookmark.
This is a wip and should not be used in production. Besides being
a hacky implementation, it currently relies on fbcode and does
not remove bookmarks from the mysql server when the client deletes
them.
Test Plan: doitlive
Reviewers: durham
Reviewed By: durham
Subscribers: njormrod, agallagher
Differential Revision: https://phabricator.fb.com/D1542144
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:
With recent version of mercurial (>= 3.2, 4dfcf21a6aa7), revert uses status
information to determine the files that needs to be touched. It then offer a
simple handle for extensions that needs prefetch.
Test Plan:
Ran the tests. Certain tests depended on the old revert behavior (of
prefetching everything), so they required slight changes.
Reviewers: pyd, sid0, davidsp
Differential Revision: https://phabricator.fb.com/D1551059
Summary:
Changegroups have been refactored upstream and we need to update our
remotefilelog monkey patching accordingly.
Also fix an issue with the tests where 'function foo()' was not considered valid
on certain systems.
Test Plan: Ran the tests
Reviewers: pyd, sid0, davidsp
Differential Revision: https://phabricator.fb.com/D1551019
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:
Previously, if pullprefetch was set, we'd perform a prefetch of the
entire manifest of the specified revs (usually the public bookmarks). This
involved stat-ing all the relevant files in the cache to see if they already
existed, which added an extra 6 seconds or so to every pull.
Now we only prefetch the files that are different from our working copy. We
assume we already have all the files that are in our working copy. This reduces
the pullprefetch overhead significantly.
Test Plan:
Did a pull on my laptop. Verified it didn't hang for 6 seconds at the
prefetch stage. Also updated a test
Reviewers: davidsp, pyd, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D1505841
Tasks: 4608894
Summary:
Previously, pullprefetch was executed during the repo.pull stage. This happens
before the bookmarks have been moved, so revsets like 'bookmark()' would
prefetch the wrong commits.
This change moves the pullprefetch logic to after the pull command is completely
finished. Updated a test to make sure this is caught.
Also fixes a bug where we were using linkrevs to read a manifest rev entry. We
should be using the manifest rev instead.
Test Plan: Added a test. Ran it.
Reviewers: sid0, pyd, davidsp
Differential Revision: https://phabricator.fb.com/D1483345
Summary: These commands (well, not the debug one) were visible in the shortlist that showed up when you type `hg`. They're not basic commands.
Test Plan: Ran `hg` with the extension enabled, didn't see those commands.
Reviewers: durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1454931
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
This will allow simple synchronisation between the public facing and the
external repository. Change to the Facebook only extension should be done on in
the fbonly branch. Fix the public facing extension should happens in the default
branch.
Merge should always happen from default to fbonly. Never the other way around.
Beware that facebook only changesets exist on the default branch before this
merge.
Summary:
We couldn't handle the git case (fbandroid-hg) at all. This fixes that.
I changed my .hg/hgrc to have
```[phrevset]
callsign = FA```
but I've no idea how to do that globally.
Test Plan:
```
[diffrev] Starting Conduit call
[diffrev] echo '{"revision_id": "1153911"}' | arc call-conduit differential.getdiff
[diffrev] Starting log walk
[diffrev] Traversing log for 1153911
[diffrev] Conduit call returned 0
[diffrev] VCS is git
[diffrev] GIT rev is 34838a7f1d68531f385e471bf76f89c6620ea563
Path: ssh://hg.vip.facebook.com//data/scm/fbandroid opts: {}
running ssh hg.vip.facebook.com 'hg -R /data/scm/fbandroid serve --stdio'
sending hello command
sending between command
remote: 199
remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch stream-preferred streamreqs=lz4revlog,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN httpheader=1024 remotefilelog
remote: 1
sending lookup command
[diffrev] HG rev is e67eac10eef35a21a3b61f8aa8caa330884d48d4
...
```
Reviewers: sid0, davidsp
Reviewed By: davidsp
Differential Revision: https://phabricator.fb.com/D1458491
Summary: phrevset was completely broken, even for the case where it does a linear search.
Test Plan:
Tested before and after in fbandroid-hg. It was finding the revision but
`hg log -r 'DXX'` wasn't printing anything.
Reviewers: sid0, davidsp
Reviewed By: davidsp
Differential Revision: https://phabricator.fb.com/D1458472
Summary: Fix the import of the time package for calls to strftime() and localtime().
Test Plan:
* Edited /usr/lib/python2.6/site-packages/backups.py, cleared .pyo & .pyc, and verified
that `python -c "import backups"` didn't error out on import
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D1456741
Summary:
Due to a change in upstream mercurial, hg log with patterns was no longer
working. This fixes it by forcing hg log to take the slow path when using
patterns.
It also updates the warning messages to work when running hg log <file> from
within a subdirectory.
Test Plan: Ran the new tests
Reviewers: sid0
Differential Revision: https://phabricator.fb.com/D1450193
Summary:
Adds a remotefilelog.pullprefetch config options that accepts a revset. Whenever
a pull is run, the revs matched by that revset will be prefetched. The most
common value for this will be '(bookmark() + heads(all())) & public()', since it will download
almost everything necessary to work offline.
Test Plan: Added a test. Ran it.
Reviewers: davidsp, pyd, sid0
Reviewed By: sid0
Differential Revision: https://phabricator.fb.com/D1419420
Summary: hg githelp blame didn't work
Test Plan: not sure how to test this
Reviewers: pyd, davidsp, durham
Reviewed By: durham
Subscribers: sameen
Differential Revision: https://phabricator.fb.com/D1411080