redcar 0.6.1 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +26 -0
- data/README.md +17 -31
- data/Rakefile +1 -1
- data/bin/redcar +1 -1
- data/lib/redcar.rb +8 -4
- data/lib/redcar/installer.rb +2 -1
- data/plugins/application/features/step_definitions/dialog_steps.rb +5 -0
- data/plugins/application/features/step_definitions/tree_steps.rb +1 -1
- data/plugins/application/features/support/env.rb +38 -17
- data/plugins/application/lib/application.rb +4 -0
- data/plugins/application/lib/application/command.rb +8 -2
- data/plugins/application/lib/application/command/executor.rb +37 -8
- data/plugins/application/lib/application/command/history.rb +3 -3
- data/plugins/application/lib/application/menu.rb +4 -0
- data/plugins/application/lib/application/menu/item.rb +9 -1
- data/plugins/application/lib/application/tab.rb +11 -0
- data/plugins/application/spec/application/command/executor_spec.rb +3 -3
- data/plugins/application/spec/application/command_spec.rb +24 -0
- data/plugins/application/spec/spec_helper.rb +1 -0
- data/plugins/application_swt/lib/application_swt.rb +27 -24
- data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +4 -33
- data/plugins/application_swt/lib/application_swt/dialogs/input_dialog.rb +46 -0
- data/plugins/application_swt/lib/application_swt/dialogs/text_and_file_dialog.rb +118 -0
- data/plugins/application_swt/lib/application_swt/icon.rb +37 -0
- data/plugins/application_swt/lib/application_swt/menu.rb +8 -3
- data/plugins/application_swt/lib/application_swt/tab.rb +6 -3
- data/plugins/application_swt/lib/application_swt/treebook.rb +29 -31
- data/plugins/application_swt/lib/swt/graphics_utils.rb +170 -0
- data/plugins/application_swt/lib/swt/vtab_folder.rb +125 -0
- data/plugins/application_swt/lib/swt/vtab_item.rb +69 -0
- data/plugins/application_swt/lib/swt/vtab_label.rb +84 -0
- data/plugins/auto_indenter/lib/auto_indenter.rb +4 -2
- data/plugins/core/lib/core/controller.rb +18 -0
- data/plugins/declarations/lib/declarations.rb +1 -1
- data/plugins/document_search/lib/document_search.rb +8 -6
- data/plugins/document_search/lib/document_search/replace.rb +51 -31
- data/plugins/document_search/lib/document_search/search_and_replace.rb +12 -11
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +33 -17
- data/plugins/edit_view/lib/edit_view.rb +100 -21
- data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +34 -11
- data/plugins/edit_view/lib/edit_view/actions/deletion.rb +10 -0
- data/plugins/edit_view/lib/edit_view/command.rb +5 -1
- data/plugins/edit_view/lib/edit_view/document.rb +8 -3
- data/plugins/edit_view/lib/edit_view/document/command.rb +15 -1
- data/plugins/edit_view/lib/edit_view/document/controller.rb +9 -0
- data/plugins/edit_view/lib/edit_view/document/history.rb +41 -0
- data/plugins/edit_view/lib/edit_view/tab_settings.rb +1 -11
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +150 -4
- data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +1 -1
- data/plugins/edit_view_swt/vendor/java-mateview.rb +1 -1
- data/plugins/find-in-project/lib/find_in_project.rb +7 -5
- data/plugins/html_view/features/step_definitions/html_view_steps.rb +2 -2
- data/plugins/line_tools/features/step_definitions/line_tools_steps.rb +0 -1
- data/plugins/line_tools/lib/line_tools.rb +7 -9
- data/plugins/macros/features/block_selection_in_macros.feature +48 -0
- data/plugins/macros/features/predictive_macros.feature +79 -0
- data/plugins/macros/features/record_and_run_macro.feature +87 -0
- data/plugins/macros/features/step_definitions/macro_steps.rb +66 -0
- data/plugins/macros/features/step_definitions/prediction_steps.rb +8 -0
- data/plugins/macros/features/support/env.rb +2 -0
- data/plugins/macros/lib/macros.rb +167 -0
- data/plugins/macros/lib/macros/action_sequence.rb +30 -0
- data/plugins/macros/lib/macros/commands.rb +108 -0
- data/plugins/macros/lib/macros/macro.rb +37 -0
- data/plugins/macros/lib/macros/manager_controller.rb +67 -0
- data/plugins/macros/lib/macros/predictive/document_controller.rb +69 -0
- data/plugins/macros/lib/macros/predictive/sequence_finder.rb +112 -0
- data/plugins/macros/plugin.rb +9 -0
- data/plugins/macros/spec/macros/predictive/sequence_finder_spec.rb +142 -0
- data/plugins/macros/spec/spec_helper.rb +6 -0
- data/plugins/macros/views/macro_manager.html.erb +86 -0
- data/plugins/outline_view/lib/outline_view.rb +1 -1
- data/plugins/project/lib/project/commands.rb +2 -2
- data/plugins/redcar/redcar.rb +37 -46
- data/plugins/repl/lib/repl.rb +4 -4
- data/plugins/runnables/features/command_tree.feature +1 -1
- data/plugins/runnables/features/parameter_input.feature +42 -0
- data/plugins/runnables/features/step_definitions/runnable_steps.rb +6 -0
- data/plugins/runnables/features/support/env.rb +28 -8
- data/plugins/runnables/lib/runnables.rb +35 -206
- data/plugins/runnables/lib/runnables/commands.rb +65 -0
- data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable.rb +62 -0
- data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_group.rb +59 -0
- data/plugins/runnables/lib/runnables/tree_mirror/nodes/runnable_type_group.rb +32 -0
- data/plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb +41 -0
- data/plugins/runnables/lib/runnables/tree_mirror/tree_mirror.rb +61 -0
- data/plugins/scm/lib/scm.rb +78 -45
- data/plugins/scm/lib/scm/commands.rb +18 -4
- data/plugins/scm/lib/scm/model.rb +54 -41
- data/plugins/scm_svn/LICENSE +48 -0
- data/plugins/scm_svn/features/add_and_commit.feature +18 -0
- data/plugins/scm_svn/features/checkout.feature +5 -0
- data/plugins/scm_svn/features/edit_and_index.feature +12 -0
- data/plugins/scm_svn/features/ignore_files.feature +14 -0
- data/plugins/scm_svn/features/merge.feature +34 -0
- data/plugins/scm_svn/features/resolve_conflict.feature +23 -0
- data/plugins/scm_svn/features/revert_and_delete.feature +21 -0
- data/plugins/scm_svn/features/step_definitions/branch_and_merge_steps.rb +27 -0
- data/plugins/scm_svn/features/step_definitions/checkout_steps.rb +25 -0
- data/plugins/scm_svn/features/step_definitions/edit_and_index_steps.rb +50 -0
- data/plugins/scm_svn/features/step_definitions/scm_svn_steps.rb +57 -0
- data/plugins/scm_svn/features/support/env.rb +74 -0
- data/plugins/scm_svn/features/switch_branches.feature +53 -0
- data/plugins/scm_svn/features/update.feature +16 -0
- data/plugins/scm_svn/lib/scm_svn.rb +423 -9
- data/plugins/scm_svn/lib/scm_svn/change.rb +116 -0
- data/plugins/swt/lib/swt.rb +0 -15
- data/plugins/swt/lib/swt/cucumber_patches.rb +2 -37
- data/plugins/swt/lib/swt/cucumber_runner.rb +1 -0
- data/plugins/swt/lib/swt/full_swt.rb +2 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Clojure.tmbundle/Syntaxes/Clojure.tmLanguage +14 -2
- data/plugins/todo_list/lib/todo_list/todo_controller.rb +1 -1
- data/plugins/todo_list/views/default.css +50 -0
- data/plugins/todo_list/views/index.html.erb +5 -16
- data/plugins/todo_list/views/redcar_small_icon.png +0 -0
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +14 -33
- data/plugins/view_shortcuts/views/default.css +31 -0
- data/plugins/view_shortcuts/views/index.html.erb +26 -16
- data/plugins/view_shortcuts/views/redcar_small_icon.png +0 -0
- data/{plugins/runnables → share}/icons/cog.png +0 -0
- data/share/icons/folder-gear-emblem.png +0 -0
- data/share/icons/folder-gear.png +0 -0
- data/share/icons/folder-open-small-gears.png +0 -0
- metadata +59 -5
@@ -0,0 +1,32 @@
|
|
1
|
+
module Redcar
|
2
|
+
class Runnables
|
3
|
+
class RunnableTypeGroup
|
4
|
+
include Redcar::Tree::Mirror::NodeMirror
|
5
|
+
|
6
|
+
def initialize(name,path,runnables)
|
7
|
+
@name = name
|
8
|
+
if runnables.any?
|
9
|
+
@children = runnables.map do |runnable|
|
10
|
+
Runnable.new(runnable["name"],path,runnable)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def leaf?
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
19
|
+
def text
|
20
|
+
@name
|
21
|
+
end
|
22
|
+
|
23
|
+
def icon
|
24
|
+
File.join(Redcar::ICONS_DIRECTORY, "folder-open-small-gears.png")
|
25
|
+
end
|
26
|
+
|
27
|
+
def children
|
28
|
+
@children
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Redcar
|
2
|
+
class Runnables
|
3
|
+
class TreeController
|
4
|
+
include Redcar::Tree::Controller
|
5
|
+
|
6
|
+
def initialize(project)
|
7
|
+
@project = project
|
8
|
+
end
|
9
|
+
|
10
|
+
def right_click(tree, node)
|
11
|
+
controller = self
|
12
|
+
menu = Menu.new
|
13
|
+
Redcar.plugin_manager.objects_implementing(:runnables_context_menus).each do |object|
|
14
|
+
case object.method(:runnables_context_menus).arity
|
15
|
+
when 1
|
16
|
+
menu.merge(object.runnables_context_menus(node))
|
17
|
+
when 2
|
18
|
+
menu.merge(object.runnables_context_menus(tree, node))
|
19
|
+
when 3
|
20
|
+
menu.merge(object.runnables_context_menus(tree, node, controller))
|
21
|
+
else
|
22
|
+
puts("Invalid runnables_context_menus hook detected in "+object.class.name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
Application::Dialog.popup_menu(menu, :pointer)
|
26
|
+
end
|
27
|
+
|
28
|
+
def activated(tree, node)
|
29
|
+
case node
|
30
|
+
when Runnable
|
31
|
+
Runnables.run_process(@project.home_dir, node.command, node.text, node.output)
|
32
|
+
when HelpItem
|
33
|
+
tab = Redcar.app.focussed_window.new_tab(HtmlTab)
|
34
|
+
tab.go_to_location("http://wiki.github.com/danlucraft/redcar/users-guide-runnables")
|
35
|
+
tab.title = "Runnables Help"
|
36
|
+
tab.focus
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module Redcar
|
2
|
+
class Runnables
|
3
|
+
class TreeMirror
|
4
|
+
include Redcar::Tree::Mirror
|
5
|
+
|
6
|
+
attr_accessor :last_loaded
|
7
|
+
|
8
|
+
def initialize(project)
|
9
|
+
@project = project
|
10
|
+
end
|
11
|
+
|
12
|
+
def runnable_file_paths
|
13
|
+
@project.config_files("runnables/*.json")
|
14
|
+
end
|
15
|
+
|
16
|
+
def last_updated
|
17
|
+
runnable_file_paths.map{ |p| File.mtime(p) }.max
|
18
|
+
end
|
19
|
+
|
20
|
+
def changed?
|
21
|
+
!last_loaded || last_loaded < last_updated
|
22
|
+
end
|
23
|
+
|
24
|
+
def custom_command
|
25
|
+
custom_info = {}
|
26
|
+
custom_info["command"] = PARAMS
|
27
|
+
custom_info["output"] = 'tab'
|
28
|
+
custom = Runnable.new("Custom Command",@project.path,custom_info)
|
29
|
+
[custom]
|
30
|
+
end
|
31
|
+
|
32
|
+
def load
|
33
|
+
groups = {}
|
34
|
+
runnable_file_paths.each do |path|
|
35
|
+
runnables = []
|
36
|
+
name = File.basename(path,".json")
|
37
|
+
json = File.read(path)
|
38
|
+
this_runnables = JSON(json)["commands"]
|
39
|
+
runnables += this_runnables || []
|
40
|
+
groups[name.to_s] = runnables.to_a
|
41
|
+
end
|
42
|
+
|
43
|
+
if groups.any?
|
44
|
+
groups.map do |name, runnables|
|
45
|
+
RunnableGroup.new(name,@project.path,runnables)
|
46
|
+
end
|
47
|
+
else
|
48
|
+
[HelpItem.new]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def title
|
53
|
+
TREE_TITLE
|
54
|
+
end
|
55
|
+
|
56
|
+
def top
|
57
|
+
custom_command + load
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/plugins/scm/lib/scm.rb
CHANGED
@@ -21,15 +21,15 @@ require 'scm/scm_commits_mirror/commit'
|
|
21
21
|
module Redcar
|
22
22
|
module Scm
|
23
23
|
ICONS_DIR = File.expand_path(File.join(File.dirname(__FILE__), %w{.. icons}))
|
24
|
-
|
24
|
+
|
25
25
|
class Manager
|
26
26
|
extend Redcar::HasSPI
|
27
|
-
|
27
|
+
|
28
28
|
def self.sensitivities
|
29
29
|
[
|
30
30
|
Sensitivity.new(:open_commit_tab, Redcar.app, false, [:tab_focussed]) do |tab|
|
31
|
-
tab and
|
32
|
-
tab.is_a?(EditTab) and
|
31
|
+
tab and
|
32
|
+
tab.is_a?(EditTab) and
|
33
33
|
tab.edit_view.document.mirror.is_a?(Scm::CommitMirror)
|
34
34
|
end,
|
35
35
|
Sensitivity.new(:open_scm, Redcar.app, false, [:window_focussed]) do |window|
|
@@ -43,20 +43,24 @@ module Redcar
|
|
43
43
|
osx = Keymap.build("main", :osx) do
|
44
44
|
link "Cmd+Shift+C", Scm::CommitMirror::SaveCommand
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
linwin = Keymap.build("main", [:linux, :windows]) do
|
48
48
|
link "Ctrl+Shift+C", Scm::CommitMirror::SaveCommand
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
[linwin, osx]
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
def self.menus
|
55
55
|
Menu::Builder.build do
|
56
56
|
sub_menu "Project" do
|
57
57
|
group(:priority => 10) do
|
58
58
|
separator
|
59
59
|
sub_menu "Source Control" do
|
60
|
+
Scm::Manager.modules_with_remote_init.sort {|a, b| a.repository_type <=> b.repository_type}.each do |m|
|
61
|
+
item m.translations[:remote_init], :command => Scm::RemoteInitCommand, :value => m
|
62
|
+
end
|
63
|
+
separator
|
60
64
|
item "Toggle Changes Tree", :command => Scm::ToggleScmTreeCommand, :value => [:commit, [Scm::ScmChangesMirror, Scm::ScmChangesController]]
|
61
65
|
item "Toggle Commits Tree", :command => Scm::ToggleScmTreeCommand, :value => [:push, [Scm::ScmCommitsMirror, Scm::ScmCommitsController]]
|
62
66
|
separator
|
@@ -67,36 +71,36 @@ module Redcar
|
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
70
|
-
|
74
|
+
|
71
75
|
def self.project_repositories
|
72
76
|
@project_repositories ||= {}
|
73
77
|
end
|
74
|
-
|
78
|
+
|
75
79
|
# should we print debugging messages? this can get pretty verbose
|
76
80
|
def self.debug
|
77
81
|
ARGV.include?('--debug')
|
78
82
|
end
|
79
|
-
|
83
|
+
|
80
84
|
def self.modules
|
81
85
|
@modules ||= begin
|
82
86
|
mods = []
|
83
87
|
puts "Loading Redcar SCM modules..." if debug
|
84
|
-
|
88
|
+
|
85
89
|
Redcar.plugin_manager.objects_implementing(:scm_module).each do |i|
|
86
90
|
puts " Found #{i.name}." if debug
|
87
91
|
object = i.scm_module
|
88
|
-
|
92
|
+
|
89
93
|
if object.supported?
|
90
94
|
mods.push(object)
|
91
95
|
elsif debug
|
92
96
|
puts " but discarding because it isn't supported on the current system."
|
93
97
|
end
|
94
98
|
end
|
95
|
-
|
99
|
+
|
96
100
|
mods
|
97
101
|
end
|
98
102
|
end
|
99
|
-
|
103
|
+
|
100
104
|
# Returns a list of instances of SCM modules. This list has already been
|
101
105
|
# filtered for invalid modules.
|
102
106
|
def self.modules_instance
|
@@ -112,36 +116,40 @@ module Redcar
|
|
112
116
|
end
|
113
117
|
}.find_all {|m| not m.nil?}
|
114
118
|
end
|
115
|
-
|
119
|
+
|
116
120
|
def self.modules_with_init
|
117
121
|
modules_instance.find_all {|m| m.supported_commands.include? :init}
|
118
122
|
end
|
119
|
-
|
123
|
+
|
124
|
+
def self.modules_with_remote_init
|
125
|
+
modules_instance.find_all {|m| m.supported_commands.include? :remote_init}
|
126
|
+
end
|
127
|
+
|
120
128
|
def self.project_loaded(project)
|
121
129
|
# for now we only want to attempt to handle the local case
|
122
130
|
return if project.remote?
|
123
|
-
|
131
|
+
|
124
132
|
puts "#{modules.count} SCM modules loaded." if debug
|
125
|
-
|
133
|
+
|
126
134
|
repo = modules_instance.find do |m|
|
127
135
|
puts "Checking if #{project.path} is a #{m.repository_type} repository..." if debug
|
128
136
|
m.repository?(project.path)
|
129
137
|
end
|
130
|
-
|
138
|
+
|
131
139
|
# quit if we can't find something to handle this project
|
132
140
|
return if repo.nil?
|
133
|
-
|
141
|
+
|
134
142
|
puts " Yes it is!" if debug
|
135
|
-
|
143
|
+
|
136
144
|
prepare(project, repo)
|
137
145
|
end
|
138
|
-
|
146
|
+
|
139
147
|
def self.prepare(project, repo)
|
140
148
|
start = Time.now
|
141
149
|
begin
|
142
150
|
# associate this repository with a project internally
|
143
151
|
project_repositories[project] = {'repo' => repo}
|
144
|
-
|
152
|
+
|
145
153
|
# load the repository and inject adapter if there is one
|
146
154
|
repo.load(project.path)
|
147
155
|
adapter = repo.adapter(project.adapter)
|
@@ -149,34 +157,34 @@ module Redcar
|
|
149
157
|
puts "Attaching a custom adapter to the project." if debug
|
150
158
|
project.adapter = adapter
|
151
159
|
end
|
152
|
-
|
160
|
+
|
153
161
|
project_repositories[project]['trees'] = []
|
154
162
|
rescue
|
155
163
|
# cleanup
|
156
164
|
info = project_repositories.delete project
|
157
|
-
|
165
|
+
|
158
166
|
puts "*** Error loading SCM: " + $!.message
|
159
167
|
puts $!.backtrace
|
160
168
|
end
|
161
|
-
|
169
|
+
|
162
170
|
puts "scm start took #{Time.now - start}s (included in project start time)" if debug
|
163
171
|
end
|
164
|
-
|
172
|
+
|
165
173
|
def self.project_closed(project)
|
166
174
|
# disassociate this project with any repositories
|
167
175
|
info = project_repositories.delete project
|
168
176
|
return if info.nil?
|
169
|
-
|
177
|
+
|
170
178
|
info['trees'].each {|t| project.window.treebook.remove_tree(t)}
|
171
179
|
end
|
172
|
-
|
180
|
+
|
173
181
|
def self.refresh_trees
|
174
182
|
project_repositories.each do |project, info|
|
175
183
|
project.refresh
|
176
184
|
info['trees'].each {|t| t.refresh}
|
177
185
|
end
|
178
186
|
end
|
179
|
-
|
187
|
+
|
180
188
|
def self.project_context_menus(tree, node, controller)
|
181
189
|
# Search for the current project
|
182
190
|
project = Project::Manager.in_window(Redcar.app.focussed_window)
|
@@ -185,7 +193,7 @@ module Redcar
|
|
185
193
|
end
|
186
194
|
repo_info = project_repositories[project]
|
187
195
|
init_modules = Redcar::Scm::Manager.modules_with_init
|
188
|
-
|
196
|
+
|
189
197
|
Menu::Builder.build do
|
190
198
|
if not project.nil?
|
191
199
|
if repo_info.nil? and init_modules.length > 0
|
@@ -194,27 +202,52 @@ module Redcar
|
|
194
202
|
separator
|
195
203
|
sub_menu "Create Repository From Project" do
|
196
204
|
init_modules.sort {|a, b| a.repository_type <=> b.repository_type}.each do |m|
|
197
|
-
item(m.translations[:init]) do
|
205
|
+
item(m.translations[:init]) do
|
198
206
|
m.init!(project.path)
|
199
207
|
project.refresh
|
200
|
-
|
208
|
+
|
201
209
|
Redcar::Scm::Manager.prepare(project, m)
|
202
|
-
|
210
|
+
|
203
211
|
Application::Dialog.message_box("Created a new " + m.repository_type.capitalize + " repository in the root of your project.")
|
204
212
|
end
|
205
213
|
end
|
206
214
|
end
|
207
215
|
end
|
208
216
|
elsif repo_info
|
209
|
-
# TODO: display repository commands for this node here too
|
210
|
-
# Before that, need to work out a way of caching
|
211
|
-
# Scm#uncommited_changes as this will almost always be an
|
212
|
-
# expensive operation.
|
213
217
|
group :priority => 40 do
|
214
218
|
repo = repo_info['repo']
|
215
|
-
if repo.supported_commands.find {|i| [:switch_branch].include? i}
|
219
|
+
if repo.supported_commands.find {|i| [:switch_branch, :pull, :pull_targetted].include? i}
|
216
220
|
separator
|
217
221
|
end
|
222
|
+
if repo.supported_commands.include?(:pull)
|
223
|
+
item (repo.translations[:pull]) do
|
224
|
+
repo.pull!
|
225
|
+
|
226
|
+
# refresh tree views
|
227
|
+
project.refresh
|
228
|
+
repo_info['trees'].each {|t| t.refresh}
|
229
|
+
end
|
230
|
+
end
|
231
|
+
if repo.supported_commands.include?(:pull_targetted)
|
232
|
+
lazy_sub_menu repo.translations[:pull_targetted] do
|
233
|
+
repo.pull_targets.sort.each do |target|
|
234
|
+
action = lambda do
|
235
|
+
begin
|
236
|
+
repo.pull!(target)
|
237
|
+
|
238
|
+
# refresh tree views
|
239
|
+
project.refresh
|
240
|
+
repo_info['trees'].each {|t| t.refresh}
|
241
|
+
rescue
|
242
|
+
Redcar::Application::Dialog.message_box($!.message)
|
243
|
+
puts $!.backtrace
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
item target, &action
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
218
251
|
if repo.supported_commands.include?(:switch_branch)
|
219
252
|
lazy_sub_menu repo.translations[:switch_branch] do
|
220
253
|
current = repo.current_branch
|
@@ -222,7 +255,7 @@ module Redcar
|
|
222
255
|
action = lambda {
|
223
256
|
begin
|
224
257
|
repo.switch!(branch)
|
225
|
-
|
258
|
+
|
226
259
|
# refresh tree views
|
227
260
|
project.refresh
|
228
261
|
repo_info['trees'].each {|t| t.refresh}
|
@@ -231,7 +264,7 @@ module Redcar
|
|
231
264
|
puts $!.backtrace
|
232
265
|
end
|
233
266
|
}
|
234
|
-
|
267
|
+
|
235
268
|
item branch, :type => :radio, :active => (branch == current), &action
|
236
269
|
end
|
237
270
|
end
|
@@ -241,18 +274,18 @@ module Redcar
|
|
241
274
|
end
|
242
275
|
end
|
243
276
|
end
|
244
|
-
|
277
|
+
|
245
278
|
def self.open_commit_tab(repo, change=nil)
|
246
279
|
tab = Redcar.app.focussed_window.new_tab(Redcar::EditTab)
|
247
|
-
edit_view = tab.edit_view
|
280
|
+
edit_view = tab.edit_view
|
248
281
|
mirror = Scm::CommitMirror.new(repo, change)
|
249
282
|
edit_view.document.mirror = mirror
|
250
283
|
edit_view.grammar = "Diff"
|
251
284
|
tab.focus
|
252
|
-
|
285
|
+
|
253
286
|
mirror.add_listener(:change) do
|
254
287
|
tab.close
|
255
|
-
|
288
|
+
|
256
289
|
project = Project::Manager.focussed_project
|
257
290
|
repo_info = project_repositories[project]
|
258
291
|
repo_info['trees'].each {|t| t.refresh}
|
@@ -3,21 +3,21 @@ module Redcar
|
|
3
3
|
module Scm
|
4
4
|
class ToggleScmTreeCommand < Command
|
5
5
|
sensitize :open_scm
|
6
|
-
|
6
|
+
|
7
7
|
def execute(options)
|
8
8
|
raise "ToggleScmTree requires a class value." if not options[:value]
|
9
|
-
|
9
|
+
|
10
10
|
command = options[:value][0]
|
11
11
|
klass = options[:value][1]
|
12
12
|
project = Project::Manager.focussed_project
|
13
13
|
info = Scm::Manager.project_repositories[project]
|
14
14
|
tree = info['trees'].find {|t| t.tree_mirror.is_a?(klass[0])}
|
15
|
-
|
15
|
+
|
16
16
|
if tree
|
17
17
|
info['trees'].delete tree
|
18
18
|
focussed = project.window.treebook.focussed_tree == tree
|
19
19
|
project.window.treebook.remove_tree(tree)
|
20
|
-
|
20
|
+
|
21
21
|
# return focus to the project module if we were currently focussed
|
22
22
|
project.window.treebook.focus_tree(project.tree) if focussed
|
23
23
|
elsif info['repo'].supported_commands.include? command
|
@@ -30,5 +30,19 @@ module Redcar
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
class RemoteInitCommand < Command
|
35
|
+
def execute(options)
|
36
|
+
raise "No scm module given for remote init" unless options[:value]
|
37
|
+
m = options[:value]
|
38
|
+
dialog = Redcar::ApplicationSWT::Dialogs::TextAndFileDialog.new(Redcar.app.focussed_window.controller.shell)
|
39
|
+
dialog.set_text(m.translations[:remote_init],m.translations[:remote_init_path],m.translations[:remote_init_target])
|
40
|
+
result = dialog.open
|
41
|
+
if result
|
42
|
+
Redcar::Project::Manager.open_project_for_path(result[:directory])
|
43
|
+
m.remote_init(result[:text].to_s,result[:directory].to_s)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
33
47
|
end
|
34
48
|
end
|