SCRIPTDIR = os.path.normpath(os.path.dirname(__file__))
+# Force a checkout to happen and throw away local changes
+FORCE_CHECKOUT = False
def manifest_get_commits(manifest):
if revision:
print("Checking out %s in %s" % (revision, repo_name))
git("fetch", *fetch_args, repository_path=repo_dir)
- git("checkout", "--detach", revision, repository_path=repo_dir)
+ checkout_args = ["--force"] if FORCE_CHECKOUT else []
+ checkout_args += ["--detach", revision]
+ git("checkout", *checkout_args, repository_path=repo_dir)
else:
print("Updating branch %s in %s" % (get_branch_name(repo_dir), repo_name))
git("pull", "--rebase", repository_path=repo_dir)
meson = get_meson()
targets_s = subprocess.check_output(meson + ['subprojects', 'download'])
repos_commits = manifest_get_commits(options.manifest)
+ FORCE_CHECKOUT = True
else:
repos_commits = {}