예제 #1
0
def _update_subproject(deps,
                       state,
                       subproject,
                       module_path,
                       verify_only=False):
    desired_revision = deps.get_revision_for(subproject)
    if desired_revision is None:
        logging.warning('Skipping unknown subproject %s', subproject)
        return

    logging.info('%s Fetching information about %s', subproject,
                 desired_revision)

    # Convert the desired revision into a hash (if not already one).
    desired_revision = git.get_ref_hash(desired_revision, cwd=module_path)

    # Get the current version of the repo. We will need this to rebase the mods
    # after we roll forward.
    current_revision = git.get_head_revision(cwd=module_path)

    if desired_revision == current_revision:
        logging.info('%s is already at %s', subproject, desired_revision)

        # If we are doing an update, we can stop now, and assume that no work needs
        # to be done to the mods for that submodule.
        if not verify_only:
            return

    if not state.verify_submodule_path(current_revision, module_path):
        return

    # If we are only verifying, stop here before making any actual changes.
    if verify_only:
        return

    logging.info('%s checking out %s', subproject, desired_revision)
    git.force_checkout_revision(desired_revision, cwd=module_path)
    git.add_to_staging(module_path)

    logging.info('%s rebasing mods', subproject)
    state.rebase_submodule_path(current_revision, module_path)
예제 #2
0
def _update_subproject(deps, state, subproject, module_path, verify_only=False):
  desired_revision = deps.get_revision_for(subproject)
  if desired_revision is None:
    logging.warning('Skipping unknown subproject %s', subproject)
    return

  logging.info('%s Fetching information about %s', subproject, desired_revision)

  # Convert the desired revision into a hash (if not already one).
  desired_revision = git.get_ref_hash(desired_revision, cwd=module_path)

  # Get the current version of the repo. We will need this to rebase the mods
  # after we roll forward.
  current_revision = git.get_head_revision(cwd=module_path)

  if desired_revision == current_revision:
    logging.info('%s is already at %s', subproject, desired_revision)

    # If we are doing an update, we can stop now, and assume that no work needs
    # to be done to the mods for that submodule.
    if not verify_only:
      return

  if not state.verify_submodule_path(current_revision, module_path):
    return

  # If we are only verifying, stop here before making any actual changes.
  if verify_only:
    return

  logging.info('%s checking out %s', subproject, desired_revision)
  git.force_checkout_revision(desired_revision, cwd=module_path)
  git.add_to_staging(module_path)

  logging.info('%s rebasing mods', subproject)
  state.rebase_submodule_path(current_revision, module_path)
예제 #3
0
파일: git_test.py 프로젝트: epowers/arc
 def test_get_head_revision(self):
   self.assertIsNotNone(git.get_head_revision())
예제 #4
0
파일: git_test.py 프로젝트: zhangpf/arc
 def test_get_head_revision(self):
     self.assertIsNotNone(git.get_head_revision())