changeset 15440:9ab2b3b730ee

windows: use umask 022 in debugstate output debugstate would always report files as mode 666 or 777 on Windows. umask is not used on Windows, but faking and using a defalt value of 022 matches what the test suite uses on Unix.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 07 Nov 2011 03:14:54 +0100
parents 01611e7c36ff
children e0348815e806
files mercurial/commands.py mercurial/windows.py tests/test-rebuildstate.t
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Nov 07 03:14:53 2011 +0100
+++ b/mercurial/commands.py	Mon Nov 07 03:14:54 2011 +0100
@@ -2189,7 +2189,7 @@
         if ent[1] & 020000:
             mode = 'lnk'
         else:
-            mode = '%3o' % (ent[1] & 0777)
+            mode = '%3o' % (ent[1] & 0777 & ~util.umask)
         ui.write("%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_))
     for f in repo.dirstate.copies():
         ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
--- a/mercurial/windows.py	Mon Nov 07 03:14:53 2011 +0100
+++ b/mercurial/windows.py	Mon Nov 07 03:14:54 2011 +0100
@@ -26,7 +26,7 @@
 unlink = win32.unlink
 
 nulldev = 'NUL:'
-umask = 002
+umask = 0022
 
 # wrap osutil.posixfile to provide friendlier exceptions
 def posixfile(name, mode='r', buffering=-1):
--- a/tests/test-rebuildstate.t	Mon Nov 07 03:14:53 2011 +0100
+++ b/tests/test-rebuildstate.t	Mon Nov 07 03:14:54 2011 +0100
@@ -17,8 +17,8 @@
 state dump after
 
   $ hg debugstate --nodates | sort
-  n 666         -1 bar
-  n 666         -1 foo
+  n 644         -1 bar
+  n 644         -1 foo
 
 status