Commit Graph

12 Commits

Author SHA1 Message Date
Mateusz Kwapich
84c1720a00 fbhistedit: use user shell in histedit exec command
Summary:
This is hacky way of executing user shell in interactive mode so they get their aliases, bash functions, output coloring and more...

I put this behind config knob so if this doesn't work for user with very obscure shell they can always turn it off.

Test Plan: Tested it in my shell - used my shell aliases with exec (can't write unit tests since it's very environment specific - suggestions welcome).

Reviewers: ericsumner, rmcelroy, #sourcecontrol

Reviewed By: rmcelroy, #sourcecontrol

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

Tasks: 5852393

Signature: t1:2433238:1441961664:e4a9cb804dfb4f714278865e3abf370277836e5b
2015-09-10 22:53:28 -07:00
Durham Goode
6347babe11 fbhistedit: add execr action
Summary:
Adds an xr/execr action that executes the command relative to the
current working directory. This allows our users to run 'arc diff' and pick up
whatever the current arc project is (instead of whatever arc project is at the
root of the repository).

Test Plan: Added a test

Reviewers: davidsp, #sourcecontrol, lcharignon

Reviewed By: #sourcecontrol, lcharignon

Subscribers: rmcelroy, lcharignon

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

Tasks: 7795286
2015-08-04 10:55:33 -07:00
Durham Goode
9b0613badc fbhistedit: wrap the loaded histedit
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
2015-05-01 15:06:09 -07:00
Durham Goode
5956293896 fbhistedit: switch the exec action to be a histeditaction
Summary:
Upstream histedit has moved all it's actions to classes. Let's do the same for
exec.

Test Plan: Ran tests

Reviewers: sid0, rmcelroy, lcharignon, ericsumner

Differential Revision: https://phabricator.fb.com/D2001833
2015-04-17 09:58:36 -07:00
Durham Goode
af69020c32 fbhistedit: switch the stop action to be a histeditaction
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
2015-04-17 08:59:23 -07:00
Durham Goode
3d34417493 fbhistedit: fix to match upstream apis 2015-03-13 09:33:57 -07:00
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
Durham Goode
634cdaf0a5 histedit: fix --continue with exec
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
2015-02-17 20:04:40 -08: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
David Soria Parra
9333c05d2b fbhistedit: make stop compatible with hg tip
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
2014-10-16 13:58:47 -07:00
David Soria Parra
260cef360d fbhistedit: add x/exec command
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
2014-10-11 20:47:31 -07:00
David Soria Parra
0abdf44f41 fb-histedit: Add a histedit extension that adds stop
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
2014-10-09 10:54:43 -07:00