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