On 22.09.2009 04:23, Steve Borho wrote:
> On Mon, Sep 21, 2009 at 4:45 PM, Adrian Buehlmann <adr...@cadifra.com> wrote:
>> Any chance we can have undo/redo in the commit message TextView
>> widget in the commit dialog? (on Windows?)
> 
> Does gtksourceview work on Windows? I don't know how much of an
> improvement it would give.
> 
>> Or would it make sense to have an "edit in editor" command?
>>
>> I could also imagine to start the configured editor if
>> the message text is empty when the user clicks the "Commit"
>> button.
> 
> I won't rule it out, but shelling out to an editor is about as fun as
> launching an arbitrary diff tool, which is to say fiddly and hard to
> get right.

The diff below seems to work not that bad.

With that change, the starting of the editor is handled by mercurial
itself, due to the empty message. And the handling is the same as
with 'hg ci' on the command line.

I'm beginning to think that an additional command line option
--editor for 'hg ci' could be useful. This would start
the editor, even if the change message is *not* empty.
So we could preload mercurial's editor with a text (if we
wanted to).

diff --git a/tortoisehg/hgtk/commit.py b/tortoisehg/hgtk/commit.py
--- a/tortoisehg/hgtk/commit.py
+++ b/tortoisehg/hgtk/commit.py
@@ -811,10 +811,7 @@ class GCommit(GStatus):
     def ready_message(self):
         buf = self.text.get_buffer()
         if buf.get_char_count() == 0:
-            gdialog.Prompt(_('Nothing Commited'),
-                   _('Please enter commit message'), self).run()
-            self.text.grab_focus()
-            return False
+            return True

         try:
             sumlen = int(self.repo.ui.config('tortoisehg', 'summarylen', 0))

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to