예제 #1
0
def get_tags(ui,repo,marks_cache,mapping_cache,max):
  l=repo.tagslist()
  good,bad=[],[]
  for tag,node in l:
    if tag=='tip': continue
    rev=int(mapping_cache[node.encode('hex_codec')])
    cache_sha1=marks_cache.get(str(int(rev)+1))
    _,_,user,(_,_),_,desc,branch,_=get_changeset(ui,repo,rev)
    if int(rev)>int(max):
      bad.append([tag,branch,cache_sha1,rev,desc.split('\n')[0],user])
    else:
      good.append([tag,branch,cache_sha1,rev,desc.split('\n')[0],user])
  good.sort()
  bad.sort()
  return good,bad
예제 #2
0
def get_tags(ui, repo, marks_cache, mapping_cache, max):
    l = repo.tagslist()
    good, bad = [], []
    for tag, node in l:
        if tag == 'tip': continue
        rev = int(mapping_cache[node.encode('hex_codec')])
        cache_sha1 = marks_cache.get(str(int(rev) + 1))
        _, _, user, (_, _), _, desc, branch, _ = get_changeset(ui, repo, rev)
        if int(rev) > int(max):
            bad.append(
                [tag, branch, cache_sha1, rev,
                 desc.split('\n')[0], user])
        else:
            good.append(
                [tag, branch, cache_sha1, rev,
                 desc.split('\n')[0], user])
    good.sort()
    bad.sort()
    return good, bad
예제 #3
0
파일: hg2git.py 프로젝트: andreif/hg2git
def export_tags(ui,repo,marks_cache,start,end,count,authors):
  l=repo.tagslist()
  for tag,node in l:
    # ignore latest revision
    if tag=='tip': continue
    rev=repo.changelog.rev(node)
    # ignore those tags not in our import range
    if rev<start or rev>=end: continue

    ref=get_parent_mark(rev,marks_cache)
    if ref==None:
      sys.stderr.write('Failed to find reference for creating tag'
          ' %s at r%d\n' % (tag,rev))
      continue
    sys.stderr.write('Exporting tag [%s] at [hg r%d] [git %s]\n' % (tag,rev,ref))
    wr('reset refs/tags/%s' % tag)
    wr('from %s' % ref)
    wr()
    count=checkpoint(count)
  return count
예제 #4
0
def export_tags(ui, repo, marks_cache, start, end, count, authors):
    l = repo.tagslist()
    for tag, node in l:
        # ignore latest revision
        if tag == 'tip': continue
        rev = repo.changelog.rev(node)
        # ignore those tags not in our import range
        if rev < start or rev >= end: continue

        ref = get_parent_mark(rev, marks_cache)
        if ref == None:
            sys.stderr.write('Failed to find reference for creating tag'
                             ' %s at r%d\n' % (tag, rev))
            continue
        sys.stderr.write('Exporting tag [%s] at [hg r%d] [git %s]\n' %
                         (tag, rev, ref))
        wr('reset refs/tags/%s' % tag)
        wr('from %s' % ref)
        wr()
        count = checkpoint(count)
    return count
예제 #5
0
def export_tags(ui,repo,old_marks,mapping_cache,count,authors):
  l=repo.tagslist()
  for tag,node in l:
    tag=sanitize_name(tag,"tag")
    # ignore latest revision
    if tag=='tip': continue
    # ignore tags to nodes that are missing (ie, 'in the future')
    if node.encode('hex_codec') not in mapping_cache:
      sys.stderr.write('Tag %s refers to unseen node %s\n' % (tag, node.encode('hex_codec')))
      continue

    rev=int(mapping_cache[node.encode('hex_codec')])

    ref=revnum_to_revref(rev, old_marks)
    if ref==None:
      sys.stderr.write('Failed to find reference for creating tag'
          ' %s at r%d\n' % (tag,rev))
      continue
    sys.stderr.write('Exporting tag [%s] at [hg r%d] [git %s]\n' % (tag,rev,ref))
    wr('reset refs/tags/%s' % tag)
    wr('from %s' % ref)
    wr()
    count=checkpoint(count)
  return count