mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
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
This commit is contained in:
parent
8973f827ab
commit
673b0dd879
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user