[MERGE] Push honours 'no-working-trees' setting of repositories (#50582)

Aaron Bentley aaron.bentley at utoronto.ca
Fri Oct 5 05:49:37 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Aaron Bentley ?8H5B:
>> Alexander Belchenko wrote:
>>> The bug fixed by making clone of working tree conditional,
>>> based on destination repo settings.
>> bb:resubmit
> 
>> === modified file 'bzrlib/bzrdir.py'
>> --- bzrlib/bzrdir.py	2007-09-21 07:29:37 +0000
>> +++ bzrlib/bzrdir.py	2007-10-01 00:13:51 +0000
>> @@ -208,10 +208,11 @@
>>              self.open_branch().clone(result, revision_id=revision_id)
>>          except errors.NotBranchError:
>>              pass
>> -        try:
>> -            self.open_workingtree().clone(result)
>> -        except (errors.NoWorkingTree, errors.NotLocalUrl):
>> -            pass
>> +        if result_repo.make_working_trees():
> 
>> ^^^ result_repo is not always set, so this will throw NameError in some
>> cases.
> 
> Hmm, and in which situation there will be no result_repo?
> As I can see it's possible only if local_repo is not found
> by this code:

Right.  The most common case would be a lightweight checkout that is not
inside a repository.

Another possibility is a bzrdir with nothing in it at all--no tree,
branch or repository.

>> === modified file 'bzrlib/tests/blackbox/test_push.py'
>> --- bzrlib/tests/blackbox/test_push.py	2007-06-27 19:13:50 +0000
>> +++ bzrlib/tests/blackbox/test_push.py	2007-10-01 00:13:51 +0000
> 
>> ^^^^ a blackbox test is fine, but there should be a Bzrdir.clone test.
> 
> Where is appropriate place for such test?


I suggest somewhere in bzrlib/tests/bzrdir_implementations/

> like this:
> 	self.assertRaises(NoWorkingTree, open_workingtree('repo/branch'))

Basically.  You don't want to actually call open_workingtree, so more
like this:

self.assertRaises(NoWorkingTree, Workingtree.open, 'repo/branch')

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHBcJh0F+nu1YWqI0RAlarAJ46rogkVBcPCFKV4Jsk+SrWHSKZ4wCaAknk
gchv5E0kG6UhR7/0vsOLEGs=
=nHuI
-----END PGP SIGNATURE-----



More information about the bazaar mailing list