##// END OF EJS Templates
convert: svn: get parent for branch creation events
Brendan Cully -
r4795:ea618c59 default
parent child Browse files
Show More
@@ -124,8 +124,10 b' class convert_svn(converter_source):'
124
124
125 self.head = self.rev(self.last_changed)
125 self.head = self.rev(self.last_changed)
126
126
127 def rev(self, revnum):
127 def rev(self, revnum, module=None):
128 return (u"svn:%s%s@%s" % (self.uuid, self.module, revnum)).decode(self.encoding)
128 if not module:
129 module = self.module
130 return (u"svn:%s%s@%s" % (self.uuid, module, revnum)).decode(self.encoding)
129
131
130 def revnum(self, rev):
132 def revnum(self, rev):
131 return int(rev.split('@')[-1])
133 return int(rev.split('@')[-1])
@@ -243,6 +245,7 b' class convert_svn(converter_source):'
243 copies = {}
245 copies = {}
244 entries = []
246 entries = []
245 rev = self.rev(revnum)
247 rev = self.rev(revnum)
248 parents = []
246 try:
249 try:
247 branch = self.module.split("/")[-1]
250 branch = self.module.split("/")[-1]
248 if branch == 'trunk':
251 if branch == 'trunk':
@@ -253,10 +256,13 b' class convert_svn(converter_source):'
253 for path in orig_paths:
256 for path in orig_paths:
254 # self.ui.write("path %s\n" % path)
257 # self.ui.write("path %s\n" % path)
255 if path == self.module: # Follow branching back in history
258 if path == self.module: # Follow branching back in history
259 import pdb
260 pdb.set_trace()
256 ent = orig_paths[path]
261 ent = orig_paths[path]
257 if ent:
262 if ent:
258 if ent.copyfrom_path:
263 if ent.copyfrom_path:
259 self.modulemap[ent.copyfrom_rev] = ent.copyfrom_path
264 self.modulemap[ent.copyfrom_rev] = ent.copyfrom_path
265 parents = [self.rev(ent.copyfrom_rev, ent.copyfrom_path)]
260 else:
266 else:
261 self.ui.debug("No copyfrom path, don't know what to do.\n")
267 self.ui.debug("No copyfrom path, don't know what to do.\n")
262 # Maybe it was added and there is no more history.
268 # Maybe it was added and there is no more history.
@@ -268,9 +274,6 b' class convert_svn(converter_source):'
268 continue
274 continue
269 entry = entrypath.decode(self.encoding)
275 entry = entrypath.decode(self.encoding)
270 ent = orig_paths[path]
276 ent = orig_paths[path]
271 if not entrypath:
272 # TODO: branch creation event
273 pass
274
277
275 kind = svn.ra.check_path(self.ra, entrypath, revnum)
278 kind = svn.ra.check_path(self.ra, entrypath, revnum)
276 if kind == svn.core.svn_node_file:
279 if kind == svn.core.svn_node_file:
@@ -433,7 +436,7 b' class convert_svn(converter_source):'
433 cset = commit(author=author,
436 cset = commit(author=author,
434 date=util.datestr(date),
437 date=util.datestr(date),
435 desc=log,
438 desc=log,
436 parents=[],
439 parents=parents,
437 copies=copies,
440 copies=copies,
438 branch=branch)
441 branch=branch)
439
442
General Comments 0
You need to be logged in to leave comments. Login now