Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 13803:e380964d53f8
pull: don't suggest running hg merge when new heads are on different branches
After a pull when new heads are added but no head is added on the current
branch, the "run 'hg merge'" message can be misleading. This patch doesn't
output the merge message in that scenario.
author | Kevin Berridge <kevin.w.berridge@gmail.com> |
---|---|
date | Fri, 11 Mar 2011 20:43:12 -0500 |
parents | 0f9282dc87f8 |
children | 7dc2bd4c0dc8 |
comparison
equal
deleted
inserted
replaced
13802:49b5a1aaf726 | 13803:e380964d53f8 |
---|---|
2987 if (modheads <= 1 or len(repo.branchheads()) == 1) or checkout: | 2987 if (modheads <= 1 or len(repo.branchheads()) == 1) or checkout: |
2988 return hg.update(repo, checkout) | 2988 return hg.update(repo, checkout) |
2989 else: | 2989 else: |
2990 ui.status(_("not updating, since new heads added\n")) | 2990 ui.status(_("not updating, since new heads added\n")) |
2991 if modheads > 1: | 2991 if modheads > 1: |
2992 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) | 2992 if (len(repo.branchheads()) > 1): |
2993 ui.status(_("(run 'hg heads' to see heads, 'hg merge' to merge)\n")) | |
2994 else: | |
2995 ui.status(_("(run 'hg heads' to see heads)\n")) | |
2993 else: | 2996 else: |
2994 ui.status(_("(run 'hg update' to get a working copy)\n")) | 2997 ui.status(_("(run 'hg update' to get a working copy)\n")) |
2995 | 2998 |
2996 def pull(ui, repo, source="default", **opts): | 2999 def pull(ui, repo, source="default", **opts): |
2997 """pull changes from the specified source | 3000 """pull changes from the specified source |