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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
6c926fc1
Commit
6c926fc1
authored
May 26, 1999
by
terry%mozilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid mid-air collisions (implementing a suggestion by
py8ieh=bugzilla@bath.ac.uk).
parent
124da23d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
32 deletions
+94
-32
CGI.pl
CGI.pl
+46
-0
bug_form.pl
bug_form.pl
+6
-2
process_bug.cgi
process_bug.cgi
+41
-2
show_activity.cgi
show_activity.cgi
+1
-28
No files found.
CGI.pl
View file @
6c926fc1
...
...
@@ -509,6 +509,52 @@ sub PutHeader {
}
sub
DumpBugActivity
{
my
(
$id
,
$starttime
)
=
(
@_
);
my
$datepart
=
""
;
if
(
defined
$starttime
)
{
$datepart
=
"and bugs_activity.when >= $starttime"
;
}
my
$query
=
"
select bugs_activity.field, bugs_activity.when,
bugs_activity.oldvalue, bugs_activity.newvalue,
profiles.login_name
from bugs_activity,profiles
where bugs_activity.bug_id = $id $datepart
and profiles.userid = bugs_activity.who
order by bugs_activity.when"
;
SendSQL
(
$query
);
print
"<table border cellpadding=4>\n"
;
print
"<tr>\n"
;
print
" <th>Who</th><th>What</th><th>Old value</th><th>New value</th><th>When</th>\n"
;
print
"</tr>\n"
;
my
@row
;
while
(
@row
=
FetchSQLData
())
{
my
(
$field
,
$when
,
$old
,
$new
,
$who
)
=
(
@row
);
$old
=
value_quote
(
$old
);
$new
=
value_quote
(
$new
);
if
(
$old
eq
""
)
{
$old
=
" "
;
}
if
(
$new
eq
""
)
{
$new
=
" "
;
}
print
"<tr>\n"
;
print
"<td>$who</td>\n"
;
print
"<td>$field</td>\n"
;
print
"<td>$old</td>\n"
;
print
"<td>$new</td>\n"
;
print
"<td>$when</td>\n"
;
print
"</tr>\n"
;
}
print
"</table>\n"
;
}
...
...
bug_form.pl
View file @
6c926fc1
...
...
@@ -126,7 +126,8 @@ select
qa_contact,
status_whiteboard,
date_format(creation_ts,'Y-m-d'),
groupset
groupset,
delta_ts
from bugs
where bug_id = $::FORM{'id'}
and bugs.groupset & $::usergroupset = bugs.groupset"
;
...
...
@@ -141,7 +142,7 @@ if (@row = FetchSQLData()) {
"bug_severity"
,
"component"
,
"assigned_to"
,
"reporter"
,
"bug_file_loc"
,
"short_desc"
,
"target_milestone"
,
"qa_contact"
,
"status_whiteboard"
,
"creation_ts"
,
"groupset"
)
{
"groupset"
,
"delta_ts"
)
{
$bug
{
$field
}
=
shift
@row
;
if
(
!
defined
$bug
{
$field
})
{
$bug
{
$field
}
=
""
;
...
...
@@ -172,6 +173,7 @@ if (@row = FetchSQLData()) {
$bug
{
'assigned_to'
}
=
DBID_to_name
(
$bug
{
'assigned_to'
});
$bug
{
'reporter'
}
=
DBID_to_name
(
$bug
{
'reporter'
});
$bug
{
'long_desc'
}
=
GetLongDescription
(
$::FORM
{
'id'
});
my
$longdesclength
=
length
(
$bug
{
'long_desc'
});
GetVersionTable
();
...
...
@@ -206,6 +208,8 @@ print "
<HEAD><TITLE>Bug $::FORM{'id'} -- "
.
html_quote
(
$bug
{
'short_desc'
})
.
"</TITLE></HEAD><BODY>
<FORM NAME=changeform METHOD=POST ACTION=\"process_bug.cgi\">
<INPUT TYPE=HIDDEN NAME=\"delta_ts\" VALUE=\"$bug{'delta_ts'}\">
<INPUT TYPE=HIDDEN NAME=\"longdesclength\" VALUE=\"$longdesclength\">
<INPUT TYPE=HIDDEN NAME=\"id\" VALUE=$::FORM{'id'}>
<INPUT TYPE=HIDDEN NAME=\"was_assigned_to\" VALUE=\"$bug{'assigned_to'}\">
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR>
...
...
process_bug.cgi
View file @
6c926fc1
...
...
@@ -260,12 +260,15 @@ if ($::comma eq "") {
}
my
$basequery
=
$::query
;
my
$delta_ts
;
sub
SnapShotBug
{
my
(
$id
)
=
(
@_
);
SendSQL
(
"select "
.
join
(
','
,
@::log_columns
)
.
SendSQL
(
"select
delta_ts,
"
.
join
(
','
,
@::log_columns
)
.
" from bugs where bug_id = $id"
);
return
FetchSQLData
();
my
@row
=
FetchSQLData
();
$delta_ts
=
shift
@row
;
return
@row
;
}
...
...
@@ -273,6 +276,42 @@ foreach my $id (@idlist) {
SendSQL
(
"lock tables bugs write, bugs_activity write, cc write, profiles write"
);
my
@oldvalues
=
SnapShotBug
(
$id
);
if
(
defined
$::FORM
{
'delta_ts'
}
&&
$::FORM
{
'delta_ts'
}
ne
$delta_ts
)
{
print
"
<H1>Mid-air collision detected!</H1>
Someone else has made changes to this bug at the same time you were trying to.
The changes made were:
<p>
"
;
DumpBugActivity
(
$id
,
$delta_ts
);
my
$longdesc
=
GetLongDescription
(
$id
);
my
$longchanged
=
0
;
if
(
length
(
$longdesc
)
>
$::FORM
{
'longdesclength'
})
{
$longchanged
=
1
;
print
"<P>Added text to the long description:<blockquote><pre>"
;
print
html_quote
(
substr
(
$longdesc
,
$::FORM
{
'longdesclength'
}));
print
"</pre></blockquote>\n"
;
}
SendSQL
(
"unlock tables"
);
print
"You have the following choices: <ul>\n"
;
$::FORM
{
'delta_ts'
}
=
$delta_ts
;
print
"<li><form method=post>"
;
foreach
my
$i
(
keys
%::
FORM
)
{
my
$value
=
value_quote
(
$::FORM
{
$i
});
print
qq{<input type=hidden name="$i" value="$value">\n}
;
}
print
qq{<input type=submit value="Submit my changes anyway">\n}
;
print
" (This will cause all of the above changes to be overwritten"
;
if
(
$longchanged
)
{
print
", except for the changes to the description"
;
}
print
qq{.)</form>\n<li><a href="show_bug.cgi?id=$id">Throw away my changes, and go revisit bug $id</a></ul>\n}
;
navigation_header
();
exit
;
}
my
$query
=
"$basequery\nwhere bug_id = $id"
;
# print "<PRE>$query</PRE>\n";
...
...
show_activity.cgi
View file @
6c926fc1
...
...
@@ -29,35 +29,8 @@ print "Content-type: text/html\n\n";
PutHeader
(
"Changes made to bug $::FORM{'id'}"
,
"Activity log"
,
"Bug $::FORM{'id'}"
);
my
$query
=
"
select bugs_activity.field, bugs_activity.when,
bugs_activity.oldvalue, bugs_activity.newvalue,
profiles.login_name
from bugs_activity,profiles
where bugs_activity.bug_id = $::FORM{'id'}
and profiles.userid = bugs_activity.who
order by bugs_activity.when"
;
ConnectToDatabase
();
SendSQL
(
$query
);
print
"<table border cellpadding=4>\n"
;
print
"<tr>\n"
;
print
" <th>Who</th><th>What</th><th>Old value</th><th>New value</th><th>When</th>\n"
;
print
"</tr>\n"
;
DumpBugActivity
(
$::FORM
{
'id'
});
my
@row
;
while
(
@row
=
FetchSQLData
())
{
my
(
$field
,
$when
,
$old
,
$new
,
$who
)
=
(
@row
);
$old
=
value_quote
(
$old
);
$new
=
value_quote
(
$new
);
print
"<tr>\n"
;
print
"<td>$who</td>\n"
;
print
"<td>$field</td>\n"
;
print
"<td>$old</td>\n"
;
print
"<td>$new</td>\n"
;
print
"<td>$when</td>\n"
;
print
"</tr>\n"
;
}
print
"</table>\n"
;
print
"<hr><a href=show_bug.cgi?id=$::FORM{'id'}>Back to bug $::FORM{'id'}</a>\n"
;
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