Mailing List Archive

[The Trac Project] #1310: trac-post-commit-hook and codepages
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Id: 1310 | Status: new
Component: general | Modified: Thu Mar 17 11:55:19 2005
Severity: normal | Milestone:
Priority: normal | Version: 0.8.1
Owner: jonas | Reporter: GregZ
---------------------+------------------------------------------------------
Sorry for bad English.

I'am writing comments for SVN revisions on Russian.
To see this comments correctly in timeline page, I'am set UNICODE UTF-8
encoding in my web browser (Opera).

And whan I'am using trac-post-commit-hook the same coomments that fixed
and closed tickets displayed in Codepage 866.

Switching codepages very inconvenient to use.

Server and Workstation OS: Window XP SP2

???? ??? ????? ??????.

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
----------------------+-----------------------------------------------------
Id: 1310 | Status: new
Component: timeline | Modified: Fri Mar 18 05:25:24 2005
Severity: normal | Milestone: 0.8.2
Priority: highest | Version: 0.8.1
Owner: jonas | Reporter: GregZ
----------------------+-----------------------------------------------------
Changes (by anonymous):

* component: general => timeline
* milestone: => 0.8.2
* priority: normal => highest

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
----------------------+-----------------------------------------------------
Id: 1310 | Status: closed
Component: timeline | Modified: Tue Mar 22 20:40:17 2005
Severity: normal | Milestone: 0.8.2
Priority: highest | Version: 0.8.1
Owner: jonas | Reporter: GregZ
----------------------+-----------------------------------------------------
Changes (by anonymous):

* status: new => closed

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
----------------------+-----------------------------------------------------
Id: 1310 | Status: reopened
Component: timeline | Modified: Wed Mar 23 07:07:19 2005
Severity: normal | Milestone: 0.8.2
Priority: highest | Version: 0.8.1
Owner: jonas | Reporter: GregZ
----------------------+-----------------------------------------------------
Changes (by cmlenz):

* status: closed => reopened

Comment:

Why did you close this, anonymous?

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Id: 1310 | Status: reopened
Component: browser | Modified: Tue Mar 29 01:16:52 2005
Severity: normal | Milestone: 0.8.2
Priority: highest | Version: 0.8.1
Owner: jonas | Reporter: GregZ
---------------------+------------------------------------------------------
Changes (by GregZ):

* component: timeline => browser

Comment:

To solve this problem, i'am added 2 lines to the trac-post-commit-hook:

{{{
def __init__(self, project=options.project, author=options.user,
rev=options.rev,msg=options.msg):
self.author = author
self.rev = rev

this>> csmsg = "(In [%s]) %s" % (rev, msg)
this>> self.msg = util.to_utf8(csmsg, 'windows-1251')

self.now = int(time.time())
self.con = sqlite.connect(os.path.join(project, 'db', 'trac.db'),
autocommit=0)
}}}

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Id: 1310 | Status: reopened
Component: browser | Modified: Tue Mar 29 01:18:47 2005
Severity: normal | Milestone: 0.8.2
Priority: highest | Version: 0.8.1
Owner: jonas | Reporter: GregZ
---------------------+------------------------------------------------------
Comment (by GregZ):

To solve this problem, i'am added 2 lines to the trac-post-commit-hook:

{{{
def __init__(self, project=options.project, author=options.user,
rev=options.rev,msg=options.msg):
self.author = author
self.rev = rev

this>> csmsg = "(In [%s]) %s" % (rev, msg)
this>> self.msg = util.to_utf8(csmsg, 'windows-1251')

self.now = int(time.time())
self.con = sqlite.connect(os.path.join(project, 'db', 'trac.db'),
autocommit=0)
}}}

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Id: 1310 | Status: reopened
Component: browser | Modified: Sat Apr 2 08:11:46 2005
Severity: minor | Milestone: 0.9
Priority: low | Version: 0.8.1
Owner: jonas | Reporter: GregZ
---------------------+------------------------------------------------------
Changes (by cmlenz):

* milestone: 0.8.2 => 0.9
* priority: highest => low
* severity: normal => minor

Comment:

This is not high-priority, being just a contrib script.

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Id: 1310 | Status: reopened
Component: browser | Modified: Fri Apr 15 08:37:06 2005
Severity: minor | Milestone: 0.9
Priority: low | Version: 0.8.1
Owner: jonas | Reporter: GregZ
---------------------+------------------------------------------------------
Comment (by anonymous):

What svn client you use for writing comments ? It's strange since nornal
subversion encoding is utf-8.

PS ????? ?????????? ?? ???? ???????? -
email/jabber:vyt@vzljot.ru

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Id: 1310 | Status: reopened
Component: browser | Modified: Fri Apr 22 10:29:54 2005
Severity: minor | Milestone: 0.9
Priority: low | Version: 0.8.1
Owner: jonas | Reporter: GregZ
---------------------+------------------------------------------------------
Changes (by vyt@vzljot.ru):

* cc: => vyt@vzljot.ru

Comment:

I think that problem is a way for getting log message.

svnlook does recoding to current locale charset and no way for disable
this recoding. Charset detection in post-commit hook is overhead, so best
way, IMHO - using subversion python API for getting log message.

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone: 0.9
Component: browser | Version: 0.8.1
Severity: minor | Resolution:
Keywords: | Cc: vyt@vzljot.ru
---------------------+------------------------------------------------------
Comment (by dans):

vyt >>

That sounds reasonable, but I'm feeling a bit lost here.

I'm on Windows XP, running the "post-commit.cmd" from #1602. I guess I
should replace the line

{{{
FOR /F "usebackq delims==" %%i IN (`%%SVNLOOK%% log -r %TXN% %REPOS%`) DO
SET LOG=%%i
}}}

with something calling the Python-SVN API, but I neither fully understand
the current line nor have any clue about the API.

Can I just replace the part between the parentheses? And if so, what do I
replace it with?

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.8.1
Severity: minor | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Changes (by cmlenz):

* milestone: 0.9 =>

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.8.1
Severity: minor | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Comment (by vyt@vzljot.ru):

At least trac-post-commit-hook should contain note about invoking svnlook
in non UTF-8 locales like `LANG=ru_RU.UTF-8 svnlook...`

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------+------------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: |
---------------------+------------------------------------------------------
Changes (by szaman):

* version: 0.8.1 => 0.9.3

Comment:

i did:
{{{
LC_ALL="pl_PL.UTF-8"
}}}
in MYREPO/hooks/post-commit

Think, that should be pointed in hook's documentation.

(I'm working on trac-0.9.3 and trunk/contrib/trac-post-commit-hook)

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Changes (by Markus Tacker <m@tacker.org>):

* keywords: => utf-8 unicode
* cc: vyt@vzljot.ru => vyt@vzljot.ru, m@tacker.org

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by Markus Tacker <m@tacker.org>):

#1625 has been marked as duplicate of this bug.

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by cboos):

#2845 has also been marked as duplicate of this bug.

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by cboos):

#2352 is yet another duplicate.

--
Ticket URL: <http://projects.edgewall.com/trac/ticket/1310>
The Trac Project <http://trac.edgewall.com/>
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: jonas
Type: defect | Status: reopened
Priority: low | Milestone:
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by Markus Tacker <m@tacker.org>):

#3732 has been marked as duplicate of this bug.

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:17>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: new
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Changes (by cboos):

* owner: jonas => cboos
* priority: low => normal
* status: reopened => new
* milestone: => 0.10

Comment:

He, not sure that #3732 is really a duplicate of this one, as I wrote a
patch that would have fixed #3732, I believe. We'll see.

Can you try out the following patch?
(be careful, it's for 0.10, don't apply on 0.9)

{{{
Index: trac-post-commit-hook
===================================================================
--- trac-post-commit-hook (revision 3720)
+++ trac-post-commit-hook (working copy)
@@ -78,6 +78,7 @@
from trac.ticket import Ticket
from trac.ticket.web_ui import TicketModule
# TODO: move grouped_changelog_entries to model.py
+from trac.util.text import to_unicode
from trac.web.href import Href

try:
@@ -101,6 +102,8 @@
help='The user who is responsible for this action')
parser.add_option('-m', '--msg', dest='msg',
help='The log message to search.')
+parser.add_option('-c', '--encoding', dest='encoding',
+ help='The encoding used by the log message.')
parser.add_option('-s', '--siteurl', dest='url',
help='The base URL to the project\'s trac website (to
which '
'/ticket/## is appended). If this is not
specified, '
@@ -132,7 +135,9 @@
'see': '_cmdRefs'}

def __init__(self, project=options.project, author=options.user,
- rev=options.rev, msg=options.msg, url=options.url):
+ rev=options.rev, msg=options.msg, url=options.url,
+ encoding=options.encoding):
+ msg = to_unicode(msg, encoding)
self.author = author
self.rev = rev
self.msg = "(In [%s]) %s" % (rev, msg)
}}}

As normally ''I think'' you'd get UTF-8 strings when Subversion calls the
post-commit hook, the `-c/--encoding` option shouldn't be needed.

However it can be useful when testing the script from the command line, or
if for some reason the post-commit hook is actually given the message with
a different encoding.

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:18>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: new
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by sier@itsolution.ch):

Replying to [comment:18 cboos]:
> He, not sure that #3732 is really a duplicate of this one, as I wrote a
patch that would have fixed #3732, I believe. We'll see.
>

The patch works. Thanks!!

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:19>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: closed
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution: fixed
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Changes (by cboos):

* status: new => closed
* resolution: => fixed

Comment:

Ok, patch applied in r3743, and I'm going to close this, so we're going to
find out if #3732 was really a duplicate ;)

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:20>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: closed
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution: fixed
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by Marksu Tacker <m@tacker.org>):

Confirmed on r3747

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:21>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: closed
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution: fixed
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by cboos):

Confirmed what, the fix or the bug? I assume the former, otherwise I guess
you'd have reopened ;)

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:22>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: closed
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution: fixed
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Comment (by Markus Tacker <m@tacker.org>):

Replying to [comment:22 cboos]:
> Confirmed what, the fix or the bug?
Sorry. Fix confirmed. Thank you very much!

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:23>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---
Re: [The Trac Project] #1310: trac-post-commit-hook and codepages [ In reply to ]
#1310: trac-post-commit-hook and codepages
---------------------------+------------------------------------------------
Reporter: GregZ | Owner: cboos
Type: defect | Status: reopened
Priority: normal | Milestone: 0.10
Component: browser | Version: 0.9.3
Severity: minor | Resolution:
Keywords: utf-8 unicode |
---------------------------+------------------------------------------------
Changes (by blaufalke@yahoo.de):

* status: closed => reopened
* resolution: fixed =>

Comment:

doesn't work for me and my trac 0.10.
The changset itself displays the log message with the correct German
umlauts, but the fixed / addressed tickets are generated faulty - even
with trac-post-commit-hook from the current trunk.

Expected result
{{{
(In [353]) "Testcommit für den trac-post-commit-hook addresses #2 fixes
#1"
}}}

Actual result:
{{{
(In [353]) "Testcommit f?\195?\188r den trac-post-commit-hook addresses #2
fixes #1"
}}}

--
Ticket URL: <http://trac.edgewall.org/ticket/1310#comment:24>
The Trac Project <http://trac.edgewall.org/>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Tickets" group.
To post to this group, send email to trac-tickets@googlegroups.com
To unsubscribe from this group, send email to trac-tickets-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.se/group/trac-tickets
-~----------~----~----~----~------~----~------~--~---