Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Nov 14 13:48:23 2008 +0100 +++ b/mercurial/commands.py Fri Nov 14 14:36:17 2008 +0100 @@ -2091,7 +2091,7 @@ if modheads == 0: return if optupdate: - if modheads <= 1 or checkout: + if (modheads <= 1 or len(repo.branchheads()) == 1) or checkout: return hg.update(repo, checkout) else: ui.status(_("not updating, since new heads added\n"))