models.main: improve commit message auto-load behavior
commitb7e04608e6bfda06fc15672f691d605677299899
authorDavid Aguilar <davvid@gmail.com>
Sat, 25 Apr 2015 08:55:58 +0000 (25 01:55 -0700)
committerDavid Aguilar <davvid@gmail.com>
Sat, 25 Apr 2015 10:21:00 +0000 (25 03:21 -0700)
tree8cf7a2b3362abc97e1f28879aab016c97e88b8e1
parentf35c1c009673892085a4cc01800b471326b7d432
models.main: improve commit message auto-load behavior

Move all of the commit message auto-load logic into the model.

When automatically loading the commit message from e.g. .git/MERGE_MSG,
remember the current message so that we can restore it later.

When we detect that the message paths no longer exist, and the commit
message has not been edited by the user, then reset the message back to
the original message.

Closes #431
Suggested-by: Dave Thomas <dave@monstergfx.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
cola/models/main.py
cola/utils.py
cola/widgets/main.py
share/doc/git-cola/relnotes/unreleased.rst
share/doc/git-cola/thanks.rst