-def commit(details, files, branch, branchPrefix):
- global initialParent
- global users
- global lastChange
- global committedChanges
-
- epoch = details["time"]
- author = details["user"]
-
- gitStream.write("commit %s\n" % branch)
- gitStream.write("mark :%s\n" % details["change"])
- committedChanges.add(int(details["change"]))
- committer = ""
- if author in users:
- committer = "%s %s %s" % (users[author], epoch, tz)
- else:
- committer = "%s <a@b> %s %s" % (author, epoch, tz)
-
- gitStream.write("committer %s\n" % committer)
-
- gitStream.write("data <<EOT\n")
- gitStream.write(details["desc"])
- gitStream.write("\n[ imported from %s; change %s ]\n" % (branchPrefix, details["change"]))
- gitStream.write("EOT\n\n")
-
- if len(initialParent) > 0:
- gitStream.write("from %s\n" % initialParent)
- initialParent = ""
-
- #mergedBranches = Set()
- merges = Set()
-