Commit Graph

2466 Commits

Author SHA1 Message Date
Siddharth Agarwal
554be401b3 update run-tests.py 2014-09-08 12:49:25 -07:00
Siddharth Agarwal
bb96467321 [tweakdefaults] use hint for no-arg update message
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
2014-09-08 12:43:38 -07:00
Pierre-Yves David
2c956d95e2 revert: only pre-fetch files that needs to be touched
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
2014-09-08 15:20:59 +02:00
Durham Goode
580f3eaeb3 Update to match Mercurial version b8c8cacd4482
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
2014-09-11 14:39:14 -07:00
Durham Goode
d1e9ad4603 Fix hg update -r 2014-09-03 08:46:45 -07:00
Durham Goode
0df0625354 Fix 'update -r' to work with the new defaults
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
2014-08-19 11:21:45 -07:00
Durham Goode
17c16cf610 Optimize pullprefetch to limit number of stats
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
2014-08-19 09:33:31 -07:00
Durham Goode
8ee4b83502 Fix rebase default tweak to allow --abort and --continue. 2014-08-18 14:27:37 -07:00
Durham Goode
e46cd0e8e0 Merge heads 2014-08-07 10:23:18 -07:00
Durham Goode
e5228d9989 Fix pullprefetch that uses bookmarks
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
2014-08-06 18:50:57 -07:00
Siddharth Agarwal
07a515c430 don't show remotefilelog commands in the shortlist
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
2014-07-23 20:37:48 -07:00
Durham Goode
f8b8c6a763 Tweak default update, log, and rebase behaviors
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
2014-07-23 09:47:35 -07:00
Pierre-Yves David
94c677f0ef Merge the external hg-experimental repository into the internal one.
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.
2014-07-28 18:38:44 -07:00
Delyan Kratunov
eea8a70884 [phrevset] Add ability to parse git revisions from Phabricator
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
2014-07-24 20:27:05 -07:00
Delyan Kratunov
c0418e22e8 [phrevset] Fix failing lookup
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
2014-07-24 19:36:09 -07:00
Andy Pincombe
8b485aaed4 Fix time import in backups
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
2014-07-24 15:03:53 -07:00
Durham Goode
99d6595d48 Fix phases during hg backups --recover
We weren't locking the repo when running unbundle during hg backups --recover.
This caused the phase roots to not actually be written to disk.
2014-07-22 13:11:09 -07:00
Durham Goode
c44433c62c Fix hg log on patterns
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
2014-07-22 12:55:29 -07:00
Durham Goode
124d6bd76b Update crecord extension 2014-07-14 18:52:11 -07:00
Durham Goode
549fee35f4 Merge divergent heads 2014-07-14 17:34:10 -07:00
Durham Goode
13058fb30c Allow auto-prefetching during pulls
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
2014-07-03 13:05:11 -07:00
Igor Pozgaj
0b3afb8ca4 Add entry for git blame
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
2014-06-30 11:17:41 -07:00
Siddharth Agarwal
f662120645 merge 2014-06-21 16:06:06 -07:00
Siddharth Agarwal
0d248aa73f applyupdates: update for Mercurial changes
Summary: Update for Mercurial commits 1b6040917a6c anmd 9b42f49d06aa.

Test Plan: Ran the tests

Reviewers: durham, dschleimer, pyd, akushner, davidsp

Reviewed By: davidsp

Differential Revision: https://phabricator.fb.com/D1388563

Tasks: 4533623
2014-06-17 15:47:12 -07:00
Pierre-Yves David
56531e909c merge with older backport
We had to backport some change before the gitmeta update as we are not ready to
ship the latest mercurial heads.
2014-06-16 14:33:22 -07:00
Pierre-Yves David
805376a3bc test: glob an explicit mercurial version in fbamend test
Silly me.
2014-06-16 14:27:45 -07:00
Pierre-Yves David
77c4dddd95 test: glob an explicit mercurial version in fbamend test
Silly me.
2014-06-16 14:27:45 -07:00
Pierre-Yves David
b49da34abc fbamend: auto-disable when evolution is enabled
fbamend is not compatible with evolution. We now detect such situation and
noisily disable fbamend in that case.
2014-06-11 22:34:21 -07:00
Pierre-Yves David
84158ce683 test: add a very basic test for fb-amend
The next changeset will make some change to fbamend. I'm introducting a
minimalist test to be able to test the change.
2014-06-12 17:53:50 -07:00
Pierre-Yves David
3d194165f5 fbamend: auto-disable when evolution is enabled
fbamend is not compatible with evolution. We now detect such situation and
noisily disable fbamend in that case.
2014-06-11 22:34:21 -07:00
Pierre-Yves David
b5902fafde test: add a very basic test for fb-amend
The next changeset will make some change to fbamend. I'm introducting a
minimalist test to be able to test the change.
2014-06-12 17:53:50 -07:00
Pierre-Yves David
67107ae073 smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
2014-06-10 16:53:53 -07:00
Pierre-Yves David
ff0aee50eb smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
2014-06-10 16:53:53 -07:00
Pierre-Yves David
ab68fa3ea3 smartlog: simplify the coloration code with a list compression
Shorte, easier to read.
2014-06-10 16:53:53 -07:00
Pierre-Yves David
67fbcd0156 smartlog: turn obsolete changeset grey
He highlight the "undead" status of obsolete changeset by turning them grey, the
same way the current changeset is highlighted with purple.
2014-06-10 16:52:48 -07:00
Pierre-Yves David
7e0d5ef381 smartlog: turn obsolete changeset grey
He highlight the "undead" status of obsolete changeset by turning them grey, the
same way the current changeset is highlighted with purple.
2014-06-10 16:52:48 -07:00
Pierre-Yves David
ad5b4b4916 smartlog: turn obsolete changeset grey
He highlight the "undead" status of obsolete changeset by turning them grey, the
same way the current changeset is highlighted with purple.
2014-06-10 16:52:48 -07:00
Pierre-Yves David
ca67005ce2 gitlookup: declare unkown parameters in the part handler
Mercurial core now requires handler to declare known parameters. This is used to
detect unhandled mandatory parameter.
2014-06-04 17:18:39 -07:00
Pierre-Yves David
840e36d875 gitlookup: use BundleValueError instead of UnknownPartError
The exception have been renamed and moved into the ``mercurial.error`` module in
mercurial core.
2014-06-04 17:17:15 -07:00
Durham Goode
7321a5e343 Initial commit with extensions and readme 2014-06-02 12:54:54 -07:00
Siddharth Agarwal
08584add27 actually build gitlookup 2014-05-23 14:39:33 -07:00
Durham Goode
e6bee07496 Expand environment variables in cacheprocess and cachepath
Summary:
Expands environment variables in the cacheprocess and cachepath config options,
so users can specify something like remotefilelog.cachepath=$HOME/.hgcache

Test Plan:
Set my cachepath to $HOME/.hgcache on my laptop and manually
performed a shallow clone.  Verified data was put in ~/.hgcache

Reviewers: sid0

Differential Revision: https://phabricator.fb.com/D1342174
2014-05-21 12:28:03 -07:00
Durham Goode
c989a69647 Fix flakey tests
test-local.t was flakey because the state of the dirstate is non-deterministic
if files are written out within the same second. This rebuilds the dirstate
entirely in a few cases, which removes the flakeyness.
2014-05-21 13:24:49 -07:00
Siddharth Agarwal
5322d7b6fe add a command and server-side support to fetch git metadata
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
2014-05-20 22:32:54 -07:00
Siddharth Agarwal
ef8674624a Fix shallowbundle.getbundle for local non-remotefilelog repositories
Summary: Pulling from a local non-remotefilelog repo to a remotefilelog repo was broken. This fixes it.

Test Plan: `hg pull` from a local non-remotefilelog repo to a remotefilelog repo.

Reviewers: durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1341059
2014-05-20 20:56:19 -07:00
Siddharth Agarwal
cdda6c15f8 add an extension that allows server-side hg->git and git->hg lookups
Summary:
This is a massive hack until Dewey becomes capable of answering these questions.

The plan is to use these commands in `arc diff` and `arc patch` to send the Git versions of the base commit over, so that the diff and land infra reaches parity with Git.

This should also unblock configerator-hg and allow the landing strip to work.

Test Plan:
In my `fbandroid-from-git` repo, enabled this extension, and then added the config:

```
[gitlookup]
mapfile = git-mapfile
```

Then, ran

```
hg id -r _gitlookup_hg_1fe73e73af4acadf1865a41e3aaa518a70cc2302 ssh://localhost//data/users/sid0/fbandroid-from-git -i --debug
```

Saw that the last line printed out was `76327beadc98c7c0559cd8aa36f0a25d93d781a5`, the Git equivalent of that commit.

After this, ran

```
hg id -r _gitlookup_git_76327beadc98c7c0559cd8aa36f0a25d93d781a5 ssh://localhost/data/users/sid0/fbandroid-from-git -i --debug
```

Saw that the last line printed out was `1fe73e73af4acadf1865a41e3aaa518a70cc2302`, as expected.

Reviewers: dschleimer, akushner, davidsp, pyd, mpm, durham

Reviewed By: durham

Subscribers: pradvenkat, akshay, thawan

Differential Revision: https://phabricator.fb.com/D1330813

Tasks: 3751836
2014-05-14 16:17:25 -07:00
Siddharth Agarwal
6b475e55a4 merge branches 2014-05-15 12:38:28 -07:00
Pierre-Yves David
fbd8c16dac githelp: properly abort on unknown command
Summary: We previously aborted with a KeyError traceback.

Test Plan: Run that thing with an unknown command, got a clear abort

Reviewers: durham

Differential Revision: https://phabricator.fb.com/D1299542
2014-04-28 12:51:23 -07:00
Durham Goode
02033526d4 Fix hg commit -l when using fbamend
A change in core mercurial added --edit to the commit options. This conflicted
with the fbamend --edit, which caused hg commit --amend -l foo.txt to actually
open the editor. Breaking arc diff.
2014-04-25 17:13:13 -07:00
Pierre-Yves David
f7a8458257 backups: compatibility with Mercurial 3.0 2014-04-25 11:21:34 -07:00