Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

manifestmodel: make indexFromPath accept QString

Changeset c4f831a65125

Parent db7648fa51d4

by Yuya Nishihara

Changes to 2 files · Browse files at c4f831a65125 Showing diff from parent db7648fa51d4 Diff from another changeset...

 
1
2
 
3
4
5
 
72
73
74
 
 
 
 
75
76
77
 
1
 
2
3
4
5
 
72
73
74
75
76
77
78
79
80
81
@@ -1,5 +1,5 @@
 from nose.tools import * -from PyQt4.QtCore import QModelIndex +from PyQt4.QtCore import QModelIndex, QString  from tortoisehg.hgqt.manifestmodel import ManifestModel  from tests import get_fixture_repo, with_encoding   @@ -72,6 +72,10 @@
  assert_equals(m.index(0, 0), m.indexFromPath('baz'))   assert_equals(m.index(0, 0, m.index(0, 0)), m.indexFromPath('baz/bax'))   +def test_indexfrompath_qstr(): + m = newmodel() + assert_equals(m.index(1, 0), m.indexFromPath(QString('bar'))) +  @with_encoding('euc-jp')  def test_indexfrompath_eucjp():   m = newmodel(name='euc-jp-path')
 
122
123
124
125
 
126
127
128
 
122
123
124
 
125
126
127
128
@@ -122,7 +122,7 @@
  return QModelIndex()     e = self._rootentry - paths = path and path.split('/') or [] + paths = path and unicode(path).split('/') or []   try:   for p in paths:   e = e[p]