Permalink
Browse files

Merge pull request #14 from garacio/master

Add fetch/push/pull
  • Loading branch information...
2 parents e34bc3a + 9165d83 commit 27b2bcc8041bf309ab7e6e579c285914a9702dde @notanumber committed Mar 27, 2012
Showing with 49 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +4 −1 Context.sublime-menu
  3. +4 −1 Default (OSX).sublime-keymap
  4. +36 −0 GitCommand.py
  5. +4 −1 Main.sublime-menu
View
@@ -0,0 +1 @@
+*.pyc
@@ -16,7 +16,10 @@
{ "caption": "Diff", "command": "git_diff" },
{ "caption": "Log", "command": "git_log" },
{ "caption": "Status", "command": "git_status" },
- { "caption": "Blame", "command": "git_blame" }
+ { "caption": "Blame", "command": "git_blame" },
+ { "caption": "Fetch", "command": "git_fetch" },
+ { "caption": "Pull", "command": "git_pull" },
+ { "caption": "Push", "command": "git_push" }
]
}
]
@@ -6,5 +6,8 @@
{ "keys": ["ctrl+super+d"], "command": "git_diff"},
{ "keys": ["ctrl+super+s"], "command": "git_status"},
{ "keys": ["ctrl+super+l"], "command": "git_log"},
- { "keys": ["ctrl+super+b"], "command": "git_blame"}
+ { "keys": ["ctrl+super+b"], "command": "git_blame"},
+ { "keys": ["ctrl+super+f"], "command": "git_fetch"},
+ { "keys": ["ctrl+super+p"], "command": "git_pull"},
+ { "keys": ["ctrl+super+["], "command": "git_push"}
]
View
@@ -399,3 +399,39 @@ def on_done(self, tag_name):
folder_name = os.path.dirname(self.view.file_name())
self.view.window().run_command('exec', {'cmd': ['git', 'tag', tag_name], 'working_dir': folder_name, 'quiet': True})
+
+class GitFetchCommand(sublime_plugin.TextCommand):
+ def is_enabled(self, *args):
+ if self.view.file_name():
+ return True
+ return False
+
+ def run(self, edit):
+ if self.view.file_name():
+ folder_name = os.path.dirname(self.view.file_name())
+
+ self.view.window().run_command('exec', {'cmd': ['git', 'fetch'], 'working_dir': folder_name, 'quiet': False})
+
+class GitPullCommand(sublime_plugin.TextCommand):
+ def is_enabled(self, *args):
+ if self.view.file_name():
+ return True
+ return False
+
+ def run(self, edit):
+ if self.view.file_name():
+ folder_name = os.path.dirname(sself.view.file_name())
+
+ self.view.window().run_command('exec', {'cmd': ['git', 'pull'], 'working_dir': folder_name, 'quiet': False})
+
+class GitPushCommand(sublime_plugin.TextCommand):
+ def is_enabled(self, *args):
+ if self.view.file_name():
+ return True
+ return False
+
+ def run(self, edit):
+ if self.view.file_name():
+ folder_name = os.path.dirname(self.view.file_name())
+
+ self.view.window().run_command('exec', {'cmd': ['git', 'push'], 'working_dir': folder_name, 'quiet': False})
View
@@ -42,7 +42,10 @@
{ "caption": "-" },
{ "caption": "Init...", "command": "git_init" },
{ "caption": "-" },
- { "caption": "Settings...", "command": "git_settings" }
+ { "caption": "Settings...", "command": "git_settings" },
+ { "caption": "Fetch", "command": "git_fetch" },
+ { "caption": "Pull", "command": "git_pull" },
+ { "caption": "Push", "command": "git_push" }
]
}
]

0 comments on commit 27b2bcc

Please sign in to comment.