##// 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 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
199 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
200
200
201 if parent not in bheads:
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 if len(repo.heads()) <= 1:
205 if len(repo.heads()) <= 1:
203 msg, hint = msgdestmerge['nootherheadsbehind']
206 msg, hint = msgdestmerge['nootherheadsbehind']
204 else:
207 else:
205 msg, hint = msgdestmerge['notatheads']
208 msg, hint = msgdestmerge['notatheads']
206 raise error.Abort(msg, hint=hint)
209 raise error.Abort(msg, hint=hint)
207
210 elif len(nbhs) > 2:
208 if 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 msg, hint = msgdestmerge['toomanyheads']
216 msg, hint = msgdestmerge['toomanyheads']
210 msg %= (branch, len(bheads))
217 msg %= (branch, len(bheads))
211 raise error.Abort(msg, hint=hint)
218 raise error.Abort(msg, hint=hint)
212
219 elif len(nbhs) <= 1:
213 if 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 if len(bheads) > 1:
224 if len(bheads) > 1:
215 msg, hint = msgdestmerge['bookmarkedheads']
225 msg, hint = msgdestmerge['bookmarkedheads']
216 elif len(repo.heads()) > 1:
226 elif len(repo.heads()) > 1:
@@ -219,8 +229,7 b' def _destmergebranch(repo):'
219 else:
229 else:
220 msg, hint = msgdestmerge['nootherheads']
230 msg, hint = msgdestmerge['nootherheads']
221 raise error.Abort(msg, hint=hint)
231 raise error.Abort(msg, hint=hint)
222
232 elif parent == nbhs[0]:
223 if parent == nbhs[0]:
224 node = nbhs[-1]
233 node = nbhs[-1]
225 else:
234 else:
226 node = nbhs[0]
235 node = nbhs[0]
General Comments 0
You need to be logged in to leave comments. Login now