Rev 3679: Merge in bzr.dev to get the pyrex update in http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/btree

John Arbash Meinel john at arbash-meinel.com
Fri Aug 22 21:51:02 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.7-dev/btree

------------------------------------------------------------
revno: 3679
revision-id: john at arbash-meinel.com-20080822205059-xrra00puh3onekbi
parent: john at arbash-meinel.com-20080822205036-7el97kr85o0atqit
parent: pqm at pqm.ubuntu.com-20080822042630-on3dxyek4ezk0miu
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: btree
timestamp: Fri 2008-08-22 15:50:59 -0500
message:
  Merge in bzr.dev to get the pyrex update
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/_btree_serializer_c.pyx _parse_btree_c.pyx-20080703034413-3q25bklkenti3p8p-2
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/tests/branch_implementations/test_permissions.py test_permissions.py-20060210110243-245c01403bf0fde6
    ------------------------------------------------------------
    revno: 3641.2.3
    revision-id: pqm at pqm.ubuntu.com-20080822042630-on3dxyek4ezk0miu
    parent: pqm at pqm.ubuntu.com-20080821190656-7uoj39e0c3q3b893
    parent: john at arbash-meinel.com-20080822035429-qa604ysmpghwzcs3
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Fri 2008-08-22 05:26:30 +0100
    message:
      (robertc, jam) Bring in the good bits for btree_index (index2 plugin)
    added:
      bzrlib/_btree_serializer_c.pyx _parse_btree_c.pyx-20080703034413-3q25bklkenti3p8p-2
      bzrlib/_btree_serializer_py.py _parse_btree_py.py-20080703034413-3q25bklkenti3p8p-3
      bzrlib/btree_index.py          index.py-20080624222253-p0x5f92uyh5hw734-7
      bzrlib/chunk_writer.py         chunk_writer.py-20080630234519-6ggn4id17nipovny-1
      bzrlib/tests/test_btree_index.py test_index.py-20080624222253-p0x5f92uyh5hw734-13
      bzrlib/tests/test_chunk_writer.py test_chunk_writer.py-20080630234519-6ggn4id17nipovny-2
    modified:
      .bzrignore                     bzrignore-20050311232317-81f7b71efa2db11a
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
        ------------------------------------------------------------
        revno: 3672.1.1
        revision-id: john at arbash-meinel.com-20080822035429-qa604ysmpghwzcs3
        parent: john at arbash-meinel.com-20080822022908-420tr0519tdz6pxy
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: btree_submitted
        timestamp: Thu 2008-08-21 22:54:29 -0500
        message:
          PQM's pyrex version requires Py_ssize_t to be manually defined
        modified:
          bzrlib/_btree_serializer_c.pyx _parse_btree_c.pyx-20080703034413-3q25bklkenti3p8p-2
    ------------------------------------------------------------
    revno: 3641.2.2
    revision-id: pqm at pqm.ubuntu.com-20080821190656-7uoj39e0c3q3b893
    parent: pqm at pqm.ubuntu.com-20080820164550-e4vt9gdxv8hlic7n
    parent: john at arbash-meinel.com-20080821162035-1zr12m9rx6llkrrq
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Thu 2008-08-21 20:06:56 +0100
    message:
      (jam) Fix bug #259855,
      	if Transport.stat() returns 0 for permission bits, ignore it
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/tests/branch_implementations/test_permissions.py test_permissions.py-20060210110243-245c01403bf0fde6
        ------------------------------------------------------------
        revno: 3641.3.2
        revision-id: john at arbash-meinel.com-20080821162035-1zr12m9rx6llkrrq
        parent: john at arbash-meinel.com-20080821161257-39lgj4it2n7kw30g
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: ftp_mode_259855
        timestamp: Thu 2008-08-21 11:20:35 -0500
        message:
          NEWS
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
        ------------------------------------------------------------
        revno: 3641.3.1
        revision-id: john at arbash-meinel.com-20080821161257-39lgj4it2n7kw30g
        parent: pqm at pqm.ubuntu.com-20080819152536-6oobtmrum8e34h8l
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: ftp_mode_259855
        timestamp: Thu 2008-08-21 11:12:57 -0500
        message:
          Fix bug #259855, if a Transport returns 0 for permission bits, ignore it
        modified:
          bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
          bzrlib/tests/branch_implementations/test_permissions.py test_permissions.py-20060210110243-245c01403bf0fde6
    ------------------------------------------------------------
    revno: 3641.2.1
    revision-id: pqm at pqm.ubuntu.com-20080820164550-e4vt9gdxv8hlic7n
    parent: pqm at pqm.ubuntu.com-20080819152536-6oobtmrum8e34h8l
    parent: john at arbash-meinel.com-20080820161409-pl5tzssd7wlxi7ma
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: +trunk
    timestamp: Wed 2008-08-20 17:45:50 +0100
    message:
      (jam) Merge in 1.6rc5 and revert disabling default stack on policy
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3641.1.1
    revision-id: john at arbash-meinel.com-20080820161409-pl5tzssd7wlxi7ma
    parent: pqm at pqm.ubuntu.com-20080819152536-6oobtmrum8e34h8l
    parent: pqm at pqm.ubuntu.com-20080819231728-vrtdr5jyvvzquhcj
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: jam-integration
    timestamp: Wed 2008-08-20 11:14:09 -0500
    message:
      Merge in 1.6rc5 and revert disabling default stack on policy
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3606.5.8
    revision-id: pqm at pqm.ubuntu.com-20080819231728-vrtdr5jyvvzquhcj
    parent: pqm at pqm.ubuntu.com-20080819221503-jvqhmuigxbdpelbd
    parent: john at arbash-meinel.com-20080819224532-n720ccihpygyaz39
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.6
    timestamp: Wed 2008-08-20 00:17:28 +0100
    message:
      (jam) Fix the release date for 1.6rc5
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
        ------------------------------------------------------------
        revno: 3606.8.4
        revision-id: john at arbash-meinel.com-20080819224532-n720ccihpygyaz39
        parent: john at arbash-meinel.com-20080819214515-7wsqo3bdfui2lejq
        committer: John Arbash Meinel <john at arbash-meinel.com>
        branch nick: stacking_policy
        timestamp: Tue 2008-08-19 17:45:32 -0500
        message:
          Fix the release date for 1.6rc5
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3606.5.7
    revision-id: pqm at pqm.ubuntu.com-20080819221503-jvqhmuigxbdpelbd
    parent: pqm at pqm.ubuntu.com-20080818234533-ixoxs0ca9kygqe0m
    parent: john at arbash-meinel.com-20080819214515-7wsqo3bdfui2lejq
    committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
    branch nick: 1.6
    timestamp: Tue 2008-08-19 23:15:03 +0100
    message:
      (jam) Disable detecting stack-on policy from a containing BzrDir
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
    ------------------------------------------------------------
    revno: 3606.8.3
    revision-id: john at arbash-meinel.com-20080819214515-7wsqo3bdfui2lejq
    parent: john at arbash-meinel.com-20080819213740-x0z2gh94t15ofcko
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: stacking_policy
    timestamp: Tue 2008-08-19 16:45:15 -0500
    message:
      push doesn't notify because it doesn't notice by default.
    modified:
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
    ------------------------------------------------------------
    revno: 3606.8.2
    revision-id: john at arbash-meinel.com-20080819213740-x0z2gh94t15ofcko
    parent: john at arbash-meinel.com-20080819210422-rqtvebr36783vpqy
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: stacking_policy
    timestamp: Tue 2008-08-19 16:37:40 -0500
    message:
      Prepare 1.6rc5
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
    ------------------------------------------------------------
    revno: 3606.8.1
    revision-id: john at arbash-meinel.com-20080819210422-rqtvebr36783vpqy
    parent: pqm at pqm.ubuntu.com-20080818234533-ixoxs0ca9kygqe0m
    committer: John Arbash Meinel <john at arbash-meinel.com>
    branch nick: stacking_policy
    timestamp: Tue 2008-08-19 16:04:22 -0500
    message:
      Disable auto-detecting the default stacking url
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
      bzrlib/tests/test_bzrdir.py    test_bzrdir.py-20060131065654-deba40eef51cf220
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2008-08-22 02:29:08 +0000
+++ b/NEWS	2008-08-22 04:26:30 +0000
@@ -32,6 +32,13 @@
     * ``bzr rm`` is now aliased to ``bzr del`` for the convenience of svn
       users. (Robert Collins, #205416)
 
+    * ``FTPTransport.stat()`` would return ``0000`` as the permission bits
+      for the containing ``.bzr/`` directory (it does not implement
+      permissions). This would cause us to set all subdirectories to
+      ``0700`` and files to ``0600`` rather than leaving them unmodified.
+      Now we ignore ``0000`` as the permissions and assume they are
+      invalid. (John Arbash Meinel, #259855)
+    
     * Running ``bzr st PATH_TO_TREE`` will no longer suppress merge
       status. Status is also about 7% faster on mozilla sized trees
       when the path to the root of the tree has been given. Users of
@@ -71,6 +78,18 @@
       (Robert Collins, Aaron Bentley)
 
 
+bzr 1.6rc5 2008-08-19
+---------------------
+
+  BUG FIXES: 
+
+    * Disable automatic detection of stacking based on a containing
+      directory of the target. It interacted badly with push, and needs a
+      bit more work to get the edges polished before it should happen
+      automatically. (John Arbash Meinel, #259275)
+      (This change was reverted when merged to bzr.dev)
+  
+
 bzr 1.6rc4 2008-08-18
 ---------------------
 

=== modified file 'bzrlib/_btree_serializer_c.pyx'
--- a/bzrlib/_btree_serializer_c.pyx	2008-08-22 02:18:27 +0000
+++ b/bzrlib/_btree_serializer_c.pyx	2008-08-22 03:54:29 +0000
@@ -21,6 +21,7 @@
     ctypedef unsigned size_t
 
 cdef extern from "Python.h":
+    ctypedef int Py_ssize_t # Required for older pyrex versions
     ctypedef struct PyObject:
         pass
     int PyList_Append(object lst, object item) except -1

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2008-07-31 08:35:25 +0000
+++ b/bzrlib/bzrdir.py	2008-08-21 19:06:56 +0000
@@ -637,7 +637,7 @@
 
     def _find_creation_modes(self):
         """Determine the appropriate modes for files and directories.
-        
+
         They're always set to be consistent with the base directory,
         assuming that this transport allows setting modes.
         """
@@ -656,9 +656,14 @@
             # directories and files are read-write for this user. This is
             # mostly a workaround for filesystems which lie about being able to
             # write to a directory (cygwin & win32)
-            self._dir_mode = (st.st_mode & 07777) | 00700
-            # Remove the sticky and execute bits for files
-            self._file_mode = self._dir_mode & ~07111
+            if (st.st_mode & 07777 == 00000):
+                # FTP allows stat but does not return dir/file modes
+                self._dir_mode = None
+                self._file_mode = None
+            else:
+                self._dir_mode = (st.st_mode & 07777) | 00700
+                # Remove the sticky and execute bits for files
+                self._file_mode = self._dir_mode & ~07111
 
     def _get_file_mode(self):
         """Return Unix mode for newly created files, or None.

=== modified file 'bzrlib/tests/branch_implementations/test_permissions.py'
--- a/bzrlib/tests/branch_implementations/test_permissions.py	2008-05-21 03:01:10 +0000
+++ b/bzrlib/tests/branch_implementations/test_permissions.py	2008-08-21 16:12:57 +0000
@@ -22,35 +22,48 @@
 So if the directory is group writable, the files and subdirs should be as well.
 """
 
-# TODO: jam 20051215 Currently the default behavior for 'bzr branch' is just 
+# TODO: jam 20051215 Currently the default behavior for 'bzr branch' is just
 #                    defined by the local umask. This isn't terrible, is it
 #                    the truly desired behavior?
- 
+
 import os
 import sys
 import stat
 from StringIO import StringIO
 
+from bzrlib import tests
 from bzrlib.branch import Branch
 from bzrlib.bzrdir import BzrDir
 from bzrlib.lockable_files import LockableFiles
 from bzrlib.remote import RemoteBranchFormat
-from bzrlib.tests import TestCaseWithTransport, TestSkipped
 from bzrlib.tests.test_permissions import chmod_r, check_mode_r
 from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
 from bzrlib.transport import get_transport
 from bzrlib.workingtree import WorkingTree
 
 
-class TestPermissions(TestCaseWithTransport):
+class _NullPermsStat(object):
+    """A class that proxy's a stat result and strips permissions."""
+
+    def __init__(self, orig_stat):
+        self._orig_stat = orig_stat
+        # We strip all permission bits from st_mode
+        self.st_mode = orig_stat.st_mode & ~07777
+
+    def __getattr__(self, name):
+        return getattr(self._orig_stat, name)
+
+
+class TestPermissions(tests.TestCaseWithTransport):
 
     def test_new_branch(self):
         if isinstance(self.branch_format, RemoteBranchFormat):
             # Remote branch format have no permission logic in them; there's
             # nothing to test here.
-            return
+            raise tests.TestNotApplicable('Remote branches have no'
+                                          ' permission logic')
         if sys.platform == 'win32':
-            raise TestSkipped('chmod has no effect on win32')
+            raise tests.TestNotApplicable('chmod has no effect on win32')
         # also, these are BzrBranch format specific things..
         os.mkdir('a')
         mode = stat.S_IMODE(os.stat('a').st_mode)
@@ -87,3 +100,21 @@
         self.assertEqualMode(0700, b.control_files._dir_mode)
         self.assertEqualMode(0600, b.control_files._file_mode)
         check_mode_r(self, 'd/.bzr', 00600, 00700)
+
+    def test_mode_0(self):
+        """Test when a transport returns null permissions for .bzr"""
+        if isinstance(self.branch_format, RemoteBranchFormat):
+            # Remote branch format have no permission logic in them; there's
+            # nothing to test here.
+            raise tests.TestNotApplicable('Remote branches have no'
+                                          ' permission logic')
+        self.make_branch_and_tree('.')
+        bzrdir = BzrDir.open('.')
+        # Monkey patch the transport
+        _orig_stat = bzrdir.transport.stat
+        def null_perms_stat(*args, **kwargs):
+            result = _orig_stat(*args, **kwargs)
+            return _NullPermsStat(result)
+        bzrdir.transport.stat = null_perms_stat
+        self.assertIs(None, bzrdir._get_dir_mode())
+        self.assertIs(None, bzrdir._get_file_mode())



More information about the bazaar-commits mailing list