bisect-kit: migrate chromeos bisector to use codechange module

After this CL, chromeos localbuild bisector is more robust and can
handle following issues:
 - add and remove repo projects
 - manifest snapshot racing

Like android local build bisector, the setup step of chromeos checkout
is changed as well. Now you have to make a repo mirror and sync the
tree from the mirror. The exact steps are:

 1. setup a repo mirror
    $ cd $CHROMEOS_REPO_MIRROR_DIR
    $ repo init ...<original flags>... --mirror
    $ mkdir .repo/local_manifests
    $ cat << END > .repo/local_manifests/manifest-versions.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <project name="chromeos/manifest-versions" remote="cros-internal" />
    </manifest>
    END
    $ repo sync

 2. checkout chromeos tree from the mirror
    $ cd $CHROMEOS_ROOT
    $ repo init ...<original flags>...  --reference=$CHROMEOS_REPO_MIRROR_DIR
    $ repo sync

 3. specify --chromeos_repo_mirror_dir $CHROMEOS_REPO_MIRROR_DIR when you
    use bisect_cros_repo.py and switch_cros_localbuild.py

Due to crbug.com/864886, this bisector can only work with version of
chromite after 2018-07-19. Workaround will be provided in separate CL
later.

BUG=chromium:827092
TEST=unit test and following commands
$ ./bisect_cros_repo.py init --old R69-10883.0.0 --new R69-10884.0.0 \
  --chromeos_root $CHROMEOS_ROOT \
  --chromeos_repo_mirror_dir $CHROMEOS_REPO_MIRROR_DIR \
  --board samus
$ ./switch_cros_localbuild.py samus-test R69-10883.0.0~R69-10884.0.0/10 \
  --chromeos_root $CHROMEOS_ROOT \
  --chromeos_repo_mirror_dir $CHROMEOS_REPO_MIRROR_DIR

Change-Id: I594d850f80a9ff05b7241106bdc7ff191cf12676
Reviewed-on: https://chromium-review.googlesource.com/1143114
Commit-Ready: Kuang-che Wu <kcwu@chromium.org>
Tested-by: Kuang-che Wu <kcwu@chromium.org>
Reviewed-by: Chi-Ngai Wan <cnwan@google.com>
diff --git a/bisect_kit/android_util.py b/bisect_kit/android_util.py
index 524a4d9..a2cffe1 100644
--- a/bisect_kit/android_util.py
+++ b/bisect_kit/android_util.py
@@ -239,8 +239,9 @@
   def parse_spec(self, spec):
     logging.debug('parse_spec %s', spec.name)
     manifest_content = self._load_manifest_content(spec)
-    manifest_url = repo_util.get_manifest_url(self.config['android_root'])
-    spec.entries = repo_util.parse_manifest(manifest_content, manifest_url)
+    parser = repo_util.ManifestParser(self.manifest_dir)
+    root = parser.parse_single_xml(manifest_content, allow_include=False)
+    spec.entries = parser.process_parsed_result(root)
     if spec.spec_type == codechange.SPEC_FIXED:
       assert spec.is_static()