comparison mercurial/commands.py @ 14485:610873cf064a

Make pull -u behave like pull && update Previously, pull would not update if new branch heads were received, whereas pull && update would move to the tipmost branch head. Also change the "crosses branches" abort in merge.update from "crosses branches (merge branches or use --check to force update)" to "crosses branches (merge branches or update --check to force update)" since it can no longer assume the user is running hg update.
author Brendan Cully <brendan@kublai.com>
date Tue, 31 May 2011 11:52:22 -0700
parents bd34a027f3ed
children 1ffeeb91c55d
comparison
equal deleted inserted replaced
14484:4582a4dd1817 14485:610873cf064a
3653 3653
3654 def postincoming(ui, repo, modheads, optupdate, checkout): 3654 def postincoming(ui, repo, modheads, optupdate, checkout):
3655 if modheads == 0: 3655 if modheads == 0:
3656 return 3656 return
3657 if optupdate: 3657 if optupdate:
3658 if (modheads <= 1 or len(repo.branchheads()) == 1) or checkout: 3658 try:
3659 return hg.update(repo, checkout) 3659 return hg.update(repo, checkout)
3660 else: 3660 except util.Abort, inst:
3661 ui.status(_("not updating, since new heads added\n")) 3661 ui.warn(_("not updating: %s\n" % str(inst)))
3662 return 0
3662 if modheads > 1: 3663 if modheads > 1:
3663 currentbranchheads = len(repo.branchheads()) 3664 currentbranchheads = len(repo.branchheads())
3664 if currentbranchheads == modheads: 3665 if currentbranchheads == modheads:
3665 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) 3666 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))
3666 elif currentbranchheads > 1: 3667 elif currentbranchheads > 1: