comparison hg_delta_editor.py @ 321:b6c6d32c8ef1

Add an option to clone without branch names.
author Augie Fackler <durin42@gmail.com>
date Fri, 08 May 2009 16:11:08 -0500
parents 5dc8fee7fc96
children 05cd4a5138bf
comparison
equal deleted inserted replaced
320:1ba8ed29148e 321:b6c6d32c8ef1
631 parentctx = self.repo.changectx(ha) 631 parentctx = self.repo.changectx(ha)
632 parents = (ha, closed) 632 parents = (ha, closed)
633 def del_all_files(*args): 633 def del_all_files(*args):
634 raise IOError 634 raise IOError
635 files = parentctx.manifest().keys() 635 files = parentctx.manifest().keys()
636 extra = {}
637 if not self.opts.get('svn_no_branchnames', False):
638 extra['branch'] = 'closed-branches'
636 current_ctx = context.memctx(self.repo, 639 current_ctx = context.memctx(self.repo,
637 parents, 640 parents,
638 rev.message or ' ', 641 rev.message or ' ',
639 files, 642 files,
640 del_all_files, 643 del_all_files,
641 self.authors[rev.author], 644 self.authors[rev.author],
642 date, 645 date,
643 {'branch': 'closed-branches'}) 646 extra)
644 new_hash = self.repo.commitctx(current_ctx) 647 new_hash = self.repo.commitctx(current_ctx)
645 self.ui.status('Marked branch %s as closed.\n' % (branch or 648 self.ui.status('Marked branch %s as closed.\n' % (branch or
646 'default')) 649 'default'))
647 for branch, files in branch_batches.iteritems(): 650 for branch, files in branch_batches.iteritems():
648 if branch in self.commit_branches_empty and files: 651 if branch in self.commit_branches_empty and files:
684 data = parent_ctx.filectx(path).data() 687 data = parent_ctx.filectx(path).data()
685 return context.memfilectx(path=path, 688 return context.memfilectx(path=path,
686 data=data, 689 data=data,
687 islink=is_link, isexec=is_exec, 690 islink=is_link, isexec=is_exec,
688 copied=copied) 691 copied=copied)
692 if self.opts.get('svn_no_branchnames', False):
693 extra.pop('branch', None)
689 current_ctx = context.memctx(self.repo, 694 current_ctx = context.memctx(self.repo,
690 parents, 695 parents,
691 rev.message or '...', 696 rev.message or '...',
692 files.keys(), 697 files.keys(),
693 filectxfn, 698 filectxfn,
711 raise hgutil.Abort('Empty commit to an open branch attempted. ' 716 raise hgutil.Abort('Empty commit to an open branch attempted. '
712 'Please report this issue.') 717 'Please report this issue.')
713 extra = util.build_extra(rev.revnum, branch, 718 extra = util.build_extra(rev.revnum, branch,
714 open(self.uuid_file).read(), 719 open(self.uuid_file).read(),
715 self.subdir) 720 self.subdir)
721 if self.opts.get('svn_no_branchnames', False):
722 extra.pop('branch', None)
716 current_ctx = context.memctx(self.repo, 723 current_ctx = context.memctx(self.repo,
717 (ha, node.nullid), 724 (ha, node.nullid),
718 rev.message or ' ', 725 rev.message or ' ',
719 [], 726 [],
720 del_all_files, 727 del_all_files,