816 return |
816 return |
817 anc = repo.changelog.ancestors([repo[target].rev()]) |
817 anc = repo.changelog.ancestors([repo[target].rev()]) |
818 bmctx = repo[marks[mark]] |
818 bmctx = repo[marks[mark]] |
819 divs = [repo[b].node() for b in marks |
819 divs = [repo[b].node() for b in marks |
820 if b.split('@', 1)[0] == mark.split('@', 1)[0]] |
820 if b.split('@', 1)[0] == mark.split('@', 1)[0]] |
|
821 |
|
822 # allow resolving a single divergent bookmark even if moving |
|
823 # the bookmark across branches when a revision is specified |
|
824 # that contains a divergent bookmark |
|
825 if bmctx.rev() not in anc and target in divs: |
|
826 bookmarks.deletedivergent(repo, [target], mark) |
|
827 return |
|
828 |
821 deletefrom = [b for b in divs |
829 deletefrom = [b for b in divs |
822 if repo[b].rev() in anc or b == target] |
830 if repo[b].rev() in anc or b == target] |
823 bookmarks.deletedivergent(repo, deletefrom, mark) |
831 bookmarks.deletedivergent(repo, deletefrom, mark) |
824 if bmctx.rev() in anc: |
832 if bmctx.rev() in anc: |
825 ui.status(_("moving bookmark '%s' forward from %s\n") % |
833 ui.status(_("moving bookmark '%s' forward from %s\n") % |