From 969df92a3605ec2be0cbf6c8e12c2dc3f348cce6 Mon Sep 17 00:00:00 2001 From: Francisco Redondo Marchena Date: Tue, 12 Aug 2014 17:32:00 +0000 Subject: WIP: Remove git add and git commit commands --- scripts/migrate-chunks | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'scripts/migrate-chunks') diff --git a/scripts/migrate-chunks b/scripts/migrate-chunks index 7ab49803..74a7a836 100755 --- a/scripts/migrate-chunks +++ b/scripts/migrate-chunks @@ -103,16 +103,9 @@ def move_morphologies(morphs, kind, directory, path): submorph['morph'] = sanitise_morphology_path(submorph['morph'], kind) print 'Moving %s into %s' % (morph.filename, directory) loader.save_to_file(morph.filename, morph) - subprocess.call(['git', 'add', morph.filename]) - subprocess.call(['git', 'commit', '--quiet', '-m', - 'Add morphology paths to %s' %(morph['name'] + '.morph']) new_location = os.path.join(subdir, morph.filename) subprocess.call(['git', 'mv', morph.filename, new_location]) morph.filename = new_location - subprocess.call(['git', 'add', morph.filename]) - subprocess.call(['git', 'commit', '--quiet', '-m', - 'Move %s into %s' %(morph['name'] + '.morph', directory)]) - sys.exit(0) def move_clusters(morphs): kind = 'system' @@ -143,9 +136,6 @@ def download_chunks(morph): new_chunk = loader.load_from_string(chunk_morph) loader.save_to_file(chunk['morph'], new_chunk) print "Downloading %s from %s and placing in %s" %(name, repo, chunk['morph']) - subprocess.call(['git', 'add', chunk['morph']]) - #subprocess.call(['git', 'commit', '--quiet', '-m', - # 'Add %s to definitions repository' % name]) except urllib2.HTTPError as err: # If there is no morphology in the repository we assume that the morphology # system will be autodetected, so we don't have to create a new one @@ -163,9 +153,6 @@ def download_chunks(morph): fixed_chunk['description'] = fixed_chunk.pop('comments') loader.save_to_file(chunk['morph'], fixed_chunk) print "Downloading %s from %s and placing in %s" %(name, repo, chunk['morph']) - #subprocess.call(['git', 'add', chunk['morph']]) - #subprocess.call(['git', 'commit', '--quiet', '-m', - # 'Add %s to definitions repository' % name]) if "buildsystem" in str(err): # This error is caused because a typo in a morphology which # has a field "buildsystem" instead of "build-system". @@ -173,9 +160,6 @@ def download_chunks(morph): fixed_chunk['build-system'] = fixed_chunk.pop('buildsystem') loader.save_to_file(chunk['morph'], fixed_chunk) print "Downloading %s from %s and placing in %s" %(name, repo, chunk['morph']) - subprocess.call(['git', 'add', chunk['morph']]) - #subprocess.call(['git', 'commit', '--quiet', '-m', - # 'Add %s to definitions repository' % name]) except morphlib.morphloader.MorphologyNotYamlError as err: print "ERROR: %s in chunk \n%s" % (err, chunk_morph) # This error is caused because there are old morphologies written @@ -187,9 +171,6 @@ def download_chunks(morph): new_chunk = loader.load_from_string(fix_chunk) loader.save_to_file(chunk['morph'], new_chunk) print "Downloading %s from %s and placing in %s" %(name, repo, chunk['morph']) - subprocess.call(['git', 'add', chunk['morph']]) - #subprocess.call(['git', 'commit', '--quiet', '-m', - # 'Add %s to definitions repository' % name]) def move_strata(morphs): @@ -206,10 +187,8 @@ def move_strata(morphs): build_depends['morph'] = sanitise_morphology_path(build_depends['morph'], 'stratum') loader.save_to_file(morph.filename,morph) new_location = os.path.join(subdir, morph.filename) - #subprocess.call(['git', 'mv', morph.filename, new_location]) - #morph.filename = new_location - #subprocess.call(['git', 'commit', '--quiet', '-m', - # 'Move %s into strata' % morph.filename]) + subprocess.call(['git', 'mv', morph.filename, new_location]) + morph.filename = new_location # Get the path from definitions repo definitions_repo = sb.get_git_directory_name(sb.root_repository_url) @@ -222,5 +201,3 @@ for key in morphologies.iterkeys(): elif key == 'stratum': move_strata(morphologies[key]) elif key == 'chunk': move_chunks(morphologies[key]) else: print 'ERROR: Morphology not know %' % key - -sys.exit(0) -- cgit v1.2.1