28 import Preferences |
28 import Preferences |
29 |
29 |
30 |
30 |
31 class HgLogDialog(QWidget, Ui_HgLogDialog): |
31 class HgLogDialog(QWidget, Ui_HgLogDialog): |
32 """ |
32 """ |
33 Class implementing a dialog to show the output of the hg log command process. |
33 Class implementing a dialog to show the output of the hg log command |
|
34 process. |
34 |
35 |
35 The dialog is nonmodal. Clicking a link in the upper text pane shows |
36 The dialog is nonmodal. Clicking a link in the upper text pane shows |
36 a diff of the revisions. |
37 a diff of the revisions. |
37 """ |
38 """ |
38 def __init__(self, vcs, mode="log", bundle=None, isFile=False, parent=None): |
39 def __init__(self, vcs, mode="log", bundle=None, isFile=False, |
|
40 parent=None): |
39 """ |
41 """ |
40 Constructor |
42 Constructor |
41 |
43 |
42 @param vcs reference to the vcs object |
44 @param vcs reference to the vcs object |
43 @param mode mode of the dialog (string; one of log, incoming, outgoing) |
45 @param mode mode of the dialog (string; one of log, incoming, outgoing) |
199 'Ensure, that it is in the search path.' |
201 'Ensure, that it is in the search path.' |
200 ).format('hg')) |
202 ).format('hg')) |
201 |
203 |
202 def __getParents(self, rev): |
204 def __getParents(self, rev): |
203 """ |
205 """ |
204 Private method to get the parents of the currently viewed file/directory. |
206 Private method to get the parents of the currently viewed |
|
207 file/directory. |
205 |
208 |
206 @param rev revision number to get parents for (string) |
209 @param rev revision number to get parents for (string) |
207 @return list of parent revisions (list of strings) |
210 @return list of parent revisions (list of strings) |
208 """ |
211 """ |
209 errMsg = "" |
212 errMsg = "" |
214 args.append("parents") |
217 args.append("parents") |
215 if self.mode == "incoming": |
218 if self.mode == "incoming": |
216 if self.bundle: |
219 if self.bundle: |
217 args.append("--repository") |
220 args.append("--repository") |
218 args.append(self.bundle) |
221 args.append(self.bundle) |
219 elif self.vcs.bundleFile and os.path.exists(self.vcs.bundleFile): |
222 elif self.vcs.bundleFile and \ |
|
223 os.path.exists(self.vcs.bundleFile): |
220 args.append("--repository") |
224 args.append("--repository") |
221 args.append(self.vcs.bundleFile) |
225 args.append(self.vcs.bundleFile) |
222 args.append("--template") |
226 args.append("--template") |
223 args.append("{rev}:{node|short}\n") |
227 args.append("{rev}:{node|short}\n") |
224 args.append("-r") |
228 args.append("-r") |
317 ) |
322 ) |
318 dstr += '<br />\n' |
323 dstr += '<br />\n' |
319 html += dstr |
324 html += dstr |
320 |
325 |
321 if "phase" in entry: |
326 if "phase" in entry: |
322 html += self.trUtf8("Phase: {0}<br />\n").format(entry["phase"]) |
327 html += self.trUtf8("Phase: {0}<br />\n")\ |
323 |
328 .format(entry["phase"]) |
324 html += self.trUtf8("Branches: {0}<br />\n").format(entry["branches"]) |
329 |
|
330 html += self.trUtf8("Branches: {0}<br />\n")\ |
|
331 .format(entry["branches"]) |
325 |
332 |
326 html += self.trUtf8("Tags: {0}<br />\n").format(entry["tags"]) |
333 html += self.trUtf8("Tags: {0}<br />\n").format(entry["tags"]) |
327 |
334 |
328 if "bookmarks" in entry: |
335 if "bookmarks" in entry: |
329 html += self.trUtf8("Bookmarks: {0}<br />\n").format(entry["bookmarks"]) |
336 html += self.trUtf8("Bookmarks: {0}<br />\n")\ |
330 |
337 .format(entry["bookmarks"]) |
331 html += self.trUtf8("Parents: {0}<br />\n").format(entry["parents"]) |
338 |
332 |
339 html += self.trUtf8("Parents: {0}<br />\n")\ |
333 html += self.trUtf8('<i>Author: {0}</i><br />\n').format(entry["user"]) |
340 .format(entry["parents"]) |
|
341 |
|
342 html += self.trUtf8('<i>Author: {0}</i><br />\n')\ |
|
343 .format(entry["user"]) |
334 |
344 |
335 date, time = entry["date"].split()[:2] |
345 date, time = entry["date"].split()[:2] |
336 html += self.trUtf8('<i>Date: {0}, {1}</i><br />\n').format(date, time) |
346 html += self.trUtf8('<i>Date: {0}, {1}</i><br />\n')\ |
|
347 .format(date, time) |
337 |
348 |
338 for line in entry["description"]: |
349 for line in entry["description"]: |
339 html += Utilities.html_encode(line.strip()) |
350 html += Utilities.html_encode(line.strip()) |
340 html += '<br />\n' |
351 html += '<br />\n' |
341 |
352 |
342 if entry["file_adds"]: |
353 if entry["file_adds"]: |
343 html += '<br />\n' |
354 html += '<br />\n' |
344 for f in entry["file_adds"].strip().split(", "): |
355 for f in entry["file_adds"].strip().split(", "): |
345 if f in fileCopies: |
356 if f in fileCopies: |
346 html += self.trUtf8('Added {0} (copied from {1})<br />\n')\ |
357 html += self.trUtf8( |
347 .format(Utilities.html_encode(f), |
358 'Added {0} (copied from {1})<br />\n')\ |
348 Utilities.html_encode(fileCopies[f])) |
359 .format(Utilities.html_encode(f), |
|
360 Utilities.html_encode(fileCopies[f])) |
349 else: |
361 else: |
350 html += self.trUtf8('Added {0}<br />\n')\ |
362 html += self.trUtf8('Added {0}<br />\n')\ |
351 .format(Utilities.html_encode(f)) |
363 .format(Utilities.html_encode(f)) |
352 |
364 |
353 if entry["files_mods"]: |
365 if entry["files_mods"]: |