Skip to content
Browse files

Merge branch 'release/v0.1.0'

  • Loading branch information...
2 parents ba1038a + 6996177 commit a8a3dfe33b6837b1d6a531607457da470e1626b9 @seancojr committed May 9, 2012
Showing with 134 additions and 0 deletions.
  1. +28 −0 Default.sublime-commands
  2. +3 −0 Git.sublime-settings
  3. +15 −0 Main.sublime-menu
  4. +88 −0 git.py
View
28 Default.sublime-commands
@@ -80,6 +80,10 @@
"command": "git_checkout"
}
,{
+ "caption": "Git: Fetch",
+ "command": "git_fetch"
+ }
+ ,{
"caption": "Git: Pull",
"command": "git_pull"
}
@@ -131,4 +135,28 @@
"caption": "Git: Gitk",
"command": "git_gitk"
}
+ ,{
+ "caption": "Git Flow: Feature Start",
+ "command": "git_flow_feature_start"
+ }
+ ,{
+ "caption": "Git Flow: Feature Finish",
+ "command": "git_flow_feature_finish"
+ }
+ ,{
+ "caption": "Git Flow: Release Start",
+ "command": "git_flow_release_start"
+ }
+ ,{
+ "caption": "Git Flow: Release Finish",
+ "command": "git_flow_release_finish"
+ }
+ ,{
+ "caption": "Git Flow: Hotfix Start",
+ "command": "git_flow_hotfix_start"
+ }
+ ,{
+ "caption": "Git Flow: Hotfix Finish",
+ "command": "git_flow_hotfix_finish"
+ }
]
View
3 Git.sublime-settings
@@ -6,6 +6,9 @@
// e.g. "/Users/kemayo/bin/git" or "C:\bin\git.exe"
,"git_command": false
+ // point this the installation location of git-flow
+ ,"git_flow_command": "C:\\Program Files\\Git\\bin\\git-flow"
+
// use the panel for diff output, rather than a new scratch window (new tab)
,"diff_panel": false
View
15 Main.sublime-menu
@@ -46,6 +46,21 @@
]
}
,{ "caption": "-" }
+ ,{
+ "caption": "Flow",
+ "children":
+ [
+ { "caption": "Feature Start", "command": "git_flow_feature_start"}
+ ,{ "caption": "Feature Finish", "command": "git_flow_feature_finish"}
+ ,{ "caption": "-"}
+ ,{ "caption": "Release Start", "command": "git_flow_release_start"}
+ ,{ "caption": "Release Finish", "command": "git_flow_release_finish"}
+ ,{ "caption": "-"}
+ ,{ "caption": "Hotfix Start", "command": "git_flow_hotfix_start"}
+ ,{ "caption": "Hotfix Finish", "command": "git_flow_hotfix_finish"}
+ ]
+ }
+ ,{ "caption": "-" }
,{ "caption": "Status...", "command": "git_status" }
,{ "caption": "Branches...", "command": "git_branch" }
,{ "caption": "Merge...", "command": "git_merge" }
View
88 git.py
@@ -127,6 +127,8 @@ def run_command(self, command, callback=None, show_status=True,
self.active_view().run_command('save')
if command[0] == 'git' and s.get('git_command'):
command[0] = s.get('git_command')
+ if command[0] == 'git-flow' and s.get('git_flow_command'):
+ command[0] = s.get('git_flow_command')
if not callback:
callback = self.generic_done
@@ -728,6 +730,11 @@ def run(self, edit):
self.run_command(['git', 'checkout', self.get_file_name()])
+class GitFetchCommand(GitWindowCommand):
+ def run(self):
+ self.run_command(['git', 'fetch'], callback=self.panel)
+
+
class GitPullCommand(GitWindowCommand):
def run(self):
self.run_command(['git', 'pull'], callback=self.panel)
@@ -785,6 +792,87 @@ def on_input(self, command):
self.run_command(command_splitted)
+class GitFlowFeatureStartCommand(GitWindowCommand):
+ def run(self):
+ self.get_window().show_input_panel('Enter Feature Name:', '', self.on_done, None, None)
+
+ def on_done(self, feature_name):
+ self.run_command(['git-flow', 'feature', 'start', feature_name])
+
+
+class GitFlowFeatureFinishCommand(GitWindowCommand):
+ def run(self):
+ self.run_command(['git-flow', 'feature'], self.feature_done)
+
+ def feature_done(self, result):
+ self.results = result.rstrip().split('\n')
+ self.quick_panel(self.results, self.panel_done,
+ sublime.MONOSPACE_FONT)
+
+ def panel_done(self, picked):
+ if 0 > picked < len(self.results):
+ return
+ picked_feature = self.results[picked]
+ if picked_feature.startswith("*"):
+ picked_feature = picked_feature.strip("*")
+ picked_feature = picked_feature.strip()
+ self.run_command(['git-flow', 'feature', 'finish', picked_feature])
+
+
+class GitFlowReleaseStartCommand(GitWindowCommand):
+ def run(self):
+ self.get_window().show_input_panel('Enter Version Number:', '', self.on_done, None, None)
+
+ def on_done(self, release_name):
+ self.run_command(['git-flow', 'release', 'start', release_name])
+
+
+class GitFlowReleaseFinishCommand(GitWindowCommand):
+ def run(self):
+ self.run_command(['git-flow', 'release'], self.release_done)
+
+ def release_done(self, result):
+ self.results = result.rstrip().split('\n')
+ self.quick_panel(self.results, self.panel_done,
+ sublime.MONOSPACE_FONT)
+
+ def panel_done(self, picked):
+ if 0 > picked < len(self.results):
+ return
+ picked_release = self.results[picked]
+ if picked_release.startswith("*"):
+ picked_release = picked_release.strip("*")
+ picked_release = picked_release.strip()
+ self.run_command(['git-flow', 'release', 'finish', picked_release])
+
+
+class GitFlowHotfixStartCommand(GitWindowCommand):
+ def run(self):
+ self.get_window().show_input_panel('Enter hotfix name:', '', self.on_done, None, None)
+
+ def on_done(self, hotfix_name):
+ self.run_command(['git-flow', 'hotfix', 'start', hotfix_name])
+
+
+class GitFlowHotfixFinishCommand(GitWindowCommand):
+ def run(self):
+ self.run_command(['git-flow', 'hotfix'], self.hotfix_done)
+
+ def hotfix_done(self, result):
+ self.results = result.rstrip().split('\n')
+ self.quick_panel(self.results, self.panel_done,
+ sublime.MONOSPACE_FONT)
+
+ def panel_done(self, picked):
+ if 0 > picked < len(self.results):
+ return
+ picked_hotfix = self.results[picked]
+ if picked_hotfix.startswith("*"):
+ picked_hotfix = picked_hotfix.strip("*")
+ picked_hotfix = picked_hotfix.strip()
+ self.run_command(['git-flow', 'hotfix', 'finish', picked_hotfix])
+
+
class GitResetHeadCommand(GitTextCommand):
def run(self, edit):
self.run_command(['git', 'reset', 'HEAD', self.get_file_name()])

0 comments on commit a8a3dfe

Please sign in to comment.
Something went wrong with that request. Please try again.