contrib/convert-repo
changeset 2658 2be3001847cb
parent 2649 e6a7a6a33a62
child 3825 158fce02dc40
equal deleted inserted replaced
2657:6024216754f4 2658:2be3001847cb
    26 class convert_git:
    26 class convert_git:
    27     def __init__(self, path):
    27     def __init__(self, path):
    28         self.path = path
    28         self.path = path
    29 
    29 
    30     def getheads(self):
    30     def getheads(self):
    31         return [file(self.path + "/HEAD").read()[:-1]]
    31         fh = os.popen("GIT_DIR=%s git-rev-parse --verify HEAD" % self.path)
       
    32         return [fh.read()[:-1]]
    32 
    33 
    33     def catfile(self, rev, type):
    34     def catfile(self, rev, type):
    34         if rev == "0" * 40: raise IOError()
    35         if rev == "0" * 40: raise IOError()
    35         fh = os.popen("GIT_DIR=%s git-cat-file %s %s 2>/dev/null" % (self.path, type, rev))
    36         fh = os.popen("GIT_DIR=%s git-cat-file %s %s 2>/dev/null" % (self.path, type, rev))
    36         return fh.read()
    37         return fh.read()