Commit Graph

19959 Commits

Author SHA1 Message Date
Jun Wu
e0afcd18bd log: partically rewrite _makelogrevset to be less cryptic
Summary:
The `_makelogrevset` feels cryptic, partially because its use of `opt2revset`
and related logic for adhoc revset expression calculation.

This diff removes `opt2revset` and related logic, so:
- `opts` is no longer both input and output. It's only input. The output is a
  different variable.
- Use `revsetlang` APIs to format revset strings directly, without going
  through an indirection via `opts`. Avoid `repr` or `a % b` formatting.
  Note: `%d` is formatted as `_intlist(v)` instead of `rev(v)`.

The new code generates slightly simpler revset expressions with less `()`s
(or "group" in revsetlang AST).

Reviewed By: zzl0

Differential Revision: D45936983

fbshipit-source-id: 3155016a85fa9ea61f9334a2d1fc82eac5450fec
2023-06-06 11:13:25 -07:00
Jun Wu
b49ad5cac6 revset: kill _firstdescendants
Summary:
It's already the same as `descendants` in our current implementation.
It's non-trivial to implement efficiently and is rarely used. So let's just
remove it for now.

Note the order of children of a commit is undefined, unlike parents. If we want
to provide a "meaningful" order and implement this in the future we might want
to use commit date etc to sort children.

Reviewed By: zzl0

Differential Revision: D45936979

fbshipit-source-id: bff72a130a5ffb7c573f06374da8f9c02791049f
2023-06-06 11:13:25 -07:00
Jun Wu
1064ae23d4 revsetlang: add %v format for variadic args
Summary: Used by the next change.

Reviewed By: zzl0

Differential Revision: D45936988

fbshipit-source-id: f2edee33bfefe3e5dd90a3cd7bc157d3b537cc0f
2023-06-06 11:13:25 -07:00
Jun Wu
aa8409d980 revsetlang: add "formatlist"
Summary: Useful to chain a list of revset together.

Reviewed By: zzl0

Differential Revision: D45936980

fbshipit-source-id: 1775cd472e239f56971d0b441aae3e416852ea3f
2023-06-06 11:13:25 -07:00
Jun Wu
6ec291990b log: mark "--branch" as deprecated
Summary: Named branches are removed in our implementation. Clean them up in the log command.

Reviewed By: zzl0

Differential Revision: D45936987

fbshipit-source-id: 98d3df01b1f3db53861f886289cb720dccf0535a
2023-06-06 11:13:25 -07:00
Jun Wu
5020be072f log: drop "cannot follow nonexistent file" message
Summary: It's not used anywhere. This removes a dependency on the legacy filelog.

Reviewed By: zzl0

Differential Revision: D45936981

fbshipit-source-id: 1c3af8dc792454d1bf893e922c1c37c80fa0a79b
2023-06-06 11:13:25 -07:00
Jun Wu
e8d0a21746 repo: add storage_format API
Summary: This can simplify logic that checks a bunch of repo requirements.

Reviewed By: zzl0

Differential Revision: D45936978

fbshipit-source-id: eec8ca0035642bf2324782b7fb7e97cb740cc02d
2023-06-06 11:13:25 -07:00
Mateusz Kwapich
28c9cdda53 add make unlink command support more blobstores
Summary: We need that for optimizing our storage.

Reviewed By: RajivTS

Differential Revision: D46362446

fbshipit-source-id: d81973cd05cffdc78ad84da867fa4791efea877c
2023-06-06 08:32:15 -07:00
Rajiv Sharma
17c0fe0da2 Mirgrate away from BlobRepo in StatisticsCollector tool
Summary: As in title. Once `BlobRepo` has been removed from this tool, I will also migrate it to the new `Mononoke Admin`

Reviewed By: mitrandir77

Differential Revision: D46444744

fbshipit-source-id: 059623d32d608f852254f16f811bcaf4e6bf3b4a
2023-06-06 02:48:35 -07:00
Jeremy Fitzhardinge
86c075fca5 third-party/rust: update to text_placeholder 0.5
Summary: This includes PR 7 so drops the patch.

Reviewed By: zertosh

Differential Revision: D46451758

fbshipit-source-id: 5df8ccbfa610eab470744e28b5bffe411a983996
2023-06-06 00:44:17 -07:00
Barys Skarabahaty
0a29c16672 Remove default ctor from BlobMetadata
Summary: Removing the previous default ctor to ensure that we always compute and pass blake3.

Reviewed By: chadaustin

Differential Revision: D46268716

fbshipit-source-id: d9bfbc7bfd07b61dbb2e915c3fe72d7526d919e1
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
8099af29e0 Add getBlake3 method to eden service
Summary: Adding a method to retrieve blake3 hash for a list of files.

Reviewed By: chadaustin

Differential Revision: D46268718

fbshipit-source-id: 59cb3d25a1d059a7e9b6a4da784a820945ffbd32
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
7dba15317f Expose blake3 via file attributes
Summary: Expose blake3 via file attributes and changing some integration tests accordingly. Added blake3_sum so that it could be used to verify blake3 hashes and updated the tests to work with blake3.

Reviewed By: chadaustin

Differential Revision: D46307686

fbshipit-source-id: 6f2a4e8e25757862ef17d56f92b90a95c7f5a474
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
25b673f8d0 Integrate with virtualInode
Summary: Integrating blake3 with virtual inode.

Reviewed By: chadaustin

Differential Revision: D46268717

fbshipit-source-id: c513a71e81691c43b0eada26aa5f1325a79db07b
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
fd3ab81bd3 Add blake3_sum
Summary: This utility binary could be used from the integration tests to compute blake3 hashes as it is easier to have it than adding the python pypi package with native dependencies.

Reviewed By: chadaustin

Differential Revision: D46307685

fbshipit-source-id: 1c48c689312cd9a04a19a62ad02ae3e9185041e5
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
d6dd01b37a Make LocalCachedBackingStore being able to compute blake3
Summary: If backing store doesn't provide a blake3 hash then we should be able to compute and cache it on demand.

Reviewed By: chadaustin

Differential Revision: D46316187

fbshipit-source-id: 9b77368ac5bb351d0edd80274b280692f8e1f774
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
4fca53249d ThriftUtil to support blake3
Summary: Adding some util functions to ThriftUtil to support blake3

Reviewed By: chadaustin

Differential Revision: D46268709

fbshipit-source-id: 1bc7b7b02ecb121e10e4b15036aa645466e7f762
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
6dc04add37 Integrate with TreeEntry and stores
Summary:
Adding blake3 support into TreeEntry and backing stores.

Note: Http and RE CAS stores don't provide blake3 hash so far. While it would be pretty easy to add support for RE, not sure how hard it would be for the http store.

Reviewed By: chadaustin

Differential Revision: D46268715

fbshipit-source-id: db66e63fe0348eb582a8050f22cdc0ff720ccf85
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
087566da69 Expose blake3 via aux and tree structures
Summary: Exposing blake3 from hg to eden

Reviewed By: chadaustin

Differential Revision: D46268710

fbshipit-source-id: 5f34b5f9586cc8c9507cc987378dc172959b4079
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
32a9f5eac5 Adding blake3 support
Summary:
Adding blake3 into the `Entry` and `Info` objects to make it possible to retrieve blake3 hashes.

The FileNode part will be integrated in the next diff

Reviewed By: chadaustin

Differential Revision: D46268719

fbshipit-source-id: b787b583e5abb3ed306fd1870f96bbdbc9fc0711
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
c663f1d624 Add blake3 support to FileHash utils
Summary: Adding blake3 support to the FileHash util that is used to compute hashes on Windows.

Reviewed By: chadaustin

Differential Revision: D46268714

fbshipit-source-id: cdca3dced494b1f37841121df09351acfdd6c745
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
66dee790bd Make it easier to use blake3
Summary: Frequently we will be operating with the blake3 key that is represented as `std::optional` so making it is easier to initialize blake3 appropriately.

Reviewed By: chadaustin

Differential Revision: D46268711

fbshipit-source-id: 2b9882683e79de2325d23353a4ca7260f3853f47
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
6cbc51fa1c Add Blake3 support to ObjectStore
Summary: Adding blake3 support to the Object store.

Reviewed By: chadaustin

Differential Revision: D44503947

fbshipit-source-id: 5112856576375a6fc0e697fa022506406844700a
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
3ae264c71c Add blake3 support to Serialized blob metadata
Summary:
Adding blake3 support to SerializedBlobMetadata.

* The serialized data is stored as:
   * - version (1 byte, big endian)
   * - blob_size (up to 10 bytes, big endian)
   * - used_hashes (1 byte, big-endian)
   * - hashes stored in order of their type values e.g. from less significant
   to more significant
   * - hash (N bytes)
   ...
   * - hash (M bytes)

Reviewed By: chadaustin

Differential Revision: D44500908

fbshipit-source-id: d64081db8591f85be5cdf3fd98ff9839c028d5fb
2023-06-05 23:41:35 -07:00
Barys Skarabahaty
306c59197a Add blake3 to blob metadata
Summary: Adding blake3 to the blob metadata

Reviewed By: chadaustin

Differential Revision: D44500745

fbshipit-source-id: 41809051b1d45b1512427f5fa830af3a9941148a
2023-06-05 23:41:35 -07:00
Muir Manders
716f8162d4 fix test-rename-merge2.t
Summary: Byte offset in error depends on environment.

Reviewed By: sggutier

Differential Revision: D46468819

fbshipit-source-id: 971f0655d88a9b76f1250e87d85d97a7d5be8828
2023-06-05 20:23:59 -07:00
Zhaolong Zhu
0ca377ce38 revset: add '-' for old working copy parent
Summary: Use `-` for old working copy parent, so we can easily go back to the previous working copy parent with `hg go -`. This is similar to `cd -` to go back to the previous folder.

Reviewed By: quark-zju

Differential Revision: D46368217

fbshipit-source-id: ab51992f8dde66a7535ba673892bbb6c0f01ecec
2023-06-05 18:47:04 -07:00
Shayne Fletcher
906e591ec8 codemods to remove lazy static 1/N
Summary:
first in a set of diffs with the intent of removing `lazy_static!` from fbcode.

this diff changes `std::sync::Mutex` and `parking_lot::Mutex` to plain `static` initializations where possible.

Reviewed By: zertosh

Differential Revision: D46335784

fbshipit-source-id: 105848f38dcb8083be77a4ad4db267058081fe53
2023-06-05 17:01:50 -07:00
Michael Christensen
1ffac63e6d debugnamecomplete: show 9 digits for autocompleted rev numbers
Summary: Show 9 characters for autocompleted revs, to match rev numbers shown in e.g. `hg sl`. This makes it a little easier to verify the rev that was autocompleted for you matches the one you were looking at in the smart log (i.e. if you're looking at the end of the rev rather than the beginning).

Reviewed By: zzl0

Differential Revision: D46398818

fbshipit-source-id: 70f19d60df7aa85371e1c1838b362b621da5b493
2023-06-05 11:12:48 -07:00
Saul Gutierrez
9b36c19d6d delete unused shutil import
Summary: This library doesn't seem to be used anymore in that file, so seems to be safe to delete it

Reviewed By: zzl0

Differential Revision: D46433066

fbshipit-source-id: 7c522b99048130f2ecd996e6ba901b5e5cccad2b
2023-06-05 10:54:44 -07:00
Andres Suarez
bef7ae79d2 Update openssl from 0.10.35 to 10.10.54
Reviewed By: dtolnay

Differential Revision: D46432065

fbshipit-source-id: 6a6c20e8b82accd9fe0dd4fc04d1d85a30dfa3e5
2023-06-05 06:35:30 -07:00
Youssef Ibrahim
40e9993707 delete reachabilityindex directory
Summary: saintelmosfire

Reviewed By: liubov-dmitrieva

Differential Revision: D46109912

fbshipit-source-id: 2c2f6a65164471b5fc7c1668e4577fb39ef58091
2023-06-04 23:27:57 -07:00
Youssef Ibrahim
448eafe8fb commit_graph: delete RangeNodeStream
Summary:
saintelmosfire
Will only land this after D45356044 is landed and tested.

Differential Revision: D45356043

fbshipit-source-id: 068aa45e1edd954b8ba5dc3355f9392ab06419b5
2023-06-04 23:27:57 -07:00
Youssef Ibrahim
1960074205 delete DifferenceOfUnionsOfAncestorsNodeStream
Summary: :)

Reviewed By: Croohand

Differential Revision: D45607812

fbshipit-source-id: ff65cc7850d2d538d014a414e43ef54b51d265e2
2023-06-04 23:27:57 -07:00
Youssef Ibrahim
8a8519f5d2 remove DifferenceOfUnionsOfAncestorsNodeStream from getbundle_response
Summary: :)

Reviewed By: liubov-dmitrieva

Differential Revision: D45607811

fbshipit-source-id: 2f6fbe6975b1ba3592a80268f41cbe2181c11c13
2023-06-04 23:27:57 -07:00
Youssef Ibrahim
ba0a8baf2e remove usages of DifferenceOfUnionsOfAncestorsNodeStream (except in getbundle_response)
Summary: :)

Reviewed By: markbt

Differential Revision: D45053470

fbshipit-source-id: 9e4dc4f92183b5369444e4e861a19614ba945fe3
2023-06-04 23:27:57 -07:00
Muir Manders
3f3bb6df3e filemerge: integrate merge tool script into tool selection
Summary:
Now we interpret merge tool specifications as "merge tool scripts" and evaluate them in the context of each conflicting file. This allows the merge tool script to use a different underlying tool depending on the type of conflict. For now, the only test the script can do is whether the file was deleted on one side.

In particular, we evaluate merge tools specified via "--tool", "HGMERGE", "ui:merge" config, and "merge-patterns" config.

Note that some existing valid inputs are invalid merge tool script (e.g. "--tool '/bin/sh do_something'"). It's invalid because of the space, among other potential reasons. I don't think this is common, but to work around it we let the input through un-intrepreted if it doesn't contain "if(" (i.e. doesn't look like a merge tool script that needs evaluating).

Reviewed By: quark-zju

Differential Revision: D46163268

fbshipit-source-id: 8a3d4b799e7f8d1d36bcc21035d7310de3d30ddb
2023-06-04 22:40:24 -07:00
Muir Manders
ac8e8b1813 filemerge: add wrapper for merge args
Summary:
Add a wrapper that contains the three file contexts. This will be used in next commit to simplify integration of "merge tool script" tool selection.

I tweaked the debugpickmergetool to allow specifying whether the local or other fctx is absent rather than the less specific "changedelete".

Reviewed By: quark-zju

Differential Revision: D46163269

fbshipit-source-id: 184ca01ca9dc3bdf80d2ec23f2e0a3f1d745f581
2023-06-04 22:40:24 -07:00
Muir Manders
e955a5eda2 filemerge: add start of simple merge tool DSL
Summary:
A user wants to use a different merge tool for delete+modified conflicts. The current merge tools are not flexible or composable enough to handle this. For example, even if we added a ":delete-keep-local" tool, there is no way to specify the fallback merge tool to use for other kinds of conflicts.

In this diff I introduce a simple DSL to solve the above problem. I called it "merge tool script". It only supports the "if" function, and "isabsent" to test of the "local" or "other" file context is absent/deleted.

Reviewed By: zzl0

Differential Revision: D46163270

fbshipit-source-id: 28f2579e665dc9dd66ab816b10e0b7a758e772f5
2023-06-04 22:40:24 -07:00
Muir Manders
67ef3afc23 parser: factor out string parsing
Summary: Move string parsing code from revsetlang.py into the parser so other langs can use it.

Reviewed By: zzl0

Differential Revision: D46194125

fbshipit-source-id: cb8c829ceb52a829a831a33b4265410ef704fef9
2023-06-04 22:40:24 -07:00
Muir Manders
1fd96b9a1d merge: remove v1 merge state
Summary: v1 and v2 have both been written out forever, so I think we can drop the v1 format.

Reviewed By: zzl0

Differential Revision: D46075828

fbshipit-source-id: 373dae9cf6a53534489022716986aa85b5de5552
2023-06-04 21:54:48 -07:00
Shayne Fletcher
4ea1ce14a8 upgrade to parking_lot-0.12.1
Summary: upgrade parking_lot from version 0.11.2 to version 0.12.1

Reviewed By: zertosh, diliop, dtolnay

Differential Revision: D46398501

fbshipit-source-id: ffae0ea188abad5253f1524216dd18ce9a53a74c
2023-06-02 18:45:03 -07:00
Rajiv Sharma
0443bba2cf Migrate check_git_wc command to new Mononoke App
Summary: As in title

Reviewed By: mitrandir77

Differential Revision: D46354685

fbshipit-source-id: 2a3e7e86772c71aed18cc6c83c31767c7454d65c
2023-06-02 12:00:47 -07:00
Andres Suarez
51fc649c56 unfork and update toml-5
Reviewed By: jsgf

Differential Revision: D46369474

fbshipit-source-id: 2905c96f24f3a6963c69ed89572ce36e564443d6
2023-06-02 08:04:49 -07:00
Rajiv Sharma
11982fe8da Log create_bookmark error in gitimport
Summary:
In D41769964, we decided not to stop `gitimport` simply because `create-bookmark` fails cause that could be due to the fact that the bookmark being created already exists. If that is indeed the case, we try to resolve the bookmark and move it to the new value. However, there could be other unrelated reasons for `create_bookmark` to fail in which case we would still try to resolve the bookmark and end up in unexpected situations (e.g. Luibov trying to import `paws` repo faced this problem). This diff does two things:
- Performs an early check to determine if the bookmark exists by resolving it. If it does exist, it executes the move bookmark branch of code
- If the bookmark doesn't exist, then it creates it.

If there are any errors during bookmark creation or movement, they get logged for the user.

Reviewed By: mitrandir77

Differential Revision: D46071703

fbshipit-source-id: 446b0bc720d13b9e9314feccdb147b2bab0b7cd9
2023-06-02 06:52:56 -07:00
Jeremy Fitzhardinge
1ae4f69513 third-party/rust: update text_placeholder with https://github.com/bernardoamc/text-placeholder/pull/7
Summary: Added `fill_from_function` which makes it much more useful

Reviewed By: fanzeyi

Differential Revision: D46342378

fbshipit-source-id: 9bc8c01dcb10806a03f1eab628f9763c4e5edc81
2023-06-02 03:29:24 -07:00
Pierre Chevalier
c7c032c6fb non-oss work 67/n
Differential Revision: D46326058

fbshipit-source-id: 70db644c1badfcefddea80ce9961b9f547388192
2023-06-02 02:52:32 -07:00
Xavier Deguillard
b26ca0d334 store: properly time ObjectStore::getBlobMetadata
Summary:
Our telemetry was showing that starting mid-April the cost of
ObjectStore::getBlobmetadata went down significantly but investigating the root
cause of the improvement didn't seem to yield any results. It turns out the
root cause was that the code no longer timed the cost of the future.

Reviewed By: kmancini

Differential Revision: D46369667

fbshipit-source-id: 0c7d997c93d94498384e27b3447a9c736dcce3b2
2023-06-01 15:51:45 -07:00
Zhaolong Zhu
ccec2d4263 copytrace: exclude files that are not in the dest manifest
Summary:
the previous change broke `test-fb-ext-copytrace.t` tests, but somehow the failure didn't show up in the CI, this is to fix the that.

The issue happened when rebasing 8f852f229 (mv a b) to 046961699 (del a), and file `a` doesn't in the dest commit. The old logic is to keep b in the final commit, and my previous abort with an error that a is not in dest. I think a better way is to report a conflict and ask users to resolve it. But for now, I will keep the old behevior.

```
  @  046961699  72 seconds ago  zhaolong
  │  del a
  │
  │ o  8f852f229  107 seconds ago  zhaolong
  ├─╯  mv a b
  │
  o  7a737d7e6  2 minutes ago  zhaolong
╭─╯  add a
```

Reviewed By: sggutier

Differential Revision: D46357844

fbshipit-source-id: f5860c0037b909e2dd1a62700775dba505b88849
2023-06-01 10:32:04 -07:00
Saul Gutierrez
d430d13cb5 tests: move environment related utils to their own crate
Summary: The `lock_env` function from `scm/lib/config/loader/src/test_util.rs` was way too useful to leave in its own crate, since it could be useful for Rust unit tests that modified environment variables

Reviewed By: quark-zju

Differential Revision: D46133861

fbshipit-source-id: b32842c55bd7279490f69601fbb22201da7a0767
2023-06-01 05:52:37 -07:00