예제 #1
0
def noto_checkout_master(dry_run=False):
    """Check out the noto repos at master.  Return True if ok, else log
  error and return False."""

    if not noto_check_clean():
        return False

    if not dry_run:
        for p in _REPO_PATHS:
            tool_utils.git_checkout(p, 'master')
    else:
        print('would have checked out master in %s' % (', '.join(_REPOS)))

    return True
예제 #2
0
def noto_checkout_master(dry_run=False):
  """Check out the noto repos at master.  Return True if ok, else log
  error and return False."""

  if not noto_check_clean():
    return False

  if not dry_run:
    for p in _REPO_PATHS:
      tool_utils.git_checkout(p, 'master')
  else:
    print 'would have checked out master in %s' % (', '.join(_REPOS))

  return True
예제 #3
0
def noto_checkout(
    fonts_tag="latest",
    emoji_tag="latest",
    cjk_tag="latest",
    verbose=False,
    dry_run=False,
):
    """Check out the noto repos at the provided tags.  Return True if ok,
  else log error and return False.  Default is 'latest' for the latest
  tag."""

    if not noto_check_clean():
        return False

    requested_tags = [fonts_tag, emoji_tag, cjk_tag]
    failed_tags = []
    resolved_tags = []
    for r, p, t in zip(_REPOS, _REPO_PATHS, requested_tags):
        found = False
        tag_info = tool_utils.git_tags(p)
        for _, tag, _ in tag_info:
            if t == "latest" or tag == t:
                resolved_tags.append(tag)
                found = True
                break
        if not found:
            failed_tags.append("%s: %s" % (r, t))

    if failed_tags:
        sys.stderr.write("failed to find:\n  %s\n" % "\n  ".join(failed_tags))
        return False

    if not dry_run:
        for p, t in zip(_REPO_PATHS, resolved_tags):
            tool_utils.git_checkout(p, t)

    if verbose or dry_run:
        print(
            "%schecked out:\n  %s"
            % (
                "would have " if dry_run else "",
                "\n  ".join("%s: %s" % (r, t) for r, t in zip(_REPOS, resolved_tags)),
            )
        )

    return True
예제 #4
0
def noto_checkout(fonts_tag='latest',
                  emoji_tag='latest',
                  cjk_tag='latest',
                  verbose=False,
                  dry_run=False):
    """Check out the noto repos at the provided tags.  Return True if ok,
  else log error and return False.  Default is 'latest' for the latest
  tag."""

    if not noto_check_clean():
        return False

    requested_tags = [fonts_tag, emoji_tag, cjk_tag]
    failed_tags = []
    resolved_tags = []
    for r, p, t in zip(_REPOS, _REPO_PATHS, requested_tags):
        found = False
        tag_info = tool_utils.git_tags(p)
        for _, tag, _ in tag_info:
            if t == 'latest' or tag == t:
                resolved_tags.append(tag)
                found = True
                break
        if not found:
            failed_tags.append('%s: %s' % (r, t))

    if failed_tags:
        print >> sys.stderr, 'failed to find:\n  %s' % '\n  '.join(failed_tags)
        return False

    if not dry_run:
        for p, t in zip(_REPO_PATHS, resolved_tags):
            tool_utils.git_checkout(p, t)

    if verbose or dry_run:
        print '%schecked out:\n  %s' % (
            'would have ' if dry_run else '', '\n  '.join(
                '%s: %s' % (r, t) for r, t in zip(_REPOS, resolved_tags)))

    return True
예제 #5
0
def noto_checkout(
    fonts_tag='latest', emoji_tag='latest', cjk_tag='latest', verbose=False,
    dry_run=False):
  """Check out the noto repos at the provided tags.  Return True if ok,
  else log error and return False.  Default is 'latest' for the latest
  tag."""

  if not noto_check_clean():
    return False

  requested_tags = [fonts_tag, emoji_tag, cjk_tag]
  failed_tags = []
  resolved_tags = []
  for r, p, t in zip(_REPOS, _REPO_PATHS, requested_tags):
    found = False
    tag_info = tool_utils.git_tags(p)
    for _, tag, _ in tag_info:
      if t == 'latest' or tag == t:
        resolved_tags.append(tag)
        found = True
        break
    if not found:
      failed_tags.append('%s: %s' % (r, t))

  if failed_tags:
    print >> sys.stderr, 'failed to find:\n  %s' % '\n  '.join(failed_tags)
    return False

  if not dry_run:
    for p, t in zip(_REPO_PATHS, resolved_tags):
      tool_utils.git_checkout(p, t)

  if verbose or dry_run:
    print '%schecked out:\n  %s' % (
        'would have ' if dry_run else '',
        '\n  '.join('%s: %s' % (r, t) for r, t in zip(_REPOS, resolved_tags)))

  return True