Commits

Yuya Nishihara  committed ab7ab6a

correct fix for revset

  • Participants
  • Parent commits 01613f9

Comments (0)

Files changed (3)

File 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:

File 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