[patch] Make export take an optional branch url

Aaron Bentley aaron.bentley at utoronto.ca
Sat Oct 28 22:04:13 BST 2006


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

+1.

Daniel Silverstone wrote:

> # Bazaar revision bundle v0.8
> #
> # message:
> #   Add source branch support to export command
> # committer: Daniel Silverstone <daniel.silverstone at canonical.com>
> # date: Sat 2006-10-28 13:40:21.570173979 +0100
> 
> === modified file bzrlib/builtins.py
> --- bzrlib/builtins.py
> +++ bzrlib/builtins.py
> @@ -1648,6 +1648,8 @@
>      Root may be the top directory for tar, tgz and tbz2 formats. If none
>      is given, the top directory will be the root name of the file.
>  
> +    If branch is omitted then the branch containing the CWD will be used.
                           ^---needs a comma here.

> +    def run(self, dest, branch=None, revision=None, format=None, root=None):
>          from bzrlib.export import export
> -        tree = WorkingTree.open_containing(u'.')[0]
> -        b = tree.branch
> +
> +        if branch is None:
> +            tree = WorkingTree.open_containing(u'.')[0]
> +            b = tree.branch
> +        else:
> +            b = Branch.open(branch)

This seems like it would be simpler if you made branch default to '.'
instead of None.

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

iD8DBQFFQ8XM0F+nu1YWqI0RAhU7AJ0WygjG/w6O6r1py9ZP+3zPWlocwgCfRMVx
L6TujinY8SxEpcZT8cbv77w=
=D1cu
-----END PGP SIGNATURE-----




More information about the bazaar mailing list