diff --git a/setup/git_post_checkout_hook.py b/setup/git_post_checkout_hook.py index 9aefa16bed..ca1eadff6c 100755 --- a/setup/git_post_checkout_hook.py +++ b/setup/git_post_checkout_hook.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' -import os, subprocess, sys, shutil +import os, subprocess, sys prev_rev, current_rev, flags = [x.decode('utf-8') if isinstance(x, bytes) else x for x in sys.argv[1:]] def get_branch_name(rev): @@ -26,44 +26,3 @@ if flags == '1': # A branch checkout if f.endswith('.pyc'): os.remove(fpath) -elif flags in ('master', 'qt5'): - cur_branch = get_branch_name('HEAD') - next_branch = flags - if cur_branch == next_branch: - print ('Already on branch', next_branch, file=sys.stderr) - raise SystemExit(1) - is_qt5_transition = 'qt5' in (next_branch, cur_branch) - print ('Transitioning from', cur_branch, 'to', next_branch) - - if is_qt5_transition: - # Remove compiled .ui files as they must be re-generated - for dirpath, dirnames, filenames in os.walk('.'): - for f in filenames: - if f.endswith('_ui.py'): - os.remove(os.path.join(dirpath, f)) - - subprocess.check_call(['git', 'checkout', next_branch]) - - if is_qt5_transition: - # Rebuild PyQt extensions - if not os.path.exists('.git/rebase-merge'): # Dont rebuild if we are rebasing - for ext in ('progress_indicator', 'pictureflow', 'qt_hack'): - 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 next_branch == 'qt5': - for dirpath, dirnames, filenames in os.walk('.'): - for f in filenames: - fpath = os.path.join(dirpath, f) - if f.endswith('.py') and 'qtcurve' not in fpath and (b'PyQt' + b'4') in open(fpath, 'rb').read(): - red = ('\033[%dm'%31).encode('ascii') - reset = ('\033[%dm'%31).encode('ascii') - sys.stdout.write(red) - print ('\nPyQt' + '4 present in:', fpath) - sys.stdout.write(reset) - print ('\n') - subprocess.check_call(['python', 'setup/qt5-migrate.py']) - -