Commit Graph

20 Commits

Author SHA1 Message Date
Ronny Pfannschmidt
66fa69cb0e posix: move a global fcntl import to keep it from breaking jython
Only needed on darwin, anyway.
2010-03-23 11:37:01 +01:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Patrick Mezard
48eee05938 Find right hg command for detached process
On Windows, Mercurial can be run from the python script of from a frozen
executable. In the first case, we have to call the python interpreter since the
script is not executable. Frozen executable can be called directly.

Fix 3/3 for issue421
2010-01-06 21:11:58 +01:00
Siddharth Agarwal
eab3968819 Add support for relinking on Windows.
Test and minor code change by Patrick Mézard <pmezard@gmail.com>
2010-01-08 18:48:39 +05:30
Adrian Buehlmann
db3cee7306 util: move rename into posix.py and windows.py 2009-10-07 20:32:07 +02:00
Mads Kiilerich
097282895a util.system: Use subprocess instead of os.system
subprocess allows the environment and working directory to be specified
directly, so the hacks for making temporary changes while forking is no longer
necessary.

This also fixes failures on solaris where the temporary changes can't be undone
because there is no unsetenv.
2009-09-20 22:19:18 +02:00
Dan Villiom Podlaski Christiansen
5cd95d0ef8 util: add realpath() for getting the 'true' path.
The function is implemented for Mac OS X using the F_GETPATH fcntl,
and a basic implementation for Windows is provided as well. On other
POSIX systems, vanilla os.path.realpath() is used.
2009-07-26 17:25:08 +02:00
Alejandro Santos
77d606ac51 compat: use open() instead of file() everywhere 2009-07-05 11:01:30 +02:00
timeless
fb33de67af Generally replace "file name" with "filename" in help and comments. 2009-06-09 09:25:17 -04:00
Martin Geisler
cac71647b1 posix: do not use fstat in isowner
The fstat function was undefined, but never used since a stat object
was always passed in the optional st argument. Passing st is now
mandatory.

This bug crept in when util was split up into posix and windows
modules. The fstat function is still defined in util, but importing it
into posix would create an import cycle which seems unnecessary.
2009-05-30 23:42:35 +02:00
Matt Mackall
a30eb02911 cmdutils: Take over glob expansion duties from util 2009-05-24 16:38:29 -05:00
Patrick Mezard
e8790c2140 serve: add and use portable spawnvp replacement
There is no standard python command to really detach a process under Windows.
Instead we use the low level API wrapped by subprocess module with all
necessary options to avoid any kind of context inheritance. Unfortunately, this
version still opens a new window for the child process.

The following have been tried:
- os.spawnv(os.P_NOWAIT): works but the child process is killed when parent
  console terminates.
- os.spawnv(os.P_DETACH): works on python25, hang on python26 when writing to
  the hgweb output socket.
- subprocess.CreateProcess() hack without shell mode: similar to
  os.spawnv(os.P_DETACH).

Fix 1/3 for issue421
2009-04-10 21:20:25 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
8e4bc1e9ad put license and copyright info into comment blocks 2009-04-26 01:13:08 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Peter Arrenbrecht
7b457d8a6a whitespace cleanup 2009-04-27 09:12:07 +02:00
Matt Mackall
bcbc752a6f posix: kill some trailing newlines 2009-04-03 12:37:07 -05:00
Rocco Rutte
895d037e99 Add missing imports for posix.py for OS X
These don't seem to do harm on Linux.
2009-03-27 17:56:18 +01:00
Matt Mackall
0952760f82 util: split out posix, windows, and win32 modules 2009-03-26 13:54:44 -05:00