Commit Graph

3022 Commits

Author SHA1 Message Date
Durham Goode
0a0ba996ea treemanifest: make pack part handler more generic
Summary:
In a future patch we will reuse pack part generation for another part type.
Let's refactor our existing tree group part type to be more generic. We can now
specify what category the pack belongs to (manifests, files, etc) and treecache
has become cache.

Since argument changes in bundle2 are breaking changes, we need to deploy this
as a new bundle2 part type first, then once all old clients are gone, we can
remove the old part type and rename it.

Test Plan: Ran the tests

Reviewers: #mercurial, mjpieters

Reviewed By: mjpieters

Subscribers: mitrandir, medson, mjpieters

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

Signature: t1:5326081:1499704314:59e53a6fb573d9b4594c5ac64e6c4b6f8301df6e
2017-07-10 15:53:12 -07:00
Jun Wu
18c1406b18 inhibitold: add back the old extension
Summary:
This allows us to quickly switch back to the old behavior somehow by using
Chef overrides.

Test Plan: The file was copied from the old revision. Therefore not tested.

Reviewers: #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters

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

Signature: t1:5392986:1499722593:a895f94b3281ccba709fc219f927e8f6c770054a
2017-07-10 15:45:52 -07:00
Jun Wu
99386e40fd inhibit: update existing code to work with the rewritten version
Summary:
debuginhibit was removed since we no longer have a separate inhibit state.

smartlog hack about changing "o" to "x" was removed since "obsolete()"
revset is correct and the hack is unnecessary now.

directaccess was removed from tests since inhibit does not depend on it.

`- obsolete()` was added to some revsets to avoid divergence and other
surprises.

Use `inhibit.revive` API in infinitepush and reset to revive changesets
properly.

Remove various hacky code that mangle inhibit state in corner cases.

Most test changes are `o` changed to `x` in output since we draw
`obsolete()` state correctly now. `test-infinitepush-backup-remotefilelog.t`
change was because output could be `bytes/sec` instead of `KB/sec`.

Test Plan: arc unit

Reviewers: #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: kulshrax, medson, mjpieters

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

Signature: t1:5391361:1499722618:d3c1cf629f0c59ecdf1dfd5e653c1eb6176646b8
2017-07-10 15:45:31 -07:00
Jun Wu
40503c20fb inhibit: completely rewrite the extension
Summary:
The main feature we want is to be able to unobsolete an already obsoleted
changeset. The old inhibit code is causing all kinds of unsolvable weird
cases and is hard to deubg or maintain.

This patch rewrites it completely. Basically, we now require people to use
obsmarkers to "unobsolete" changesets. We treat cycles in obsstore as a
normal case and break the cycle using date information.

It should be a neat and correct solution until we want marker exchange.

A "revive" API was provided for other extensions to use.

Tests and other code changes will be fixed in a follow up.

Test Plan:
`test-inhibit.t` was rewritten to test the new features.

Other tests are broken and skipped for now. The next diff will fix them.

Reviewers: #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters

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

Signature: t1:5391320:1499716172:a946381421cc242411f5175ee3b7a3a0bc5a4f07
2017-07-10 15:45:07 -07:00
Jun Wu
a5b4320a9b remotefilelog: fix check-code 2017-07-07 21:08:26 -07:00
Jun Wu
95a42790fb helper-testrepo: workaround broken helpers-testrepo.sh 2017-07-07 21:06:48 -07:00
Jun Wu
b757e7498c codemod: use obsutil
Upstream has moved APIs to obsutil, and removed some APIs from obsolete.py
2017-07-07 20:54:19 -07:00
Adam Simpkins
4a7be070d7 phabstatus: fix interaction with the smartlog extension
Summary:
Previously phabstatus.extsetup() would throw an exception if the smartlog
extension was not in use and already loaded.

This fixes the code to use extensions.afterloaded() to ensure that we try to
wrap smartlog functions only after smartlog is loaded.  It also handles the
lookup error if smartlog is not in use at all.

Test Plan: Included a new unit test.

Reviewers: #mercurial, phillco

Reviewed By: phillco

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

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

Tasks: 16939242

Signature: t1:5375301:1499323251:4bc00c9cba79d60cbbb6738e8f1d648e75055cdb
2017-07-06 09:38:14 -07:00
Mihails Smolins
de95312716 Added logging to fileserverclient
Summary: Number of files fetched from server is now logged to scuba.

Test Plan:
* rm -fr $(hg showconfig remotefilelog.cachepath)/* to clean cache
* hg show #rev
* check Scuba table 'Hg Remotefilelog' to ensure that # of files fetched from server is logged

Reviewers: durham, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 19727278

Signature: t1:5375753:1499347945:97ecef74418ad2fcbabfcd850a37622b23551815
2017-07-06 06:53:11 -07:00
Felix Merk
5ddcdfffe8 undo: add olddraft revset to return previous drafts
Summary: Register `olddraft([index])` revset returning draft changesets using undo data.

Test Plan: unit tests

Reviewers: stash, #mercurial, quark

Reviewed By: quark

Subscribers: mitrandir, quark, medson, mjpieters

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

Tasks: 19646287, 19261492

Signature: t1:5359322:1499122771:0a1e952a9bb4cd6b31d95a229ccb398cd6aafd1f
2017-07-03 19:01:09 -07:00
Felix Merk
ba1dce8f88 undo: deal with --hidden flag edge case
Summary:
Makes sure repo is filtered by the "visible" filter which hides hidden commits.
Otherwise --hidden flag can mass up "draftheads" storage.

Test Plan: Added a new test case.

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, medson, mjpieters

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

Tasks: 19822306

Signature: t1:5357222:1499102417:ce78065d36841601fe0dfb1d615d7b3be28c5870
2017-07-03 19:01:09 -07:00
Felix Merk
955a9bfcce undo: allow user to list or see details about undoable commands run
Summary: add hg debugundohistory -l to view recent undoable transactions

Test Plan: unit test

Reviewers: #mercurial, stash, quark

Reviewed By: quark

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

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

Tasks: 19646287

Signature: t1:5325772:1499122626:48dd25cee8ed8912c07a6c1dabb3d4286483a8b7
2017-07-03 19:01:09 -07:00
Durham Goode
d633ef7216 arc: update config to work with external phabricator
Summary:
Let's switch to upstream phabricator for our code reviews. We keep the
internal configs around, and they can be accessed by swapping the .arcconfig
symlink if necessary.

Test Plan: hgarc lint, hgarc unit, hgarc diff

Reviewers: sid0, mitrandir, quark

Reviewed By: mitrandir, quark

Differential Revision: https://hg-phab.durin42.com/D1
2017-06-29 13:42:07 -07:00
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
Mark Edson
dd3fd72496 phabricator: override default ph*.fb.com with ph*.intern.facebook.com
Summary:
Trivial change.  Rather than run around and change all 200+ repos so their .arcconfigs are pointing to phabricator.intern.facebook.com, just override in hgext.  The hgext call to differential.querydiffhashes here:
  https://phabricator.intern.facebook.com/diffusion/HGEXT/browse/default/hgext3rd/phabstatus.py$76
represents 20k hits per day to phabricator.fb.com, and that is now (by far) the biggest hitter of fb.com, so we'd like it to go away.

Test Plan:
Modified my .arcconfig and .arcrc to both point to phabricator.fb.com and verified with temporary logging that the redirect was happening.

Because we already added the code to make it hunt down the first cert it finds, this doesn't hurt the connection between URL and certificate in .arcrc

Reviewers: mitrandir, rmcelroy, #phabricator, #sourcecontrol, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters

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

Tasks: 17358638

Signature: t1:5320052:1498488854:27f56d98f8dcb9cf5a6900360316a99d42e353c5
2017-06-26 08:04:42 -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
Stanislau Hlebik
a5b66da81e infinitepush: cleaning up
Summary:
Inspired by @mjpieters comments to another diff.
Let's simplify error handling.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters, quark

Reviewed By: quark

Subscribers: quark, medson, mjpieters, #sourcecontrol

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

Signature: t1:5310421:1498248385:4957c187e99ed112db388fd3e3daf115c0fe9e0f
2017-06-26 00:55:16 -07:00
Stanislau Hlebik
f9c6290c1b infinitepush: log number of added heads
Summary: It's a useful piece of information for Mononoke (see attached task).

Test Plan: arc unit

Reviewers: #mercurial, jsgf

Reviewed By: jsgf

Subscribers: medson, mjpieters

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

Tasks: 18812931

Signature: t1:5310026:1498234999:0c06a30bd659d6a1d3cedc28252f17dd1fc93dc8
2017-06-26 00:42:03 -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
Stanislau Hlebik
a2c98b25a6 infinitepush: do not fail if backup state file does not exist
Summary:
Previously pushbackups failed when it tried to unlink non-existent infinitepush
backup state file. This diff fixes it.

Test Plan: arc unit

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: medson, mjpieters, #sourcecontrol

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

Signature: t1:5309684:1498210504:49af716dbb4e7e1875e8a2b7ee4b40fe28ceefc1
2017-06-23 03:27:49 -07:00
Stanislau Hlebik
0cc4f07f11 modcheck: do not warn about importing mysql modules
Summary:
arc unit failed for me with
{P57551010}

Let's exclude mysql module from modcheck

Test Plan: Change infinitepush files and run arc unit, make sure it doesn't fail

Reviewers: quark, mitrandir

Reviewed By: mitrandir

Subscribers: medson, mjpieters, #mercurial

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

Signature: t1:5300890:1498125580:166141adbc211726e679ea48897a47a73835ed22
2017-06-23 01:22:03 -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
Stanislau Hlebik
9384ed14b8 fix tests
check-code was updated and it started to fail. This diff fixes it.
2017-06-22 00:33:08 -07:00
Durham Goode
d31e2ec441 treemanifest: fix pack transaction closing
Summary:
When adding manifests, we keep the mutable packs open for the duration of the
transaction. The old code had a bug where it didn't realize the pack files were
already open and it would open new ones. This meant only the last pack file was
finalized and the rest were left open as unfinished temp files.

This patch fixes it and adds a test.

Test Plan: Added a test

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: medson, mjpieters

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

Signature: t1:5297004:1498086398:5cbe6e6c78d02f09d341417ec3a745853dac9849
2017-06-21 16:59:44 -07:00
Durham Goode
d4f324c561 treemanifest: fix sub-tree prefetches
Summary:
Previously the wireprotocol allowed for fetching a specific sub-tree,
but the server's implementation didn't handle it. This caused issues when the
user made a local commit whose trees had references to public trees, then the
user deleted the cache trees and refilling the cache failed.

The current solution is to just serve the entire tree, since the current native
code treemanifest implementation can't serve sub-parts of the tree at the
moment. This is expensive, but should be pretty rare though since the client
usually the entirety of a tree if it's going to keep the root.

Test Plan: Added a test

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: medson, mjpieters

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

Signature: t1:5296211:1498086921:3e7be99b8581c1fdf507a2fe560b4c796835cdf3
2017-06-21 16:59:44 -07:00
Durham Goode
cbc8579872 remotefilelog: increase incremental repack to pack 3 at once
Summary:
Previously we tried to keep incremental repacks small by only allowing 2 packs
to be repacked at once. This causes problems with treemanifest since hg pull
could create a pack file, which then gets repacked with a single other pack
file. This meant the total number of packs did not decrease. Let's increases the
number of files we pack at once to 3 so we can guarantee that a repack after
adding a pack still decreases the total number.

Test Plan:
Ran a local tree repack that was previously only causing two files to
be repacked. Now it repacked three files.

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: medson, mjpieters

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

Signature: t1:5287238:1497995177:54e229b564137ddc35ea28fd3d649a1085de0c72
2017-06-21 16:59:44 -07:00
Andras Belokosztolszki
fb10004ee8 infinitepush: use milliseconds to measure elapsed time in logging
Summary: Currently seconds are sent to logging for elapsed time. Given the that most values are 0, 1, 2, or 3 seconds, this change adds some better signal. Not reusing the elapsed field, instead introduced elapsed ms.

Test Plan:
arc unit
modified test-infinitepush-backup-logging.t to include the new elapsedms field

Reviewers: stash

Reviewed By: stash

Subscribers: medson, mjpieters

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

Tasks: 19557691

Signature: t1:5292576:1498059638:8461a71398a41bf741384ddcda15d5c016633d66
2017-06-21 11:13:38 -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
Jun Wu
83c88e7a24 modcheck: check if external modules are imported
Summary:
When testing code in this repo, it's an easy mistake to import a module of a
same name installed in the system or specified by `PYTHONPATH`. This diff
adds a test module to detect that. It's included in `unit.py` so `arc unit`
will be able to find such issues

It will be more effective if all our extensions are moved to hgext3rd.

Test Plan:
Append a blank line to every `.t` files, and run `unit.py` with `hg-dev`
environment, and make sure nothing got reported.

Reviewers: durham, #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir, medson, mjpieters

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

Signature: t1:5274454:1497976474:1b25881f022e148b89829ed3f4d6a79437f2533f
2017-06-20 13:40:53 -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
Durham Goode
23ca29ef80 treemanifest: find bases up and down from the treerev
Summary:
Previously, if we were fetching a treemanifest we would only search downwards
for commits for possible base trees (so we could download only the new parts of
the tree).  With this patch we will also search upwards in the changelog. This
means that running 'hg log -r master --stat' will efficiently download the tree
for `.^` since it will be based against `.`.

Also fixes an issue with on demand downloads looking for base revs by starting
at the wrong changelog rev (they used the manifest rev number instead of the
changelog linkrev number). The same test covers this.

Test Plan: Added a test

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mitrandir, medson, mjpieters

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

Signature: t1:5279552:1497980967:a2d6003b126858cc05eb0095cd68c12db9670e29
2017-06-20 11:08:15 -07:00
Durham Goode
2959c77757 treemanifest: set upper rev bound on revlog repack
Summary:
If the repo being repacked has commits being pushed, it's possible that the
repack will encounter file revisions who's linkrevs don't exist in the inmemory
changelog. Let's set an upper bound on what linkrevs to repack so we can only
process revisions who's commits we can see.

Test Plan: Added test

Reviewers: #mercurial, mjpieters

Reviewed By: mjpieters

Subscribers: medson, mjpieters

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

Signature: t1:5279171:1497911997:a48c56abebd14a1c066c9fc1ee4098f813d062df
2017-06-20 11:08:15 -07:00
Durham Goode
f952dad372 treemanifest: add debug output for number of trees downloaded
Summary:
Adds output that tells how many trees were downloaded, and how long it took.
Only appears if remotefilelog.debug=True is set.

Test Plan: Updated the tests

Reviewers: #mercurial, phillco

Reviewed By: phillco

Subscribers: medson, mjpieters

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

Signature: t1:5278596:1497926493:82a01b3b49e9ff87e51ac3c5cd0e4be952020ba0
2017-06-20 11:08:15 -07:00
Stanislau Hlebik
cad3f2d0a3 infinitepush: run debugfillinfinitepushmetadata in the background
Summary:
Final part: launching debugfillinfinitepushmetadata in the background. We
intentionally don't wait for it's completion in order not to slow down pushes.

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mitrandir, quark, mjpieters, medson, #sourcecontrol

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

Tasks: 19103180

Signature: t1:5265325:1497886939:6c306c08b240373ea43a7fc868b17ef776258cf9
2017-06-20 05:40:01 -07:00
Jun Wu
e9147da58e remotefilelog: fix changelog.add when node exists
Summary:
When committing a node which already exists, the linkrev provided to filelog
is actually wrong (len(changelog)). The upstream Mercurial will not update
existing file revisions but remotefilelog will.

The fact that linkrev being wrong triggers the ProgrammingError added by
D5061330. This diff detects that case and avoid writing bad linkrevs or
raise ProgrammingError.

Test Plan: Added a test.

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: medson, mjpieters

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

Signature: t1:5278060:1497910883:b8c3b6281ad9c0a516b942ba8ca41c51801b2d6b
2017-06-19 15:35:23 -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