Commit Graph

43305 Commits

Author SHA1 Message Date
Liubov Dmitrieva
77e1cb22e8 commitcloud: do not use filtered set of heads when update infinitepush state
Summary:
commitcloud: do not use filtered set of heads when update infinitepush
state

hg cloud sync command can be interrupted when pulling

some of commits will be pulled, but not written to the commit cloud and
infinitepush states

the next run of cloud sync is smart, it will not pull what has been already pulled in but will fix the
commit cloud state

but because we used the filtered list of heads for infinitepush state, it will not fix the infinitepush
state

So, we shouldn't use the filtered set

Reviewed By: markbt

Differential Revision: D7972200

fbshipit-source-id: 94c01694d4ac77beeed647f77cbdb30fe3f7a404
2018-05-14 06:42:19 -07:00
Jun Wu
5851c126a5 tests: fix helpers-usechg.sh
Summary:
I noticed some tests were running slower without chg. Upon investigation,
`alias hg=...` seems stop working. Similar to D7563731, let's define
functions explicitly instead.

Reviewed By: singhsrb

Differential Revision: D7964291

fbshipit-source-id: 08a69c865ffef6be7e84dd66a7cece9284b94e60
2018-05-11 16:20:55 -07:00
Jun Wu
cef17b6c33 chg: revert D7845335
Summary:
`pkill -f chgunix` is a convenient, but not a safe way to invalidate chg
servers. We're going to do the server invalidation in a better way. So just
revert the change.

Reviewed By: singhsrb

Differential Revision: D7978130

fbshipit-source-id: c13b75204ae1097ffe992b2e26d80d028022ff0d
2018-05-11 16:05:07 -07:00
Kostia Balytskyi
b955fc974e extutil: make background run truly background
Summary:
`DETACHED_PROCESS` simply means that child process won't inherit
current process' console (it does get one allocated by the OS though). `CREATE_NO_WINDOW` means that child
process does not get an allocated console altogether.

For details: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863(v=vs.85).aspx

Reviewed By: quark-zju

Differential Revision: D7969621

fbshipit-source-id: 58d5e69808fb1064bcc1101c971f52088a7fd2de
2018-05-11 10:11:22 -07:00
Jun Wu
a2e7d1cfe3 treestate: implement Rand for FileStateV2
Summary: This will be used in tests.

Differential Revision: D7769655

fbshipit-source-id: 27647685848c03f56740f49361dd286abdef8e33
2018-05-10 16:40:25 -07:00
Mark Thomas
6b20072672 commitcloud: use source repo when writing infinitepushbackupstate
Summary:
The infinitepushbackupstate file must be written using the vfs of the source
repo when the share extension is in use.

Reviewed By: mitrandir77

Differential Revision: D7936097

fbshipit-source-id: a57e241ca969632ced65029cb5ccf61373bd8aeb
2018-05-10 11:32:30 -07:00
Mark Thomas
37a68060fa commitcloud: prevent race between creating and syncing obsmarkers
Summary:
In order to prevent newly added obsmarkers from being lost while we are syncing
them, we separate out the obsmarkers that we are in the process of syncing into
a separate `syncing` file.  New obsmarkers that are created during sync go into
the `pending` file and are synced on the next sync, which means it's safe to
delete the `syncing` file when sync completes.

Differential Revision: D7932299

fbshipit-source-id: bd86e836ded10e75790b87ca6734a29f068f3571
2018-05-10 03:06:03 -07:00
Mark Thomas
eef982accb commitcloud: add test demonstrating obsmarker race
Summary:
A command that creates obsmarkers while they are being synced can cause the
obsmarkers to be dropped.

In this test, the obsmarker for the rebase restack is lost.

Differential Revision: D7932300

fbshipit-source-id: 11988f2a2c77eed9f9fab258a6623abd8c50e1cd
2018-05-10 03:06:03 -07:00
Jun Wu
4d4a8d26ae treedirstate: do not print debug messages during cleanup by default
Summary:
They got randomly printed out and broke tests. Let's limit it to
"debugtreedirstate" command.

Reviewed By: singhsrb

Differential Revision: D7904376

fbshipit-source-id: 4f0b3708fdc55ed207c3c3baa2926f4b2374730f
2018-05-09 19:32:15 -07:00
Jun Wu
2b34292f89 tests: remove test-fb-hgext-fastmanifest-concurrency.t
Summary:
It's flaky and fastmanifest is no longer used in production. So let's just
remove the test.

Reviewed By: singhsrb

Differential Revision: D7945558

fbshipit-source-id: a6a4b34d40f0994223f9eebc41a34ffdcb260032
2018-05-09 19:32:15 -07:00
Jun Wu
599c63b56f tests: fix test-gendoc-ro.t
Summary:
D7845334 seems to "fix" the tests - the warnings are gone like other
`test-gendoc-*.t`. So let's update the test.

Reviewed By: DurhamG

Differential Revision: D7937819

fbshipit-source-id: 00ec52f5860c9ad7a5ab3b42a3d6db87124b7fbe
2018-05-09 13:28:29 -07:00
Jun Wu
8a679289b2 tests: fix test-fb-hgext-scm-prompt-hg.t
Summary: Follow up of D7874269.

Reviewed By: singhsrb

Differential Revision: D7921934

fbshipit-source-id: 4aa4fa52e93bf9d21e8369d4c5891d3046af01eb
2018-05-09 11:28:18 -07:00
Durham Goode
0fcd554c57 treemanifest: enable ondemand tree generation when sendtrees is enabled
Summary:
Previously we only enabled on demand tree generation when treeonly was
set, but we also need it when sendtrees is set since we'll need to generate
trees for sending.

Reviewed By: quark-zju

Differential Revision: D7927856

fbshipit-source-id: a69d6c7920a92e4f90bdcd1d04aad9ef59e9c778
2018-05-09 11:28:18 -07:00
Durham Goode
a25ff90a5e clone: disable pull during hgsql streaming clones
Summary:
hgsql depends on repositories being byte for byte identical, but the
current pull after a streaming clone can cause the repository to be different
(like if different delta decisions were made, or the commits were ordered
slightly differently). Let's disable that pull when the repository is an hgsql
repo.

Reviewed By: ryanmce

Differential Revision: D7925300

fbshipit-source-id: 6eba7ad4ccdd37f6d7c5090522867d1a54f722b7
2018-05-09 06:15:20 -07:00
Jun Wu
6596190811 tweakdefaults: avoid crash with "rebase -r foo -d func(SRC)"
Summary:
The destination revset could contain `SRC` that will break tweakdefaults.
Change the ordering so it could work.

Reviewed By: singhsrb

Differential Revision: D7924127

fbshipit-source-id: cb3eb1379425303607e4cb6f57f534133d457dea
2018-05-09 00:26:47 -07:00
Jun Wu
f7228afd10 chg: drop "sensitive config sections"
Summary:
The "sensitive config sections" was used because "hg serve" loading
different extensions are incompatible with each other. Now we neither load
extensions nor run their uisetups, and just use one chg server.  So
sensitive config sections can be removed.

Reviewed By: singhsrb

Differential Revision: D7847149

fbshipit-source-id: 758c1df21d280bf0f88d91432e1201c8417df532
2018-05-08 17:02:22 -07:00
Jun Wu
4d5d548fb7 chg: change process title immediately after fork
Summary:
`pkill -f chgunix` was used to kill chg server processes. That could kill
worker processes if the worker hasn't changed its process name. Let's change
the process name early after forking to reduce the window a chg worker can
be killed by `pkill -f chgunix`.

Reviewed By: singhsrb

Differential Revision: D7845335

fbshipit-source-id: 3b3fc64c4328a058e0c6aad3cb11b0bc4efd9d13
2018-05-08 17:02:22 -07:00
Jun Wu
7ef0f57c6a chg: remove hacks reducing idletimeout
Summary:
It was used to reduce process count on laptops.  Now chg server can be
reused across different `--config`, `HGPLAIN` settings, it's no longer
necessary to keep the hack.

Reviewed By: singhsrb

Differential Revision: D7847150

fbshipit-source-id: d4f98debb5e9eb4f2c3f8575532cc833c61e4b1d
2018-05-08 17:02:22 -07:00
Jun Wu
b8dcc85bd7 chg: drop more sensitive environment variables aggressively
Summary:
This makes it further harder to have multiple chg servers.

- MODULEPOLICY: We effectively only support 'c' now.
- LD_: It might be intentionally to trace chg server but not the client.
  Assuming the user knows what they are doing.
- PATH: It's rare that `PATH` change can cause issues.
- PYTHON: Assume the current Python works, it's reasonable to not start a
  new Python process.
- PYTHONPATH: Since we now bundle most extensions, side effects on
  extensions should be considered rare.

Reviewed By: singhsrb

Differential Revision: D7845333

fbshipit-source-id: 264d67b687173fb4f2bdef1ef45937d8f098ed3d
2018-05-08 17:02:22 -07:00
Jun Wu
cad09500d3 chg: defer i18n initialization
Summary:
Previously, i18n are initialized at module import time, and cannot be
reinitialized if HGPLAIN is changed. That makes chg server has to hash
HGPLAIN, and use different servers if HGPLAIN is set.

Change i18n to be only initialized at `dispatch._dispatch` time, after chg
server updating environment variables. So a same chg server could serve
different languages or encodings.

Reviewed By: singhsrb

Differential Revision: D7845334

fbshipit-source-id: 6fba19cc07efdfa60a0e328cf2cc981cfed4bcc8
2018-05-08 17:02:22 -07:00
Jun Wu
15fe9250df dispatch: pre-import modules for chg service
Summary:
Pre-import modules so when they are imported by `extensions.py`, they will
get a cache hit.

Note: use a dict explicitly since it's much faster than re-`import`:

  In [2]: %timeit import hgext.rebase
  The slowest run took 13.43 times longer than the fastest. This could mean that an intermediate result is being cached.
  1000000 loops, best of 3: 444 ns per loop

  In [3]: d=sys.modules
  In [4]: %timeit d['hgext.rebase']
  10000000 loops, best of 3: 38 ns per loop

  In [7]: %timeit sys.modules['hgext.rebase']
  The slowest run took 31.89 times longer than the fastest. This could mean that an intermediate result is being cached.
  10000000 loops, best of 3: 67.3 ns per loop

Even importing two modules and constructing a tuple is 2.5x faster than directly
"import" one module:

  In [8]: %timeit (sys.modules['hgext.rebase'], sys.modules['hgext.absorb'])
  The slowest run took 10.78 times longer than the fastest. This could mean that an intermediate result is being cached.
  10000000 loops, best of 3: 177 ns per loop

Reviewed By: singhsrb

Differential Revision: D7840236

fbshipit-source-id: ca351c61ec63ffdaf401e561944e97963b434b3c
2018-05-08 17:02:22 -07:00
Jun Wu
bf577875b3 chg: use a separate entry point
Summary:
Motivated by recent D7784903 which kills chg because it holds blackbox.log
file descriptor, and that patch is causing race conditions running with chg
(chg's sock atomic rename might fail if the directory is deleted).

There are other ways to solve the direct issue. This diff takes a more
aggressive but much cleaner approach. Basically, the `hg serve` framework is
too late for chg's usecase - the repo was already loaded, extension
side-effects have been already done at that time - chg has to use
workarounds to be compatible with that. Even with a best effort, it is still
possible to have weird interactions with shared repo because how hg loads
extensions.

The new approach is to pre-import a list of bundled extensions but do not
run their `uisetup`s.  This solves a couple of hard problems:

 - Compatibility - `uisetup` runs per request. That behaves exactly as what
   an extension author expects.
 - Less memory usage - there is no `repo` object is loaded in memory.
 - Reduced process count - since extension config change does not require a
   new chg server, the count of server processes would decrease (ex.
   `--config extensions.blackbox=!` won't require a new chg server)
 - Not holding fd to edenfs, since neither blackbox nor repo is loaded. This
   makes it possible to remove the hacky killing chg logic in D7784903.

The downside is performance, since extension loading, and `uisetup` will run
every time. Benchmark shows that's could be 50ms-ish. But we could move
forward by moving extension logic to core incrementally to get rid of that
cost too.

This is basically a simplified version of my previous stack starting
with [1]. The original commit message was:

  This is the beginning of a series that does a re-architect to chg mentioned
  in [1], to achieve better compatibility.

  The compatibility issues are mainly around "uisetup"s and "reposetup"s:

    - Developers are usually unaware that uisetup runs only once per chg
      process. We cannot reliably devel-warn them. The result is, potential
      broken code are written. For example, it's really hard for chg to deal
      with "experimental.evolution" changed from unset to manually set in
      config files because setconfig is used if that config option is not set.
    - An unnecessary "reposetup" caused by "hg serve" may have unwanted
      side effects. This can become troublesome if the repo requires things
      like remotefilelog or lz4revlog, and the user sets HGRCPATH to run
      tests.

  The current chg implementation assumes that "loading" an extension is not
  side effect free - if extension related config has changed, a restart is
  needed. The new idea is, "loading" = "importing" + "run ui/extsetup", the
  "importing" part can be side-effect free for some extensions. And benchmark
  shows "import" takes most of the time consumed, while "uisetup" is usually
  very fast. We can afford running "uisetup"s per request.

  To be able to (pre-)"import" extensions without running any "uisetup"s, a
  different entry point is needed. Otherwise as long as we go through the
  normal dispatch / runcommand ("hg serve") flow, "uisetup"s cannot be
  avoided.

  Aside from better compatibility, we can also remove some hacks:

    - chg client: no longer needs to extract sensitive argv
    - chg server: confighash can be changed to only hash environment variables
      (reduce the number of server processes)
    - chg server: srcui.walkconfig hack is no longer necessary

  This patch adds a new script "chgserve" as the new entry point. Currently,
  it is just a minimal implementation that makes "CHGHG=chgserve chg ..."
  work, without doing any pre-importing. The change could also be done in the
  "hg" script. But since chg is still experimental, let's keep "hg" untouched
  for now.

  [1]: www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/085965.html

[1]: 6f91a1a69f

Reviewed By: singhsrb

Differential Revision: D7840237

fbshipit-source-id: e3d613b41fe4b721238b86c5bf84434d32cf0609
2018-05-08 17:02:22 -07:00
Jun Wu
cbfbcf5b73 fsmonitor: unlink fsmonitor.state before writing dirstate
Summary:
This is an attempt to fix the wrong status issue. A formal fix would be
D7909172, which merges fsmonitor.state into treestate. See the comment in
`__init__.py` change for why status can be wrong.

Although it fixes the "status" path, I'm not sure whether other code paths
writing dirstates could be problematic or not. Anyway, D7909172 should be the
preferred final fix.

Reviewed By: r4-in

Differential Revision: D7916344

fbshipit-source-id: beab1c825b970bb47ffe03617a14eb6f203feafa
2018-05-08 15:26:29 -07:00
Kostia Balytskyi
88fbc4e6ee windows: fsync a temporary lock file before renaming it
Summary:
This helps to avoid the following problem:
1. hg creates a temporary lock file, writes some stuff there
2. os writes this stuff into its buffer
3. hg closes the file, the metadata is written out (or journaled)
4. hg renames the file, which is again a metadata-only operation
5. the buffer is still not flushed
6. the OS crashes
7. upon reload, the os has a file with a correct name and a correct length,
but unexpected contents

Reviewed By: quark-zju

Differential Revision: D7889111

fbshipit-source-id: a0a152c9e7efef34847fa2d2ab9b94191bde43f4
2018-05-08 03:18:36 -07:00
Mark Thomas
dd7b147493 sshpeer: suspend progress bars while connecting
Summary:
While establishing an ssh connection, ssh may need to interact with the user
(e.g. to collect passwords).  Suspend the progress bar for the duration of
this, so it doesn't interfere.

Reviewed By: quark-zju

Differential Revision: D7876414

fbshipit-source-id: 5fa82f0f40fcffa6b94fa0210d102c76d3618a1d
2018-05-08 03:18:36 -07:00
Adam Simpkins
10557edc2f remove eden-specific logic from scm-prompt.sh
Summary:
The mercurial Eden extension writes a `.hg/dirstate` file now, so scm-prompt.sh
no longer needs logic to look for Eden's snapshot file when the `dirstate` file
does not exist.

Reviewed By: wez

Differential Revision: D7874269

fbshipit-source-id: d36445e99de42f135088f38f3ce4ce372be9245e
2018-05-07 16:21:42 -07:00
Adam Simpkins
7141f33a64 exit unsuccessfully if pushbackup fails to acquire the lock
Summary:
If `hg pushbackup` or `hg cloudsync` timed out waiting on the backup lock it
would still exit successfully.  This updates the code to exit unsuccessfully so
that callers can tell that their commits were not actually backed up.

Reviewed By: quark-zju

Differential Revision: D7874624

fbshipit-source-id: 501b76d7c98d16f0128a77a20c881bf55d11a1d4
2018-05-04 14:16:28 -07:00
Alexandre Marin
aed14c5d04 importer - make it ignore p4 reorgs
Summary:
This diff prepares the importer to cleanly handle moving files in perforce while
keeping the structure in hg untouched.

It introduces a magic string that has to be present in the changelist description:
`IMPORTER_IGNORE_REORG@`

When that is present, move/add move/delete actions where hg path is the same are
ignored.

Differential Revision: D7832814

fbshipit-source-id: e8323d0c3cc79ee81cb819bee63435f345069861
2018-05-04 13:36:28 -07:00
Mark Thomas
17c3e2dd8f commitcloud: UX improvements
Summary:
Rework the commit cloud commands:

* Arrange them under a top-level `cloud` command.
* Make `join` call `register` if necessary and `sync`.  This gives one-step
  on-boarding.
* Add help text to all commands; clean up existing help text.
* Simplify output a little.

Differential Revision: D7876295

fbshipit-source-id: 1f7c0cabfa3d426ced34b90bdca64bef78d78211
2018-05-04 08:05:42 -07:00
Martijn Pieters
59b960eade sparse: filter on file containment
Summary: This lets you find profiles that'll include a given filename.

Reviewed By: markbt

Differential Revision: D7876496

fbshipit-source-id: 3b375e5d8257a80853f854a6be27c74f805687e3
2018-05-04 07:31:06 -07:00
Durham Goode
58ac63caab prompt: update tests with prompt change
Summary:
The prompt was recently fixed to work with remotenames and we need to
update the test.

Reviewed By: ryanmce

Differential Revision: D7876171

fbshipit-source-id: 95ebc8d9d598cf943e67e1d38e9d7ee061882cca
2018-05-04 05:00:37 -07:00
Adam Simpkins
197605e8bd fix scm-prompt.sh to find the remotenames file correctly
Summary:
When the share extension is in use the remotenames file lives in the shared
repository, not the current working direcotry's .hg directory.

Reviewed By: wez

Differential Revision: D7872628

fbshipit-source-id: f4faae3411e6cef14cef5d52151092ce3ecebd47
2018-05-03 20:08:12 -07:00
Mark Thomas
e049b43113 commands: fix subcommands test for systems with long TESTTMP paths
Summary:
On systems with long TESTTMP paths, the test-subcommands test wraps the
filename in the help output.  This means the TESTTMP matching no longer works,
and the test fails.

Move the alias definitions into the extension, where we can set the origin
manually.

Reviewed By: mjpieters

Differential Revision: D7859229

fbshipit-source-id: a3b62079ec302f7d6de1e4444a3d5bd740b39703
2018-05-03 08:01:03 -07:00
Mark Thomas
7da35d4f22 fbsparse: use new subcommand infra
Summary:
Replace the monkey-patched subcommands in fbsparse with the new subcommand
infra.

Reviewed By: mjpieters

Differential Revision: D7849195

fbshipit-source-id: 7f1fc21f555dc2bea49d3a80efdbfd42a6e70cb5
2018-05-03 04:35:46 -07:00
Mark Thomas
0aab0bd5dd commands: allow commands to have subcommands
Summary:
Add generalised support for subcommands.  This is similar to the monkey-patched
version in `fbsparse`, but fully supported by the command infrastructure.

Subcommands are the same structure as normal commands, but are attached to a
table in the `subcommands` attribute of the main command.  Normally, if no
subcommand is provided, the normal command function is called.  This can be
made into an error by setting `subonly` on the top-level command.

In order to make `fbsparse` continue to work, I've temporarily hacked how it
handles help text.  This will be fixed in a later diff that switches fbsparse
to use this infrastructure.

Reviewed By: mjpieters

Differential Revision: D7849476

fbshipit-source-id: b988edabb17da77bf91a278e0faa2feecd0c1db9
2018-05-03 04:35:46 -07:00
Adam Simpkins
24d06c02aa fix hg rage error handling on non-Windows platforms
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
2018-05-02 21:08:32 -07:00
Saurabh Singh
7fa81be4df fix building rpm on osx
Summary: D7840688 broke building RPM on OSX. This commit fixes the same.

Reviewed By: quark-zju

Differential Revision: D7854180

fbshipit-source-id: 4d3e4c87da777930780ad53888c13a41aab6c6e4
2018-05-02 17:36:01 -07:00
Jun Wu
841114e210 sparse: skip checking files outside sparse for absorb's case
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
2018-05-02 17:16:01 -07:00
Jun Wu
0fb4933a1e absorb: use dirstate.rebuild(exact=True)
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
2018-05-02 17:15:50 -07:00
Jun Wu
1b475a874d dirstate: add an "exact" parameter to "rebuild"
Summary: This is a hint for performing certain fast paths.

Reviewed By: mitrandir77

Differential Revision: D7818730

fbshipit-source-id: 4adcf8724b462d8d652e8e580d6a36eebc46a0f8
2018-05-02 17:15:40 -07:00
Jun Wu
77638ffcc0 treedirstate: actually enable it in tests
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
2018-05-02 17:15:36 -07:00
Jun Wu
b055d6aace cleanup: remove "fb/" from test-check tests
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
2018-05-02 14:01:09 -07:00
Kostia Balytskyi
c8861cea97 windows: implement cachestat using win32.fileinfo
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
2018-05-02 08:38:59 -07:00
Kostia Balytskyi
d363d016c6 win32: make _getfileinfo accessible from other modules
Summary: Next diff in the stack accesses it from `windows.py`.

Reviewed By: quark-zju

Differential Revision: D7843747

fbshipit-source-id: fa9458a3ac4e66013f61c92d8ebc41b0859d4e37
2018-05-02 08:38:59 -07:00
Kostia Balytskyi
dd69de9b1c rage: finish oncall option cleanup
Summary: Finishing D7142733

Reviewed By: farnz

Differential Revision: D7844879

fbshipit-source-id: ffca2fc1e7b8f6dd608f2c2baae1a336d3f88dcf
2018-05-02 08:38:58 -07:00
Adam Simpkins
844ae16cea support finding pyre2 as "re2"
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
2018-05-01 20:34:57 -07:00
Jun Wu
3368506521 tests: fix test-check-code.t
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
2018-05-01 14:17:43 -07:00
Mateusz Kwapich
be9c5d754b fix pyflakes.t failure
Summary: Our CI didn't catch when I landed the previous diff.

Reviewed By: singhsrb

Differential Revision: D7834066

fbshipit-source-id: a51c2a294ea550917836f8b1eede2570838b60b7
2018-05-01 13:44:40 -07:00
Mateusz Kwapich
3e05d1c44a fix test outputs to unbreak the builds
Reviewed By: markbt

Differential Revision: D7831727

fbshipit-source-id: 65b2c5047a6738cda2e07d9bd319cfdc3db20b3f
2018-05-01 11:11:54 -07:00
Jun Wu
67b4301002 extensions: always turn on treedirstate
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
2018-05-01 08:18:36 -07:00