Comment 2 for bug 332718

Revision history for this message
Eduardo de Oliveira Padoan (eopadoan) wrote : Re: All files still there when a filtered view is active

> That's for the fast feedback. The feature only landed an hour or so
> before this bug report. Awesome!

Its bloody carnival, and I wasn't inspired to to get out the house, so...
Also this is a very cool feature, I really want to see it shipped.

> By design, filtered views do not delete other files in the working tree.
> A bit like a database view, they simply provide a lens on to the
> information. I am planning to implement a feature closer to what you're
> expecting - partial trees. See http://bazaar-vcs.org/FilteredView if you
> haven't already. Technically, the latter is harder than it sounds. For
> example, merge expects *all* the files to be in the tree (and merge
> needs to remain a tree-wide operation, even if a view is active and you
> only see the bits you interesting in via status, diff and commit).

I have read this page once when you proposed the feature only, but I'll take a better look, thanks.

So, If I try to merge, it still needs to get the complete list of files. Ok. But 'bzr help view' (a quite long doc, btw :P) says:

"""
  To disable the current view without deleting it, you can switch to
  the pseudo view called ``off``. This can be useful when you need
  to see the whole tree for an operation or two (e.g. merge) but
  want to switch back to your view after that.
"""

I guess that its because we will want to check 'bzr st' and etc before committing the merge (and so will need the whole list of affected files), or simply because the committing the merge will fail If we aren't viewing the whole tree?

> Having said the above, I certainly think that there are some commands
> where the filtered view ought to apply and it doesn't yet. ls is one
> example - I hadn't thought of that one. I think they ought to apply for
> shelve as well. They *might* - I'm yet to test it - but there certainly
> isn't a unit test for shelve yet and there needs to be. In the case of
> shelve, I don't think it existed in the core when I first wrote the
> filtered views code. I don't have any excuse for ls though. :-)

BTW, I discovered this testing my plugin, bzr-rxrename (not a definitive name :). It uses WT.inventory.get_entries_by_dir().

> I also feel some commands should explicitly ignore the view, though
> perhaps they should make it clearer they are doing so. log and info
> are examples of commands in this category.