Encoding problem and bug running hookscript ?

Yannick CHARLES yannick.charles at gmail.com
Wed Nov 28 19:52:41 UTC 2012


Good evening everybody,

I have the following setup:

A repository "test-syst", and a versionned patch queue located at 
"test-syst/.hg/patches-Yann" (final goal will be to have one patch queue 
for each developer).
These two are located on a remote server, running Mercurial 2.3.2 
(latest version on release ppa) on Ubuntu 12.04 (precise).

There is a changegroup hook configured for the patches repository that 
calls the following shell script (the script is passed the developer 
name as argument, here Yann):

------

#/bin/bash

# Getting back to "test-syst/.hg" as the script is run from 
"test-syst/.hg/patches-Yann"
cd ..

# Config file backup
cp hgrc hgrc_bak

# Add user name to prevent error when applying patch
echo "
[ui]
username = $1
" >> hgrc

# Select stack
hg qqueue $1
# Select some guard
hg qselect pub
# Apply all patches
hg qpush -a

#
# Here goes some command that builds the contents of the repository, 
once patched, and export the resulting files to some folder.
#

# Restore original config file
mv hgrc_bak hgrc
# Restore original state
hg qpop -a

--------
One of the patches committed in the patches repo has non-ascii accented 
letters (à) in its description.

Provided that I invoke it from the right directory, the script works 
fine from the command line. It also works fine if I push changes from 
another repository created with qclone on the server itself.

However, when I push changes from my machine (also with Mercurial 2.3.2, 
and TortoiseHg 2.4.3, on Ubuntu 11.04) to the patch repository over 
http, the hg qpush -a command in the script fails and I get the 
following output:

searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
remote: 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
remote: applying 2012-11-28_16-32-05_r0+.diff
remote: applying 2012-11-28_17-34-08_r1+.diff
remote: transaction abort!
remote: rollback completed
remote: cleaning up working directory...done
remote: abort: decoding near 'h tant qu'à faire': 'ascii' codec can't 
decode byte 0xc3 in position 17: ordinal not in range(128)!
remote: no patches applied


It looked like an encoding problem, so I tried to fiddle around with 
encoding settings in python, HGENCODING environment variable (on both 
client and server side)... But it doesn't change.


Does anybody have an idea about how to fix it ? I wouldn't like to 
forbid accented letters in commit messages / patches description (I 
already restrained myself for filenames, don't know if necessary but 
still).
Also, would it help somehow to update to Mercurial 2.4 ?


Thanks a lot.
Best regards,
Yannick CHARLES




More information about the Mercurial mailing list