Summary:
WindowsError is only defined on Windows platforms. On non-Windows platforms
this could cause rage failures like this one: P59496908
This updates the code to just catch `OSError` since `WindowsError` derives from
`OSError` on Windows.
Reviewed By: phillco
Differential Revision: D7856903
fbshipit-source-id: cf56c24eb52bb1da5dcd94ef56a3f8eb5fd849e1
Summary: D7840688 broke building RPM on OSX. This commit fixes the same.
Reviewed By: quark-zju
Differential Revision: D7854180
fbshipit-source-id: 4d3e4c87da777930780ad53888c13a41aab6c6e4
Summary:
The logic was added by D2594568 and is intentional for "repairing" dirstate.
It's O(working copy). That makes absorb super slow. Therefore let's use the
new "exact" flag to skip the slow path.
Reviewed By: mitrandir77
Differential Revision: D7818728
fbshipit-source-id: a3a7d6074bd0240b9e1919e18d3e0b95daf74a64
Summary:
Previously, absorb patches fsmonitor to skip invalidating fsmonitor state
during dirstate.rebuild. Now let's use the added "exact" parameter to avoid
the monkey patching.
Reviewed By: mitrandir77
Differential Revision: D7818729
fbshipit-source-id: 0db41c7609277acd4823101e5569cbbe80f7580e
Summary: This is a hint for performing certain fast paths.
Reviewed By: mitrandir77
Differential Revision: D7818730
fbshipit-source-id: 4adcf8724b462d8d652e8e580d6a36eebc46a0f8
Summary:
Previously it is not actually used.
`test-hgext-repogenerator.t` changed because treedirstate uses random
number to generate file names.
`fakedirstatewritetime.py` was updated to be treedirstate-aware. This
makes test-revert.t test-merge-tools.t test-merge1.t pass.
Reviewed By: singhsrb
Differential Revision: D7844960
fbshipit-source-id: 33a1d0d4a8e22ea5e6bb6454956884571fcf6bab
Summary:
Either fix or ignore issues in `fb/` so the test is consistent if run
externally.
Reviewed By: DurhamG
Differential Revision: D7850647
fbshipit-source-id: 0f7faa3be2dff1dcf61a3b765c1827583fafc14f
Summary:
`GetFileInformationByHandle` returns a `BY_HANDLE_FILE_INFORMATION` structure,
which is similar to what a `stat` call returns. In particular, this structure
contains:
- the `VolumeSerialNumber` field
- the `CreationTime` fields
- the `LastWriteTime` fields
- the `FileSize` field
- the `FileIndex` fields
All of these are self-explanatory, except for the `FileIndex`. Here's what MSDN says:
```
The identifier that is stored in the nFileIndexHigh and nFileIndexLow members is called the file ID.
...
In the NTFS file system, a file keeps the same file ID until it is deleted.
You can replace one file with another file without changing the file ID
by using the ReplaceFile function. However, the file ID of the replacement file,
not the replaced file, is retained as the file ID of the resulting file.
```
Basically, every change to a file, except replacing it with some other file,
results in a changed file Id. Calling `ReplaceFile` however results in
`CreationTime` preserved from the replaced file and `LastWriteTime` preserved
from the replacement file:
```
C:\Code\tries\windowstries
λ python fileinfo.py
1.txt: Attr;32;Create;4064609256;30663014;Write;3046340864;30663166;Volume;1792064959;Size;0;5;Idx;655360;547898
2.txt: Attr;32;Create;3030045984;30663166;Write;3030172944;30663166;Volume;1792064959;Size;0;5;Idx;786432;565725
Replacing 1.txt with 2.txt; result is: 1
1.txt: Attr;32;Create;4064609256;30663014;Write;3030172944;30663166;Volume;1792064959;Size;0;5;Idx;786432;565725
```
Thus comparing all of these fields seems to be enough to replicate the `cachestat` beharior from `posix.py` (We
cache the `stat` of a file, which we almost always expect to change by renaming into it. We only use this `cachestat`
while our process is alive. One notable exception is the `.hgignore` file, which the user can change as they please,
but which we still `cachestat`.)
This change has performance implications for `status` if we use `.hgignore`: it's nearly 0.1s faster.
If we use `.gitignore`, there are no performance implications (at least I did not find any), but I'd still like
to land it for the sake of feature parity between Posix and Windows.
Reviewed By: quark-zju
Differential Revision: D7843746
fbshipit-source-id: f6f69ee12bdce054d7ea77917e83a95bcec17f83
Summary: Next diff in the stack accesses it from `windows.py`.
Reviewed By: quark-zju
Differential Revision: D7843747
fbshipit-source-id: fa9458a3ac4e66013f61c92d8ebc41b0859d4e37
Summary:
Update the buck build rules to depend on the pyre2 third-party library, and to
try importing it using the module name `re2`.
Reviewed By: ryanmce
Differential Revision: D7840688
fbshipit-source-id: 21156958f42cdcf61f4dfdb2c6eccf95e657fcd1
Summary:
There is a proper way [1] to skip the dict check-code check. Let's use it.
[1]: a61ed1c2d7
Reviewed By: DurhamG
Differential Revision: D7831336
fbshipit-source-id: a5e654e9e94cbfb1c5a07b047eb6e5451904c48e
Summary: Our CI didn't catch when I landed the previous diff.
Reviewed By: singhsrb
Differential Revision: D7834066
fbshipit-source-id: a51c2a294ea550917836f8b1eede2570838b60b7
Summary:
This would make tests run on treedirstate.
To avoid issues with Eden pulling from a non-eden treedirstate repo,
treedirstate is changed to be "always on" and disables itself on an eden repo.
The extension list is changed to a set for efficient `__contains__` test.
Reviewed By: phillco
Differential Revision: D7769804
fbshipit-source-id: d328fe51ef67c4730cfc53f43bdfc48c2765c541
Summary:
We mark some hg commands as appearing in short help, let's add this
to our parser
Reviewed By: quark-zju
Differential Revision: D7779270
fbshipit-source-id: 0c2b790f1994205ae4dbf7cd12ac3ba7f5ef39ad
Summary:
Let's check-in the definitions for now. In the future those should be generated
every build with all the extensions enabled - like in prod.
Reviewed By: quark-zju
Differential Revision: D7779273
fbshipit-source-id: f0d5c5260be74c5f64c0945004bf60399a6e8c4c
Summary:
This allows writing `TreeState` state in two ways - save as a new file, or
incrementally update an existing file.
Reviewed By: markbt
Differential Revision: D7748822
fbshipit-source-id: 472b78af6cf7ea79968460a51ec824eaa96e4973
Summary: They are used by the next diff.
Reviewed By: markbt
Differential Revision: D7748834
fbshipit-source-id: 9562204975d83a8dce6eb80d2677387e24f8f0a0
Summary:
The method names are inspired by std HashMap. The types are slightly
different due to `Tree` implementation details.
Reviewed By: markbt
Differential Revision: D7748828
fbshipit-source-id: fc24481cdf0054c8e879d760082e192e52afc7f5
Summary:
The `Tree` object can return an `&mut` entry easily. Let's expose the
interface. This could be useful when the caller only wants to modify part of
the file state. For example, changing `copied` without touching anything
else.
Reviewed By: markbt
Differential Revision: D7748820
fbshipit-source-id: 430fa8ee310297c61866695a692134daf519e78d
Summary:
Unlike TreeDirstate, this struct does not have two trees, and uses
FileStateV2.
Reviewed By: markbt
Differential Revision: D7748826
fbshipit-source-id: e637fad64e6b3e9b2a122e26a29fd04014181d6b
Summary: This lets you select on substrings in fields and paths.
Reviewed By: quark-zju
Differential Revision: D7788826
fbshipit-source-id: f92b8cc646fd36f4cb3b8a4dc6116576db80eb42
Summary: Calculation on how many profiles were hidden is only done when the hint is actually shown.
Reviewed By: quark-zju
Differential Revision: D7774192
fbshipit-source-id: a7196b2cc5640d0a7cb9c4d572e1a31ebfa41598
Summary:
This lets us produce a list of profiles with the title set, or find all profiles that are missing a description.
Convert the 'hidden' filter to use this feature, rather than special-case it in `_discover()`.
Reviewed By: quark-zju
Differential Revision: D7774029
fbshipit-source-id: 3bcba75e6da97bf0e560e11ce1ae7cbcee49ee45
Summary:
Infinitepush stores bundles uncompressed, which can make them quite large.
Enable zstd compression of bundles, both when sending them to the server during
backups, and when storing the bundle in the bundle store on the server.
Reviewed By: quark-zju
Differential Revision: D7777371
fbshipit-source-id: ef9360bf05bf2a6d2b76e26cd40ad1e4ee8ae076
Summary:
check-seclevel.py complains about using section markers inside a container.
The help text about sparse file format and config options can be put at
extension-level.
Reviewed By: mjpieters
Differential Revision: D7776355
fbshipit-source-id: 0b7d813c5eee352a054b21897682f6064f384829
Summary:
On OSX developers kept having to set their $PATH or change the make
file to actually build against the homebrew python. Let's build against it by
default if it exists.
Reviewed By: ryanmce
Differential Revision: D7791395
fbshipit-source-id: c69e41a469c5f94825814b4b30bc8ea144112167
Summary:
We currently call "p4 where" on all files in the new client spec, which is roughly O(all files in ovrsource), and it's only going to get worse as ovrsource grows :(
This diff makes the number of calls O(files added & removed between two client specs) by filtering them in the following way:
- get a full list of files from old client (L1)
- get a full list of files from new client (L2)
- files_added = L2 - L1
- files_removed = L1 - L2
- `p4 where` on (files_added + files_removed)
How much speedup do we get?
from
[2018-04-25 16:07:27,725]INFO:root: Start sync import in ovrsource-master
[2018-04-25 17:35:35,873]INFO:root: Finish sync import in ovrsource-master after 5288.147963762283 seconds
to
[2018-04-26 13:43:28,819]INFO:root: Start sync import in ovrsource-master
[2018-04-26 13:51:35,575]INFO:root: Finish sync import in ovrsource-master after 486.7560772895813 seconds
on this change D7722798
Differential Revision: D7772403
fbshipit-source-id: 05a16343264007ee3ee466621da9da888c2368d7
Summary:
"\n" will flush the line and that would probably solve the OSX test failure.
```
--- tests/test-clone-uncompressed.t
+++ tests/test-clone-uncompressed.t.err
@@ -37,8 +37,8 @@
> EOF
$ hg clone --stream -U ssh://user@dummy/server blockedclone
streaming all changes
- remote: unable to perform an implicit streaming clone - make sure remotefilelog is enabled
abort: locking the remote repository failed
+ remote: unable to perform an implicit streaming clone - make sure remotefilelog is enabled (no-eol)
[255]
$ hg clone --stream --config clone.requestfullclone=True -U ssh://user@dummy/server blockedclone
streaming all changes
ok
```
Reviewed By: DurhamG
Differential Revision: D7776998
fbshipit-source-id: f21c26e1bf7aa547cd79892f66521fb27cb2e77f
Summary:
They are similar. Merge into one single method. The `visit` method will be
extended to support other filtering features.
Reviewed By: markbt
Differential Revision: D7748829
fbshipit-source-id: 4388291945668a684808fe384341328ffd4ad2a8
Summary:
Allow `Node` type to work with both versions of file states. This is the
static dispatch approach that does not introduce runtime overhead.
Reviewed By: markbt
Differential Revision: D7748831
fbshipit-source-id: 4ac0386f9f93e55af1102b97a3510c8e872444a2
Summary:
This field stores the pre-computed aggregated state that helps fast path
traversal - if a state does not match the aggregated state, we can now skip
an entire tree quickly.
Reviewed By: markbt
Differential Revision: D7748823
fbshipit-source-id: 4b81ef5b911b4a21fdd46f8845ec217a75f5af8c
Summary: The new `FileState` has a state bitflags field, and a "copied" information.
Reviewed By: markbt
Differential Revision: D7748824
fbshipit-source-id: a68687764e1b0c13252cb914673f2b16fa22d4ef
Summary:
We (me and Aida) wanted to have something that could be used instead of Command decorator that we have in python
and we came up with the following trait.
Differential Revision: D7754930
fbshipit-source-id: 15f412d07045e7d8b229801ec3094664f78f801b
Summary: Let's commit a stub of demo binary depending on argparse that we'll work on this wekk
Differential Revision: D7752614
fbshipit-source-id: a811ea363d49e0fd56cc755b0abb74d89b4a3112
Summary:
let's turn the wez's argparse library from telemetry into a separate
crate withing hg/lib. We'll experiment on it and if things go well we'll make
`telemetry` depend on that.
Reviewed By: quark-zju
Differential Revision: D7752615
fbshipit-source-id: 0814d91d704abdb746894a0289bf082e8d799b73
Summary:
We want to allow blocking full repo streaming clones in certain
repositories (since they can take the lock and take a very long time) unless the
client has explicitly asked for it. The existing stream_out wire protocol has no
way of passing an option, so let's create a new endpoint.
Reviewed By: quark-zju
Differential Revision: D7763717
fbshipit-source-id: eace47143f8fdcc4c6e302b5c26678ccf56ca5d4
Summary: This is needed to be able to list profiles via SCMQuery, where there is a working copy at the null revision.
Reviewed By: quark-zju
Differential Revision: D7745434
fbshipit-source-id: b5ac236c36f9bafc9e0f305bc0892e0cd8bec628
Summary:
This makes it easier to modify and test the core logic without coupling with
the Python logic.
Reviewed By: markbt
Differential Revision: D7734012
fbshipit-source-id: 0d7b19198d85f6ca7314611256e9271be60070d1
Summary:
I need a no-op change to test landing logic.
(Note: this ignores all push blocking failures!)
Reviewed By: phillco
Differential Revision: D7747338
fbshipit-source-id: 49388721418572b97b99971def951704059fc36a