Commit Graph

16 Commits

Author SHA1 Message Date
Ryan McElroy
f19c04580a Merge fbonly into default
Summary:
A ton of tests in the 'default' branch are broken, yet they all work in 'fbonly' (because that's what we test and push).

Let's give the world all of our goodness. Bleeding edge is where it's at.

Top of hg sl now looks like:

```
@    386a20  rmcelroy
|\   merge fbonly into default
| |
o |  a284c7  rmcelroy  D1880107  remote/@
| |  githelp: add: mention that record and crecord make commits
| |
| o  f4870a  sid0  remote/fbtip  fbonly
| |  crecord: update to latest default
```

Test Plan: run-tests.py actually works now

Reviewers: davidsp, ericsumner, mitrandir, akushner, durham, sid0

Reviewed By: durham

Subscribers: lcharignon, mpm, ps

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

Signature: t1:1883891:1425613263:8c199f339596384aa7d089154ef99eb982ecff87
2015-03-08 12:22:25 -07:00
Drew Gross
d4e6c1d643 Fix a bug that prevents hg up -d from working properly with our extensions
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
2015-03-02 10:54:07 -08:00
Ryan McElroy
34be666d38 tweakdefaults: allow update to current rev when working copy is not clean
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
2014-12-13 18:13:41 -08:00
Ryan McElroy
e32d2ef5da tweakdefaults: make update --check default; override with --nocheck
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
2014-12-03 15:45:53 -08:00
Siddharth Agarwal
ee01e471d1 [tweakdefaults] add the ability to customize the grep command
Summary: For OS X I'm going to install a private copy of GNU `grep` to a directory not in the PATH. With this we'll be able to point to that copy of `grep`.

Test Plan:
I'm relying on the fact that GNU grep is a hell of a lot faster than BSD grep.

With GNU grep available at `/opt/facebook/libexec/mercurial/grep`, in fbandroid,

```
$ time hg --config grep.command=/opt/facebook/libexec/mercurial/grep grep <yubikey> java
0.81s
$ time hg grep <yubikey> java
4.65s
```

Reviewers: davidsp, akushner, pyd, daviser, rmcelroy, durham

Reviewed By: durham

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

Tasks: 4786323

Signature: t1:1654012:1415041229:9c5c175e650cea29e71bb3ce138edbc661771077
2014-10-31 19:13:32 -07:00
David Soria Parra
cddc80fd98 fb-hgext: add docstrings for extensions
Summary:
Most of our internal extensions don't have any docstringa causing hg help
to show nothing. I think this is confusing, as we teach people to use hg help.
In particular for our extensions they won't find anything on the internet
but hg help won't help either. So let's add rudimentary help texts.

Also ensure that gitnode is properly documented in hg help revset.

Test Plan:
added extensions, checked hg help and hg help extension. Also
checked hg help revset for gitnode.

Reviewers: rmcelroy, durham, sid0, akushner

Differential Revision: https://phabricator.fb.com/D1645964
2014-10-28 23:06:11 -07:00
Siddharth Agarwal
3352fc0344 [grep] ignore symlinks
Summary:
Previously, `hg grep` would follow symlinks because that's what `grep` does. This is a problem in fbcode because of all the tp2 and dewey symlinks. Handroll our iteration and ignore all files recorded as symlinks in the dirstate. This isn't perfect, but it's good enough and it's a lot faster than stating all the files.

Presumably we can integrate this with hgwatchman at some point.

Now, `hg grep <random string>` in fbcode takes just 2.6 seconds. (`git grep` takes 4.)

Test Plan: Ran tests.

Reviewers: daviser, akushner, davidsp, pyd, durham

Reviewed By: durham

Differential Revision: https://phabricator.fb.com/D1587863
2014-09-30 16:37:32 -07:00
Durham Goode
10667d93fd Move command wrapping to be inside extsetup
Summary:
Previously we wrapped commands at global initialization time, which is just
plain wrong (since other commands may not have even be initialized yet). Now we
do it inside extsetup.  It's mildly important that we do it in extsetup (vs
uisetup) because other extensions, like remotefilelog, wrap commands in the
uisetup and we want to make sure that our tweaks (like passing -f to log) come
first.  And by wrapping last, we get invoked first.

Test Plan: Ran the tests

Reviewers: sid0, davidsp, pyd

Differential Revision: https://phabricator.fb.com/D1578154
2014-09-25 11:34:07 -07:00
Siddharth Agarwal
883a155fdd [tweakdefaults] superpower grep
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
2014-09-25 13:50:36 -07:00
Erin Davis
51411dc368 Swapped the functionality of grep with wgrep and added histgrep
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
2014-09-24 15:11:10 -07:00
Siddharth Agarwal
d992bf1282 [tweakdefaults] fix rebase when destination contains a hyphen
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
2014-09-18 17:22:14 -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
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
8ee4b83502 Fix rebase default tweak to allow --abort and --continue. 2014-08-18 14:27:37 -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