Merge lp:~gz/bzr/2.5_2.4_integration into lp:bzr

Proposed by Martin Packman
Status: Merged
Approved by: Martin Packman
Approved revision: no longer in the source branch.
Merged at revision: 6513
Proposed branch: lp:~gz/bzr/2.5_2.4_integration
Merge into: lp:bzr
Diff against target: 93 lines (+37/-7)
3 files modified
bzrlib/_walkdirs_win32.pyx (+14/-7)
bzrlib/tests/test__walkdirs_win32.py (+19/-0)
doc/en/release-notes/bzr-2.4.txt (+4/-0)
To merge this branch: bzr merge lp:~gz/bzr/2.5_2.4_integration
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+99915@code.launchpad.net

Commit message

Merge 2.4 for feature flag conflict resolution and _Win32Stat fix

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/_walkdirs_win32.pyx'
2--- bzrlib/_walkdirs_win32.pyx 2011-04-05 12:15:34 +0000
3+++ bzrlib/_walkdirs_win32.pyx 2012-03-29 12:00:28 +0000
4@@ -1,4 +1,4 @@
5-# Copyright (C) 2008-2011 Canonical Ltd
6+# Copyright (C) 2008-2012 Canonical Ltd
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10@@ -95,8 +95,19 @@
11 return self._st_size
12
13 # os.stat always returns 0, so we hard code it here
14- cdef readonly int st_dev
15- cdef readonly int st_ino
16+ property st_dev:
17+ def __get__(self):
18+ return 0
19+ property st_ino:
20+ def __get__(self):
21+ return 0
22+ # st_uid and st_gid required for some external tools like bzr-git & dulwich
23+ property st_uid:
24+ def __get__(self):
25+ return 0
26+ property st_gid:
27+ def __get__(self):
28+ return 0
29
30 def __repr__(self):
31 """Repr is the same as a Stat object.
32@@ -195,8 +206,6 @@
33 statvalue.st_mtime = _ftime_to_timestamp(&data.ftLastWriteTime)
34 statvalue.st_atime = _ftime_to_timestamp(&data.ftLastAccessTime)
35 statvalue._st_size = _get_size(data)
36- statvalue.st_ino = 0
37- statvalue.st_dev = 0
38 return statvalue
39
40 def read_dir(self, prefix, top):
41@@ -288,6 +297,4 @@
42 statvalue.st_mtime = st.st_mtime
43 statvalue.st_atime = st.st_atime
44 statvalue._st_size = st.st_size
45- statvalue.st_ino = 0
46- statvalue.st_dev = 0
47 return statvalue
48
49=== modified file 'bzrlib/config.py'
50=== modified file 'bzrlib/tests/test__walkdirs_win32.py'
51--- bzrlib/tests/test__walkdirs_win32.py 2011-06-14 01:26:41 +0000
52+++ bzrlib/tests/test__walkdirs_win32.py 2012-03-29 12:00:28 +0000
53@@ -96,3 +96,22 @@
54 self.assertEqual(errno.ENOENT, e.errno)
55 self.assertEqual(3, e.winerror)
56 self.assertEqual((3, u'no_such_dir/*'), e.args)
57+
58+
59+class Test_Win32Stat(tests.TestCaseInTempDir):
60+
61+ _test_needs_features = [win32_readdir_feature]
62+
63+ def setUp(self):
64+ super(Test_Win32Stat, self).setUp()
65+ from bzrlib._walkdirs_win32 import lstat
66+ self.win32_lstat = lstat
67+
68+ def test_zero_members_present(self):
69+ self.build_tree(['foo'])
70+ st = self.win32_lstat('foo')
71+ # we only want to ensure that some members are present
72+ self.assertEqual(0, st.st_dev)
73+ self.assertEqual(0, st.st_ino)
74+ self.assertEqual(0, st.st_uid)
75+ self.assertEqual(0, st.st_gid)
76
77=== modified file 'bzrlib/tests/test_config.py'
78=== modified file 'doc/en/release-notes/bzr-2.4.txt'
79--- doc/en/release-notes/bzr-2.4.txt 2012-02-27 13:07:18 +0000
80+++ doc/en/release-notes/bzr-2.4.txt 2012-03-29 12:00:28 +0000
81@@ -55,6 +55,10 @@
82 * Prevent a traceback being printed to stderr when logging has problems and
83 accept utf-8 byte string without breaking. (Martin Packman, #714449)
84
85+* _Win32Stat object provides members st_uid and st_gid, those are present
86+ in Python's os.stat object. These members required for external tools like
87+ bzr-git and dulwich. (Alexander Belchenko, #967060)
88+
89 Documentation
90 *************
91
92
93=== modified file 'doc/en/release-notes/bzr-2.5.txt'