Commits

Anonymous committed 4211659

do not push when only one incomplete task and --all-tasks is not specified
fixes #27

  • Participants
  • Parent commits 886ac61

Comments (0)

Files changed (1)

     outnodes = outgoingnodes(ui, repo, dest, **opts)
     completenodes = stripincomplete(repo, outnodes)
 
-    if outnodes == completenodes:
-        return orig(ui, repo, dest, **opts)
-
-    if not opts.get('completed_tasks'):
+    if opts.get('completed_tasks'):
+        if completenodes == []:
+            raise util.Abort(_('no completed tasks to push\n'
+                    '(use --all-tasks to force)'))
+        else:
+            ui.status('searching for completed tasks\n')
+            opts['rev'] = completenodes
+            return orig(ui, repo, dest, **opts)
+    else:
         raise util.Abort(_('pushing incomplete tasks\n'
             '(use --all-tasks to force or --completed-tasks to prune)'))
 
-    ui.status('searching for completed tasks\n')
-    opts['rev'] = completenodes
-    return orig(ui, repo, dest, **opts)
-
 
 cmdtable = {
     'tasks':