started tag support

This commit is contained in:
Scott Chacon 2009-05-13 13:54:54 -07:00
parent d2782e7a41
commit dd8016ed49
3 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
*Warning: This plugin is not yet stabilized. Use to help me identify bugs, but it will be a few weeks before its fully stable.*
*Project status as of 5/11:* Pretty solid, but a bit slow - can losslessly convert most major scenarios and can handle projects up to several thousand commits. Encodings, submodules and octopus merges in Git are not handled well, nor are tags in either system. See TODO.txt for full list of things I'm working on.
*Project status as of 5/11:* Pretty solid, but a bit slow - can losslessly convert most major scenarios and can handle projects up to several thousand commits. Submodules and octopus merges in Git are not handled, nor are tags in either system. See TODO.txt for full list of things I'm working on.
Hg-Git Mercurial Plugin

View File

@ -80,14 +80,17 @@ def gfetch(ui, repo, remote_name='origin'):
git = GitHandler(repo, ui)
git.fetch(remote_name)
def gtest(ui, repo):
print repo.tags()
commands.norepo += " gclone"
cmdtable = {
"gclone":
(gclone, [],
_('Clone a git repository into an hg repository.'),
),
"gpush":
(gpush, [], _('hg gpush remote')),
"gtest":
(gtest, [], _('testing')),
"gexport":
(gexport, [], _('hg gexport')),
"gfetch":

View File

@ -118,6 +118,7 @@ class GitHandler(object):
def export(self):
self.export_git_objects()
self.export_hg_tags()
self.update_references()
self.save_map()
@ -158,6 +159,9 @@ class GitHandler(object):
c = self.map_git_get(hex(self.repo.changelog.tip()))
self.git.set_ref('refs/heads/master', c)
def export_hg_tags(self):
pass
def export_git_objects(self):
self.ui.status(_("exporting git objects\n"))
total = len(self.repo.changelog)
@ -465,6 +469,7 @@ class GitHandler(object):
if not self.map_hg_get(csha): # it's already here
self.import_git_commit(commit)
else:
# we need to get rename info for further upstream
self.pseudo_import_git_commit(commit)
self.update_hg_bookmarks(remote_name)
@ -534,10 +539,6 @@ class GitHandler(object):
def import_git_commit(self, commit):
self.ui.debug(_("importing: %s\n") % commit.id)
# TODO : find and use hg named branches
# TODO : add extra Git data (committer info) as extras to changeset
# TODO : (?) have to handle merge contexts at some point (two parent files, etc)
# TODO : Do something less coarse-grained than try/except on the
# get_file call for removed files