--- a/hgext/convert/git.py Sun Jul 01 12:58:08 2007 -0700
+++ b/hgext/convert/git.py Sun Jul 01 15:02:15 2007 -0700
@@ -5,7 +5,7 @@
from common import NoRepo, commit, converter_source
class convert_git(converter_source):
- def __init__(self, ui, path):
+ def __init__(self, ui, path, rev=None):
if os.path.isdir(path + "/.git"):
path += "/.git"
if not os.path.exists(path + "/objects"):
@@ -13,10 +13,12 @@
self.path = path
self.ui = ui
+ self.rev = rev
self.encoding = 'utf-8'
def getheads(self):
- fh = os.popen("GIT_DIR=%s git-rev-parse --verify HEAD" % self.path)
+ rev = self.rev or 'HEAD'
+ fh = os.popen("GIT_DIR=%s git-rev-parse --verify %s" % (self.path, rev))
return [fh.read()[:-1]]
def catfile(self, rev, type):