Rev 6513: (gz) Merge 2.4 for feature flag conflict resolution and _Win32Stat fix in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Mar 29 12:27:54 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6513 [merge]
revision-id: pqm at pqm.ubuntu.com-20120329122752-d05to7wdet9w3886
parent: pqm at pqm.ubuntu.com-20120328161349-2gsc0g11fcu43hlc
parent: martin.packman at canonical.com-20120329115429-pcdpq81uu3tj8anc
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2012-03-29 12:27:52 +0000
message:
(gz) Merge 2.4 for feature flag conflict resolution and _Win32Stat fix
(Martin Packman)
modified:
bzrlib/_walkdirs_win32.pyx _walkdirs_win32.pyx-20080716220454-kweh3tgxez5dvw2l-2
bzrlib/tests/test__walkdirs_win32.py test__walkdirs_win32-20080716220454-kweh3tgxez5dvw2l-3
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/_walkdirs_win32.pyx'
--- a/bzrlib/_walkdirs_win32.pyx 2011-04-05 12:15:34 +0000
+++ b/bzrlib/_walkdirs_win32.pyx 2012-03-29 08:34:13 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 Canonical Ltd
+# Copyright (C) 2008-2012 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -95,8 +95,19 @@
return self._st_size
# os.stat always returns 0, so we hard code it here
- cdef readonly int st_dev
- cdef readonly int st_ino
+ property st_dev:
+ def __get__(self):
+ return 0
+ property st_ino:
+ def __get__(self):
+ return 0
+ # st_uid and st_gid required for some external tools like bzr-git & dulwich
+ property st_uid:
+ def __get__(self):
+ return 0
+ property st_gid:
+ def __get__(self):
+ return 0
def __repr__(self):
"""Repr is the same as a Stat object.
@@ -195,8 +206,6 @@
statvalue.st_mtime = _ftime_to_timestamp(&data.ftLastWriteTime)
statvalue.st_atime = _ftime_to_timestamp(&data.ftLastAccessTime)
statvalue._st_size = _get_size(data)
- statvalue.st_ino = 0
- statvalue.st_dev = 0
return statvalue
def read_dir(self, prefix, top):
@@ -288,6 +297,4 @@
statvalue.st_mtime = st.st_mtime
statvalue.st_atime = st.st_atime
statvalue._st_size = st.st_size
- statvalue.st_ino = 0
- statvalue.st_dev = 0
return statvalue
=== modified file 'bzrlib/tests/test__walkdirs_win32.py'
--- a/bzrlib/tests/test__walkdirs_win32.py 2011-06-14 01:26:41 +0000
+++ b/bzrlib/tests/test__walkdirs_win32.py 2012-03-29 11:54:29 +0000
@@ -96,3 +96,22 @@
self.assertEqual(errno.ENOENT, e.errno)
self.assertEqual(3, e.winerror)
self.assertEqual((3, u'no_such_dir/*'), e.args)
+
+
+class Test_Win32Stat(tests.TestCaseInTempDir):
+
+ _test_needs_features = [win32_readdir_feature]
+
+ def setUp(self):
+ super(Test_Win32Stat, self).setUp()
+ from bzrlib._walkdirs_win32 import lstat
+ self.win32_lstat = lstat
+
+ def test_zero_members_present(self):
+ self.build_tree(['foo'])
+ st = self.win32_lstat('foo')
+ # we only want to ensure that some members are present
+ self.assertEqual(0, st.st_dev)
+ self.assertEqual(0, st.st_ino)
+ self.assertEqual(0, st.st_uid)
+ self.assertEqual(0, st.st_gid)
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2012-02-27 13:07:18 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2012-03-29 11:54:29 +0000
@@ -55,6 +55,10 @@
* Prevent a traceback being printed to stderr when logging has problems and
accept utf-8 byte string without breaking. (Martin Packman, #714449)
+* _Win32Stat object provides members st_uid and st_gid, those are present
+ in Python's os.stat object. These members required for external tools like
+ bzr-git and dulwich. (Alexander Belchenko, #967060)
+
Documentation
*************
More information about the bazaar-commits
mailing list