contrib/convert-repo
changeset 4111 06d65498f73b
parent 4082 6b2909e84203
child 4114 d5011e347476
equal deleted inserted replaced
4101:e2ed92f4c0f7 4111:06d65498f73b
   291 class convert_git:
   291 class convert_git:
   292     def __init__(self, path):
   292     def __init__(self, path):
   293         if os.path.isdir(path + "/.git"):
   293         if os.path.isdir(path + "/.git"):
   294             path += "/.git"
   294             path += "/.git"
   295         self.path = path
   295         self.path = path
   296         if not os.path.exists(path + "/HEAD"):
   296         if not os.path.exists(path + "/objects"):
   297             raise NoRepo("couldn't open GIT repo %s" % path)
   297             raise NoRepo("couldn't open GIT repo %s" % path)
   298 
   298 
   299     def getheads(self):
   299     def getheads(self):
   300         fh = os.popen("GIT_DIR=%s git-rev-parse --verify HEAD" % self.path)
   300         fh = os.popen("GIT_DIR=%s git-rev-parse --verify HEAD" % self.path)
   301         return [fh.read()[:-1]]
   301         return [fh.read()[:-1]]