Commit Graph

55 Commits

Author SHA1 Message Date
Ryan McElroy
9e16f90f02 fbamend: allow verbose user education
Summary:
I want to turn on fbamend by default, but in order to do that, we need to point
people in a super-obvious way at the documentation when they first run fbamend.
This provides a stub for user education.

Test Plan:
 * ./run-tests.py
 * Added a message and played around with it in my www-hg

Reviewers: durham, sid0, ericsumner, mitrandir, daviser

Differential Revision: https://phabricator.fb.com/D1844274
2015-02-12 01:26:20 -08:00
Ryan McElroy
6f8358819a fbamend: change suffix to remove parentheses
Summary:
While working with fbandroid folks working in OSX, it looked like there were
some issues with escaping parentheses in the console. Also, parens are annoying
to type even in Linux. Let's have a lighter-weight suffix to the preamend
bookmarks.

Test Plan: ./run-tests.py

Reviewers: durham, sid0, mitrandir, daviser, ericsumner

Differential Revision: https://phabricator.fb.com/D1844272
2015-02-11 20:01:03 -08:00
Ryan McElroy
b1a851bb16 fbamend: add real testing
Summary: Previously the tests didn't actually check fbamend's functionality.

Test Plan: ./run-tests.py

Reviewers: durham, sid0, mitrandir, ericsumner, daviser

Differential Revision: https://phabricator.fb.com/D1844282
2015-02-12 02:32:51 -08:00
Ryan McElroy
a147066185 smartlog: allow master to be specified in configuration
Summary:
This allows each repo to specify a master revision other than ##master##,
 ##trunk##, or ##@##. This is especially useful when using the ##remotenames##
extension, since the remote bookmark might be of the form ##remote/master##.

Test Plan:
Set this cofig option in my repo's .hg/hgrc:

  [smartlog]
  master = smf/@

Then ran smartlog and it worked as if I had passed ##--master smf/@##

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

Reviewed By: durham

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

Signature: t1:1840345:1423625389:aec4d651a23747bc5fdce3f14b26158ad0ddf313
2015-02-10 19:11:19 -08:00
Eric Sumner
b630a5a622 smartlog: config option to ignore bookmarks
Summary:
I have some bookmarks for interesting code that I've stopped
development of indefinitely, and I don't want them cluttering
my smartlog output.  This lets me add a config option like

  [smartlog]
  ignorebookmarks = abandoned/

so that smartlog won't force them to be included

Test Plan: ##run-test.py##

Reviewers: sid0, daviser, davidsp, mitrandir, rmcelroy, durham

Reviewed By: durham

Subscribers: calvinb, mpm, pyd, akushner

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

Signature: t1:1812758:1422567344:d44896000ea3f92dbd0b981fc26693066ab23ee1
2015-01-29 11:32:37 -08:00
Durham Goode
8687288433 backups: make warning message clearer 2015-01-28 13:16:22 -08:00
Durham Goode
578b5611e2 backups: handle bundles without parents
Summary:
hg backups would fail if it encountered a bundle whose parent wasn't present in
the repo anymore. This handles that case and prints out a message.

Test Plan:
Tried it in a large repo with lots of backup bundles, verified the
message was printed and the backups process continued on to the next one.

Reviewers: davidsp, pyd, rmcelroy, mitrandir, ericsumner, sid0

Reviewed By: sid0

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

Signature: t1:1809904:1422478920:90cff2103c4417e21da37e230e6058348f1c218a
2015-01-28 13:00:36 -08:00
Eric Sumner
b1826220fd merge 2015-01-22 11:36:27 -08:00
Eric Sumner
1c0fd006c9 smartlog: add revset function
Summary:
I wanted a way to see a commit in relation to the other smartlog entries, so
I refactored smartlog to provide a revset function for its default selections.

Test Plan: ##run-tests##

Reviewers: durham

Reviewed By: durham

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

Tasks: 6057467

Signature: t1:1794762:1421888058:9b96d26f68b9b3bac24ef43db58fe8aa0299de37
2015-01-21 12:20:33 -08:00
Durham Goode
2b4b3831c8 Fix rebase with no-op changes
The sparse checkout extension had a pretty bad flaw where rebasing across
certain no-op file changes would fail the rebase. This was due to Mercurial
adding a 'keep' action on those files and that action getting translated to a
'remove' by the sparse extension, then failing to edit the dirstate during the rebase
branchmerge.

The fix is to only issue 'remove' actions if we're not in a branchmerge
and the file in question is in the workingcopy but shouldn't be.

I also added more validation for the branchmerge scenario to make sure we aren't
losing any dirstate data.  It will basically abort if any action besides 'keep'
is performed on a file outside the sparse checkout.
2015-01-14 16:31:01 -08:00
Durham Goode
b638332657 Update sparse to match upstream
Upstream Mercurial has changed the return value of merge.calculateupdates in two
ways: 1) actions is now a file->action mapping instead of a
actiontype->list-of-files mapping, 2) it now returns actions, diverge,
renamedelete where the last two are just used for displaying to the user and can
be pretty much ignored by the sparse extension.
2015-01-06 11:38:33 -08:00
Eric Sumner
4092b99234 pushrebase: cleanup phase handling
Summary:
It turns out that bundlerepo uses the underlying phase boundaries, so the
added changesets show up with the same phase as their nearest ancestor that's
already in the repository.  This behavior is confusing and inconsistent with
what happens when the bundle is actually applied: retracting the draft boundary
over the new commits.

This makes a copy of the phase cache so that changes in the bundlerepo don't
affect the real one and then retracts the draft boundary like would happen
when the bundle is applied normally.

If this general solution looks OK, I'll submit an upstream patch that makes
bundlerepo behave this way always, which will make it match the behavior that
would be seen when using ##hg unbundle##.

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1733166:1420502423:f57e2fff8fe47293ecab1ac4f6efdd0507c9c7b5
2015-01-05 15:50:59 -08:00
Eric Sumner
f5303c01ab pushrebase: push phase boundary on publishing servers
Test Plan: ##run-tests.py##

Reviewers: pyd, sid0, durham

Reviewed By: durham

Subscribers: akushner, davidsp, mpm, daviser, rmcelroy, calvinb

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

Signature: t1:1749892:1419020663:fe78e5c3aba585e5c9c0b93e21148cdacbe3ba71
2014-12-18 16:22:19 -08:00
Siddharth Agarwal
2d094f51a1 upgradegeneraldelta: only upgrade before pulls
Summary: This is nicer because it only does the upgrade when an operation that'll probably take a while anyway is run.

Test Plan: Enabled the extension on a non-generaldelta repo, then ran `hg status`. Saw that it wasn't upgraded. Next, ran `hg pull`, and saw that it was.

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

Reviewed By: durham

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

Signature: t1:1749026:1418940170:6fdecc074294b26b7c3e9bd8c1463eefd13a8fc1
2014-12-18 12:43:32 -08:00
Siddharth Agarwal
6cfd6e20ea upgradegeneraldelta: disable for peer objects 2014-12-17 21:09:18 -08:00
Eric Sumner
0f39c60f82 pushrebase: (easy) fix traditional push
Summary: Been working with js too long; python vars aren't None by default

Test Plan: ##run-tests.py##, and doing a traditional push w/ the extension enabled

Reviewers: durham, sid0, pyd

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1743710
2014-12-16 14:27:21 -08:00
Eric Sumner
4ba902f661 pushrebase: add node argument to changegroup hook
Summary: This is expected by the remotefilelog hook, and possibly others

Test Plan: ##run-tests.py##

Reviewers: durham, pyd, sid0

Reviewed By: sid0

Subscribers: calvinb, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1743261:1418762431:4fbbc1ed800023ddc51dbf53703e58294fbc2a4c
2014-12-16 12:38:48 -08:00
Eric Sumner
773c19ec6b pushrebase: (easy) fix typo
Test Plan: left-blank

Reviewers: durham, pyd, sid0

Reviewed By: sid0

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1743240:1418762156:d08545a3dfd4dff3fa1f5565aa4386ee219883f1
2014-12-16 12:32:24 -08:00
Eric Sumner
a540ffa647 pushrebase: enable pushback always
Test Plan: ##run-tests.py##

Reviewers: durham, pyd, sid0

Reviewed By: sid0

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1743234:1418762853:e406ef2b4a22601596e0629e4561b2a7ca9a0df3
2014-12-16 11:44:45 -08:00
Eric Sumner
17840a1afd pushrebase: disallow pushing obsolete commits
Summary:
@durin42 suggested that the extension might want to prevent processing of
obsolete commits.  Given the current state of dealing with conflicting
obsolescence markers, this seems like a good idea.

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1740886:1418686275:d505ff1de8fbce39eb4fbe3a2e6d368b4b14edb8
2014-12-15 15:06:57 -08:00
Durham Goode
a032665ffb Add upgradegeneraldelta to setup.py 2014-12-17 13:40:52 -08:00
Durham Goode
acbfa0551c Fix sparse strip -r . -k
Summary:
strip -r . -k rebuilds the dirstate and was inserting filtered entries
into the dirstate. This fixes rebuild to exclude sparse files.

Test Plan: Added a test

Reviewers: sid0, pyd, davidsp, mitrandir, rmcelroy

Differential Revision: https://phabricator.fb.com/D1743331
2014-12-16 11:35:41 -08:00
Siddharth Agarwal
6d854966b4 upgradegeneraldelta: fix path issues 2014-12-15 13:28:00 -08:00
Siddharth Agarwal
e431588514 add an extension to upgrade manifests in-place to generaldelta
Summary:
We actually realized that converting a manifest to generaldelta is not as easy as just flipping a bit -- the meaning of 'base' is different for normal vs generaldelta revlogs.

Instead, open a new generaldelta revlog, write out every node from the manifest, and then close the revlog. Finally, move over the revlog index and data files.

Test Plan: Ran it on local non-generaldelta fbandroid and fbcode repos. It's pretty fast: under two minutes each for both.

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

Reviewed By: pyd

Subscribers: hannesr

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

Signature: t1:1738808:1418522355:31e424dc523d40f8194490d75160e993f48a0f27
2014-12-13 17:37:14 -08:00
Eric Sumner
3d18258260 pushrebase: extract pushback into its own function
Summary: Also, remove some spurious TODOs

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1732036:1418250584:6922035a05df012445b0092f8646eb982602f07d
2014-12-10 14:22:34 -08:00
Eric Sumner
c7ba62014c pushrebase: extract obsolete marker generation into a function
Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1726944:1418242222:a91974f41b5883eb659dd69135176adf066b8b47
2014-12-08 17:49:48 -08:00
Eric Sumner
3575568e6e pushrebase: extract revlist creation and validation into its own function
Summary: None of these temporary variables should be needed later

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1726850:1418242127:64da1168b9f11897f6018082292e7f6285141bfd
2014-12-08 17:30:26 -08:00
Eric Sumner
4bc463862e extract temporary bundle file creation into its own function
Summary:
Transferring the part data into a bundle file on disk for bundlerepo to read
is a self-contained operation

Test Plan: ##run_tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1726767:1418241560:8afac123afc847e61e6f46b6216d15b003024504
2014-12-08 17:10:24 -08:00
Eric Sumner
40f3704fa2 pushrebase: extract commit grafting into its own function
Summary: Breaking up the part handler into smaller pieces

Test Plan: ##run_tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

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

Signature: t1:1726701:1418241313:52edc229bc635d7e703bcc2b5ee5673ece6373fa
2014-12-08 16:54:14 -08:00
Eric Sumner
cc6da40495 pushrebase: improve formatting
Summary: Update indentation to be more in-line with how hg does things

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy, mitrandir, calvinb

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

Signature: t1:1726641:1418086497:91cde84647f094e077966aea53668fead9c47a7a
2014-12-08 16:39:20 -08:00
Eric Sumner
af1b675338 pushrebase: call changegroup/incoming hooks
Summary:
The rebase extension bypasses the changegroup processing hooks, so they need to
be called explicitly.

Test Plan: Added hooks to the existing test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner

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

Signature: t1:1726408:1418241039:4e51a6dcbf3134f12d55c8e902de9ca7086883d1
2014-12-08 15:43:58 -08:00
Eric Sumner
e9983fe1d5 pushrebase: fix changegroup handshake
Summary:
Instead of always sending back a v1 changegroup, do the proper version
negotiation so we use the latest version supported by both client and server

Test Plan: ##run-tests.py##

Reviewers: durham, pyd

Reviewed By: pyd

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

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

Signature: t1:1722669:1417819262:6ab35f612fbb0dc5884caefc12e550d1d3eb0adf
2014-12-05 13:10:34 -08:00
Eric Sumner
09fb2c7f88 pushrebase: mark rebase parttype as mandatory
Test Plan: Ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

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

Signature: t1:1722517:1417815518:afed70bc12dcf2130091e15821d76105e8591a2c
2014-12-05 12:19:12 -08:00
Eric Sumner
f558603bc4 pushrebase: transmit common heads information in separate parttype
Summary:
This information will be useful to any pushback extension; this is a first step
towards making it a separate extension

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

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

Signature: t1:1722350:1417813202:a021aa449765bf49c0c2e1fe86cb90534c50fdad
2014-12-05 11:40:14 -08:00
Eric Sumner
bfd9ea6e54 Remove head/tail safety parameters; commit dummyssh into the test directory
Test Plan: ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

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

Signature: t1:1722193:1417813982:18951855d64d13d868ca80be92b7a3ecb631337b
2014-12-05 11:02:01 -08:00
Eric Sumner
081e7652ae [pushrebase] Remove debug command
Summary:
In practice, this doesn't seem to be necessary -- testing with ##hg push##
appears to be sufficient.

Test Plan: run-tests

Reviewers: pyd, durham, sid0

Reviewed By: sid0

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

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

Signature: t1:1700839:1416859911:321862b34c7067a11475a2e77112e77b20147dc6
2014-11-24 11:40:57 -08:00
Eric Sumner
afe0305ccb [pushrebase] Handle client not accepting obsoletion part
Summary:
The function already raises ValueError if it can't generate a suitable part
for the remote; catch it and continue otherwise

Test Plan: Run test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

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

Signature: t1:1700817:1416868855:cad7838c2c9be0d0657adda28d0d1796c119a4ef
2014-11-24 11:18:33 -08:00
Eric Sumner
44c7735be5 [pushrebase] Use existing mechanism to pass info between parts
Summary: Removes the mechanism I monkey-patched in

Test Plan: Ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: akushner, sid0, davidsp, mpm, daviser, rmcelroy

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

Signature: t1:1697566:1416603991:38d1cb3756b428e5ffe8b8af2b97ce62afde2a57
2014-11-21 10:55:46 -08:00
Eric Sumner
9cd35a5772 [pushrebase] Send changes back over the wire
Summary: Use the bundle2 reply stream to send changes back to the client

Test Plan: Ran test

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: rmcelroy, daviser, mpm, davidsp, sid0, akushner

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

Signature: t1:1689551:1416948875:987c7440298aa57d5cf46d420feab151ce9340b1
2014-11-18 16:36:46 -08:00
Eric Sumner
8ccb57bef0 [rfc] Server-side rebasing extension
Summary:
Adds a new bundle2 parttype to accept a linear changegroup and rebase it onto
the designated position on the server.

Future work:

* Issue the new parttype from ##hg push## (under what circumstances?)
* Return new revisions to client in the bundle2 response
* Write automated tests
* Support v2 changegroup packing?
* Test compatibility with the extensions we commonly use

Test Plan:
Diff includes an hg command that issues the new parttype; have used it to test
manually on a repository with 2 files.

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

Reviewed By: durham

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

Signature: t1:1670811:1416335316:05c5ae8a35ba28cab87c474bab28afe91e8702d2
2014-11-07 16:27:47 -08:00
Durham Goode
f26417b0dd Add sparse to setup.py 2014-12-02 13:50:22 -08:00
Durham Goode
08d5465b17 sparse: add sparse checkout extension
Summary:
Adds a sparse checkout extension that allows you to checkout just part of the
working copy.  This only affects the working copy, it does not affect history,
or what is pushed and pulled from the server.

The basic api is:

hg sparse --include PATTERN...  # add a pattern to the sparse checkout
hg sparse --exclude PATTERN...  # excludes files from the sparse checkout
hg sparse --delete PATTERN...   # deletes an include/exclude rule
hg sparse --enable-profile      # enables a predefined sparse profile
hg sparse --disable-profile     # disables a predefined sparse profile
hg sparse --reset               # makes the repository full again
hg sparse --refresh             # refreshes the working copy if .hg/sparse was
modified manually
hg sparse                       # show the current sparse rules

Test Plan:
Added tests. Ran them. Also deploy it to a couple users for a bit
without major issues.

Reviewers: pyd, sid0, rmcelroy, davidsp, mpm

Subscribers: mitrandir, akushner

Differential Revision: https://phabricator.fb.com/D1698824
2014-12-01 11:02:08 -08:00
David Soria Parra
c4e6f486a2 chistedit: language improvements 2014-11-07 09:34:29 -08:00
David Soria Parra
dcafccb185 chistedit: don't user underscore which accidentally redefines _()
Summary: shamecat

Test Plan: noplan

Reviewers: durham

Reviewed By: durham

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

Signature: t1:1665893:1415327791:c8e73533f269c5625f5004a0f91412d99d37a79a
2014-11-06 17:38:09 -08:00
David Soria Parra
67438e93b4 chistedit: an interactive ncurses interface for histedit
Summary: add the chistedit extension that adds an interactive ncurses based
interface for histedit. It requires python-curses to be installed and the
Mercurial histedit extension to be enabled.

Test Plan: enabled and used it

Reviewers: durham, sid0, pyd

Differential Revision: https://phabricator.fb.com/D1662465
2014-11-05 16:14:33 -08:00
Siddharth Agarwal
b4c11162d8 fix smartlog for Mercurial changes
Summary:
Use `first()` instead of `[0]`.

Also fix coloring under non-ANSI terminals (required to get the test working).

Test Plan: Ran the tests. Also ran `hg sl` with this in a few of my repos.

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

Reviewed By: pyd

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

Tasks: 5375006
2014-10-17 13:35:52 -07:00
Siddharth Agarwal
30f6859ed1 [githelp] add ls-files
Summary:
A couple of people requested this.

Also add `git` as an alias and fix the function name.

Test Plan:
Kicked the tires a bit.

```
hg git -- git ls-files
hg git -- git ls-files '**/*.py'
hg git -- git ls-files -m '**/.py'
hg git -- git ls-files -z '**/.py'
```

Reviewers: daviser, davidsp, akushner, pyd, durham

Reviewed By: durham

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

Tasks: 4515847
2014-10-09 19:26:29 -07:00
Siddharth Agarwal
18687164fa fix test-fbamend.t for Mercurial 3.2 2014-09-17 16:37:11 -07:00
Siddharth Agarwal
70693db843 add some convenience features 2014-09-08 12:49:25 -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