From 673b0dd8793dc69e261085166d4777aeea233bc6 Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Wed, 15 Jan 2014 17:55:13 -0600 Subject: [PATCH] commands: use bookmarks.validdest instead of duplicating logic Now that bookmarks.py has grown a validdest method that even handles successor changesets, we use that instead of duplicating the logic in commands.py --- mercurial/commands.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mercurial/commands.py b/mercurial/commands.py index 7e37e565c2..3d6db18cca 100644 --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -847,12 +847,10 @@ def bookmark(ui, repo, *names, **opts): bookmarks.deletedivergent(repo, [target], mark) return - # consider successor changesets as well - foreground = obsolete.foreground(repo, [marks[mark]]) deletefrom = [b for b in divs if repo[b].rev() in anc or b == target] bookmarks.deletedivergent(repo, deletefrom, mark) - if bmctx.rev() in anc or target in foreground: + if bookmarks.validdest(repo, bmctx, repo[target]): ui.status(_("moving bookmark '%s' forward from %s\n") % (mark, short(bmctx.node()))) return