diff mercurial/util.py @ 461:9ae0034f2772

[PATCH] /dev/null for other OS -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [PATCH] /dev/null for other OS From: K Thananchayan <thananck@yahoo.com> Null device name is platform dependent. Introduce util.nulldev - - platform dependent constant and use it instead of '/dev/null' manifest hash: 95a1bfdb712c53ef97aaff73f7f4c87e9299cf59 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCvQCGywK+sNU5EO8RAiRBAKCcXasCCFT2+6wgklkgqIt4l3UwugCeKWii h/8iRYEw8Rp8B67abiFiwyY= =L3Mk -----END PGP SIGNATURE-----
author mpm@selenic.com
date Fri, 24 Jun 2005 22:58:14 -0800
parents e8af362cfb01
children 50da4bb9cab6
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -16,6 +16,8 @@ def rename(src, dst):
 
 # Platfor specific varients
 if os.name == 'nt':
+    nulldev = 'NUL:'
+
     def is_exec(f, last):
         return last
 
@@ -32,7 +34,10 @@ if os.name == 'nt':
 
     def readlock(pathname):
         return file(pathname).read()
+
 else:
+    nulldev = '/dev/null'
+
     def is_exec(f, last):
         return (os.stat(f).st_mode & 0100 != 0)
 
@@ -57,5 +62,3 @@ else:
 
     def readlock(pathname):
         return os.readlink(pathname)
-
-