##// END OF EJS Templates
bookmarks: resolve divergent bookmark when moving across a branch...
Sean Farley -
r19111:6439d78e stable
parent child Browse files
Show More
@@ -818,6 +818,14 b' def bookmark(ui, repo, mark=None, rev=No'
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)
@@ -611,3 +611,19 b' test clearing divergent bookmarks of lin'
611 Z@1 1:925d80f479bb
611 Z@1 1:925d80f479bb
612 four 3:9ba5f110a0b3
612 four 3:9ba5f110a0b3
613 should-end-on-two 2:db815d6d32e6
613 should-end-on-two 2:db815d6d32e6
614
615 test clearing only a single divergent bookmark across branches
616
617 $ hg book foo -r 1
618 $ hg book foo@1 -r 0
619 $ hg book foo@2 -r 2
620 $ hg book foo@3 -r 3
621 $ hg book foo -r foo@3
622 $ hg book
623 Z 3:9ba5f110a0b3
624 Z@1 1:925d80f479bb
625 * foo 3:9ba5f110a0b3
626 foo@1 0:f7b1eb17ad24
627 foo@2 2:db815d6d32e6
628 four 3:9ba5f110a0b3
629 should-end-on-two 2:db815d6d32e6
General Comments 0
You need to be logged in to leave comments. Login now