[MERGE] Allow appending path segments to the :<name> style aliases.

John Arbash Meinel john at arbash-meinel.com
Thu Aug 14 21:22:55 BST 2008


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

Michael Hudson wrote:

...

>>>> +        if '/' in url:
>>>> +            name = url[1:url.find('/')]
>>>> +            extra = url[url.find('/') + 1:]
>>>> +        else:
>>>> +            name = url[1:]
>>>> +            extra = None

...

>> Actually, I was talking about just the portion in the first 'if' statement:
>>
>> if '/' in url:
>>   name, extra = url[1:].split('/')
>> else:
>>   name = url[1:]
>>   extra = None
>>
>> Which is, as far as I can tell, true, and avoids doing 2 string finds
>> and a bit of additions.
> 
> I don't mean to be rude, but I think you may have worried about
> performance too much for your own good...

Perhaps. But I also think the code is *clearer* and a lot more obvious
about getting the edge conditions correct.

> 
>> The other way would be to:
>> try:
>>   name, extra = url[1:].split('/')
>> except IndexError:
>>   name = url[1:]
>>   extra = None
>>
>> but I probably prefer the "if '/' in url".
>>
>> I suppose I wasn't clear on the portion that I was objecting to.
> 
> No you weren't :)
> 
>> BB:tweak
>>
>> This isn't critical, and whoever merges it can chose if they want to
>> change it.
> 
> Sounds good to me, doesn't seem worth generating a new bundle for.
> 
> Cheers,
> mwh
> 

Agreed.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiklB8ACgkQJdeBCYSNAANA6gCdFe7KGuX4UCR2qtIC9eriQoqv
0LMAoKcwgoScLl824liIYbOko4HZ+SOk
=s5Qj
-----END PGP SIGNATURE-----



More information about the bazaar mailing list