Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable qreorder: Show patch description on patch list

Changeset 08a1010521ce

Parent 35e27b5924eb

by Angel Ezquerra

Changes to one file · Browse files at 08a1010521ce Showing diff from parent 35e27b5924eb Diff from another changeset...

 
147
148
149
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
152
153
 
169
170
171
172
173
 
 
 
174
175
176
 
182
183
184
185
 
186
187
188
 
189
190
191
 
147
148
149
 
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
 
182
183
184
 
 
185
186
187
188
189
190
 
196
197
198
 
199
200
201
 
202
203
204
205
@@ -147,7 +147,20 @@
  ulw.clear()   alw.clear()   for p in reversed(patchnames): - item = QListWidgetItem(hglib.tounicode(p)) + # Each row in the patch list has the + # format [patchname] patchdescription + # The patch description is the first line of the patch message + # If the message has more than one line, we add "..." to the first + # line to create the patch description + patchmessage = mq.patchheader(self.repo.mq.join(p)).message + patchdesc = patchmessage[0] + if len(patchmessage) > 1: + patchdesc = patchdesc + '...' + item = QListWidgetItem('[%s]\t%s' % (hglib.tounicode(p), hglib.tounicode(patchdesc))) + # Save the patchname with the item so that we can easily + # retrieve it later + item.patchname = p +   if p in applied:   item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)   item.setForeground(QColor(111,111,111)) # gray, like disabled @@ -169,8 +182,9 @@
    def showSummary(self, item):   try: - patchname = hglib.fromunicode(item.text()) - txt = '\n'.join(mq.patchheader(self.repo.mq.join(patchname)).message) + # Note that item.patchname uses the local encoding and hence does + # not need to be converted from unicode + txt = '\n'.join(mq.patchheader(self.repo.mq.join(item.patchname)).message)   self.summ.setText(hglib.tounicode(txt))   except:   pass @@ -182,10 +196,10 @@
  lines = []   for i in xrange(self.alw.count()-1, -1, -1):   item = self.alw.item(i) - lines.append(hglib.fromunicode(item.text())) + lines.append(item.patchname)   for i in xrange(self.ulw.count()-1, -1, -1):   item = self.ulw.item(i) - lines.append(hglib.fromunicode(item.text())) + lines.append(item.patchname)   if lines:   fp = self.repo.mq.opener('series', 'wb')   fp.write('\n'.join(lines))