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

------------------------------------------------------------
revno: 3761
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Canonical.com Patch Queue Manager <[EMAIL PROTECTED]>
branch nick: +trunk
timestamp: Thu 2008-10-02 17:01:45 +0100
message:
  (jam) Simple fix for bug #276436,
        WT.open() should use osutils.getcwd()
modified:
  bzrlib/tests/test_workingtree.py 
testworkingtree.py-20051004024258-b88d0fe8f101d468
  bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
    ------------------------------------------------------------
    revno: 3753.1.2
    revision-id: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: John Arbash Meinel <[EMAIL PROTECTED]>
    branch nick: trivial_276436
    timestamp: Wed 2008-10-01 09:14:38 -0500
    message:
      Switch to using the class attribute, rather than the instance
    modified:
      bzrlib/tests/test_workingtree.py 
testworkingtree.py-20051004024258-b88d0fe8f101d468
    ------------------------------------------------------------
    revno: 3753.1.1
    revision-id: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: John Arbash Meinel <[EMAIL PROTECTED]>
    branch nick: trivial_276436
    timestamp: Tue 2008-09-30 15:30:04 -0500
    message:
      Add some simple direct tests for WT.open and WT.open_containing.
      Fixes bug #276436.
    modified:
      bzrlib/tests/test_workingtree.py 
testworkingtree.py-20051004024258-b88d0fe8f101d468
      bzrlib/workingtree.py          
workingtree.py-20050511021032-29b6ec0a681e02e3
=== modified file 'bzrlib/tests/test_workingtree.py'
--- a/bzrlib/tests/test_workingtree.py  2008-05-12 04:07:49 +0000
+++ b/bzrlib/tests/test_workingtree.py  2008-10-01 14:14:38 +0000
@@ -81,6 +81,25 @@
             workingtree.WorkingTreeFormat.set_default_format(old_format)
         self.assertEqual(old_format, 
workingtree.WorkingTreeFormat.get_default_format())
 
+    def test_open(self):
+        tree = self.make_branch_and_tree('.')
+        open_direct = workingtree.WorkingTree.open('.')
+        self.assertEqual(tree.basedir, open_direct.basedir)
+        open_no_args = workingtree.WorkingTree.open()
+        self.assertEqual(tree.basedir, open_no_args.basedir)
+
+    def test_open_containing(self):
+        tree = self.make_branch_and_tree('.')
+        open_direct, relpath = workingtree.WorkingTree.open_containing('.')
+        self.assertEqual(tree.basedir, open_direct.basedir)
+        self.assertEqual('', relpath)
+        open_no_args, relpath = workingtree.WorkingTree.open_containing()
+        self.assertEqual(tree.basedir, open_no_args.basedir)
+        self.assertEqual('', relpath)
+        open_subdir, relpath = 
workingtree.WorkingTree.open_containing('subdir')
+        self.assertEqual(tree.basedir, open_subdir.basedir)
+        self.assertEqual('subdir', relpath)
+
 
 class SampleTreeFormat(workingtree.WorkingTreeFormat):
     """A sample format

=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py     2008-09-25 01:11:30 +0000
+++ b/bzrlib/workingtree.py     2008-09-30 20:30:04 +0000
@@ -303,14 +303,14 @@
 
         """
         if path is None:
-            path = os.path.getcwdu()
+            path = osutils.getcwd()
         control = bzrdir.BzrDir.open(path, _unsupported)
         return control.open_workingtree(_unsupported)
-        
+
     @staticmethod
     def open_containing(path=None):
         """Open an existing working tree which has its root about path.
-        
+
         This probes for a working tree at path and searches upwards from there.
 
         Basically we keep looking up until we find the control directory or


-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to