# HG changeset patch
# User Steve Borho <st...@borho.org>
# Date 1254541595 18000
# Node ID da76d9133dc68a9d7dee51cd5cf31a87d69d6c67
# Parent  e934183f6f76983df2bc0673e0edf3ce8520a7c4
history: add 'push to here' cmenu option

diff -r e934183f6f76 -r da76d9133dc6 tortoisehg/hgtk/history.py
--- a/tortoisehg/hgtk/history.py        Fri Oct 02 22:18:22 2009 -0500
+++ b/tortoisehg/hgtk/history.py        Fri Oct 02 22:46:35 2009 -0500
@@ -49,6 +49,7 @@
         self.bundledir = None
         self.bfile = None
         self.npreviews = 0
+        self.outgoing = []
         os.chdir(self.repo.root)
 
         # Load extension support for commands which need it
@@ -97,6 +98,7 @@
     def get_menu_list(self):
         def refresh(menuitem, resetmarks):
             if resetmarks:
+                self.outgoing = []
                 self.graphview.set_outgoing([])
                 self.origtip = len(self.repo)
             self.reload_log()
@@ -580,6 +582,8 @@
             m.show_all()
             return m
 
+        if self.repo[self.currevid].node() in self.outgoing:
+            m.append(create_menu(_('push to here'), self.push_to))
         m.append(create_menu(_('_update'), self.checkout))
         cmenu_merge = create_menu(_('_merge with'), self.domerge)
         m.append(cmenu_merge)
@@ -748,6 +752,7 @@
         cell = gtk.CellRendererText()
         urlcombo.pack_end(cell, False)
         urlcombo.add_attribute(cell, 'text', 1)
+        self.pathentry = urlcombo.get_child()
         syncbox.append_widget(urlcombo, expand=True)
 
         for alias, path in self.repo.ui.configitems('paths'):
@@ -1057,6 +1062,7 @@
             else:
                 self.stbar.end()
                 self.graphview.set_outgoing(outgoing)
+                self.outgoing = outgoing
                 self.reload_log()
                 stop.disconnect(stop_handler)
                 stop.set_sensitive(False)
@@ -1097,7 +1103,8 @@
         dlg.show_all()
         dlg.run()
         dlg.hide()
-        if dlg.return_code() == 0 and self.graphview.outgoing:
+        if dlg.return_code() == 0 and self.outgoing:
+            self.outgoing = []
             self.graphview.set_outgoing([])
             self.reload_log()
 
@@ -1409,6 +1416,25 @@
                          statopts)
         dialog.display()
 
+    def push_to(self, menuitem):
+        remote_path = hglib.fromutf(self.pathentry.get_text()).strip()
+        for alias, path in self.repo.ui.configitems('paths'):
+            if remote_path == alias:
+                remote_path = path
+            elif remote_path == url.hidepassword(path):
+                remote_path = path
+        node = self.repo[self.currevid].node()
+        cmdline = ['hg', 'push', '--rev', str(self.currevid), remote_path]
+        dlg = hgcmd.CmdDialog(cmdline, text='hg push')
+        dlg.show_all()
+        dlg.run()
+        dlg.hide()
+        if dlg.return_code() == 0 and self.outgoing:
+            d = self.outgoing.index(node)
+            self.outgoing = self.outgoing[d+1:]
+            self.graphview.set_outgoing(self.outgoing)
+            self.reload_log()
+
     def pull_to(self, menuitem):
         cmdline = ['hg', 'pull', '--rev', str(self.currevid), self.bfile]
         dlg = hgcmd.CmdDialog(cmdline)

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to