Russian text in comit comments

Issue #12 resolved
Николай Шкрылев
created an issue

Thanks for a great plugin!

I have a problem with commit and log commands.

  • When using "hg: quick commit" command witch russian comment commit not complete without any errors.
  • command "hg: log all" return log list with "???" instead russian words (see attachment)

What can I do? Thanks.

Comments (9)

  1. Daniel Siepmann repo owner

    Can you send me the pure command line output of hg log? Of course you can secure necessary output using asterisks or something else.

    With this output I can try to reproduce the issue and create a bugfix, hopefully.

    The same for quick commit, can you give an example so I can copy and paste to reproduce the problem?

  2. Николай Шкрылев reporter

    Of course.

    bash-3.2$ hg log -l3
    changeset:   11:d1769d31575e
    tag:         tip
    user:        snn
    date:        Sun Jan 04 02:17:10 2015 +0300
    files:       index.html voice_player.js
    description:
    загрузка аудио и (про/пере)рисовка канвы
    
    
    changeset:   10:8f19fd867be5
    user:        snn
    date:        Sun Jan 04 00:20:23 2015 +0300
    files:       example/app.js example/index.html example/test-wavesurfer.html index.html test/wave.png test/wave_test.py voice_player.js
    description:
    render player on backbone.js
    
    
    changeset:   9:4ac90b484098
    bookmark:    master
    user:        snn
    date:        Sat Dec 27 11:25:39 2014 +0300
    files:       TODO.TODO example/test-wavesurfer.html index.html voice_player.js
    description:
    вернул тест wavesrufer
    

    In ST3: hg quick: кнопки упраления

  3. Daniel Siepmann repo owner

    I'm sorry. I can reproduce the error and it looks like I can't help.

    The ??? are returned to the python call inside CommandThread. Google can't find anything about the issue. subprocess.Popen / subprocess.check_output are used to fetch the output from hg. Perhaps you can find something?

  4. Daniel Siepmann repo owner

    Of course, you can include an print(output) after Line 41 at lib/cli.py: https://bitbucket.org/DanielSiepmann/mercurial-for-sublime/src/ac0db7da543526a809e033bac09e63218a4c45ac/lib/cli.py?at=default#cl-41 That's the first place where python receives the output of the call to mercurial.

    So you get the following code:

                if self.working_dir != "":
                    os.chdir(self.working_dir)
                output = subprocess.Popen(self.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=shell).communicate()[0]
                print(output)
                # if sublime's python gets bumped to 2.7 we can just do:
                # output = subprocess.check_output(self.command)
                main_thread(self.on_done, _make_text_safeish(output, self.fallback_encoding))
    

    You can see the output inside the console of Sublime Text. (View > Show Console)

    In my case I've to restart Sublime Text each time I'm editing a file inside the lib folder. Files in the package root will be reloaded automatically.

    Yes I can reproduce the bug with your repository too.

  5. Николай Шкрылев reporter

    After change line:

    output = subprocess.Popen(self.command, stdout=subprocess.STDOUT, stderr=subprocess.STDOUT, shell=shell).communicate()[0]
    

    I've see next output:

    Exception in thread Thread-6:
    Traceback (most recent call last):
      File "./threading.py", line 901, in _bootstrap_inner
      File "/Users/snn/Library/Application Support/Sublime Text 3/Packages/Mercurial for Sublime/lib/cli.py", line 41, in run
        output = subprocess.Popen(self.command, stdout=subprocess.STDOUT, stderr=subprocess.STDOUT, shell=shell).communicate()[0]
      File "./subprocess.py", line 824, in __init__
      File "./subprocess.py", line 1448, in _execute_child
    OSError: [Errno 9] Bad file descriptor
    

    Unfortunately I do not know enough on the subprocess.Popen subject... :\

  6. Николай Шкрылев reporter

    Sorry. I'll retry and see next error:

    decoding near '\xd0\xba\xd0\xbd\xd0\xbe\xd0\xbf\xd0\xba': 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)!\n"
    

    but \xd0\xba\xd0\xbd\xd0\xbe\xd0\xbf\xd0\xba is кнопки

  7. Log in to comment