Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

thgshelve: implement single file shelve operation

Changeset 39b1a7f2bb62

Parent 9febe2a49bb1

by Steve Borho

Changes to one file · Browse files at 39b1a7f2bb62 Showing diff from parent 9febe2a49bb1 Diff from another changeset...

 
127
128
129
130
 
131
 
132
 
 
133
134
135
 
156
157
158
159
 
160
161
162
 
195
196
197
198
 
 
199
200
201
 
127
128
129
 
130
131
132
133
134
135
136
137
138
 
159
160
161
 
162
163
164
165
 
198
199
200
 
201
202
203
204
205
@@ -127,9 +127,12 @@
  self.shelve_btn.set_sensitive(False)   self.unshelve_btn.set_sensitive(False)   - def _shelve_selected(self): + def _shelve_selected(self, file=None):   # get list of hunks that have not been rejected + chunks = self._shelve_chunks   hlist = [x[DM_CHUNK_ID] for x in self.diff_model if not x[DM_REJECTED]] + if file: + hlist = [cid for cid in hlist if chunks[cid].filename() == file]   if not hlist:   Prompt('Shelve', 'Please select diff chunks to shelve',   self).run() @@ -156,7 +159,7 @@
  # capture the selected hunks to shelve   fc = []   sc = [] - for n, c in enumerate(self._shelve_chunks): + for n, c in enumerate(chunks):   if isinstance(c, hgshelve.header):   if len(fc) > 1 or (len(fc) == 1 and fc[0].binary()):   sc += fc @@ -195,7 +198,8 @@
  self._activate_shelve_buttons(True)     def _shelve_file(self, stat, file): - self._hg_shelve([file]) + self._shelve_selected(file) + self._activate_shelve_buttons(True)   return True