16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>eric6.Plugins.VcsPlugins.vcsGit.GitDiffGenerator</h1> |
23 <h1>eric6.Plugins.VcsPlugins.vcsGit.GitDiffGenerator</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing a class to generate the output of the git diff command |
26 Module implementing a class to generate the output of the git diff command |
25 process. |
27 process. |
26 </p> |
28 </p> |
27 <h3>Global Attributes</h3> |
29 <h3>Global Attributes</h3> |
|
30 |
28 <table> |
31 <table> |
29 <tr><td>None</td></tr> |
32 <tr><td>None</td></tr> |
30 </table> |
33 </table> |
31 <h3>Classes</h3> |
34 <h3>Classes</h3> |
32 <table> |
35 |
|
36 <table> |
|
37 |
33 <tr> |
38 <tr> |
34 <td><a href="#GitDiffGenerator">GitDiffGenerator</a></td> |
39 <td><a href="#GitDiffGenerator">GitDiffGenerator</a></td> |
35 <td>Class implementing the generation of output of the git diff command.</td> |
40 <td>Class implementing the generation of output of the git diff command.</td> |
36 </tr> |
41 </tr> |
37 </table> |
42 </table> |
38 <h3>Functions</h3> |
43 <h3>Functions</h3> |
39 <table> |
44 |
40 <tr><td>None</td></tr> |
45 <table> |
41 </table> |
46 <tr><td>None</td></tr> |
42 <hr /><hr /> |
47 </table> |
|
48 <hr /> |
|
49 <hr /> |
43 <a NAME="GitDiffGenerator" ID="GitDiffGenerator"></a> |
50 <a NAME="GitDiffGenerator" ID="GitDiffGenerator"></a> |
44 <h2>GitDiffGenerator</h2> |
51 <h2>GitDiffGenerator</h2> |
|
52 |
45 <p> |
53 <p> |
46 Class implementing the generation of output of the git diff command. |
54 Class implementing the generation of output of the git diff command. |
47 </p><h3>Signals</h3> |
55 </p> |
48 <dl> |
56 <h3>Signals</h3> |
|
57 <dl> |
|
58 |
49 <dt>finished()</dt> |
59 <dt>finished()</dt> |
50 <dd> |
60 <dd> |
51 emitted when all processes have finished |
61 emitted when all processes have finished |
52 </dd> |
62 </dd> |
53 </dl> |
63 </dl> |
54 <h3>Derived from</h3> |
64 <h3>Derived from</h3> |
55 QObject |
65 QObject |
56 <h3>Class Attributes</h3> |
66 <h3>Class Attributes</h3> |
|
67 |
57 <table> |
68 <table> |
58 <tr><td>None</td></tr> |
69 <tr><td>None</td></tr> |
59 </table> |
70 </table> |
60 <h3>Class Methods</h3> |
71 <h3>Class Methods</h3> |
|
72 |
61 <table> |
73 <table> |
62 <tr><td>None</td></tr> |
74 <tr><td>None</td></tr> |
63 </table> |
75 </table> |
64 <h3>Methods</h3> |
76 <h3>Methods</h3> |
65 <table> |
77 |
|
78 <table> |
|
79 |
66 <tr> |
80 <tr> |
67 <td><a href="#GitDiffGenerator.__init__">GitDiffGenerator</a></td> |
81 <td><a href="#GitDiffGenerator.__init__">GitDiffGenerator</a></td> |
68 <td>Constructor</td> |
82 <td>Constructor</td> |
69 </tr><tr> |
83 </tr> |
|
84 <tr> |
70 <td><a href="#GitDiffGenerator.__procFinished">__procFinished</a></td> |
85 <td><a href="#GitDiffGenerator.__procFinished">__procFinished</a></td> |
71 <td>Private slot connected to the finished signal.</td> |
86 <td>Private slot connected to the finished signal.</td> |
72 </tr><tr> |
87 </tr> |
|
88 <tr> |
73 <td><a href="#GitDiffGenerator.__processFileLine">__processFileLine</a></td> |
89 <td><a href="#GitDiffGenerator.__processFileLine">__processFileLine</a></td> |
74 <td>Private slot to process a line giving the old/new file.</td> |
90 <td>Private slot to process a line giving the old/new file.</td> |
75 </tr><tr> |
91 </tr> |
|
92 <tr> |
76 <td><a href="#GitDiffGenerator.__processLine">__processLine</a></td> |
93 <td><a href="#GitDiffGenerator.__processLine">__processLine</a></td> |
77 <td>Private method to process one line of output.</td> |
94 <td>Private method to process one line of output.</td> |
78 </tr><tr> |
95 </tr> |
|
96 <tr> |
79 <td><a href="#GitDiffGenerator.__readStderr">__readStderr</a></td> |
97 <td><a href="#GitDiffGenerator.__readStderr">__readStderr</a></td> |
80 <td>Private slot to handle the readyReadStandardError signal.</td> |
98 <td>Private slot to handle the readyReadStandardError signal.</td> |
81 </tr><tr> |
99 </tr> |
|
100 <tr> |
82 <td><a href="#GitDiffGenerator.__readStdout">__readStdout</a></td> |
101 <td><a href="#GitDiffGenerator.__readStdout">__readStdout</a></td> |
83 <td>Private slot to handle the readyReadStandardOutput signal.</td> |
102 <td>Private slot to handle the readyReadStandardOutput signal.</td> |
84 </tr><tr> |
103 </tr> |
|
104 <tr> |
85 <td><a href="#GitDiffGenerator.getResult">getResult</a></td> |
105 <td><a href="#GitDiffGenerator.getResult">getResult</a></td> |
86 <td>Public method to return the result data.</td> |
106 <td>Public method to return the result data.</td> |
87 </tr><tr> |
107 </tr> |
|
108 <tr> |
88 <td><a href="#GitDiffGenerator.start">start</a></td> |
109 <td><a href="#GitDiffGenerator.start">start</a></td> |
89 <td>Public slot to start the git diff command.</td> |
110 <td>Public slot to start the git diff command.</td> |
90 </tr><tr> |
111 </tr> |
|
112 <tr> |
91 <td><a href="#GitDiffGenerator.stopProcesses">stopProcesses</a></td> |
113 <td><a href="#GitDiffGenerator.stopProcesses">stopProcesses</a></td> |
92 <td>Public slot to stop the diff processes.</td> |
114 <td>Public slot to stop the diff processes.</td> |
93 </tr> |
115 </tr> |
94 </table> |
116 </table> |
95 <h3>Static Methods</h3> |
117 <h3>Static Methods</h3> |
96 <table> |
118 |
97 <tr><td>None</td></tr> |
119 <table> |
98 </table> |
120 <tr><td>None</td></tr> |
|
121 </table> |
|
122 |
99 <a NAME="GitDiffGenerator.__init__" ID="GitDiffGenerator.__init__"></a> |
123 <a NAME="GitDiffGenerator.__init__" ID="GitDiffGenerator.__init__"></a> |
100 <h4>GitDiffGenerator (Constructor)</h4> |
124 <h4>GitDiffGenerator (Constructor)</h4> |
101 <b>GitDiffGenerator</b>(<i>vcs, parent=None</i>) |
125 <b>GitDiffGenerator</b>(<i>vcs, parent=None</i>) |
|
126 |
102 <p> |
127 <p> |
103 Constructor |
128 Constructor |
104 </p><dl> |
129 </p> |
|
130 <dl> |
|
131 |
105 <dt><i>vcs</i></dt> |
132 <dt><i>vcs</i></dt> |
106 <dd> |
133 <dd> |
107 reference to the vcs object |
134 reference to the vcs object |
108 </dd><dt><i>parent</i></dt> |
135 </dd> |
|
136 <dt><i>parent</i></dt> |
109 <dd> |
137 <dd> |
110 parent widget (QWidget) |
138 parent widget (QWidget) |
111 </dd> |
139 </dd> |
112 </dl><a NAME="GitDiffGenerator.__procFinished" ID="GitDiffGenerator.__procFinished"></a> |
140 </dl> |
|
141 <a NAME="GitDiffGenerator.__procFinished" ID="GitDiffGenerator.__procFinished"></a> |
113 <h4>GitDiffGenerator.__procFinished</h4> |
142 <h4>GitDiffGenerator.__procFinished</h4> |
114 <b>__procFinished</b>(<i>exitCode, exitStatus</i>) |
143 <b>__procFinished</b>(<i>exitCode, exitStatus</i>) |
|
144 |
115 <p> |
145 <p> |
116 Private slot connected to the finished signal. |
146 Private slot connected to the finished signal. |
117 </p><dl> |
147 </p> |
|
148 <dl> |
|
149 |
118 <dt><i>exitCode</i></dt> |
150 <dt><i>exitCode</i></dt> |
119 <dd> |
151 <dd> |
120 exit code of the process (integer) |
152 exit code of the process (integer) |
121 </dd><dt><i>exitStatus</i></dt> |
153 </dd> |
|
154 <dt><i>exitStatus</i></dt> |
122 <dd> |
155 <dd> |
123 exit status of the process (QProcess.ExitStatus) |
156 exit status of the process (QProcess.ExitStatus) |
124 </dd> |
157 </dd> |
125 </dl><a NAME="GitDiffGenerator.__processFileLine" ID="GitDiffGenerator.__processFileLine"></a> |
158 </dl> |
|
159 <a NAME="GitDiffGenerator.__processFileLine" ID="GitDiffGenerator.__processFileLine"></a> |
126 <h4>GitDiffGenerator.__processFileLine</h4> |
160 <h4>GitDiffGenerator.__processFileLine</h4> |
127 <b>__processFileLine</b>(<i>line, isTopDiff</i>) |
161 <b>__processFileLine</b>(<i>line, isTopDiff</i>) |
|
162 |
128 <p> |
163 <p> |
129 Private slot to process a line giving the old/new file. |
164 Private slot to process a line giving the old/new file. |
130 </p><dl> |
165 </p> |
|
166 <dl> |
|
167 |
131 <dt><i>line</i></dt> |
168 <dt><i>line</i></dt> |
132 <dd> |
169 <dd> |
133 line to be processed (string) |
170 line to be processed (string) |
134 </dd><dt><i>isTopDiff</i></dt> |
171 </dd> |
|
172 <dt><i>isTopDiff</i></dt> |
135 <dd> |
173 <dd> |
136 flag indicating to show the output in the top |
174 flag indicating to show the output in the top |
137 output widget (boolean) |
175 output widget (boolean) |
138 </dd> |
176 </dd> |
139 </dl><a NAME="GitDiffGenerator.__processLine" ID="GitDiffGenerator.__processLine"></a> |
177 </dl> |
|
178 <a NAME="GitDiffGenerator.__processLine" ID="GitDiffGenerator.__processLine"></a> |
140 <h4>GitDiffGenerator.__processLine</h4> |
179 <h4>GitDiffGenerator.__processLine</h4> |
141 <b>__processLine</b>(<i>line, isTopDiff</i>) |
180 <b>__processLine</b>(<i>line, isTopDiff</i>) |
|
181 |
142 <p> |
182 <p> |
143 Private method to process one line of output. |
183 Private method to process one line of output. |
144 </p><dl> |
184 </p> |
|
185 <dl> |
|
186 |
145 <dt><i>line</i></dt> |
187 <dt><i>line</i></dt> |
146 <dd> |
188 <dd> |
147 output line to process (string) |
189 output line to process (string) |
148 </dd><dt><i>isTopDiff</i></dt> |
190 </dd> |
|
191 <dt><i>isTopDiff</i></dt> |
149 <dd> |
192 <dd> |
150 flag indicating to show the output in the top |
193 flag indicating to show the output in the top |
151 output widget (boolean) |
194 output widget (boolean) |
152 </dd> |
195 </dd> |
153 </dl><a NAME="GitDiffGenerator.__readStderr" ID="GitDiffGenerator.__readStderr"></a> |
196 </dl> |
|
197 <a NAME="GitDiffGenerator.__readStderr" ID="GitDiffGenerator.__readStderr"></a> |
154 <h4>GitDiffGenerator.__readStderr</h4> |
198 <h4>GitDiffGenerator.__readStderr</h4> |
155 <b>__readStderr</b>(<i>process</i>) |
199 <b>__readStderr</b>(<i>process</i>) |
|
200 |
156 <p> |
201 <p> |
157 Private slot to handle the readyReadStandardError signal. |
202 Private slot to handle the readyReadStandardError signal. |
158 </p><p> |
203 </p> |
|
204 <p> |
159 It reads the error output of the process and inserts it into the |
205 It reads the error output of the process and inserts it into the |
160 error pane. |
206 error pane. |
161 </p><dl> |
207 </p> |
|
208 <dl> |
|
209 |
162 <dt><i>process</i> (QProcess)</dt> |
210 <dt><i>process</i> (QProcess)</dt> |
163 <dd> |
211 <dd> |
164 reference to the process providing error output |
212 reference to the process providing error output |
165 </dd> |
213 </dd> |
166 </dl><a NAME="GitDiffGenerator.__readStdout" ID="GitDiffGenerator.__readStdout"></a> |
214 </dl> |
|
215 <a NAME="GitDiffGenerator.__readStdout" ID="GitDiffGenerator.__readStdout"></a> |
167 <h4>GitDiffGenerator.__readStdout</h4> |
216 <h4>GitDiffGenerator.__readStdout</h4> |
168 <b>__readStdout</b>(<i>process</i>) |
217 <b>__readStdout</b>(<i>process</i>) |
|
218 |
169 <p> |
219 <p> |
170 Private slot to handle the readyReadStandardOutput signal. |
220 Private slot to handle the readyReadStandardOutput signal. |
171 </p><p> |
221 </p> |
|
222 <p> |
172 It reads the output of the process, formats it and inserts it into |
223 It reads the output of the process, formats it and inserts it into |
173 the contents pane. |
224 the contents pane. |
174 </p><dl> |
225 </p> |
|
226 <dl> |
|
227 |
175 <dt><i>process</i> (QProcess)</dt> |
228 <dt><i>process</i> (QProcess)</dt> |
176 <dd> |
229 <dd> |
177 reference to the process providing output |
230 reference to the process providing output |
178 </dd> |
231 </dd> |
179 </dl><a NAME="GitDiffGenerator.getResult" ID="GitDiffGenerator.getResult"></a> |
232 </dl> |
|
233 <a NAME="GitDiffGenerator.getResult" ID="GitDiffGenerator.getResult"></a> |
180 <h4>GitDiffGenerator.getResult</h4> |
234 <h4>GitDiffGenerator.getResult</h4> |
181 <b>getResult</b>(<i></i>) |
235 <b>getResult</b>(<i></i>) |
|
236 |
182 <p> |
237 <p> |
183 Public method to return the result data. |
238 Public method to return the result data. |
184 </p><dl> |
239 </p> |
|
240 <dl> |
185 <dt>Returns:</dt> |
241 <dt>Returns:</dt> |
186 <dd> |
242 <dd> |
187 tuple of lists of string containing lines of the diff, the diff |
243 tuple of lists of string containing lines of the diff, the diff |
188 between stage and repo for 'work2stage2repo' mode (empty |
244 between stage and repo for 'work2stage2repo' mode (empty |
189 otherwise), the list of errors and a list of tuples of filenames |
245 otherwise), the list of errors and a list of tuples of filenames |
190 and the line into the diff output. |
246 and the line into the diff output. |
191 </dd> |
247 </dd> |
192 </dl><a NAME="GitDiffGenerator.start" ID="GitDiffGenerator.start"></a> |
248 </dl> |
|
249 <a NAME="GitDiffGenerator.start" ID="GitDiffGenerator.start"></a> |
193 <h4>GitDiffGenerator.start</h4> |
250 <h4>GitDiffGenerator.start</h4> |
194 <b>start</b>(<i>fn, versions=None, diffMode="work2repo", stashName=""</i>) |
251 <b>start</b>(<i>fn, versions=None, diffMode="work2repo", stashName=""</i>) |
|
252 |
195 <p> |
253 <p> |
196 Public slot to start the git diff command. |
254 Public slot to start the git diff command. |
197 </p><dl> |
255 </p> |
|
256 <dl> |
|
257 |
198 <dt><i>fn</i></dt> |
258 <dt><i>fn</i></dt> |
199 <dd> |
259 <dd> |
200 filename to be diffed (string) |
260 filename to be diffed (string) |
201 </dd><dt><i>versions</i></dt> |
261 </dd> |
|
262 <dt><i>versions</i></dt> |
202 <dd> |
263 <dd> |
203 list of versions to be diffed (list of up to 2 strings |
264 list of versions to be diffed (list of up to 2 strings |
204 or None) |
265 or None) |
205 </dd><dt><i>diffMode</i></dt> |
266 </dd> |
|
267 <dt><i>diffMode</i></dt> |
206 <dd> |
268 <dd> |
207 indication for the type of diff to be performed ( |
269 indication for the type of diff to be performed ( |
208 'work2repo' compares the working tree with the HEAD commit, |
270 'work2repo' compares the working tree with the HEAD commit, |
209 'work2stage' compares the working tree with the staging area, |
271 'work2stage' compares the working tree with the staging area, |
210 'stage2repo' compares the staging area with the HEAD commit, |
272 'stage2repo' compares the staging area with the HEAD commit, |
211 'work2stage2repo' compares the working tree with the staging area |
273 'work2stage2repo' compares the working tree with the staging area |
212 and the staging area with the HEAD commit, |
274 and the staging area with the HEAD commit, |
213 'stash' shows the diff for a stash) |
275 'stash' shows the diff for a stash) |
214 </dd><dt><i>stashName</i></dt> |
276 </dd> |
|
277 <dt><i>stashName</i></dt> |
215 <dd> |
278 <dd> |
216 name of the stash to show a diff for (string) |
279 name of the stash to show a diff for (string) |
217 </dd> |
280 </dd> |
218 </dl><dl> |
281 </dl> |
|
282 <dl> |
219 <dt>Returns:</dt> |
283 <dt>Returns:</dt> |
220 <dd> |
284 <dd> |
221 flag indicating the start status (boolean) |
285 flag indicating the start status (boolean) |
222 </dd> |
286 </dd> |
223 </dl><a NAME="GitDiffGenerator.stopProcesses" ID="GitDiffGenerator.stopProcesses"></a> |
287 </dl> |
|
288 <a NAME="GitDiffGenerator.stopProcesses" ID="GitDiffGenerator.stopProcesses"></a> |
224 <h4>GitDiffGenerator.stopProcesses</h4> |
289 <h4>GitDiffGenerator.stopProcesses</h4> |
225 <b>stopProcesses</b>(<i></i>) |
290 <b>stopProcesses</b>(<i></i>) |
|
291 |
226 <p> |
292 <p> |
227 Public slot to stop the diff processes. |
293 Public slot to stop the diff processes. |
228 </p> |
294 </p> |
229 <div align="right"><a href="#top">Up</a></div> |
295 <div align="right"><a href="#top">Up</a></div> |
230 <hr /> |
296 <hr /> |