mercurial/commands.py
changeset 29413 31d3ab7985b8
parent 29397 844f72885fb9
child 29426 26ac04a39e11
--- a/mercurial/commands.py	Sat Jun 25 18:35:14 2016 -0700
+++ b/mercurial/commands.py	Sun Jun 26 07:59:02 2016 -0700
@@ -5942,6 +5942,15 @@
         if not revs:
             raise error.Abort(_("specified revisions evaluate to an empty set"),
                              hint=_("use different revision arguments"))
+    elif path.pushrev:
+        # It doesn't make any sense to specify ancestor revisions. So limit
+        # to DAG heads to make discovery simpler.
+        expr = revset.formatspec('heads(%r)', path.pushrev)
+        revs = scmutil.revrange(repo, [expr])
+        revs = [repo[rev].node() for rev in revs]
+        if not revs:
+            raise error.Abort(_('default push revset for path evaluates to an '
+                                'empty set'))
 
     repo._subtoppath = dest
     try: