comparison mercurial/commands.py @ 7372:e17dbf140035

pull: update to branch tip if there is only one head on the current branch On pull, if the current named branch has only one head, update to it.
author Benoit Allard <benoit@aeteurope.nl>
date Fri, 14 Nov 2008 14:36:17 +0100
parents 87158be081b8
children 7e9a15fa6c8f bffdab64dfbb
comparison
equal deleted inserted replaced
7371:6ad2b914acbd 7372:e17dbf140035
2089 2089
2090 def postincoming(ui, repo, modheads, optupdate, checkout): 2090 def postincoming(ui, repo, modheads, optupdate, checkout):
2091 if modheads == 0: 2091 if modheads == 0:
2092 return 2092 return
2093 if optupdate: 2093 if optupdate:
2094 if modheads <= 1 or checkout: 2094 if (modheads <= 1 or len(repo.branchheads()) == 1) or checkout:
2095 return hg.update(repo, checkout) 2095 return hg.update(repo, checkout)
2096 else: 2096 else:
2097 ui.status(_("not updating, since new heads added\n")) 2097 ui.status(_("not updating, since new heads added\n"))
2098 if modheads > 1: 2098 if modheads > 1:
2099 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) 2099 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n"))