##// END OF EJS Templates
darcs2hg.py: use darcs patch hash as patch identifier...
Nils Decker -
r2585:5ec2dded default
parent child Browse files
Show More
@@ -74,7 +74,8 b' def darcs_changes(darcsRepo):'
74 else: comm = comm[0].childNodes[0].data
74 else: comm = comm[0].childNodes[0].data
75 author = patch_node.getAttribute("author")
75 author = patch_node.getAttribute("author")
76 date = patch_node.getAttribute("date")
76 date = patch_node.getAttribute("date")
77 yield author, date, name, comm
77 hash = patch_node.getAttribute("hash")
78 yield hash, author, date, name, comm
78
79
79 def darcs_pull(hg_repo, darcs_repo, change):
80 def darcs_pull(hg_repo, darcs_repo, change):
80 cmd("darcs pull '%s' --all --patches='%s'" % (darcs_repo, change), hg_repo)
81 cmd("darcs pull '%s' --all --patches='%s'" % (darcs_repo, change), hg_repo)
@@ -120,9 +121,9 b' if __name__ == "__main__":'
120 cmd("hg init '%s'" % (hg_repo))
121 cmd("hg init '%s'" % (hg_repo))
121 cmd("darcs initialize", hg_repo)
122 cmd("darcs initialize", hg_repo)
122 # Get the changes from the Darcs repository
123 # Get the changes from the Darcs repository
123 for author, date, summary, description in darcs_changes(darcs_repo):
124 for hash, author, date, summary, description in darcs_changes(darcs_repo):
124 text = summary + "\n" + description
125 text = summary + "\n" + description
125 darcs_pull(hg_repo, darcs_repo, summary)
126 darcs_pull(hg_repo, darcs_repo, hash)
126 epoch = int(mktime(strptime(date, '%Y%m%d%H%M%S')))
127 epoch = int(mktime(strptime(date, '%Y%m%d%H%M%S')))
127 hg_commit(hg_repo, text, author, epoch)
128 hg_commit(hg_repo, text, author, epoch)
128
129
General Comments 0
You need to be logged in to leave comments. Login now