Adjust to recent Mercurial API in hg-git mode tag handling

This commit is contained in:
Mark Nauwelaerts
2017-09-21 12:18:11 +02:00
parent 2ab9ae9073
commit dfa6910cab

View File

@@ -1302,7 +1302,13 @@ def do_push_hg(parser):
tagnode, branch = write_tag(parser.repo, tag, node, msg, author)
p_revs[tagnode] = 'refs/heads/branches/' + gitref(branch)
else:
fp = parser.repo.opener('localtags', 'a')
if hasattr(parser.repo, 'opener'):
fp = parser.repo.opener('localtags', 'a')
else:
try:
fp = parser.repo.vfs('localtags', 'r+')
except IOError:
fp = parser.repo.vfs('localtags', 'a')
fp.write('%s %s\n' % (node, tag))
fp.close()
p_revs[bnode] = ref