##// END OF EJS Templates
Revert convert-repo changes
Matt Mackall -
r1715:40346aa6 default
parent child Browse files
Show More
@@ -21,7 +21,7 b''
21 # interrupted and can be run repeatedly to copy new commits.
21 # interrupted and can be run repeatedly to copy new commits.
22
22
23 import sys, os, zlib, sha, time
23 import sys, os, zlib, sha, time
24 from mercurial import hg, ui, util, commands
24 from mercurial import hg, ui, util
25
25
26 class convert_git:
26 class convert_git:
27 def __init__(self, path):
27 def __init__(self, path):
@@ -113,7 +113,7 b' class convert_mercurial:'
113 except:
113 except:
114 pass
114 pass
115
115
116 def putcommit(self, files, parents, author, date, text):
116 def putcommit(self, files, parents, author, dest, text):
117 seen = {}
117 seen = {}
118 pl = []
118 pl = []
119 for p in parents:
119 for p in parents:
@@ -129,13 +129,8 b' class convert_mercurial:'
129 while parents:
129 while parents:
130 p1 = p2
130 p1 = p2
131 p2 = parents.pop(0)
131 p2 = parents.pop(0)
132 self.repo.dirstate.setparents(hg.bin(p1), hg.bin(p2))
132 self.repo.rawcommit(files, text, author, dest,
133 if len(files) > 0:
133 hg.bin(p1), hg.bin(p2))
134 olddir = os.getcwd()
135 os.chdir(self.path)
136 commands.addremove(self.repo.ui, self.repo, *files)
137 os.chdir(olddir)
138 self.repo.commit(files, text, author, date)
139 text = "(octopus merge fixup)\n"
134 text = "(octopus merge fixup)\n"
140 p2 = hg.hex(self.repo.changelog.tip())
135 p2 = hg.hex(self.repo.changelog.tip())
141
136
@@ -265,6 +260,7 b' class convert:'
265 t = self.toposort(parents)
260 t = self.toposort(parents)
266 t = [n for n in t if n not in self.map]
261 t = [n for n in t if n not in self.map]
267 num = len(t)
262 num = len(t)
263 c = None
268
264
269 for c in t:
265 for c in t:
270 num -= 1
266 num -= 1
@@ -279,7 +275,7 b' class convert:'
279 if v in self.map:
275 if v in self.map:
280 ctags[k] = self.map[v]
276 ctags[k] = self.map[v]
281
277
282 if ctags:
278 if c and ctags:
283 nrev = self.dest.puttags(ctags)
279 nrev = self.dest.puttags(ctags)
284 # write another hash correspondence to override the previous
280 # write another hash correspondence to override the previous
285 # one so we don't end up with extra tag heads
281 # one so we don't end up with extra tag heads
General Comments 0
You need to be logged in to leave comments. Login now