Commit Graph

51080 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
1713cfca79 backingstore: impl Drop for CBytes and add From<Vec<u8>> for CBytes
Summary:
Some clean up.

`CByte` should clean up `vec` in `Drop` since we are going to have `CBytes` in other struct's field and this will allow Rust automatically manage this memory.

Reviewed By: chadaustin

Differential Revision: D18365441

fbshipit-source-id: 7038bc6ff457415ee8234cc4c6b7df0f70005cfe
2019-11-19 18:01:23 -08:00
Zeyi (Rice) Fan
f27e1eb2e0 backingstore: add TreeContentStore to impl TreeStore
Summary: `manifest::Tree` wants to have a store that implements `TreeStore`. However at current we don't want to introduce dependency between `manifest` and `contentstore`. So we create this wrapper struct to provide the trait implementation. This will allow us to use `manifest` to parse manifest data we get from hg store.

Reviewed By: chadaustin, xavierd

Differential Revision: D18365354

fbshipit-source-id: 3687032c7f51570ef51ccc4004efc87f64ef2188
2019-11-19 18:01:23 -08:00
Zeyi (Rice) Fan
7f0f541fa1 manifest: add FsNode to List::Directory
Reviewed By: sfilipco

Differential Revision: D18307923

fbshipit-source-id: 1844afb7b9a185f7e89c11476ee2eb34cac117c6
2019-11-19 18:01:22 -08:00
Zeyi (Rice) Fan
5b274b1a4c manifest: add tree HgId to FsNode
Summary: This diff adds `Option<HgId>` to `FsNode::Directory` because EdenFS needs the tree hash for the directories in the tree.

Reviewed By: sfilipco

Differential Revision: D18307205

fbshipit-source-id: 93db944ff1686a1c5927aa9a876a0fd008edbf9a
2019-11-19 18:01:22 -08:00
svcscm
c91facaf23 Updating submodules
Summary:
GitHub commits:

107984051e
c420949847
4e0dcd36df

Reviewed By: yns88

fbshipit-source-id: 328096fad9acc47e4f801645924bf4327ba8f726
2019-11-19 18:01:22 -08:00
svcscm
9e854012ac Updating submodules
Summary:
GitHub commits:

81a1e5270d
03f8dc6a44
a80e0cab35
20b48c6478
27ea56c7c0

Reviewed By: yns88

fbshipit-source-id: b98a17c125c2f48decea86c912fe4692d056f616
2019-11-19 13:01:41 -08:00
Jun Wu
2918ef4850 test-hggit-clone: update the test
Summary:
The test needs to be updated since we now print commit hashes instead of
revision numbers in `phase` output.

Reviewed By: akushner

Differential Revision: D18596300

fbshipit-source-id: b42bb6ed68dfc33977f0c9df5018a5bf365c2909
2019-11-19 12:05:05 -08:00
svcscm
92fac21ac1 Updating submodules
Summary:
GitHub commits:

ddc3cd2e2c
547f5abfb8
75acf748b1
38cc611297
2d5fbf572b

Reviewed By: yns88

fbshipit-source-id: fc4e253e87f23f6ff79481790eb9504e50733ed5
2019-11-19 11:58:00 -08:00
Xavier Deguillard
2afcb03dd8 split: use rebase.rebase instead of restackonce
Summary:
The restackonce function warns about not using it and using `rebase.rebase`
directly, so let's just do that.

Reviewed By: quark-zju

Differential Revision: D18574767

fbshipit-source-id: 56829bccbba7f727867ba2b9bd0a81530ba29bf3
2019-11-19 09:10:37 -08:00
Stanislau Hlebik
bcfbc5c19e fix compilation warning
Summary: I got unused warning every time I build Mononoke.

Reviewed By: singhsrb

Differential Revision: D18573764

fbshipit-source-id: 23921f581bdc74655041a2413f80cb159b4ba010
2019-11-19 00:43:36 -08:00
Jun Wu
0bab8ac4b2 tests: revive silenttestrunner.py
Summary: D18541783 accidentally removed it. Revive the file to unbreak tests.

Reviewed By: singhsrb

Differential Revision: D18587477

fbshipit-source-id: 7a7a0cf8a53e5e1fc1856aab18a3da02e53e019a
2019-11-18 20:34:04 -08:00
Jun Wu
1f5ccb5939 test-hggit-bookmark-workflow: update the test
Summary: D18544475 changed `phase` output. Update this test.

Reviewed By: singhsrb

Differential Revision: D18587462

fbshipit-source-id: 82b5a75a006c792f259af9ca038c24a032069f55
2019-11-18 20:34:04 -08:00
Jun Wu
48722a4f20 test-contrib: remove the test
Summary: The test was about `simplemerge`, which was removed. Therefore, remove the test.

Reviewed By: singhsrb

Differential Revision: D18587461

fbshipit-source-id: daf12f0c38ec08a0f73d834b8f32dc1a65620a8f
2019-11-18 20:34:04 -08:00
svcscm
e5753685e4 Updating submodules
Summary:
GitHub commits:

c0b9193399
c0d9a8ebe8
c2bab5e58b
cf43b69248
fd03cf64a5
bd40feb215
2bf411857c
1f62f7aac9

Reviewed By: yns88

fbshipit-source-id: ad4bf4d5a3a8f0041e7425846e54572fde9494b8
2019-11-18 20:34:03 -08:00
svcscm
3138fa7b9e Updating submodules
Summary:
GitHub commits:

385acc503c
b35b183e45

Reviewed By: yns88

fbshipit-source-id: c7eccd88c804f1afd1db8d52221665b87ab51837
2019-11-18 19:10:27 -08:00
Adam Simpkins
d2aeffb44d getdeps: update FBPythonBinary.cmake to generate executable files on Windows
Summary:
On Windows, compile a small C executable to prepend to the zip file, to allow
the resulting executable files to be run directly on Windows, without needing
to explicitly invoke the Python interpreter to run the output file.

Reviewed By: wez

Differential Revision: D17733616

fbshipit-source-id: 989a93851412d0bbe1e7857aa9111db082f67a4c
2019-11-18 18:41:00 -08:00
svcscm
313ba4d41a Updating submodules
Summary:
GitHub commits:

c570a09dd2
3724751529
279c488395

Reviewed By: yns88

fbshipit-source-id: f1f29f030e53ddc0d76c80113509070187c8ae94
2019-11-18 18:41:00 -08:00
svcscm
16858dd47d Updating submodules
Summary:
GitHub commits:

aceee6d762
551cb91526

Reviewed By: yns88

fbshipit-source-id: da56aafe3266e1f468e5a07ecfa6409b2667e680
2019-11-18 14:23:25 -08:00
Xavier Deguillard
81aabc01e7 phase: print node, not revision number
Summary: Revision numbers are going away, let's print the node instead.

Reviewed By: quark-zju

Differential Revision: D18544475

fbshipit-source-id: df9ab928a3f7dbbcd95352eebcea46f563eec4f3
2019-11-18 13:23:00 -08:00
svcscm
1bdc539172 Updating submodules
Summary:
GitHub commits:

3acb25f216
b830bffa96
fc7064cb4e
aa3975852e
b2a3d8944d

Reviewed By: yns88

fbshipit-source-id: 34571d2a94a8fd93d744dc58a0ba7681f3fdc6b2
2019-11-18 13:08:16 -08:00
David Tolnay
066f461bcf Replace reliance on From<Context<_>> with an extension trait and constructor
Summary:
Edenapi uses a group of impls like the following as the canonical way to construct ApiError.

```
impl From<Context<ApiErrorKind>> for ApiError {
```

Downstream code would write:

```
use failure::ResultExt;

let stream_trees = config
    .get_or_default("edenapi", "streamtrees")
    .context(ApiErrorKind::BadConfig("edenapi.streamtrees"))?;
```

This relies on the way that ResultExt::context returns a unique type that is different from failure::Error.

This diff introduces a dedicated extension trait to allow the same code in the caller to continue to work even without a failure::Context<T> type, which will be required for dropping our dependency on failure::Fail and failure.

```
pub trait ApiErrorContext<T> {
    fn context(self, kind: ApiErrorKind) -> ApiResult<T>;
}
```

We also introduce a public constructor for ApiError and replace indirect construction that used to look like this:

```
error.context(ApiErrorKind::Curl).into()
```

with this instead:

```
ApiError::new(ApiErrorKind::Curl, error)
```

which is the same number of characters but clearer. The argument order matches [std::io::Error::new](https://doc.rust-lang.org/std/io/struct.Error.html#method.new).

Reviewed By: kulshrax

Differential Revision: D18574668

fbshipit-source-id: 0a56297bb942a26d75a62ca39fc16abeb4486345
2019-11-18 12:12:43 -08:00
Jun Wu
9561b5e22a treematcher: do not crash on non-utf-8 paths
Summary:
On Windows, the paths passed to the `match` functions are not encoded in utf-8
yet.  Do not crash if received them.

Reviewed By: sfilipco

Differential Revision: D18574951

fbshipit-source-id: c22ce95cb6538db0c15d60789286e2ff7d2148bc
2019-11-18 11:44:53 -08:00
David Tolnay
6ff01a57ec commitcloudsubscriber: Consolidate CommitCloudHttpError into ErrorKind enum
Summary: The CommitCloudHttpError seems to have been working around a limitation of failure's derive that no longer applies to thiserror.

Reviewed By: xavierd

Differential Revision: D18523907

fbshipit-source-id: 54efaedc405911a412ce842dff6285fb80d875b8
2019-11-18 11:44:52 -08:00
Jun Wu
13a6237c1d run-tests: silent some errors from run-tests itself
Summary:
I have seen errors like:

  Traceback (most recent call last):
    File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
      self.run()
    File "/usr/lib64/python2.7/threading.py", line 765, in run
      self.__target(*self.__args, **self.__kwargs)
    File "./run-tests.py", line 2636, in job
      del runningtests[test.name]
    File "/usr/lib64/python2.7/collections.py", line 68, in __delitem__
      dict_delitem(self, key)
  KeyError: 'test-empty-t.py'

It's not fatal and is caused by race condition. So let's just ignore it.

Reviewed By: ikostia

Differential Revision: D18538388

fbshipit-source-id: 85e38578bea4c9b27439e6f10abb7619a8bb9238
2019-11-18 11:42:09 -08:00
Jun Wu
b4f7ff744e run-tests: dott Python tests do not have reference outputs
Summary:
Before this patch, if `test-foo-t.py.out` exists, the output of `test-foo-t.py`
will be diffed against it, something like:

  % ./run-tests.py test-empty-t.py
  --- test-empty-t.py.out
  +++ test-empty-t.py.err
  @@ -1,4 +1,4 @@
   Traceback (most recent call last):
     File "tests/test-empty-t.py", line 77, in <module>
  -    raise RuntimeError('a')
  -RuntimeError: a
  +    raise RuntimeError('ab')
  +RuntimeError: ab

However, the dott Python tests are not using "reference output" at all. If they
output something, it's mostly likely some crash or back traces that we want to
see the full content of it.

This patch makes it so. The new output looks like:

  % ./run-tests.py test-empty-t.py
  Traceback (most recent call last):
    File "tests/test-empty-t.py", line 77, in <module>
      raise RuntimeError('ab')
  RuntimeError: ab

  ERROR: test-empty-t.py output changed

As we're here, also improve the detection of dott Python test so they don't
have to have the `-t.py` suffix in file name.

Reviewed By: ikostia

Differential Revision: D18534830

fbshipit-source-id: 826328be5de5841081e8f093b07295bc2fadc6b1
2019-11-18 11:42:08 -08:00
Puneet Kaushik
276ee0b882 fixing hg add on Eden Windows clone
Summary: Eden sets the "portablefilenames" to ignore and the current Mercurial code doesn't consider the setting on Windows, which triggers iterate on the Eden clone. Iterate is an unsupported function on Eden clone.

Reviewed By: quark-zju

Differential Revision: D18195607

fbshipit-source-id: a21e1fcec3ee74398f22eaf56c70116468a45b45
2019-11-18 11:31:17 -08:00
Puneet Kaushik
a88d4eff1f Add template function to convert different string input types
Summary: Create a template functions to convert strings with a wide variety of input types like folly::StringPiece, std::string, folly::fbstring and std::string_view to wide char string.

Reviewed By: wez

Differential Revision: D18071832

fbshipit-source-id: 147af97dff929766db83c9477117ec82da42b03e
2019-11-18 11:31:17 -08:00
Puneet Kaushik
e9dbb85b8d Fix FileUtilsTest and enable them.
Summary: We had linking issues with the Boost while compiling with getdeps. I have moved the tests to use std::filesystem instead.

Reviewed By: wez

Differential Revision: D18195608

fbshipit-source-id: 32213a9b22105869eef78724bb3e583c3fd8e708
2019-11-18 11:31:16 -08:00
svcscm
f62ab09f21 Updating submodules
Summary:
GitHub commits:

1c9e11ed14
92ef8204de
8953a59078
3983a38d1b
b74b833648
b43987b039
ba7f504899

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 22413d1713cd9b76c6941be9b196d3e0efaaa347
2019-11-18 11:31:16 -08:00
svcscm
19df9a1b56 Updating submodules
Summary:
GitHub commits:

ea4aa9fc07
54e6aa5568
da41ae5048
da70fce0d3
0bec77c2d2
09fd20898f
b47c7f5c77
5762809397
241c174631

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 1739f00a0f1e4ffe4b5ebb9e6f5dce403a5adf8b
2019-11-18 07:06:27 -08:00
Victor Zverovich
3285a8f909 Replace Folly Format with fmt in logger to reduce binary size
Summary:
Now that fmt is available in Folly builds (D14813810), use it to reduce binary code size in Folly Logger. This is done by moving most of the formatting logic behind the type-erased `vformat` API. Previously it was instantiated for all combinations of formatting argument types used in calls to `FB_LOGF` and `XLOGF` in a program.

The effect of this change can be illustrated by looking at symbol sizes as given by `nm -S -td` for the following test function:

```
void test_log() {
  FB_LOGF(logger, WARN, "num events: {:06d}, duration: {:6.3f}", 1234, 5.6789);
}
```
compiled in `opt` mode.

`nm` before:

```
0000000004236736 0000000000000231 T test_log()
0000000004236992 0000000000001002 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&)
```

`nm` after:

```
0000000004237536 0000000000000231 T test_log()
0000000004237792 0000000000000251 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&)
0000000004238048 0000000000000740 W folly::LogStreamProcessor::vformatLogString[abi:cxx11](folly::Range<char const*>, fmt::v5::format_args, bool&)
```

Before we had one 1002 byte instantiation of `formatLogString<int, double>`. With this change it was reduced 4x to 251 bytes and non-template function `vformatLogString` was added which is shared among all logging calls. The size of `test_log` remained unchanged. There are even bigger savings from Folly Formatter instantiations which are no longer needed, e.g.

```
0000000004238032 0000000000001363 W _ZNK5folly13BaseFormatterINS_9FormatterILb0EJRKiRKdEEELb0EJS3_S5_EEclIZNKS7_8appendToINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsr12IsSomeStringIT_EE5valueEvE4typeERSH_EUlNS_5RangeIPKcEEE_EEvSK_
```

So in total this change results in ~5x per-call/instantiation binary size. It is possible to reduce binary size even further but it is not done in the current diff to keep it manageable.

In addition to binary size improvements, switching to fmt will potentially

* allow catching errors in format strings at compile time,
* simplify future migration to C++20 [`std::format`](http://eel.is/c++draft/format).

Reviewed By: simpkins

Differential Revision: D15485589

fbshipit-source-id: 06db4436839f11c2c3dbed7b36658e2193343411
2019-11-18 05:53:08 -08:00
svcscm
05e5741cc9 Updating submodules
Summary:
GitHub commits:

3062e817bf
3e9812cf6b
05d9eea2c0

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 2d7a90c7413b6fb600e92b729cb86205a37d62ac
2019-11-18 05:53:08 -08:00
svcscm
b1c572092f Updating submodules
Summary:
GitHub commits:

eeb38ffd62
f27f096824
d5c51096af
76432027c0
e6135854c5
83800eae9a
5a5b563db5

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 1eab55cd73b143acedfad7bf6fcad44b8a2cc12e
2019-11-17 18:37:38 -08:00
svcscm
21e7fd27e0 Updating submodules
Summary:
GitHub commits:

b5fa56c4e4
414aa7f2d5
a0ceaf440c
295a0662c2
214cd3295f
be9c6db57a
ec7569b9b9

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: b4d055387255a169d8ccef88c9d66cb73761e414
2019-11-17 17:21:59 -08:00
svcscm
7a53f38c11 Updating submodules
Summary:
GitHub commits:

8f2eb5c69a
4a4926a64a
8e0ca4677e
2ca3bf578d
7c5d25d54f
4aa70edfce
4597821b3a
309dc6604d

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 5b20c52e24e6d19d6baac2c9fd58f6d142686795
2019-11-16 16:54:35 -08:00
Wez Furlong
eee586ea4f getdeps: fix node/yarn detection for watchman builds
Summary:
When we detect that we are building out of the fbsource
monorepo internal to FB, pre-set some environment variables to help
projects detect our internally pinned versions of node and yarn.

Previously, the detection logic was deciding that the `yarn` shell
script was the executable to invoke, but since that is a bash script
it would fail to spawn.

Reviewed By: simpkins

Differential Revision: D18523871

fbshipit-source-id: b932d2b0ccd7b79d6f9cd74d363bc426c288e38f
2019-11-16 16:17:32 -08:00
Xavier Deguillard
41e5d10db5 amend: _setbookmark already takes a node
Summary:
The caller already pass in a node, so there is no need to convert the rev
number to a node. This broke `hg next -B`.

Reviewed By: quark-zju

Differential Revision: D18539038

fbshipit-source-id: 44afdd184bc7c949f8efb863702af8a301bbcfb7
2019-11-16 12:57:36 -08:00
svcscm
f301356f93 Updating submodules
Summary:
GitHub commits:

207328497a
c272123098
cdcd46de4e
1c093d3fa7
e18b3c2e6e
746161a422

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 253c3a9d70da0cbaf34dc38414966ccccf40533c
2019-11-16 06:09:48 -08:00
Jun Wu
e5d47a8bde codemod: remove unneeded files
Summary:
Remove files that are ancient, not used, or not referred.
The file list was initially generated via a Ruby script:

  (Dir['{contrib,tests}/**']-Dir['tests/test-*']).select{|name| `rg #{File.basename(name).split('.')[0]}`.empty?}

Plus some manual selection.

Some notes about deleted files:
- Revset benchmarks: Benchmarks on the Rust side is a cleaner choice.
- editmerge and hg-new-workdir: Newer versions live in fb/.

Reviewed By: xavierd

Differential Revision: D18541783

fbshipit-source-id: f08933d5c1a9c46d25322adbc2cc1e8a1b505d70
2019-11-15 17:08:40 -08:00
svcscm
35e1f88a5f Updating submodules
Summary:
GitHub commits:

ad9b5695cc
36862d7625

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 88d9733fc255381fdb78ed3f27ed84863b04c3ae
2019-11-15 17:08:40 -08:00
svcscm
8c45a850f9 Updating submodules
Summary:
GitHub commits:

c0c421beeb

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 736d1655e7d79828acf947be2c9e1ad2e88406b7
2019-11-15 14:21:41 -08:00
Michael Devine
02295d54b6 Fix commit ordering
Summary: The commit timestamps in Git have second granularity. As a result, sometimes multiple succeeding commits have numerically equivalent timestamps. This means that sorting by timestamp may not result in the correct ordering of commits. This is particularly true because the sort we use is a stable sort, which means that commits with the same timestamp must go into the sort in ascending commit history order to have the correct order coming out of the sort. This commit updates the log that generates the list to use ascending commit order rather than descending.

Reviewed By: tchebb

Differential Revision: D18486839

fbshipit-source-id: 7a0ff099375a250d92b0f1a846e1105bf7bb9c86
2019-11-15 11:16:09 -08:00
svcscm
7a8bb97245 Updating submodules
Summary:
GitHub commits:

c24f26fe23

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 0c944b70133413b29fccce3aabe326f850bf1c44
2019-11-15 10:49:43 -08:00
Stefan Filip
e07097e3bc tests: set flatcompat=False for test-fb-hgext-treemanifest-pushrebase.t
Summary: Title

Reviewed By: quark-zju

Differential Revision: D18463485

fbshipit-source-id: 6356d87743764e85f46e91e6bffe35db7ebdf10b
2019-11-15 10:47:50 -08:00
Michael Devine
8c7131b74f Optimize memory usage of rev-list parser
Summary: The existing logic for parsing rev-list data relies very heavily on split, which creates many intermediate strings that take up a lot of memory. This commit updates the logic to use indices into the original output to extract individual strings. It also includes a new unit test for the list parsing. Big thanks to Tom Hebb for identifying the excessive memory usage.

Reviewed By: tchebb

Differential Revision: D18513949

fbshipit-source-id: c3b4e420ae2635904b42b84f2973e83c81c21dd7
2019-11-15 10:38:48 -08:00
Xavier Deguillard
75d4a47eb1 histgrep: replace rev number with node in default output
Summary:
Revision numbers are deprecated, let's only show the short hash of the commit
instead.

Reviewed By: quark-zju

Differential Revision: D18519655

fbshipit-source-id: df277cc7e99ad747899d1fae2d92cd88eebea0f1
2019-11-15 09:48:10 -08:00
svcscm
33e8f2ed77 Updating submodules
Summary:
GitHub commits:

61f165b8f9

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 7016cbd4cd2d38ac316396599b2e539fa79e42cb
2019-11-15 09:48:10 -08:00
svcscm
8d510c0525 Updating submodules
Summary:
GitHub commits:

770b887986

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 31edbcc549f11026806e4b3576fcdda22401f9cc
2019-11-14 23:17:20 -08:00
David Tolnay
9c6f253858 rust: Replace derive(Fail) with derive(Error)
Summary:
This diff replaces code of the form:

```
use failure::Fail;

#[derive(Fail, Debug)]
pub enum ErrorKind {
    #[fail(display = "something failed {} times", _0)]
    Failed(usize),
}
```

with:

```
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ErrorKind {
    #[error("something failed {0} times")]
    Failed(usize),
}
```

The former emits an implementation of failure 0.1's `Fail` trait while the latter emits an impl of `std::error::Error`. Failure provides a blanket impl of `Fail` for any type that implements `Error`, so these `Error` impls are strictly more general. Each of these error types will continue to have exactly the same `Fail` impl that it did before this change, but now also has the appropriate `std::error::Error` impl which sets us up for dropping our various dependencies on `Fail` throughout the codebase.

Reviewed By: Imxset21

Differential Revision: D18523700

fbshipit-source-id: 0e43b10d5dfa79820663212391ecbf4aeaac2d41
2019-11-14 22:04:38 -08:00
svcscm
b9569ab08f Updating submodules
Summary:
GitHub commits:

20080a6338
170bb2ae47

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: f3c5863ebb72b5eef36133bffd2a1ba8ba1d0fe4
2019-11-14 22:04:38 -08:00