When bootstrap.py tries to move from a newer to an older branch, it can fail with sync errors:
When running this test:
BOOTSTRAP="${SANDBOX_DIR}/chromite/scripts/bootstrap --debug --buildbot --notests --buildroot ~/sand/buildroot"
${BOOTSTRAP} mario-incremental &&
${BOOTSTRAP} -b release-R57-9202.B mario-incremental &&
${BOOTSTRAP} -b release-R35-5712.B mario-incremental
It fails on the R35 checkout with:
error: Cannot fetch chromeos/toolchain-utils (GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync src/third_party/toolchain-utils` to proceed.)
Exception in thread Thread-100:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/google/home/dgarrett/sand/buildroot/.repo/repo/subcmds/sync.py", line 276, in _FetchProjectList
success = self._FetchHelper(opt, project, *args, **kwargs)
File "/usr/local/google/home/dgarrett/sand/buildroot/.repo/repo/subcmds/sync.py", line 321, in _FetchHelper
cache_dir=opt.cache_dir)
File "/usr/local/google/home/dgarrett/sand/buildroot/.repo/repo/project.py", line 1293, in Sync_NetworkHalf
self._InitGitDir(force_sync=force_sync)
File "/usr/local/google/home/dgarrett/sand/buildroot/.repo/repo/project.py", line 2346, in _InitGitDir
raise e
GitError: --force-sync not enabled; cannot overwrite a local work tree. If you're comfortable with the possibility of losing the work tree's git metadata, use `repo sync --force-sync src/third_party/toolchain-utils` to proceed.
Comment 1 by dgarr...@chromium.org
, Jan 26 2017