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
275eb1b3
Commit
275eb1b3
authored
Feb 07, 2013
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 784352: Show a warning when interdiff reports errors
r=dkl, a=LpSolit
parent
87badf1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
13 deletions
+34
-13
PatchReader.pm
Bugzilla/Attachment/PatchReader.pm
+23
-5
diff-header.html.tmpl
template/en/default/attachment/diff-header.html.tmpl
+11
-8
No files found.
Bugzilla/Attachment/PatchReader.pm
View file @
275eb1b3
...
...
@@ -10,6 +10,9 @@ package Bugzilla::Attachment::PatchReader;
use
5.10.1
;
use
strict
;
use
IPC::
Open3
;
use
Symbol
'gensym'
;
use
Bugzilla::
Error
;
use
Bugzilla::
Attachment
;
use
Bugzilla::
Util
;
...
...
@@ -100,8 +103,23 @@ sub process_interdiff {
# Send through interdiff, send output directly to template.
# Must hack path so that interdiff will work.
$ENV
{
'PATH'
}
=
$lc
->
{
diffpath
};
open
my
$interdiff_fh
,
"$lc->{interdiffbin} $old_filename $new_filename|"
;
binmode
$interdiff_fh
;
my
(
$interdiff_stdout
,
$interdiff_stderr
);
$interdiff_stderr
=
gensym
;
my
$pid
=
open3
(
gensym
,
$interdiff_stdout
,
$interdiff_stderr
,
$lc
->
{
interdiffbin
},
$old_filename
,
$new_filename
);
binmode
$interdiff_stdout
;
# Check for errors
{
local
$/
=
undef
;
my
$error
=
<
$interdiff_stderr
>
;
if
(
$error
)
{
warn
(
$error
);
$warning
=
'interdiff3'
;
}
}
my
(
$reader
,
$last_reader
)
=
setup_patch_readers
(
""
,
$context
);
if
(
$format
eq
'raw'
)
{
...
...
@@ -114,7 +132,7 @@ sub process_interdiff {
}
else
{
# In case the HTML page is displayed with the UTF-8 encoding.
binmode
$interdiff_
fh
,
':utf8'
if
Bugzilla
->
params
->
{
'utf8'
};
binmode
$interdiff_
stdout
,
':utf8'
if
Bugzilla
->
params
->
{
'utf8'
};
$vars
->
{
'warning'
}
=
$warning
if
$warning
;
$vars
->
{
'bugid'
}
=
$new_attachment
->
bug_id
;
...
...
@@ -125,9 +143,9 @@ sub process_interdiff {
setup_template_patch_reader
(
$last_reader
,
$format
,
$context
,
$vars
);
}
$reader
->
iterate_fh
(
$interdiff_
fh
,
'interdiff #'
.
$old_attachment
->
id
.
$reader
->
iterate_fh
(
$interdiff_
stdout
,
'interdiff #'
.
$old_attachment
->
id
.
' #'
.
$new_attachment
->
id
);
close
$interdiff_fh
;
waitpid
(
$pid
,
0
)
;
$ENV
{
'PATH'
}
=
''
;
# Delete temporary files.
...
...
template/en/default/attachment/diff-header.html.tmpl
View file @
275eb1b3
...
...
@@ -119,15 +119,18 @@ Interdiff of #[% oldid %] and #[% newid %] for [% terms.bug %] #[% bugid %]
[% END %]
[% IF warning %]
<h2
class=
"warning"
>
Warning:
<h2
class=
"warning"
>
Warning:
[% IF warning == "interdiff1" %]
this difference between two patches may show things in the wrong places due
to a limitation in [% terms.Bugzilla %] when comparing patches with different
sets of files.
[% END %]
[% IF warning == "interdiff2" %]
this difference between two patches may be inaccurate due to a limitation in
[%+ terms.Bugzilla %] when comparing patches made against different revisions.
this difference between two patches may show things in the wrong places due
to a limitation in [% terms.Bugzilla %] when comparing patches with
different sets of files.
[% ELSIF warning == "interdiff2" %]
this difference between two patches may be inaccurate due to a limitation
in [%+ terms.Bugzilla %] when comparing patches made against different
revisions.
[% ELSIF warning == "interdiff3" %]
interdiff encountered errors while comparing these patches.
[% END %]
</h2>
[% ELSE %]
...
...
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