diff --git a/release_scripts/localization_scripts/diffscript.py b/release_scripts/localization_scripts/diffscript.py index df805d7236..4f207f3f9f 100644 --- a/release_scripts/localization_scripts/diffscript.py +++ b/release_scripts/localization_scripts/diffscript.py @@ -65,7 +65,7 @@ def main(): help='The commit for current release.') parser.add_argument('-nc', '--no-commits', dest='no_commits', action='store_true', default=False, required=False, help="Suppresses adding commits to the generated csv header.") - parser.add_argument('-l', '--language', dest='language', type=str, default='HEAD', required=False, + parser.add_argument('-l', '--language', dest='language', type=str, default=None, required=False, help='Specify the language in order to determine the first commit to use (i.e. \'ja\' for ' 'Japanese. This flag overrides the first-commit flag.') parser.add_argument('-vr', '--value-regex', dest='value_regex', type=str, default=None, required=False, @@ -81,8 +81,9 @@ def main(): output_path = args.output_path commit_1_id = args.commit_1_id value_regex = args.value_regex - if args.language is not None: - commit_1_id = get_commit_for_language(args.language) + lang = args.language + if lang is not None: + commit_1_id = get_commit_for_language(lang) if commit_1_id is None: print('Either the first commit or language flag need to be specified. If specified, the language file, ' + diff --git a/release_scripts/localization_scripts/gitutil.py b/release_scripts/localization_scripts/gitutil.py index 333bee1440..43c20e2ce0 100644 --- a/release_scripts/localization_scripts/gitutil.py +++ b/release_scripts/localization_scripts/gitutil.py @@ -100,7 +100,7 @@ def get_commit_id(repo_path: str, commit_id: str) -> str: The hash for the commit in the repo. """ repo = Repo(repo_path, search_parent_directories=True) - commit = repo.commit(commit_id) + commit = repo.commit(commit_id.strip()) return str(commit.hexsha) @@ -118,7 +118,7 @@ def get_property_files_diff(repo_path: str, commit_1_id: str, commit_2_id: str, All found item changes in values of keys between the property files. """ - diffs = get_diff(repo_path, commit_1_id, commit_2_id) + diffs = get_diff(repo_path, commit_1_id.strip(), commit_2_id.strip()) for diff in diffs: rel_path = get_rel_path(diff) if rel_path is None or not rel_path.endswith('.' + property_file_extension): @@ -160,7 +160,7 @@ def get_property_file_entries(repo_path: str, at_commit: str = 'HEAD', """ repo = Repo(repo_path, search_parent_directories=True) - commit = repo.commit(at_commit) + commit = repo.commit(at_commit.strip()) for item in list_paths(commit.tree): path, blob = item if path.endswith(property_file_extension): diff --git a/release_scripts/localization_scripts/lastupdated.properties b/release_scripts/localization_scripts/lastupdated.properties index e69de29bb2..8a337511e7 100644 --- a/release_scripts/localization_scripts/lastupdated.properties +++ b/release_scripts/localization_scripts/lastupdated.properties @@ -0,0 +1 @@ +# in format of bundles..lastupdated= \ No newline at end of file