Issue #2299 on hold

index fault when picking a ticket-commitmessage with tracexplorer

Daniel Gehriger
created an issue

I'm adding ticket 1612 from hgtk, as it doesn't seem to get included in TortoiseHg, despite the original ticket including the fix:

I've installed Tracexplorer to select tickets from our tracsite and put this info as commitmessage on commit. The ticketbrowser is opening and a can point a ticket a want to add to the commitmessage, but when pressing OK from tracexplorer my commitmessage is not filled with the ticketinfo. When closing Mercurial commit intererface a receive the following stderr output.

** Please report this bug to http://bitbucket.org/tortoisehg/stable/issues or tortoisehg-discuss@lists.sourceforge.net
** Mercurial version (1.7+22-6bd9778ae749).  TortoiseHg version (1.1.5+11-46a0e79316c4)
** Command: --nofork commit
** CWD: C:\Ontwikkeling\PVSS_39\PrismataFacility_v1.0_mercurial
** Extensions loaded: fixfrozenexts, convert, rebase, svn, hgcr-gui
** Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
** sys.getwindowsversion(): (5, 1, 2600, 2, 'Service Pack 3')
** Processor architecture: x86
Recoverable runtime error (stderr):
Traceback (most recent call last):
  File "tortoisehg\hgtk\commit.pyo", line 626, in bugtraq_clicked
  File "tortoisehg\hgtk\bugtraq.pyo", line 92, in get_commit_message
  File "comtypes\safearray.pyo", line 182, in __ctypes_from_outparam__
  File "comtypes\safearray.pyo", line 173, in __getitem__
  File "comtypes\safearray.pyo", line 211, in unpack
  File "comtypes\safearray.pyo", line 281, in _get_row
IndexError: invalid index

Solution:

The reason seems to be that TracExplorer returns nulls for some the out params and Python is unable to deal with them. I have created a small patch for TortoiseHG so that it uses old interface call.

diff -r 24e9d29b1f80 tortoisehg/util/bugtraq.py
--- a/tortoisehg/util/bugtraq.py    Mon Jan 09 00:16:01 2012 -0800
+++ b/tortoisehg/util/bugtraq.py    Fri Jan 13 21:11:11 2012 +0100
@@ -90,7 +90,7 @@
         pathlist = bstrarray.from_param(())

         bugtr = self._get_bugtraq_object()
-        if self.supports_bugtraq2_interface():
+        if False:# self.supports_bugtraq2_interface():
             (bugid, revPropNames, revPropValues, newmessage) = bugtr.GetCommitMessage2(
                     0, parameters, commonurl, commonroot, pathlist, logmessage, bugid)
         else:

Comments (3)

  1. Yuya Nishihara

    I don't think the proposed patch is correct. It should, at least, disable bugtraq2 interface only for TracExplorer.

    FWIW, isn't it a bug of TracExplorer? The IBugtraqProvider2 doc says:

    The revPropNames and revPropValues return parameters [...] If no revision properties are to be set, the plugin must return empty arrays.

  2. Log in to comment