Rev 627: Merge 0.4. in file:///data/jelmer/bzr-svn/revprops/

Jelmer Vernooij jelmer at samba.org
Sat Feb 2 14:56:01 GMT 2008


At file:///data/jelmer/bzr-svn/revprops/

------------------------------------------------------------
revno: 627
revision-id:jelmer at samba.org-20080202145545-qzo4m1hsf50vrmo0
parent: jelmer at samba.org-20080202145433-6pglepxu5zvndczx
parent: jelmer at samba.org-20080202144835-ru01007ojxb6xl5z
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: revprops
timestamp: Sat 2008-02-02 15:55:45 +0100
message:
  Merge 0.4.
modified:
  AUTHORS                        AUTHORS-20060508114718-4c90c0062645106d
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
  tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
  tests/test_convert.py          test_convert.py-20060705203611-b1l0bapeku6foco0-1
  tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
  tests/test_tree.py             test_tree.py-20070103204350-pr8nupes7e5sd2wr-1
  tests/test_workingtree.py      test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
  workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
    ------------------------------------------------------------
    revno: 579.1.318
    revision-id:jelmer at samba.org-20080202144835-ru01007ojxb6xl5z
    parent: jelmer at samba.org-20080202143907-5w3g2ikaghfwxrll
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-02-02 15:48:35 +0100
    message:
      use feature-specific function rather than checking platform.
    modified:
      tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
      tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
      tests/test_tree.py             test_tree.py-20070103204350-pr8nupes7e5sd2wr-1
      tests/test_workingtree.py      test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
    ------------------------------------------------------------
    revno: 579.1.317
    revision-id:jelmer at samba.org-20080202143907-5w3g2ikaghfwxrll
    parent: jelmer at samba.org-20080202143627-32e9vhb90yur11fm
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-02-02 15:39:07 +0100
    message:
      Fix file id handling.
    modified:
      commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
    ------------------------------------------------------------
    revno: 579.1.316
    revision-id:jelmer at samba.org-20080202143627-32e9vhb90yur11fm
    parent: jelmer at samba.org-20080202135302-404yj4696wix6mgy
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-02-02 15:36:27 +0100
    message:
      More win32 improvements.
    modified:
      AUTHORS                        AUTHORS-20060508114718-4c90c0062645106d
      tests/test_convert.py          test_convert.py-20060705203611-b1l0bapeku6foco0-1
      tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
      tests/test_tree.py             test_tree.py-20070103204350-pr8nupes7e5sd2wr-1
      tests/test_workingtree.py      test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
    ------------------------------------------------------------
    revno: 579.1.315
    revision-id:jelmer at samba.org-20080202135302-404yj4696wix6mgy
    parent: jelmer at samba.org-20080202010752-y0xl4fakzitxi4js
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-02-02 14:53:02 +0100
    message:
      Another attempt at fixing executable bit on Windows.
    modified:
      workingtree.py                 workingtree.py-20060306120941-b083cb0fdd4a69de
    ------------------------------------------------------------
    revno: 579.1.314
    revision-id:jelmer at samba.org-20080202010752-y0xl4fakzitxi4js
    parent: jelmer at samba.org-20080202002919-1p13k95p8td5v5yu
    parent: adwi2 at 014661-xp-20080202010310-m86mg0g1rlb3un2d
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-02-02 02:07:52 +0100
    message:
      Merge win32 test fixes from Adrian Wilkins.
    modified:
      tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
      tests/test_convert.py          test_convert.py-20060705203611-b1l0bapeku6foco0-1
      tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
        ------------------------------------------------------------
        revno: 579.1.312.1.1
        revision-id:adwi2 at 014661-xp-20080202010310-m86mg0g1rlb3un2d
        parent: jelmer at samba.org-20080201173447-3ecapklbladpzjp1
        committer: adwi2 <adwi2 at 014661-XP>
        branch nick: svn
        timestamp: Sat 2008-02-02 01:03:10 +0000
        message:
          Some small fixes to the win32 support.
        modified:
          tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
          tests/test_convert.py          test_convert.py-20060705203611-b1l0bapeku6foco0-1
          tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
          tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
    ------------------------------------------------------------
    revno: 579.1.313
    revision-id:jelmer at samba.org-20080202002919-1p13k95p8td5v5yu
    parent: jelmer at samba.org-20080201173447-3ecapklbladpzjp1
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: 0.4
    timestamp: Sat 2008-02-02 01:29:19 +0100
    message:
      Use sys.platform rather than os.name.
    modified:
      tests/__init__.py              __init__.py-20060508151940-e9f4d914801a2535
      tests/test_push.py             test_push.py-20070201165715-g2ievcdfqi33wqsy-1
=== modified file 'AUTHORS'
--- a/AUTHORS	2008-02-01 13:25:44 +0000
+++ b/AUTHORS	2008-02-02 14:55:45 +0000
@@ -5,7 +5,7 @@
 Wouter van Heyst, Michael Hudson, David James, Matthias Klose, Jan Kneschke, 
 Lukás Lalinský, Kevin Light, Roland Mas, John Arbash Meinel, Stefan Metzmacher, 
 Andrew Mitchell, Gustavo Niemeyer, Martin Pool, Garrett Rooney, Johan Rydberg, 
-Peter Samuelson, Mark Shuttleworth, Adeodato Simó, Mikhail Sobolev and 
-Reinhard Tartler for comments, code reviews, funding, bug reports, testing, 
+Peter Samuelson, Mark Shuttleworth, Adeodato Simó, Mikhail Sobolev, 
+Reinhard Tartler and Adrian Wilkins for comments, code reviews, funding, bug reports, testing, 
 committing patches/bundles and generally keeping up while I was asking 
 annoying questions.

=== modified file 'commit.py'
--- a/commit.py	2008-02-02 14:54:33 +0000
+++ b/commit.py	2008-02-02 14:55:45 +0000
@@ -385,6 +385,7 @@
 
         # Store file ids
         def _dir_process_file_id(old_inv, new_inv, path, file_id):
+            ret = []
             for child_name in new_inv[file_id].children:
                 child_ie = new_inv.get_child(file_id, child_name)
                 new_child_path = new_inv.id2path(child_ie.file_id)
@@ -393,11 +394,12 @@
                 if (not child_ie.file_id in old_inv or 
                     old_inv.id2path(child_ie.file_id) != new_child_path or
                     old_inv[child_ie.file_id].parent_id != child_ie.parent_id):
-                    yield (child_ie.file_id, new_child_path)
+                    ret.append((child_ie.file_id, new_child_path))
 
                 if (child_ie.kind == 'directory' and 
                     child_ie.file_id in self.modified_dirs):
-                    _dir_process_file_id(old_inv, new_inv, new_child_path, child_ie.file_id)
+                    ret += _dir_process_file_id(old_inv, new_inv, new_child_path, child_ie.file_id)
+            return ret
 
         fileids = {}
 

=== modified file 'tests/__init__.py'
--- a/tests/__init__.py	2008-02-01 17:34:47 +0000
+++ b/tests/__init__.py	2008-02-02 01:07:52 +0000
@@ -17,6 +17,7 @@
 """Tests for the bzr-svn plugin."""
 
 import os
+import sys
 import bzrlib
 from bzrlib import osutils
 from bzrlib.bzrdir import BzrDir
@@ -46,12 +47,11 @@
         :return: Handle to the repository.
         """
         abspath = os.path.join(self.test_dir, relpath)
-        repos_url = "file://%s" % abspath
 
         svn.repos.create(abspath, '', '', None, None)
 
         if allow_revprop_changes:
-            if os.name == 'win32':
+            if sys.platform == 'win32':
                 revprop_hook = os.path.join(abspath, "hooks", "pre-revprop-change.bat")
                 open(revprop_hook, 'w').write("exit 0\n")
             else:
@@ -59,6 +59,10 @@
                 open(revprop_hook, 'w').write("#!/bin/sh\n")
                 os.chmod(revprop_hook, os.stat(revprop_hook).st_mode | 0111)
 
+        if sys.platform == 'win32':
+            abspath = '/' + abspath # The root of the filesystem on win32 is one level above the "drives"
+        repos_url = "file://%s" % abspath
+
         return repos_url
 
     def make_remote_bzrdir(self, relpath):

=== modified file 'tests/test_convert.py'
--- a/tests/test_convert.py	2008-01-28 21:50:03 +0000
+++ b/tests/test_convert.py	2008-02-02 14:36:27 +0000
@@ -23,7 +23,7 @@
 from bzrlib.tests import TestCaseInTempDir
 from bzrlib.trace import mutter
 
-import os
+import os, sys
 from convert import convert_repository, NotDumpFile, load_dumpfile
 from format import get_rich_root_format
 from mapping import default_mapping
@@ -345,6 +345,9 @@
         repos = self.load_dumpfile(filename, 'g')
         convert_repository(repos, os.path.join(self.test_dir, "e"), 
                            TrunkBranchingScheme())
+        abspath = self.test_dir
+        if sys.platform == 'win32':
+            abspath = '/' + abspath
         branch = Branch.open(os.path.join(self.test_dir, "e", "trunk"))
         self.assertEqual("file://%s/e/trunk" % self.test_dir, branch.base.rstrip("/"))
         self.assertEqual(default_mapping.generate_revision_id("6987ef2d-cd6b-461f-9991-6f1abef3bd59", 1, 'trunk', "trunk0"), branch.last_revision())

=== modified file 'tests/test_push.py'
--- a/tests/test_push.py	2008-01-28 22:52:09 +0000
+++ b/tests/test_push.py	2008-02-02 14:48:35 +0000
@@ -21,6 +21,7 @@
 from bzrlib.errors import AlreadyBranchError, BzrError, DivergedBranches
 from bzrlib.inventory import Inventory
 from bzrlib.merge import Merger, Merge3Merger
+from bzrlib.osutils import has_symlinks
 from bzrlib.progress import DummyProgress
 from bzrlib.repository import Repository
 from bzrlib.tests import KnownFailure, TestCaseWithTransport
@@ -148,7 +149,7 @@
                         self.svndir.open_branch().last_revision())
 
     def test_symlink(self):
-        if os.name == 'win32':
+        if not has_symlinks():
             return
         os.symlink("bla", "dc/south")
         assert os.path.islink("dc/south")

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2008-02-01 13:33:39 +0000
+++ b/tests/test_repos.py	2008-02-02 14:48:35 +0000
@@ -24,11 +24,12 @@
 from bzrlib.config import GlobalConfig
 from bzrlib.errors import NoSuchRevision, UninitializableFormat, BzrError
 from bzrlib.inventory import Inventory
+from bzrlib.osutils import has_symlinks
 from bzrlib.repository import Repository
 from bzrlib.revision import NULL_REVISION, Revision
 from bzrlib.tests import TestCase
 
-import os
+import os, sys
 
 import svn.fs
 
@@ -148,6 +149,9 @@
 
         repos = Repository.open(repos_url)
 
+        abspath = self.test_dir
+        if sys.platform == 'win32':
+            abspath = '/' + abspath
         self.assertEqual("SvnRepository('file://%s/')" % urlutils.join(self.test_dir, "a"), repos.__repr__())
 
     def test_get_branch_invalid_revision(self):
@@ -1168,6 +1172,8 @@
         self.assertTrue(inventory[inventory.path2id("foo/bla")].executable)
 
     def test_symlink(self):
+        if not has_symlinks():
+            return
         os.symlink('foo/bla', 'dc/bar')
         self.client_add('dc/bar')
         self.client_commit("dc", "My Message")

=== modified file 'tests/test_tree.py'
--- a/tests/test_tree.py	2007-05-17 16:52:31 +0000
+++ b/tests/test_tree.py	2008-02-02 14:48:35 +0000
@@ -16,8 +16,11 @@
 
 """Basis and revision tree tests."""
 
+from bzrlib.osutils import has_symlinks
 from bzrlib.workingtree import WorkingTree
 
+import os, sys
+
 from tree import SvnBasisTree
 from tests import TestCaseWithSubversionRepository
 
@@ -42,8 +45,9 @@
         self.assertFalse(tree.inventory[tree.inventory.path2id("file")].executable)
 
     def test_symlink(self):
+        if not has_symlinks():
+            return
         self.make_client("d", "dc")
-        import os
         os.symlink("target", "dc/file")
         self.build_tree({"dc/file": "x"})
         self.client_add("dc/file")
@@ -56,8 +60,9 @@
                          tree.inventory[tree.inventory.path2id("file")].symlink_target)
 
     def test_symlink_next(self):
+        if not has_symlinks():
+            return
         self.make_client("d", "dc")
-        import os
         os.symlink("target", "dc/file")
         self.build_tree({"dc/file": "x", "dc/bla": "p"})
         self.client_add("dc/file")
@@ -73,8 +78,9 @@
                          tree.inventory[tree.inventory.path2id("file")].symlink_target)
 
     def test_executable_link(self):
+        if not has_symlinks():
+            return
         self.make_client("d", "dc")
-        import os
         os.symlink("target", "dc/file")
         self.build_tree({"dc/file": "x"})
         self.client_add("dc/file")

=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py	2008-01-31 23:04:12 +0000
+++ b/tests/test_workingtree.py	2008-02-02 14:48:35 +0000
@@ -20,6 +20,7 @@
 from bzrlib.bzrdir import BzrDir
 from bzrlib.errors import NoSuchFile, OutOfDateTree
 from bzrlib.inventory import Inventory
+from bzrlib.osutils import has_symlinks
 from bzrlib.tests import KnownFailure
 from bzrlib.trace import mutter
 from bzrlib.workingtree import WorkingTree
@@ -27,7 +28,7 @@
 import svn.core
 import svn.wc
 
-import os
+import os, sys
 
 from mapping import MAPPING_VERSION, default_mapping
 from transport import svn_config
@@ -430,6 +431,8 @@
         self.assertTrue(inv[inv.path2id("bla")].executable)
 
     def test_symlink(self):
+        if not has_symlinks():
+            return
         self.make_client('a', 'dc')
         os.symlink("target", "dc/bla")
         self.client_add("dc/bla")

=== modified file 'workingtree.py'
--- a/workingtree.py	2008-02-01 17:34:47 +0000
+++ b/workingtree.py	2008-02-02 13:53:02 +0000
@@ -25,7 +25,7 @@
 from bzrlib.inventory import Inventory, InventoryFile, InventoryLink
 from bzrlib.lockable_files import TransportLock, LockableFiles
 from bzrlib.lockdir import LockDir
-from bzrlib.osutils import file_kind, fingerprint_file
+from bzrlib.osutils import file_kind, fingerprint_file, supports_executable
 from bzrlib.revision import NULL_REVISION
 from bzrlib.trace import mutter
 from bzrlib.tree import RevisionTree
@@ -694,9 +694,13 @@
         finally:
             self.branch.unlock()
 
-    def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
-        file_id = self.basis_tree().path2(path)
-        return self.basis_tree()._inventory[file_id].executable
+    if not supports_executable():
+        def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
+            file_id = self.basis_tree().path2(path)
+            return self.basis_tree()._inventory[file_id].executable
+
+        def is_executable(self, file_id, path=None):
+            return self.basis_tree()._inventory[file_id].executable
 
 
 class SvnWorkingTreeFormat(WorkingTreeFormat):




More information about the bazaar-commits mailing list