John Arbash Meinel | 30 Sep 22:28
Favicon

[MERGE][BUG #276436] Simple fix to WT.open()


This is just a simple fix to WT.open() and some associated tests. I
added them to bzrlib.tests.test_workingtree.TestDefaultFormat, because I
was surprised that there was no direct tests for the "TestWorkingTree"
to test the static members.

I had considered deprecating not passing an argument (as obviously it
isn't being used), but I decided to keep it for now.

John
=:->

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: john <at> arbash-meinel.com-20080930203004-sf06gl9iaovamxzl
# target_branch: http://bazaar-vcs.org/bzr/bzr.dev
# testament_sha1: 8ebed8c2231beb4ba7fda7eb5adeb420fbd7b64a
# timestamp: 2008-09-30 15:30:54 -0500
# source_branch: http://bzr.arbash-meinel.com/branches/bzr/1.8-\
#   dev/trivial_276436
# base_revision_id: pqm <at> pqm.ubuntu.com-20080930002605-dfe533l96sx35va8
# 
# Begin patch
=== modified file 'bzrlib/tests/test_workingtree.py'
--- bzrlib/tests/test_workingtree.py	2008-05-12 04:07:49 +0000
+++ bzrlib/tests/test_workingtree.py	2008-09-30 20:30:04 +0000
@@ -81,6 +81,25 @@
             workingtree.WorkingTreeFormat.set_default_format(old_format)
         self.assertEqual(old_format, workingtree.WorkingTreeFormat.get_default_format())
(Continue reading)

Bundle Buggy | 30 Sep 22:34
Gravatar

Re: [MERGE][BUG #276436] Simple fix to WT.open()

Bundle Buggy has detected this merge request.

For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C48E28CCB.50407%40arbash-meinel.com%3E
Project: Bazaar

Martin Pool | 1 Oct 10:36

Re: [MERGE][BUG #276436] Simple fix to WT.open()

On Wed, Oct 1, 2008 at 6:32 AM, John Arbash Meinel
<john <at> arbash-meinel.com> wrote:
> This is just a simple fix to WT.open() and some associated tests. I
> added them to bzrlib.tests.test_workingtree.TestDefaultFormat, because I
> was surprised that there was no direct tests for the "TestWorkingTree"
> to test the static members.
>
> I had considered deprecating not passing an argument (as obviously it
> isn't being used), but I decided to keep it for now.

Actually I think the existence of these methods is a bit questionable:
they just loop back in to BzrDir which eventually calls back in to
WorkingTree.   So they're not adding much value in functionality, and
I think any arguable simplicity in the api is outweighed by the
potential confusion of having too many ways to do the same thing.

Of course that I'm still happy you stopped them failing in this case.

> +    def test_open(self):
> +        tree = self.make_branch_and_tree('.')
> +        open_direct = tree.open('.')
> +        self.assertEqual(tree.basedir, open_direct.basedir)
> +        open_no_args = tree.open()
> +        self.assertEqual(tree.basedir, open_no_args.basedir)
> +
> +    def test_open_containing(self):
> +        tree = self.make_branch_and_tree('.')
> +        open_direct, relpath = tree.open_containing('.')
> +        self.assertEqual(tree.basedir, open_direct.basedir)
> +        self.assertEqual('', relpath)
(Continue reading)

John Arbash Meinel | 1 Oct 15:59
Favicon

Re: [MERGE][BUG #276436] Simple fix to WT.open()


Martin Pool wrote:
> On Wed, Oct 1, 2008 at 6:32 AM, John Arbash Meinel
> <john <at> arbash-meinel.com> wrote:
>> This is just a simple fix to WT.open() and some associated tests. I
>> added them to bzrlib.tests.test_workingtree.TestDefaultFormat, because I
>> was surprised that there was no direct tests for the "TestWorkingTree"
>> to test the static members.
>>
>> I had considered deprecating not passing an argument (as obviously it
>> isn't being used), but I decided to keep it for now.
> 
> Actually I think the existence of these methods is a bit questionable:
> they just loop back in to BzrDir which eventually calls back in to
> WorkingTree.   So they're not adding much value in functionality, and
> I think any arguable simplicity in the api is outweighed by the
> potential confusion of having too many ways to do the same thing.
> 
> Of course that I'm still happy you stopped them failing in this case.

I personally use WT.open quite often in TIMEIT scripts or in interactive
discourse.

I *do* think that WT.open() is more concise than
BzrDir.open().open_workingtree().

> 
>> +    def test_open(self):
>> +        tree = self.make_branch_and_tree('.')
>> +        open_direct = tree.open('.')
(Continue reading)

Wouter van Heyst | 1 Oct 16:02
Favicon

Re: [MERGE][BUG #276436] Simple fix to WT.open()

On Wed, Oct 01, 2008 at 08:59:54AM -0500, John Arbash Meinel wrote:
> Martin Pool wrote:
> > On Wed, Oct 1, 2008 at 6:32 AM, John Arbash Meinel
> > <john <at> arbash-meinel.com> wrote:
> >> This is just a simple fix to WT.open() and some associated tests. I
> >> added them to bzrlib.tests.test_workingtree.TestDefaultFormat, because I
> >> was surprised that there was no direct tests for the "TestWorkingTree"
> >> to test the static members.
> >>
> >> I had considered deprecating not passing an argument (as obviously it
> >> isn't being used), but I decided to keep it for now.
> > 
> > Actually I think the existence of these methods is a bit questionable:
> > they just loop back in to BzrDir which eventually calls back in to
> > WorkingTree.   So they're not adding much value in functionality, and
> > I think any arguable simplicity in the api is outweighed by the
> > potential confusion of having too many ways to do the same thing.
> > 
> > Of course that I'm still happy you stopped them failing in this case.
> 
> I personally use WT.open quite often in TIMEIT scripts or in interactive
> discourse.

As do I for interactive work with ipython, fwiw. 

Wouter van Heyst

John Arbash Meinel | 1 Oct 16:15
Favicon

Re: [MERGE][BUG #276436] Simple fix to WT.open()


Martin Pool wrote:

...

> It seems a bit strange or misleading to call these static methods on
> an instance.  Are you trying to make sure you get possibly overridden
> versions or something?  I'd at least hope for a comment...
> 

Fixed in attached.

John
=:->
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: john <at> arbash-meinel.com-20081001141438-goh72dzp4zmd69fr
# target_branch: http://bazaar-vcs.org/bzr/bzr.dev
# testament_sha1: 8ca62d2787f95c408a0eaebc24d473f15e54f4cc
# timestamp: 2008-10-01 09:14:55 -0500
# source_branch: http://bzr.arbash-meinel.com/branches/bzr/1.8-\
#   dev/trivial_276436
# base_revision_id: pqm <at> pqm.ubuntu.com-20080930002605-dfe533l96sx35va8
# 
# Begin patch
=== modified file 'bzrlib/tests/test_workingtree.py'
--- bzrlib/tests/test_workingtree.py	2008-05-12 04:07:49 +0000
+++ bzrlib/tests/test_workingtree.py	2008-10-01 14:14:38 +0000
@@ -81,6 +81,25 @@
(Continue reading)

Bundle Buggy | 1 Oct 16:17
Gravatar

Re: [MERGE][BUG #276436] Simple fix to WT.open()

Bundle Buggy has detected this merge request.

For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C48E38604.1020503%40arbash-meinel.com%3E
Project: Bazaar

Martin Pool | 2 Oct 03:38

Re: [MERGE][BUG #276436] Simple fix to WT.open()

Martin Pool has voted approve.
Status is now: Approved

For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C48E38604.1020503%40arbash-meinel.com%3E
Project: Bazaar

Bundle Buggy | 2 Oct 18:16
Gravatar

[Success!] Re: [MERGE][BUG #276436] Simple fix to WT.open()

This change has been merged.
Previous status: Approved

For details, see: 
http://bundlebuggy.aaronbentley.com/project/bzr/request/%3C48E38604.1020503%40arbash-meinel.com%3E
Project: Bazaar


Gmane