Commit Graph

44146 Commits

Author SHA1 Message Date
Adam Simpkins
f32aa15ebd remotenames: fix a crash in remotenames() revset evaluation
Summary:
Update the `remotenames()` revset to check if the repository in question
actually supports remotenames.  Otherwise the code will crash trying to access
`repo._remotenames` if it does not exist.

The `_findrecenttree()` function in the `treemanifest` extension evaluates the
`remotenames()` revset if the remotenames extension is loaded.  This can cause
it to evaluate this revset even if the repository in question was initialized
before the remotenames extension was loaded, and therefore does not support
remotenames.

Reviewed By: quark-zju, strager

Differential Revision: D9486916

fbshipit-source-id: 4a656f5f56330b4038afdb2f88e35b7c97bbc81e
2018-08-23 21:20:16 -07:00
Jun Wu
a987ecb9b2 ui: use Rust config parser in Mercurial
Summary:
Switch `ui.load` and `ui.readconfig` to use the Rust config parser.
`ui` now no longer depends on `config.config` or `rcutil`.

Pest's error messages are fancier, thus most test changes.

For the fbsource repo, debugshell shows the new code is 10+x faster:

On laptop:

Before:

  In [1]: %timeit m.ui.ui.load()
  10 loops, best of 3: 27.8 ms per loop

After:

  In [1]: %timeit m.ui.ui.load()
  100 loops, best of 3: 1.85 ms per loop

On devserver:

Before:

  In [1]: %timeit m.ui.ui.load()
  100 loops, best of 3: 16.8 ms per loop

After:

  In [1]: %timeit m.ui.ui.load()
  1000 loops, best of 3: 1.28 ms per loop

Since `ui._rcfg` is no longer copy-on-write, there is concern about `ui.copy()`
performance. It is faster too (on devserver):

Before:

  In [1]: %timeit ui.copy()
  1000 loops, best of 3: 198 µs per loop

After:

  In [1]: %timeit ui.copy()
  10000 loops, best of 3: 157 µs per loop

The old `ui.py` was copied to `legacyui.py` and can replace the new `ui.py` if
a config file exists on the system.  This provides a way to switch back to the
old config parser in case of emergency.

Reviewed By: mitrandir77

Differential Revision: D8887375

fbshipit-source-id: 2951ca622c77bf41187ad5c5cab3445cda0dc519
2018-08-23 17:52:52 -07:00
Jun Wu
07f3d004cc summary: remove branch related logic
Summary:
I noticed `hg summary` takes 32 seconds running in my local repo. Profiling
shows 30 seconds spent on `changelog.findmissing`. We don't use branches and
heavily patched other places to get rid of branch heads logic. So let's remove
them from `hg summary` too.

Reviewed By: phillco

Differential Revision: D9477205

fbshipit-source-id: 17b07190b6dcc96bc3a5f3c2b5ff4aa1366f4904
2018-08-23 17:35:01 -07:00
Saurabh Singh
9f912dccda test-lfs-localstore: make test more robust
Summary:
This test fails on `OSX` with the following error:

```
  $ find $TESTTMP/remote | grep '/../' | sort
+  $TESTTMP/remote
+  $TESTTMP/remote/96
   $TESTTMP/remote/96/85eb765661ea3b95f31e1bb3c3b5501d0c2acdf353feeaa4d8fe32f95f77fb
+  $TESTTMP/remote/ab
   $TESTTMP/remote/ab/861dc170dc2e43224e45278d3d31a675b9ebc34c9b0f48c066ca1eeaed8ee6
```

This commit addresses that issue by only checking for the important paths.

Reviewed By: quark-zju

Differential Revision: D9491589

fbshipit-source-id: 42941b9a7b8ca0f9ac6df1ef85598e78d14e1355
2018-08-23 17:05:39 -07:00
Jun Wu
ff3111cced hgevents: move hg.transaction event to the extension
Summary: This was a review comment on D8003628. bolinfest is on PTO, so I fix it.

Reviewed By: wez

Differential Revision: D9444972

fbshipit-source-id: ecbaa6b7f8867e76274e5bd9700dd77f73d9545c
2018-08-23 15:36:03 -07:00
Wez Furlong
d5726c9caa retry watchman commands if we hit a UseAfterFork error
Summary:
as it states in the comments, we ideally wouldn't get
in this state, but if we do, let's try to recover and continue
a bit more gracefully.

Reviewed By: quark-zju

Differential Revision: D9445209

fbshipit-source-id: a08e605f37f85a9296f71d595f950bbf110e204d
2018-08-23 12:05:29 -07:00
Wez Furlong
94e1767dcd sync with pywatchman upstream
Summary:
Sync up with pywatchman changes; some of these are rather
old now :-/

Reviewed By: quark-zju

Differential Revision: D9440040

fbshipit-source-id: a19b53bb21ffcb8e2566bfa7461a636bf1b739aa
2018-08-23 12:05:29 -07:00
Jun Wu
e429e1d9c6 debugprocesstree: swallow osqueryi stderr
Summary:
osqueryi may print warnings to stderr. That's not expected to be shown to the
end user and breaks tests. Therefore send them to os.devnull.

Reviewed By: singhsrb

Differential Revision: D9482781

fbshipit-source-id: 240e6057a1b8bd49c93edeff3c79b749e209dc1e
2018-08-23 11:52:10 -07:00
Jun Wu
af0a2ecb8b lfs: add a config to skip writing to localstore
Summary:
We'd like to enable `lfs.url` on hg servers to make blob verification work
without downloading actual blobs. Previously, the LFS local blob store is
always backed by the local filesystem. D6699099 added a simple in-memory store
for another purpose. That in-memory local store fits the
"avoid downloading to disk" purpose. So let's add a config option to use it.

Reviewed By: zhh95

Differential Revision: D9478744

fbshipit-source-id: 69b04cd719cedb77f01b90b4666676c8f38584a1
2018-08-23 11:01:07 -07:00
Jun Wu
21c6b8ac47 extutil: make runbgcommand Ctrl+C safe
Summary:
There is a user report that a command was strangely forked into 2 processes:

The blackbox looks like:

  .... (no other "commit" command around this time)
  2018/08/21 10:57:03 c00b (33973)> commit
  2018/08/21 10:58:59 c00b (34191)> sl
  2018/08/21 10:58:59 c00b (34159)> pythonhook-pretxncommit: hgext.checkmessagehook.checkcommitmessage finished in 0.00 seconds
  2018/08/21 10:58:59 7b7a (34159)> commit exited 0 after 116.00 seconds
  2018/08/21 10:58:59 c00b (34191)> sl exited 0 after 0.39 seconds
  2018/08/21 10:58:59 7b7a (33973)> commit exited -1 after 116.17 seconds

It appears that pid 34159 was a fork of pid 33973. The fork and the original
process both end and mess up with the transaction framework.

The user did pressed Ctrl+C.  Looking at the code, I suspect extutil suffers
a same issue that I fixed for upstream worker.py [1]. So let's fix extutil
too.

[1]: 3176378509

Reviewed By: singhsrb

Differential Revision: D9438093

fbshipit-source-id: 66d72d5d1d2be89f078f391eac9bd7b21b4c176c
2018-08-23 10:35:54 -07:00
Liubov Dmitrieva
3e0958929c cloud sync: fix smartlog message for multiple checkouts
Summary:
the smartlog message notification about "cloud sync is running" was not working because srcrepo should be used instead of repo.
commit cloud is srcrepo based feature

Reviewed By: ikostia

Differential Revision: D9479775

fbshipit-source-id: a41852b86a8dea7c9d01ea0f31cecdcb0a2bc229
2018-08-23 06:34:53 -07:00
Jun Wu
d5391483e7 lfs: add a config option to disable LFS object verification
Summary:
The verification also runs client-side and that can cause issues with complex
treemanifest setups.

Therefore turn the verification off by default. It would be enabled on the
server-side.

Reviewed By: phillco

Differential Revision: D9478745

fbshipit-source-id: 299b9180c661023d8e2358eedeae7b5c7d36ab79
2018-08-23 00:35:16 -07:00
Jun Wu
66566b4a08 rage: use pager
Summary:
The output is still long. So let's use a pager.

This is better than `hg rage -p --pager=1` because the progress bar is
preserved.

Reviewed By: markbt

Differential Revision: D9443603

fbshipit-source-id: e2dbf9fa4de378a150e51bb2f3022463d7a344fd
2018-08-22 21:35:21 -07:00
Jun Wu
dcca731506 rage: add fstype
Summary:
The filesystem type field is useful to tell whether it's an eden repo or not
quickly.

Reviewed By: markbt

Differential Revision: D9443608

fbshipit-source-id: 60ca660ee297ca00e36a46d69c8823687fd2c576
2018-08-22 21:35:21 -07:00
Jun Wu
1b5f26b374 rage: do not print all configs
Summary:
All configs could be hundreds of lines. We're only interested in things that
are overridden. So let's limit the config to only include those chef overrides.

Reviewed By: markbt

Differential Revision: D9443604

fbshipit-source-id: e9903e79568bae99d03e19b5045b37336bc02095
2018-08-22 21:35:20 -07:00
Jun Wu
95957edcf2 rage: show progress bar per steps
Summary:
Show progress bar for each step so people know what information takes long to
collect.

Avoid using the "paste" word since with `-p` there is no paste.

As we're here, uncapitalize the message so it's consistent with the rest of the
code.

Reviewed By: markbt

Differential Revision: D9443605

fbshipit-source-id: 74672a1cf52d44289e438abeb1ca10019e37b531
2018-08-22 21:35:20 -07:00
Jun Wu
90cce90542 rage: include debugprocesstree output
Summary: This allows us to understand locking issues better.

Reviewed By: markbt

Differential Revision: D9443607

fbshipit-source-id: 47f3ddd04b9bfc21e15d136826b99093f83fb2bc
2018-08-22 21:35:20 -07:00
Jun Wu
3a1a154516 lock: suggest running debugprocesstree to figure out what's blocking
Summary: This would help people unblock themselves.

Reviewed By: markbt

Differential Revision: D9443602

fbshipit-source-id: f05e2b2390a88a9280149d2164c2d7ab71c29600
2018-08-22 21:35:19 -07:00
Jun Wu
98c4b5d665 debugcommands: add a "debugprocesstree" command
Summary:
Recently there are a trend of questions about repo being locked. People usually
don't have enough debugging skills to find out what's going on. So let's add a
debug command to help them.

The implementation uses `osqueryi`, which perfectly solves the cross-platform
process handling headache. Note the well-known `psutil` Python library does not
seem to provide parent process information on Windows.

The `_rapply` function was backported from upstream mercurial.

Reviewed By: markbt

Differential Revision: D9443601

fbshipit-source-id: d26b3adfde1045ebd5bca1c6b1c93f0db147f9b0
2018-08-22 21:35:19 -07:00
Jun Wu
e5681472dd progress: remove lockguard
Summary:
Python2 class objects cannot be released by refcount because [this bug](https://bugs.python.org/issue17950).
Defining a new class inside a method creates such a new Python object every
time that method is called.Since `lock` can be called frequently, avoid
creating that many classes.

The following code demonstrates different classes are created:

```
def getclass():
    class foo(object):
        pass

    return foo

print(id(getclass()))
print(id(getclass()))  # different id
```

Therefore let's remove the class. `threading.Condition` already works with
`__enter__` and `__exit__`.

See [localrepo: cache types for filtered repos (issue5043)](7e89bd0cfb)
for a workaround to a similar issue.

Reviewed By: markbt

Differential Revision: D9405723

fbshipit-source-id: 7aff44255a4ee2d7dba1e0fa394500a8c157507b
2018-08-22 15:23:37 -07:00
Kaley Huang
61aa294522 fix buck test
Summary: fix flaky buck test

Reviewed By: quark-zju

Differential Revision: D9465687

fbshipit-source-id: d27f1b8ed5d8eb0ffe15aa92400afc92dfd8238a
2018-08-22 12:26:02 -07:00
Kostia Balytskyi
819d195bc8 hg: add some platform-specific tests for encoding crate
Summary:
This just adds some more tests that in case of Windows try to execute the
string encoding APIs directly, while paying attention to the ANSI Code Page.

Reviewed By: quark-zju

Differential Revision: D9441406

fbshipit-source-id: c0873dca9fc8775839a62da60af46ff29e700634
2018-08-22 09:06:22 -07:00
Kostia Balytskyi
71baca5dfa hg: add osstring_to_local_bytes function to the encoding crate
Summary: Another convenience method that I plan to use in the `hgmain` later.

Reviewed By: quark-zju

Differential Revision: D9441426

fbshipit-source-id: 007e4932a344b9d1c8d4d654152bcca5c2362431
2018-08-22 09:06:22 -07:00
Kostia Balytskyi
1175b6b1c6 hg: extract platform-specific bits of encoding into separate files
Summary:
I think it's more readable to split the implementations into platform-specific
bits.

Reviewed By: quark-zju

Differential Revision: D9441424

fbshipit-source-id: 136d5a00aa4ed8cf4f0886bda0f77a40cba1f542
2018-08-22 09:06:21 -07:00
Kostia Balytskyi
fa882cf7da hg: make encoding create use ANSI code page, not OEM
Summary:
We almost never need an `OEM` code page: Windows API calls use ANSI-encoded
strings if they are `A` calls and Wide strings if they are `W` calls.

Reviewed By: quark-zju

Differential Revision: D9441425

fbshipit-source-id: 979697c349389ea4f7569be9949be3b636f6063c
2018-08-22 09:06:21 -07:00
Kostia Balytskyi
25a8ee686f hg: rename pathencoding into encoding
Summary:
In the later diffs I'll add some more functionality there, not strictly
related to encoding paths.

Reviewed By: quark-zju

Differential Revision: D9441427

fbshipit-source-id: 069ab30a24761038fa2c1a4f180bbc0699d38ef9
2018-08-22 09:06:20 -07:00
Mark Thomas
283c1fd469 undo: show a hint when a user might have wanted uncommit or unamend
Summary:
If a user uses `hg undo` to undo a `commit` or `amend` operation, this discards
the changes.  If they wanted to keep them in the working copy, they should have
used `hg uncommit` or `hg unamend`.

Provide a hint telling the user how to get back their changes, and letting them
know that `hg uncommit` and `hg unamend` exist.

Reviewed By: quark-zju

Differential Revision: D9346061

fbshipit-source-id: 300b1ac851a12ccf2432ba2c11fceac619667701
2018-08-22 03:50:55 -07:00
Jun Wu
dc42feebe8 test-run-tests.t: remove warning about entry point
Summary:
The warning was removed by D9436487. This diff should fold into that change.
Unfortunately buck test didn't run with run-tests.py changes. So lets fix it.

Reviewed By: singhsrb

Differential Revision: D9444368

fbshipit-source-id: 8e27ae14d56e559fc063d5500ebb789c4fe26545
2018-08-21 20:04:52 -07:00
Puneet Kaushik
9b9126c79f Started Eden for Windows and integrated hg store with it.
Summary:
This diff is first in the series to make Eden work on Windows. It includes:

1. HG backing store and Object store, which provides the capability to talk to mercurial and fetch the file and folder contents on Windows.
2. Subprocess and Pipe definition for Windows.
3. The Visual studio solution and projects files to compile Eden and scm datapack.

Few Important points:

1. Most of the changes to existing code is done under a macro EDEN_WIN so that it doesn't impact on other platform.
2. Sqlite is used for caching the fetched contents. We are not using Rocksdb on Windows.
3. The main function only calls some test code and exit after printing the output.
4. The initializeMononoke code is disabled for Windows because it needs Proxygen to talk HTTP. Will enable this once I get Proxygen and other dependencies working.
5. HgImporter pass Windows handles to hg_import_helper as command line args. The code to convert these handles into fds is in a separate diff.

Reviewed By: wez

Differential Revision: D8653992

fbshipit-source-id: 52a3c3750425fb92c2a7158c2c214a9372661e13
2018-08-21 17:51:26 -07:00
Wez Furlong
829e678a72 don't allow state-enter/leave event errors to block hg
Summary:
In these threads, our users are working around what is
either an invalid state transition on the hg side and/or slow
processing of the state transitions on the watchman side.

Since the state updates are purely advisory, we do not want to
block users in this case.

This doesn't address the root cause of this problem, it just stops
it from breaking our users.

Reviewed By: quark-zju

Differential Revision: D9437674

fbshipit-source-id: a2b0514a71e31ee7c92df1c24031b12a349822b5
2018-08-21 15:05:33 -07:00
Jun Wu
e082921ddc run-tests: remove warning about entry point does not exist
Summary:
It breaks test-runtests.t when running with buck:
https://fburl.com/testinfra/7ui6uffp

Reviewed By: singhsrb

Differential Revision: D9436487

fbshipit-source-id: caa01f5d5c2d60cd0bd197a1d1b6269e64c98df7
2018-08-21 13:35:26 -07:00
Jun Wu
f3718fc48d util: skip checkexec or checklink for wider file systems
Summary:
D9328199 made them skip eden mounts. This diff expands the whitelist to other
common filesystems.

Reviewed By: wez

Differential Revision: D9416599

fbshipit-source-id: 5f1dddf5a181833a2fa6e0954c2579bb5adcd170
2018-08-21 12:21:07 -07:00
Jun Wu
6df713c244 util: backport Windows getfstype implementation
Summary:
This is done by Matt Harbison at Yahoo. See
2062f7c2ac
for the original commit.

As we're here, also make the POSIX version report "eden" directly.

Reviewed By: wez

Differential Revision: D9416596

fbshipit-source-id: 812d02b35f149f9019c2307e6246a29c27c48cfe
2018-08-21 12:06:18 -07:00
Jun Wu
25eb53f3e7 alias: make resolution unaffected by definition order
Summary:
Previously, the alias resolution is affected by the alias definition order. So
things like:

  [alias]
  myglog = log -G
  myvlog = myglog -v

works. But

  [alias]
  myvlog = myglog -v
  myglog = log -G

doesn't. D8767902 changed ordering semantics and broke some people's aliases,
because if both `myvlog` and `myglog` are defined in system hgrc, their order
cannot be changed from a user hgrc.

Instead of having subtle behavior here depending on the order. Let's just do
not rely on the order. This diff makes it so, by resolving aliases using latest
(alias-if-possible) definitions, with only one special case: "foo = foo ..."
uses the original non-alias "foo" command.

The "alias ... shadows command ..." debug message was removed as it's
no longer accurate.

Reviewed By: simpkins

Differential Revision: D9417710

fbshipit-source-id: f4228eba3c8c728163a54bcf053c379fa86bd123
2018-08-21 12:06:18 -07:00
Liubov Dmitrieva
a51873a3fb cloud sync - add an option to specified a head to include
Summary:
this is an option to take into consideration only specified heads that run cloud sync

this is helpful to debug issues with individual stacks on push part of cloud sync

Reviewed By: quark-zju

Differential Revision: D9349821

fbshipit-source-id: c5220be3b30cfc300bf62bdcfc472368ce74104e
2018-08-21 10:51:39 -07:00
Kostia Balytskyi
b6f9443b79 hg: add comprehensive/.testtimes to .gitignore
Reviewed By: quark-zju

Differential Revision: D9421830

fbshipit-source-id: 3e105f15ea640c34e5127fa53475356c86b2ff72
2018-08-21 10:05:49 -07:00
Mateusz Kwapich
33e7f62a7a s/lockinforor/LockError
Summary:
D9004612 renamed locker to lockinfo and went a bit too far^^

It's already deployed and causing crashes t33048346

Differential Revision: D9422585

fbshipit-source-id: 3eecc24d12cd6cfca0f98b823fa315acfdb20e48
2018-08-21 09:50:38 -07:00
Liubov Dmitrieva
00e4efbf47 cloud sync: speed up it after hg hide and other repo modifications related to about obsmarkers only
Summary:
about 3-6 seconds speed up for cloud sync after hg hide (no ssh any more)

also to sync hg hide on another machine

Reviewed By: quark-zju

Differential Revision: D9403921

fbshipit-source-id: 56c1475dc104f6b13483db4bdb40dabd09a6400d
2018-08-21 09:35:41 -07:00
Liubov Dmitrieva
7d9365a359 cloud sync: backup token in the secret tool
Summary:
backup token in the secrets tool to easier recover it when move to another dev server

secrets tool is a distributed keychain

this will allow `cloud sync` and `cloud rejoin` to work even if .commitcloudrc file doesn't exists

we don't move to storing it in the secret tool only and read it from there each time because of overhead

Reviewed By: quark-zju

Differential Revision: D9399916

fbshipit-source-id: 571f31b323f09259f7e955780f662aad2b4a5c3e
2018-08-21 09:35:41 -07:00
Kostia Balytskyi
0598171436 hg: fix linux test failure
Summary:
Generally, it seems the `mercurial/entrypoint.py` approach might need some
more thinking, but in this particular case I'd prefer to just fix the tests.

Here's what's going wrong:
- D9407009 intoduced a logic to expect `mercurial/entrypoint.py` to always
exist under the `hg` installation on a *run-tests* level
- `run-tests.py test-run-tests.t` however runs `run-tests.py` (yo dawg), while
`hg` is a symlink to `$(which true)`
- while the `mercurial/entrypoint.py` script cannot be found by the test
suite in this case, it's not important becuase no real Mercurial is run.
Therefore, I propose to change `SystemExit` to `log`. On one hand, the absense
of `mercurial/entrypoint.py` is a big deal, so we should know about it. On the
other, this case can run completely without it. In the dominant majority of the
other test cases, we'll learn about the absense of `mercurial/entrypoint.py`
by means of the failing Mercurial call.

Generally, this migth require some more thought, but for now let's fix tests.

Reviewed By: lukaspiatkowski

Differential Revision: D9421433

fbshipit-source-id: e39628015ff96f27368b99ec1f99145c0cb1ae7b
2018-08-21 07:51:24 -07:00
Jun Wu
0e88e00ceb commit: auto revive committed commits
Summary: It makes no sense for newly committed commits to be obsoleted.

Reviewed By: DurhamG

Differential Revision: D9236660

fbshipit-source-id: 95e4076bb9acde67aaab95f25a6de27d761cd960
2018-08-20 23:24:50 -07:00
Jun Wu
005a60c6b5 histedit: do not always use real strip on --abort
Summary:
Similar to rebase, do not use unsafe strip for histedit.

This makes `histedit --abort` safer, faster, undo-able, and also solves
potential crashes using real strip with clindex.

Note `test-histedit-obsolete.t` shows a case that is suboptimal. It'll be fixed
by the next commit.

Reviewed By: phillco

Differential Revision: D9236662

fbshipit-source-id: e436b0aa9b4a1b155dcfb111c5618371b68232eb
2018-08-20 18:35:56 -07:00
Jun Wu
159468b58f run-tests: set HGPYENTRYPOINT explicitly
Summary:
The run-tests script symlinks hg to a place and sets `PATH` so `hg` can be
called from anywhere without requiring the local shell settings, including
"dummy-ssh" server side.

The Rust `hgmain` uses
`env::current_exe().parent().join("mercurial/entrypoint.py")` to locate
the `entrypoint.py` file. However, `env::current_exe()` does not follow
symlink on OSX, unlike Linux. Therefore the entrypoint.py cannot be located on
OSX.

`hgmain` also reads `HGPYENTRYPOINT`. So let's set it explicitly from
run-tests.py.

Reviewed By: singhsrb

Differential Revision: D9407009

fbshipit-source-id: db9a55e11b424625a6ab58afdbebf0944c7012f5
2018-08-20 17:05:24 -07:00
Kaley Huang
9d54d78caa verify LFS blobs were uploaded before push
Summary:
per @[1070541862:quark]'s suggestion, I attempt to add a verification hook that checks LFS blobs were uploaded before push.

The code execution path looks like this:
`command.py: push()` -->
`exchange.py: push()` -->
 ......
 `exchange.py: _pushbundle2()`
 `exchange.py: _pushcheckoutgoing()`
 ......

And I insert the hook in `exchange.py: _pushcheckoutgoing()`

Reviewed By: quark-zju

Differential Revision: D9212199

fbshipit-source-id: 98e016da81f9df85731771b7d486d03848624bcb
2018-08-20 16:51:07 -07:00
Jun Wu
b04dda41f1 hint: point people to gitignore QA page
Summary:
As requested by https://fburl.com/qw620t12.

Didn't add another option to make the message configurable as it'll eventually
be removed.

Reviewed By: singhsrb

Differential Revision: D9405366

fbshipit-source-id: 1aef69b4d01be976c3c4465cd542642e586599ca
2018-08-20 13:51:32 -07:00
Pavel Aslanov
8ed850dc2b fixes recording of: 1. correct repo_id. 2. full ontorev
Summary:
This change fixes two problems in pushrebase recording, that will be used to test mononoke pushrebase:
- record correct `repo_id`, it used to be always 0
- `ontorev` truncation, as we store rev as hex string we need 40 bytes instead of 20

Reviewed By: ikostia

Differential Revision: D9398009

fbshipit-source-id: 91add2d75fbb9acf32b99dc952c467d44c2ccbc9
2018-08-20 06:23:20 -07:00
Aida Getoeva
57eaddb3b9 loose files: packing loose files for local data
Summary: Packing loose files for local data into `.hg/store/packs`. Existing pack files for local data can also be repacked.

Reviewed By: DurhamG

Differential Revision: D9181106

fbshipit-source-id: 4d044e97178b4263b87404357445b43eb99017b3
2018-08-20 04:34:48 -07:00
Jun Wu
c601e242af rebase: do not always use real strip on --abort
Summary:
The real strip was used on purpose [1] as a workaround of the old obsstore
design where commits cannot be revived.

Since reviving commits is now possible. Let's avoid dangerous strip here.

This makes `rebase --abort` safer, faster, undo-able, and also solves an
issue where clindex crashes with real strip reported by @[839419353:jeroenv] at
https://fburl.com/uqfglmu5.

[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095572.html

Reviewed By: DurhamG

Differential Revision: D9236658

fbshipit-source-id: 9ae7089a8991d8d21ddc5e107c15b8374c7d7339
2018-08-18 10:51:57 -07:00
Jun Wu
51c92b569d hgext: use in-core revive API
Summary: No longer need to check inhibit.

Reviewed By: DurhamG

Differential Revision: D9236656

fbshipit-source-id: d05ec2ed2b2314ef7608c54df4f1653ca8b1b53d
2018-08-18 10:51:57 -07:00
Jun Wu
4791303cd2 obsolete: move commit reviving logic to core
Summary:
Reviving commits is an essential feature. So move it to core.

Most test changes are caused by the auto-date-bump behavior, which is needed to
revive commits automatically.

Note the existing code is not fully ready for the change. For example,
`precursors.get(node)`, `successors.get(node)` do not filter out markers that
are suppressed. For example, some code paths treat node as obsoleted if
`precursors.get(node)` is non-empty. That's no longer true.  markbt's
planned visibility change might clean up this area a bit.

Regarding on tests, most changes are because of the "auto bump date" feature.
The graphlog change in `test-obsmarker-template.t` is because it creates a
cycle, which behaves differently in the new code. Half of obsmarker exchange
tests break. Given the fact that we do not use and will probably rewrite the
exchange algorithm, related tests are deleted, including
`test-obsolete-distributed.t`.

Reviewed By: DurhamG

Differential Revision: D9236661

fbshipit-source-id: 85b983f8bd46dece908c05f56bea2abbc8ffbaf6
2018-08-18 10:51:56 -07:00