equal
deleted
inserted
replaced
730 if len(roots) > 1: |
730 if len(roots) > 1: |
731 raise error.Abort(_("cannot change branch of non-linear revisions")) |
731 raise error.Abort(_("cannot change branch of non-linear revisions")) |
732 rewriteutil.precheck(repo, revs, 'change branch of') |
732 rewriteutil.precheck(repo, revs, 'change branch of') |
733 |
733 |
734 root = repo[roots.first()] |
734 root = repo[roots.first()] |
735 if not root.p1().branch() == label and label in repo.branchmap(): |
735 rpb = {parent.branch() for parent in root.parents()} |
|
736 if label not in rpb and label in repo.branchmap(): |
736 raise error.Abort(_("a branch of the same name already exists")) |
737 raise error.Abort(_("a branch of the same name already exists")) |
737 |
738 |
738 if repo.revs('merge() and %ld', revs): |
|
739 raise error.Abort(_("cannot change branch of a merge commit")) |
|
740 if repo.revs('obsolete() and %ld', revs): |
739 if repo.revs('obsolete() and %ld', revs): |
741 raise error.Abort(_("cannot change branch of a obsolete changeset")) |
740 raise error.Abort(_("cannot change branch of a obsolete changeset")) |
742 |
741 |
743 # make sure only topological heads |
742 # make sure only topological heads |
744 if repo.revs('heads(%ld) - head()', revs): |
743 if repo.revs('heads(%ld) - head()', revs): |