##// END OF EJS Templates
destutil: remove current head from list of candidates early...
Pierre-Yves David -
r28138:5ad20174 default
parent child Browse files
Show More
@@ -212,7 +212,6 b" def _destmergebranch(repo, action='merge"
212 212 parent = repo.dirstate.p1()
213 213 branch = repo.dirstate.branch()
214 214 bheads = repo.branchheads(branch)
215 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
216 215
217 216 if parent not in bheads:
218 217 # Case A: working copy if not on a head.
@@ -223,21 +222,25 b" def _destmergebranch(repo, action='merge"
223 222 else:
224 223 msg, hint = msgdestmerge['notatheads'][action]
225 224 raise error.Abort(msg, hint=hint)
226 elif len(nbhs) > 2:
227 # Case B: There is more than 2 anonymous heads
225 # remove current head from the set
226 bheads = [bh for bh in bheads if bh != parent]
227 # filters out bookmarked heads
228 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
229 if len(nbhs) > 1:
230 # Case B: There is more than 1 other anonymous heads
228 231 #
229 232 # This means that there will be more than 1 candidate. This is
230 233 # ambiguous. We abort asking the user to pick as explicit destination
231 234 # instead.
232 235 msg, hint = msgdestmerge['toomanyheads'][action]
233 msg %= (branch, len(bheads))
236 msg %= (branch, len(bheads) + 1)
234 237 raise error.Abort(msg, hint=hint)
235 elif len(nbhs) <= 1:
236 # Case B: There is no other anonymous head that the one we are one
238 elif not nbhs:
239 # Case B: There is no other anonymous heads
237 240 #
238 241 # This means that there is no natural candidate to merge with.
239 242 # We abort, with various messages for various cases.
240 if len(bheads) > 1:
243 if bheads:
241 244 msg, hint = msgdestmerge['bookmarkedheads'][action]
242 245 elif len(repo.heads()) > 1:
243 246 msg, hint = msgdestmerge['nootherbranchheads'][action]
@@ -245,8 +248,6 b" def _destmergebranch(repo, action='merge"
245 248 else:
246 249 msg, hint = msgdestmerge['nootherheads'][action]
247 250 raise error.Abort(msg, hint=hint)
248 elif parent == nbhs[0]:
249 node = nbhs[-1]
250 251 else:
251 252 node = nbhs[0]
252 253 assert node is not None
General Comments 0
You need to be logged in to leave comments. Login now