mercurial/commands.py
branchstable
changeset 19111 6439d78e14fb
parent 19109 26c51e87e807
child 19112 23f785b38af3
equal deleted inserted replaced
19110:741d94aa92e4 19111:6439d78e14fb
   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") %