zh_TW.po: fix typo

Simply 轉備 -> 準備

Signed-off-by: Ｖ字龍(Vdragon) <Vdragon.Taiwan@gmail.com>
zh_TW.po: improve translation

Signed-off-by: Ｖ字龍(Vdragon) <Vdragon.Taiwan@gmail.com>
zh_TW.po: update PO-Revision-Date

Signed-off-by: Ｖ字龍(Vdragon) <Vdragon.Taiwan@gmail.com>
po: update i18n files

$ python setup.py build_pot

Signed-off-by: David Aguilar <davvid@gmail.com>
core: Apply Python 3 change to code based around os.getcwdu

This is building on changes that @takluyver already made.  I changed out
instances of getcwdu with our Python version specific core.getcwd.  I
also added some very basic unit tests for those changes.
Merge remote-tracking branch 'upstream/master'
Merge pull request #326 from paulhildebrandt/master

Fixed os.getcwdu code for Python 3 compatibility

Signed-off-by: David Aguilar <davvid@gmail.com>
doc: add Paul to the credits

Signed-off-by: David Aguilar <davvid@gmail.com>
tests: use absolute imports for test.helper

Signed-off-by: David Aguilar <davvid@gmail.com>
tests: adjust things so that test_app and test_qtutils can pass

Signed-off-by: David Aguilar <davvid@gmail.com>
doc: update v2.0.5 release notes draft

Signed-off-by: David Aguilar <davvid@gmail.com>
widgets.diff: remove unused parameter

The reverse parameter for DiffEditor.process_diff_selection() was
unused, so remove it.

Signed-off-by: Daniel Harding <dharding@living180.net>
diffparse: improve generation of reverse diffs

The process used for generating reverse diffs for operations such as
"Revert Selected Lines..." sometimes resulted in the wrong lines being
reverted.  The process worked as follows:

* call out to git to generate the full forward and reverse diffs for the
  file
* find the text from the GUI selection in the full forward diff
* use the information about the location of the GUI selection in the
  forward diff to determine which lines to use from the reverse diff
* generate the partial reverse diff from those lines

The problem with this is that if there are adjacent adds and removes,
the order of lines in the forward diff will likely not be the same as in
the reverse diff.  As a result, the wrong lines can be selected from the
reverse diff.

To address this issue, change the code to no longer use git to get the
full reverse diff.  Instead, transform the full forward diff to a
reverse diff algorithmically.

Signed-off-by: Daniel Harding <dharding@living180.net>
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>
diff: use "Diff Hunk" instead of "Diff Region"

Refer to diff regions as "Diff Hunk" throughout the
documentation and interface for consistency with other
patch/diff tools.

Closes #328

Suggested-by: Daniel Harding <dharding@living180.net>
Helped-by: Uri Okrent <uokrent@gmail.com>
Helped-by: Ｖ字龍(Vdragon) <Vdragon.Taiwan@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
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>