author | Mark J. Nelson <Mark.J.Nelson@Sun.COM> |
Wed, 06 Aug 2008 16:29:39 -0600 | |
changeset 7298 | b69e27387f74 |
parent 7078 | 935563142864 |
child 7310 | 47b366e07022 |
permissions | -rw-r--r-- |
0 | 1 |
#!/usr/bin/ksh -p |
2 |
# |
|
3 |
# CDDL HEADER START |
|
4 |
# |
|
5 |
# The contents of this file are subject to the terms of the |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
6 |
# Common Development and Distribution License (the "License"). |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
7 |
# You may not use this file except in compliance with the License. |
0 | 8 |
# |
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
10 |
# or http://www.opensolaris.org/os/licensing. |
|
11 |
# See the License for the specific language governing permissions |
|
12 |
# and limitations under the License. |
|
13 |
# |
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
19 |
# |
|
20 |
# CDDL HEADER END |
|
21 |
# |
|
7298
b69e27387f74
6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents:
7078
diff
changeset
|
22 |
|
0 | 23 |
# |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
24 |
# Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
0 | 25 |
# Use is subject to license terms. |
26 |
# |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
27 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
28 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
29 |
# This script takes a file list and a workspace and builds a set of html files |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
30 |
# suitable for doing a code review of source changes via a web page. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
31 |
# Documentation is available via the manual page, webrev.1, or just |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
32 |
# type 'webrev -h'. |
0 | 33 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
34 |
# Acknowledgements to contributors to webrev are listed in the webrev(1) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
35 |
# man page. |
0 | 36 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
37 |
|
0 | 38 |
REMOVED_COLOR=brown |
39 |
CHANGED_COLOR=blue |
|
40 |
NEW_COLOR=blue |
|
41 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
42 |
HTML='<?xml version="1.0"?> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
43 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
44 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
45 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
46 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
47 |
FRAMEHTML='<?xml version="1.0"?> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
48 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
49 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
50 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
51 |
|
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
52 |
STDHEAD='<meta http-equiv="cache-control" content="no-cache"></meta> |
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
53 |
<meta http-equiv="Pragma" content="no-cache"></meta> |
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
54 |
<meta http-equiv="Expires" content="-1"></meta> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
55 |
<!-- |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
56 |
Note to customizers: the body of the webrev is IDed as SUNWwebrev |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
57 |
to allow easy overriding by users of webrev via the userContent.css |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
58 |
mechanism available in some browsers. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
59 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
60 |
For example, to have all "removed" information be red instead of |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
61 |
brown, set a rule in your userContent.css file like: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
62 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
63 |
body#SUNWwebrev span.removed { color: red ! important; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
64 |
--> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
65 |
<style type="text/css" media="screen"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
66 |
body { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
67 |
background-color: #eeeeee; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
68 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
69 |
hr { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
70 |
border: none 0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
71 |
border-top: 1px solid #aaa; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
72 |
height: 1px; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
73 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
74 |
div.summary { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
75 |
font-size: .8em; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
76 |
border-bottom: 1px solid #aaa; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
77 |
padding-left: 1em; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
78 |
padding-right: 1em; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
79 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
80 |
div.summary h2 { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
81 |
margin-bottom: 0.3em; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
82 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
83 |
div.summary table th { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
84 |
text-align: right; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
85 |
vertical-align: top; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
86 |
white-space: nowrap; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
87 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
88 |
span.lineschanged { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
89 |
font-size: 0.7em; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
90 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
91 |
span.oldmarker { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
92 |
color: red; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
93 |
font-size: large; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
94 |
font-weight: bold; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
95 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
96 |
span.newmarker { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
97 |
color: green; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
98 |
font-size: large; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
99 |
font-weight: bold; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
100 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
101 |
span.removed { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
102 |
color: brown; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
103 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
104 |
span.changed { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
105 |
color: blue; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
106 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
107 |
span.new { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
108 |
color: blue; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
109 |
font-weight: bold; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
110 |
} |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
111 |
span.chmod { |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
112 |
font-size: 0.7em; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
113 |
color: #db7800; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
114 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
115 |
a.print { font-size: x-small; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
116 |
a:hover { background-color: #ffcc99; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
117 |
</style> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
118 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
119 |
<style type="text/css" media="print"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
120 |
pre { font-size: 0.8em; font-family: courier, monospace; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
121 |
span.removed { color: #444; font-style: italic } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
122 |
span.changed { font-weight: bold; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
123 |
span.new { font-weight: bold; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
124 |
span.newmarker { font-size: 1.2em; font-weight: bold; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
125 |
span.oldmarker { font-size: 1.2em; font-weight: bold; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
126 |
a.print {display: none} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
127 |
hr { border: none 0; border-top: 1px solid #aaa; height: 1px; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
128 |
</style> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
129 |
' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
130 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
131 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
132 |
# UDiffs need a slightly different CSS rule for 'new' items (we don't |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
133 |
# want them to be bolded as we do in cdiffs or sdiffs). |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
134 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
135 |
UDIFFCSS=' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
136 |
<style type="text/css" media="screen"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
137 |
span.new { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
138 |
color: blue; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
139 |
font-weight: normal; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
140 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
141 |
</style> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
142 |
' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
143 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
144 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
145 |
# input_cmd | html_quote | output_cmd |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
146 |
# or |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
147 |
# html_quote filename | output_cmd |
0 | 148 |
# |
149 |
# Make a piece of source code safe for display in an HTML <pre> block. |
|
150 |
# |
|
151 |
html_quote() |
|
152 |
{ |
|
153 |
sed -e "s/&/\&/g" -e "s/</\</g" -e "s/>/\>/g" "$@" | expand |
|
154 |
} |
|
155 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
156 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
157 |
# input_cmd | bug2url | output_cmd |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
158 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
159 |
# Scan for bugids and insert <a> links to the relevent bug database. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
160 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
161 |
bug2url() |
0 | 162 |
{ |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
163 |
sed -e 's|[0-9]\{5,\}|<a href=\"'$BUGURL'&\">&</a>|g' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
164 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
165 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
166 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
167 |
# input_cmd | sac2url | output_cmd |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
168 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
169 |
# Scan for ARC cases and insert <a> links to the relevent SAC database. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
170 |
# This is slightly complicated because inside the SWAN, SAC cases are |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
171 |
# grouped by ARC: PSARC/2006/123. But on OpenSolaris.org, they are |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
172 |
# referenced as 2006/123 (without labelling the ARC). |
0 | 173 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
174 |
sac2url() |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
175 |
{ |
5175 | 176 |
if [[ -z "$Oflag" ]]; then |
3949 | 177 |
sed -e 's|\([A-Z]\{1,2\}ARC\)[ /]\([0-9]\{4\}\)/\([0-9]\{3\}\)|<a href=\"'$SACURL'/\1/\2/\3\">\1 \2/\3</a>|g' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
178 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
179 |
sed -e 's|\([A-Z]\{1,2\}ARC\)[ /]\([0-9]\{4\}\)/\([0-9]\{3\}\)|<a href=\"'$SACURL'/\2/\3\">\1 \2/\3</a>|g' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
180 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
181 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
182 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
183 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
184 |
# strip_unchanged <infile> | output_cmd |
0 | 185 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
186 |
# Removes chunks of sdiff documents that have not changed. This makes it |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
187 |
# easier for a code reviewer to find the bits that have changed. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
188 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
189 |
# Deleted lines of text are replaced by a horizontal rule. Some |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
190 |
# identical lines are retained before and after the changed lines to |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
191 |
# provide some context. The number of these lines is controlled by the |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
192 |
# variable C in the $AWK script below. |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
193 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
194 |
# The script detects changed lines as any line that has a "<span class=" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
195 |
# string embedded (unchanged lines have no particular class and are not |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
196 |
# part of a <span>). Blank lines (without a sequence number) are also |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
197 |
# detected since they flag lines that have been inserted or deleted. |
0 | 198 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
199 |
strip_unchanged() |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
200 |
{ |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
201 |
$AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
202 |
BEGIN { C = c = 20 } |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
203 |
NF == 0 || /<span class="/ { |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
204 |
if (c > C) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
205 |
c -= C |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
206 |
inx = 0 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
207 |
if (c > C) { |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
208 |
print "\n</pre><hr></hr><pre>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
209 |
inx = c % C |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
210 |
c = C |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
211 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
212 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
213 |
for (i = 0; i < c; i++) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
214 |
print ln[(inx + i) % C] |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
215 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
216 |
c = 0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
217 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
218 |
next |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
219 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
220 |
{ if (c >= C) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
221 |
ln[c % C] = $0 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
222 |
c++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
223 |
next; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
224 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
225 |
c++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
226 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
227 |
} |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
228 |
END { if (c > (C * 2)) print "\n</pre><hr></hr>" } |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
229 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
230 |
' $1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
231 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
232 |
|
0 | 233 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
234 |
# sdiff_to_html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
235 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
236 |
# This function takes two files as arguments, obtains their diff, and |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
237 |
# processes the diff output to present the files as an HTML document with |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
238 |
# the files displayed side-by-side, differences shown in color. It also |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
239 |
# takes a delta comment, rendered as an HTML snippet, as the third |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
240 |
# argument. The function takes two files as arguments, then the name of |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
241 |
# file, the path, and the comment. The HTML will be delivered on stdout, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
242 |
# e.g. |
0 | 243 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
244 |
# $ sdiff_to_html old/usr/src/tools/scripts/webrev.sh \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
245 |
# new/usr/src/tools/scripts/webrev.sh \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
246 |
# webrev.sh usr/src/tools/scripts \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
247 |
# '<a href="http://monaco.sfbay.sun.com/detail.jsp?cr=1234567"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
248 |
# 1234567</a> my bugid' > <file>.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
249 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
250 |
# framed_sdiff() is then called which creates $2.frames.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
251 |
# in the webrev tree. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
252 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
253 |
# FYI: This function is rather unusual in its use of awk. The initial |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
254 |
# diff run produces conventional diff output showing changed lines mixed |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
255 |
# with editing codes. The changed lines are ignored - we're interested in |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
256 |
# the editing codes, e.g. |
0 | 257 |
# |
258 |
# 8c8 |
|
259 |
# 57a61 |
|
260 |
# 63c66,76 |
|
261 |
# 68,93d80 |
|
262 |
# 106d90 |
|
263 |
# 108,110d91 |
|
264 |
# |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
265 |
# These editing codes are parsed by the awk script and used to generate |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
266 |
# another awk script that generates HTML, e.g the above lines would turn |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
267 |
# into something like this: |
0 | 268 |
# |
269 |
# BEGIN { printf "<pre>\n" } |
|
270 |
# function sp(n) {for (i=0;i<n;i++)printf "\n"} |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
271 |
# function wl(n) {printf "<font color=%s>%4d %s </font>\n", n, NR, $0} |
0 | 272 |
# NR==8 {wl("#7A7ADD");next} |
273 |
# NR==54 {wl("#7A7ADD");sp(3);next} |
|
274 |
# NR==56 {wl("#7A7ADD");next} |
|
275 |
# NR==57 {wl("black");printf "\n"; next} |
|
276 |
# : : |
|
277 |
# |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
278 |
# This script is then run on the original source file to generate the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
279 |
# HTML that corresponds to the source file. |
0 | 280 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
281 |
# The two HTML files are then combined into a single piece of HTML that |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
282 |
# uses an HTML table construct to present the files side by side. You'll |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
283 |
# notice that the changes are color-coded: |
0 | 284 |
# |
285 |
# black - unchanged lines |
|
286 |
# blue - changed lines |
|
287 |
# bold blue - new lines |
|
288 |
# brown - deleted lines |
|
289 |
# |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
290 |
# Blank lines are inserted in each file to keep unchanged lines in sync |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
291 |
# (side-by-side). This format is familiar to users of sdiff(1) or |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
292 |
# Teamware's filemerge tool. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
293 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
294 |
sdiff_to_html() |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
295 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
296 |
diff -b $1 $2 > /tmp/$$.diffs |
0 | 297 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
298 |
TNAME=$3 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
299 |
TPATH=$4 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
300 |
COMMENT=$5 |
0 | 301 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
302 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
303 |
# Now we have the diffs, generate the HTML for the old file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
304 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
305 |
$AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
306 |
BEGIN { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
307 |
printf "function sp(n) {for (i=0;i<n;i++)printf \"\\n\"}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
308 |
printf "function removed() " |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
309 |
printf "{printf \"<span class=\\\"removed\\\">%%4d %%s</span>\\n\", NR, $0}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
310 |
printf "function changed() " |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
311 |
printf "{printf \"<span class=\\\"changed\\\">%%4d %%s</span>\\n\", NR, $0}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
312 |
printf "function bl() {printf \"%%4d %%s\\n\", NR, $0}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
313 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
314 |
/^</ {next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
315 |
/^>/ {next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
316 |
/^---/ {next} |
0 | 317 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
318 |
{ |
0 | 319 |
split($1, a, /[cad]/) ; |
320 |
if (index($1, "a")) { |
|
321 |
if (a[1] == 0) { |
|
322 |
n = split(a[2], r, /,/); |
|
323 |
if (n == 1) |
|
324 |
printf "BEGIN\t\t{sp(1)}\n" |
|
325 |
else |
|
326 |
printf "BEGIN\t\t{sp(%d)}\n",\ |
|
327 |
(r[2] - r[1]) + 1 |
|
328 |
next |
|
329 |
} |
|
330 |
||
331 |
printf "NR==%s\t\t{", a[1] |
|
332 |
n = split(a[2], r, /,/); |
|
333 |
s = r[1]; |
|
334 |
if (n == 1) |
|
335 |
printf "bl();printf \"\\n\"; next}\n" |
|
336 |
else { |
|
337 |
n = r[2] - r[1] |
|
338 |
printf "bl();sp(%d);next}\n",\ |
|
339 |
(r[2] - r[1]) + 1 |
|
340 |
} |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
341 |
next |
0 | 342 |
} |
343 |
if (index($1, "d")) { |
|
344 |
n = split(a[1], r, /,/); |
|
345 |
n1 = r[1] |
|
346 |
n2 = r[2] |
|
347 |
if (n == 1) |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
348 |
printf "NR==%s\t\t{removed(); next}\n" , n1 |
0 | 349 |
else |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
350 |
printf "NR==%s,NR==%s\t{removed(); next}\n" , n1, n2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
351 |
next |
0 | 352 |
} |
353 |
if (index($1, "c")) { |
|
354 |
n = split(a[1], r, /,/); |
|
355 |
n1 = r[1] |
|
356 |
n2 = r[2] |
|
357 |
final = n2 |
|
358 |
d1 = 0 |
|
359 |
if (n == 1) |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
360 |
printf "NR==%s\t\t{changed();" , n1 |
0 | 361 |
else { |
362 |
d1 = n2 - n1 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
363 |
printf "NR==%s,NR==%s\t{changed();" , n1, n2 |
0 | 364 |
} |
365 |
m = split(a[2], r, /,/); |
|
366 |
n1 = r[1] |
|
367 |
n2 = r[2] |
|
368 |
if (m > 1) { |
|
369 |
d2 = n2 - n1 |
|
370 |
if (d2 > d1) { |
|
371 |
if (n > 1) printf "if (NR==%d)", final |
|
372 |
printf "sp(%d);", d2 - d1 |
|
373 |
} |
|
374 |
} |
|
375 |
printf "next}\n" ; |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
376 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
377 |
next |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
378 |
} |
0 | 379 |
} |
380 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
381 |
END { printf "{printf \"%%4d %%s\\n\", NR, $0 }\n" } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
382 |
' /tmp/$$.diffs > /tmp/$$.file1 |
0 | 383 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
384 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
385 |
# Now generate the HTML for the new file |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
386 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
387 |
$AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
388 |
BEGIN { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
389 |
printf "function sp(n) {for (i=0;i<n;i++)printf \"\\n\"}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
390 |
printf "function new() " |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
391 |
printf "{printf \"<span class=\\\"new\\\">%%4d %%s</span>\\n\", NR, $0}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
392 |
printf "function changed() " |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
393 |
printf "{printf \"<span class=\\\"changed\\\">%%4d %%s</span>\\n\", NR, $0}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
394 |
printf "function bl() {printf \"%%4d %%s\\n\", NR, $0}\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
395 |
} |
0 | 396 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
397 |
/^</ {next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
398 |
/^>/ {next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
399 |
/^---/ {next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
400 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
401 |
{ |
0 | 402 |
split($1, a, /[cad]/) ; |
403 |
if (index($1, "d")) { |
|
404 |
if (a[2] == 0) { |
|
405 |
n = split(a[1], r, /,/); |
|
406 |
if (n == 1) |
|
407 |
printf "BEGIN\t\t{sp(1)}\n" |
|
408 |
else |
|
409 |
printf "BEGIN\t\t{sp(%d)}\n",\ |
|
410 |
(r[2] - r[1]) + 1 |
|
411 |
next |
|
412 |
} |
|
413 |
||
414 |
printf "NR==%s\t\t{", a[2] |
|
415 |
n = split(a[1], r, /,/); |
|
416 |
s = r[1]; |
|
417 |
if (n == 1) |
|
418 |
printf "bl();printf \"\\n\"; next}\n" |
|
419 |
else { |
|
420 |
n = r[2] - r[1] |
|
421 |
printf "bl();sp(%d);next}\n",\ |
|
422 |
(r[2] - r[1]) + 1 |
|
423 |
} |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
424 |
next |
0 | 425 |
} |
426 |
if (index($1, "a")) { |
|
427 |
n = split(a[2], r, /,/); |
|
428 |
n1 = r[1] |
|
429 |
n2 = r[2] |
|
430 |
if (n == 1) |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
431 |
printf "NR==%s\t\t{new() ; next}\n" , n1 |
0 | 432 |
else |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
433 |
printf "NR==%s,NR==%s\t{new() ; next}\n" , n1, n2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
434 |
next |
0 | 435 |
} |
436 |
if (index($1, "c")) { |
|
437 |
n = split(a[2], r, /,/); |
|
438 |
n1 = r[1] |
|
439 |
n2 = r[2] |
|
440 |
final = n2 |
|
441 |
d2 = 0; |
|
442 |
if (n == 1) { |
|
443 |
final = n1 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
444 |
printf "NR==%s\t\t{changed();" , n1 |
0 | 445 |
} else { |
446 |
d2 = n2 - n1 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
447 |
printf "NR==%s,NR==%s\t{changed();" , n1, n2 |
0 | 448 |
} |
449 |
m = split(a[1], r, /,/); |
|
450 |
n1 = r[1] |
|
451 |
n2 = r[2] |
|
452 |
if (m > 1) { |
|
453 |
d1 = n2 - n1 |
|
454 |
if (d1 > d2) { |
|
455 |
if (n > 1) printf "if (NR==%d)", final |
|
456 |
printf "sp(%d);", d1 - d2 |
|
457 |
} |
|
458 |
} |
|
459 |
printf "next}\n" ; |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
460 |
next |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
461 |
} |
0 | 462 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
463 |
END { printf "{printf \"%%4d %%s\\n\", NR, $0 }\n" } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
464 |
' /tmp/$$.diffs > /tmp/$$.file2 |
0 | 465 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
466 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
467 |
# Post-process the HTML files by running them back through $AWK |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
468 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
469 |
html_quote < $1 | $AWK -f /tmp/$$.file1 > /tmp/$$.file1.html |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
470 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
471 |
html_quote < $2 | $AWK -f /tmp/$$.file2 > /tmp/$$.file2.html |
0 | 472 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
473 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
474 |
# Now combine into a valid HTML file and side-by-side into a table |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
475 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
476 |
print "$HTML<head>$STDHEAD" |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
477 |
print "<title>$WNAME Sdiff $TPATH/$TNAME</title>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
478 |
print "</head><body id=\"SUNWwebrev\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
479 |
print "<a class=\"print\" href=\"javascript:print()\">Print this page</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
480 |
print "<pre>$COMMENT</pre>\n" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
481 |
print "<table><tr valign=\"top\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
482 |
print "<td><pre>" |
0 | 483 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
484 |
strip_unchanged /tmp/$$.file1.html |
0 | 485 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
486 |
print "</pre></td><td><pre>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
487 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
488 |
strip_unchanged /tmp/$$.file2.html |
0 | 489 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
490 |
print "</pre></td>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
491 |
print "</tr></table>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
492 |
print "</body></html>" |
0 | 493 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
494 |
framed_sdiff $TNAME $TPATH /tmp/$$.file1.html /tmp/$$.file2.html \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
495 |
"$COMMENT" |
0 | 496 |
} |
497 |
||
498 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
499 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
500 |
# framed_sdiff <filename> <filepath> <lhsfile> <rhsfile> <comment> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
501 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
502 |
# Expects lefthand and righthand side html files created by sdiff_to_html. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
503 |
# We use insert_anchors() to augment those with HTML navigation anchors, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
504 |
# and then emit the main frame. Content is placed into: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
505 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
506 |
# $WDIR/DIR/$TNAME.lhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
507 |
# $WDIR/DIR/$TNAME.rhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
508 |
# $WDIR/DIR/$TNAME.frames.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
509 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
510 |
# NOTE: We rely on standard usage of $WDIR and $DIR. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
511 |
# |
0 | 512 |
function framed_sdiff |
513 |
{ |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
514 |
typeset TNAME=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
515 |
typeset TPATH=$2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
516 |
typeset lhsfile=$3 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
517 |
typeset rhsfile=$4 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
518 |
typeset comments=$5 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
519 |
typeset RTOP |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
520 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
521 |
# Enable html files to access WDIR via a relative path. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
522 |
RTOP=$(relative_dir $TPATH $WDIR) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
523 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
524 |
# Make the rhs/lhs files and output the frameset file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
525 |
print "$HTML<head>$STDHEAD" > $WDIR/$DIR/$TNAME.lhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
526 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
527 |
cat >> $WDIR/$DIR/$TNAME.lhs.html <<-EOF |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
528 |
<script type="text/javascript" src="$RTOP/ancnav.js"></script> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
529 |
</head> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
530 |
<body id="SUNWwebrev" onkeypress="keypress(event);"> |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
531 |
<a name="0"></a> |
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
532 |
<pre>$comments</pre><hr></hr> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
533 |
EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
534 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
535 |
cp $WDIR/$DIR/$TNAME.lhs.html $WDIR/$DIR/$TNAME.rhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
536 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
537 |
insert_anchors $lhsfile >> $WDIR/$DIR/$TNAME.lhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
538 |
insert_anchors $rhsfile >> $WDIR/$DIR/$TNAME.rhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
539 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
540 |
close='</body></html>' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
541 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
542 |
print $close >> $WDIR/$DIR/$TNAME.lhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
543 |
print $close >> $WDIR/$DIR/$TNAME.rhs.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
544 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
545 |
print "$FRAMEHTML<head>$STDHEAD" > $WDIR/$DIR/$TNAME.frames.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
546 |
print "<title>$WNAME Framed-Sdiff " \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
547 |
"$TPATH/$TNAME</title> </head>" >> $WDIR/$DIR/$TNAME.frames.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
548 |
cat >> $WDIR/$DIR/$TNAME.frames.html <<-EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
549 |
<frameset rows="*,60"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
550 |
<frameset cols="50%,50%"> |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
551 |
<frame src="$TNAME.lhs.html" scrolling="auto" name="lhs"></frame> |
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
552 |
<frame src="$TNAME.rhs.html" scrolling="auto" name="rhs"></frame> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
553 |
</frameset> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
554 |
<frame src="$RTOP/ancnav.html" scrolling="no" marginwidth="0" |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
555 |
marginheight="0" name="nav"></frame> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
556 |
<noframes> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
557 |
<body id="SUNWwebrev"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
558 |
Alas 'frames' webrev requires that your browser supports frames |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
559 |
and has the feature enabled. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
560 |
</body> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
561 |
</noframes> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
562 |
</frameset> |
0 | 563 |
</html> |
564 |
EOF |
|
565 |
} |
|
566 |
||
567 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
568 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
569 |
# fix_postscript |
0 | 570 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
571 |
# Merge codereview output files to a single conforming postscript file, by: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
572 |
# - removing all extraneous headers/trailers |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
573 |
# - making the page numbers right |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
574 |
# - removing pages devoid of contents which confuse some |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
575 |
# postscript readers. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
576 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
577 |
# From Casper. |
0 | 578 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
579 |
function fix_postscript |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
580 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
581 |
infile=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
582 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
583 |
cat > /tmp/$$.crmerge.pl << \EOF |
0 | 584 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
585 |
print scalar(<>); # %!PS-Adobe--- |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
586 |
print "%%Orientation: Landscape\n"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
587 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
588 |
$pno = 0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
589 |
$doprint = 1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
590 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
591 |
$page = ""; |
0 | 592 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
593 |
while (<>) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
594 |
next if (/^%%Pages:\s*\d+/); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
595 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
596 |
if (/^%%Page:/) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
597 |
if ($pno == 0 || $page =~ /\)S/) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
598 |
# Header or single page containing text |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
599 |
print "%%Page: ? $pno\n" if ($pno > 0); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
600 |
print $page; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
601 |
$pno++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
602 |
} else { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
603 |
# Empty page, skip it. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
604 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
605 |
$page = ""; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
606 |
$doprint = 1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
607 |
next; |
0 | 608 |
} |
609 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
610 |
# Skip from %%Trailer of one document to Endprolog |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
611 |
# %%Page of the next |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
612 |
$doprint = 0 if (/^%%Trailer/); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
613 |
$page .= $_ if ($doprint); |
0 | 614 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
615 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
616 |
if ($page =~ /\)S/) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
617 |
print "%%Page: ? $pno\n"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
618 |
print $page; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
619 |
} else { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
620 |
$pno--; |
0 | 621 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
622 |
print "%%Trailer\n%%Pages: $pno\n"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
623 |
EOF |
0 | 624 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
625 |
$PERL /tmp/$$.crmerge.pl < $infile |
0 | 626 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
627 |
|
0 | 628 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
629 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
630 |
# input_cmd | insert_anchors | output_cmd |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
631 |
# |
0 | 632 |
# Flag blocks of difference with sequentially numbered invisible |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
633 |
# anchors. These are used to drive the frames version of the |
0 | 634 |
# sdiffs output. |
635 |
# |
|
636 |
# NOTE: Anchor zero flags the top of the file irrespective of changes, |
|
637 |
# an additional anchor is also appended to flag the bottom. |
|
638 |
# |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
639 |
# The script detects changed lines as any line that has a "<span |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
640 |
# class=" string embedded (unchanged lines have no class set and are |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
641 |
# not part of a <span>. Blank lines (without a sequence number) |
0 | 642 |
# are also detected since they flag lines that have been inserted or |
643 |
# deleted. |
|
644 |
# |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
645 |
function insert_anchors |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
646 |
{ |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
647 |
$AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
648 |
function ia() { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
649 |
printf "<a name=\"%d\" id=\"anc%d\"></a>", anc, anc++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
650 |
} |
0 | 651 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
652 |
BEGIN { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
653 |
anc=1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
654 |
inblock=1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
655 |
printf "<pre>\n"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
656 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
657 |
NF == 0 || /^<span class=/ { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
658 |
if (inblock == 0) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
659 |
ia(); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
660 |
inblock=1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
661 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
662 |
print; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
663 |
next; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
664 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
665 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
666 |
inblock=0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
667 |
print; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
668 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
669 |
END { |
0 | 670 |
ia(); |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
671 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
672 |
printf "<b style=\"font-size: large; color: red\">"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
673 |
printf "--- EOF ---</b>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
674 |
for(i=0;i<8;i++) printf "\n\n\n\n\n\n\n\n\n\n"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
675 |
printf "</pre>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
676 |
printf "<form name=\"eof\">"; |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
677 |
printf "<input name=\"value\" value=\"%d\" " \ |
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
678 |
"type=\"hidden\"></input>", anc - 1; |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
679 |
printf "</form>"; |
0 | 680 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
681 |
' $1 |
0 | 682 |
} |
683 |
||
684 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
685 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
686 |
# relative_dir |
0 | 687 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
688 |
# Print a relative return path from $1 to $2. For example if |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
689 |
# $1=/tmp/myreview/raw_files/usr/src/tools/scripts and $2=/tmp/myreview, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
690 |
# this function would print "../../../../". |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
691 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
692 |
# In the event that $1 is not in $2 a warning is printed to stderr, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
693 |
# and $2 is returned-- the result of this is that the resulting webrev |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
694 |
# is not relocatable. |
0 | 695 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
696 |
function relative_dir |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
697 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
698 |
typeset cur="${1##$2?(/)}" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
699 |
typeset ret="" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
700 |
if [[ $2 == $cur ]]; then # Should never happen. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
701 |
# Should never happen. |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
702 |
print -u2 "\nWARNING: relative_dir: \"$1\" not relative " |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
703 |
print -u2 "to \"$2\". Check input paths. Framed webrev " |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
704 |
print -u2 "will not be relocatable!" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
705 |
print $2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
706 |
return |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
707 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
708 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
709 |
while [[ -n ${cur} ]]; |
0 | 710 |
do |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
711 |
cur=${cur%%*(/)*([!/])} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
712 |
if [[ -z $ret ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
713 |
ret=".." |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
714 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
715 |
ret="../$ret" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
716 |
fi |
0 | 717 |
done |
718 |
print $ret |
|
719 |
} |
|
720 |
||
721 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
722 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
723 |
# frame_nav_js |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
724 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
725 |
# Emit javascript for frame navigation |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
726 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
727 |
function frame_nav_js |
0 | 728 |
{ |
729 |
cat << \EOF |
|
730 |
var myInt; |
|
731 |
var scrolling=0; |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
732 |
var sfactor = 3; |
0 | 733 |
var scount=10; |
734 |
||
735 |
function scrollByPix() { |
|
736 |
if (scount<=0) { |
|
737 |
sfactor*=1.2; |
|
738 |
scount=10; |
|
739 |
} |
|
740 |
parent.lhs.scrollBy(0,sfactor); |
|
741 |
parent.rhs.scrollBy(0,sfactor); |
|
742 |
scount--; |
|
743 |
} |
|
744 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
745 |
function scrollToAnc(num) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
746 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
747 |
// Update the value of the anchor in the form which we use as |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
748 |
// storage for this value. setAncValue() will take care of |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
749 |
// correcting for overflow and underflow of the value and return |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
750 |
// us the new value. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
751 |
num = setAncValue(num); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
752 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
753 |
// Set location and scroll back a little to expose previous |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
754 |
// lines. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
755 |
// |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
756 |
// Note that this could be improved: it is possible although |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
757 |
// complex to compute the x and y position of an anchor, and to |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
758 |
// scroll to that location directly. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
759 |
// |
0 | 760 |
parent.lhs.location.replace(parent.lhs.location.pathname + "#" + num); |
761 |
parent.rhs.location.replace(parent.rhs.location.pathname + "#" + num); |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
762 |
|
0 | 763 |
parent.lhs.scrollBy(0,-30); |
764 |
parent.rhs.scrollBy(0,-30); |
|
765 |
} |
|
766 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
767 |
function getAncValue() |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
768 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
769 |
return (parseInt(parent.nav.document.diff.real.value)); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
770 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
771 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
772 |
function setAncValue(val) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
773 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
774 |
if (val <= 0) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
775 |
val = 0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
776 |
parent.nav.document.diff.real.value = val; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
777 |
parent.nav.document.diff.display.value = "BOF"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
778 |
return (val); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
779 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
780 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
781 |
// |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
782 |
// The way we compute the max anchor value is to stash it |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
783 |
// inline in the left and right hand side pages-- it's the same |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
784 |
// on each side, so we pluck from the left. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
785 |
// |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
786 |
maxval = parent.lhs.document.eof.value.value; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
787 |
if (val < maxval) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
788 |
parent.nav.document.diff.real.value = val; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
789 |
parent.nav.document.diff.display.value = val.toString(); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
790 |
return (val); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
791 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
792 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
793 |
// this must be: val >= maxval |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
794 |
val = maxval; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
795 |
parent.nav.document.diff.real.value = val; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
796 |
parent.nav.document.diff.display.value = "EOF"; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
797 |
return (val); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
798 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
799 |
|
0 | 800 |
function stopScroll() { |
801 |
if (scrolling==1) { |
|
802 |
clearInterval(myInt); |
|
803 |
scrolling=0; |
|
804 |
} |
|
805 |
} |
|
806 |
||
807 |
function startScroll() { |
|
808 |
stopScroll(); |
|
809 |
scrolling=1; |
|
810 |
myInt=setInterval("scrollByPix()",10); |
|
811 |
} |
|
812 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
813 |
function handlePress(b) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
814 |
|
0 | 815 |
switch (b) { |
816 |
case 1 : |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
817 |
scrollToAnc(-1); |
0 | 818 |
break; |
819 |
case 2 : |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
820 |
scrollToAnc(getAncValue() - 1); |
0 | 821 |
break; |
822 |
case 3 : |
|
823 |
sfactor=-3; |
|
824 |
startScroll(); |
|
825 |
break; |
|
826 |
case 4 : |
|
827 |
sfactor=3; |
|
828 |
startScroll(); |
|
829 |
break; |
|
830 |
case 5 : |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
831 |
scrollToAnc(getAncValue() + 1); |
0 | 832 |
break; |
833 |
case 6 : |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
834 |
scrollToAnc(999999); |
0 | 835 |
break; |
836 |
} |
|
837 |
} |
|
838 |
||
839 |
function handleRelease(b) { |
|
840 |
stopScroll(); |
|
841 |
} |
|
842 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
843 |
function keypress(ev) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
844 |
var keynum; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
845 |
var keychar; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
846 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
847 |
if (window.event) { // IE |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
848 |
keynum = ev.keyCode; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
849 |
} else if (ev.which) { // non-IE |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
850 |
keynum = ev.which; |
0 | 851 |
} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
852 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
853 |
keychar = String.fromCharCode(keynum); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
854 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
855 |
if (keychar == "k") { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
856 |
handlePress(2); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
857 |
return (0); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
858 |
} else if (keychar == "j" || keychar == " ") { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
859 |
handlePress(5); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
860 |
return (0); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
861 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
862 |
return (1); |
0 | 863 |
} |
864 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
865 |
function ValidateDiffNum(){ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
866 |
val = parent.nav.document.diff.display.value; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
867 |
if (val == "EOF") { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
868 |
scrollToAnc(999999); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
869 |
return; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
870 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
871 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
872 |
if (val == "BOF") { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
873 |
scrollToAnc(0); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
874 |
return; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
875 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
876 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
877 |
i=parseInt(val); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
878 |
if (isNaN(i)) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
879 |
parent.nav.document.diff.display.value = getAncValue(); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
880 |
} else { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
881 |
scrollToAnc(i); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
882 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
883 |
return false; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
884 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
885 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
886 |
EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
887 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
888 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
889 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
890 |
# frame_navigation |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
891 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
892 |
# Output anchor navigation file for framed sdiffs. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
893 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
894 |
function frame_navigation |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
895 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
896 |
print "$HTML<head>$STDHEAD" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
897 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
898 |
cat << \EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
899 |
<title>Anchor Navigation</title> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
900 |
<meta http-equiv="Content-Script-Type" content="text/javascript"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
901 |
<meta http-equiv="Content-Type" content="text/html"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
902 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
903 |
<style type="text/css"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
904 |
div.button td { padding-left: 5px; padding-right: 5px; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
905 |
background-color: #eee; text-align: center; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
906 |
border: 1px #444 outset; cursor: pointer; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
907 |
div.button a { font-weight: bold; color: black } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
908 |
div.button td:hover { background: #ffcc99; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
909 |
</style> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
910 |
EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
911 |
|
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
912 |
print "<script type=\"text/javascript\" src=\"ancnav.js\"></script>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
913 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
914 |
cat << \EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
915 |
</head> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
916 |
<body id="SUNWwebrev" bgcolor="#eeeeee" onload="document.diff.real.focus();" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
917 |
onkeypress="keypress(event);"> |
0 | 918 |
<noscript lang="javascript"> |
919 |
<center> |
|
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
920 |
<p><big>Framed Navigation controls require Javascript</big><br></br> |
0 | 921 |
Either this browser is incompatable or javascript is not enabled</p> |
922 |
</center> |
|
923 |
</noscript> |
|
924 |
<table width="100%" border="0" align="center"> |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
925 |
<tr> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
926 |
<td valign="middle" width="25%">Diff navigation: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
927 |
Use 'j' and 'k' for next and previous diffs; or use buttons |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
928 |
at right</td> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
929 |
<td align="center" valign="top" width="50%"> |
0 | 930 |
<div class="button"> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
931 |
<table border="0" align="center"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
932 |
<tr> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
933 |
<td> |
0 | 934 |
<a onMouseDown="handlePress(1);return true;" |
935 |
onMouseUp="handleRelease(1);return true;" |
|
936 |
onMouseOut="handleRelease(1);return true;" |
|
937 |
onClick="return false;" |
|
938 |
title="Go to Beginning Of file">BOF</a></td> |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
939 |
<td> |
0 | 940 |
<a onMouseDown="handlePress(3);return true;" |
941 |
onMouseUp="handleRelease(3);return true;" |
|
942 |
onMouseOut="handleRelease(3);return true;" |
|
943 |
title="Scroll Up: Press and Hold to accelerate" |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
944 |
onClick="return false;">Scroll Up</a></td> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
945 |
<td> |
0 | 946 |
<a onMouseDown="handlePress(2);return true;" |
947 |
onMouseUp="handleRelease(2);return true;" |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
948 |
onMouseOut="handleRelease(2);return true;" |
0 | 949 |
title="Go to previous Diff" |
950 |
onClick="return false;">Prev Diff</a> |
|
951 |
</td></tr> |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
952 |
|
0 | 953 |
<tr> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
954 |
<td> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
955 |
<a onMouseDown="handlePress(6);return true;" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
956 |
onMouseUp="handleRelease(6);return true;" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
957 |
onMouseOut="handleRelease(6);return true;" |
0 | 958 |
onClick="return false;" |
959 |
title="Go to End Of File">EOF</a></td> |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
960 |
<td> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
961 |
<a onMouseDown="handlePress(4);return true;" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
962 |
onMouseUp="handleRelease(4);return true;" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
963 |
onMouseOut="handleRelease(4);return true;" |
0 | 964 |
title="Scroll Down: Press and Hold to accelerate" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
965 |
onClick="return false;">Scroll Down</a></td> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
966 |
<td> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
967 |
<a onMouseDown="handlePress(5);return true;" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
968 |
onMouseUp="handleRelease(5);return true;" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
969 |
onMouseOut="handleRelease(5);return true;" |
0 | 970 |
title="Go to next Diff" |
971 |
onClick="return false;">Next Diff</a></td> |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
972 |
</tr> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
973 |
</table> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
974 |
</div> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
975 |
</td> |
0 | 976 |
<th valign="middle" width="25%"> |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
977 |
<form action="" name="diff" onsubmit="return ValidateDiffNum();"> |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
978 |
<input name="display" value="BOF" size="8" type="text"></input> |
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
979 |
<input name="real" value="0" size="8" type="hidden"></input> |
0 | 980 |
</form> |
981 |
</th> |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
982 |
</tr> |
0 | 983 |
</table> |
984 |
</body> |
|
985 |
</html> |
|
986 |
EOF |
|
987 |
} |
|
988 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
989 |
|
0 | 990 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
991 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
992 |
# diff_to_html <filename> <filepath> { U | C } <comment> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
993 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
994 |
# Processes the output of diff to produce an HTML file representing either |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
995 |
# context or unified diffs. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
996 |
# |
0 | 997 |
diff_to_html() |
998 |
{ |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
999 |
TNAME=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1000 |
TPATH=$2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1001 |
DIFFTYPE=$3 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1002 |
COMMENT=$4 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1003 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1004 |
print "$HTML<head>$STDHEAD" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1005 |
print "<title>$WNAME ${DIFFTYPE}diff $TPATH</title>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1006 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1007 |
if [[ $DIFFTYPE == "U" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1008 |
print "$UDIFFCSS" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1009 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1010 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1011 |
cat <<-EOF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1012 |
</head> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1013 |
<body id="SUNWwebrev"> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1014 |
<a class="print" href="javascript:print()">Print this page</a> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1015 |
<pre>$COMMENT</pre> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1016 |
<pre> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1017 |
EOF |
0 | 1018 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1019 |
html_quote | $AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1020 |
/^--- new/ { next } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1021 |
/^\+\+\+ new/ { next } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1022 |
/^--- old/ { next } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1023 |
/^\*\*\* old/ { next } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1024 |
/^\*\*\*\*/ { next } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1025 |
/^-------/ { printf "<center><h1>%s</h1></center>\n", $0; next } |
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
1026 |
/^\@\@.*\@\@$/ { printf "</pre><hr></hr><pre>\n"; |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1027 |
printf "<span class=\"newmarker\">%s</span>\n", $0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1028 |
next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1029 |
|
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
1030 |
/^\*\*\*/ { printf "<hr></hr><span class=\"oldmarker\">%s</span>\n", $0; |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1031 |
next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1032 |
/^---/ { printf "<span class=\"newmarker\">%s</span>\n", $0; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1033 |
next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1034 |
/^\+/ {printf "<span class=\"new\">%s</span>\n", $0; next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1035 |
/^!/ {printf "<span class=\"changed\">%s</span>\n", $0; next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1036 |
/^-/ {printf "<span class=\"removed\">%s</span>\n", $0; next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1037 |
{printf "%s\n", $0; next} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1038 |
' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1039 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1040 |
print "</pre></body></html>\n" |
0 | 1041 |
} |
1042 |
||
1043 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1044 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1045 |
# source_to_html { new | old } <filename> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1046 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1047 |
# Process a plain vanilla source file to transform it into an HTML file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1048 |
# |
0 | 1049 |
source_to_html() |
1050 |
{ |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1051 |
WHICH=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1052 |
TNAME=$2 |
0 | 1053 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1054 |
print "$HTML<head>$STDHEAD" |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1055 |
print "<title>$WNAME $WHICH $TNAME</title>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1056 |
print "<body id=\"SUNWwebrev\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1057 |
print "<pre>" |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1058 |
html_quote | $AWK '{line += 1 ; printf "%4d %s\n", line, $0 }' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1059 |
print "</pre></body></html>" |
0 | 1060 |
} |
1061 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1062 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1063 |
# comments_from_teamware {text|html} parent-file child-file |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1064 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1065 |
# Find the first delta in the child that's not in the parent. Get the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1066 |
# newest delta from the parent, get all deltas from the child starting |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1067 |
# with that delta, and then get all info starting with the second oldest |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1068 |
# delta in that list (the first delta unique to the child). |
0 | 1069 |
# |
1070 |
# This code adapted from Bill Shannon's "spc" script |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1071 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1072 |
comments_from_teamware() |
0 | 1073 |
{ |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1074 |
fmt=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1075 |
pfile=$PWS/$2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1076 |
cfile=$CWS/$3 |
0 | 1077 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1078 |
if [[ ! -f $PWS/${2%/*}/SCCS/s.${2##*/} && -n $RWS ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1079 |
pfile=$RWS/$2 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1080 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1081 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1082 |
if [[ -f $pfile ]]; then |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1083 |
psid=$($SCCS prs -d:I: $pfile 2>/dev/null) |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1084 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1085 |
psid=1.1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1086 |
fi |
0 | 1087 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1088 |
set -A sids $($SCCS prs -l -r$psid -d:I: $cfile 2>/dev/null) |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1089 |
N=${#sids[@]} |
0 | 1090 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1091 |
nawkprg=' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1092 |
/^COMMENTS:/ {p=1; continue} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1093 |
/^D [0-9]+\.[0-9]+/ {printf "--- %s ---\n", $2; p=0; } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1094 |
NF == 0u { continue } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1095 |
{if (p==0) continue; print $0 }' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1096 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1097 |
if [[ $N -ge 2 ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1098 |
sid1=${sids[$((N-2))]} # Gets 2nd to last sid |
0 | 1099 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1100 |
if [[ $fmt == "text" ]]; then |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1101 |
$SCCS prs -l -r$sid1 $cfile 2>/dev/null | \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1102 |
$AWK "$nawkprg" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1103 |
return |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1104 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1105 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1106 |
$SCCS prs -l -r$sid1 $cfile 2>/dev/null | \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1107 |
html_quote | bug2url | sac2url | $AWK "$nawkprg" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1108 |
fi |
0 | 1109 |
} |
1110 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1111 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1112 |
# comments_from_wx {text|html} filepath |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1113 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1114 |
# Given the pathname of a file, find its location in a "wx" active |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1115 |
# file list and print the following comment. Output is either text or |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1116 |
# HTML; if the latter, embedded bugids (sequence of 5 or more digits) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1117 |
# are turned into URLs. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1118 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1119 |
# This is also used with Mercurial and the file list provided by hg-active. |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1120 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1121 |
comments_from_wx() |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1122 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1123 |
typeset fmt=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1124 |
typeset p=$2 |
0 | 1125 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1126 |
comm=`$AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1127 |
$1 == "'$p'" { |
0 | 1128 |
do getline ; while (NF > 0) |
1129 |
getline |
|
1130 |
while (NF > 0) { print ; getline } |
|
1131 |
exit |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1132 |
}' < $wxfile` |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1133 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1134 |
if [[ -z $comm ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1135 |
comm="*** NO COMMENTS ***" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1136 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1137 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1138 |
if [[ $fmt == "text" ]]; then |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1139 |
print -- "$comm" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1140 |
return |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1141 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1142 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1143 |
print -- "$comm" | html_quote | bug2url | sac2url |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1144 |
|
0 | 1145 |
} |
1146 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1147 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1148 |
# getcomments {text|html} filepath parentpath |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1149 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1150 |
# Fetch the comments depending on what SCM mode we're in. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1151 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1152 |
getcomments() |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1153 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1154 |
typeset fmt=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1155 |
typeset p=$2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1156 |
typeset pp=$3 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1157 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1158 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1159 |
# Mercurial support uses a file list in wx format, so this |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1160 |
# will be used there, too |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1161 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1162 |
if [[ -n $wxfile ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1163 |
comments_from_wx $fmt $p |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1164 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1165 |
if [[ $SCM_MODE == "teamware" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1166 |
comments_from_teamware $fmt $pp $p |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1167 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1168 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1169 |
} |
0 | 1170 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1171 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1172 |
# printCI <total-changed> <inserted> <deleted> <modified> <unchanged> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1173 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1174 |
# Print out Code Inspection figures similar to sccs-prt(1) format. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1175 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1176 |
function printCI |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1177 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1178 |
integer tot=$1 ins=$2 del=$3 mod=$4 unc=$5 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1179 |
typeset str |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1180 |
if (( tot == 1 )); then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1181 |
str="line" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1182 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1183 |
str="lines" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1184 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1185 |
printf '%d %s changed: %d ins; %d del; %d mod; %d unchg\n' \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1186 |
$tot $str $ins $del $mod $unc |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1187 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1188 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1189 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1190 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1191 |
# difflines <oldfile> <newfile> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1192 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1193 |
# Calculate and emit number of added, removed, modified and unchanged lines, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1194 |
# and total lines changed, the sum of added + removed + modified. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1195 |
# |
0 | 1196 |
function difflines |
1197 |
{ |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1198 |
integer tot mod del ins unc err |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1199 |
typeset filename |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1200 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1201 |
eval $( diff -e $1 $2 | $AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1202 |
# Change range of lines: N,Nc |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1203 |
/^[0-9]*,[0-9]*c$/ { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1204 |
n=split(substr($1,1,length($1)-1), counts, ","); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1205 |
if (n != 2) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1206 |
error=2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1207 |
exit; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1208 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1209 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1210 |
# 3,5c means lines 3 , 4 and 5 are changed, a total of 3 lines. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1211 |
# following would be 5 - 3 = 2! Hence +1 for correction. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1212 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1213 |
r=(counts[2]-counts[1])+1; |
0 | 1214 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1215 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1216 |
# Now count replacement lines: each represents a change instead |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1217 |
# of a delete, so increment c and decrement r. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1218 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1219 |
while (getline != /^\.$/) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1220 |
c++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1221 |
r--; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1222 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1223 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1224 |
# If there were more replacement lines than original lines, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1225 |
# then r will be negative; in this case there are no deletions, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1226 |
# but there are r changes that should be counted as adds, and |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1227 |
# since r is negative, subtract it from a and add it to c. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1228 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1229 |
if (r < 0) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1230 |
a-=r; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1231 |
c+=r; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1232 |
} |
0 | 1233 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1234 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1235 |
# If there were more original lines than replacement lines, then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1236 |
# r will be positive; in this case, increment d by that much. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1237 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1238 |
if (r > 0) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1239 |
d+=r; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1240 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1241 |
next; |
0 | 1242 |
} |
1243 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1244 |
# Change lines: Nc |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1245 |
/^[0-9].*c$/ { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1246 |
# The first line is a replacement; any more are additions. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1247 |
if (getline != /^\.$/) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1248 |
c++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1249 |
while (getline != /^\.$/) a++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1250 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1251 |
next; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1252 |
} |
0 | 1253 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1254 |
# Add lines: both Na and N,Na |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1255 |
/^[0-9].*a$/ { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1256 |
while (getline != /^\.$/) a++; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1257 |
next; |
0 | 1258 |
} |
1259 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1260 |
# Delete range of lines: N,Nd |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1261 |
/^[0-9]*,[0-9]*d$/ { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1262 |
n=split(substr($1,1,length($1)-1), counts, ","); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1263 |
if (n != 2) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1264 |
error=2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1265 |
exit; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1266 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1267 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1268 |
# 3,5d means lines 3 , 4 and 5 are deleted, a total of 3 lines. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1269 |
# following would be 5 - 3 = 2! Hence +1 for correction. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1270 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1271 |
r=(counts[2]-counts[1])+1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1272 |
d+=r; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1273 |
next; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1274 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1275 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1276 |
# Delete line: Nd. For example 10d says line 10 is deleted. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1277 |
/^[0-9]*d$/ {d++; next} |
0 | 1278 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1279 |
# Should not get here! |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1280 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1281 |
error=1; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1282 |
exit; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1283 |
} |
0 | 1284 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1285 |
# Finish off - print results |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1286 |
END { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1287 |
printf("tot=%d;mod=%d;del=%d;ins=%d;err=%d\n", |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1288 |
(c+d+a), c, d, a, error); |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1289 |
}' ) |
0 | 1290 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1291 |
# End of $AWK, Check to see if any trouble occurred. |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1292 |
if (( $? > 0 || err > 0 )); then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1293 |
print "Unexpected Error occurred reading" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1294 |
"\`diff -e $1 $2\`: \$?=$?, err=" $err |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1295 |
return |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1296 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1297 |
|
0 | 1298 |
# Accumulate totals |
1299 |
(( TOTL += tot )) |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1300 |
(( TMOD += mod )) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1301 |
(( TDEL += del )) |
0 | 1302 |
(( TINS += ins )) |
1303 |
# Calculate unchanged lines |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1304 |
unc=`wc -l < $1` |
0 | 1305 |
if (( unc > 0 )); then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1306 |
(( unc -= del + mod )) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1307 |
(( TUNC += unc )) |
0 | 1308 |
fi |
1309 |
# print summary |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1310 |
print "<span class=\"lineschanged\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1311 |
printCI $tot $ins $del $mod $unc |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1312 |
print "</span>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1313 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1314 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1315 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1316 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1317 |
# flist_from_wx |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1318 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1319 |
# Sets up webrev to source its information from a wx-formatted file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1320 |
# Sets the global 'wxfile' variable. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1321 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1322 |
function flist_from_wx |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1323 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1324 |
typeset argfile=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1325 |
if [[ -n ${argfile%%/*} ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1326 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1327 |
# If the wx file pathname is relative then make it absolute |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1328 |
# because the webrev does a "cd" later on. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1329 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1330 |
wxfile=$PWD/$argfile |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1331 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1332 |
wxfile=$argfile |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1333 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1334 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1335 |
$AWK '{ c = 1; print; |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1336 |
while (getline) { |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1337 |
if (NF == 0) { c = -c; continue } |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1338 |
if (c > 0) print |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1339 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1340 |
}' $wxfile > $FLIST |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1341 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1342 |
print " Done." |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1343 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1344 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1345 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1346 |
# flist_from_teamware [ <args-to-putback-n> ] |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1347 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1348 |
# Generate the file list by extracting file names from a putback -n. Some |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1349 |
# names may come from the "update/create" messages and others from the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1350 |
# "currently checked out" warning. Renames are detected here too. Extract |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1351 |
# values for CODEMGR_WS and CODEMGR_PARENT from the output of the putback |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1352 |
# -n as well, but remove them if they are already defined. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1353 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1354 |
function flist_from_teamware |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1355 |
{ |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1356 |
if [[ -n $codemgr_parent && -z $parent_webrev ]]; then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1357 |
if [[ ! -d $codemgr_parent/Codemgr_wsdata ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1358 |
print -u2 "parent $codemgr_parent doesn't look like a" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1359 |
"valid teamware workspace" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1360 |
exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1361 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1362 |
parent_args="-p $codemgr_parent" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1363 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1364 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1365 |
print " File list from: 'putback -n $parent_args $*' ... \c" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1366 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1367 |
putback -n $parent_args $* 2>&1 | |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1368 |
$AWK ' |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1369 |
/^update:|^create:/ {print $2} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1370 |
/^Parent workspace:/ {printf("CODEMGR_PARENT=%s\n",$3)} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1371 |
/^Child workspace:/ {printf("CODEMGR_WS=%s\n",$3)} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1372 |
/^The following files are currently checked out/ {p = 1; continue} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1373 |
NF == 0 {p=0 ; continue} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1374 |
/^rename/ {old=$3} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1375 |
$1 == "to:" {print $2, old} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1376 |
/^"/ {continue} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1377 |
p == 1 {print $1}' | |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1378 |
sort -r -k 1,1 -u | sort > $FLIST |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1379 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1380 |
print " Done." |
0 | 1381 |
} |
1382 |
||
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1383 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1384 |
# Call hg-active to get the active list output in the wx active list format |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1385 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1386 |
function hg_active_wxfile |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1387 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1388 |
typeset child=$1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1389 |
typeset parent=$2 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1390 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1391 |
TMPFLIST=/tmp/$$.active |
7298
b69e27387f74
6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents:
7078
diff
changeset
|
1392 |
$HG_ACTIVE -w $child -p $parent -o $TMPFLIST |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1393 |
wxfile=$TMPFLIST |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1394 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1395 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1396 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1397 |
# flist_from_mercurial |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1398 |
# Call hg-active to get a wx-style active list, and hand it off to |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1399 |
# flist_from_wx |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1400 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1401 |
function flist_from_mercurial |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1402 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1403 |
typeset child=$1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1404 |
typeset parent=$2 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1405 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1406 |
print " File list from: hg-active -p $parent ...\c" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1407 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1408 |
if [[ ! -x $HG_ACTIVE ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1409 |
print # Blank line for the \c above |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1410 |
print -u2 "Error: hg-active tool not found. Exiting" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1411 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1412 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1413 |
hg_active_wxfile $child $parent |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1414 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1415 |
# flist_from_wx prints the Done, so we don't have to. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1416 |
flist_from_wx $TMPFLIST |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1417 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1418 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1419 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1420 |
# flist_from_subversion |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1421 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1422 |
# Generate the file list by extracting file names from svn status. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1423 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1424 |
function flist_from_subversion |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1425 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1426 |
CWS=$1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1427 |
OLDPWD=$2 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1428 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1429 |
cd $CWS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1430 |
print -u2 " File list from: svn status ... \c" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1431 |
svn status | $AWK '/^[ACDMR]/ { print $NF }' > $FLIST |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1432 |
print -u2 " Done." |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1433 |
cd $OLDPWD |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1434 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1435 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1436 |
function env_from_flist |
0 | 1437 |
{ |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1438 |
[[ -r $FLIST ]] || return |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1439 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1440 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1441 |
# Use "eval" to set env variables that are listed in the file |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1442 |
# list. Then copy those into our local versions of those |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1443 |
# variables if they have not been set already. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1444 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1445 |
eval `sed -e "s/#.*$//" $FLIST | grep = ` |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1446 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1447 |
if [[ -z $codemgr_ws && -n $CODEMGR_WS ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1448 |
codemgr_ws=$CODEMGR_WS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1449 |
export CODEMGR_WS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1450 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1451 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1452 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1453 |
# Check to see if CODEMGR_PARENT is set in the flist file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1454 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1455 |
if [[ -z $codemgr_parent && -n $CODEMGR_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1456 |
codemgr_parent=$CODEMGR_PARENT |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1457 |
export CODEMGR_PARENT |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1458 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1459 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1460 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1461 |
function look_for_prog |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1462 |
{ |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1463 |
typeset path |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1464 |
typeset ppath |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1465 |
typeset progname=$1 |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1466 |
|
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1467 |
ppath=$PATH |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1468 |
ppath=$ppath:/usr/sfw/bin:/usr/bin:/usr/sbin |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1469 |
ppath=$ppath:/opt/teamware/bin:/opt/onbld/bin |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1470 |
ppath=$ppath:/opt/onbld/bin/`uname -p` |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1471 |
|
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1472 |
PATH=$ppath prog=`whence $progname` |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1473 |
if [[ -n $prog ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1474 |
print $prog |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1475 |
fi |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1476 |
} |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1477 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1478 |
function get_file_mode |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1479 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1480 |
$PERL -e ' |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1481 |
if (@stat = stat($ARGV[0])) { |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1482 |
$mode = $stat[2] & 0777; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1483 |
printf "%03o\n", $mode; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1484 |
exit 0; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1485 |
} else { |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1486 |
exit 1; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1487 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1488 |
' $1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1489 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1490 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1491 |
function build_old_new_teamware |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1492 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1493 |
typeset olddir="$1" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1494 |
typeset newdir="$2" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1495 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1496 |
# If the child's version doesn't exist then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1497 |
# get a readonly copy. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1498 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1499 |
if [[ ! -f $CWS/$DIR/$F && -f $CWS/$DIR/SCCS/s.$F ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1500 |
$SCCS get -s -p $CWS/$DIR/$F > $CWS/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1501 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1502 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1503 |
# The following two sections propagate file permissions the |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1504 |
# same way SCCS does. If the file is already under version |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1505 |
# control, always use permissions from the SCCS/s.file. If |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1506 |
# the file is not under SCCS control, use permissions from the |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1507 |
# working copy. In all cases, the file copied to the webrev |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1508 |
# is set to read only, and group/other permissions are set to |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1509 |
# match those of the file owner. This way, even if the file |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1510 |
# is currently checked out, the webrev will display the final |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1511 |
# permissions that would result after check in. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1512 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1513 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1514 |
# Snag new version of file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1515 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1516 |
rm -f $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1517 |
cp $CWS/$DIR/$F $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1518 |
if [[ -f $CWS/$DIR/SCCS/s.$F ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1519 |
chmod `get_file_mode $CWS/$DIR/SCCS/s.$F` \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1520 |
$newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1521 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1522 |
chmod u-w,go=u $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1523 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1524 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1525 |
# Get the parent's version of the file. First see whether the |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1526 |
# child's version is checked out and get the parent's version |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1527 |
# with keywords expanded or unexpanded as appropriate. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1528 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1529 |
if [[ -f $PWS/$PDIR/$PF && ! -f $PWS/$PDIR/SCCS/s.$PF && \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1530 |
! -f $PWS/$PDIR/SCCS/p.$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1531 |
# Parent is not a real workspace, but just a raw |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1532 |
# directory tree - use the file that's there as |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1533 |
# the old file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1534 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1535 |
rm -f $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1536 |
cp $PWS/$PDIR/$PF $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1537 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1538 |
if [[ -f $PWS/$PDIR/SCCS/s.$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1539 |
real_parent=$PWS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1540 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1541 |
real_parent=$RWS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1542 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1543 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1544 |
rm -f $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1545 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1546 |
if [[ -f $real_parent/$PDIR/$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1547 |
if [ -f $CWS/$DIR/SCCS/p.$F ]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1548 |
$SCCS get -s -p -k $real_parent/$PDIR/$PF > \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1549 |
$olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1550 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1551 |
$SCCS get -s -p $real_parent/$PDIR/$PF > \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1552 |
$olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1553 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1554 |
chmod `get_file_mode $real_parent/$PDIR/SCCS/s.$PF` \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1555 |
$olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1556 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1557 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1558 |
if [[ -f $olddir/$PDIR/$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1559 |
chmod u-w,go=u $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1560 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1561 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1562 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1563 |
function build_old_new_mercurial |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1564 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1565 |
typeset olddir="$1" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1566 |
typeset newdir="$2" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1567 |
typeset old_mode= |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1568 |
typeset new_mode= |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1569 |
typeset file |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1570 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1571 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1572 |
# Get old file mode, from the parent revision manifest entry. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1573 |
# Mercurial only stores a "file is executable" flag, but the |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1574 |
# manifest will display an octal mode "644" or "755". |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1575 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1576 |
if [[ "$PDIR" == "." ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1577 |
file="$PF" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1578 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1579 |
file="$PDIR/$PF" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1580 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1581 |
file=`echo $file | sed 's#/#\\\/#g'` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1582 |
# match the exact filename, and return only the permission digits |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1583 |
old_mode=`sed -n -e "/^\\(...\\) . ${file}$/s//\\1/p" \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1584 |
< $HG_PARENT_MANIFEST` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1585 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1586 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1587 |
# Get new file mode, directly from the filesystem. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1588 |
# Normalize the mode to match Mercurial's behavior. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1589 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1590 |
new_mode=`get_file_mode $CWS/$DIR/$F` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1591 |
if [[ -n "$new_mode" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1592 |
if [[ "$new_mode" = *[1357]* ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1593 |
new_mode=755 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1594 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1595 |
new_mode=644 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1596 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1597 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1598 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1599 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1600 |
# new version of the file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1601 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1602 |
rm -rf $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1603 |
if [[ -e $CWS/$DIR/$F ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1604 |
cp $CWS/$DIR/$F $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1605 |
if [[ -n $new_mode ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1606 |
chmod $new_mode $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1607 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1608 |
# should never happen |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1609 |
print -u2 "ERROR: set mode of $newdir/$DIR/$F" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1610 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1611 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1612 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1613 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1614 |
# parent's version of the file |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1615 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1616 |
# Note that we get this from the last version common to both |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1617 |
# ourselves and the parent. References are via $CWS since we have no |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1618 |
# guarantee that the parent workspace is reachable via the filesystem. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1619 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1620 |
if [[ -n $parent_webrev && -e $PWS/$PDIR/$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1621 |
cp $PWS/$PDIR/$PF $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1622 |
elif [[ -n $HG_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1623 |
hg cat -R $CWS -r $HG_PARENT $CWS/$PDIR/$PF > \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1624 |
$olddir/$PDIR/$PF 2>/dev/null |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1625 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1626 |
if [ $? -ne 0 ]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1627 |
rm -f $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1628 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1629 |
if [[ -n $old_mode ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1630 |
chmod $old_mode $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1631 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1632 |
# should never happen |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1633 |
print -u2 "ERROR: set mode of $olddir/$PDIR/$PF" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1634 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1635 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1636 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1637 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1638 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1639 |
function build_old_new_subversion |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1640 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1641 |
typeset olddir="$1" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1642 |
typeset newdir="$2" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1643 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1644 |
# Snag new version of file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1645 |
rm -f $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1646 |
[[ -e $CWS/$DIR/$F ]] && cp $CWS/$DIR/$F $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1647 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1648 |
if [[ -n $PWS && -e $PWS/$PDIR/$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1649 |
cp $PWS/$PDIR/$PF $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1650 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1651 |
# Get the parent's version of the file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1652 |
svn status $CWS/$DIR/$F | read stat file |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1653 |
if [[ $stat != "A" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1654 |
svn cat -r BASE $CWS/$DIR/$F > $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1655 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1656 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1657 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1658 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1659 |
function build_old_new_unknown |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1660 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1661 |
typeset olddir="$1" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1662 |
typeset newdir="$2" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1663 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1664 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1665 |
# Snag new version of file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1666 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1667 |
rm -f $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1668 |
[[ -e $CWS/$DIR/$F ]] && cp $CWS/$DIR/$F $newdir/$DIR/$F |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1669 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1670 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1671 |
# Snag the parent's version of the file. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1672 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1673 |
if [[ -f $PWS/$PDIR/$PF ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1674 |
rm -f $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1675 |
cp $PWS/$PDIR/$PF $olddir/$PDIR/$PF |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1676 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1677 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1678 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1679 |
function build_old_new |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1680 |
{ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1681 |
typeset WDIR=$1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1682 |
typeset PWS=$2 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1683 |
typeset PDIR=$3 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1684 |
typeset PF=$4 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1685 |
typeset CWS=$5 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1686 |
typeset DIR=$6 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1687 |
typeset F=$7 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1688 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1689 |
typeset olddir="$WDIR/raw_files/old" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1690 |
typeset newdir="$WDIR/raw_files/new" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1691 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1692 |
mkdir -p $olddir/$PDIR |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1693 |
mkdir -p $newdir/$DIR |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1694 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1695 |
if [[ $SCM_MODE == "teamware" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1696 |
build_old_new_teamware "$olddir" "$newdir" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1697 |
elif [[ $SCM_MODE == "mercurial" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1698 |
build_old_new_mercurial "$olddir" "$newdir" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1699 |
elif [[ $SCM_MODE == "subversion" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1700 |
build_old_new_subversion "$olddir" "$newdir" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1701 |
elif [[ $SCM_MODE == "unknown" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1702 |
build_old_new_unknown "$olddir" "$newdir" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1703 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1704 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1705 |
if [[ ! -f $olddir/$PDIR/$PF && ! -f $newdir/$DIR/$F ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1706 |
print "*** Error: file not in parent or child" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1707 |
return 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1708 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1709 |
return 0 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1710 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1711 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1712 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1713 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1714 |
# Usage message. |
0 | 1715 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1716 |
function usage |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1717 |
{ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1718 |
print 'Usage:\twebrev [common-options] |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1719 |
webrev [common-options] ( <file> | - ) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1720 |
webrev [common-options] -w <wx file> |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1721 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1722 |
Options: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1723 |
-O: Print bugids/arc cases suitable for OpenSolaris. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1724 |
-i <filename>: Include <filename> in the index.html file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1725 |
-o <outdir>: Output webrev to specified directory. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1726 |
-p <compare-against>: Use specified parent wkspc or basis for comparison |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1727 |
-w <wxfile>: Use specified wx active file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1728 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1729 |
Environment: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1730 |
WDIR: Control the output directory. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1731 |
WEBREV_BUGURL: Control the URL prefix for bugids. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1732 |
WEBREV_SACURL: Control the URL prefix for ARC cases. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1733 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1734 |
SCM Specific Options: |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1735 |
TeamWare: webrev [common-options] -l [arguments to 'putback'] |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1736 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1737 |
SCM Environment: |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1738 |
CODEMGR_WS: Workspace location. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1739 |
CODEMGR_PARENT: Parent workspace location. |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1740 |
' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1741 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1742 |
exit 2 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1743 |
} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1744 |
|
0 | 1745 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1746 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1747 |
# Main program starts here |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1748 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1749 |
# |
0 | 1750 |
|
1751 |
trap "rm -f /tmp/$$.* ; exit" 0 1 2 3 15 |
|
1752 |
||
1753 |
set +o noclobber |
|
1754 |
||
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1755 |
PATH=$(dirname $(whence $0)):$PATH |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1756 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1757 |
[[ -z $WDIFF ]] && WDIFF=`look_for_prog wdiff` |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1758 |
[[ -z $WX ]] && WX=`look_for_prog wx` |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1759 |
[[ -z $HG_ACTIVE ]] && HG_ACTIVE=`look_for_prog hg-active` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1760 |
[[ -z $WHICH_SCM ]] && WHICH_SCM=`look_for_prog which_scm` |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1761 |
[[ -z $CODEREVIEW ]] && CODEREVIEW=`look_for_prog codereview` |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1762 |
[[ -z $PS2PDF ]] && PS2PDF=`look_for_prog ps2pdf` |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1763 |
[[ -z $PERL ]] && PERL=`look_for_prog perl` |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1764 |
[[ -z $SCCS ]] && SCCS=`look_for_prog sccs` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1765 |
[[ -z $AWK ]] && AWK=`look_for_prog nawk` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1766 |
[[ -z $AWK ]] && AWK=`look_for_prog gawk` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1767 |
[[ -z $AWK ]] && AWK=`look_for_prog awk` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1768 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1769 |
|
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1770 |
if [[ ! -x $PERL ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1771 |
print -u2 "Error: No perl interpreter found. Exiting." |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1772 |
exit 1 |
0 | 1773 |
fi |
1774 |
||
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1775 |
if [[ ! -x $WHICH_SCM ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1776 |
print -u2 "Error: Could not find which_scm. Exiting." |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1777 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1778 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1779 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1780 |
# |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1781 |
# These aren't fatal, but we want to note them to the user. |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1782 |
# We don't warn on the absence of 'wx' until later when we've |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1783 |
# determined that we actually need to try to invoke it. |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1784 |
# |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1785 |
[[ ! -x $CODEREVIEW ]] && print -u2 "WARNING: codereview(1) not found." |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1786 |
[[ ! -x $PS2PDF ]] && print -u2 "WARNING: ps2pdf(1) not found." |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1787 |
[[ ! -x $WDIFF ]] && print -u2 "WARNING: wdiff not found." |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1788 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1789 |
# Declare global total counters. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1790 |
integer TOTL TINS TDEL TMOD TUNC |
0 | 1791 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1792 |
flist_mode= |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1793 |
flist_file= |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1794 |
iflag= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1795 |
oflag= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1796 |
pflag= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1797 |
lflag= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1798 |
wflag= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1799 |
Oflag= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1800 |
while getopts "i:o:p:lwO" opt |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1801 |
do |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1802 |
case $opt in |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1803 |
i) iflag=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1804 |
INCLUDE_FILE=$OPTARG;; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1805 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1806 |
o) oflag=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1807 |
WDIR=$OPTARG;; |
0 | 1808 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1809 |
p) pflag=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1810 |
codemgr_parent=$OPTARG;; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1811 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1812 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1813 |
# If -l has been specified, we need to abort further options |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1814 |
# processing, because subsequent arguments are going to be |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1815 |
# arguments to 'putback -n'. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1816 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1817 |
l) lflag=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1818 |
break;; |
0 | 1819 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1820 |
w) wflag=1;; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1821 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1822 |
O) Oflag=1;; |
0 | 1823 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1824 |
?) usage;; |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1825 |
esac |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1826 |
done |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1827 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1828 |
FLIST=/tmp/$$.flist |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1829 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1830 |
if [[ -n $wflag && -n $lflag ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1831 |
usage |
0 | 1832 |
fi |
1833 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1834 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1835 |
# If this manually set as the parent, and it appears to be an earlier webrev, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1836 |
# then note that fact and set the parent to the raw_files/new subdirectory. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1837 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1838 |
if [[ -n $pflag && -d $codemgr_parent/raw_files/new ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1839 |
parent_webrev="$codemgr_parent" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1840 |
codemgr_parent="$codemgr_parent/raw_files/new" |
0 | 1841 |
fi |
1842 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1843 |
if [[ -z $wflag && -z $lflag ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1844 |
shift $(($OPTIND - 1)) |
0 | 1845 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1846 |
if [[ $1 == "-" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1847 |
cat > $FLIST |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1848 |
flist_mode="stdin" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1849 |
flist_done=1 |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1850 |
shift |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1851 |
elif [[ -n $1 ]]; then |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1852 |
if [[ ! -r $1 ]]; then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1853 |
print -u2 "$1: no such file or not readable" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1854 |
usage |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1855 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1856 |
cat $1 > $FLIST |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1857 |
flist_mode="file" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1858 |
flist_file=$1 |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1859 |
flist_done=1 |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1860 |
shift |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1861 |
else |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1862 |
flist_mode="auto" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1863 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1864 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1865 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1866 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1867 |
# Before we go on to further consider -l and -w, work out which SCM we think |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1868 |
# is in use. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1869 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1870 |
$WHICH_SCM | read SCM_MODE junk || exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1871 |
case "$SCM_MODE" in |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1872 |
teamware|mercurial|subversion) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1873 |
;; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1874 |
unknown) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1875 |
if [[ $flist_mode == "auto" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1876 |
print -u2 "Unable to determine SCM in use and file list not specified" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1877 |
print -u2 "See which_scm(1) for SCM detection information." |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1878 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1879 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1880 |
;; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1881 |
*) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1882 |
if [[ $flist_mode == "auto" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1883 |
print -u2 "Unsupported SCM in use ($SCM_MODE) and file list not specified" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1884 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1885 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1886 |
;; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1887 |
esac |
0 | 1888 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1889 |
print -u2 " SCM detected: $SCM_MODE" |
0 | 1890 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1891 |
if [[ -n $lflag ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1892 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1893 |
# If the -l flag is given instead of the name of a file list, |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1894 |
# then generate the file list by extracting file names from a |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1895 |
# putback -n. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1896 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1897 |
shift $(($OPTIND - 1)) |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1898 |
if [[ $SCM_MODE == "teamware" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1899 |
flist_from_teamware "$*" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1900 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1901 |
print -u2 -- "Error: -l option only applies to TeamWare" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1902 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1903 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1904 |
flist_done=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1905 |
shift $# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1906 |
elif [[ -n $wflag ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1907 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1908 |
# If the -w is given then assume the file list is in Bonwick's "wx" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1909 |
# command format, i.e. pathname lines alternating with SCCS comment |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1910 |
# lines with blank lines as separators. Use the SCCS comments later |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1911 |
# in building the index.html file. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1912 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1913 |
shift $(($OPTIND - 1)) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1914 |
wxfile=$1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1915 |
if [[ -z $wxfile && -n $CODEMGR_WS ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1916 |
if [[ -r $CODEMGR_WS/wx/active ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1917 |
wxfile=$CODEMGR_WS/wx/active |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1918 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1919 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1920 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1921 |
[[ -z $wxfile ]] && print -u2 "wx file not specified, and could not " \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1922 |
"be auto-detected (check \$CODEMGR_WS)" && exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1923 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1924 |
if [[ ! -r $wxfile ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1925 |
print -u2 "$wxfile: no such file or not readable" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1926 |
usage |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1927 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
1928 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1929 |
print -u2 " File list from: wx 'active' file '$wxfile' ... \c" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1930 |
flist_from_wx $wxfile |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1931 |
flist_done=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1932 |
if [[ -n "$*" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1933 |
shift |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1934 |
fi |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1935 |
elif [[ $flist_mode == "stdin" ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1936 |
print -u2 " File list from: standard input" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1937 |
elif [[ $flist_mode == "file" ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1938 |
print -u2 " File list from: $flist_file" |
0 | 1939 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1940 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1941 |
if [[ $# -gt 0 ]]; then |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1942 |
print -u2 "WARNING: unused arguments: $*" |
0 | 1943 |
fi |
1944 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1945 |
if [[ $SCM_MODE == "teamware" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1946 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1947 |
# Parent (internally $codemgr_parent) and workspace ($codemgr_ws) can |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1948 |
# be set in a number of ways, in decreasing precedence: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1949 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1950 |
# 1) on the command line (only for the parent) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1951 |
# 2) in the user environment |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1952 |
# 3) in the flist |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1953 |
# 4) automatically based on the workspace (only for the parent) |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1954 |
# |
0 | 1955 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1956 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1957 |
# Here is case (2): the user environment |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1958 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1959 |
[[ -z $codemgr_ws && -n $CODEMGR_WS ]] && codemgr_ws=$CODEMGR_WS |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1960 |
if [[ -n $codemgr_ws && ! -d $codemgr_ws ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1961 |
print -u2 "$codemgr_ws: no such workspace" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1962 |
exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1963 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1964 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1965 |
[[ -z $codemgr_parent && -n $CODEMGR_PARENT ]] && \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1966 |
codemgr_parent=$CODEMGR_PARENT |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1967 |
if [[ -n $codemgr_parent && ! -d $codemgr_parent ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1968 |
print -u2 "$codemgr_parent: no such directory" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1969 |
exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1970 |
fi |
0 | 1971 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1972 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1973 |
# If we're in auto-detect mode and we haven't already gotten the file |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1974 |
# list, then see if we can get it by probing for wx. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1975 |
# |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1976 |
if [[ -z $flist_done && $flist_mode == "auto" && -n $codemgr_ws ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1977 |
if [[ ! -x $WX ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1978 |
print -u2 "WARNING: wx not found!" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1979 |
fi |
0 | 1980 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1981 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1982 |
# We need to use wx list -w so that we get renamed files, etc. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1983 |
# but only if a wx active file exists-- otherwise wx will |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1984 |
# hang asking us to initialize our wx information. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1985 |
# |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
1986 |
if [[ -x $WX && -f $codemgr_ws/wx/active ]]; then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1987 |
print -u2 " File list from: 'wx list -w' ... \c" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1988 |
$WX list -w > $FLIST |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1989 |
$WX comments > /tmp/$$.wx_comments |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1990 |
wxfile=/tmp/$$.wx_comments |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1991 |
print -u2 "done" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1992 |
flist_done=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1993 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1994 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1995 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1996 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1997 |
# If by hook or by crook we've gotten a file list by now (perhaps |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1998 |
# from the command line), eval it to extract environment variables from |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
1999 |
# it: This is step (3). |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2000 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2001 |
env_from_flist |
0 | 2002 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2003 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2004 |
# Continuing step (3): If we still have no file list, we'll try to get |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2005 |
# it from teamware. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2006 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2007 |
if [[ -z $flist_done ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2008 |
flist_from_teamware |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2009 |
env_from_flist |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2010 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2011 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2012 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2013 |
# (4) If we still don't have a value for codemgr_parent, get it |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2014 |
# from workspace. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2015 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2016 |
[[ -z $codemgr_ws ]] && codemgr_ws=`workspace name` |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2017 |
[[ -z $codemgr_parent ]] && codemgr_parent=`workspace parent` |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2018 |
if [[ ! -d $codemgr_parent ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2019 |
print -u2 "$CODEMGR_PARENT: no such parent workspace" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2020 |
exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2021 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2022 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2023 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2024 |
# Observe true directory name of CODEMGR_WS, as used later in |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2025 |
# webrev title. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2026 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2027 |
codemgr_ws=$(cd $codemgr_ws;print $PWD) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2028 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2029 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2030 |
# Reset CODEMGR_WS to make sure teamware commands are happy. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2031 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2032 |
CODEMGR_WS=$codemgr_ws |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2033 |
CWS=$codemgr_ws |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2034 |
PWS=$codemgr_parent |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2035 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2036 |
[[ -n $parent_webrev ]] && RWS=$(workspace parent $CWS) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2037 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2038 |
elif [[ $SCM_MODE == "mercurial" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2039 |
[[ -z $codemgr_ws && -n $CODEMGR_WS ]] && \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2040 |
codemgr_ws=`hg root -R $CODEMGR_WS 2>/dev/null` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2041 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2042 |
[[ -z $codemgr_ws ]] && codemgr_ws=`hg root 2>/dev/null` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2043 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2044 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2045 |
# Parent can either be specified with -p |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2046 |
# Specified with CODEMGR_PARENT in the environment |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2047 |
# or taken from hg's default path. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2048 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2049 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2050 |
if [[ -z $codemgr_parent && -n $CODEMGR_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2051 |
codemgr_parent=$CODEMGR_PARENT |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2052 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2053 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2054 |
if [[ -z $codemgr_parent ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2055 |
codemgr_parent=`hg path -R $codemgr_ws default 2>/dev/null` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2056 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2057 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2058 |
CWS_REV=`hg parent -R $codemgr_ws --template '{node|short}' 2>/dev/null` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2059 |
CWS=$codemgr_ws |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2060 |
PWS=$codemgr_parent |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2061 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2062 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2063 |
# If the parent is a webrev, we want to do some things against |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2064 |
# the natural workspace parent (file list, comments, etc) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2065 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2066 |
if [[ -n $parent_webrev ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2067 |
real_parent=$(hg path -R $codemgr_ws default 2>/dev/null) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2068 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2069 |
real_parent=$PWS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2070 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2071 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2072 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2073 |
# If hg-active exists, then we run it. In the case of no explicit |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2074 |
# flist given, we'll use it for our comments. In the case of an |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2075 |
# explicit flist given we'll try to use it for comments for any |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2076 |
# files mentioned in the flist. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2077 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2078 |
if [[ -z $flist_done ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2079 |
flist_from_mercurial $CWS $real_parent |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2080 |
flist_done=1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2081 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2082 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2083 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2084 |
# If we have a file list now, pull out any variables set |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2085 |
# therein. We do this now (rather than when we possibly use |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2086 |
# hg-active to find comments) to avoid stomping specifications |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2087 |
# in the user-specified flist. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2088 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2089 |
if [[ -n $flist_done ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2090 |
env_from_flist |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2091 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2092 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2093 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2094 |
# Only call hg-active if we don't have a wx formatted file already |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2095 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2096 |
if [[ -x $HG_ACTIVE && -z $wxfile ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2097 |
print " Comments from: hg-active -p $real_parent ...\c" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2098 |
hg_active_wxfile $CWS $real_parent |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2099 |
print " Done." |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2100 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2101 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2102 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2103 |
# At this point we must have a wx flist either from hg-active, |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2104 |
# or in general. Use it to try and find our parent revision, |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2105 |
# if we don't have one. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2106 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2107 |
if [[ -z $HG_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2108 |
eval `sed -e "s/#.*$//" $wxfile | grep HG_PARENT=` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2109 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2110 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2111 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2112 |
# If we still don't have a parent, we must have been given a |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2113 |
# wx-style active list with no HG_PARENT specification, run |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2114 |
# hg-active and pull an HG_PARENT out of it, ignore the rest. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2115 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2116 |
if [[ -z $HG_PARENT && -x $HG_ACTIVE ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2117 |
$HG_ACTIVE -w $codemgr_ws -p $real_parent | \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2118 |
eval `sed -e "s/#.*$//" | grep HG_PARENT=` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2119 |
elif [[ -z $HG_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2120 |
print -u2 "Error: Cannot discover parent revision" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2121 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2122 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2123 |
elif [[ $SCM_MODE == "subversion" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2124 |
if [[ -n $CODEMGR_WS && -d $CODEMGR_WS/.svn ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2125 |
CWS=$CODEMGR_WS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2126 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2127 |
svn info | while read line; do |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2128 |
if [[ $line == "URL: "* ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2129 |
url=${line#URL: } |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2130 |
elif [[ $line == "Repository Root: "* ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2131 |
repo=${line#Repository Root: } |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2132 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2133 |
done |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2134 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2135 |
rel=${url#$repo} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2136 |
CWS=${PWD%$rel} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2137 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2138 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2139 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2140 |
# We only will have a real parent workspace in the case one |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2141 |
# was specified (be it an older webrev, or another checkout). |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2142 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2143 |
[[ -n $codemgr_parent ]] && PWS=$codemgr_parent |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2144 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2145 |
if [[ -z $flist_done && $flist_mode == "auto" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2146 |
flist_from_subversion $CWS $OLDPWD |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2147 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2148 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2149 |
if [[ $SCM_MODE == "unknown" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2150 |
print -u2 " Unknown type of SCM in use" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2151 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2152 |
print -u2 " Unsupported SCM in use: $SCM_MODE" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2153 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2154 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2155 |
env_from_flist |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2156 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2157 |
if [[ -z $CODEMGR_WS ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2158 |
print -u2 "SCM not detected/supported and CODEMGR_WS not specified" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2159 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2160 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2161 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2162 |
if [[ -z $CODEMGR_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2163 |
print -u2 "SCM not detected/supported and CODEMGR_PARENT not specified" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2164 |
exit 1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2165 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2166 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2167 |
CWS=$CODEMGR_WS |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2168 |
PWS=$CODEMGR_PARENT |
0 | 2169 |
fi |
2170 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2171 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2172 |
# If the user didn't specify a -i option, check to see if there is a |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2173 |
# webrev-info file in the workspace directory. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2174 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2175 |
if [[ -z $iflag && -r "$CWS/webrev-info" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2176 |
iflag=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2177 |
INCLUDE_FILE="$CWS/webrev-info" |
0 | 2178 |
fi |
2179 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2180 |
if [[ -n $iflag ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2181 |
if [[ ! -r $INCLUDE_FILE ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2182 |
print -u2 "include file '$INCLUDE_FILE' does not exist or is" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2183 |
"not readable." |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2184 |
exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2185 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2186 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2187 |
# $INCLUDE_FILE may be a relative path, and the script alters |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2188 |
# PWD, so we just stash a copy in /tmp. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2189 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2190 |
cp $INCLUDE_FILE /tmp/$$.include |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2191 |
fi |
0 | 2192 |
fi |
2193 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2194 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2195 |
# Output directory. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2196 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2197 |
WDIR=${WDIR:-$CWS/webrev} |
0 | 2198 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2199 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2200 |
# Name of the webrev, derived from the workspace name; in the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2201 |
# future this could potentially be an option. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2202 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2203 |
WNAME=${CWS##*/} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2204 |
|
5175 | 2205 |
if [ "${WDIR%%/*}" ]; then |
0 | 2206 |
WDIR=$PWD/$WDIR |
2207 |
fi |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2208 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2209 |
if [[ ! -d $WDIR ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2210 |
mkdir -p $WDIR |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2211 |
[[ $? != 0 ]] && exit 1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2212 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2213 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2214 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2215 |
# Summarize what we're going to do. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2216 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2217 |
if [[ -n $CWS_REV ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2218 |
print " Workspace: $CWS (at $CWS_REV)" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2219 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2220 |
print " Workspace: $CWS" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2221 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2222 |
if [[ -n $parent_webrev ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2223 |
print "Compare against: webrev at $parent_webrev" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2224 |
else |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2225 |
if [[ -n $HG_PARENT ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2226 |
hg_parent_short=`echo $HG_PARENT \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2227 |
| sed -e 's/\([0-9a-f]\{12\}\).*/\1/'` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2228 |
print "Compare against: $PWS (at $hg_parent_short)" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2229 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2230 |
print "Compare against: $PWS" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2231 |
fi |
0 | 2232 |
fi |
2233 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2234 |
[[ -n $INCLUDE_FILE ]] && print " Including: $INCLUDE_FILE" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2235 |
print " Output to: $WDIR" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2236 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2237 |
# |
0 | 2238 |
# Save the file list in the webrev dir |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2239 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2240 |
[[ ! $FLIST -ef $WDIR/file.list ]] && cp $FLIST $WDIR/file.list |
0 | 2241 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2242 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2243 |
# Bug IDs will be replaced by a URL. Order of precedence |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2244 |
# is: default location, $WEBREV_BUGURL, the -O flag. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2245 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2246 |
BUGURL='http://monaco.sfbay.sun.com/detail.jsp?cr=' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2247 |
[[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2248 |
[[ -n "$Oflag" ]] && \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2249 |
BUGURL='http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=' |
0 | 2250 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2251 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2252 |
# Likewise, ARC cases will be replaced by a URL. Order of precedence |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2253 |
# is: default, $WEBREV_SACURL, the -O flag. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2254 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2255 |
# Note that -O also triggers different substitution behavior for |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2256 |
# SACURL. See sac2url(). |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2257 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2258 |
SACURL='http://sac.eng.sun.com' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2259 |
[[ -n $WEBREV_SACURL ]] && SACURL="$WEBREV_SACURL" |
5175 | 2260 |
[[ -n "$Oflag" ]] && \ |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2261 |
SACURL='http://www.opensolaris.org/os/community/arc/caselog' |
0 | 2262 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2263 |
rm -f $WDIR/$WNAME.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2264 |
rm -f $WDIR/$WNAME.ps |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2265 |
rm -f $WDIR/$WNAME.pdf |
0 | 2266 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2267 |
touch $WDIR/$WNAME.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2268 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2269 |
print " Output Files:" |
0 | 2270 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2271 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2272 |
# Clean up the file list: Remove comments, blank lines and env variables. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2273 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2274 |
sed -e "s/#.*$//" -e "/=/d" -e "/^[ ]*$/d" $FLIST > /tmp/$$.flist.clean |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2275 |
FLIST=/tmp/$$.flist.clean |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2276 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2277 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2278 |
# For Mercurial, create a cache of manifest entries. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2279 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2280 |
if [[ $SCM_MODE == "mercurial" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2281 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2282 |
# Transform the FLIST into a temporary sed script that matches |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2283 |
# relevant entries in the Mercurial manifest as follows: |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2284 |
# 1) The script will be used against the parent revision manifest, |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2285 |
# so for FLIST lines that have two filenames (a renamed file) |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2286 |
# keep only the old name. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2287 |
# 2) Escape all forward slashes the filename. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2288 |
# 3) Change the filename into another sed command that matches |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2289 |
# that file in "hg manifest -v" output: start of line, three |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2290 |
# octal digits for file permissions, space, a file type flag |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2291 |
# character, space, the filename, end of line. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2292 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2293 |
SEDFILE=/tmp/$$.manifest.sed |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2294 |
sed ' |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2295 |
s#^[^ ]* ## |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2296 |
s#/#\\\/#g |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2297 |
s#^.*$#/^... . &$/p# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2298 |
' < $FLIST > $SEDFILE |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2299 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2300 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2301 |
# Apply the generated script to the output of "hg manifest -v" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2302 |
# to get the relevant subset for this webrev. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2303 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2304 |
HG_PARENT_MANIFEST=/tmp/$$.manifest |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2305 |
hg -R $CWS manifest -v -r $HG_PARENT | |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2306 |
sed -n -f $SEDFILE > $HG_PARENT_MANIFEST |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2307 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2308 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2309 |
# |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2310 |
# First pass through the files: generate the per-file webrev HTML-files. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2311 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2312 |
cat $FLIST | while read LINE |
0 | 2313 |
do |
2314 |
set - $LINE |
|
2315 |
P=$1 |
|
2316 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2317 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2318 |
# Normally, each line in the file list is just a pathname of a |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2319 |
# file that has been modified or created in the child. A file |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2320 |
# that is renamed in the child workspace has two names on the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2321 |
# line: new name followed by the old name. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2322 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2323 |
oldname="" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2324 |
oldpath="" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2325 |
rename= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2326 |
if [[ $# -eq 2 ]]; then |
0 | 2327 |
PP=$2 # old filename |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2328 |
oldname=" (was $PP)" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2329 |
oldpath="$PP" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2330 |
rename=1 |
0 | 2331 |
PDIR=${PP%/*} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2332 |
if [[ $PDIR == $PP ]]; then |
0 | 2333 |
PDIR="." # File at root of workspace |
2334 |
fi |
|
2335 |
||
2336 |
PF=${PP##*/} |
|
2337 |
||
2338 |
DIR=${P%/*} |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2339 |
if [[ $DIR == $P ]]; then |
0 | 2340 |
DIR="." # File at root of workspace |
2341 |
fi |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2342 |
|
0 | 2343 |
F=${P##*/} |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2344 |
|
0 | 2345 |
else |
2346 |
DIR=${P%/*} |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2347 |
if [[ "$DIR" == "$P" ]]; then |
0 | 2348 |
DIR="." # File at root of workspace |
2349 |
fi |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2350 |
|
0 | 2351 |
F=${P##*/} |
2352 |
||
2353 |
PP=$P |
|
2354 |
PDIR=$DIR |
|
2355 |
PF=$F |
|
2356 |
fi |
|
2357 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2358 |
COMM=`getcomments html $P $PP` |
0 | 2359 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2360 |
print "\t$P$oldname\n\t\t\c" |
0 | 2361 |
|
2362 |
# Make the webrev mirror directory if necessary |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2363 |
mkdir -p $WDIR/$DIR |
0 | 2364 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2365 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2366 |
# If we're in OpenSolaris mode, we enforce a minor policy: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2367 |
# help to make sure the reviewer doesn't accidentally publish |
5175 | 2368 |
# source which is in usr/closed/* or deleted_files/usr/closed/* |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2369 |
# |
5175 | 2370 |
if [[ -n "$Oflag" ]]; then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2371 |
pclosed=${P##usr/closed/} |
5175 | 2372 |
pdeleted=${P##deleted_files/usr/closed/} |
2373 |
if [[ "$pclosed" != "$P" || "$pdeleted" != "$P" ]]; then |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2374 |
print "*** Omitting closed source for OpenSolaris" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2375 |
"mode review" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2376 |
continue |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2377 |
fi |
0 | 2378 |
fi |
2379 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2380 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2381 |
# We stash old and new files into parallel directories in $WDIR |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2382 |
# and do our diffs there. This makes it possible to generate |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2383 |
# clean looking diffs which don't have absolute paths present. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2384 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2385 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2386 |
build_old_new "$WDIR" "$PWS" "$PDIR" "$PF" "$CWS" "$DIR" "$F" || \ |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2387 |
continue |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2388 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2389 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2390 |
# Keep the old PWD around, so we can safely switch back after |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2391 |
# diff generation, such that build_old_new runs in a |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2392 |
# consistent environment. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2393 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2394 |
OWD=$PWD |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2395 |
cd $WDIR/raw_files |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2396 |
ofile=old/$PDIR/$PF |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2397 |
nfile=new/$DIR/$F |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2398 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2399 |
mv_but_nodiff= |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2400 |
cmp $ofile $nfile > /dev/null 2>&1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2401 |
if [[ $? == 0 && $rename == 1 ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2402 |
mv_but_nodiff=1 |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2403 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2404 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2405 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2406 |
# If we have old and new versions of the file then run the appropriate |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2407 |
# diffs. This is complicated by a couple of factors: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2408 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2409 |
# - renames must be handled specially: we emit a 'remove' |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2410 |
# diff and an 'add' diff |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2411 |
# - new files and deleted files must be handled specially |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2412 |
# - Solaris patch(1m) can't cope with file creation |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2413 |
# (and hence renames) as of this writing. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2414 |
# - To make matters worse, gnu patch doesn't interpret the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2415 |
# output of Solaris diff properly when it comes to |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2416 |
# adds and deletes. We need to do some "cleansing" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2417 |
# transformations: |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2418 |
# [to add a file] @@ -1,0 +X,Y @@ --> @@ -0,0 +X,Y @@ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2419 |
# [to del a file] @@ -X,Y +1,0 @@ --> @@ -X,Y +0,0 @@ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2420 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2421 |
cleanse_rmfile="sed 's/^\(@@ [0-9+,-]*\) [0-9+,-]* @@$/\1 +0,0 @@/'" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2422 |
cleanse_newfile="sed 's/^@@ [0-9+,-]* \([0-9+,-]* @@\)$/@@ -0,0 \1/'" |
0 | 2423 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2424 |
rm -f $WDIR/$DIR/$F.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2425 |
if [[ -z $rename ]]; then |
5175 | 2426 |
if [ ! -f "$ofile" ]; then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2427 |
diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2428 |
> $WDIR/$DIR/$F.patch |
5175 | 2429 |
elif [ ! -f "$nfile" ]; then |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2430 |
diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2431 |
> $WDIR/$DIR/$F.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2432 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2433 |
diff -u $ofile $nfile > $WDIR/$DIR/$F.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2434 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2435 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2436 |
diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2437 |
> $WDIR/$DIR/$F.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2438 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2439 |
diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2440 |
>> $WDIR/$DIR/$F.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2441 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2442 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2443 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2444 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2445 |
# Tack the patch we just made onto the accumulated patch for the |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2446 |
# whole wad. |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2447 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2448 |
cat $WDIR/$DIR/$F.patch >> $WDIR/$WNAME.patch |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2449 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2450 |
print " patch\c" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2451 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2452 |
if [[ -f $ofile && -f $nfile && -z $mv_but_nodiff ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2453 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2454 |
${CDIFFCMD:-diff -bt -C 5} $ofile $nfile > $WDIR/$DIR/$F.cdiff |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2455 |
diff_to_html $F $DIR/$F "C" "$COMM" < $WDIR/$DIR/$F.cdiff \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2456 |
> $WDIR/$DIR/$F.cdiff.html |
0 | 2457 |
print " cdiffs\c" |
2458 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2459 |
${UDIFFCMD:-diff -bt -U 5} $ofile $nfile > $WDIR/$DIR/$F.udiff |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2460 |
diff_to_html $F $DIR/$F "U" "$COMM" < $WDIR/$DIR/$F.udiff \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2461 |
> $WDIR/$DIR/$F.udiff.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2462 |
|
0 | 2463 |
print " udiffs\c" |
2464 |
||
2465 |
if [[ -x $WDIFF ]]; then |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2466 |
$WDIFF -c "$COMM" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2467 |
-t "$WNAME Wdiff $DIR/$F" $ofile $nfile > \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2468 |
$WDIR/$DIR/$F.wdiff.html 2>/dev/null |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2469 |
if [[ $? -eq 0 ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2470 |
print " wdiffs\c" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2471 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2472 |
print " wdiffs[fail]\c" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2473 |
fi |
0 | 2474 |
fi |
2475 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2476 |
sdiff_to_html $ofile $nfile $F $DIR "$COMM" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2477 |
> $WDIR/$DIR/$F.sdiff.html |
0 | 2478 |
print " sdiffs\c" |
2479 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2480 |
print " frames\c" |
0 | 2481 |
|
2482 |
rm -f $WDIR/$DIR/$F.cdiff $WDIR/$DIR/$F.udiff |
|
2483 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2484 |
difflines $ofile $nfile > $WDIR/$DIR/$F.count |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2485 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2486 |
elif [[ -f $ofile && -f $nfile && -n $mv_but_nodiff ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2487 |
# renamed file: may also have differences |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2488 |
difflines $ofile $nfile > $WDIR/$DIR/$F.count |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2489 |
elif [[ -f $nfile ]]; then |
0 | 2490 |
# new file: count added lines |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2491 |
difflines /dev/null $nfile > $WDIR/$DIR/$F.count |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2492 |
elif [[ -f $ofile ]]; then |
0 | 2493 |
# old file: count deleted lines |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2494 |
difflines $ofile /dev/null > $WDIR/$DIR/$F.count |
0 | 2495 |
fi |
2496 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2497 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2498 |
# Now we generate the postscript for this file. We generate diffs |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2499 |
# only in the event that there is delta, or the file is new (it seems |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2500 |
# tree-killing to print out the contents of deleted files). |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2501 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2502 |
if [[ -f $nfile ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2503 |
ocr=$ofile |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2504 |
[[ ! -f $ofile ]] && ocr=/dev/null |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2505 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2506 |
if [[ -z $mv_but_nodiff ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2507 |
textcomm=`getcomments text $P $PP` |
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2508 |
if [[ -x $CODEREVIEW ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2509 |
$CODEREVIEW -y "$textcomm" \ |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2510 |
-e $ocr $nfile \ |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2511 |
> /tmp/$$.psfile 2>/dev/null && |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2512 |
cat /tmp/$$.psfile >> $WDIR/$WNAME.ps |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2513 |
if [[ $? -eq 0 ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2514 |
print " ps\c" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2515 |
else |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2516 |
print " ps[fail]\c" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2517 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2518 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2519 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2520 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2521 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2522 |
if [[ -f $ofile ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2523 |
source_to_html Old $PP < $ofile > $WDIR/$DIR/$F-.html |
0 | 2524 |
print " old\c" |
2525 |
fi |
|
2526 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2527 |
if [[ -f $nfile ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2528 |
source_to_html New $P < $nfile > $WDIR/$DIR/$F.html |
0 | 2529 |
print " new\c" |
2530 |
fi |
|
2531 |
||
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2532 |
cd $OWD |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2533 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2534 |
|
0 | 2535 |
done |
2536 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2537 |
frame_nav_js > $WDIR/ancnav.js |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2538 |
frame_navigation > $WDIR/ancnav.html |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2539 |
|
3295
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2540 |
if [[ ! -f $WDIR/$WNAME.ps ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2541 |
print " Generating PDF: Skipped: no output available" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2542 |
elif [[ -x $CODEREVIEW && -x $PS2PDF ]]; then |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2543 |
print " Generating PDF: \c" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2544 |
fix_postscript $WDIR/$WNAME.ps | $PS2PDF - > $WDIR/$WNAME.pdf |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2545 |
print "Done." |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2546 |
else |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2547 |
print " Generating PDF: Skipped: missing 'ps2pdf' or 'codereview'" |
4c025ff534ce
6505241 webrev misses ps2pdf, but carries on like it's still there
dp
parents:
3252
diff
changeset
|
2548 |
fi |
0 | 2549 |
|
5175 | 2550 |
# If we're in OpenSolaris mode and there's a closed dir under $WDIR, |
2551 |
# delete it - prevent accidental publishing of closed source |
|
2552 |
||
2553 |
if [[ -n "$Oflag" ]]; then |
|
2554 |
/usr/bin/find $WDIR -type d -name closed -exec /bin/rm -rf {} \; |
|
2555 |
fi |
|
2556 |
||
0 | 2557 |
# Now build the index.html file that contains |
2558 |
# links to the source files and their diffs. |
|
2559 |
||
2560 |
cd $CWS |
|
2561 |
||
2562 |
# Save total changed lines for Code Inspection. |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2563 |
print "$TOTL" > $WDIR/TotalChangedLines |
0 | 2564 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2565 |
print " index.html: \c" |
0 | 2566 |
INDEXFILE=$WDIR/index.html |
2567 |
exec 3<&1 # duplicate stdout to FD3. |
|
2568 |
exec 1<&- # Close stdout. |
|
2569 |
exec > $INDEXFILE # Open stdout to index file. |
|
2570 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2571 |
print "$HTML<head>$STDHEAD" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2572 |
print "<title>$WNAME</title>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2573 |
print "</head>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2574 |
print "<body id=\"SUNWwebrev\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2575 |
print "<div class=\"summary\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2576 |
print "<h2>Code Review for $WNAME</h2>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2577 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2578 |
print "<table>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2579 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2580 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2581 |
# Get the preparer's name: |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2582 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2583 |
# If the SCM detected is Mercurial, and the configuration property |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2584 |
# ui.username is available, use that, but be careful to properly escape |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2585 |
# angle brackets (HTML syntax characters) in the email address. |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2586 |
# |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2587 |
# Otherwise, use the current userid in the form "John Doe (jdoe)", but |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2588 |
# to maintain compatibility with passwd(4), we must support '&' substitutions. |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2589 |
# |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2590 |
preparer= |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2591 |
if [[ "$SCM_MODE" == mercurial ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2592 |
preparer=`hg showconfig ui.username 2>/dev/null` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2593 |
if [[ -n "$preparer" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2594 |
preparer="$(echo "$preparer" | html_quote)" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2595 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2596 |
fi |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2597 |
if [[ -z "$preparer" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2598 |
preparer=$( |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2599 |
$PERL -e ' |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2600 |
($login, $pw, $uid, $gid, $quota, $cmt, $gcos) = getpwuid($<); |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2601 |
if ($login) { |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2602 |
$gcos =~ s/\&/ucfirst($login)/e; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2603 |
printf "%s (%s)\n", $gcos, $login; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2604 |
} else { |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2605 |
printf "(unknown)\n"; |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2606 |
} |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2607 |
') |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2608 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2609 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2610 |
print "<tr><th>Prepared by:</th><td>$preparer on `date`</td></tr>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2611 |
print "<tr><th>Workspace:</th><td>$CWS" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2612 |
if [[ -n $CWS_REV ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2613 |
print "(at $CWS_REV)" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2614 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2615 |
print "</td></tr>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2616 |
print "<tr><th>Compare against:</th><td>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2617 |
if [[ -n $parent_webrev ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2618 |
print "webrev at $parent_webrev" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2619 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2620 |
print "$PWS" |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2621 |
if [[ -n $hg_parent_short ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2622 |
print "(at $hg_parent_short)" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2623 |
fi |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2624 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2625 |
print "</td></tr>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2626 |
print "<tr><th>Summary of changes:</th><td>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2627 |
printCI $TOTL $TINS $TDEL $TMOD $TUNC |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2628 |
print "</td></tr>" |
0 | 2629 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2630 |
if [[ -f $WDIR/$WNAME.patch ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2631 |
print "<tr><th>Patch of changes:</th><td>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2632 |
print "<a href=\"$WNAME.patch\">$WNAME.patch</a></td></tr>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2633 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2634 |
if [[ -f $WDIR/$WNAME.pdf ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2635 |
print "<tr><th>Printable review:</th><td>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2636 |
print "<a href=\"$WNAME.pdf\">$WNAME.pdf</a></td></tr>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2637 |
fi |
0 | 2638 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2639 |
if [[ -n "$iflag" ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2640 |
print "<tr><th>Author comments:</th><td><div>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2641 |
cat /tmp/$$.include |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2642 |
print "</div></td></tr>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2643 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2644 |
print "</table>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2645 |
print "</div>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2646 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2647 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2648 |
# Second pass through the files: generate the rest of the index file |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2649 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2650 |
cat $FLIST | while read LINE |
0 | 2651 |
do |
2652 |
set - $LINE |
|
2653 |
P=$1 |
|
2654 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2655 |
if [[ $# == 2 ]]; then |
0 | 2656 |
PP=$2 |
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2657 |
oldname="$PP" |
0 | 2658 |
else |
2659 |
PP=$P |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2660 |
oldname="" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2661 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2662 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2663 |
mv_but_nodiff= |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2664 |
cmp $WDIR/raw_files/old/$PP $WDIR/raw_files/new/$P > /dev/null 2>&1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2665 |
if [[ $? == 0 && -n "$oldname" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2666 |
mv_but_nodiff=1 |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2667 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2668 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2669 |
DIR=${P%/*} |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2670 |
if [[ $DIR == $P ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2671 |
DIR="." # File at root of workspace |
0 | 2672 |
fi |
2673 |
||
2674 |
# Avoid processing the same file twice. |
|
2675 |
# It's possible for renamed files to |
|
2676 |
# appear twice in the file list |
|
2677 |
||
2678 |
F=$WDIR/$P |
|
2679 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2680 |
print "<p>" |
0 | 2681 |
|
2682 |
# If there's a diffs file, make diffs links |
|
2683 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2684 |
if [[ -f $F.cdiff.html ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2685 |
print "<a href=\"$P.cdiff.html\">Cdiffs</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2686 |
print "<a href=\"$P.udiff.html\">Udiffs</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2687 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2688 |
if [[ -f $F.wdiff.html && -x $WDIFF ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2689 |
print "<a href=\"$P.wdiff.html\">Wdiffs</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2690 |
fi |
0 | 2691 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2692 |
print "<a href=\"$P.sdiff.html\">Sdiffs</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2693 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2694 |
print "<a href=\"$P.frames.html\">Frames</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2695 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2696 |
print " ------ ------ ------" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2697 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2698 |
if [[ -x $WDIFF ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2699 |
print " ------" |
0 | 2700 |
fi |
2701 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2702 |
print " ------" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2703 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2704 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2705 |
# If there's an old file, make the link |
0 | 2706 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2707 |
if [[ -f $F-.html ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2708 |
print "<a href=\"$P-.html\">Old</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2709 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2710 |
print " ---" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2711 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2712 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2713 |
# If there's an new file, make the link |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2714 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2715 |
if [[ -f $F.html ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2716 |
print "<a href=\"$P.html\">New</a>" |
0 | 2717 |
else |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2718 |
print " ---" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2719 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2720 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2721 |
if [[ -f $F.patch ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2722 |
print "<a href=\"$P.patch\">Patch</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2723 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2724 |
print " -----" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2725 |
fi |
0 | 2726 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2727 |
if [[ -f $WDIR/raw_files/new/$P ]]; then |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2728 |
print "<a href=\"raw_files/new/$P\">Raw</a>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2729 |
else |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2730 |
print " ---" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2731 |
fi |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2732 |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2733 |
print "<b>$P</b>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2734 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2735 |
# For renamed files, clearly state whether or not they are modified |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2736 |
if [[ -n "$oldname" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2737 |
if [[ -n "$mv_but_nodiff" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2738 |
print "<i>(renamed only, was $oldname)</i>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2739 |
else |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2740 |
print "<i>(modified and renamed, was $oldname)</i>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2741 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2742 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2743 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2744 |
# If there's an old file, but no new file, the file was deleted |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2745 |
if [[ -f $F-.html && ! -f $F.html ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2746 |
print " <i>(deleted)</i>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2747 |
fi |
0 | 2748 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2749 |
# |
5175 | 2750 |
# Check for usr/closed and deleted_files/usr/closed |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2751 |
# |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2752 |
if [ ! -z "$Oflag" ]; then |
5175 | 2753 |
if [[ $P == usr/closed/* || \ |
2754 |
$P == deleted_files/usr/closed/* ]]; then |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2755 |
print " <i>Closed source: omitted from" \ |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2756 |
"this review</i>" |
0 | 2757 |
fi |
2758 |
fi |
|
2759 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2760 |
print "</p>" |
0 | 2761 |
# Insert delta comments |
2762 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2763 |
print "<blockquote><pre>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2764 |
getcomments html $P $PP |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2765 |
print "</pre>" |
0 | 2766 |
|
2767 |
# Add additional comments comment |
|
2768 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2769 |
print "<!-- Add comments to explain changes in $P here -->" |
0 | 2770 |
|
2771 |
# Add count of changes. |
|
2772 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2773 |
if [[ -f $F.count ]]; then |
0 | 2774 |
cat $F.count |
2775 |
rm $F.count |
|
2776 |
fi |
|
7078
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2777 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2778 |
if [[ $SCM_MODE == "teamware" || |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2779 |
$SCM_MODE == "mercurial" || |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2780 |
$SCM_MODE == "unknown" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2781 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2782 |
# Include warnings for important file mode situations: |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2783 |
# 1) New executable files |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2784 |
# 2) Permission changes of any kind |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2785 |
# 3) Existing executable files |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2786 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2787 |
old_mode= |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2788 |
if [[ -f $WDIR/raw_files/old/$PP ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2789 |
old_mode=`get_file_mode $WDIR/raw_files/old/$PP` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2790 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2791 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2792 |
new_mode= |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2793 |
if [[ -f $WDIR/raw_files/new/$P ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2794 |
new_mode=`get_file_mode $WDIR/raw_files/new/$P` |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2795 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2796 |
|
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2797 |
if [[ -z "$old_mode" && "$new_mode" = *[1357]* ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2798 |
print "<span class=\"chmod\">" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2799 |
print "<p>new executable file: mode $new_mode</p>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2800 |
print "</span>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2801 |
elif [[ -n "$old_mode" && -n "$new_mode" && |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2802 |
"$old_mode" != "$new_mode" ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2803 |
print "<span class=\"chmod\">" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2804 |
print "<p>mode change: $old_mode to $new_mode</p>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2805 |
print "</span>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2806 |
elif [[ "$new_mode" = *[1357]* ]]; then |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2807 |
print "<span class=\"chmod\">" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2808 |
print "<p>executable file: mode $new_mode</p>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2809 |
print "</span>" |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2810 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2811 |
fi |
935563142864
6538468 add Mercurial support to ON developer tools
mjnelson
parents:
6922
diff
changeset
|
2812 |
|
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2813 |
print "</blockquote>" |
0 | 2814 |
done |
2815 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2816 |
|
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2817 |
|
6922
7a94a2aa907b
6716179 webrev emits XHTML, not HTML, causing improper display in some browsers
mjnelson
parents:
5175
diff
changeset
|
2818 |
print "<hr></hr>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2819 |
print "<p style=\"font-size: small\">" |
7298
b69e27387f74
6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents:
7078
diff
changeset
|
2820 |
print "This code review page was prepared using <b>$0</b>." |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2821 |
print "Webrev is maintained by the <a href=\"http://www.opensolaris.org\">" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2822 |
print "OpenSolaris</a> project. The latest version may be obtained" |
3696
374685e62d7a
6527002 webrev has incorrect link to latest version on opensolaris.org
fr80241
parents:
3295
diff
changeset
|
2823 |
print "<a href=\"http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/tools/scripts/webrev.sh\">here</a>.</p>" |
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2824 |
print "</body>" |
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2825 |
print "</html>" |
0 | 2826 |
|
2827 |
exec 1<&- # Close FD 1. |
|
2828 |
exec 1<&3 # dup FD 3 to restore stdout. |
|
2829 |
exec 3<&- # close FD 3. |
|
2830 |
||
3252
68e8f4a5fe5d
4921786 webrev -l should be able to use a different workspace parent
dp
parents:
0
diff
changeset
|
2831 |
print "Done." |