contrib/convert-repo
changeset 4082 6b2909e84203
parent 4062 516f883e3d79
child 4102 06d65498f73b
child 4112 59de487f43d7
equal deleted inserted replaced
4081:e6d26e71f049 4082:6b2909e84203
   251             elif line.startswith("Mbinary "):
   251             elif line.startswith("Mbinary "):
   252                 count = int(self.readp.readline()[:-1])
   252                 count = int(self.readp.readline()[:-1])
   253                 data = self.readp.read(count)
   253                 data = self.readp.read(count)
   254             else:
   254             else:
   255                 if line == "ok\n":
   255                 if line == "ok\n":
   256                     return (data, "x" in mode)
   256                     return (data, "x" in mode and "x" or "")
   257                 elif line.startswith("E "):
   257                 elif line.startswith("E "):
   258                     warn("cvs server: %s\n" % line[2:])
   258                     warn("cvs server: %s\n" % line[2:])
   259                 elif line.startswith("Remove"):
   259                 elif line.startswith("Remove"):
   260                     l = self.readp.readline()
   260                     l = self.readp.readline()
   261                     l = self.readp.readline()
   261                     l = self.readp.readline()
   319             if "\t" not in l: continue
   319             if "\t" not in l: continue
   320             m, f = l[:-1].split("\t")
   320             m, f = l[:-1].split("\t")
   321             m = m.split()
   321             m = m.split()
   322             h = m[3]
   322             h = m[3]
   323             p = (m[1] == "100755")
   323             p = (m[1] == "100755")
   324             self.modecache[(f, h)] = p
   324             s = (m[1] == "120000")
       
   325             self.modecache[(f, h)] = (p and "x") or (s and "l") or ""
   325             changes.append((f, h))
   326             changes.append((f, h))
   326         return changes
   327         return changes
   327 
   328 
   328     def getcommit(self, version):
   329     def getcommit(self, version):
   329         c = self.catfile(version, "commit") # read the commit hash
   330         c = self.catfile(version, "commit") # read the commit hash
   388     def getheads(self):
   389     def getheads(self):
   389         h = self.repo.changelog.heads()
   390         h = self.repo.changelog.heads()
   390         return [ hg.hex(x) for x in h ]
   391         return [ hg.hex(x) for x in h ]
   391 
   392 
   392     def putfile(self, f, e, data):
   393     def putfile(self, f, e, data):
   393         self.repo.wwrite(f, data, e and 'x' or '')
   394         self.repo.wwrite(f, data, e)
   394         if self.repo.dirstate.state(f) == '?':
   395         if self.repo.dirstate.state(f) == '?':
   395             self.repo.dirstate.update([f], "a")
   396             self.repo.dirstate.update([f], "a")
   396 
   397 
   397     def delfile(self, f):
   398     def delfile(self, f):
   398         try:
   399         try: