[BUG] bzr mkdir subdir fails... -> patch: test+fix

John A Meinel john at arbash-meinel.com
Sun Nov 13 16:46:37 GMT 2005


Matthieu Moy wrote:
> Alexander Belchenko <bialix at ukr.net> writes:
> 
>> Probably there is should be more complicated test for your variant
>> because this mkdir implementation have two different ways of execution
>> for first maked directory and next directories.
> 

...

> 
> I believe a better fix would be
> 
>     def run(self, dir_list):
>         for d in dir_list:
>             os.mkdir(d)
>             b, dd = Branch.open_containing(d)
>             b.add([dd])
>             print 'added', dd
> 
> (I'm not sure the performance gain of not setting b several times is
> significant)

I think you're right on this one. I went ahead and applied Alexander's
change, and then modified it with an extra test, and Matthieu's behavior.
So now, you can 'bzr mkdir foo subproj/foo subproj/subsubproj/foo' and
it should get all of the directories added to their parent projects.

> 
> but then:
> 
> $ bzr mkdir dir6 p2/dir6
> added dir6
> added dir6
> 
> Perhaps we actually want
> 
> $ bzr mkdir dir6 p2/dir6
> added dir6
> added dir6 in p2/

I'm actually going to switch it to:
added dir6
added p2/dir6

At least that is more obvious.

Ultimately, I think we might want to figure out some sort of relative
path to here for the branch base, and then we can print out what branch
is adding the directory as you recommend.

We could also just do a check to say,
	If branch.base != cwd
		print added foo in branch.base
	else
		print added foo

That would mean that you would get the full path to branch.base
sometimes, which might be ugly, but it would mean that you would know
exactly where the directory was added.

John
=:->

> 
> ?
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051113/0b176d07/attachment.pgp 


More information about the bazaar mailing list