comparison hgext3rd/fastimport/hgimport.py @ 93:2ce33511de87

hgimport: Pass on deleteall_handler Fossil exports may not have parents, so just skip it for now.
author Roy Marples <roy@marples.name>
date Thu, 21 Jan 2021 20:42:10 +0000
parents efe678b023d3
children 3b398a887b95
comparison
equal deleted inserted replaced
92:efe678b023d3 93:2ce33511de87
399 self.copies = {} 399 self.copies = {}
400 400
401 # number of inline files seen in this commit 401 # number of inline files seen in this commit
402 self.inlinecount = 0 402 self.inlinecount = 0
403 403
404 def copy_handler(self, filecmd):
405 self.copies[filecmd.src_path] = filecmd.dest_path
406
407 def delete_handler(self, filecmd):
408 self.modified.append((filecmd.path, None))
409
410 def deleteall_handler(self, filecmd):
411 pass # Fossil fastexport will hit this with no parents
412
404 def modify_handler(self, filecmd): 413 def modify_handler(self, filecmd):
405 if filecmd.dataref: 414 if filecmd.dataref:
406 blobid = filecmd.dataref # blobid is the mark of the blob 415 blobid = filecmd.dataref # blobid is the mark of the blob
407 else: 416 else:
408 blobid = b"%s-inline:%d" % (self.command.id, self.inlinecount) 417 blobid = b"%s-inline:%d" % (self.command.id, self.inlinecount)
422 else: 431 else:
423 raise RuntimeError(b"mode %s unsupported" % filecmd.mode) 432 raise RuntimeError(b"mode %s unsupported" % filecmd.mode)
424 433
425 self.mode[filecmd.path] = mode 434 self.mode[filecmd.path] = mode
426 435
427 def delete_handler(self, filecmd):
428 self.modified.append((filecmd.path, None))
429
430 def copy_handler(self, filecmd):
431 self.copies[filecmd.src_path] = filecmd.dest_path
432
433 def rename_handler(self, filecmd): 436 def rename_handler(self, filecmd):
434 # copy oldname to newname and delete oldname 437 # copy oldname to newname and delete oldname
435 self.copies[filecmd.new_path] = filecmd.old_path 438 self.copies[filecmd.new_path] = filecmd.old_path
436 self.modified.append((filecmd.old_path, None)) 439 self.modified.append((filecmd.old_path, None))