← Back to team overview

openerp-community-reviewer team mailing list archive

lp:~therp-nl/lp-community-utils/target_copy_from_shared_repository into lp:lp-community-utils

 

Holger Brunn (Therp) has proposed merging lp:~therp-nl/lp-community-utils/target_copy_from_shared_repository into lp:lp-community-utils.

Requested reviews:
  OpenERP Community Reviewer/Maintainer (openerp-community-reviewer)

For more details, see:
https://code.launchpad.net/~therp-nl/lp-community-utils/target_copy_from_shared_repository/+merge/201446

The clone_mp_to_community script chokes if you pass a branch that uses a shared repository via target-copy. This MP fixes that.
-- 
https://code.launchpad.net/~therp-nl/lp-community-utils/target_copy_from_shared_repository/+merge/201446
Your team OpenERP Community Reviewer/Maintainer is requested to review the proposed merge of lp:~therp-nl/lp-community-utils/target_copy_from_shared_repository into lp:lp-community-utils.
=== modified file 'clone_mp_to_community.py'
--- clone_mp_to_community.py	2013-09-22 14:36:16 +0000
+++ clone_mp_to_community.py	2014-01-13 16:03:38 +0000
@@ -149,6 +149,20 @@
         if target_copy:
             logging.debug('Using %s as a local copy of %s',
                           target_copy, target_branch_address)
+            branch_to_copy = Branch.open(target_copy)
+            if branch_to_copy.repository.is_shared():
+                if not isinstance(
+                        branch_to_copy.repository.user_transport,
+                        bzrlib.transport.local.LocalTransport):
+                    logging.error(
+                            '%s uses a nonlocal shared directory, I '
+                            'can\'t work with that')
+                    return 1
+                os.symlink(
+                        branch_to_copy.repository.user_transport\
+                                .local_abspath('.bzr'),
+                        os.path.join(target_branch_dir, '.bzr'))
+                target_branch_dir = tempfile.mkdtemp(dir=target_branch_dir)
             shutil.rmtree(target_branch_dir)
             shutil.copytree(target_copy, target_branch_dir)
             copied_branch = Branch.open(target_branch_dir)


Follow ups