Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

thgstrip: check local changes and show prompt to discard them

Changeset 31ca7a9d5031

Parent d34b5871f38f

by Yuki KODAMA

Changes to one file · Browse files at 31ca7a9d5031 Showing diff from parent d34b5871f38f Diff from another changeset...

 
296
297
298
 
 
 
 
299
300
 
 
 
 
 
 
 
 
 
 
 
301
302
303
 
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
@@ -296,8 +296,23 @@
  self.abortbtn.set_property('visible', working)     def strip(self): + def isclean(): + '''whether WD is changed''' + wc = self.repo[None] + return not (wc.modified() or wc.added() or wc.removed())   revstr = self.revcombo.get_active_text()   cmdline = ['hg', 'strip', '--verbose', revstr] + # check uncommitted changes + if not isclean(): + ret = gdialog.CustomPrompt(_('Confirm Strip'), + _('Detected uncommitted local changes.\nDo' + ' you want to discard them and continue?'), + self, (_('&Yes (--force)'), _('&No')), + default=1, esc=1).run() + if ret == 0: + cmdline.append('--force') + else: + return   def cmd_done(returncode, useraborted):   self.switch_to(MODE_NORMAL, cmd=False)   if returncode == 0: