Mercurial > hgsubversion
comparison hgsubversion/stupid.py @ 447:0d3b5acb1d51
tags: handle edits to tags as gracefully as possible
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Tue, 23 Jun 2009 21:38:27 -0500 |
parents | 8c545dcad7b1 |
children | ae35c389cdef |
comparison
equal
deleted
inserted
replaced
446:cbd230043379 | 447:0d3b5acb1d51 |
---|---|
599 # this is a case that really shouldn't ever happen, it means | 599 # this is a case that really shouldn't ever happen, it means |
600 # something is very wrong | 600 # something is very wrong |
601 assert f[0] != '/' | 601 assert f[0] != '/' |
602 | 602 |
603 extra = meta.genextra(r.revnum, b) | 603 extra = meta.genextra(r.revnum, b) |
604 if not meta.usebranchnames: | 604 |
605 tag = False | |
606 tag = meta.is_path_tag(meta.remotename(b)) | |
607 | |
608 if tag: | |
609 if parentctx.node() == node.nullid: | |
610 continue | |
611 extra.update({'branch': parentctx.extra().get('branch', None), | |
612 'close': 1}) | |
613 | |
614 if not meta.usebranchnames or extra.get('branch', None) == 'default': | |
605 extra.pop('branch', None) | 615 extra.pop('branch', None) |
606 | |
607 current_ctx = context.memctx(meta.repo, | 616 current_ctx = context.memctx(meta.repo, |
608 [parentctx.node(), revlog.nullid], | 617 [parentctx.node(), revlog.nullid], |
609 r.message or util.default_commit_msg, | 618 r.message or util.default_commit_msg, |
610 files_touched, | 619 files_touched, |
611 filectxfn, | 620 filectxfn, |
613 date, | 622 date, |
614 extra) | 623 extra) |
615 ha = meta.repo.commitctx(current_ctx) | 624 ha = meta.repo.commitctx(current_ctx) |
616 | 625 |
617 branch = extra.get('branch', None) | 626 branch = extra.get('branch', None) |
618 if not branch in meta.branches: | 627 if (not branch in meta.branches |
628 and not meta.is_path_tag(meta.remotename(branch))): | |
619 meta.branches[branch] = None, 0, r.revnum | 629 meta.branches[branch] = None, 0, r.revnum |
620 meta.revmap[r.revnum, b] = ha | 630 if not tag: |
631 meta.revmap[r.revnum, b] = ha | |
621 util.describe_commit(ui, ha, b) | 632 util.describe_commit(ui, ha, b) |
633 if tag: | |
634 meta.movetag(tag, ha, parentctx.extra().get('branch', None), r, date) | |
622 | 635 |
623 # These are branches with an 'R' status in svn log. This means they were | 636 # These are branches with an 'R' status in svn log. This means they were |
624 # replaced by some other branch, so we need to verify they get marked as closed. | 637 # replaced by some other branch, so we need to verify they get marked as closed. |
625 for branch in check_deleted_branches: | 638 for branch in check_deleted_branches: |
626 closed = checkbranch(meta, r, branch) | 639 closed = checkbranch(meta, r, branch) |