Commit eb9f20c0 authored by Christophe Benz's avatar Christophe Benz

Remove Git stuff from convert script

parent 9520c339
......@@ -158,10 +158,6 @@ root_categories = [
]
source_filename_re = re.compile('AMECO(?P<number>\d+)\.TXT$')
source_repository_name = 'ameco-source-data'
source_repository_url = 'https://git.nomics.world/dbnomics-source-data/{}.git'.format(source_repository_name)
target_repository_name = 'ameco-json-data'
target_repository_url = 'git@git.nomics.world:dbnomics-json-data/{}.git'.format(target_repository_name)
used_categories_code = set()
......@@ -196,46 +192,8 @@ def main():
action='store_true',
help='fetch the whole history of the Git archive instead of only the latest version',
)
parser.add_argument(
'-p',
'--push',
action='store_true',
help='push commits to remote Git server',
)
args = parser.parse_args()
if not os.path.exists(args.source_dir):
assert not args.full
subprocess.check_call(
['git', 'clone', source_repository_url, args.source_dir],
)
if not os.path.exists(args.target_dir):
if args.full:
os.makedirs(args.target_dir)
else:
subprocess.check_call(
['git', 'clone', target_repository_url, args.target_dir],
)
target_git_dir = os.path.join(args.target_dir, '.git')
if os.path.exists(target_git_dir):
assert not args.full
else:
subprocess.check_call(
['git', 'init'],
cwd=args.target_dir,
)
subprocess.check_call(
['git', 'remote', 'add', 'origin', target_repository_url],
cwd=args.target_dir,
)
# Remove all tracked files.
subprocess.check_call(
['git', 'rm', '--ignore-unmatch', '-r', '.'],
cwd=args.target_dir,
)
datasets_code = set()
source_filenames = sorted(
(
......@@ -357,28 +315,6 @@ def main():
save_node(args.target_dir, provider)
subprocess.check_call(
['git', 'add', '--all'],
cwd=args.target_dir,
)
# Note: Don't fail when there is nothing to commit.
subprocess.call(
['git', 'commit', '-m', 'New fetch'],
cwd=args.target_dir,
)
if args.push:
# Note: Don't fail when there is nothing to push.
if args.full:
subprocess.call(
['git', 'push', '-f', 'origin', 'master'],
cwd=args.target_dir,
)
else:
subprocess.call(
['git', 'push', 'origin', 'master'],
cwd=args.target_dir,
)
return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment