Mercurial > hg > mercurial-source
changeset 19986:ea81f8b2364e stable
rebase: fix working copy location after a --collapse (issue4080)
Rebasing with --collapse would leave the working copy on the parent of the
collapsed commit, instead of on the collapsed commit. This fixes that. Also
fixes a few tests that already covered this area but had bad data.
This also fixes issue3716 where bookmarks are not kept across rebases with
--collapse. I updated the test to cover that case as well.
author | Durham Goode <durham@fb.com> |
---|---|
date | Fri, 01 Nov 2013 17:08:06 -0700 |
parents | 7d5e7799a29f |
children | ba6486076429 |
files | hgext/rebase.py tests/test-rebase-collapse.t tests/test-rebase-detach.t |
diffstat | 3 files changed, 11 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -346,6 +346,9 @@ commitmsg = ui.edit(commitmsg, repo.ui.username()) newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg, extrafn=extrafn, editor=editor) + for oldrev in state.iterkeys(): + if state[oldrev] > nullmerge: + state[oldrev] = newrev if 'qtip' in repo.tags(): updatemq(repo, state, skipped, **opts)
--- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -57,11 +57,11 @@ saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) $ hg tglogp - o 5:secret 'Collapsed revision + @ 5:secret 'Collapsed revision | * B | * C | * D' - @ 4:draft 'H' + o 4:draft 'H' | | o 3:draft 'G' |/| @@ -737,12 +737,13 @@ $ touch b $ hg commit -Am b adding b + $ hg book foo $ hg rebase -d 0 -r "1::2" --collapse -m collapsed saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/*-backup.hg (glob) - $ hg tglog - o 1: 'collapsed' + $ hg log -G --template "{rev}: '{desc}' {bookmarks}" + @ 1: 'collapsed' foo | - @ 0: 'base' + o 0: 'base' $ hg manifest --rev tip b