comparison hg_delta_editor.py @ 154:6fa97cfbf62f

fetch: Refactor extra creation to be shared by real and diff replay. Add convert-compatible meta information to extra.
author Augie Fackler <durin42@gmail.com>
date Tue, 23 Dec 2008 11:10:32 -0600
parents 22162380c4b9
children ba801f44d240
comparison
equal deleted inserted replaced
153:46f6b872c988 154:6fa97cfbf62f
393 self.ui.status('Marked branch %s as closed.\n' % (branch or 393 self.ui.status('Marked branch %s as closed.\n' % (branch or
394 'default')) 394 'default'))
395 for branch, files in branch_batches.iteritems(): 395 for branch, files in branch_batches.iteritems():
396 if branch in self.commit_branches_empty and files: 396 if branch in self.commit_branches_empty and files:
397 del self.commit_branches_empty[branch] 397 del self.commit_branches_empty[branch]
398 extra = {}
399 files = dict(files) 398 files = dict(files)
400 399
401 parents = (self.get_parent_revision(rev.revnum, branch), 400 parents = (self.get_parent_revision(rev.revnum, branch),
402 revlog.nullid) 401 revlog.nullid)
403 if parents[0] in closed_revs and branch in self.branches_to_delete: 402 if parents[0] in closed_revs and branch in self.branches_to_delete:
404 continue 403 continue
404 # TODO this needs to be fixed with the new revmap
405 extra = our_util.build_extra(rev.revnum, branch,
406 open(self.uuid_file).read(),
407 self.subdir)
405 if branch is not None: 408 if branch is not None:
406 if (branch not in self.branches 409 if (branch not in self.branches
407 and branch not in self.repo.branchtags()): 410 and branch not in self.repo.branchtags()):
408 continue 411 continue
409 extra['branch'] = branch
410 parent_ctx = self.repo.changectx(parents[0]) 412 parent_ctx = self.repo.changectx(parents[0])
411 def filectxfn(repo, memctx, path): 413 def filectxfn(repo, memctx, path):
412 current_file = files[path] 414 current_file = files[path]
413 if current_file in self.deleted_files: 415 if current_file in self.deleted_files:
414 raise IOError() 416 raise IOError()
449 def del_all_files(*args): 451 def del_all_files(*args):
450 raise IOError 452 raise IOError
451 # True here meant nuke all files, shouldn't happen with branch closing 453 # True here meant nuke all files, shouldn't happen with branch closing
452 if self.commit_branches_empty[branch]: #pragma: no cover 454 if self.commit_branches_empty[branch]: #pragma: no cover
453 assert False, 'Got asked to commit non-closed branch as empty with no files. Please report this issue.' 455 assert False, 'Got asked to commit non-closed branch as empty with no files. Please report this issue.'
454 extra = {} 456 extra = our_util.build_extra(rev.revnum, branch,
455 if branch: 457 open(self.uuid_file).read(),
456 extra['branch'] = branch 458 self.subdir)
457 current_ctx = context.memctx(self.repo, 459 current_ctx = context.memctx(self.repo,
458 (ha, node.nullid), 460 (ha, node.nullid),
459 rev.message or ' ', 461 rev.message or ' ',
460 [], 462 [],
461 del_all_files, 463 del_all_files,