remote-bzr: improve tag handling
revision_history() is deprecated and doesn't do what we want (revno instead of dotted_revno?). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5ff4fc649e
commit
fa7285dc3d
@ -25,6 +25,7 @@ bzrlib.plugin.load_plugins()
|
|||||||
|
|
||||||
import bzrlib.generate_ids
|
import bzrlib.generate_ids
|
||||||
import bzrlib.transport
|
import bzrlib.transport
|
||||||
|
import bzrlib.errors
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -335,12 +336,9 @@ def export_branch(branch, name):
|
|||||||
|
|
||||||
def export_tag(repo, name):
|
def export_tag(repo, name):
|
||||||
global tags
|
global tags
|
||||||
try:
|
print "reset refs/tags/%s" % name
|
||||||
print "reset refs/tags/%s" % name
|
print "from :%u" % rev_to_mark(tags[name])
|
||||||
print "from :%u" % rev_to_mark(tags[name])
|
print
|
||||||
print
|
|
||||||
except KeyError:
|
|
||||||
warn("TODO: fetch tag '%s'" % name)
|
|
||||||
|
|
||||||
def do_import(parser):
|
def do_import(parser):
|
||||||
global dirname
|
global dirname
|
||||||
@ -660,16 +658,25 @@ def do_capabilities(parser):
|
|||||||
|
|
||||||
print
|
print
|
||||||
|
|
||||||
|
def ref_is_valid(name):
|
||||||
|
return not True in [c in name for c in '~^: \\']
|
||||||
|
|
||||||
def do_list(parser):
|
def do_list(parser):
|
||||||
global tags
|
global tags
|
||||||
print "? refs/heads/%s" % 'master'
|
print "? refs/heads/%s" % 'master'
|
||||||
|
|
||||||
history = parser.repo.revision_history()
|
branch = parser.repo
|
||||||
for tag, revid in parser.repo.tags.get_tag_dict().items():
|
branch.lock_read()
|
||||||
if revid not in history:
|
for tag, revid in branch.tags.get_tag_dict().items():
|
||||||
|
try:
|
||||||
|
branch.revision_id_to_dotted_revno(revid)
|
||||||
|
except bzrlib.errors.NoSuchRevision:
|
||||||
|
continue
|
||||||
|
if not ref_is_valid(tag):
|
||||||
continue
|
continue
|
||||||
print "? refs/tags/%s" % tag
|
print "? refs/tags/%s" % tag
|
||||||
tags[tag] = revid
|
tags[tag] = revid
|
||||||
|
branch.unlock()
|
||||||
print "@refs/heads/%s HEAD" % 'master'
|
print "@refs/heads/%s HEAD" % 'master'
|
||||||
print
|
print
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user