======================
Changes in version 1.1
======================

This page lists all changes made to Fabric in its 1.1.0 release.

.. note::
    This release also includes all applicable changes from the :doc:`1.0.2
    release </changes/1.0.2>`.

Highlights
==========

* :issue:`76`: :ref:`New-style tasks <new-style-tasks>` have been added. With
  the addition of the `~fabric.decorators.task` decorator and the
  `~fabric.tasks.Task` class, you can now "opt-in" and explicitly mark task
  functions as tasks, and Fabric will ignore the rest. The original behavior
  (now referred to as :ref:`"classic" tasks <classic-tasks>`) will still take
  effect if no new-style tasks are found. Major thanks to Travis Swicegood for
  the original implementation.
* :issue:`56`: Namespacing is now possible: Fabric will crawl imported module
  objects looking for new-style task objects and build a dotted hierarchy
  (tasks named e.g. ``web.deploy`` or ``db.migrations.run``), allowing for
  greater organization. See :ref:`namespaces` for details. Thanks again to
  Travis Swicegood.


Feature additions
=================

* :issue:`10`: `~fabric.contrib.upload_project` now allows control over the
  local and remote directory paths, and has improved error handling. Thanks to
  Rodrigue Alcazar for the patch.
* As part of :issue:`56` (highlighted above), added :option:`--list-format
  <-F>` to allow specification of a nested output format from :option:`--list
  <-l>`.
* :issue:`107`: `~fabric.operations.require`'s ``provided_by`` kwarg now
  accepts iterables in addition to single values. Thanks to Thomas Ballinger
  for the patch.
* :issue:`117`: `~fabric.contrib.files.upload_template` now supports the
  `~fabric.operations.put` flags ``mirror_local_mode`` and ``mode``. Thanks to
  Joe Stump for the suggestion and Thomas Ballinger for the patch.
* :issue:`154`: `~fabric.contrib.files.sed` now allows customized regex flags
  to be specified via a new ``flags`` parameter. Thanks to Nick Trew for the
  suggestion and Morgan Goose for initial implementation.
* :issue:`170`: Allow :ref:`exclusion <excluding-hosts>` of specific hosts from
  the final run list. Thanks to Casey Banner for the suggestion and patch.
* :issue:`189`: Added :option:`--abort-on-prompts`/:ref:`env.abort_on_prompts
  <abort-on-prompts>` to allow a more non-interactive behavior,
  aborting/exiting instead of trying to prompt the running user. Thanks to
  Jeremy Avnet and Matt Chisholm for the initial patch.
* :issue:`273`: `~fabric.contrib.files.upload_template` now offers control over
  whether it attempts to create backups of pre-existing destination files.
  Thanks to Ales Zoulek for the suggestion and initial patch.
* :issue:`283`: Added the `~fabric.decorators.with_settings` decorator to allow
  application of env var settings to an entire function, as an alternative to
  using the `~fabric.context_managers.settings` context manager. Thanks to
  Travis Swicegood for the patch.
* :issue:`353`: Added :option:`--keepalive`/:ref:`env.keepalive <keepalive>` to
  allow specification of an SSH keepalive parameter for troublesome network
  connections. Thanks to Mark Merritt for catch & patch.

Bugfixes
========

* :issue:`115`: An implementation detail causing host lists to lose order
  when deduped by the ``fab`` execution loop, has been patched to preserve
  order instead. So e.g. ``fab -H a,b,c`` (or setting ``env.hosts = ['a', 'b',
  'c']``) will now always run on ``a``, then ``b``, then ``c``. Previously,
  there was a chance the order could get mixed up during deduplication. Thanks
  to Rohit Aggarwal for the report.
* :issue:`345`: `~fabric.contrib.files.contains` returned the stdout of its
  internal ``grep`` command instead of success/failure, causing incorrect
  behavior when stderr exists and is combined with stdout. This has been
  corrected. Thanks to Szymon Reichmann for catch and patch.

Documentation updates
=====================

* Documentation for task declaration has been moved from
  :doc:`/usage/execution` into its own docs page, :doc:`/usage/tasks`, as a
  result of the changes added in :issue:`76` and :issue:`56`.
* :issue:`184`: Make the usage of `~fabric.contrib.project.rsync_project`'s
  ``local_dir`` argument more obvious, regarding its use in the ``rsync`` call.
  (Specifically, so users know they can pass in multiple, space-joined
  directory names instead of just one single directory.)

Internals
=========

* :issue:`307`: A whole pile of minor PEP8 tweaks. Thanks to Markus Gattol for
  highlighting the ``pep8`` tool and to Rick Harding for the patch.
* :issue:`314`: Test utility decorator improvements. Thanks to Rick Harding for
  initial catch & patch.
