[MERGE] Mark .bzr directories as "hidden" on Windows (#71147)
John Arbash Meinel
john at arbash-meinel.com
Mon Nov 26 17:44:14 GMT 2007
John Arbash Meinel has voted tweak.
Status is now: Conditionally approved
Comment:
I would be more comfortable with using a list and subprocess.Popen()
such as:
+class TestDotBzrHidden(TestCaseWithTransport):
+
+ ls = 'ls'
+ if sys.platform == 'win32':
+ ls = '%s /C dir /B' % os.environ['COMSPEC']
+
+ def get_ls(self):
+ f = os.popen(self.ls)
+ out = f.readlines()
+ self.assertEquals(None, f.close())
+ return [i.strip() for i in out]
+ ls = ['ls']
+ if sys.platform == 'win32':
+ ls = [os.environ['COMSPEC'], '/C', 'dir', '/B']
+
+ def get_ls(self):
+ f = subprocess.Popen(self.ls, stdout=subprocess.PIPE)
+ out, err = f.communicate()
self.assertEqual(0, f.returncode, 'Calling %s failed: %s'
% (self.ls, err))
out_lines = out.splitlines()
...
Also, I don't see the code where set_file_attr_hidden(path) is actually
being used. So I'm not sure why the tests are passing on Windows, since
it doesn't seem to actually make the file hidden.
For details, see:
http://bundlebuggy.aaronbentley.com/request/%3C474A8A43.2060503%40ukr.net%3E
More information about the bazaar
mailing list