Example #1
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
Example #2
0
def export_tags(ui,repo,old_marks,mapping_cache,count,authors,tagsmap):
  l=repo.tagslist()
  for tag,node in l:
    # Remap the branch name
    tag=sanitize_name(tagsmap.get(tag,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
Example #3
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
Example #4
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
Example #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