Commits

Anonymous committed cccb727

context: add hg pull back to drag-n-drop menu

Comments (0)

Files changed (1)

tortoise/contextmenu.py

             result.append((_("Push to"), 
                            _("Push source into the repo here"),
                            self._push_here))
+            result.append((_("Pull from"), 
+                           _("Pull new change from dragged repo"),
+                           self._pull_here))
             result.append((_("Incoming"), 
                            _("show new changesets found in source"),
                            self._incoming_here))
                         shellquote(dest))
         gpopen.run(cmdline)
 
+    def _pull_here(self, parent_window):
+        src = self._filenames[0]
+        dest = self._folder
+        msg = "Pull changes from %s?" % (src)
+        title = "Mercurial: pull"
+        rv = win32ui.MessageBox(msg, title, win32con.MB_OKCANCEL)
+        if rv == 2:
+            return
+
+        cmdline = "hg --verbose --repository %s pull %s" % (
+                        shellquote(dest),
+                        shellquote(src))
+        gpopen.run(cmdline)
+
     def _incoming_here(self, parent_window):
         src = self._filenames[0]
         dest = self._folder
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.