[PATCH] Updated convert-repo script (1/3 Git 1.3.0 fix)

Alexis S. L. Carvalho alexis at cecm.usp.br
Tue May 2 18:09:02 CDT 2006


Thus spake Sébastien Pierre:
> Le mardi 02 mai 2006 à 17:04 -0300, Alexis S. L. Carvalho a écrit :
> 
> > >      def getheads(self):
> > > -        return [file(self.path + "/HEAD").read()[:-1]]
> > > +        # On some versions of git, the HEAD file last line is like
> > > +        # ref: refs/heads/master
> > > +        # And we only want "master" here
> > > +        head = file(self.path + "/HEAD").read()[:-1]
> > > +        head = head.split("/")[-1]
> > > +        return [head]
> > 
> > I'm still not up to speed with git, but I'm reasonably sure that you
> > just want to call "git-rev-parse HEAD" here (setting GIT_DIR like the
> > other calls in this file).
> 
> I'm not the original author of the "convert-repo" script, so I don't
> really know if that is what was actually intended, but this patch fixes
> the compatibilty problem with git-1.3.0.

I meant that instead of poking into the file, it's probably better to
use git's interface to it - git-rev-parse HEAD

> There are two other patches coming as soon as I figure out how to access
> the first changeset using Mercurial Python API.

As I mentioned in the other message, current convert-repo can handle
doing the initial commit just fine - you just have to manually create
the destination repository.

Alexis


More information about the Mercurial mailing list