Rev 5354: Add flags to enable accelerator trees, but default them to false. in http://bazaar.launchpad.net/~jameinel/bzr/2.3-disable-accelerator-tree

John Arbash Meinel john at arbash-meinel.com
Tue Jul 20 10:13:38 BST 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.3-disable-accelerator-tree

------------------------------------------------------------
revno: 5354
revision-id: john at arbash-meinel.com-20100720091332-0y0yq151gsi7ebc0
parent: pqm at pqm.ubuntu.com-20100719213209-3bqfu9jg2md5zga6
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.3-disable-accelerator-tree
timestamp: Tue 2010-07-20 04:13:32 -0500
message:
  Add flags to enable accelerator trees, but default them to false.
-------------- next part --------------
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-07-19 15:39:51 +0000
+++ b/bzrlib/builtins.py	2010-07-20 09:13:32 +0000
@@ -1135,8 +1135,8 @@
 
     _see_also = ['checkout']
     takes_args = ['from_location', 'to_location?']
-    takes_options = ['revision', Option('hardlink',
-        help='Hard-link working tree files where possible.'),
+    takes_options = ['revision',
+        Option('hardlink', help='Hard-link working tree files where possible.'),
         Option('no-tree',
             help="Create a branch without a working-tree."),
         Option('switch',
@@ -1155,16 +1155,23 @@
                     ' allow branch to proceed.'),
         Option('bind',
             help="Bind new branch to from location."),
+        Option('use-accel', help='Try to copy content from the source tree'
+            ' rather than extracting it from the repository.'
+            ' Setting "--hardlink" forces this to True'),
         ]
     aliases = ['get', 'clone']
 
     def run(self, from_location, to_location=None, revision=None,
             hardlink=False, stacked=False, standalone=False, no_tree=False,
-            use_existing_dir=False, switch=False, bind=False):
+            use_existing_dir=False, switch=False, bind=False,
+            use_accel=False):
         from bzrlib import switch as _mod_switch
         from bzrlib.tag import _merge_tags_if_possible
         accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
             from_location)
+        use_accel = (hardlink or use_accel)
+        if not use_accel:
+            accelerator_tree = None
         revision = _get_one_revision('branch', revision)
         self.add_cleanup(br_from.lock_read().unlock)
         if revision is not None:
@@ -1267,17 +1274,26 @@
                      Option('hardlink',
                             help='Hard-link working tree files where possible.'
                             ),
+                     Option('use-accel',
+                         help='Try to copy content from the source tree'
+                              ' rather than extracting it from the repository.'
+                              ' Setting "--hardlink" or "--files-from"'
+                              ' forces this to True'),
                      ]
     aliases = ['co']
 
     def run(self, branch_location=None, to_location=None, revision=None,
-            lightweight=False, files_from=None, hardlink=False):
+            lightweight=False, files_from=None, hardlink=False,
+            use_accel=False):
         if branch_location is None:
             branch_location = osutils.getcwd()
             to_location = branch_location
         accelerator_tree, source = bzrdir.BzrDir.open_tree_or_branch(
             branch_location)
         revision = _get_one_revision('checkout', revision)
+        use_accel = (hardlink or use_accel or files_from)
+        if not use_accel:
+            accelerator_tree = None
         if files_from is not None:
             accelerator_tree = WorkingTree.open(files_from)
         if revision is not None:



More information about the bazaar-commits mailing list