Show More
@@ -394,7 +394,7 b' class changectx(basectx):' | |||||
394 | return filectx(self._repo, path, fileid=fileid, |
|
394 | return filectx(self._repo, path, fileid=fileid, | |
395 | changectx=self, filelog=filelog) |
|
395 | changectx=self, filelog=filelog) | |
396 |
|
396 | |||
397 | def ancestor(self, c2): |
|
397 | def ancestor(self, c2, warn=False): | |
398 | """ |
|
398 | """ | |
399 | return the "best" ancestor context of self and c2 |
|
399 | return the "best" ancestor context of self and c2 | |
400 | """ |
|
400 | """ | |
@@ -415,12 +415,13 b' class changectx(basectx):' | |||||
415 | break |
|
415 | break | |
416 | else: |
|
416 | else: | |
417 | anc = self._repo.changelog.ancestor(self._node, n2) |
|
417 | anc = self._repo.changelog.ancestor(self._node, n2) | |
418 | self._repo.ui.status( |
|
418 | if warn: | |
419 | (_("note: using %s as ancestor of %s and %s\n") % |
|
419 | self._repo.ui.status( | |
420 | (short(anc), short(self._node), short(n2))) + |
|
420 | (_("note: using %s as ancestor of %s and %s\n") % | |
421 | ''.join(_(" alternatively, use --config " |
|
421 | (short(anc), short(self._node), short(n2))) + | |
422 | "merge.preferancestor=%s\n") % |
|
422 | ''.join(_(" alternatively, use --config " | |
423 | short(n) for n in sorted(cahs) if n != anc)) |
|
423 | "merge.preferancestor=%s\n") % | |
|
424 | short(n) for n in sorted(cahs) if n != anc)) | |||
424 | return changectx(self._repo, anc) |
|
425 | return changectx(self._repo, anc) | |
425 |
|
426 | |||
426 | def descendant(self, other): |
|
427 | def descendant(self, other): |
@@ -992,7 +992,7 b' def update(repo, node, branchmerge, forc' | |||||
992 | cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) |
|
992 | cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) | |
993 | pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] |
|
993 | pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] | |
994 | else: |
|
994 | else: | |
995 | pas = [p1.ancestor(p2)] |
|
995 | pas = [p1.ancestor(p2, warn=True)] | |
996 |
|
996 | |||
997 | fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2) |
|
997 | fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2) | |
998 |
|
998 |
General Comments 0
You need to be logged in to leave comments.
Login now