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

status: add method to WctxModel to retrieve original path

Avoids the loop through unicode, use the raw path we received from Mercurial

Changeset 45469bf20d70

Parent 5858b05ccc0b

by Steve Borho

Changes to one file · Browse files at 45469bf20d70 Showing diff from parent 5858b05ccc0b Diff from another changeset...

 
100
101
102
103
104
 
105
106
107
 
117
118
119
 
 
 
 
120
121
122
123
124
125
 
126
127
 
128
129
 
130
131
 
132
133
 
134
135
136
 
137
138
 
139
140
141
142
 
143
144
145
 
149
150
151
152
 
153
154
155
156
157
158
 
 
 
 
159
160
161
 
100
101
102
 
 
103
104
105
106
 
116
117
118
119
120
121
122
123
124
125
126
127
 
128
129
 
130
131
 
132
133
 
134
135
 
136
137
138
 
139
140
 
141
142
143
144
 
145
146
147
148
 
152
153
154
 
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@@ -100,8 +100,7 @@
  self.tv.resizeColumnToContents(1)     def rowSelected(self, index): - pfile = index.sibling(index.row(), 1).data().toString() - pfile = hglib.fromunicode(pfile) + pfile = index.model().getPath(index)   wfile = util.pconvert(pfile)   hu = htmlui.htmlui()   try: @@ -117,29 +116,33 @@
  self.te.setHtml(o)     +COL_STATUS = 0 +COL_PATH_DISPLAY = 1 +COL_PATH = 2 +  class WctxModel(QAbstractTableModel):   def __init__(self, wctx, parent=None):   QAbstractTableModel.__init__(self, parent)   rows = []   for m in wctx.modified(): - rows.append(('M', m)) + rows.append(('M', hglib.tounicode(m), m))   for a in wctx.added(): - rows.append(('A', a)) + rows.append(('A', hglib.tounicode(a), a))   for r in wctx.removed(): - rows.append(('R', r)) + rows.append(('R', hglib.tounicode(r), r))   for d in wctx.deleted(): - rows.append(('!', d)) + rows.append(('!', hglib.tounicode(d), d))   for u in wctx.unknown(): - rows.append(('?', u)) + rows.append(('?', hglib.tounicode(u), u))   # TODO: wctx.ignored() does not exist   #for i in wctx.ignored(): - # rows.append(('I', i)) + # rows.append(('I', hglib.tounicode(i), i))   for c in wctx.clean(): - rows.append(('C', c)) + rows.append(('C', hglib.tounicode(c), c))   try:   for s in wctx.substate:   if wctx.sub(s).dirty(): - rows.append(('S', s)) + rows.append(('S', hglib.tounicode(s), s))   except (OSError, IOError, error.ConfigError), e:   self.status_error = str(e)   self.rows = rows @@ -149,13 +152,17 @@
  return len(self.rows)     def columnCount(self, parent): - return 2 + return len(self.headers)     def data(self, index, role):   if not index.isValid() or role != Qt.DisplayRole:   return QVariant()   return QVariant(self.rows[index.row()][index.column()])   + def getPath(self, index): + assert index.isValid() + return self.rows[index.row()][COL_PATH] +   def headerData(self, col, orientation, role):   if role != Qt.DisplayRole or orientation != Qt.Horizontal:   return QVariant()