Commit Graph

500 Commits

Author SHA1 Message Date
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
72c2c0ee05 simplecache: update pathcopies wrapper signature
Summary:
Upstream has changed the pathcopies signature to include a matcher, so we need
to do the same.

Test Plan: Ran tests with new hg

Reviewers: rmcelroy, sid0, lcharignon

Differential Revision: https://phabricator.fb.com/D2001829
2015-04-17 10:00:47 -07:00
Ryan McElroy
9d0379fb36 fbamend: configurable user education
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
2015-04-17 10:17:23 -07:00
Pierre-Yves David
85ecf16f11 setup: get the b2xcompat extension installed
Summary: Now that we have it, we wants it deployable

Test Plan:
ran setup.py install --prefix=/tmp/babar/

The file was there!

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D1990894
2015-04-14 08:59:23 -07:00
Ryan McElroy
efe74ca9a4 fbamend: add addremove (-A) option
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
2015-04-15 09:29:09 -07:00
Pierre-Yves David
5291c13da1 add an extension to support the HG2Y format
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
2015-04-07 11:37:55 -07:00
Durham Goode
933f828bb1 sparse: add temporarily included files when merging
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
2015-04-09 17:17:03 -07:00
Durham Goode
42804877b3 sparse: prune the temporary file list on commit and update
Summary:
If a commit or update happens, check if the working copy is clean, and if it is,
delete all the temporarily included files. This calls hg status, which may have
perf implications, but since we're dealing with sparse checkouts, hopefully it
won't be too bad for now.

Test Plan: Ran the tests

Reviewers: sid0, pyd, lcharignon, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:1982949:1428635990:29ddacdf3f32a38ce0e725ed9db7e13e98e0f21e
2015-04-09 17:14:42 -07:00
Durham Goode
27e584fa9c sparse: account for temporary includes in sparsematch creation
Summary:
Now that we store a list of temporary included files, add them to the sparse
matcher using our new forceincludematcher.

Test Plan: Ran the tests

Reviewers: sid0, pyd, lcharignon, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:1982948:1428635825:b8d2dcd94df5d75946b96cf2ac1ad29691d54066
2015-04-09 17:13:11 -07:00
Durham Goode
1c30325bf5 sparse: add new temporary includes
Summary:
The tempsparse file can now be used to contain a list of files that should be
temporarily included in the sparse checkout. This is useful for bringing in
merge conflicts to be dealt with.

Future patches will populate and prune the set of temporary includes.

Test Plan: Ran the tests

Reviewers: sid0, pyd, lcharignon, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:1982947:1428635211:e92ed0b48aed55217dac1b864214f924dc672828
2015-04-09 19:00:59 -07:00
Durham Goode
e7d7119973 sparse: switch to using new matcher classes instead of functions
Summary:
Previously I just returned a function as the matcher in certain cases. This
failed in a bunch of places because Mercurial expects the matcher to have
functions on it like isexact() and always(). Let's switch to a matcher class
that does the same thing.

Also add a new matcher that will be used to force certain files to always return
true. This will be useful for temporarily adding certain files to the working
copy during a merge.

We may want to send these kinds of things upstream once they're more robust.

Test Plan: Ran the tests

Reviewers: sid0, pyd, lcharignon, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:1982945:1428634767:613984f99be8bdc05f82bae11cf4ee28d5922ac1
2015-04-09 17:09:40 -07:00
Durham Goode
28e9f7b09c sparse: minor fix up to a few spots
Summary:
As part of a larger refactor, I did some minor fix ups. In one case I change the
default value from [] to set(), because the non-default values are set()
already, so this makes it more consistent.

In the other case I just moved something into a better scope for readability
since I'll be adding a very similar piece of code later.

Test Plan: Ran the tests (though this code path is unused right now)

Reviewers: sid0, pyd, lcharignon, rmcelroy

Reviewed By: rmcelroy

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

Signature: t1:1982943:1428634617:b3449acd6bc08c53daf1de7be8f44f0dc543ef1c
2015-04-09 19:01:34 -07:00
Nat Mote
c170003d67 Githelp: properly handle '--' in checkout args
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
2015-04-13 14:57:52 -07:00
Nat Mote
aca2687a3b Handle githelp for 'git commit --amend --no-edit'
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
2015-04-13 10:47:34 -07:00
Ryan McElroy
5f9e3bb604 fbamend: keep explicitly passed message
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
2015-04-07 13:31:44 -07:00
Durham Goode
2cc36eb05c sparse: fix rebasing new sparse profiles
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
2015-04-03 16:45:36 -07:00
Siddharth Agarwal
9a3748f730 [pushrebase] fix for Mercurial 3.4
Summary: The `intersectfiles` API changed.

Test Plan: ran the tests

Reviewers: ericsumner, #sourcecontrol

Reviewed By: ericsumner, #sourcecontrol

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

Tasks: 6619970

Signature: t1:1966309:1428086453:415a185b71af4812de2f5b6690a5337a5950aab6
2015-04-03 11:38:55 -07:00
Laurent Charignon
8b3d2878c1 githelp: add git rebase --skip
Summary: githelp: add git rebase --skip

Test Plan: Wrote and ran test

Reviewers: mathieubaudet, rmcelroy, sid0

Differential Revision: https://phabricator.fb.com/D1946751
2015-03-26 12:48:36 -07:00
Mateusz Kwapich
fd872ab219 [githelp] Add reflog to githelp
Test Plan: .

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: #sourcecontrol, rmcelroy

Subscribers: rmcelroy

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

Tasks: 6579083
2015-03-23 20:44:52 -07:00
Andi Ni
1d750a090b Githelp now throws error rather than crashes on unrecognized option packed with other options.
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
2015-03-19 11:05:02 -07:00
Durham Goode
3d34417493 fbhistedit: fix to match upstream apis 2015-03-13 09:33:57 -07:00
Durham Goode
fc7e80fa9a smartlog: fix to match upstream 2015-03-13 09:29:29 -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
Siddharth Agarwal
54b6316cdb crecord: update to latest default 2015-03-06 12:59:11 -08:00
Siddharth Agarwal
34eb1268ff reintroduce crecord 2015-03-06 12:57:26 -08:00
Siddharth Agarwal
58bf1448bf Backed out changeset babc6ba5dd1e 2015-03-06 12:57:08 -08:00
Siddharth Agarwal
65e7df0886 also remove crecord in setup.py 2015-03-06 11:25:18 -08:00
Siddharth Agarwal
b7d409ac87 remove crecord since we've moved it to a subrepo 2015-03-06 11:23:49 -08: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
6f163f4e19 githelp: add: mention that record and crecord make commits
Test Plan: inspection

Reviewers: sid0

Reviewed By: sid0

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

Signature: t1:1880107:1425330619:fff59776e78c2b082e3618a07eb09e8f2bb6f04b

Blame Revision: D1782964
2015-02-27 21:57:51 -08:00
Ryan McElroy
3816687569 githelp: pull changes from fbonly branch 2015-02-27 21:53:59 -08:00
Ryan McElroy
1b69c516cc merge from default 2015-02-24 23:17:46 -08:00
Ryan McElroy
9b28146bb2 smartlog: fix bug in remote bookmark lookup 2015-02-24 23:16:06 -08:00
Mateusz Kwapich
4dc1293e89 [githelp] Fix crashes in branch
Summary: githelp was crashing when git branch -D was provided

Test Plan: .

Reviewers: #sourcecontrol, durham

Reviewed By: #sourcecontrol, durham

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

Tasks: 6061141
2015-02-24 18:47:25 -08:00
Ryan McElroy
a16275745c merge from default 2015-02-24 11:51:16 -08:00
Ryan McElroy
2536c27cf5 dbg: an extension for a quick hg REPL
Summary:
I've found this enormously useful for quickly trying things out on a repo.
I wish I could get it to work with ipython (probably requires a python upgrade),
but this is better than nothing.

Test Plan:
I've used it many times. For example:

```
$ hg dbg
--Return--
> /home/rmcelroy/dbg.py(13)debug_()->None
-> pdb.set_trace()
(Pdb) from mercurial import scmutil, node
(Pdb) x = repo[None].node()
(Pdb) node.hex(x)
*** TypeError: b2a_hex() argument 1 must be string or read-only buffer, not None
(Pdb) x = repo['tip'].node()
(Pdb) node.hex(x)
'd32c8d91739957f3f9f587e14530c3bf222b1227'
```

Reviewers: durham, pyd, davidsp, daviser, mitrandir, ericsumner, sid0

Reviewed By: ericsumner

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

Signature: t1:1867702:1424804512:c6d9fb6500a9db76eb1a0b99b1f565a33500ceb7
2015-02-24 10:50:23 -08:00
Ryan McElroy
01936c5c53 smartlog: fix crash with non-public branches
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
2015-02-23 22:54:08 -08:00
Ryan McElroy
c247e80cac smartlog: remotenames: always show certain names if they exist
Summary:
With remotenames, we will not always have local bookmarks for important
commits. This introduces a way to ensure important remote bookmark names
are always shows in the commit graph.

Test Plan:
* ./run-tests.py
* manual testing in various repos with remotenames enabled

Reviewers: sid0, daviser, mitrandir, ericsumner, durham

Reviewed By: durham

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

Signature: t1:1866949:1424798937:ccae85fa3655cfe8171089a3295d42a483f18d08
2015-02-20 15:32:11 -08:00
Ryan McElroy
53576fd0d7 smartlog: bugfix from bad rebase 2015-02-23 11:21:52 -08:00
Ryan McElroy
aee7669af1 smartlog: also consider remote bookmarks, if available
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: daviser, davidsp, mitrandir, ericsumner, pyd, durham, sid0

Reviewed By: sid0

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

Tasks: 6274574

Signature: t1:1859454:1424458765:ba337a1d382ee5074efbd1a034bc712d7f44f25e
2015-02-19 15:34:34 -08:00
Ryan McElroy
412f1c3026 smartlog: clean up variable names in revset
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

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

Tasks: 6274574

Signature: t1:1859448:1424455122:af8716a10731b97782dfe0cc31f8c580f00b9f51
2015-02-19 16:13:54 -08:00
Ryan McElroy
5c278c6414 smartlog: clean up variable naming in command
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

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

Tasks: 6274574

Signature: t1:1859445:1424455369:e6e5a49fafa876ca37d4edef4badbda1dd84afc3
2015-02-19 16:10:33 -08:00
Ryan McElroy
264dbf8ad6 smartlog: centralize master option lookup
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

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

Tasks: 6274574

Signature: t1:1859443:1424455198:eeb81ecf0bd66c975b5c39b85710b6cd419912f2
2015-02-19 16:03:41 -08:00
Ryan McElroy
693b970149 smartlog: fix master ordering
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: daviser, davidsp, mitrandir, ericsumner, pyd, durham, sid0

Reviewed By: sid0

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

Tasks: 6274574

Signature: t1:1859437:1424455215:f6a02deb5e2ad3cb57001da2dcba7d40fe9571e4
2015-02-19 15:50:16 -08:00
Ryan McElroy
7f8a217b84 smartlog: factor out master rev lookup
Test Plan: ```./run-tests.py --with-hg=$(which hg) -j 8```

Reviewers: durham, daviser, davidsp, mitrandir, ericsumner, pyd, sid0

Reviewed By: sid0

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

Tasks: 6274574

Signature: t1:1859434:1424455240:a87e5ab451f774966fffe4f720da214c1b8748f1
2015-02-19 15:49:52 -08:00
Ryan McElroy
dae96ce42f smartlog: factor out master revset calculation
Test Plan:
* Updated test

```
./run-tests.py --with-hg=$(which hg) -j 8
```

Reviewers: daviser, davidsp, mitrandir, ericsumner, pyd, sid0, durham

Reviewed By: durham

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

Tasks: 6274574

Signature: t1:1859427:1424479467:27b4a2ce644c97c04265b93e79332f169f78eda0
2015-02-19 14:39:54 -08: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
Siddharth Agarwal
191ac11eb5 merge 2015-02-17 19:02:48 -08:00
Siddharth Agarwal
d8f9a69c86 [gitrevset] use an empty string rather than None 2015-02-17 19:02:09 -08:00
Eric Sumner
c81d3f9f70 [writecg2] Fix conflict with bundle2 bundlerepo work
Summary:
If bundle2 backups are turned on, don't write the nonstandard format; just
allow reading them.

Test Plan: ##run-tests##

Reviewers: durham, pyd, mpm, #sourcecontrol, sid0

Reviewed By: #sourcecontrol, sid0

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

Tasks: 6271882
2015-02-17 14:04:28 -08:00