[MERGE] Make 'ls' aware of views

Eduardo O. Padoan eduardo.padoan at gmail.com
Tue Feb 24 19:31:41 GMT 2009


On Tue, Feb 24, 2009 at 4:05 AM, Ian Clatworthy
<ian.clatworthy at internode.on.net> wrote:
> Eduardo O. Padoan wrote:
>> ... just attached the wrong file. Here we go again...
>
> bb:tweak
>
> I think the code in builtins.py should be tweaked as we merge ...
>
>> -            null=False, kind=None, show_ids=False, path=None):
>> +            null=False, kind=None, show_ids=False, path=None,
>> +            apply_view=True):
>
> The only parameters added to run() should be options. Set apply_view
> lower ...
>
>> +        if apply_view and tree.supports_views():
>> +            view_files = tree.views.lookup_view()
>> +            if view_files:
>> +                view_str = views.view_display_str(view_files)
>> +                note("*** ignoring files outside view: %s" % view_str)
>
> Don't test apply_view here. Set it to True inside the inner if test.
>
>> +                    if apply_view and tree.supports_views():
>> +                        try:
>> +                            views.check_path_in_view(tree, fp)
>> +                        except errors.FileOutsideView:
>> +                            continue
>
> And *just* test apply_view here, don't retest tree.supports_views()
> every time through the loop.

Ok, Done.


> Otherwise, it all looks pretty good.
>
> Do you think there's any chance for confusion about giving the full
> tree paths in the "ignoring ..." message if the user is running
> ls in a subdirectory? If so, we probably need to solve that for all
> view messages, not just the ls one.

There are 3 situations:

 - Running the command on the root. Here the message should stay.
 - Running it on a subdir in the view, giving the path explicitly or
not. No message here, I think.
 - Running it on a subdir outside the view -- the message here should
be different right? More like an error?

Also, some places the message is "*** ignoring..." and others "Ignoring...".

> Ian C.
>



-- 
    Eduardo de Oliveira Padoan
http://importskynet.blogspot.com
http://djangopeople.net/edcrypt/

"Distrust those in whom the desire to punish is strong."
   -- Goethe, Nietzsche, Dostoevsky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ls_view3.patch
Type: text/x-patch
Size: 10306 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090224/d1e8cfa5/attachment-0001.bin 


More information about the bazaar mailing list