From 5481f1f820bb13399fc2bface66cf1d769cdca66 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 Apr 2014 20:50:45 +0530 Subject: [PATCH] Dont rebuild extensions during a rebase --- setup/git_post_checkout_hook.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/setup/git_post_checkout_hook.py b/setup/git_post_checkout_hook.py index f7e3ffb34d..5af6f41da8 100755 --- a/setup/git_post_checkout_hook.py +++ b/setup/git_post_checkout_hook.py @@ -18,6 +18,7 @@ if flags == '1': # A branch checkout prev_branch, cur_branch = map(get_branch_name, (prev_rev, current_rev)) is_qt5_transition = 'qt5' in (prev_branch, cur_branch) + print ('Transitioning from', prev_branch, 'to', cur_branch) if is_qt5_transition: # Remove compiled .ui files as they must be re-generated @@ -27,11 +28,12 @@ if flags == '1': # A branch checkout os.remove(os.path.join(dirpath, f)) # Rebuild PyQt extensions - for ext in ('progress_indicator',): - extdir = os.path.join('build', 'pyqt', ext) - if os.path.exists(extdir): - shutil.rmtree(extdir) - subprocess.check_call(['python', 'setup.py', 'build', '--only', ext]) + if not os.path.exists('.git/rebase-merge'): # Dont rebuild if we are rebasing + for ext in ('progress_indicator',): + extdir = os.path.join('build', 'pyqt', ext) + if os.path.exists(extdir): + shutil.rmtree(extdir) + subprocess.check_call(['python', 'setup.py', 'build', '--only', ext]) subprocess.check_call(['python', 'setup.py', 'gui', '--summary'])