[MERGE] teach shelve about filtered views

Aaron Bentley aaron at aaronbentley.com
Mon Feb 23 15:04:58 GMT 2009


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

Ian Clatworthy wrote:
> As promised, I went ahead and landed the filtered views
> code a few days ago. This patch adds shelve to the list
> of commands that understand and consider the current view.

I'm not sure it makes sense to combine shelve and views.  They seem like
competing concepts.

> It also improves the help for the view command.

> === modified file 'bzrlib/builtins.py'
> --- bzrlib/builtins.py	2009-02-21 06:33:41 +0000
> +++ bzrlib/builtins.py	2009-02-23 09:07:29 +0000
> @@ -5161,6 +5161,19 @@
>      to see the whole tree for an operation or two (e.g. merge) but
>      want to switch back to your view after that.
>  
> +    There are 3 categories of commands in terms of view handling:
> +    
> +     1. Commands that consider the view when operating, e.g.
> +        status, diff, add, commit, remove, revert and shelve.
> +        
> +     2. Commands that operate on the full tree but filter their results
> +        according to the current view, e.g. pull, update, merge.

I don't understand the distinction that is being drawn.  Surely, the
commands in category two "consider the view" in order to filter their
results according to it.

> +     3. Commands that explicitly ignore the view, e.g. log, info.

These are essentially branch-oriented commands.  Are there any
tree-oriented commands that ignore the view?

> @@ -5364,6 +5377,7 @@
>          if writer is None:
>              writer = bzrlib.option.diff_writer_registry.get()
>          try:
> +            tree, file_list = tree_files(file_list)
>              Shelver.from_args(writer(sys.stdout), revision, all, file_list,
>                                message).run()
>          except errors.UserAbort:

This should be done in Shelver.from_args, not here.

The problem with doing it here is that you're not controlling the tree
used by shelve.  Shelve will use the current working directory as the
tree, but tree_files will use the tree containing the first entry in
file_list as the tree.

bb:resubmit on that basis.

Once you've got view support in from_args, you'll want a unit test for
that, not just a blackbox test.

Also, you are will have changed the behaviour of shelve, because it will
no longer always use the current working directory, and that should be
noted somewhere.

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

iEYEARECAAYFAkmiuxcACgkQ0F+nu1YWqI0mCwCeLLhA3sTUURE6w/RrEVGMCMkK
NtYAn0DXiwv9foSn9VRywyOMlZwW6INj
=ae6W
-----END PGP SIGNATURE-----



More information about the bazaar mailing list