README.md: avoid html characters

Signed-off-by: David Aguilar <davvid@gmail.com>
status: launch "mergetool" on unmerged paths for Ctrl+D

Teach the Ctrl+D shortcut to launch "mergetool" when a path is unmerged.
Previously, we would blindly launch "difftool", which silently fails.

Make the user experience seemless by adding automatically invoking
"mergetool" when "difftool" is requested on an unmerged path.

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

Signed-off-by: David Aguilar <davvid@gmail.com>
cmds: consolidate LaunchDifftool and Mergetool commands

The status widget recently learned to automatically launch mergetool on
unmerged paths.  Move that feature into the LaunchDifftool command so
that we can eliminate Mergetool.

This also makes it so that the "diff" Ctrl+D shortcut also calls
mergetool on unmerged paths where previously it would call difftool.

Signed-off-by: David Aguilar <davvid@gmail.com>
status: remove redundant actions

Reuse the launch_difftool and launch_editor in the context menus instead
of recreating them.

Signed-off-by: David Aguilar <davvid@gmail.com>
cmds: simplify things by removing a class

RunCommand exists so that we keep a reference to QRunnables.  Not doing
so invokes the wrath of the python gc and crashes some versions of
PyQt4.  Tuck the reference into the AsyncCommand class so that we can do
without the RunCommand middleman.

Signed-off-by: David Aguilar <davvid@gmail.com>
guicmds: refactor new_repo() into a reusable function

Signed-off-by: David Aguilar <davvid@gmail.com>
main: add a "File -> New Repository..." menu action

Signed-off-by: David Aguilar <davvid@gmail.com>
doc: add "Ctrl+l" to the hotkeys page

Signed-off-by: David Aguilar <davvid@gmail.com>
doc: update the upcoming v1.8.4 release notes

Signed-off-by: David Aguilar <davvid@gmail.com>
status: move stage/unstage to the top of the context menu

Closes #167
main.model: recount diff lines when applying

Use "git apply --recount" when applying diffs.  This makes the
interactive diff editing more robust.

Related-to: #191

Signed-off-by: David Aguilar <davvid@gmail.com>
diffparse: support diffs that remove the entire file

The diff header format is different when the entire file is removed and
replaced with a single line.

Add test fixtures to demonstrate this diff output and add unit tests to
ensure that we can parse these diffs.  Teach the diff parser to parse
these header lines so that we can generate proper diffs.

Closes #191

Reported-by: Eli Skeggs <skeggse@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
status: workaround sip memory leak

sip v4.14.7 and below leak memory in parent.takeChildren().
Use parent.takeChild(0) in a loop instead.  This is
backwards-compatible and avoids the leak.

Reported-by: Matti Aarnio <oh2mqk@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
status: optimize refreshing the item lists

Calling QTreeWidgetItem.takeChild(0) in a loop is slow because
the child array has to be shifted, it seems.  Testing shows that
Taking from the end of the list is much faster.

Signed-off-by: David Aguilar <davvid@gmail.com>
Revert "main.model: recount diff lines when applying"

This reverts commit 61409cb8eaea6fcb87efd9e3c556f73285ff062a.
diffparse: simplify and improve diff editing

Unify all diff header parsing into a single regex and unify how we deal
with diff header edits.

We now model the diff ranges using a Range class which owns the start
and end ranges of the diffs.  The only thing our diff edits should ever
do is change the "after" image ranges, so we now have an explicit
set_end() function to handle it.

More edge cases have been added to the unit tests.

Closes #193

Reported-by: Eli Skeggs <skeggse@gmail.com>
Reported-by: Uri Okrent <uokrent@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
diffparse: use a r"aw string" for the regex

Signed-off-by: David Aguilar <davvid@gmail.com>
app: allow file:// URLs

Signed-off-by: David Aguilar <davvid@gmail.com>
git-cola.desktop: associate with inode/directory

Add a "Bookmarks" action that does the traditional
`git-cola --prompt` startup dialog.

Change the default Exec to `git-cola --repo %u` and add the
inode/directory MimeType.  The mime type association allows us
to open directories with git-cola from a file browser.

Suggested-by: Muhammad Bashir Al-Noimi <mbnoimi@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>