[MERGE][Bug #273993] Add --no-tree option to `bzr branch`

John Arbash Meinel john at arbash-meinel.com
Sat Feb 7 18:01:20 GMT 2009


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

Daniel Watkins wrote:
> Hello all,
> 
> Attached is a fix for bug #273993, which adds a --no-tree option to bzr
> branch.  This fix is based on work by John Klinger, which I've updated
> to apply to bzr.dev and added tests to.
> 
> 
> Dan
> 

     def run(self, from_location, to_location=None, revision=None,
- -            hardlink=False, stacked=False, standalone=False):
+            hardlink=False, no_tree=False, stacked=False,
standalone=False):
         from bzrlib.tag import _merge_tags_if_possible


^- minor thing, we generally always add new parameters at the end. I'm
curious what made you decide to put it here (alphabetically sorted?)

+        if (isinstance(target_transport, local.LocalTransport) and not
no_tree
+            and (result_repo is None or result_repo.make_working_trees())):
             wt =
result.create_workingtree(accelerator_tree=accelerator_tree,
                 hardlink=hardlink)
             wt.lock_write()

^- I would just start with:

if not no_tree ...

I wonder if it wouldn't be better to change the parameter to:

..., create_tree_if_local=True)

Since it is usually better to use a positive statement, than "not no_tree".

...

- -        # we always want a working tree
- -        WorkingTreeFormat2().initialize(result,
- -
accelerator_tree=accelerator_tree,
- -                                        hardlink=hardlink)
+
+        if not no_tree:
+            WorkingTreeFormat2().initialize(result,
+
accelerator_tree=accelerator_tree,
+                                            hardlink=hardlink)

^- This is wrong. Formats that use WorkingTreeFormat2 *have* to have a
working tree. (This is really old stuff; we shouldn't change it)


Otherwise I like the patch.

  BB:tweak

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

iEYEARECAAYFAkmNzHAACgkQJdeBCYSNAANu8wCdFgwHxYffG2LMnc7OuymhPr7s
kbMAn2amscIn7yl0z2sccpXA9ULg5Iz+
=jd05
-----END PGP SIGNATURE-----



More information about the bazaar mailing list