Commit Graph

421 Commits

Author SHA1 Message Date
Jun Wu
605fa025ff morecolors: colorize uncaught exceptions
Summary:
Previously morecolors only changes "ui.traceback". This diff makes it replace
uncaught exceptions. It now conflicts with errorredirect (whichever loads last
will be effective) but that's probably fine since morecolors is intended for
the team only.

Test Plan: Added a test case.

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir, medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5347030

Signature: t1:5347030:1498751985:b8c750c5bfe4a25f1e0a4dd1cebcfa74fa8739b0
2017-06-29 09:55:25 -07:00
Kostia Balytskyi
d9a8476274 obsshelve: adopt upsteam changes regarding applybundle
Summary:
Upstream made a coupld of changes (including 4fadfa7f05a2a49a2554f0d70f9a35e085109d44), which changed how bundles are supposed to be applied. This breaks obsshelve's compatibility with old shelves.

This commit just ports the aformentioned upstream change into obsshevlve.

Test Plan: rt

Reviewers: quark, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5347598
2017-06-29 09:52:11 -07:00
Felix Merk
1abcb63689 undo: amend transacts twice
Summary: amend performs two transactions, second without command which breaks our assertion, but possibly isn't an issue. This fixes the assertion.

Test Plan: unit tests

Reviewers: #mercurial, stash, quark

Reviewed By: quark

Subscribers: quark, stash, medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5326358

Tasks: 19261492

Signature: t1:5326358:1498684945:0fde1df243cdbac67ceb092d30599ebd56a731a5
2017-06-28 15:28:40 -07:00
Sen Li
3a87ac6ec2 errorredirect: modify errorredirect extension to send crash log to scuba table
Summary: Modify error redirect extension to send crash log, type and traceback to scuba table hgerrors

Test Plan:
Sample that is being sent to Scuba:
```
{
"int":{"time":1498528572},
"normal":{
  "host":"devvm26497.prn1",
  "metrics_type":"hgerrors",
  "msg":"exception has occurred: ** unknown exception encountered, please report by visiting\n** Source Control @ FB group\n** Python 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]\n** Mercurial Distributed SCM (version 4.2.1+842-79c3f212a9c9)\n** Extensions loaded: tweakdefaults, hgk, absorb, arcdiff, automv, blackbox, chistedit, color, debugcommitmessage, debuginhibit, evolve, fbhistedit, githelp, hiddenerror, histedit, inhibit, journal, logginghelper, lz4revlog, morestatus, moreversion, myparent, pager, patchrmdir, perftweaks, phabdiff, phabstatus, phrevset, pullcreatemarkers, purge, rage, rebase, record, remotefilelog, remotenames, reset, sampling, fbshow, sigtrace, simplecache, smartlog, sshaskpass, strip, directaccess, uncommit, conflictinfo, extorder, obsshelve, sqldirstate, fastmanifest, hgsubversion, traceprof, dialect, grpcheck, errorredirect, fbamend, pushvars, pushrebase\n",
  "traceback":"Traceback (most recent call last):\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py\", line 326, in _callcatch\n    return scmutil.callcatch(ui, func)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/scmutil.py\", line 145, in callcatch\n    return func()\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py\", line 308, in _runcatchfunc\n    return _dispatch(req)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py\", line 938, in _dispatch\n    cmdpats, cmdoptions)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/fastmanifest\/cachemanager.py\", line 318, in runcommandtrigger\n    result = orig(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/fastmanifest\/__init__.py\", line 175, in _logonexit\n    r = orig(ui, repo, cmd, fullargs, *args)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext3rd\/perftweaks.py\", line 263, in _tracksparseprofiles\n    res = runcommand(lui, repo, *args)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext3rd\/perftweaks.py\", line 248, in _trackdirstatesizes\n    res = runcommand(lui, repo, *args)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext\/journal.py\", line 76, in runcommand\n    return orig(lui, repo, cmd, fullargs, *args)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py\", line 674, in runcommand\n    ret = _runcommand(ui, options, cmd, d)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext\/pager.py\", line 69, in pagecmd\n    return orig(ui, options, cmd, cmdfunc)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py\", line 946, in _runcommand\n    return cmdfunc()\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/dispatch.py\", line 935, in <lambda>\n    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext3rd\/absorb\/__init__.py\", line 977, in _amendcmd\n    return orig(ui, repo, *pats, **opts)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext3rd\/tweakdefaults.py\", line 627, in cmd\n    return origcmd(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext3rd\/tweakdefaults.py\", line 694, in amendcmd\n    return orig(ui, repo, *pats, **opts)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/extensions.py\", line 273, in closure\n    return func(*(args + a), **kw)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/hgext\/automv.py\", line 63, in mvcheck\n    return orig(ui, repo, *pats, **opts)\n  File \"\/usr\/lib64\/python2.7\/site-packages\/mercurial\/util.py\", line 1056, in check\n    return func(*args, **kwargs)\n  File \"\/data\/users\/lsen\/facebook-hg-rpms\/fb-hgext\/hgext3rd\/fbamend\/__init__.py\", line 169, in amend\n    raise Exception(\"testing\")\nException: testing\n",
  "type":"<type 'exceptions.Exception'>"}
}
```

Reviewers: juehui, akushner, durham

Reviewed By: durham

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5326253

Tasks: 19602850

Signature: t1:5326253:1498577444:c62977ec782519a22b9dc64b33f2a575c544b83c
2017-06-27 09:44:29 -07:00
Jun Wu
e7998929ab inhibitwarn: temporarily add the extension back
Summary:
This extension is still enabled by other code that has a longer release
cycle. Add back the placeholder extension temporarily until we confirm their
release removed the config.

Test Plan: Adding an empty file should be harmless.

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5321153

Signature: t1:5321153:1498500260:941dd1738a2ab3d3389c4251d86bf7c2ccc17648
2017-06-26 11:08:30 -07:00
Therin Irwin
66b64d8fb6 fbamend: change hint text to suggest running restack
Summary: Instead of referencing `hg rebase` --restack option, just reference the `restack` subcommand.

Test Plan:
1. Make a few commits 1, 2, 3, 4 on any branch
2. `hg update 1`
3. Try to amend commit 1
4. Warning message should appear about children left behind
expected: Hint text does not mention `hg rebase --restack`

Reviewers: durham, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters, kkrewink

Differential Revision: https://phabricator.intern.facebook.com/D5313108

Tasks: 19601780

Signature: t1:5313108:1498249314:98f31f4424341ef51997687293bf99b7297b6cd0
2017-06-26 07:31:28 -07:00
Jun Wu
14440f1fcf tweakdefaults: add bookmark -D support
Summary:
It got removed from inhibit by D5258813. It's a useful feature so let's
re-implement it in tweakdefaults.

Test Plan: Added test cases with plain strip and fbamend's safe strip.

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5313291

Signature: t1:5313291:1498321590:03e61a5b1acc2df44afcfd6ceb723e17c648ce79
2017-06-24 23:18:52 -07:00
Jun Wu
17886e370b fbamend: remove troublesome tr.release()
Summary:
`tr` could be None and `tr.release()` there is causing issues.

The next line actually checks `tr` and call `tr.release()` if `tr` is not None.

Test Plan: arc unit

Reviewers: #mercurial, wez

Reviewed By: wez

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5314538

Signature: t1:5314538:1498255892:084e1f5f1521ff7794be43b24510d2b54bf2148e
2017-06-23 15:12:46 -07:00
Felix Merk
fbd87d6923 undo: store op history
Summary: Store basic operational history: bookmarks, commands, private heads, date and working copy parent

Test Plan: Unit tests

Reviewers: durham, #mercurial, mitrandir, quark

Reviewed By: quark

Subscribers: stash, mitrandir

Differential Revision: https://phabricator.intern.facebook.com/D5293596

Tasks: 19261492, 19563903, 19450726

Tags: Hg Undo

Signature: t1:5293596:1498245082:264e344054ee5061a439dec1c6071c2a60ffcf55
2017-06-23 12:19:09 -07:00
Jun Wu
c35c433212 smartlog: be graceful when ancestorcache db is corrupted
Summary:
We have seem some errors when closing the database during `db.close()`. This
diff nukes the database if that happens.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters

Reviewed By: mjpieters

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5305123

Signature: t1:5305123:1498166056:8355e861c18c670e6342e541f2bc55d65bc7b1c8
2017-06-22 14:15:56 -07:00
Mateusz Kwapich
afebcb5512 phabdiff: add singlepublicbase revset
Summary:
This revset will be used by jellyfish to set the proper base in sandcastle. Anyway: a public ancestor is
a valuable commit information so there should be a template for it.

Test Plan: see test

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: durham, quark, medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5275811

Tasks: 19186426

Signature: t1:5275811:1497979632:9589491be723daf0b127703a7bc4571f7539bd84
2017-06-21 17:03:50 +01:00
Jun Wu
ce21516db2 smartlog: use dagop.reachableroots
97fbbbc2ac35 moved reachableroots from revset to dagop.
2017-06-20 13:58:40 -07:00
Jun Wu
2df622a724 cleanup: remove fbmetaedit and inhibitwarn
Summary: We no longer use those extensions. Remove them.

Test Plan: arc unit

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D5286709
2017-06-20 13:58:40 -07:00
Durham Goode
55f677869b remotefilelog: use a connection pool instead of a long running connection
Summary:
Previously remotefilelog would open a connection and leave the getfiles command
running on that connection, so it didn't have to reopen the ssh connection each
time. We want to reuse this ssh connection for treemanifest and fastannotate, so
let's switch it to a pool model where the connection is kept open but the
getfiles command is not left open.

If an exception happens while the connection is out of the pool, it is discarded
instead of being added back to the pool.

Test Plan:
Ran the tests. The fastannotate tests changed to reflect the new way
the connectionpool allows use.

Reviewers: quark, #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir, medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5280323

Signature: t1:5280323:1497975420:e3ae1ee854a1afc90816502543a19ff36f59b497
2017-06-20 11:08:15 -07:00
Jun Wu
32dd7f7841 fbamend: fix tests
Fix test issues caused by importing 0e0ff0ef4ad6.
2017-06-19 13:24:41 -07:00
Adam Simpkins
13bd099e74 pushrebase: improve blocknonpushrebase error message
Summary:
Improve the error message from the blocknonpushrebase hook to inform the user
that they need the pushrebase extension enabled.

Previously the message indicated that you mush push using
`hg push --to <bookmark>`, but this is not sufficient.  Enabling the pushrebase
hook is the most important step here.  (The `--to` flag is not part of vanilla
mercurial, and is added by pushrebase, but other extensions like remotenames
also add a `--to` flag.)

Test Plan:
Added a unit tests for `hg push --to <bookmark>` with remotenames enabled but
pushrebase disabled.

Reviewers: #mercurial, davidsp, zhihuih

Reviewed By: zhihuih

Subscribers: quark, medson, mjpieters, net-systems-diffs@fb.com

Differential Revision: https://phabricator.intern.facebook.com/D5276550

Signature: t1:5276550:1497899421:3656bcc3e7358f97fc852e14307b34d8aa4d9951
2017-06-19 12:48:46 -07:00
Zhihui Huang
5e0994a87f p4fastimport: handle keyword extension
Summary:
Perforce has a feature called [[ http://answers.perforce.com/articles/KB/3482 | keyword expansion ]].

When a file is marked +k or +ko and you have a string like $Id$, it get's expanded to $Id: SOMETHING$ on Perforce. When importing a file like this from Perforce into Mercurial we need to do the reverse, renaming $Id: SOMETHING$ to $Id$ (and equivalent for all other expansion types).


Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/tests/
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-import.t
$ python ../../hg-crew/tests/run-tests.py test-p4*

Reviewers: #idi, davidsp

Reviewed By: davidsp

Subscribers: davidsp

Differential Revision: https://phabricator.intern.facebook.com/D5266323

Tasks: 19211063

Signature: t1:5266323:1497890444:a1cced5faa5e48c708c2721510952ca4d27d1bd4
2017-06-19 11:54:10 -07:00
Tony Tung
6c4e900989 add date=implicitupdate option to automagically update the commit date 2017-06-19 09:50:32 -07:00
Tony Tung
c4d7df0a0f add the --date and --user parameters that commit supports 2017-06-19 09:50:32 -07:00
Mateusz Kwapich
250c2c7c4a metaedit: fix editing multiple commits
Summary: The recent refactoring brought back the original condition from metaedit that was preventing multi-commit metaedits.

Test Plan: see test

Reviewers: #mercurial, quark, stash

Reviewed By: stash

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5274562

Signature: t1:5274562:1497884504:f46988cd1926f52227a907e4e081e65de24080ad
2017-06-19 16:03:17 +01:00
Jun Wu
3d461ae600 check-ext: make checks stricter
Summary:
Enhance check-ext script to be more strict:

 - Only one foreign extension is allowed: `remotenames`
 - Require explicit path for in-repo extensions to avoid wrong extensions
   being tested

This would make the test more predicatable since system extensions
will be less likely to be imported. Explicit path is better than
setting `PYTHONPATH` since `hgext/name.py` could override
`hgext3rd/name.py` regardless of `PYTHONPATH`.

Test Plan: arc unit

Reviewers: phillco, durham, ikostia, #mercurial, stash

Reviewed By: stash

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5271430

Signature: t1:5271430:1497861776:7dd35ec7c522cd9b26aa0871cb4306b4f1b8993a
2017-06-19 08:02:38 -07:00
Stanislau Hlebik
7b8cb0004c debugcommitmessage: fix tests
Upstream 608e426d0577d44f4d5030dc6d71e57d691ca3da changed the API. Now template
ref should be passed instead of template itself. This diff fixes it.
2017-06-19 03:01:18 -07:00
Jun Wu
a6c7fc128f allowunstable: remove the extension
Summary: allowunstable is no longer used. So remove it.

Test Plan: arc unit

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5258845

Signature: t1:5258845:1497602890:4b9c7cffc2132df0a7059fe2fdbeddf3e21c1875
2017-06-16 15:54:15 -07:00
Jun Wu
be7ac42b50 codemod: replace evolve by fbamend
Summary:
Now that fbamend has most of the features we want. Replace evolve
used by tests.

Minor changes are made to some extensions to make test pass:
- reset: drop commit reviving support (was provided by "hg touch")
- smartlog: do not assume who provides "allsuccessors" revset
- fbamend: return 1 on "nothing changed"
- fbamend: write operation data for split and fold
- fbamend: do not print incompatibility notice
- fbamend: do not disable itself when rebase is not enabled
- inhibit: remove `bookmark -D` option - use `prune -B` instead

Test Plan: arc unit

Reviewers: #mercurial, stash

Reviewed By: stash

Subscribers: stash, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5258813

Signature: t1:5258813:1497604051:0c7334f9a6554cf31aaaaa2a4995b17d4e445847
2017-06-16 15:50:01 -07:00
Jun Wu
2dc367dac3 inhibitwarn: nuke the extension
Summary:
We are going to remove evolve and inhibit. So the warning is no longer
useful.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: ikostia, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254984

Signature: t1:5254984:1497518474:80649544fef3aee90bf9a407d45ddeb9f6d85dba
2017-06-16 14:40:31 -07:00
Jun Wu
d06133e837 fbamend: backport prune
Summary:
Backport the prune command and its strip wrapper from mutable-history changeset
cb0d62ed5e2a using GPL2 license.

There are some adjustments to make the ported code work well with existing
code better, namely:

  - Add a `safestrip` option to control whether `strip` is replaced to `prune`
    or not.


Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254961

Signature: t1:5254961:1497518704:91b200bf791297ff797cc0ff28ab31d7eb294963
2017-06-16 14:39:04 -07:00
Jun Wu
2852dabbc8 fbamend: merge fbmetaedit
Summary:
Merge fbmetaedit which uses a fast path to change commit messages.

Make fbmetaedit a no-op.

Test Plan: arc unit

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254867

Signature: t1:5254867:1497524975:c7cc3ad9d1162332fbdd665eb5a2f6d7ce87a585
2017-06-16 14:12:32 -07:00
Jun Wu
87b248dd27 fbamend: backport metaedit command
Summary:
Backport the metaedit command and its test from mutable-history changeset
cb0d62ed5e2a using GPL2 license.

There are some adjustments to make the ported code work well with existing
code better, namely:

  - Removed allowunstable check to simplify the code.
  - Make "nothing changed" return 1.
  - Minor i18n and check code fixes.

Note: this backport does not include fbmetaedit changes.

Test Plan: arc unit

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254807

Signature: t1:5254807:1497524996:abf856dc9bb8225316ca6c17f41ffa2c9d8d9964
2017-06-16 14:11:43 -07:00
Jun Wu
04579ab177 fbmetaedit: do not assume evolve provides metaedit
Summary: This is temporary as fbmetaedit will be merged into fbamend.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254803

Signature: t1:5254803:1497520047:2c6eb22ce8cb80e4c785fd0b82311706487f6c7e
2017-06-16 14:07:02 -07:00
Jun Wu
c7c3280b44 fbamend: backport fold command
Summary:
Backport the fold command and its dependencies (`rewrite`) from mutable-history
changeset cb0d62ed5e2a using GPL2 license.

There are some adjustments to make the ported code work well with existing
code better, namely:

 - The `--norebase` flag was renamed as `--no-rebase` and moved to the
   backported command so we no longer wrap the split command.
 - Rebase now runs inside a same transaction.
 - `bookmarksupdater` now accepts multiple revs so bookmarks on all changesets
   being folded will be updated correctly. It is a bugfix to the ported code.

Test Plan:
`arc unit`.
Some tests are changed. It seems the new behavior looks better.

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: ikostia, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254681

Signature: t1:5254681:1497520003:f7ec3622286804fead059ab9a8021bb8f3067e64
2017-06-16 14:06:24 -07:00
Jun Wu
020ff84b79 fbamend: backport split command
Summary:
Backport the split command and its dependencies (namely, `bookmarksupdater`)
from mutable-history changeset cb0d62ed5e2a using GPL2 license.

There are some adjustments to make the ported code work well with existing
code, namely:

 - The `--norebase` flag was renamed as `--no-rebase` and moved to the
   backported command so we no longer wrap the split command.
 - Rebase now runs inside a same transaction.

The glob change in tests is because `(tip)` shows up.


Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: ikostia, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254544

Signature: t1:5254544:1497519470:fe8a7308b35b578fd4f1257cebba15062e752c2f
2017-06-16 13:59:12 -07:00
Jun Wu
08e9bc0bbf fbamend: make restack take inhibithack
Summary:
This hack is needed to make split + rebase work well inside a same transaction.

inhibit does special things at the end of a transaction which may override deinhibit.
Sometimes we want deinhibit to override the transaction close handler.

The hack will be removed once inhibit gets removed.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: ikostia, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254517

Signature: t1:5254517:1497519294:89b6de077514252c42fb128760cf9f9241180242
2017-06-16 13:55:29 -07:00
Jun Wu
30b417ea27 allowunstable: do not assume evolve provides split and fold
Summary:
split and fold will be backported and removed from evolve. So do not assume
evolve provides them.

Test Plan: Not breaking existing tests

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254455

Signature: t1:5254455:1497519005:aca0373cc61ca5438cee1c9d85f2df77f33d8455
2017-06-16 13:54:03 -07:00
Jun Wu
edf220db3a inhibit: allow _deinhibitmarkers inside a transaction
Summary:
inhibit hacks transactioncallback so _deinhibitmarkers might be ineffective
inside a transaction. This diff adds a flag to allow _deinhibitmarkers
effective inside a transaction. It will be used by the split backport.

Test Plan: No new test being added since inhibit is a hack and is going to be removed.

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254416

Signature: t1:5254416:1497519161:b01f3fa59004ded5beaf5dcfc7d18eb2b5227130
2017-06-16 13:52:29 -07:00
Jun Wu
200a9b16fb fbamend: implement successors and precursors revsets
Summary:
We are depending on `allprecursors` and `allsuccessors` revsets in multiple
places. Re-implement them in fbamend.

Also reimplement `successors` and `precursors` since they are used by some
other code.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5254403

Signature: t1:5254403:1497519041:8c6f001a6acf8056b5f795575b42922a476ac34b
2017-06-16 13:48:14 -07:00
Jun Wu
7e8b62aef6 lfs: add retry logic for transferring a single object
Summary:
We got TCP RESETs frequently. It's hard to pinpoint the root cause so let's
just add retry for now.

Test Plan: eyes

Reviewers: #mercurial, #ovrsource_warroom, steaphan

Reviewed By: steaphan

Subscribers: steaphan, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5265928

Tasks: 19419154

Signature: t1:5265928:1497635499:17cf5d5cb69b406330326d693a9eceb1d22861f8
2017-06-16 10:54:07 -07:00
Jun Wu
3556ad01c5 fbamend: rename conflicted evolve commands instead of removing them
Summary: This unbreaks `experimental.evolutioncommands`.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5256903

Signature: t1:5256903:1497547902:9af6930776fc272db0c7d1bbfca2f4e76342255a
2017-06-15 10:35:28 -07:00
Felix Merk
88a744be9e smartlog: let smartlog revset take recentday argument
Summary: Add an optional `recentdays` parameter to smartlog revset.

Test Plan: Added test to test-smartlog.t

Reviewers: #mercurial, durham, quark

Reviewed By: quark

Subscribers: durham, stash, mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5211513

Tasks: 19179819

Signature: t1:5211513:1497487196:f7d59ec32c09680ed769977890f3031369f7652e
2017-06-15 10:06:09 -07:00
Stanislau Hlebik
6c09d4ce19 rage: add a hack to make rage work on osx
Summary: Add a config option to specify rpm binary

Test Plan: arc unit

Reviewers: #mercurial, quark, ikostia, luk

Reviewed By: ikostia, luk

Subscribers: luk, mjpieters, medson, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5255174

Tasks: 19361425

Signature: t1:5255174:1497518216:d78a66e27a1073921f06d9dd0e7036bab3e4010a
2017-06-15 04:20:52 -07:00
Stanislau Hlebik
31e9c3d80b copytrace: fix logging
ctx.node() is None, so it's bettter to use ctx.hex()
2017-06-15 04:08:49 -07:00
Felix Merk
5c4ff4f39f tweakdefaults: add --inactive flag to update command
Summary:
People want update to optionally not activate a bookmark.
This diff adds an `--inactive` flag to do that.

Test Plan: Added test-update-i.t

Reviewers: durham, #mercurial, quark

Reviewed By: quark

Subscribers: mitrandir, mjpieters, medson, durham, akushner, quark

Differential Revision: https://phabricator.intern.facebook.com/D5228552

Tasks: 8097957

Signature: t1:5228552:1497396566:16322e1a2dfdab30a213ddc37cbde4fc71bffcc0
2017-06-14 16:42:39 -07:00
Olivier Trempe
7b57890313 pushrebase: make pretxnchangegroup and changegroup hook arguments consistent with mercurial hook documentation
Before this patch, the pretxnchangegroup 'node' argument would be the last
added node whereas mercurial documention specifies that it should be the first
new changeset. The 'node_last' argument has also been added to both
pretxnchangegroup and changegroup hooks as per mercurial documentation.
2017-06-14 16:29:16 -07:00
Olivier Trempe
602a765fe6 pushrebase: bring variable initialization closer to first usage 2017-06-14 16:29:16 -07:00
Jun Wu
8d58d00052 fbamend: move restack to a separate file
Summary: This makes `__init__.py` smaller.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5223421

Signature: t1:5223421:1497387183:9ce70419c3c63ca55f1a225192ae7a6556316ea3
2017-06-13 17:09:34 -07:00
Jun Wu
3ab3ee018a fbamend: move next, previous to a movement.py
Summary:
Move movement commands (next, previous) to `movement.py`. Some common utilities
were moved to `common.py`. I did some minor cleanups on the help output.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5222981

Signature: t1:5222981:1497265815:5dbba53fe7a16dbf924898331496a5c50b54b9f2
2017-06-13 17:09:16 -07:00
Jun Wu
e1f58d87e3 fbamend: move unamend to a separate file
Summary:
Going to split fbamend into individual files by commands. `unamend` seems
self-contained to be moved out.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Subscribers: mjpieters, medson

Differential Revision: https://phabricator.intern.facebook.com/D5221159

Signature: t1:5221159:1497261013:d371bcf4406277228fc4f3f6c6aaa4600dab4823
2017-06-13 17:08:50 -07:00
Jun Wu
f1b6191c18 fbamend: move to a package
Summary: `fbamend.py` is already long. It will become more complex so let's move it.

Test Plan: arc unit

Reviewers: #mercurial, ikostia

Reviewed By: ikostia

Differential Revision: https://phabricator.intern.facebook.com/D5209475

Signature: t1:5209475:1497260957:e84aec4a2f90c8dd1d247b2b0caef48cfbb59c55
2017-06-13 17:08:20 -07:00
Olivier Trempe
0e2e9efbc7 pushrebase: add node_onto argument to prepushrebase hook
This helps doing some validation before accepting a pushrebase.
For example, if you want to prevent users to accidentally pushrebase
changesets to the wrong branch by checking if all pushed changesets are
on the same branch as the destination (--to)
2017-06-13 16:32:25 -07:00
Stanislau Hlebik
defa69c1d8 extorder: fix test
Summary:
There was a change in core mercurial b319e3173a9534a2b7750b69ef446a803c3145ff
that catches all exception from uisetup and extsetup. Let's throw subclass of
BaseException in this case.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters, medson, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D5236650

Signature: t1:5236650:1497363414:9bbde3cabb696bb77a7ffddcb576923e5743c993
2017-06-13 09:13:41 -07:00
Stanislau Hlebik
300bc72abd absorb: fix test
Upstream e0fc50267c46 removed makememctx() function and requires filectxfn to
be an instance of patch.filestore.
2017-06-13 07:17:36 -07:00