Mercurial > public > mercurial-scm > hg-stable
diff tests/test-subrepo @ 10251:a19d2993385d stable
subrepo: fix merging of already merged subrepos (issue1986)
This fixes a bug seen when merging a main repo which contains a subrepo when
both repos have been merged before. Each repo (main and sub) has two
branches, both of which have been merged before.
In a subrepo, if the revision to merge to is an ancestor of the current rev,
then the merge should be a noop.
Test provided by Steve Losh.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 15 Jan 2010 21:08:04 +0100 |
parents | a7c4eb0cc0ed |
children | 0bc93fa2cf2b |
line wrap: on
line diff
--- a/tests/test-subrepo Fri Jan 15 09:50:52 2010 +0100 +++ b/tests/test-subrepo Fri Jan 15 21:08:04 2010 +0100 @@ -104,3 +104,57 @@ hg pull | sed 's/ .*sub/ ...sub/g' hg up # should pull t cat t/t + +echo % issue 1986 +cd .. +rm -rf sub +hg init main +cd main + +hg init s # subrepo layout +cd s # +echo a > a # o 5 br +hg ci -Am1 # /| +hg branch br # o | 4 default +echo a >> a # | | +hg ci -m1 # | o 3 br +hg up default # |/| +echo b > b # o | 2 default +hg ci -Am1 # | | +hg up br # | o 1 br +hg merge tip # |/ +hg ci -m1 # o 0 default +hg up 2 +echo c > c +hg ci -Am1 +hg up 3 +hg merge 4 +hg ci -m1 + +cd .. # main repo layout: +echo 's = s' > .hgsub # +hg -R s up 2 # * <-- try to merge default into br again +hg ci -Am1 # .`| +hg branch br # . o 5 br --> substate = 5 +echo b > b # . | +hg -R s up 3 # o | 4 default --> substate = 4 +hg ci -Am1 # | | +hg up default # | o 3 br --> substate = 2 +echo c > c # |/| +hg ci -Am1 # o | 2 default --> substate = 2 +hg up 1 # | | +hg merge 2 # | o 1 br --> substate = 3 +hg ci -m1 # |/ +hg up 2 # o 0 default --> substate = 2 +hg -R s up 4 +echo d > d +hg ci -Am1 +hg up 3 +hg -R s up 5 +echo e > e +hg ci -Am1 + +hg up 5 +hg merge 4 # try to merge default into br again + +exit 0