Commit Graph

13767 Commits

Author SHA1 Message Date
Mark Thomas
9a19e06fee strip: move extension to core and rename to debugstrip
Summary:
Move the strip extension to core.  Rename the command to `hg debugstrip` as it
is not intended for use by users.  Users should use `hg hide` instead.

Reviewed By: quark-zju

Differential Revision: D14185822

fbshipit-source-id: ef096488cb94b72a7bb79f5bf153c064e0555b34
2019-02-25 03:55:08 -08:00
Mark Thomas
cb47493670 commitcloud: accept cloud bookmarks for hidden commits
Summary:
When receiving cloud bookmarks, if they point to a hidden/obsolete commit,
don't omit them.  The bookmark will make the commit visible again.

Reviewed By: quark-zju

Differential Revision: D14183009

fbshipit-source-id: ddcb8cce6aaa1eefae93490f76c3dffeaffda21c
2019-02-25 02:34:50 -08:00
Jun Wu
bfaf19a6a8 fetch: remove the extension
Summary:
`fetch` is a deprecated extension. It uses non-trivial branch-related logic.
Drop it to unblock further branch related cleanups.

Differential Revision: D14180593

fbshipit-source-id: 8288a7f0ac1ba72cf476cb78f109c71aa11c92c0
2019-02-22 21:02:42 -08:00
Jun Wu
56338d7005 branchmap: drop revbranchcache and other unused logic
Summary:
They're no longer used. Drop them. The `branchcache` is still somehow used,
although it's basically equvilent to `{"default": heads}`.

We can probably clean it up further after detached from subversion.

Reviewed By: singhsrb

Differential Revision: D14180592

fbshipit-source-id: 45230d486f203bf3f55e89ce9eb89e6855e14e54
2019-02-22 21:02:41 -08:00
Jun Wu
b8eecfa308 streamclone: drop branchmap code
Summary: It's a no-op already. Drop it.

Reviewed By: singhsrb

Differential Revision: D14180595

fbshipit-source-id: 9f904b818bcf56b9d12405ca9894baa9c786801b
2019-02-22 21:02:41 -08:00
Jun Wu
e188aff028 revset: make "branch(x)" equvilant to "all()"
Summary:
All commits belong to `default` branch. Therefore `branch(x)` can be seen as
just `all()`, assuming `x` is a valid name.

This removes the only user of `repo.revbranchcache`.

In a later step, branch related features will be moved to an extension so the
code becomes separate and features are optional.

Reviewed By: sfilipco

Differential Revision: D14180594

fbshipit-source-id: 9dc52743f1b69a1838114c8c0de5fc69383dc41e
2019-02-22 21:02:41 -08:00
Jun Wu
66f2e5f45e branch: disable branchcache and drop all branches other than "default"
Summary:
This hardcodes several perftweaks configs that have been enabled for major FB
repos for months:

  [perftweaks]
  disablebranchcache = True
  disablebranchcache2 = True
  disableresolvingbranches = True
  disableupdatebranchcacheoncommit = True

Practically, this means the branchmap is now just `{'default': heads}`. (i.e.
there are no named branches other than `default`), and branchcache is removed
(i.e. `.hg/cache` does not exist without clindex or in-repo tags).

This diff only makes easy-to-verify logic changes by assuming the configs and
removing dead code. Things can be further cleaned up. They will be done by
upcoming changes.

Most test changes are due to the fact that `.hg/cache` is no longer created.

Reviewed By: singhsrb

Differential Revision: D14179858

fbshipit-source-id: 479f7427168eb1d9614a973e273a229e50f5620a
2019-02-22 21:02:41 -08:00
Jun Wu
d30f175cde test-treediscovery: remove the tests
Summary:
The tests are about HTTP bundle1 support, which is not an environment we care
about. They will break in a way that is non-trivial to fix with the upcoming
branchmap removal. There is little value keeping them. So let's just remove the
tests.

Reviewed By: sfilipco

Differential Revision: D14179859

fbshipit-source-id: 09392bb2e5c0aebc30e584ed3a6593b0b2a81089
2019-02-22 21:02:41 -08:00
Jun Wu
9c13621dea test-hgweb-non-interactive: remove the test
Summary:
The WSGI parameter part gets changed with the upcoming branchmap removal.
We don't have resources to maintain WSGI for now, so let's just remove the
test.

Reviewed By: singhsrb

Differential Revision: D14179860

fbshipit-source-id: b2b82f7658a754caece220fa5f80d15514dd9260
2019-02-22 21:02:41 -08:00
Jun Wu
850022dd70 convert: drop cvs support
Summary:
The CVS branch support will break with the upcoming branchcache removal.
CVS repos are rare. Let's just remove the code.

Differential Revision: D14179863

fbshipit-source-id: 890ce34958d2efe4f2ef02b1d72cf92f6269378c
2019-02-22 21:02:41 -08:00
Jun Wu
047b1a05f4 exchange: kill checkheads
Summary:
We had `ui.checkheads=false` set for a long time. Let's remove the feature
entirely and update the tests.

This is necessary before killing the branch cache, as some tests still use
different branches and there would be suddently more "heads" that cause
test issues.

Reviewed By: sfilipco

Differential Revision: D14179861

fbshipit-source-id: 0de76566799a9560b45e823cc5f49cfda9e3dd30
2019-02-22 21:02:41 -08:00
Jun Wu
581f379320 tests: remove tests about checkheads
Summary:
The checkheads feature is being removed. See D8148016 for details.
This diff just removes tests with "checkheads" in their names.

Reviewed By: sfilipco

Differential Revision: D14179862

fbshipit-source-id: abd5bb26c0d92276273bef7ea93096ca3fde95dc
2019-02-22 21:02:41 -08:00
Johan Schuijt-Li
877d1315da treemanifest/remotenames: use write path for reads after push
Summary:
Treemanifest uses it's own fallbackpath for reads in all cases, but
particularly in the case of remotenames it should stay on the path that is
actively being used by the push. It is possible to have remotenames which are
mirrored and selected by query strings in the repo path. In this case it is
possible that the mirror is still out of date when reading back data from our
push. Ensure that when doing a push the remote server this is considered
'sticky' so that we read back from the remote we pushed to, rather then
determening the path ourselves.

To disable, please use:
  treemanifest.stickypushpath=False

Reviewed By: DurhamG, markbt, quark-zju

Differential Revision: D14165444

fbshipit-source-id: 75a53ffab895d87a4c52814f7887145c134868b5
2019-02-22 06:03:18 -08:00
Stanislau Hlebik
8922f8a4b1 hook: make it possible to record stderr of failed python hooks
Summary:
Context: in pushrebase replay job we run on Mononoke we also want to test our
hooks i.e. replay pushrebase requests that were denied on mercurial because of
a hook failure. The problem is that at the moment the only error message we have
is `prepushrebase.driver hook failed` (see xdb table `xdb.mononoke_production`,
query `select * from pushrebaserecording where pushrebase_errmsg like '%hook%'
limit 10;`). This error message tells us nothing, not even what hook failed.

To change it I suggest to make it possible for python hooks to raise HookAbort
and provide more information in the `hook_failure_reason` field.

Reviewed By: quark-zju

Differential Revision: D14131359

fbshipit-source-id: 69a2b51b30c78efadf3ba0d3332f46a777022568
2019-02-22 05:10:46 -08:00
Liubov Dmitrieva
db6d74a622 pushbackup - add a message when we truncate heads that needs to be backed
Summary: In chef there is currently an override to 50, so if someone got more due to some reason, it is nice to add a message.

Reviewed By: quark-zju

Differential Revision: D14170749

fbshipit-source-id: 3f3c79e4e6103523c14c8d9c1600f104e3d5d3d8
2019-02-21 20:27:32 -08:00
Stanislau Hlebik
ddd0f0ed99 mononoke: mononoke -> hg sync job
Summary:
First stab at a job that will keep hg in sync with Mononoke when Mononoke
becomes a source of truth.

Reviewed By: ikostia

Differential Revision: D14018269

fbshipit-source-id: f88c5eba8bf5482f2f162b7807ca8e41a3b4291d
2019-02-21 05:46:40 -08:00
Stanislau Hlebik
e36da58ac9 pushrebase: fix choosing commit timezone
Summary: There was a typo, the timezone is `[1]` and not at `[0]`

Reviewed By: ikostia

Differential Revision: D14147329

fbshipit-source-id: 8ad4bff810ed949a9f8e86d03ef62bc63aaf11bd
2019-02-21 00:59:13 -08:00
Jun Wu
f6c3848463 commands: remove more branch related CLI flags
Summary:
Remove:
- log --only-branch
- pull --branch
- push --branch
- record --close-branch
- incoming --branch
- outgoing --branch

Currently, `log --branch` is kept since some arcanist code still uses it.
We can probably remove it after the next arcanist release.

Differential Revision: D14116320

fbshipit-source-id: 50960ae8700200b322f615c4defd9c05353c2435
2019-02-20 20:05:29 -08:00
Jun Wu
2dc2a3d2a2 dispatch: do not show help on CommandError
Summary:
CommandError happens if there is an unknown command flag, or a required
argument is missing. The old behavior is to print an error message to
stderr, then start the pager with the command help printed to stdout.

There are 2 problems with that approach:
1. When using mosh, a long help text might flush the actual error to out of the
   screen. The error message will be missed.
2. When captured in shell scripts, the help text printed to stdout would be
   captured, which is almost always undesirable.

The actual motivation of this change is for 2. Zsh themes like bullet-train [1]
uses `hg id -b 2>/dev/null` and we'd like to remove `id -b` support. After that,
the command should not polluate stdout with help text.

[1]: bd88ade263/bullet-train.zsh-theme (L102)

Differential Revision: D14151200

fbshipit-source-id: edd38e91115f96929438379aa2e40edfba560b41
2019-02-20 18:44:35 -08:00
Jun Wu
fba42ecd00 mergedriver: handle queueremove correctly
Summary:
It's possible that the non-mergedriver code path decides to create ("get") a
file, because it only exists in one side of the merge parents, while
mergedriver decides to remove that file. That makes the file exist in both
"g" (get, aka. create) and "r" (remove) lists and result in incorrect
dirstate state.

Fix it by detecting the case and remove the conflicted files from the "g" list.

Reviewed By: DurhamG

Differential Revision: D14145990

fbshipit-source-id: f4e5d9787dca5cda6cae270f8a84296ecddf553c
2019-02-20 18:11:33 -08:00
Jun Wu
1321ab12f9 mergedriver: add a test showing suboptimal behavior
Summary:
vipannalla encountered an issue that his mergedriver code does not know the
complete list of files to "driver-resolve" at the "preprocess" step.

When doing "queueremove" files from one-side in the "conclude" step, the
dirstate would have "!" state afterwards.

Add a test to show that.

Reviewed By: DurhamG

Differential Revision: D14145989

fbshipit-source-id: e316aedea3359260dfbf7578a332f87b99fb37f9
2019-02-20 18:11:33 -08:00
Liubov Dmitrieva
ac401b9d9f commitcloud: trigger a backup to a secondary storage after cloud sync in the background
Summary:
We can't run in parallel at the moment as the log file and the lock file are
shared.

Every path maintains independent backup state (the previous diff).

The secondary backup state doesn't affect smartlog (only the main one)

The issue with this approach is that we maintain backup lock a bit longer.

Unfortunately, the progress in smartlog doesn't show anything about the second backup.

I added 'finished', it makes it easier to compare in the logs.

Reviewed By: markbt

Differential Revision: D14149399

fbshipit-source-id: f90e8aac6cb8dee53d5c7468bd6adba067e13362
2019-02-20 15:36:29 -08:00
Liubov Dmitrieva
ae7b506f80 infinitepush backup: separate depends on the remote infinitepush path
Summary:
We are going to support 2 different backends of Commit Cloud: Mercurial and
Mononoke.

Each of them should maintain local backup state separately.

Output of some tests have been slightly changes, this is because a separate backup
state, the same error appears earlier when we are trying the backup stacks.

The idea is to have separate backup states for different remote paths, but
there will be only one cloud sync state for the current source of
truth. We could include there the remote path and then validate that cloud sync
state is correct if the remote path has been changed.

However, for backup states it is much easier to have them separately (and we
will backup in 2 places)

Reviewed By: markbt

Differential Revision: D14138496

fbshipit-source-id: 0a7a763a395be5456cbd724bff7ebc069f03fb0e
2019-02-20 15:36:29 -08:00
Arun Kulshreshtha
a15b016f89 movement: add short flags for --clean and --merge
Summary: The `hg update` command has short flags for `--merge` and `--clean`, namely `-m` and `-C`. Let's add the short versions to `hg next` and `hg prev` as well.

Reviewed By: quark-zju

Differential Revision: D14155218

fbshipit-source-id: d51f5f658b525809e4c512ffa300dea4b4cabcdf
2019-02-20 14:49:53 -08:00
Durham Goode
8d31ac8424 simplecache: add checksum to simplecache values
Summary:
We're encountering an issue that I think is caused by invalid data
coming back from memcache, possibly due to our recently introduced connection
reusing. Let's add some checksums to verify that the data we put in is identical
to the data we get out for a given key.

Reviewed By: kulshrax

Differential Revision: D14141683

fbshipit-source-id: 206b51b862db7d54def02f5310b90f473d5a0d03
2019-02-20 13:56:33 -08:00
Arun Kulshreshtha
aaf26c23ca movement: pass --merge flag to update from prev/next
Summary: We weren't passing the `--merge` flag from `hg prev` and `hg next` to the underlying invocation of `hg update`. This diff fixes the problem so that `--merge` now works as expected.

Reviewed By: DurhamG

Differential Revision: D14154244

fbshipit-source-id: 4a2412cca714ec8f269eb5f2989e39821642fbb3
2019-02-20 13:49:08 -08:00
Durham Goode
1935d046b8 pushrebase: backout change to preload the manifest
Summary:
Backs out D13944829 that add preloading the manifest to pushrebase. In
a situation where you receive tree commits, but the repo is hybrid, this causes
it to try to lookup the bundled tree manifests in the flat manifest revlog.

Let's just back this out for now until we can come up with an appropriate fix,
or move all our repos to treeonly.

Reviewed By: quark-zju

Differential Revision: D14151876

fbshipit-source-id: 0f7419d5b9bcd9d7ce363f4349e9e2e4a86cf713
2019-02-20 13:44:51 -08:00
Mark Thomas
6ee252bb95 debugstatus: print the clock value stored in treestate
Summary: Add the current clock value to the output of `hg debugstatus`

Reviewed By: quark-zju

Differential Revision: D14150641

fbshipit-source-id: 917ac3095bc933c042c0f057d0dbda38ef710844
2019-02-20 11:01:52 -08:00
Kostia Balytskyi
33a83f729b replay: only expect timestamp and not timezone
Reviewed By: StanislavGlebik

Differential Revision: D14149972

fbshipit-source-id: 3cab55c9247fa06e3a01a5d4dda507d47a6ebf5e
2019-02-20 08:47:25 -08:00
Kostia Balytskyi
4a3a890f0d unbundlereplay: do not produce changegroup response part
Summary:
This is a perf optimization. `unbundlereplay.respondlightly` instructs the
server to not produce the pushback parts regardless of what `replycaps` part
of the incoming bundle says. This is important, since the mononoke-hg sync will
send all the bundles in a searialized way, so we want to optimize time where
possible.

Reviewed By: StanislavGlebik

Differential Revision: D14131575

fbshipit-source-id: afec15347d43fa52b1ec64b4ac8ece5b227ccf7d
2019-02-20 08:47:25 -08:00
Xavier Deguillard
966f142720 tests: make test-fb-hgext-remotefilelog-corrupt-cache.t reliable
Summary:
This test has been extremely flaky in the last few weeks, causing builds to not
being released, or just sandcastle jobs failing randomly. The reason for the
flakyness was due to the mtime stored in the dirstate being -1 instead of the
real mtime of the file.

The reason for the mtime to be -1 is to fix a race where a file is modified in
the same second the dirstate is updated. This can happen when a transaction
spans less than a second. By forcing a transaction to always last at least a
second, we can avoid this issue and make the test stable.

Reviewed By: quark-zju

Differential Revision: D14141924

fbshipit-source-id: ce151cd65d930f8c745633f7575ea006748af9b9
2019-02-19 16:24:38 -08:00
Kostia Balytskyi
2c56dd0930 unbundlereplay: add a missing bit to the test
Summary: Add the actual verification of the server-side repo after `unbundlereplay`

Reviewed By: StanislavGlebik

Differential Revision: D14131577

fbshipit-source-id: 18828479b07a110f26fd8adf108eb94a21d817c6
2019-02-19 08:22:24 -08:00
Kostia Balytskyi
da3e429150 wireproto: add unbundlereplay command
Summary:
This is to be used from Mononoke->hg sync.
Currently expects only `pushrebase` bundles, e.g. one head and one book to
move.

Reviewed By: StanislavGlebik

Differential Revision: D14116130

fbshipit-source-id: 959a6e51f51e21da5592c84188e294a33057ffaa
2019-02-19 01:57:39 -08:00
Mateusz Kwapich
4db0750027 fsmonitor: use correct length for number of files changed
Summary: When comparing the number of files changed, fsmonitor was incorrectly using the length of the result dict (always 4), rather than the number of files watchman returned.  Use the right list of files instead.

Reviewed By: markbt

Differential Revision: D14123604

fbshipit-source-id: 94684f1f189d045b2f6a880180b15e52ba9bba8c
2019-02-18 10:03:12 -08:00
Mateusz Kwapich
9e35a167ef fsmonitor: show that we don't update watchman clock as often as we wish
Summary:
This subtle bug shows only when the watchman-changed-file-threshold is set to a
value higher than 4.

Reviewed By: markbt

Differential Revision: D14123605

fbshipit-source-id: 51ff3172fef5bc65fb9f68bb34826a9181fd64a9
2019-02-18 10:03:12 -08:00
Kostia Balytskyi
a61dbb725b branches: delete hgsubversion test related to branches
Summary: It fails the build currently.

Reviewed By: quark-zju

Differential Revision: D14108628

fbshipit-source-id: 5721a3513c5234df1c96756a3ab48b3b6c9c350f
2019-02-15 11:26:56 -08:00
Liubov Dmitrieva
4454d6eeb5 pushbackup: fix early exit logic
Summary:
the early exit logic was incorrect, basically if there is at least 1 bookmark
in the repo and the backup state was not empty, it didn't catch that nothing has been changed.

bookmarks are dicts, so it is fine to compare them

if any bookmarks in the repo, everytime `hg pushbackup` established a connection to mercurial

Reviewed By: quark-zju

Differential Revision: D14103938

fbshipit-source-id: 0edc4d9e186199670765fd2362236330e831c7d9
2019-02-15 10:04:00 -08:00
Jun Wu
f752c4dd75 commands: deprecate "hg id -b"
Summary:
There are still users of "hg id -b", namely shell prompt scripts.
However, it seems fine to remove "branch" from the formatted (JSON or other
formats) output.

Reviewed By: ikostia

Differential Revision: D14076296

fbshipit-source-id: a77f4b9e73161d322da3f1bdec993082ac463939
2019-02-14 17:44:40 -08:00
Jun Wu
dc38aa9d7a commands: remove "clone --branch" flag
Differential Revision: D14076299

fbshipit-source-id: dafbb7866e12e551b162a20ee048264866b67c96
2019-02-14 17:44:40 -08:00
Jun Wu
e257757924 commands: remove "bundle --branch" flag
Summary: Named branches are going away.

Differential Revision: D14076297

fbshipit-source-id: b68356f7075a6a8787cf0d2aa972bb27e1ef9bb1
2019-02-14 17:44:40 -08:00
Jun Wu
37af1cfda3 commands: remove "commit --close-branch" flag
Summary: Without named branch, it is not meaningful to close a branch.

Differential Revision: D14076295

fbshipit-source-id: 527ae457cb14f9415fa7269b7dc123252e7d6867
2019-02-14 17:44:40 -08:00
Jun Wu
35a58e8c24 commands: replace "branch" command with deprecation warnings
Summary:
Unfortunately, there are still users of the "hg branch" command so we cannot
remove it right now. But I'm updating internal tools to not call it.

Reviewed By: ikostia

Differential Revision: D14076300

fbshipit-source-id: a5322d9c9ce8148c6ad0800653bd829736556386
2019-02-14 17:44:40 -08:00
Jun Wu
82b4be9a7f config: hard-code ui.allowbranches=False
Summary: Since it's always False, remove the config option.

Reviewed By: ikostia

Differential Revision: D14076304

fbshipit-source-id: 2cc6409355a0c4514a62bc764e1deec0af1bd3a1
2019-02-14 17:44:40 -08:00
Jun Wu
9a87d9567c commands: remove "branches" command
Summary:
It seems nobody uses it from dev_commands logging. Search for "allowbranches"
in all internal repos suggests nobody turned it on. The tests were also
migrated to not use the command so let's just remove it.

Reviewed By: ikostia

Differential Revision: D14076298

fbshipit-source-id: a1cb03b2da289c01b15f0580ffe77531941be213
2019-02-14 17:44:40 -08:00
Jun Wu
20da8e235a test-hgsubversion-unaffected-core: remove tests using named branches
Differential Revision: D14063219

fbshipit-source-id: 80cad750bfc5c0ef66d545e4a6be56342a195f8e
2019-02-14 17:44:39 -08:00
Jun Wu
702ed9a453 test-revset: do not use "hg branch" directly
Summary:
Migrate away from using the "hg branch" command to "hg commit --extra branch="
instead. In the future the branch namespace would be removed, so we create
local tags instead.

`test-revset2` was split from `test-revset` and has the same header. Do the
same change to it. Besides, de-duplicate tests about the `tag()` revset.

Reviewed By: ikostia

Differential Revision: D14058435

fbshipit-source-id: b59fadc43939d85d14bbf9f81227c523b65557a0
2019-02-14 17:44:39 -08:00
Jun Wu
338fe1197f dirstate: add more logging to debug T39234759
Summary:
"st_size" returned by watchman is sometimes 0. We suspect it's incorrect.
It could be the file on disk is actually empty, or the kernel made it
look empty to watchman in the past, or there is something wrong with
serialization, etc. Let's first add a real os.stat to test if the file
is really empty.

Reviewed By: phillco

Differential Revision: D14090851

fbshipit-source-id: bd75cf86bfd117285658ad0dd7fb28d0e8b5585c
2019-02-14 16:29:46 -08:00
Phil Cohen
50ebbbbb86 hook: print exception message on load failure
Summary: Otherwise mergedrivers become impossible to debug if they don't import correctly.

Reviewed By: ikostia

Differential Revision: D14071200

fbshipit-source-id: 3e677089e6b008d892158290c392e1f9d68a67ae
2019-02-14 16:22:22 -08:00
Kostia Balytskyi
2da9689539 test-hggit: yet another fix
Differential Revision: D14091401

fbshipit-source-id: f712c7796ff3cbd66a0249ba6aeb2405a18ffc68
2019-02-14 14:08:27 -08:00
Mateusz Kwapich
4f58ae8678 config: stop lying about the config locations
Summary:
Since september (D9840431) rcutil.rccomponents is no longer source of truth
about which config files we load. In fact we use it only in the
`hg config --debug`. This leads to situations where the debug command mentions
loading a specific config file and then ignores it completely which is very
confusing.

Let's remove it.

Reviewed By: suitingtseng

Differential Revision: D14083220

fbshipit-source-id: 362fd9bf574e24639f99a1203206184da42d1e24
2019-02-14 09:31:58 -08:00