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

stable history: use hgcmd for outgoing requests

User will now see a nice list of outgoing changeset hashes, but hgcmd provides
interactivity in case a password is required to discover the outgoing changeset
list.

Makes the stop button obsolete, so it was removed. We also no longer need the
Queue or thread2 modules

Fixes #698

Changeset fc43a344f860

Parent 658f0adb3202

by Steve Borho

Changes to one file · Browse files at fc43a344f860 Showing diff from parent 658f0adb3202 Diff from another changeset...

 
10
11
12
13
14
15
16
 
18
19
20
21
 
22
23
24
 
916
917
918
919
920
921
922
923
924
925
926
927
928
929
 
1314
1315
1316
1317
1318
 
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
 
 
 
 
 
 
 
 
 
1331
1332
 
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
 
 
 
 
1357
1358
1359
 
10
11
12
 
13
14
15
 
17
18
19
 
20
21
22
23
 
915
916
917
 
 
 
918
 
919
920
 
921
922
923
 
1308
1309
1310
 
 
1311
1312
1313
1314
 
 
 
 
 
 
 
 
 
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
 
1325
1326
1327
1328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1329
1330
1331
1332
1333
1334
1335
@@ -10,7 +10,6 @@
 import sys  import gtk  import gobject -import Queue  import shutil  import tempfile  import atexit @@ -18,7 +17,7 @@
 from mercurial import ui, hg, cmdutil, commands, extensions, util, match, url    from tortoisehg.util.i18n import _ -from tortoisehg.util import hglib, thread2 +from tortoisehg.util import hglib    from tortoisehg.hgtk.logview.treeview import TreeView as LogTreeView   @@ -916,14 +915,9 @@
  _('Push outgoing changesets'))   email = syncbox.append_stock(gtk.STOCK_GOTO_LAST,   _('Email outgoing changesets')) - syncbox.append_widget(gtk.VSeparator()) - stop = syncbox.append_stock(gtk.STOCK_STOP, - _('Stop current transaction'))   - stop.set_sensitive(False)   apply.set_sensitive(False)   reject.set_sensitive(False) - self.stop_button = stop   self.syncbar_apply = apply   self.syncbar_reject = reject   @@ -1314,46 +1308,28 @@
  self).run()   self.pathentry.grab_focus()   return - q = Queue.Queue() - cmd = [q, 'outgoing', '--quiet', '--template', '{node}\n'] + cmd = ['hg', 'outgoing', '--quiet', '--template', '{node}\n']   cmd += self.get_proxy_args()   cmd += [hglib.validate_synch_path(path, self.repo)]   - def threadfunc(q, *args): - try: - hglib.hgcmd_toq(q, *args) - except (util.Abort, hglib.RepoError), e: - self.stbar.set_status_text(_('Abort: %s') % str(e)) - - def out_wait(): - while q.qsize(): - hash = q.get(0).strip() + dlg = hgcmd.CmdDialog(cmd, text='hg outgoing') + dlg.show_all() + dlg.run() + dlg.hide() + if dlg.return_code() == 0: + outgoing = [] + buf = dlg.textbuffer + begin, end = buf.get_bounds() + for line in buf.get_text(begin, end).splitlines()[:-1]:   try: - node = self.repo[hash].node() + node = self.repo[line].node()   outgoing.append(node)   except:   pass - if thread.isAlive(): - return True - else: - self.stbar.end() - self.outgoing = outgoing - self.reload_log() - text = _('%d outgoing changesets') % len(outgoing) - self.stbar.set_idle_text(text) - self.stop_button.disconnect(stop_handler) - self.stop_button.set_sensitive(False) - - def stop_clicked(button): - thread.terminate() - - outgoing = [] - thread = thread2.Thread(target=threadfunc, args=cmd) - thread.start() - self.stbar.begin() - stop_handler = self.stop_button.connect('clicked', stop_clicked) - self.stop_button.set_sensitive(True) - gobject.timeout_add(50, out_wait) + self.outgoing = outgoing + self.reload_log() + text = _('%d outgoing changesets') % len(outgoing) + self.stbar.set_idle_text(text)     def email_clicked(self, toolbutton):   path = hglib.fromutf(self.pathentry.get_text()).strip()