comparison 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
comparison
equal deleted inserted replaced
10249:8ebb34b0f6f7 10251:a19d2993385d
102 echo % pull 102 echo % pull
103 cd ../tc 103 cd ../tc
104 hg pull | sed 's/ .*sub/ ...sub/g' 104 hg pull | sed 's/ .*sub/ ...sub/g'
105 hg up # should pull t 105 hg up # should pull t
106 cat t/t 106 cat t/t
107
108 echo % issue 1986
109 cd ..
110 rm -rf sub
111 hg init main
112 cd main
113
114 hg init s # subrepo layout
115 cd s #
116 echo a > a # o 5 br
117 hg ci -Am1 # /|
118 hg branch br # o | 4 default
119 echo a >> a # | |
120 hg ci -m1 # | o 3 br
121 hg up default # |/|
122 echo b > b # o | 2 default
123 hg ci -Am1 # | |
124 hg up br # | o 1 br
125 hg merge tip # |/
126 hg ci -m1 # o 0 default
127 hg up 2
128 echo c > c
129 hg ci -Am1
130 hg up 3
131 hg merge 4
132 hg ci -m1
133
134 cd .. # main repo layout:
135 echo 's = s' > .hgsub #
136 hg -R s up 2 # * <-- try to merge default into br again
137 hg ci -Am1 # .`|
138 hg branch br # . o 5 br --> substate = 5
139 echo b > b # . |
140 hg -R s up 3 # o | 4 default --> substate = 4
141 hg ci -Am1 # | |
142 hg up default # | o 3 br --> substate = 2
143 echo c > c # |/|
144 hg ci -Am1 # o | 2 default --> substate = 2
145 hg up 1 # | |
146 hg merge 2 # | o 1 br --> substate = 3
147 hg ci -m1 # |/
148 hg up 2 # o 0 default --> substate = 2
149 hg -R s up 4
150 echo d > d
151 hg ci -Am1
152 hg up 3
153 hg -R s up 5
154 echo e > e
155 hg ci -Am1
156
157 hg up 5
158 hg merge 4 # try to merge default into br again
159
160 exit 0