1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Steve Borho  committed 0e1afeb

sync: make workbench toolbar buttons behave like the built-in sync buttons

Perhaps someone can figure out how to represent 'push to default-push'. It
escapes me at the moment.

  • Participants
  • Parent commits 4ee043d
  • Branches default

Comments (0)

Files changed (1)

File tortoisehg/hgqt/sync.py

View file
  • Ignore whitespace
 
     def incoming(self):
         if self.cmd.core.is_running():
-            self.output.emit(_('sync command already running'), 'control')
-            return
-        if 'default' in self.paths:
-            self.setUrl(self.paths['default'])
-            self.curalias = 'default'
+            self.showMessage.emit(_('sync command already running'))
+        else:
             self.inclicked()
 
     def pull(self):
         if self.cmd.core.is_running():
-            self.output.emit(_('sync command already running'), 'control')
-            return
-        if 'default' in self.paths:
-            self.setUrl(self.paths['default'])
-            self.curalias = 'default'
+            self.showMessage.emit(_('sync command already running'))
+        else:
             self.pullclicked()
 
     def outgoing(self):
         if self.cmd.core.is_running():
-            self.output.emit(_('sync command already running'), 'control')
-            return
-        if 'default-push' in self.paths:
-            self.setUrl(self.paths['default-push'])
-            self.curalias = 'default-push'
-            self.outclicked()
-        elif 'default' in self.paths:
-            self.setUrl(self.paths['default'])
-            self.curalias = 'default'
+            self.showMessage.emit(_('sync command already running'))
+        else:
             self.outclicked()
 
     def push(self):
         if self.cmd.core.is_running():
-            self.output.emit(_('sync command already running'), 'control')
-            return
-        if 'default-push' in self.paths:
-            self.setUrl(self.paths['default-push'])
-            self.curalias = 'default-push'
-            self.pushclicked()
-        elif 'default' in self.paths:
-            self.setUrl(self.paths['default'])
-            self.curalias = 'default'
+            self.showMessage.emit(_('sync command already running'))
+        else:
             self.pushclicked()
 
     def pullBundle(self, bundle, rev):
         'accept bundle changesets'
         if self.cmd.core.is_running():
-            self.output.emit(_('sync command already running'), 'control')
+            self.showMessage.emit(_('sync command already running'))
             return
         save = self.currentUrl(False)
         orev = self.opts.get('rev')
     def pushToRevision(self, rev):
         'push to specified revision'
         if self.cmd.core.is_running():
-            self.output.emit(_('sync command already running'), 'control')
+            self.showMessage.emit(_('sync command already running'))
             return
         orev = self.opts.get('rev')
         self.opts['rev'] = str(rev)