##// END OF EJS Templates
destutil: document various failure cases...
Pierre-Yves David -
r28105:1fc7b536 default
parent child Browse files
Show More
@@ -199,18 +199,28 b' def _destmergebranch(repo):'
199 199 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
200 200
201 201 if parent not in bheads:
202 # Case A: working copy if not on a head.
203 #
204 # This is probably a user mistake We bailout pointing at 'hg update'
202 205 if len(repo.heads()) <= 1:
203 206 msg, hint = msgdestmerge['nootherheadsbehind']
204 207 else:
205 208 msg, hint = msgdestmerge['notatheads']
206 209 raise error.Abort(msg, hint=hint)
207
208 if len(nbhs) > 2:
210 elif len(nbhs) > 2:
211 # Case B: There is more than 2 anonymous heads
212 #
213 # This means that there will be more than 1 candidate. This is
214 # ambiguous. We abort asking the user to pick as explicit destination
215 # instead.
209 216 msg, hint = msgdestmerge['toomanyheads']
210 217 msg %= (branch, len(bheads))
211 218 raise error.Abort(msg, hint=hint)
212
213 if len(nbhs) <= 1:
219 elif len(nbhs) <= 1:
220 # Case B: There is no other anonymous head that the one we are one
221 #
222 # This means that there is no natural candidate to merge with.
223 # We abort, with various messages for various cases.
214 224 if len(bheads) > 1:
215 225 msg, hint = msgdestmerge['bookmarkedheads']
216 226 elif len(repo.heads()) > 1:
@@ -219,8 +229,7 b' def _destmergebranch(repo):'
219 229 else:
220 230 msg, hint = msgdestmerge['nootherheads']
221 231 raise error.Abort(msg, hint=hint)
222
223 if parent == nbhs[0]:
232 elif parent == nbhs[0]:
224 233 node = nbhs[-1]
225 234 else:
226 235 node = nbhs[0]
General Comments 0
You need to be logged in to leave comments. Login now