Edgewall Software

Opened 12 years ago

Last modified 4 years ago

#10504 closed defect

[PATCH] bugzilla2trac.py: import Bugzilla version 4.0.1 — at Version 9

Reported by: tapomay.dey@… Owned by:
Priority: normal Milestone:
Component: contrib Version: 0.11.1
Severity: normal Keywords: verify, patch, bugzilla2trac
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos <ryano@…>)

Creating new ticket in lines of http://trac.edgewall.org/ticket/7333 as that one is pretty old. Managed to import my bugs from Bugzilla version 4.0.1 into Trac version 0.11.1. Changes in the bugzilla2trac.py:

  1. BZ_VERSION = 4010
    Fixed selection of correct query in TracDatabase.getFieldName
    "cursor.execute("SELECT * FROM fielddefs WHERE id = %s",(fieldid))"
    is correct.
    
  2. In method TracDatabase.addAttachment

Insert following code to change : TracDatabase.env.path to absolute path

mod_env = os.path.abspath(self.env.path).	
self.env.path = mod_env

Before doing

"attachment = Attachment(self.env, 'ticket', id)"

This fixed an assertion error in attachment.py:

" assert commonprefix == attachments_dir "
System Information:
Trac:	0.11.1
Python:	2.5.2 (r252:60911, Jan 24 2010, 17:44:40) [GCC 4.3.2]
setuptools:	0.6c8
SQLite:	3.5.9
pysqlite:	2.4.1
Genshi:	0.5.1
Subversion:	1.5.1 (r32289)
jQuery:	1.2.6

P.S: Please note that I have no insight into trac codebase nor am I accustomed to python. The changes to the script are completely symptom-solution based.

Change History (11)

comment:1 by Remy Blank, 12 years ago

Milestone: not applicable

Would you mind submitting a patch? It's much easier to apply on the code than an English explanation ;)

by tapomay.dey@…, 12 years ago

Attachment: bugzilla2py_0_11_1.diff added

svn Diff for bugzilla2trac.py changes w.r.t. trac-0.11.1

comment:3 by Remy Blank, 12 years ago

Milestone: 0.13
Owner: set to Remy Blank

Yes, that's what I meant. Thank you.

by tapomay.dey@…, 12 years ago

svn Diff for bugzilla2trac.py changes w.r.t. trac-0.11.1 and mysql

comment:4 by tapomay.dey@…, 12 years ago

Added one more diff - http://trac.edgewall.org/attachment/ticket/10504/bugzilla2py_mysql_0_11_1.diff

This is for the change I had to make while importing into Mysql database. Only difference from previous attachment (http://trac.edgewall.org/attachment/ticket/10504/bugzilla2py_0_11_1.diff) is that I had to change table name from "Ticket" to "ticket" in the query in TracDatabase.hasTickets. "Ticket" worked for sqlite but I guess mysql has case-sensitive table names. Actual table is named "ticket". The latest code in trunk has correct table-name "ticket". Just FYI.

comment:5 by Remy Blank, 12 years ago

Owner: Remy Blank removed

Refocusing.

comment:6 by Remy Blank, 12 years ago

Milestone: 1.01.0-triage

Preparing for 1.0.

comment:7 by Ryan J Ollos <ryano@…>, 12 years ago

Description: modified (diff)

comment:8 by Christian Boos, 12 years ago

Type: enhancementdefect

Looks like the 'attachments' has to be modified anyway due to r11028.

comment:9 by Christian Boos, 12 years ago

API Changes: modified (diff)
Note: See TracTickets for help on using tickets.