widgets.diff: remove obsolete action

The action_apply_selection action of the DiffEditor class has not been
used since December 2011 (commit
c1f5cf5032d560755bd5ccd25cbbac865d0af3b6), so remove it.

Signed-off-by: Daniel Harding <dharding@living180.net>
widgets.diff: better selection action enabling

In the DiffEditor, the actions for acting upon the selected lines were
initially enabled, which meant that they could be selected in the
context menu if no text selection had ever been made, in which case they
would operate on the entire hunk under the cursor.  Once the first text
selection had been made, they would be enabled and disabled properly.
Fix this by disabling them when they are created.

Additionally, the action_process_selection action was always enabled,
which meant that if the user pressed the "S" shortcut key in the diff
pane when no text was selected, the action would be applied to the
entire hunk containing the cursor.  Fix this by enabling and disabling
this action in the same way as the other actions that operate on the
selected lines.

Signed-off-by: Daniel Harding <dharding@living180.net>
Merge pull request #331 from living180/diff_actions

widgets.diff: improve DiffEditor actions

Signed-off-by: David Aguilar <davvid@gmail.com>
test.helper: shutil.rmtree workaround for Windows

On Windows, shutil.rmtree() raises an exception if it tries to remove a
file marked as read-only.  The files that git creates in the
.git/objects directory are read-only, so the GitRepositoryTestCase hits
this problem when shutil.rmtree() is called during tearDown.  Work
around the issue by passing a an onerror handler to shutil.rmtree()
which detects the case of trying to remove a read-only file, changes the
file to be writeable, and tries again to remove it.

Signed-off-by: Daniel Harding <dharding@living180.net>
test: make tests portable to Windows

Using os.system() to shell out to perform various test setup functions
does not work well on Windows because it uses different shell syntax.
To address this, remove the shell() method from TmpPathTestCase, along
with the shell() and pipe() functions from the test.helper module.  To
facilitate replacing usages of the shell() method, add three static
methods to TmpPathTestCase:

 * touch(): creates one or more empty files if they do not already
   exist.
 * write_file(): sets the content of file at the specified path
 * append_file(): appends content to the file at the specified path

In addition, add a git() method to GitRepositoryTestCase, which uses
subprocess to invoke git with the specified arguments and returns any
output generated by git.

Re-implement all the uses of the shell() method or the pipe() function
using these helper methods or built-in Python functions.

Signed-off-by: Daniel Harding <dharding@living180.net>
test.git_test: skip test not supported on Windows

test_it_handles_interrupted_syscalls uses signal.SIGALRM, which is not
supported on Windows, so skip this test case on Windows.

Signed-off-by: Daniel Harding <dharding@living180.net>
Merge pull request #332 from living180/test_portability

Make tests portable to Windows

Signed-off-by: David Aguilar <davvid@gmail.com>
doc: update v2.0.5 release notes

Signed-off-by: David Aguilar <davvid@gmail.com>
git-cola v2.0.5

Signed-off-by: David Aguilar <davvid@gmail.com>