Skip to content

Commit

Permalink
Merge pull request #14 from garacio/master
Browse files Browse the repository at this point in the history
Add fetch/push/pull
  • Loading branch information
notanumber committed Mar 27, 2012
2 parents e34bc3a + 9165d83 commit 27b2bcc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
5 changes: 4 additions & 1 deletion Context.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
}
]
5 changes: 4 additions & 1 deletion Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
36 changes: 36 additions & 0 deletions GitCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
5 changes: 4 additions & 1 deletion Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
}
]
Expand Down

0 comments on commit 27b2bcc

Please sign in to comment.