Summary:
This crate compiles in a binary entry-point for Mercurial.
The way the binary works at first:
- dynamically link to the Python's shared library (Linux, Windows) or Python
Framework (OSX)
- find the location of `hgexe.py` (this is what's currently known as `hg` and
what serves as a shebang entrypoint on OSX and Linux today)
- call `Py_Main` with `hgexe.py` and the rest of the supplied arguments
A couple of decisions that someone might find controversial:
- all strings are expected to be correctly conversible to/from Rust String
- in particular, this means that we're limiting the command line arguments (and
therefore the repo file names) to the valid Unicode strings. This is not much
of a limitation on Windows, but it is on Linux.
- `build.rs` takes linker path hints from the environment, to be supplied by
the `setup.py` later
- `hgexe.py` is expected to live either alongside the resulting binary or in
the `libexec` dir, that is a sister to one of the binary's parents.
Reviewed By: quark-zju
Differential Revision: D9218066
fbshipit-source-id: ff6e01d06f118cd6bc1a20fbab6b5d17fe51b531
Summary:
D9030136 removed the `use` statement and broke OSX build:
```
Compiling scm_daemon v0.1.0 (file:///.../exec/scm_daemon)
error[E0599]: no method named `write_fmt` found for type `std::fs::File` in the current scope
--> src/main.rs:62:33
|
62 | File::create(path)?.write_fmt(format_args!("{}", std::process::id()))?;
| ^^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
14 | use std::io::Write;
|
```
Reviewed By: DurhamG, singhsrb
Differential Revision: D9066112
fbshipit-source-id: f685b75c4032e8388529f6cf8a9724426bd15baa
Summary: `std::io::Write` was imported but not used causing a warning
Differential Revision: D9030136
fbshipit-source-id: 64e8e2f03cd73ecf77113f6edf7d62c2372833ea
Summary:
this will reduce cloud sync errors and unnecessary cloud sync calls
the daemon triggers cloud sync on service start/restart
it is not always the time when the machine online (and connected to correct network), so we get cloud sync errors
Reviewed By: markbt
Differential Revision: D8692972
fbshipit-source-id: 59033fd4c3e7c30100d82b908442bbf1ebea9322
Summary:
std::process::id is stable feature but not for old compilers
https://doc.rust-lang.org/std/process/fn.id.html
hopefully we will revert this diff soon
Reviewed By: markbt
Differential Revision: D8332282
fbshipit-source-id: cd6ed573a7bd1294ac666f267b09a2121c386a34
Summary:
just refactoring to improve the code quality
the main improvement is that I separated TcpReceiver to a different service,
any other services can register callbacks with TcpReceiver service.
For WorkspaceSubscriberService callbacks are implemented using mpsc channel to notify the main WorkspaceSubscriberService thread and single atomic flag that allows running subscriptions to join.
Another improvement is that I added logic to run cloud sync on the first keep alive after connection errors
Reviewed By: markbt
Differential Revision: D8226109
fbshipit-source-id: 3fe513da9273b28b2262948ecdf620821e7ab313
Summary: This changes to support Scm Daemon on dev machines
Reviewed By: farnz
Differential Revision: D8139892
fbshipit-source-id: b6df53d6ce6615d24822b739d4d1705e0f572660
Summary: Scm Daemon initial implementation that currently just listen to Commit Cloud Live Notifications and trigger `hg cloud sync` on notifications
Reviewed By: markbt
Differential Revision: D8119768
fbshipit-source-id: a0d86624fe4b81b3adc89990640916d3da279b8c