contrib/convert-repo
changeset 1385 adb3de56635b
parent 1335 bea6356b8bca
child 1386 a1040345fdda
equal deleted inserted replaced
1384:d729850d52fa 1385:adb3de56635b
    59         parents = []
    59         parents = []
    60         for e in l[1:]:
    60         for e in l[1:]:
    61             n,v = e.split(" ", 1)
    61             n,v = e.split(" ", 1)
    62             if n == "author":
    62             if n == "author":
    63                 p = v.split()
    63                 p = v.split()
    64                 date = " ".join(p[-2:])
    64                 tm, tz = p[-2:]
    65                 author = " ".join(p[:-2])
    65                 author = " ".join(p[:-2])
    66                 if author[0] == "<": author = author[1:-1]
    66                 if author[0] == "<": author = author[1:-1]
    67             if n == "committer":
    67             if n == "committer":
    68                 p = v.split()
    68                 p = v.split()
    69                 date = " ".join(p[-2:])
    69                 tm, tz = p[-2:]
    70                 committer = " ".join(p[:-2])
    70                 committer = " ".join(p[:-2])
    71                 if committer[0] == "<": committer = committer[1:-1]
    71                 if committer[0] == "<": committer = committer[1:-1]
    72                 message += "\ncommitter: %s %s\n" % (committer, date)
    72                 message += "\ncommitter: %s\n" % v
    73             if n == "parent": parents.append(v)
    73             if n == "parent": parents.append(v)
       
    74 
       
    75         tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
       
    76         tz = int(tzs) * (int(tzh) * 3600 + int(tzm))
       
    77         date = tm + " " + str(tz)
    74         return (parents, author, date, message)
    78         return (parents, author, date, message)
    75 
    79 
    76     def gettags(self):
    80     def gettags(self):
    77         tags = {}
    81         tags = {}
    78         for f in os.listdir(self.path + "/refs/tags"):
    82         for f in os.listdir(self.path + "/refs/tags"):