eric6/Plugins/VcsPlugins/vcsMercurial/HgSummaryDialog.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7719
a20dce3647ee
child 7970
c4ee8a81584c
permissions
-rw-r--r--

Updated copyright for 2021.

2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7719
diff changeset
3 # Copyright (c) 2013 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to show some summary information of the working
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 directory state.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import os
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
7719
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
13 from PyQt5.QtCore import pyqtSlot
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
14 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 from .Ui_HgSummaryDialog import Ui_HgSummaryDialog
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 class HgSummaryDialog(QDialog, Ui_HgSummaryDialog):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 Class implementing a dialog to show some summary information of the working
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 directory state.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 def __init__(self, vcs, parent=None):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Constructor
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param vcs reference to the vcs object
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param parent parent widget (QWidget)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
2847
1843ef6e2656 Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2827
diff changeset
31 super(HgSummaryDialog, self).__init__(parent)
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setupUi(self)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
34 self.refreshButton = self.buttonBox.addButton(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
35 self.tr("Refresh"), QDialogButtonBox.ActionRole)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
36 self.refreshButton.setToolTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
37 self.tr("Press to refresh the summary display"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.refreshButton.setEnabled(False)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.vcs = vcs
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.vcs.committed.connect(self.__committed)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
43 def start(self, path, mq=False, largefiles=False):
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 Public slot to start the hg summary command.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 @param path path name of the working directory (string)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 @param mq flag indicating to show the queue status as well (boolean)
3359
6b6c224d67d6 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
49 @param largefiles flag indicating to show the largefiles status as
6b6c224d67d6 Corrected some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3315
diff changeset
50 well (boolean)
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.errorGroup.hide()
4126
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
53 self.refreshButton.setEnabled(False)
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
54 self.summary.clear()
c28d0cf3b639 Some changes to the various VCS interfaces to use one dialog instead of creating a new one each time.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
55
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 self.__path = path
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.__mq = mq
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
58 self.__largefiles = largefiles
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59
3302
e92f0dd51979 Removed the Mercurial support for a command options dialog and added useable global options to the Mercurial config page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3218
diff changeset
60 args = self.vcs.initCommand("summary")
3396
5320ecd70fdb Added support for Mercurial queues summary.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3359
diff changeset
61 if self.vcs.canPull():
5320ecd70fdb Added support for Mercurial queues summary.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3359
diff changeset
62 args.append("--remote")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 if self.__mq:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 args.append("--mq")
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
65 if self.__largefiles:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
66 args.append("--large")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 # find the root of the repo
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 repodir = self.__path
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 repodir = os.path.dirname(repodir)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 if os.path.splitdrive(repodir)[1] == os.sep:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 return
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
7719
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
75 client = self.vcs.getClient()
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
76 output, error = client.runcommand(args)
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
77 if error:
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
78 self.__showError(error)
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
79 else:
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
80 self.__processOutput(output.splitlines())
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 self.refreshButton.setEnabled(True)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 def on_buttonBox_clicked(self, button):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 Private slot called by a button of the button box clicked.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 @param button button that was clicked (QAbstractButton)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 if button == self.buttonBox.button(QDialogButtonBox.Close):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.close()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 elif button == self.refreshButton:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.on_refreshButton_clicked()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 @pyqtSlot()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 def on_refreshButton_clicked(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 Private slot to refresh the status display.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.start(self.__path, mq=self.__mq)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 def __committed(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 Private slot called after the commit has finished.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 if self.isVisible():
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.on_refreshButton_clicked()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
7719
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
109 def __showError(self, out):
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
110 """
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
111 Private slot to show some error.
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
112
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
113 @param out error to be shown (string)
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
114 """
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
115 self.errorGroup.show()
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
116 self.errors.insertPlainText(out)
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
117 self.errors.ensureCursorVisible()
a20dce3647ee Mercurial interface: deleted several calls to the hg executable in favour of the Mercurial server (aka. client).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
118
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 def __processOutput(self, output):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 Private method to process the output into nice readable text.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 @param output output from the summary command (string)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 infoDict = {}
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 # step 1: parse the output
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 while output:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 line = output.pop(0)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
130 if ':' not in line:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
131 continue
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 name, value = line.split(": ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 value = value.strip()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 if name == "parent":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 if " " in value:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 parent, tags = value.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 parent = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 tags = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 rev, node = parent.split(":")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 remarks = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 if tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 if " (empty repository)" in tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 remarks.append("@EMPTY@")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 tags = tags.replace(" (empty repository)", "")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 if " (no revision checked out)" in tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 remarks.append("@NO_REVISION@")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 tags = tags.replace(" (no revision checked out)", "")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 tags = None
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 value = infoDict.get(name, [])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 if rev == "-1":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 value.append((int(rev), node, tags, None, remarks))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 message = output.pop(0).strip()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 value.append((int(rev), node, tags, message, remarks))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 elif name == "branch":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 pass
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 elif name == "bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 pass
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 elif name == "commit":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 stateDict = {}
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 if "(" in value:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 if value.startswith("("):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 states = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 remark = value[1:-1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 states, remark = value.rsplit(" (", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 remark = remark[:-1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 states = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 remark = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 states = states.split(", ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 for state in states:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 if state:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 count, category = state.split(" ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 stateDict[category] = count
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 value = (stateDict, remark)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 elif name == "update":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 if value.endswith("(current)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 value = ("@CURRENT@", 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 elif value.endswith("(update)"):
3218
c33689d92b14 Fixed an issue in the Mercurial summary dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
187 value = ("@UPDATE@", int(value.split(" ", 1)[0]), 0)
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 elif value.endswith("(merge)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 parts = value.split(", ")
3218
c33689d92b14 Fixed an issue in the Mercurial summary dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
190 value = ("@MERGE@", int(parts[0].split(" ", 1)[0]),
c33689d92b14 Fixed an issue in the Mercurial summary dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
191 int(parts[1].split(" ", 1)[0]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 value = ("@UNKNOWN@", 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 elif name == "remote":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 if value == "(synced)":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 value = (0, 0, 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 inc = incb = outg = outgb = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 for val in value.split(", "):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 count, category = val.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 if category == "outgoing":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 outg = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 elif category.endswith("incoming"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 inc = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 elif category == "incoming bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 incb = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 elif category == "outgoing bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 outgb = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 value = (inc, outg, incb, outgb)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 elif name == "mq":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 if value == "(empty queue)":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 value = (0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 applied = unapplied = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 for val in value.split(", "):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 count, category = val.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 if category == "applied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 applied = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 elif category == "unapplied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 unapplied = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 value = (applied, unapplied)
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
222 elif name == "largefiles":
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
223 if not value[0].isdigit():
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
224 value = 0
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
225 else:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
226 value = int(value.split(None, 1)[0])
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 # ignore unknown entries
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 continue
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 infoDict[name] = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 # step 2: build the output
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 if infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 info = ["<table>"]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 pindex = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 for rev, node, tags, message, remarks in infoDict["parent"]:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 pindex += 1
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 changeset = "{0}:{1}".format(rev, node)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 if len(infoDict["parent"]) > 1:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
241 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
242 "<tr><td><b>Parent #{0}</b></td><td>{1}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 .format(pindex, changeset))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
245 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
246 "<tr><td><b>Parent</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 .format(changeset))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 if tags:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
249 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
250 "<tr><td><b>Tags</b></td><td>{0}</td></tr>")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
251 .format('<br/>'.join(tags.split())))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 if message:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
253 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
254 "<tr><td><b>Commit Message</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 .format(message))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 if remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 rem = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 if "@EMPTY@" in remarks:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
259 rem.append(self.tr("empty repository"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 if "@NO_REVISION@" in remarks:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
261 rem.append(self.tr("no revision checked out"))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
262 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
263 "<tr><td><b>Remarks</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 .format(", ".join(rem)))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 if "branch" in infoDict:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
266 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
267 "<tr><td><b>Branch</b></td><td>{0}</td></tr>")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
268 .format(infoDict["branch"]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 if "bookmarks" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 bookmarks = infoDict["bookmarks"].split()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 for i in range(len(bookmarks)):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 if bookmarks[i].startswith("*"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 bookmarks[i] = "<b>{0}</b>".format(bookmarks[i])
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
274 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
275 "<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
276 .format('<br/>'.join(bookmarks)))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 if "commit" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 cinfo = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 for category, count in infoDict["commit"][0].items():
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 if category == "modified":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
281 cinfo.append(self.tr("{0} modified").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 elif category == "added":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
283 cinfo.append(self.tr("{0} added").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 elif category == "removed":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
285 cinfo.append(self.tr("{0} removed").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 elif category == "renamed":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
287 cinfo.append(self.tr("{0} renamed").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 elif category == "copied":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
289 cinfo.append(self.tr("{0} copied").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 elif category == "deleted":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
291 cinfo.append(self.tr("{0} deleted").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 elif category == "unknown":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
293 cinfo.append(self.tr("{0} unknown").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 elif category == "ignored":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
295 cinfo.append(self.tr("{0} ignored").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 elif category == "unresolved":
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
297 cinfo.append(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
298 self.tr("{0} unresolved").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 elif category == "subrepos":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
300 cinfo.append(self.tr("{0} subrepos").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 remark = infoDict["commit"][1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 if remark == "merge":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
303 cinfo.append(self.tr("Merge needed"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 elif remark == "new branch":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
305 cinfo.append(self.tr("New Branch"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 elif remark == "head closed":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
307 cinfo.append(self.tr("Head is closed"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 elif remark == "clean":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
309 cinfo.append(self.tr("No commit required"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 elif remark == "new branch head":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
311 cinfo.append(self.tr("New Branch Head"))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
312 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
313 "<tr><td><b>Commit Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 .format("<br/>".join(cinfo)))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 if "update" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 if infoDict["update"][0] == "@CURRENT@":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
317 uinfo = self.tr("current")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 elif infoDict["update"][0] == "@UPDATE@":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
319 uinfo = self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
320 "%n new changeset(s)<br/>Update required", "",
2827
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
321 infoDict["update"][1])
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 elif infoDict["update"][0] == "@MERGE@":
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
323 uinfo1 = self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
324 "%n new changeset(s)", "", infoDict["update"][1])
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
325 uinfo2 = self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
326 "%n branch head(s)", "", infoDict["update"][2])
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
327 uinfo = self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
328 "{0}<br/>{1}<br/>Merge required",
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
329 "0 is changesets, 1 is branch heads"
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
330 ).format(uinfo1, uinfo2)
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
332 uinfo = self.tr("unknown status")
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
333 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
334 "<tr><td><b>Update Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 .format(uinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 if "remote" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 if infoDict["remote"] == (0, 0, 0, 0):
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
338 rinfo = self.tr("synched")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 else:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
340 li = []
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 if infoDict["remote"][0]:
5579
2afb925a84e6 Recompiled all resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
342 li.append(self.tr("1 or more incoming changesets"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 if infoDict["remote"][1]:
5579
2afb925a84e6 Recompiled all resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
344 li.append(self.tr("%n outgoing changeset(s)", "",
2afb925a84e6 Recompiled all resources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
345 infoDict["remote"][1]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 if infoDict["remote"][2]:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
347 li.append(self.tr("%n incoming bookmark(s)", "",
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
348 infoDict["remote"][2]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 if infoDict["remote"][3]:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
350 li.append(self.tr("%n outgoing bookmark(s)", "",
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
351 infoDict["remote"][3]))
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
352 rinfo = "<br/>".join(li)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
353 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
354 "<tr><td><b>Remote Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 .format(rinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 if "mq" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 if infoDict["mq"] == (0, 0):
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
358 qinfo = self.tr("empty queue")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 else:
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
360 li = []
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 if infoDict["mq"][0]:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
362 li.append(self.tr("{0} applied")
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
363 .format(infoDict["mq"][0]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 if infoDict["mq"][1]:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
365 li.append(self.tr("{0} unapplied")
3034
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
366 .format(infoDict["mq"][1]))
7ce719013078 Fixed various coding style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3023
diff changeset
367 qinfo = "<br/>".join(li)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
368 info.append(self.tr(
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
369 "<tr><td><b>Queues Status</b></td><td>{0}</td></tr>")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 .format(qinfo))
3315
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
371 if "largefiles" in infoDict:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
372 if infoDict["largefiles"] == 0:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
373 lfInfo = self.tr("No files to upload")
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
374 else:
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
375 lfInfo = self.tr("%n file(s) to upload", "",
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
376 infoDict["largefiles"])
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
377 info.append(self.tr(
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
378 "<tr><td><b>Large Files</b></td><td>{0}</td></tr>")
bd1a25ead18d Continued implementing support for Mercurial largefiles.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3302
diff changeset
379 .format(lfInfo))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 info.append("</table>")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
382 info = [self.tr("<p>No status information available.</p>")]
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 self.summary.insertHtml("\n".join(info))

eric ide

mercurial