Rev 2959: windows python has os.lstat in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Sat Nov 3 09:39:15 GMT 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2959
revision-id: pqm at pqm.ubuntu.com-20071103093911-4alf7wiad3n3vfz6
parent: pqm at pqm.ubuntu.com-20071103032627-fvl5prorhuns0t4o
parent: bialix at ukr.net-20071103083016-zsrh94hlg43us0pz
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2007-11-03 09:39:11 +0000
message:
  windows python has os.lstat
modified:
  bzrlib/osutils.py              osutils.py-20050309040759-eeaff12fbf77ac86
  bzrlib/tests/test_osutils.py   test_osutils.py-20051201224856-e48ee24c12182989
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 2949.6.2
    merged: bialix at ukr.net-20071103083016-zsrh94hlg43us0pz
    parent: bialix at ukr.net-20071031103212-pog42qlbk0vt66hk
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: win32.os.lstat
    timestamp: Sat 2007-11-03 10:30:16 +0200
    message:
      more changes osutils.lstat -> os.lstat
    ------------------------------------------------------------
    revno: 2949.6.1
    merged: bialix at ukr.net-20071031103212-pog42qlbk0vt66hk
    parent: pqm at pqm.ubuntu.com-20071029221703-zy7q7a0ehfvpybtn
    committer: Alexander Belchenko <bialix at ukr.net>
    branch nick: win32.os.lstat
    timestamp: Wed 2007-10-31 12:32:12 +0200
    message:
      windows python has os.lstat
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2007-10-24 06:48:13 +0000
+++ b/bzrlib/osutils.py	2007-10-31 10:32:12 +0000
@@ -68,20 +68,17 @@
 # OR with 0 on those platforms
 O_BINARY = getattr(os, 'O_BINARY', 0)
 
-# On posix, use lstat instead of stat so that we can
-# operate on broken symlinks. On Windows revert to stat.
-lstat = getattr(os, 'lstat', os.stat)
 
 def make_readonly(filename):
     """Make a filename read-only."""
-    mod = lstat(filename).st_mode
+    mod = os.lstat(filename).st_mode
     if not stat.S_ISLNK(mod):
         mod = mod & 0777555
         os.chmod(filename, mod)
 
 
 def make_writable(filename):
-    mod = lstat(filename).st_mode
+    mod = os.lstat(filename).st_mode
     if not stat.S_ISLNK(mod):
         mod = mod | 0200
         os.chmod(filename, mod)

=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2007-11-01 09:52:45 +0000
+++ b/bzrlib/tests/test_osutils.py	2007-11-03 09:39:11 +0000
@@ -284,12 +284,12 @@
 
         # Make a file readonly
         osutils.make_readonly('file')
-        mode = osutils.lstat('file').st_mode
+        mode = os.lstat('file').st_mode
         self.assertEqual(mode, mode & 0777555)
 
         # Make a file writable
         osutils.make_writable('file')
-        mode = osutils.lstat('file').st_mode
+        mode = os.lstat('file').st_mode
         self.assertEqual(mode, mode | 0200)
 
         if osutils.has_symlinks():

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py	2007-10-30 21:06:01 +0000
+++ b/bzrlib/workingtree.py	2007-11-03 09:39:11 +0000
@@ -64,7 +64,6 @@
     hashcache,
     ignores,
     merge,
-    osutils,
     revision as _mod_revision,
     revisiontree,
     repository,
@@ -90,6 +89,7 @@
 from bzrlib.lockdir import LockDir
 import bzrlib.mutabletree
 from bzrlib.mutabletree import needs_tree_write_lock
+from bzrlib import osutils
 from bzrlib.osutils import (
     compact_date,
     file_kind,
@@ -703,7 +703,7 @@
         if updated:
             self.set_parent_ids(parents, allow_leftmost_as_ghost=True)
 
-    def path_content_summary(self, path, _lstat=osutils.lstat,
+    def path_content_summary(self, path, _lstat=os.lstat,
         _mapper=osutils.file_kind_from_stat_mode):
         """See Tree.path_content_summary."""
         abspath = self.abspath(path)




More information about the bazaar-commits mailing list