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

status: fix behavior in rev-diff and MQ modes

Changeset 26821ff3a5e3

Parent 20e7872e8ff2

by Steve Borho

Changes to one file · Browse files at 26821ff3a5e3 Showing diff from parent 20e7872e8ff2 Diff from another changeset...

Change 1 of 5 Show Entire File hggtk/​status.py Stacked
 
143
144
145
146
147
 
 
 
 
 
 
 
 
 
148
149
150
 
180
181
182
183
184
185
186
187
188
189
190
191
 
 
 
 
 
 
 
 
 
 
 
 
192
193
194
 
209
210
211
 
 
 
212
213
214
 
509
510
511
512
 
513
514
515
 
1316
1317
1318
1319
 
 
1320
1321
1322
 
143
144
145
 
 
146
147
148
149
150
151
152
153
154
155
156
157
 
187
188
189
 
 
 
 
 
 
 
 
 
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
 
219
220
221
222
223
224
225
226
227
 
522
523
524
 
525
526
527
528
 
1329
1330
1331
 
1332
1333
1334
1335
1336
@@ -143,8 +143,15 @@
      def get_title(self): - return os.path.basename(self.repo.root) + ' status ' + ':'.join(self.opts['rev'])\ - + ' ' + ' '.join(self.pats) + root = os.path.basename(self.repo.root) + revs = self.opts.get('rev') + if revs: + return root + ' status ' + ':'.join(revs) + ' ' + ' '.join(self.pats) + elif self.mqmode: + patch = self.repo.mq.lookup('qtip') + return root + ' applied MQ patch ' + patch + else: + return root + ' status ' + ' '.join(self.pats)     def get_icon(self):   return 'menushowchanged.ico' @@ -180,15 +187,18 @@
  self._showdiff_toggled )   tbuttons.append(self.showdiff_toggle)   - self.shelve_btn = self.make_toolbutton(gtk.STOCK_FILE, 'Shelve', - self._shelve_clicked, tip='set aside selected changes') - self.unshelve_btn = self.make_toolbutton(gtk.STOCK_EDIT, 'Unshelve', - self._unshelve_clicked, tip='restore shelved changes') - tbuttons += [ - gtk.SeparatorToolItem(), - self.shelve_btn, - self.unshelve_btn, - ] + # Shelving does not work when visualizing diffs between + # revisions (though this could eventually be made to work) + if not self.opts.get('rev'): + self.shelve_btn = self.make_toolbutton(gtk.STOCK_FILE, 'Shelve', + self._shelve_clicked, tip='set aside selected changes') + self.unshelve_btn = self.make_toolbutton(gtk.STOCK_EDIT, 'Unshelve', + self._unshelve_clicked, tip='restore shelved changes') + tbuttons += [ + gtk.SeparatorToolItem(), + self.shelve_btn, + self.unshelve_btn, + ]     return tbuttons   @@ -209,6 +219,9 @@
  else:   self._setting_pos = 64000   self._setting_lastpos = 270 + self.mqmode = None + if hasattr(self.repo, 'mq') and self.repo.mq.applied: + self.mqmode = True       def get_body(self): @@ -509,7 +522,7 @@
  # The following code was copied from the status function in mercurial\commands.py   # and modified slightly to work here   - if hasattr(self.repo, 'mq') and self.repo.mq.applied: + if self.mqmode and not self.opts.get('rev'):   # when a patch is applied, show diffs to parent of top patch   self._node1 = self.repo.lookup(-3)   self._node2 = None @@ -1316,7 +1329,8 @@
  cmdoptions = {   'all':False, 'clean':False, 'ignored':False, 'modified':True,   'added':True, 'removed':True, 'deleted':True, 'unknown':True, 'rev':[], - 'exclude':[], 'include':[], 'debug':True,'verbose':True,'git':False + 'exclude':[], 'include':[], 'debug':True, 'verbose':True, 'git':False, + 'check':True   }     dialog = GStatus(u, repo, cwd, files, cmdoptions, True)