Commit Graph

12844 Commits

Author SHA1 Message Date
Mateusz Kwapich
c74ac7db7f print the first line of hidden commit message
Summary: This way it's even more clear

Reviewed By: ryanmce

Differential Revision: D7585130

fbshipit-source-id: ce9e535f88f794fd19d7fd3db5171263fcd7865a
2018-04-13 21:51:54 -07:00
Martijn Pieters
abd2175e71 hg: actually run the tests in fb/tests
Summary:
There are tests in fb/tests we don't run as part of the test suite. Update the makefile and add buck infrastructure to run them.

 - Update the test-common-commands-hg.t test
 - Re-generate the fbcode/.hgignore file from the updated .gitignore

Reviewed By: quark-zju

Differential Revision: D7584511

fbshipit-source-id: d85800dccf0eb569a68db4b9e1d9796e3d7ac957
2018-04-13 21:51:54 -07:00
Phil Cohen
487a3fb991 repogenerator: add new files and directories over time
Summary:
The megarepo generator now adds new directories and files automatically. We now pick folders and paths randomly, with a configurable number of subdirectories and a configurable length for the leaf filename, and a fixed alphabet.

The array of directories and leaf filenames are prorated: they start out constrained and grow as we approach our desired number of commits to generate (`repogenerator.numcommits`), so as not to be too sparse initially.

The directory array is randomized initially, so the above proration doesn't lead to a trivial edit pattern (e.g. everything in a/* initially.)

Lastly, we now stop generation when we hit our goal.

Reviewed By: quark-zju

Differential Revision: D7572968

fbshipit-source-id: b60d60b6262962ee114cb19b0989e6a1af8c0549
2018-04-13 21:51:54 -07:00
Durham Goode
c679adb7d0 hg: remove bundlev1 from the supported outgoing versions
Summary:
Removes bundlev1 from the supported outgoing versions, but keeps a flag
around to force enable it if tests need it.

Reviewed By: quark-zju

Differential Revision: D7591176

fbshipit-source-id: 280cbbbe87848e3d6c9d448ce4f87c5eadeff720
2018-04-13 21:51:53 -07:00
Durham Goode
0f716a4f57 hg: remove test dependency on bundle1
Summary:
Bundle1 is being deprecated. These tests use it but don't need to, so
let's change them to use bundle2.

Reviewed By: quark-zju

Differential Revision: D7591178

fbshipit-source-id: 3fd46d3bbab9f7acd2f63dfb4f10c21b6d2c35e9
2018-04-13 21:51:53 -07:00
Durham Goode
a2f2208f71 hg: update commit interactive test to not use bundle1
Summary:
The commit interactive test was creating a bundle to test committing
binary files. It had no reason to need bundle1, so let's update it to bundle2.

Reviewed By: quark-zju

Differential Revision: D7591170

fbshipit-source-id: 964cd2cfc4368a89c956b30389ca74ab0b87a486
2018-04-13 21:51:53 -07:00
Durham Goode
6750ab25b0 hg: allow bundle1 for hg web tests
Summary:
These tests use hard coded url's that don't include bundlecaps, so it's
difficult to convert them to use the right bundlecaps for bundle2.

Reviewed By: quark-zju

Differential Revision: D7591165

fbshipit-source-id: 3424c448be8c713cac5b876438745414a59b7230
2018-04-13 21:51:53 -07:00
Durham Goode
f96219ef87 hg: update test-patchbomb to not use bundle1
Summary: We're deprecating bundlev1, so let's update this test to not use it.

Reviewed By: quark-zju

Differential Revision: D7591169

fbshipit-source-id: c3bd3496e46c57365beb6cc8380ed6d13110f7b3
2018-04-13 21:51:53 -07:00
Durham Goode
a54b05ee58 hg: use bundle2 for treemanifest backfill
Summary:
We weren't passing bundlecaps to the backfill pull, so we were getting
bundle1. Let's fix that

Reviewed By: quark-zju

Differential Revision: D7591167

fbshipit-source-id: 111e2967190dca17764c84e6d7be850644f222fd
2018-04-13 21:51:53 -07:00
Durham Goode
ba5c4cc4e9 hg: update tests to not use bundle1
Summary: We're deprecating bundle1, so let's update some tests.

Reviewed By: quark-zju

Differential Revision: D7591173

fbshipit-source-id: 806dfab377d2416e9fc8fe34bfebcaaf854e5c11
2018-04-13 21:51:53 -07:00
Durham Goode
db081e2c0c hg: update test-bundle2-format to not use bundlev1
Summary: We're deprecating bundlev1. Let's update this test.

Reviewed By: quark-zju

Differential Revision: D7591171

fbshipit-source-id: 0f840d318937016bec22d42577ab882eef9bedc9
2018-04-13 21:51:53 -07:00
Durham Goode
0ae182a740 hg: default to using bundle2 for pushrebase parts
Summary:
Pushrebase previously defaulted to bundlev1. Now that the server can
support v2, let's default to v2.

Reviewed By: quark-zju

Differential Revision: D7591174

fbshipit-source-id: bc5448490ff319543baedf3f5a1aab160a73ed27
2018-04-13 21:51:53 -07:00
Durham Goode
24653e5e32 hg: add develwarn for bundle1 format
Summary:
We want to deprecate the bundlev1 format, so let's start by adding a
develwarn. Later diffs will update the tests to not use v1, then remove v1 as a
supported outgoing bundle entirely.

Reviewed By: quark-zju

Differential Revision: D7591166

fbshipit-source-id: 143ad029bfe4d141f91d6d5077342dfa44ad2944
2018-04-13 21:51:52 -07:00
Liubov Dmitrieva
4affcfaa2a infinitepush: MRU order of listing hosts and repo roots
Summary:
infinitepush: MRU order of listing hosts and repo roots to show host/repos with most recent first

this is for improving ux for those who have a lot of backups (T27713908)

Reviewed By: StanislavGlebik

Differential Revision: D7568128

fbshipit-source-id: 65bb6a4759298268fbd3109df57a2b9e198bd4c0
2018-04-13 21:51:52 -07:00
Mateusz Kwapich
e6ed96017c add --cleanup option
Summary:
This is meant to replace `arc cleanup`. Normally the commits corresponding
to landed Differential Revisions disappear on `hg pull` unless:
 * there's a bookmark pointing to a commit
 * the commit is currently checkout out

This command makes it easy to deal with such commits. Just run `hg hide -c`

Reviewed By: ryanmce

Differential Revision: D7350794

fbshipit-source-id: 3b77acbca01edc5bffda53023687f268dc8edb08
2018-04-13 21:51:52 -07:00
Mateusz Kwapich
323157e712 add a hint about hg undo to hide
Summary:
I know that `hg undo` is useful for undoing most of the commands
but hide is the one that a bit more sensitive because it's
the command to remove commits from your smartlog.

Also I'm planning on introducing additional, more powerful options
for hide and that could be useful for undoing them.

Reviewed By: ryanmce

Differential Revision: D7350795

fbshipit-source-id: fbc42674fe0ca4ac6300c08095897f624d41a2f3
2018-04-13 21:51:52 -07:00
Mateusz Kwapich
d2c8503e6f make hide more verbose
Summary:
Users would feel more comfortable using this command if they knew what it's
doing for them. Use `--quiet` to disable verbosity

Reviewed By: quark-zju

Differential Revision: D7380617

fbshipit-source-id: 0de46a858ec9c1c4a8cd9a55a5760bdcd8723424
2018-04-13 21:51:52 -07:00
Alexandre Marin
c8a36c3d0c rm scm/hg/hgext/p4fastimport/filetransaction.py
Summary:
We haven't used this for over a month, we're alive and well.
The raccoon asked me to remove this:
codecleanupracoon

Differential Revision: D7578280

fbshipit-source-id: ee522203095a213dc90d6146ce720b473ab5afe5
2018-04-13 21:51:52 -07:00
Alexandre Marin
dcfdac9963 seqimport - test moving files in/out of client view
Summary: Adds a more thorough test for D7574415

Differential Revision: D7575302

fbshipit-source-id: cdd98f738da5d78331f7e761b940897a8761bfcc
2018-04-13 21:51:52 -07:00
Jun Wu
5346a46bb5 rebase: on abort, don't strip commits that didn't need rebased (issue5822)
Summary:
Backports:

```
  # HG changeset patch
  # User Martin von Zweigbergk <martinvonz@google.com>
  # Date 1521175251 25200
  #      Thu Mar 15 21:40:51 2018 -0700
  # Branch stable
  # Node ID a046d6890761b6a99475f0e5bf9cce74715897ec
  # Parent  b9a6ee2066f9636265d812a3a8b82b02bc3223aa
  rebase: avoid defining two lists with the same contents

  In abort(), there's "dstates" and "rebased" that are identical, which
  they seem to have been since 0806823370d8 (rebase: properly calculate
  descendant set when aborting (issue3332), 2012-03-22). Let's
  de-duplicate. I don't know what "dstates" means, but "rebased" makes
  sense (it's the list of rebased revisions), so let's pick that.

  Differential Revision: https://phab.mercurial-scm.org/D2878

  # HG changeset patch
  # User Martin von Zweigbergk <martinvonz@google.com>
  # Date 1521178507 25200
  #      Thu Mar 15 22:35:07 2018 -0700
  # Branch stable
  # Node ID 177f3b90335fc49c23a8880de57dc865f0832849
  # Parent  a046d6890761b6a99475f0e5bf9cce74715897ec
  rebase: on abort, don't strip commits that didn't need rebased (issue5822)

  I clearly missed adding this condition in 78496ac30025 (rebase: allow
  rebase even if some revisions need no rebase (BC) (issue5422),
  2017-05-11). Perhaps I should have opted for the "revdone" solution I
  mentioned there...

  Differential Revision: https://phab.mercurial-scm.org/D2879
```

Differential Revision: D7517675

fbshipit-source-id: c08206700f2a26a36785adf9df93176449a58376
2018-04-13 21:51:51 -07:00
Jun Wu
1caa774e95 amend: abort if unresolved merge conflicts found (issue5805)
Summary:
Backport from:

```
  # HG changeset patch
  # User Yuya Nishihara <yuya@tcha.org>
  # Date 1520766638 -32400
  #      Sun Mar 11 20:10:38 2018 +0900
  # Branch stable
  # Node ID eeb87b24aea7f547f6d95b812dd080dc6e9ab194
  # Parent  9639c433be54191b4136b48fe70fc8344d2b5db2
  amend: abort if unresolved merge conflicts found (issue5805)

  It was checked by repo.commit() before e8a7c1a0565a "cmdutil: remove the
  redundant commit during amend."
```

Differential Revision: D7517547

fbshipit-source-id: fd585bc4dceb837e8486b1285ed7ff14d24795d3
2018-04-13 21:51:51 -07:00
Mark Thomas
f1ebfba3dc progress: deactivate the progress thread when shutting down
Summary:
The progress bar thread is a daemon thread, so that it doesn't need to be
deactivated manually.  However, this means the thread terminates and the lock
is released during interpreter shutdown.  Because Python clears module
attributes at the start of interpreter shutdown (see [1]), releasing the lock
fails as it can no longer get the thread identity.

To mitigate this, we register an atexit handler to terminate and join to the
progress bar thread.

[1] https://stackoverflow.com/questions/25649676/where-is-pythons-shutdown-procedure-documented

Differential Revision: D7568155

fbshipit-source-id: 85ef10af6c1576d5beceb78f8514e0e440cdab7f
2018-04-13 21:51:51 -07:00
Kaley Huang
667f296601 bring back mercurial worker
Summary:
We disabled `runworker` for every importer (fastimport, syncimport, seqimport) when we hotfixed a customized file transaction breakage in fastimport D7108127.

Since
- we're not using fastimport, which relies on the customized file transaction
- seqimport does not rely on the customized file transaction mechanism
- syncimport is super slow without `runworker` and syncimport does not rely on the customized file transaction mechanism
- the manual work involved in adding mapping to ovrsource (we have to do that if we don't have syncimport) is not trivial

I think it's a good idea to bring back `runworker`, which is a configurable config, and it's explicitly set to `false` for fastimport and seqimport, `force` for syncimport.

This diff
- make the `useworker` config available again
- remove the unnecessary test on the customized file transaction, which is still broken with `runworker`
- log the time it takes to finish one sync import

Differential Revision: D7557856

fbshipit-source-id: 6d4105cc38b182e027512730901ce3b2a4e1d449
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
88b296f51b hg: add more debug output to the _testlock function
Summary: We want to know what is the reason why we think the lock file can't be removed.

Reviewed By: farnz

Differential Revision: D7513954

fbshipit-source-id: fd1668e7a614e5e24e250018fbc880ba87821aa8
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
e516de21d5 hg: introduce a Locker class for lock-owner processes
Summary:
The goal of this diff is to introduce a central place for all logic related
to parsing and handling the contents of the lock files. The current state of
things is hard to manage and even harder to extend.

NB: the stack is not complete, the changes that actually use this refactoring are yet to come.

Reviewed By: quark-zju

Differential Revision: D7489326

fbshipit-source-id: aa79d964411e3f5b61e24aa9babece05d4f0bd60
2018-04-13 21:51:51 -07:00
Martijn Pieters
3f7758625a sparse: Add support for specifying a revision to sparse explain
Summary: We need this to support producing sparse profile stats in a null-revision working copy.

Reviewed By: quark-zju

Differential Revision: D7553022

fbshipit-source-id: b1643f443de5a748bf81ff2df16ace984d59a2c2
2018-04-13 21:51:50 -07:00
Martijn Pieters
440232e553 sparse: fix the accidental recursive handling of profiles
Summary:
hg sparse explain wasn't supposed to recurse, not without additional support.

It was the process of gathering stats that overwrote shared mutable structures.
Prevent this from happening again by making these structures immutable.

Differential Revision: D7516570

fbshipit-source-id: 247c60b4bd8d2d22b42c41871e1eb15988820025
2018-04-13 21:51:50 -07:00
Martijn Pieters
62ec76397b sparse: fix broken signature calculation for sparse profiles
Summary:
We were ignoring the actual profile data, and all profiles were given the same .hg/sparse-based hash signature instead.

Error introduced in D7415720

Differential Revision: D7514087

fbshipit-source-id: 56288aaaa2065b031318e7c065ec6310f6cecd37
2018-04-13 21:51:50 -07:00
Kostia Balytskyi
fa03821500 hg: fix test-checks broken in windows treemanifest stack
Reviewed By: quark-zju

Differential Revision: D7560133

fbshipit-source-id: 98b016d0911aaecc1058263c134a5e4ecd0be9e5
2018-04-13 21:51:50 -07:00
Saurabh Singh
32da3b0259 run-tests: change the default hg shell for tests to bash
Summary:
Our tests use features that are provided by the bash shell to function
properly. I ran into issues with our tests on Ubuntu because the default shell
was `dash` which did not even support the `source` command. Therefore, this
commit changes the default hg shell for the tests to `bash`. Clients can always
override the default hg shell for the tests to another shell.

Reviewed By: quark-zju

Differential Revision: D7563733

fbshipit-source-id: e9c16c002793a919a49292a9aa0a876ba232c293
2018-04-13 21:51:50 -07:00
Saurabh Singh
51aa41fa78 run-tests: fix the tests when run with '--shell bash' configuration
Summary:
`run-tests.py` has an option to specify the shell for running the
tests. However, when run with the `--shell bash` configuration, several tests
fail with the `testrepohg: command not found` error. I could not find the
specific cause for this but changing the alias to a function resolved this
error. Also, fixed another related error by using double quotes during variable
expansion.

Reviewed By: quark-zju

Differential Revision: D7563731

fbshipit-source-id: 58e1b5b996ccdc20b8375dcd5f4f8e071bd9cdc1
2018-04-13 21:51:50 -07:00
Jun Wu
b43606ee98 ignore: add a way to disable hgignore
Summary:
This allows us to turn on and off hgignore support directly without changing
files in the working copy (which could be hard to revert cleanly).

Reviewed By: mjpieters

Differential Revision: D7544529

fbshipit-source-id: 14cc41e2ae361070f91bf3b8aa28dd5808e7fe99
2018-04-13 21:51:49 -07:00
Kaley Huang
9d4c4d34e7 seqimport-test: make src a glob expression instead of "p4"
Summary: When I run this test (test-fb-hgext-p4fastimport-seqimport.t) on my dev server, which has the same `p4d` as what we have in prod (P59384966), it fails the test due to reading the file from a different source P59381563. Since both `p4` and `rcs` are valid options for a read, this diff updates the test to not restrict to `p4` only.

Differential Revision: D7556357

fbshipit-source-id: b82d254841a31fe447452ee408bdb8e157854aab
2018-04-13 21:51:49 -07:00
Stanislau Hlebik
2355414e71 mercurial: improve graft error message
Summary:
Previously `hg graft -r 'ancestor::descendant` printed no error message at all.
This diff fixes it.

Reviewed By: mjpieters

Differential Revision: D7533498

fbshipit-source-id: 5c4e41ecc3178495ad2f41ef53ef65f7fbb70212
2018-04-13 21:51:49 -07:00
Jun Wu
18c17ec9f1 tweakdefaults: use hint framework for prev
Summary:
A side effect is, the hint won't be printed out if fbamend is not enabled,
which is more "correct".

Reviewed By: markbt

Differential Revision: D7392130

fbshipit-source-id: 5b7aa4cc3083b03546c54965ce51040fab958b87
2018-04-13 21:51:49 -07:00
Jun Wu
213feff513 amend: use hint framework for auto rebase
Reviewed By: markbt

Differential Revision: D7392128

fbshipit-source-id: b502ac1d7595bd072b6bd4e96de69cde6cca1878
2018-04-13 21:51:49 -07:00
Jun Wu
238cda6c14 amend: use hint framework for restack
Summary: This allows people to silence the hint.

Reviewed By: markbt

Differential Revision: D7392127

fbshipit-source-id: ac16f952a178d567ce13e22946127456972ebe85
2018-04-13 21:51:49 -07:00
Jun Wu
10bf57de39 prune: use hint framework
Summary:
This allows users to silence the "hide" advice.

In the future, we might want to change "hide/unhide" to only affect visibility
without changing obsolesce. So "strip" is not fully deprecated yet.

Reviewed By: markbt

Differential Revision: D7392131

fbshipit-source-id: 2448d4c91dffce31d29e2dd99078cb555c9a8f8c
2018-04-13 21:51:49 -07:00
Jun Wu
0252fce55c hint: add a command to silence hints
Summary:
This allows people to silence hints as they like. It's done by modifying
user hgrc.

Reviewed By: markbt

Differential Revision: D7392133

fbshipit-source-id: 1365294217db92dfb3a0c81332a9fefd164795d4
2018-04-13 21:51:49 -07:00
Jun Wu
14783221f6 hint: add a simple framework for registering hint messages
Summary:
This allows us to have a unified way to print hint messages at the end of a
command. It would be helpful for feature discovery in general.

Reviewed By: mjpieters

Differential Revision: D7392132

fbshipit-source-id: 8b4e94cc2176266652459ecca3428bd86d95bfe2
2018-04-13 21:51:48 -07:00
Phil Cohen
1fed73ea7e rebase: fix IMM restarting with uncommited changes
Summary:
We bailifchanged() later on, but the abort does an `up -C originalwc` before that. Let's bailifchanged() immediately.

A better version: reset the transaction and clear the statefile, instead of calling `abort()`.

Reviewed By: quark-zju

Differential Revision: D7538017

fbshipit-source-id: 8c490b366e495bb269c4d8c75b6144c535c8d54f
2018-04-13 21:51:48 -07:00
Adam Simpkins
a6782ea273 minor improvements to hg journal output
Summary:
Minor fixes to how the `previous locations of %s` line is printed:
- Start the pager before printing this line, so it gets included in the pager
  output correctly.
- Avoid printing this line when using a custom output template.  Previously it
  was only skipped when using the `json` template.  This now matches the logic
  used to skip the `no recorded locations` line that was recommended in
  D7512030.

Reviewed By: ryanmce

Differential Revision: D7537661

fbshipit-source-id: eb695dd98c06149701cf96acf5ec2eb277ea9cf3
2018-04-13 21:51:48 -07:00
Adam Simpkins
39cd1c0389 fix hg journal to avoid printing non-JSON data with -Tjson
Summary:
Avoid printing "no recorded locations" directly to stdout when a format
template was specified.  In particular this avoids printing non-JSON data
when using `-Tjson`.

We potentially could change this to print to stderr instead.  However for now
I just followed the same pattern of checking the template as was done above for
the "previous locations" message.

Reviewed By: ryanmce

Differential Revision: D7512030

fbshipit-source-id: 2c32f07962fac4ca3d6bfd8f2ca3c4840b2a8a9b
2018-04-13 21:51:48 -07:00
Martijn Pieters
964bbe67d5 simplecache: correct indentation error, causing an UnboundLocal exception
Summary: When no cache has been set (`simplecache.caches=`) then there's no `name` set either. This exposed a logic error in this section of the code.

Reviewed By: ryanmce

Differential Revision: D7513976

fbshipit-source-id: ecbc7a8ac8c6eb23010d64ab8cbf9f9fb7d8f497
2018-04-13 21:51:47 -07:00
Liubov Dmitrieva
efebe7a94b add move logic to update current rev to its new location (optional)
Summary:
move logic to update current rev to its new location (optional)
we are trying to update only if it is unambiguous

Reviewed By: DurhamG

Differential Revision: D7431940

fbshipit-source-id: 72e7fea7365a231c4d98ceb4cf4872a4db02d9ca
2018-04-13 21:51:47 -07:00
Liubov Dmitrieva
de0082660b commit cloud recover state
Summary:
[commitcloud] commit cloud recover state

`hg cloudrecover` command

It might be helpful to have a command like this in cases something goes wrong
with the local state

Reviewed By: DurhamG

Differential Revision: D7417147

fbshipit-source-id: 4b236f2753b1f212ff4881a649032e53e032c66c
2018-04-13 21:51:47 -07:00
Liubov Dmitrieva
06bd6c5c91 speed up commitcloud pull many times
Summary: [commitcloud] speed up commitcloud pull many times

Reviewed By: markbt

Differential Revision: D7444195

fbshipit-source-id: 869e31ea3e6b6141c83fc28a605b788d192649be
2018-04-13 21:51:47 -07:00
Liubov Dmitrieva
ad6ffda306 join to workspace
Summary: `hg cloudjoin` command

Reviewed By: DurhamG

Differential Revision: D7414658

fbshipit-source-id: b612885bf6226b164a7efd21d9f4166fbf7efd1d
2018-04-13 21:51:47 -07:00
Liubov Dmitrieva
e3276c7e7b introduced secure token injection
Summary:
new command `hg cloudregister`

storing user token

Reviewed By: DurhamG

Differential Revision: D7367301

fbshipit-source-id: e8eb3d51cf62e9c1e91c39be45e0ad8b49a74442
2018-04-13 21:51:47 -07:00
Mark Thomas
457c8ba50c infinitepush: handle remote aborts when pushing backup bundles
Summary:
When pushing a backup bundle to the server, check if the response contains an
error, and fail the backup accordingly.

Differential Revision: D7498324

fbshipit-source-id: a08807ac54e9d3044ff1450e93d2a8ea9d6f767f
2018-04-13 21:51:46 -07:00