Commits

Yuya Nishihara committed a90c954

finalize some patches

  • Participants
  • Parent commits 861e980

Comments (0)

Files changed (9)

repof-comboapi.diff

-# HG changeset patch
-# Parent aa4eae37ead4b8e75a7bf69fa20fcf80ffc86205
-repofilter: use QComboBox API to access query text
-
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -113,8 +113,8 @@ class RepoFilterBar(QToolBar):
-         self.refresh()
- 
-     def onClearButtonClicked(self):
--        if self.revsetcombo.lineEdit().text():
--            self.revsetcombo.lineEdit().clear()
-+        if self.revsetcombo.currentText():
-+            self.revsetcombo.clearEditText()
-         else:
-             self.hide()
-         self.clearRevisionSet.emit()
-@@ -146,10 +146,10 @@ class RepoFilterBar(QToolBar):
- 
-     def showEvent(self, event):
-         super(RepoFilterBar, self).showEvent(event)
--        self.revsetcombo.lineEdit().setFocus()
-+        self.revsetcombo.setFocus()
- 
-     def openEditor(self):
--        query = self.revsetcombo.lineEdit().text().simplified()
-+        query = self.revsetcombo.currentText().simplified()
-         self.entrydlg.entry.setText(query)
-         self.entrydlg.entry.setCursorPosition(0, len(query))
-         self.entrydlg.entry.setFocus()
-@@ -158,12 +158,12 @@ class RepoFilterBar(QToolBar):
-     @pyqtSlot(int)
-     def comboSelectionActivated(self, row):
-         text = self.revsetcombo.itemText(row)
--        self.revsetcombo.lineEdit().setText(text)
-+        self.revsetcombo.setEditText(text)
-         self.entrydlg.entry.setText(text)
-         self.entrydlg.runQuery()
- 
-     def queryIssued(self, query, revset):
--        self.revsetcombo.lineEdit().setText(query)
-+        self.revsetcombo.setEditText(query)
-         if revset:
-             self.setRevisionSet.emit(revset)
-         else:
-@@ -173,7 +173,7 @@ class RepoFilterBar(QToolBar):
- 
-     def returnPressed(self):
-         'Return pressed on revset line entry, forward to dialog'
--        query = self.revsetcombo.lineEdit().text().simplified()
-+        query = self.revsetcombo.currentText().simplified()
-         if query:
-             self.entrydlg.entry.setText(query)
-             self.entrydlg.runQuery()
-@@ -181,7 +181,7 @@ class RepoFilterBar(QToolBar):
-             self.clearRevisionSet.emit()
- 
-     def saveQuery(self):
--        query = self.revsetcombo.lineEdit().text()
-+        query = self.revsetcombo.currentText()
-         if query in self.revsethist:
-             self.revsethist.remove(query)
-         if query not in self._permanent_queries:

repof-extracopy.diff

-# HG changeset patch
-# Parent 52aa501f2f5519508170e4cc975fe0cc169fbc35
-repofilter: remove extra code to copy activated query text to itself
-
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -157,8 +157,7 @@ class RepoFilterBar(QToolBar):
- 
-     @pyqtSlot(int)
-     def comboSelectionActivated(self, row):
--        text = self.revsetcombo.itemText(row)
--        self.revsetcombo.setEditText(text)
-+        text = self.revsetcombo.currentText()
-         self.entrydlg.entry.setText(text)
-         self.entrydlg.runQuery()
- 

repof-uniq-rename.diff

-# HG changeset patch
-# Parent bf0ea9caabc8e99fe7840228428c7ff2861da02d
-
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -65,11 +65,11 @@ class RepoFilterBar(QToolBar):
-         combo.setMinimumContentsLength(10)
-         qtlib.allowCaseChangingInput(combo)
-         le = combo.lineEdit()
--        le.returnPressed.connect(self.returnPressed)
-+        le.returnPressed.connect(self.runQuery)
-         le.selectionChanged.connect(self.selectionChanged)
-         if hasattr(le, 'setPlaceholderText'): # Qt >= 4.7
-             le.setPlaceholderText(_('### revision set query ###'))
--        combo.activated.connect(self.returnPressed)
-+        combo.activated.connect(self.runQuery)
-         self.revsetle = le
- 
-         self.clearBtn = QToolButton(self)
-@@ -84,7 +84,7 @@ class RepoFilterBar(QToolBar):
-         self.searchBtn = QToolButton(self)
-         self.searchBtn.setIcon(qtlib.geticon('view-filter'))
-         self.searchBtn.setToolTip(_('Trigger revision set query'))
--        self.searchBtn.clicked.connect(self.returnPressed)
-+        self.searchBtn.clicked.connect(self.runQuery)
-         self.addWidget(self.searchBtn)
- 
-         self.editorBtn = QToolButton()
-@@ -165,8 +165,8 @@ class RepoFilterBar(QToolBar):
-         self.revsetcombo.lineEdit().selectAll()
- 
-     @pyqtSlot()
--    def returnPressed(self):
--        'Return pressed on revset line entry, forward to dialog'
-+    def runQuery(self):
-+        'Run revset query if exists; otherwise request to clear revset'
-         query = self.revsetcombo.currentText().simplified()
-         if query:
-             self.entrydlg.entry.setText(query)
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -467,7 +467,7 @@ class RepoWidget(QWidget):
-     def setFilter(self, filter):
-         self.filterbar.revsetle.setText(filter)
-         self.filterbar.setVisible(True)
--        self.filterbar.returnPressed()
-+        self.filterbar.runQuery()
- 
-     @pyqtSlot(QString, QString)
-     def setBundle(self, bfile, bsource=None):

repof-uniq.diff

-# HG changeset patch
-# Parent e70aae99600b206682ef680f366ceff85f7f185b
-
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -69,7 +69,7 @@ class RepoFilterBar(QToolBar):
-         le.selectionChanged.connect(self.selectionChanged)
-         if hasattr(le, 'setPlaceholderText'): # Qt >= 4.7
-             le.setPlaceholderText(_('### revision set query ###'))
--        combo.activated.connect(self.comboSelectionActivated)
-+        combo.activated.connect(self.returnPressed)
-         self.revsetle = le
- 
-         self.clearBtn = QToolButton(self)
-@@ -155,12 +155,6 @@ class RepoFilterBar(QToolBar):
-         self.entrydlg.entry.setFocus()
-         self.entrydlg.setShown(True)
- 
--    @pyqtSlot(int)
--    def comboSelectionActivated(self, row):
--        text = self.revsetcombo.currentText()
--        self.entrydlg.entry.setText(text)
--        self.entrydlg.runQuery()
--
-     def queryIssued(self, query, revset):
-         self.revsetcombo.setEditText(query)
-         if revset:
-@@ -170,6 +164,7 @@ class RepoFilterBar(QToolBar):
-         self.saveQuery()
-         self.revsetcombo.lineEdit().selectAll()
- 
-+    @pyqtSlot()
-     def returnPressed(self):
-         'Return pressed on revset line entry, forward to dialog'
-         query = self.revsetcombo.currentText().simplified()

repof-usepyuni.diff

 # HG changeset patch
-# Parent 889582dba8de5705d69bb53e51a7615d8d812560
+# Parent 9659aaf2045a32dfe28d5de5e58fb691d79dcb50
+
 diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
 --- a/tortoisehg/hgqt/repofilter.py
 +++ b/tortoisehg/hgqt/repofilter.py
-@@ -167,7 +167,7 @@ class RepoFilterBar(QToolBar):
+@@ -169,7 +169,7 @@ class RepoFilterBar(QToolBar):
      @pyqtSlot()
      def runQuery(self):
-         'Run revset query if exists; otherwise request to clear revset'
+         'Run the current revset query or request to clear the previous result'
 -        query = self.revsetcombo.currentText().simplified()
 +        query = unicode(self.revsetcombo.currentText()).strip()
          if query:

repof-utilize.diff

-# HG changeset patch
-# Parent e70aae99600b206682ef680f366ceff85f7f185b
-diff --git a/tortoisehg/hgqt/workbench.py b/tortoisehg/hgqt/workbench.py
---- a/tortoisehg/hgqt/workbench.py
-+++ b/tortoisehg/hgqt/workbench.py
-@@ -595,8 +595,7 @@ class Workbench(QMainWindow):
-         for i in xrange(self.repoTabsWidget.count()):
-             w = self.repoTabsWidget.widget(i)
-             if hglib.tounicode(w.repo.root) == path:
--                w.filterbar.revsetle.setText(filter)
--                w.filterbar.returnPressed()
-+                w.setFilter(filter)
-                 return
- 
-     def find_root(self, url):

revset-lightlist.diff

-# HG changeset patch
-# Parent 7cc314e34b6aa375bb92b1e659e43f33361cebd1
-diff --git a/tortoisehg/hgqt/revset.py b/tortoisehg/hgqt/revset.py
---- a/tortoisehg/hgqt/revset.py
-+++ b/tortoisehg/hgqt/revset.py
-@@ -394,9 +394,7 @@ class RevsetThread(QThread):
-         try:
-             os.chdir(self.repo.root)
-             func = revset.match(self.repo.ui, self.text)
--            l = []
--            for c in func(self.repo, list(self.repo)):
--                l.append(c)
-+            l = list(func(self.repo, list(self.repo)))
-             if len(l):
-                 self.showMessage.emit(_('%d matches found') % len(l))
-             else:

revset-rangefix.diff

-# HG changeset patch
-# Date 1362834914 -32400
-# Parent 3f240b2585bcffd6eff8df7c5d9e1db03c19535c
-revset: match against valid list of revisions (follows hg 8575f4a2126e)
-
-`range(len(repo))` may be invalid if there are hidden changesets. It will
-cause LookupError.
-
-diff --git a/tortoisehg/hgqt/matching.py b/tortoisehg/hgqt/matching.py
---- a/tortoisehg/hgqt/matching.py
-+++ b/tortoisehg/hgqt/matching.py
-@@ -208,7 +208,7 @@ class MatchDialog(QDialog):
-         validrevset = False
-         try:
-             func = revset.match(self.repo.ui, new_rev)
--            rset = [c for c in func(self.repo, range(len(self.repo)))]
-+            rset = [c for c in func(self.repo, list(self.repo))]
-             if len(rset) > 1:
-                 self.rev_to_match_info_lbl.setText(_('Revisions to Match:'))
-                 csinfo_set_text(_('Match any of <b><i>%d</i></b> revisions') \
-diff --git a/tortoisehg/hgqt/revset.py b/tortoisehg/hgqt/revset.py
---- a/tortoisehg/hgqt/revset.py
-+++ b/tortoisehg/hgqt/revset.py
-@@ -395,7 +395,7 @@ class RevsetThread(QThread):
-             os.chdir(self.repo.root)
-             func = revset.match(self.repo.ui, self.text)
-             l = []
--            for c in func(self.repo, range(len(self.repo))):
-+            for c in func(self.repo, list(self.repo)):
-                 l.append(c)
-             if len(l):
-                 self.showMessage.emit(_('%d matches found') % len(l))
-revset-rangefix.diff
-revset-lightlist.diff
-repof-comboapi.diff
-repof-extracopy.diff
-repof-utilize.diff
-repof-uniq.diff
-repof-uniq-rename.diff
 repof-usepyuni.diff
 repof-returnearly.diff
 repof-movehack.diff