562 self.__revColors[rev] = self.__revColor |
562 self.__revColors[rev] = self.__revColor |
563 self.__revColor += 1 |
563 self.__revColor += 1 |
564 |
564 |
565 col = self.__revs.index(rev) |
565 col = self.__revs.index(rev) |
566 color = self.__revColors.pop(rev) |
566 color = self.__revColors.pop(rev) |
567 next = self.__revs[:] |
567 nextRevs = self.__revs[:] |
568 |
568 |
569 # add parents to next |
569 # add parents to next |
570 addparents = [p for p in parents if p not in next] |
570 addparents = [p for p in parents if p not in nextRevs] |
571 next[col:col + 1] = addparents |
571 nextRevs[col:col + 1] = addparents |
572 |
572 |
573 # set colors for the parents |
573 # set colors for the parents |
574 for i, p in enumerate(addparents): |
574 for i, p in enumerate(addparents): |
575 if not i: |
575 if not i: |
576 self.__revColors[p] = color |
576 self.__revColors[p] = color |
580 |
580 |
581 # add edges to the graph |
581 # add edges to the graph |
582 edges = [] |
582 edges = [] |
583 if parents[0] != -1: |
583 if parents[0] != -1: |
584 for ecol, erev in enumerate(self.__revs): |
584 for ecol, erev in enumerate(self.__revs): |
585 if erev in next: |
585 if erev in nextRevs: |
586 edges.append( |
586 edges.append( |
587 (ecol, next.index(erev), self.__revColors[erev])) |
587 (ecol, nextRevs.index(erev), self.__revColors[erev])) |
588 elif erev == rev: |
588 elif erev == rev: |
589 for p in parents: |
589 for p in parents: |
590 edges.append( |
590 edges.append( |
591 (ecol, next.index(p), self.__revColors[p])) |
591 (ecol, nextRevs.index(p), self.__revColors[p])) |
592 |
592 |
593 self.__revs = next |
593 self.__revs = nextRevs |
594 return col, color, edges |
594 return col, color, edges |
595 |
595 |
596 def __generateIcon(self, column, color, bottomedges, topedges, dotColor, |
596 def __generateIcon(self, column, color, bottomedges, topedges, dotColor, |
597 currentRev, closed): |
597 currentRev, closed): |
598 """ |
598 """ |
1971 @pyqtSlot() |
1971 @pyqtSlot() |
1972 def on_sendButton_clicked(self): |
1972 def on_sendButton_clicked(self): |
1973 """ |
1973 """ |
1974 Private slot to send the input to the mercurial process. |
1974 Private slot to send the input to the mercurial process. |
1975 """ |
1975 """ |
1976 input = self.input.text() |
1976 inputTxt = self.input.text() |
1977 input += os.linesep |
1977 inputTxt += os.linesep |
1978 |
1978 |
1979 if self.passwordCheckBox.isChecked(): |
1979 if self.passwordCheckBox.isChecked(): |
1980 self.errors.insertPlainText(os.linesep) |
1980 self.errors.insertPlainText(os.linesep) |
1981 self.errors.ensureCursorVisible() |
1981 self.errors.ensureCursorVisible() |
1982 else: |
1982 else: |
1983 self.errors.insertPlainText(input) |
1983 self.errors.insertPlainText(inputTxt) |
1984 self.errors.ensureCursorVisible() |
1984 self.errors.ensureCursorVisible() |
1985 |
1985 |
1986 self.process.write(input) |
1986 self.process.write(inputTxt) |
1987 |
1987 |
1988 self.passwordCheckBox.setChecked(False) |
1988 self.passwordCheckBox.setChecked(False) |
1989 self.input.clear() |
1989 self.input.clear() |
1990 |
1990 |
1991 def on_input_returnPressed(self): |
1991 def on_input_returnPressed(self): |