On Mon, May 25, 2009 at 2:33 AM, Yuki KODAMA <[email protected]> wrote:
> On Mon, May 25, 2009 at 1:17 AM, Steve Borho <[email protected]> wrote:
>> On Sun, May 24, 2009 at 4:17 AM, Yuki KODAMA <[email protected]> wrote:
>>> # HG changeset patch
>>> # User Yuki KODAMA <[email protected]>
>>> # Date 1243156511 -32400
>>> # Node ID b303eb01df2f58402548114addef683653a9321e
>>> # Parent  7368374fb0c5f71c873d7e3099725333f3610e48
>>> thgconfig: correcting editor path if contains whitespace
>>>
>>> this fix support some path patterns:
>>> - c:\tools\editor.exe (no ws)
>>> - "C:\Program Files\Foo\Bar.exe" (has ws, but bracketed)
>>> - C:\Program Files\Foo\Bar.exe (has ws, not bracketed)
>>>
>>> diff --git a/hggtk/thgconfig.py b/hggtk/thgconfig.py
>>> --- a/hggtk/thgconfig.py
>>> +++ b/hggtk/thgconfig.py
>>> @@ -507,6 +507,9 @@
>>>                 os.environ.get('HGEDITOR') or
>>>                 u.config('ui', 'editor') or
>>>                 os.environ.get('EDITOR', 'vi'))
>>> +        # correcting path if contains whitespace in it
>>> +        if editor.find(' ') != -1 and editor.count('"') != 2:
>>> +            editor = '"' + editor + '"'
>>>         if os.path.basename(editor) in ('vi', 'vim', 'hgeditor'):
>>>             gdialog.Prompt(_('No visual editor configured'),
>>>                    _('Please configure a visual editor.'), self).run()
>>
>> This code was copied from gdialog, and from mercurial.util before
>> that, so this issue is in a few other places.
>>
>> Perhaps it would be better to inform the user to fix their
>> configuration by adding the quotes themselves.  That way their
>> configuration will work properly if they use command line hg as well.
>>
>> --
>> Steve Borho
>
> I've make sure the same code in gdialog and 'geteditor' function in
> mercurial.ui file. I half expected but I couldn't find them. Thanks!
>
> But now, I don't know which way is better for the user...
>
> The beginning of this fix is that I figured out 'xxx.executable' in
> 'merge-tools' section supports a path without quote.
> So I rewrote all paths in my HGRC file, like here:
>
> http://bitbucket.org/kuy/dotfiles-x40/src/tip/.hgrc#cl-17
>
> And the command path in 'extdiff' section also supports
> non-quote path.
>
> However, I seem Mercurial doesn't have the process to add
> quotes like my patch... ('find_exe' function won't affect for this)
> Since I want to research more deeply, could you hold this patch?
>
> regards,
> Yuki
>

'research' means that I want to look at more smart way to resolve
'non-quote path' problem.
I don't prefer that similar codes be scattered about several places...

regards,
Yuki

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to