sapling/edenscm
Xinyue Zhang 6331cb6323 Update stablerev.py to work on Windows
Summary:
1.) Windows doesn't support close_fds if stdin/stdout/stderr is redirected. It throws out this Exception: 'close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr'. This diff resolves this issue by importing mercurial util to use file_fd only on posix
2.) Originally, stable is implemented as a mercurial extension and gets expanded as the following (take update as an example):
```
hg up stable
   -> calls getstablerev("--pick-best") in stable.py
   -> calls a bash script in hg repo, e.g. ovrsource or fbsource
```
However, bash is not supported on Windows.
To resolve this, this diff sets up cwd in `subprocess.Popen` and then modifies stablerev to take in a command in string format instead of a script. This way, we can pass in either the bash script for fbsource(backward compatible) or `python <xxx.py>` for ovrsource.

Reviewed By: quark-zju

Differential Revision: D17140170

fbshipit-source-id: ea8ae76883cc34a0517fa7e9eae3cbb3ba901353
2019-08-30 16:48:18 -07:00
..
hgdemandimport demandimport: make sqlite3 non-lazy 2019-08-19 12:26:21 -07:00
hgext Update stablerev.py to work on Windows 2019-08-30 16:48:18 -07:00
mercurial changelog: disable inline revlog 2019-08-30 14:58:02 -07:00
__init__.py edenscm: move sys.path handling to top-level edenscm 2019-07-25 17:43:41 -07:00