Plugins/VcsPlugins/vcsMercurial/HgDialog.py

changeset 694
d482fc1249b0
parent 661
f9d49e0c2522
child 791
9ec2ac20e54e
equal deleted inserted replaced
692:5c2d7b6d47cb 694:d482fc1249b0
67 67
68 if Preferences.getVCS("AutoClose") and \ 68 if Preferences.getVCS("AutoClose") and \
69 self.normal and \ 69 self.normal and \
70 self.errors.toPlainText() == "": 70 self.errors.toPlainText() == "":
71 self.accept() 71 self.accept()
72
73 if self.__updateCommand and self.normal:
74 # check, if we had additions or deletions
75 lastLine = self.resultbox.toPlainText().splitlines()[-1]
76 if lastLine and lastLine.strip()[0] in "0123456789":
77 adds, merges, deletes, conflicts = \
78 [int(a.split()[0]) for a in lastLine.split(",")]
79 self.__hasAddOrDelete = adds > 0 or deletes > 0
80 72
81 def on_buttonBox_clicked(self, button): 73 def on_buttonBox_clicked(self, button):
82 """ 74 """
83 Private slot called by a button of the button box clicked. 75 Private slot called by a button of the button box clicked.
84 76
175 s = str(self.proc.readAllStandardOutput(), 167 s = str(self.proc.readAllStandardOutput(),
176 Preferences.getSystem("IOEncoding"), 168 Preferences.getSystem("IOEncoding"),
177 'replace') 169 'replace')
178 self.resultbox.insertPlainText(s) 170 self.resultbox.insertPlainText(s)
179 self.resultbox.ensureCursorVisible() 171 self.resultbox.ensureCursorVisible()
172
173 # check for a changed project file
174 if self.__updateCommand:
175 for line in s.splitlines():
176 if '.e4p' in line:
177 self.__hasAddOrDelete = True
178 break
180 179
181 def __readStderr(self): 180 def __readStderr(self):
182 """ 181 """
183 Private slot to handle the readyReadStandardError signal. 182 Private slot to handle the readyReadStandardError signal.
184 183

eric ide

mercurial