Plugins/VcsPlugins/vcsMercurial/HgSummaryDialog.py

Sat, 12 Oct 2013 15:01:28 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 12 Oct 2013 15:01:28 +0200
changeset 3008
7848489bcb92
parent 2827
9a7928798cfe
child 3020
542e97d4ecb3
child 3057
10516539f238
permissions
-rw-r--r--

Continued to shorten the code lines to max. 79 characters.

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
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 # Copyright (c) 2013 Detlev Offenbach <detlev@die-offenbachs.de>
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
2816
05aab5164d64 A little optimization for the Mercurial interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2813
diff changeset
13 from PyQt4.QtCore import pyqtSlot, QProcess, QTimer
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from PyQt4.QtGui import QDialog, QDialogButtonBox
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 E5Gui import E5MessageBox
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
2816
05aab5164d64 A little optimization for the Mercurial interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2813
diff changeset
18 from .HgUtilities import prepareProcess
05aab5164d64 A little optimization for the Mercurial interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2813
diff changeset
19
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 from .Ui_HgSummaryDialog import Ui_HgSummaryDialog
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 import Preferences
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
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 class HgSummaryDialog(QDialog, Ui_HgSummaryDialog):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 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
28 directory state.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 def __init__(self, vcs, parent=None):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 Constructor
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param vcs reference to the vcs object
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent parent widget (QWidget)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 super().__init__(parent)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
40 self.refreshButton = self.buttonBox.addButton(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
41 self.trUtf8("Refresh"), QDialogButtonBox.ActionRole)
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
42 self.refreshButton.setToolTip(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
43 self.trUtf8("Press to refresh the summary display"))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.refreshButton.setEnabled(False)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.process = None
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.vcs = vcs
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 self.vcs.committed.connect(self.__committed)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 def closeEvent(self, e):
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 Private slot implementing a close event handler.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 @param e close event (QCloseEvent)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 if self.process is not None and \
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.process.state() != QProcess.NotRunning:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 self.process.terminate()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 QTimer.singleShot(2000, self.process.kill)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 self.process.waitForFinished(3000)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 e.accept()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 def start(self, path, mq=False):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 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
67
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 @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
69 @param mq flag indicating to show the queue status as well (boolean)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 self.errorGroup.hide()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.__path = path
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 self.__mq = mq
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 args = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 args.append('summary')
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.vcs.addArguments(args, self.vcs.options['global'])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 args.append("--remote")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 if self.__mq:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 args.append("--mq")
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 # find the root of the repo
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 repodir = self.__path
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 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
85 repodir = os.path.dirname(repodir)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 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
87 return
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 if self.process:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 self.process.kill()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 self.process = QProcess()
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
93 prepareProcess(self.process, Preferences.getSystem("IOEncoding"),
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
94 "C")
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 self.process.finished.connect(self.__procFinished)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 self.process.readyReadStandardOutput.connect(self.__readStdout)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.process.readyReadStandardError.connect(self.__readStderr)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 self.process.setWorkingDirectory(repodir)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.__buffer = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.process.start('hg', args)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 procStarted = self.process.waitForStarted(5000)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 if not procStarted:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 E5MessageBox.critical(self,
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.trUtf8('Process Generation Error'),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.trUtf8(
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 'The process {0} could not be started. '
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 'Ensure, that it is in the search path.'
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 ).format('hg'))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 def __finish(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 """
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
115 Private slot called when the process finished or the user pressed
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
116 the button.
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 if self.process is not None and \
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.process.state() != QProcess.NotRunning:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.process.terminate()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 QTimer.singleShot(2000, self.process.kill)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.process.waitForFinished(3000)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.refreshButton.setEnabled(True)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.process = None
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 def on_buttonBox_clicked(self, button):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129 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
130
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 @param button button that was clicked (QAbstractButton)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 if button == self.buttonBox.button(QDialogButtonBox.Close):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 self.close()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 elif button == self.refreshButton:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 self.on_refreshButton_clicked()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 def __procFinished(self, exitCode, exitStatus):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 Private slot connected to the finished signal.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 @param exitCode exit code of the process (integer)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 @param exitStatus exit status of the process (QProcess.ExitStatus)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 self.__processOutput(self.__buffer)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 self.__finish()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 def __readStdout(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 Private slot to handle the readyReadStandardOutput signal.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 It reads the output of the process, formats it and inserts it into
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 the contents pane.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 if self.process is not None:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 self.process.setReadChannel(QProcess.StandardOutput)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 while self.process.canReadLine():
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 line = str(self.process.readLine(),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 Preferences.getSystem("IOEncoding"),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 'replace')
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 self.__buffer.append(line)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 def __readStderr(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 Private slot to handle the readyReadStandardError signal.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 It reads the error output of the process and inserts it into the
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 error pane.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 if self.process is not None:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 s = str(self.process.readAllStandardError(),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 Preferences.getSystem("IOEncoding"),
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 'replace')
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 self.__showError(s)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 def __showError(self, out):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 Private slot to show some error.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 @param out error to be shown (string)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 self.errorGroup.show()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 self.errors.insertPlainText(out)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 self.errors.ensureCursorVisible()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 @pyqtSlot()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 def on_refreshButton_clicked(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 Private slot to refresh the status display.
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 self.refreshButton.setEnabled(False)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 self.summary.clear()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 self.start(self.__path, mq=self.__mq)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 def __committed(self):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 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
200 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 if self.isVisible():
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 self.on_refreshButton_clicked()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 def __processOutput(self, output):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 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
207
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 @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
209 """
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 infoDict = {}
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 # step 1: parse the output
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 while output:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 line = output.pop(0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 name, value = line.split(": ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 value = value.strip()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 if name == "parent":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 if " " in value:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 parent, tags = value.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 parent = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 tags = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 rev, node = parent.split(":")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 remarks = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 if tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 if " (empty repository)" in tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 remarks.append("@EMPTY@")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 tags = tags.replace(" (empty repository)", "")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 if " (no revision checked out)" in tags:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 remarks.append("@NO_REVISION@")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 tags = tags.replace(" (no revision checked out)", "")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 tags = None
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 value = infoDict.get(name, [])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 if rev == "-1":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 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
241 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 message = output.pop(0).strip()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 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
244 elif name == "branch":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 pass
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 elif name == "bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 pass
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 elif name == "commit":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 stateDict = {}
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 if "(" in value:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 if value.startswith("("):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 states = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 remark = value[1:-1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 states, remark = value.rsplit(" (", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 remark = remark[:-1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 states = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 remark = ""
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 states = states.split(", ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 for state in states:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 if state:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 count, category = state.split(" ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 stateDict[category] = count
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 value = (stateDict, remark)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 elif name == "update":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 if value.endswith("(current)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 value = ("@CURRENT@", 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 elif value.endswith("(update)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 value = ("@UPDATE@", value.split(" ", 1)[0], 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 elif value.endswith("(merge)"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 parts = value.split(", ")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 value = ("@MERGE@", parts[0].split(" ", 1)[0],
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 parts[1].split(" ", 1)[0])
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 value = ("@UNKNOWN@", 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 elif name == "remote":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 if value == "(synced)":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 value = (0, 0, 0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 inc = incb = outg = outgb = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 for val in value.split(", "):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 count, category = val.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 if category == "outgoing":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 outg = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 elif category.endswith("incoming"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 inc = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 elif category == "incoming bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 incb = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 elif category == "outgoing bookmarks":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 outgb = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 value = (inc, outg, incb, outgb)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 elif name == "mq":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 if value == "(empty queue)":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 value = (0, 0)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 applied = unapplied = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 for val in value.split(", "):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 count, category = val.split(" ", 1)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 if category == "applied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 applied = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 elif category == "unapplied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 unapplied = int(count)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 value = (applied, unapplied)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 # ignore unknown entries
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 continue
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 infoDict[name] = value
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 # step 2: build the output
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 if infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 info = ["<table>"]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 pindex = 0
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 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
316 pindex += 1
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 changeset = "{0}:{1}".format(rev, node)
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 if len(infoDict["parent"]) > 1:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
319 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
320 "<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
321 .format(pindex, changeset))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 else:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
323 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
324 "<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
325 .format(changeset))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 if tags:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
327 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
328 "<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
329 .format('<br/>'.join(tags.split())))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 if message:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
331 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
332 "<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
333 .format(message))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 if remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 rem = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 if "@EMPTY@" in remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 rem.append(self.trUtf8("empty repository"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 if "@NO_REVISION@" in remarks:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 rem.append(self.trUtf8("no revision checked out"))
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
340 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
341 "<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
342 .format(", ".join(rem)))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 if "branch" in infoDict:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
344 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
345 "<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
346 .format(infoDict["branch"]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347 if "bookmarks" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 bookmarks = infoDict["bookmarks"].split()
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 for i in range(len(bookmarks)):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 if bookmarks[i].startswith("*"):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 bookmarks[i] = "<b>{0}</b>".format(bookmarks[i])
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
352 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
353 "<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
354 .format('<br/>'.join(bookmarks)))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 if "commit" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 cinfo = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 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
358 if category == "modified":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 cinfo.append(self.trUtf8("{0} modified").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 elif category == "added":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 cinfo.append(self.trUtf8("{0} added").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 elif category == "removed":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 cinfo.append(self.trUtf8("{0} removed").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 elif category == "renamed":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 cinfo.append(self.trUtf8("{0} renamed").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 elif category == "copied":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 cinfo.append(self.trUtf8("{0} copied").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 elif category == "deleted":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 cinfo.append(self.trUtf8("{0} deleted").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 elif category == "unknown":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 cinfo.append(self.trUtf8("{0} unknown").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 elif category == "ignored":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 cinfo.append(self.trUtf8("{0} ignored").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 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
375 cinfo.append(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
376 self.trUtf8("{0} unresolved").format(count))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 elif category == "subrepos":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 cinfo.append(self.trUtf8("{0} subrepos").format(count))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 remark = infoDict["commit"][1]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 if remark == "merge":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 cinfo.append(self.trUtf8("Merge needed"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 elif remark == "new branch":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 cinfo.append(self.trUtf8("New Branch"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 elif remark == "head closed":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 cinfo.append(self.trUtf8("Head is closed"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 elif remark == "clean":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 cinfo.append(self.trUtf8("No commit required"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 elif remark == "new branch head":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 cinfo.append(self.trUtf8("New Branch Head"))
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
390 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
391 "<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
392 .format("<br/>".join(cinfo)))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 if "update" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 if infoDict["update"][0] == "@CURRENT@":
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 uinfo = self.trUtf8("current")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 elif infoDict["update"][0] == "@UPDATE@":
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
397 uinfo = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
398 "%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
399 infoDict["update"][1])
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 elif infoDict["update"][0] == "@MERGE@":
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
401 uinfo1 = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
402 "%n new changeset(s)", "", infoDict["update"][1])
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
403 uinfo2 = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
404 "%n branch head(s)", "", infoDict["update"][2])
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
405 uinfo = self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
406 "{0}<br/>{1}<br/>Merge required",
2827
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
407 "0 is changesets, 1 is branch heads")\
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
408 .format(uinfo1, uinfo2)
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 uinfo = self.trUtf8("unknown status")
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
411 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
412 "<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
413 .format(uinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 if "remote" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 if infoDict["remote"] == (0, 0, 0, 0):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 rinfo = self.trUtf8("synched")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 l = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 if infoDict["remote"][0]:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 l.append(self.trUtf8("1 or more incoming"))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 if infoDict["remote"][1]:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 l.append(self.trUtf8("{0} outgoing")\
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 .format(infoDict["remote"][1]))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 if infoDict["remote"][2]:
2827
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
425 l.append(self.trUtf8("%n incoming bookmark(s)", "",
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
426 infoDict["remote"][2]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 if infoDict["remote"][3]:
2827
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
428 l.append(self.trUtf8("%n outgoing bookmark(s)", "",
9a7928798cfe Updated translations and corrected some display strings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2816
diff changeset
429 infoDict["remote"][3]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 rinfo = "<br/>".join(l)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
431 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
432 "<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
433 .format(rinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 if "mq" in infoDict:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 if infoDict["mq"] == (0, 0):
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 qinfo = self.trUtf8("empty queue")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 l = []
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 if infoDict["mq"][0]:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
440 l.append(self.trUtf8("{0} applied")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
441 .format(infoDict["mq"][0]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 if infoDict["mq"][1]:
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
443 l.append(self.trUtf8("{0} unapplied")
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
444 .format(infoDict["mq"][1]))
2812
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 qinfo = "<br/>".join(l)
3008
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
446 info.append(self.trUtf8(
7848489bcb92 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2827
diff changeset
447 "<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
448 .format(qinfo))
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 info.append("</table>")
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 else:
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 info = [self.trUtf8("<p>No status information available.</p>")]
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452
35c3302da595 Added forgotten files for the last change.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 self.summary.insertHtml("\n".join(info))

eric ide

mercurial