Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
b0c4ab34
Commit
b0c4ab34
authored
Jun 03, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 562314: Add support for a different bug page in URLs
r/a=LpSolit
parent
ffe9d282
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
importxml.pl
importxml.pl
+15
-7
No files found.
importxml.pl
View file @
b0c4ab34
...
...
@@ -77,13 +77,16 @@ my $debug = 0;
my
$mail
=
''
;
my
$attach_path
=
''
;
my
$help
=
0
;
my
(
$default_product_name
,
$default_component_name
);
my
$bug_page
=
'show_bug.cgi?id='
;
my
$default_product_name
=
''
;
my
$default_component_name
=
''
;
my
$result
=
GetOptions
(
"verbose|debug+"
=>
\
$debug
,
"mail|sendmail!"
=>
\
$mail
,
"attach_path=s"
=>
\
$attach_path
,
"help|?"
=>
\
$help
,
"bug_page=s"
=>
\
$bug_page
,
"product=s"
=>
\
$default_product_name
,
"component=s"
=>
\
$default_component_name
,
);
...
...
@@ -102,9 +105,6 @@ my $dbh = Bugzilla->dbh;
my
$params
=
Bugzilla
->
params
;
my
(
$timestamp
)
=
$dbh
->
selectrow_array
(
"SELECT NOW()"
);
$default_product_name
=
''
if
!
defined
$default_product_name
;
$default_component_name
=
''
if
!
defined
$default_component_name
;
###############################################################################
# Helper sub routines #
###############################################################################
...
...
@@ -404,6 +404,8 @@ sub process_bug {
my
$exporter_login
=
$root
->
{
'att'
}
->
{
'exporter'
};
my
$exporter
=
new
Bugzilla::
User
({
name
=>
$exporter_login
});
my
$urlbase
=
$root
->
{
'att'
}
->
{
'urlbase'
};
my
$url
=
$urlbase
.
$bug_page
;
trick_taint
(
$url
);
# We will store output information in this variable.
my
$log
=
""
;
...
...
@@ -504,7 +506,6 @@ sub process_bug {
# Same goes for bug #'s Since we don't know if the referenced bug
# is also being moved, lets make sure they know it means a different
# bugzilla.
my
$url
=
$urlbase
.
"show_bug.cgi?id="
;
$data
=~
s/([Bb]ugs?\s*\#?\s*(\d+))/$url$2/g
;
# Keep the original commenter if possible, else we will fall back
...
...
@@ -525,7 +526,7 @@ sub process_bug {
$comments
.=
format_time
(
scalar
localtime
(
time
()),
'%Y-%m-%d %R %Z'
)
.
" "
;
$comments
.=
" ---\n\n"
;
$comments
.=
"This bug was previously known as _bug_ $bug_fields{'bug_id'} at "
;
$comments
.=
$url
base
.
"show_bug.cgi?id="
.
$bug_fields
{
'bug_id'
}
.
"\n"
;
$comments
.=
$url
.
$bug_fields
{
'bug_id'
}
.
"\n"
;
if
(
defined
$bug_fields
{
'dependson'
}
)
{
$comments
.=
"This bug depended on bug(s) "
.
join
(
' '
,
_to_array
(
$bug_fields
{
'dependson'
}))
.
".\n"
;
...
...
@@ -1200,7 +1201,7 @@ sub process_bug {
}
}
$log
.=
"Bug ${url
base}show_bug.cgi?id=
$bug_fields{'bug_id'} "
;
$log
.=
"Bug ${url
}
$bug_fields{'bug_id'} "
;
$log
.=
"imported as bug $id.\n"
;
$log
.=
$params
->
{
"urlbase"
}
.
"show_bug.cgi?id=$id\n\n"
;
if
(
$err
)
{
...
...
@@ -1294,6 +1295,13 @@ Send mail to exporter with a log of bugs imported and any errors.
The path to the attachment files. (Required if encoding="filename"
is used for attachments.)
=item B<--bug_page>
The page that links to the bug on top of urlbase. Its default value
is "show_bug.cgi?id=", which is what Bugzilla installations use.
You only need to pass this argument if you are importing bugs from
another bug tracking system.
=item B<--product=name>
The product to put the bug in if the product specified in the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment