Skip to content
Snippets Groups Projects
Commit 67ee87a3 authored by Sean Farley's avatar Sean Farley
Browse files

update: consider successor changesets when moving active bookmark

Previously, when an obsolete changeset was bookmarked, successor changesets were not considered
when moving the bookmark forward. Now that a bare update will move to the tip most of the
successor changesets, we also update the bookmark logic to allow the bookmark to move with this
update.

Tests have been updated and keep issue4015 covered as well.
parent 95b9c614
No related branches found
No related tags found
No related merge requests found
......@@ -192,9 +192,8 @@
return False
if marks[cur] in parents:
old = repo[marks[cur]]
new = repo[node]
divs = [repo[b] for b in marks
if b.split('@', 1)[0] == cur.split('@', 1)[0]]
anc = repo.changelog.ancestors([new.rev()])
deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
......@@ -196,9 +195,9 @@
new = repo[node]
divs = [repo[b] for b in marks
if b.split('@', 1)[0] == cur.split('@', 1)[0]]
anc = repo.changelog.ancestors([new.rev()])
deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
if old.descendant(new):
if validdest(repo, repo[marks[cur]], new):
marks[cur] = new.node()
update = True
......
......@@ -229,6 +229,7 @@
$ hg bookmarks
* bm 5:ff252e8273df
Test that 4 is detected as the no-argument destination from 3
Test that 4 is detected as the no-argument destination from 3 and also moves
the bookmark with it
$ hg up --quiet 0 # we should be able to update to 3 directly
$ hg up --quiet --hidden 3 # but not implemented yet.
......@@ -233,4 +234,5 @@
$ hg up --quiet 0 # we should be able to update to 3 directly
$ hg up --quiet --hidden 3 # but not implemented yet.
$ hg book -f bm
$ hg up
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
......@@ -235,7 +237,8 @@
$ hg up
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg id
d047485b3896+ (b1)
updating bookmark bm
$ hg book
* bm 4:d047485b3896
Test that 5 is detected as a valid destination from 1
$ hg up --quiet 0 # we should be able to update to 3 directly
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment