Summary: added test cases for clone and push to show how they interfere with selectivepull feature
Reviewed By: mitrandir77
Differential Revision: D16084217
fbshipit-source-id: 38774f8badfacfb9a8b2a911d2e4ae6a5cde7470
Summary:
always pull only accessed bookmarks and default, do not take remote books from `remotenames` file
also adding handling of `CorruptedState` error to delete `selectivepullaccessedbookmarks` file in that case. it will help mercurial not to crash in case the file was corrupted and self-fix next time.
Reviewed By: mitrandir77
Differential Revision: D16079548
fbshipit-source-id: a2983ee63fb17d2922f3c230c3d6e36aa6591b62
Summary:
Adding `filesync(fd)` (applies `flush()` and `os.fsync()` on fd) to make writes to the file more durable.
Before I ecountered the issue with on of the atomicfiles to have only zeros in it. markbt suggested that it could happend because of the system crashes, when the file size is still remembered but the content can be lost.
I first thought apply `filesync` only to that particular case, but decided to add into the `atomictempfile` implementation.
Reviewed By: mitrandir77
Differential Revision: D16078908
fbshipit-source-id: 5606b49aca766bf5f03fe4e763aa2c66c48ccac5
Summary:
# RFC, not sure if I know what I am doing but I know my goal as follow
In case of the entire `.hg/svn` missing, in order to get the subdir and uuid information,
hgsubversion needs to talk to svn server. In our cases, it's polluting our logging and
it's hard to know who is really using svn server.
In this diff I want to disable this by writing these 2 information directly in config
and hgsubversion will just read from there.
Reviewed By: mitrandir77
Differential Revision: D15989449
fbshipit-source-id: fd9cead094245b3c0baf6e7e1099cc302899668f
Summary: We need to log (and in debug mode print out) Eden API exceptions in several places in the code. Let's factor out this logic into a function in the edenapi module.
Reviewed By: xavierd
Differential Revision: D16027147
fbshipit-source-id: 76c8e97dcaaa114e0c22448d117caae948fb60f4
Summary:
The `notice` arg should be provided to `ui.warn`, not the translation `_`
function.
Reviewed By: xavierd
Differential Revision: D16055534
fbshipit-source-id: bb1e0213147fc591671c2ef4c79aab3f9e4a2987
Summary: I added remotebookmarks field to the References object earlier, but forgot to change object constructions in couple of places
Reviewed By: markbt
Differential Revision: D16052722
fbshipit-source-id: b0b46739a89c911541eababd35b5f43812e66c4a
Summary:
I don't think that testing the presence of parenthesis is also terribly
important, so let's just glob it all out
Reviewed By: farnz
Differential Revision: D16048857
fbshipit-source-id: d3691fe6460f2fc759c9dee2f929cc55c04c541c
Summary:
It seems possible to have both outputs:
--- test-fb-hgext-treemanifest-treeonly.t
+++ test-fb-hgext-treemanifest-treeonly.t.err
@@ -477,7 +477,7 @@
$ hg log -r 'last(public())' --stat
fetching tree '' 85b359fdb09e9b8d7ac4a74551612b277345e8fd
2 trees fetched over * (glob)
- fetching tree '' d9920715ba88cbc7962c4dac9f20004aafd94ac8, based on 85b359fdb09e9b8d7ac4a74551612b277345e8fd
+ fetching tree '' d9920715ba88cbc7962c4dac9f20004aafd94ac8, based on 85b359fdb09e9b8d7ac4a74551612b277345e8fd, found via 2937cde31c19
2 trees fetched over * (glob)
changeset: 4:2937cde31c19
parent: 0:2278cc8c6ce6
@@ -598,7 +598,7 @@
$ hg log -r tip -T '{desc}\n' --stat
fetching tree '' 83b03df1c9d62b8a2dedf46629e3262423af655c, based on d9920715ba88cbc7962c4dac9f20004aafd94ac8, found via 4f84204095e0
1 trees fetched over * (glob)
- fetching tree '' bd5ff58fa887770ff0ea29dde0b91f5804cdeff0, based on 83b03df1c9d62b8a2dedf46629e3262423af655c, found via 4f84204095e0
+ fetching tree '' bd5ff58fa887770ff0ea29dde0b91f5804cdeff0, based on 83b03df1c9d62b8a2dedf46629e3262423af655c, found via 5b1ec8639460
2 trees fetched over * (glob)
Just mask out the changes to stabilize it.
Reviewed By: xavierd
Differential Revision: D16044382
fbshipit-source-id: c22cb28512f270bb2b5bed264988b6939afeed65
Summary:
The test was flaky because there are errors about time selection. Extending the
"end time" by 1 second to fix it.
Reviewed By: xavierd
Differential Revision: D16044383
fbshipit-source-id: ab929f5f212cec88aa9e9254dd58e696b20d75f8
Summary:
With simplecache disabled globally, simplecache needs to be explicitly enabled
for this test to work.
Reviewed By: xavierd
Differential Revision: D16044111
fbshipit-source-id: 47e913787804a485012ffa3ddade54909c5de229
Summary: Use the `StatusCode` type from the `http` crate to represent HTTP status codes rather than using a plain `u32`. This has the advantage of including the canonical description of the error in the `Display` output of the type, so the user doesn't need to look up the meaning of the particular HTTP status code.
Reviewed By: xavierd
Differential Revision: D16024749
fbshipit-source-id: f2325111d5ca647b193fe8c5fa4a270f890fdbee
Summary: When addressing comments on D15640718, I forget to update the test.
Reviewed By: DurhamG, xavierd
Differential Revision: D16036450
fbshipit-source-id: 7eaba2f5a0c11ef87c6b03d1ecf0016ea5e8a937
Summary:
simplecache was already disabled via configuration. This diff disables it in
code. It affects caches.
Reviewed By: xavierd
Differential Revision: D16036295
fbshipit-source-id: 50df791e5c18fe19ad4c8b63da97f6862f150942
Summary:
By default, simplecache puts its local cache in a global location that persists
across test runs. That can cause surprises. Change the location to be inside
$TESTTMP under tests.
Reviewed By: xavierd
Differential Revision: D16036296
fbshipit-source-id: c73b573b87d49798f4ad146a1c0a559f5d94caf1
Summary:
On Windows, fp.tell() might return unreliable data for files with mixed reads
and writes.
Reviewed By: xavierd
Differential Revision: D16035564
fbshipit-source-id: d6cbb018e2664dd1e4323c52e7b0c73df07d7796
Summary:
`util.fdopen` now adds workarounds for read+write+seek files on Windows.
This should solve issues we have seen on Windows behaviors.
See https://www.mercurial-scm.org/repo/hg/rev/3686fa2b8eee for the Windows weirdness.
Here is a minimal program to reproduce the weirdness:
```
import os
f = open("a.txt", "wb+")
# Write 12 bytes
f.write(b"b" * 12)
# Read byte slice 2..5
f.seek(2, os.SEEK_SET)
data = f.read(3)
# Try SEEK_END
f.seek(0, os.SEEK_END)
print("%d (expect 12)" % f.tell()) # got 5 using some python.exe
```
Reviewed By: xavierd
Differential Revision: D16033678
fbshipit-source-id: 4f17c463d9bfcc0cdd38d1b15f2a9e38e5b4c132
Summary:
`os.fdopen` lacks of fixes in https://www.mercurial-scm.org/repo/hg/rev/3686fa2b8eee.
Add a patched version of `fdopen` to solve it.
Reviewed By: xavierd
Differential Revision: D16033679
fbshipit-source-id: 99053c05fd062feb21711aa5d6dad56014535fc1
Summary:
Add more shortcuts to common modules.
This make it easier to test changed code paths.
Reviewed By: markbt
Differential Revision: D15952263
fbshipit-source-id: c0eca6a61902d36a26a99f85e29dc70f431eca59
Summary: Rename `ApiErrorKind::BadCreds` to `ApiErrorKind::BadCertificate`. This makes it clearer to users who see the error name in log output that the problem is with a TLS client certificate, since "credentials" is otherwise pretty broad.
Reviewed By: xavierd
Differential Revision: D16024751
fbshipit-source-id: 1dea342036519a33dc48abaa41ab891be1a3637d
Summary:
The changes from commit cloud sync are supposed to be applied in-memory and committed with cloudsync-transaction to the disk. For example, for bookmarks the changes first are applied to the existing dict of bookmarks and with the transaction are being written to the disk into the `bookmarks` file.
Ideally I need to have similar thing for remote bookmarks. However, the current implementation provides of remotenames only read-only store with only possibilty to change something on the disk (`remotenames` file) and upload it to memory.
We're planning to rewrite the whole extension at some point, but currently to move forward I added a new method to the store, which will apply changes to the `remotenames` file and reload the remotenames store.
It's not transactional and uses existing function `saveremotenames`, which I refactored a little bit, so it could apply changes for multiple remotes at the same time. I also removed deletion of `remotedistance` file as it is deprecated and not used a long time.
Reviewed By: markbt
Differential Revision: D15921983
fbshipit-source-id: d6b2638db689c0c1b66a6291fc9f0f2c9dac978c
Summary:
Added implementation of the remote bookmarks merging.
1. If remote books changed in cloud since the last sync and local didn't, then local remote books will be updated with the cloud changes.
2. If otherwise, cloud remote books are the same and local are different from the last sync, then the local changes will be submitted to the cloud.
3. If both local and cloud remote books changed from the last sync, the merging becomes more difficult. There are several cases for what particular changes could be. The current implementation is the first and simpliest, so some of the decisions I made here may be improved later.
3.1. If both changed and not deleted, then the local remote book will be updated to the newest node between local and cloud's.
This is not always a correct state. For example, the local remote bookmark's commit is newer (further in the stack), but the bookmark was moved back in the stack on the server and the cloud now has this bookmark on the older commit. After syncing the local book will be kept as it was before and it's node will be submitted to the cloud.
However it's not that bad, as after `hg pull` it will point back to the right revision.
3.2. If one changed and another was deleted. There are two case when it could happen: (a) the bookmark was deleted on the server, (b) the client unsubscribed from the remote bookmark (functionality is not implemented yet). The current implmentation will just keep local remote bookmark as it is if it was deleted in the cloud and submit changes back to cloud.
Reviewed By: markbt
Differential Revision: D15899944
fbshipit-source-id: b17ca4d01fd1a1230d74588e2b9ca5c6d58df751
Summary:
Made changes to the commit cloud sync to support remote bookmarks. Here I only declared steps of future remote bookmarks sync and will add the implementation further in the stack.
Processing a merge state between cloud remote bookmarks state, last sync and local state is done earlier in the workflow, than, for example, for local bookmarks, because to update remote bookmarks we may need to fetch new public heads from the server and so need to get them first.
Reviewed By: mitrandir77
Differential Revision: D15898740
fbshipit-source-id: ca77f66b0f1244a811b4b549e5b189c5f1772708
Summary: Adding support of remote bookmarks to the get/set references of Commit Cloud client service.
Reviewed By: mitrandir77
Differential Revision: D15852515
fbshipit-source-id: 9d5331955f5fc95ecb4bfe8e060d3b1d67952a41
Summary:
PYTHONPATH is no longer a thing on Windows. Let's not rely on it
for our `heredoctest.py`-based tests
Reviewed By: mitrandir77
Differential Revision: D16028830
fbshipit-source-id: ae66d9cf194c7e3c15e44a81a18dfeeb4b68e281
Summary: When Eden API falls back to SSH, log the exception type and message (in addition to the traceback) to the `hg_errors` table. Note that previously, we were attempting to log the error message but failing because we were using the wrong column name. (`msg` instead of `exception_msg`).
Reviewed By: xavierd
Differential Revision: D16014833
fbshipit-source-id: 06460574f66999b1293ea31b43b5c7ec89737144
Summary: `hg debugedenimporthelper --get-file-size PATH:REV` will print the size of the given file
Reviewed By: chadaustin, xavierd
Differential Revision: D16009279
fbshipit-source-id: 6edb01dd154a467cdd26c0ced1d4ae82411088f1
Summary: Now that Eden API returns specific exception types rather than always raising a `RuntimeError` when things go wrong, the fallback path needs to be updated to catch all exception types, not just `RuntimeError`.
Reviewed By: xavierd
Differential Revision: D16013115
fbshipit-source-id: d5c2d88acede7e70519eda8915401bb8ee394038
Summary: This was causing `Popen` to crash, since `env` had non-strings (`NoneType`)
Reviewed By: mitrandir77
Differential Revision: D16009578
fbshipit-source-id: cbed384b7d773e3de23f9a8920d85296c5deec85
Summary: If `subprocess.Popen` crashes, the lock is never released.
Reviewed By: mitrandir77
Differential Revision: D16009579
fbshipit-source-id: e27137826ffb29aa1f497a3c4c85160b183f2a51
Summary:
`--fixup` is not really a great flag name and it came from a legacy
implementation. Suggest `restack` instead.
Reviewed By: kulshrax
Differential Revision: D15978952
fbshipit-source-id: 4e8c2e79be01f6d8f13628409a446d42ae22c0af
Summary:
See the test change for what this change is about.
The new code has side effect on linearizing things for `<rebase_src>::`. This
is reflected on the second last test change. The new behavior is arguably more
desiable - The new code can fail if rebasing D onto C2 causes conflicts. If
that happens, and rebasing C+C2+D onto the new B does not cause conflicts, then
the old behavior is better. We can add fallback code to the old behavior if
there are conflicts later, by calling a plain `rebase` instead of `restack`.
Reviewed By: kulshrax
Differential Revision: D15978953
fbshipit-source-id: 20b9d62c6125ce2faf8e21bd86f6aad31ac38a0c
Summary: This allows the callsite to control what revs to rebase.
Reviewed By: kulshrax
Differential Revision: D15978954
fbshipit-source-id: 73174475411c3986f3a8e93a1a61ce5b857f454b
Summary:
I run into this frequently and it's pretty annoying. Basically, amending X
tries to rebase things that are outside `X::`, which is unexpected.
Also, rebasing commits outside `X::` can easily fail due to conflicts. That
rollbacks the *entire* transaction. It'd be better if it only rolls back
the transaction rebasing a single branch.
I have a stack like:
o 86685181 79 minutes ago quark D15755281
| [hg] logging: log ui.write blocked time
|
o 218029b5 79 minutes ago quark D15755284
| [hg] logging: log ui.prompt blocked time
|
o da4d16a3 79 minutes ago quark D15755283
| [hg] logging: migrate crecord "blocked" logging to new API
|
o 6d0574e1 Today at 15:17 quark D15710672
| [hg] logging: migrate fsmonitor to new blackbox API
|
o
.
.
o 388aabb8 Today at 11:41 quark D15685475
| [hg] blackbox: add pattern matching for filtering events
|
| o e7d08fbd Today at 11:41 quark D15710677
| | wip
| |
| x 55895cb8 [Rewritten into 6d0574e15334] Today at 11:41 quark D15710672
| | [hg] logging: migrate fsmonitor to new blackbox API
| |
| | o de3b561f Today at 11:41 quark
| | | wip
| | |
| | o 5898b7a0 Today at 11:41 quark
| | | wip
| | |
| | x 478da1be [Rewritten into 55895cb88484] Today at 11:41 quark D15710672
| | | [hg] logging: migrate fsmonitor to new blackbox API
| | |
| | x e7c5c7d3 [Rewritten into e7d08fbdb3e0] Today at 11:41 quark D15710677
| | | [hg] blackbox: add more event types
| | |
| | x 7d715385 [Rewritten into 55895cb88484] Today at 11:41 quark
| |/ [hg] blackbox: add fsmonitor event
| |
| x c9a01966 [Rewritten into 00c67719c09d] Today at 11:41 quark
| . [hg] blackbox: change session id to u64
| .
| x b4a0a8ab [Rewritten into 388aabb8f9f6] Today at 11:41 quark D15685475
|/ [hg] blackbox: add pattern matching for filtering events
|
o 708540a9 Today at 11:41 quark D15685471
[hg] blackbox: add Event::to_value
The current behavior rebases the wip commits when amending commits on the top
like 6d0574e1. It always causes conflicts and rolls back the entire rebase.
Reviewed By: kulshrax
Differential Revision: D15978955
fbshipit-source-id: 1573407958fec647fca4ca261f6807cd8eae9803
Summary: When the Eden API Rust client raises a CredsError exception, print out a configurable error message to the user (defined by the `edenapi.badcertmessage` config option). This allows us to provide specific instructions on how the user should renew their certificate.
Reviewed By: xavierd
Differential Revision: D15992903
fbshipit-source-id: 8316e33c3a5d86da272deea6402271d4a65548f4
Summary: The future is the Rust stores, not C ones.
Reviewed By: kulshrax
Differential Revision: D15993202
fbshipit-source-id: fbdb796eafcfdaccd1f98177e83a5c0a851bee5a
Summary:
We've had these 2 options turned on for a while now. Let's stop pretending
we'll switch them off, and just hardcode them over the codebase.
Some places are still using either the C code, or the Python one explicitely,
future changes will switch them to the Rust code.
Reviewed By: kulshrax
Differential Revision: D15981631
fbshipit-source-id: c23e474a84e887a2b92c9a304d63ef8d680cdf2d
Summary:
The requirements field is only interesting for non-remotefilelog or
generaldelta repos. Nowadays it's probably safe to assume clients are
remotefilelog and "requirements" is less useful.
Reviewed By: xavierd
Differential Revision: D15710676
fbshipit-source-id: 65f04b64760c652432471c4a8dda7acc4cf45466
Summary:
The in-core blackbox command displays blackbox entries in the given time range.
The `blackbox` command provided by the blackbox extension was removed. They
can still be accessed via `.hg/blackbox.log`, though.
Tests are updated. Most `| grep` patterns were changed to use structured pattern
matching `--pattern` instead. Tests that are not interesting (ex. bundlebackup,
since we are moving away from bundle files slowly) are just removed.
Reviewed By: markbt
Differential Revision: D15640718
fbshipit-source-id: 7e5da60ca2b15ae9495d0242b340a066979d5a4f
Summary:
Add a `mercurial.blackbox` module which just delegates to the Rust
binding. This means blackbox is no longer optional.
Change `ui.log` to log to the native blackbox as `LegacyLog` event.
The plan is to slowly migrate users from `ui.log` to `blackbox.log`,
which supports well-defined event types (instead of `LegacyLog`).
This does not change the `blackbox` command, which still uses the
legacy blackbox implementation. That will be changed in a later diff.
Reviewed By: markbt
Differential Revision: D15640720
fbshipit-source-id: de171f46e1430060083c9b7aee0a96dde315d021