pushto: abort with nice message if push would have no effect

This commit is contained in:
Ryan McElroy 2015-02-10 12:02:32 -08:00
parent 5fbd0652a5
commit eb7e17b93e

View File

@ -218,6 +218,8 @@ def expushdiscoverybookmarks(pushop):
raise util.Abort('remote bookmark revision is not in local repo; '
'will not push without --force. '
'Do you need to pull and rebase?')
if repo[old] == repo[rev]:
raise util.Abort('remote bookmark already points at rev')
if not repo[old].descendant(repo[rev]):
raise util.Abort('pushed rev is not a descendant of remote '
'bookmark, will not push without --force')