fetch: add ability to fetch into a remote tracking branch
[git-cola.git] / cola / widgets / toolbarcmds.py
blob7009135457449403f102dcd6b802f0009cbb013a
1 from .. import cmds
2 from .. import difftool
3 from .. import guicmds
4 from ..widgets import archive
5 from ..widgets import browse
6 from ..widgets import compare
7 from ..widgets import createbranch
8 from ..widgets import createtag
9 from ..widgets import dag
10 from ..widgets import diff
11 from ..widgets import editremotes
12 from ..widgets import finder
13 from ..widgets import grep
14 from ..widgets import merge
15 from ..widgets import recent
16 from ..widgets import remote
17 from ..widgets import search
18 from ..widgets import stash
20 COMMANDS = {
21 'Others::LaunchEditor': {
22 'title': 'Launch Editor',
23 'action': cmds.run(cmds.LaunchEditor),
24 'icon': 'edit',
26 'Others::RevertUnstagedEdits': {
27 'title': 'Revert Unstaged Edits...',
28 'action': cmds.run(cmds.RevertUnstagedEdits),
29 'icon': 'undo',
31 'File::QuickOpen': {
32 'title': 'Quick Open...',
33 'action': guicmds.open_quick_repo_search,
34 'icon': 'search',
36 'File::NewRepo': {
37 'title': 'New Repository...',
38 'action': guicmds.open_new_repo,
39 'icon': 'new',
41 'File::OpenRepo': {
42 'title': 'Open...',
43 'action': guicmds.open_repo,
44 'icon': 'folder',
46 'File::OpenRepoNewWindow': {
47 'title': 'Open in New Window...',
48 'action': guicmds.open_repo_in_new_window,
49 'icon': 'folder',
51 # 'File::CloneRepo': {
52 # 'title': 'Clone...',
53 # 'action': guicmds.spawn_clone,
54 # 'icon': 'repo'
55 # },
56 'File::Refresh': {
57 'title': 'Refresh...',
58 'action': cmds.run(cmds.Refresh),
59 'icon': 'sync',
61 'File::FindFiles': {
62 'title': 'Find Files',
63 'action': finder.finder,
64 'icon': 'zoom_in',
66 'File::EditRemotes': {
67 'title': 'Edit Remotes...',
68 'action': editremotes.editor,
69 'icon': 'edit',
71 'File::RecentModified': {
72 'title': 'Recently Modified Files...',
73 'action': recent.browse_recent_files,
74 'icon': 'edit',
76 'File::ApplyPatches': {
77 'title': 'Apply Patches...',
78 'action': diff.apply_patches,
79 'icon': 'diff',
81 'File::ExportPatches': {
82 'title': 'Export Patches...',
83 'action': guicmds.export_patches,
84 'icon': 'save',
86 'File::SaveAsTarZip': {
87 'title': 'Save As Tarball/Zip...',
88 'action': archive.save_archive,
89 'icon': 'file_zip',
91 # 'File::Preferences': {
92 # 'title': 'Preferences',
93 # 'action': prefs.preferences,
94 # 'icon': 'configure'
95 # },
96 'Actions::Fetch': {'title': 'Fetch...', 'action': remote.fetch, 'icon': 'download'},
97 'Actions::Pull': {'title': 'Pull...', 'action': remote.pull, 'icon': 'pull'},
98 'Actions::Push': {'title': 'Push...', 'action': remote.push, 'icon': 'push'},
99 'Actions::Stash': {'title': 'Stash...', 'action': stash.view, 'icon': 'commit'},
100 'Actions::CreateTag': {
101 'title': 'Create Tag...',
102 'action': createtag.create_tag,
103 'icon': 'tag',
105 'Actions::CherryPick': {
106 'title': 'Cherry-Pick...',
107 'action': guicmds.cherry_pick,
108 'icon': 'cherry_pick',
110 'Actions::Merge': {
111 'title': 'Merge...',
112 'action': merge.local_merge,
113 'icon': 'merge',
115 'Actions::AbortMerge': {
116 'title': 'Abort Merge...',
117 'action': cmds.run(cmds.AbortMerge),
118 'icon': 'undo',
120 'Actions::UpdateSubmodules': {
121 'title': 'Update All Submodules...',
122 'action': cmds.run(cmds.SubmodulesUpdate),
123 'icon': 'sync',
125 'Actions::ResetSoft': {
126 'title': 'Reset Branch (Soft)',
127 'action': guicmds.reset_soft,
128 'icon': 'style_dialog_reset',
129 'tooltip': cmds.ResetSoft.tooltip('<commit>'),
131 'Actions::ResetMixed': {
132 'title': 'Reset Branch and Stage (Mixed)',
133 'action': guicmds.reset_mixed,
134 'icon': 'style_dialog_reset',
135 'tooltip': cmds.ResetMixed.tooltip('<commit>'),
137 'Actions::RestoreWorktree': {
138 'title': 'Restore Worktree',
139 'action': guicmds.restore_worktree,
140 'icon': 'edit',
141 'tooltip': cmds.RestoreWorktree.tooltip('<commit>'),
143 'Actions::ResetKeep': {
144 'title': 'Restore Worktree and Reset All (Keep Unstaged Changes)',
145 'action': guicmds.reset_keep,
146 'icon': 'style_dialog_reset',
147 'tooltip': cmds.ResetKeep.tooltip('<commit>'),
149 'Actions::ResetHard': {
150 'title': 'Restore Worktre and Reset All (Hard)',
151 'action': guicmds.reset_hard,
152 'icon': 'style_dialog_reset',
153 'tooltip': cmds.ResetHard.tooltip('<commit>'),
155 'Actions::Grep': {
156 'title': 'Grep',
157 'action': grep.grep,
158 'icon': 'search',
160 'Actions::Search': {
161 'title': 'Search...',
162 'action': search.search,
163 'icon': 'search',
165 'Commit::Stage': {
166 'title': 'Stage',
167 'action': cmds.run(cmds.StageOrUnstage),
168 'icon': 'add',
170 'Commit::AmendLast': {
171 'title': 'Amend Last Commit',
172 'action': cmds.run(cmds.AmendMode),
173 'icon': 'edit',
175 'Commit::UndoLastCommit': {
176 'title': 'Undo Last Commit',
177 'action': cmds.run(cmds.UndoLastCommit),
178 'icon': 'style_dialog_discard',
180 'Commit::StageModified': {
181 'title': 'Stage Modified',
182 'action': cmds.run(cmds.StageModified),
183 'icon': 'add',
185 'Commit::StageUntracked': {
186 'title': 'Stage Untracked',
187 'action': cmds.run(cmds.StageUntracked),
188 'icon': 'add',
190 'Commit::UnstageAll': {
191 'title': 'Unstage All',
192 'action': cmds.run(cmds.UnstageAll),
193 'icon': 'remove',
195 'Commit::Unstage': {
196 'title': 'Unstage',
197 'action': cmds.run(cmds.UnstageSelected),
198 'icon': 'remove',
200 'Commit::LoadCommitMessage': {
201 'title': 'Load Commit Message...',
202 'action': guicmds.load_commitmsg,
203 'icon': 'file_text',
205 'Commit::GetCommitMessageTemplate': {
206 'title': 'Get Commit Message Template',
207 'action': cmds.run(cmds.LoadCommitMessageFromTemplate),
208 'icon': 'style_dialog_apply',
210 'Diff::Difftool': {
211 'title': 'Launch Diff tool',
212 'action': cmds.run(difftool.LaunchDifftool),
213 'icon': 'diff',
215 'Diff::Expression': {
216 'title': 'Expression...',
217 'action': guicmds.diff_expression,
218 'icon': 'compare',
220 'Diff::Branches': {
221 'title': 'Branches...',
222 'action': compare.compare_branches,
223 'icon': 'compare',
225 'Diff::Diffstat': {
226 'title': 'Diffstat',
227 'action': cmds.run(cmds.Diffstat),
228 'icon': 'diff',
230 'Branch::Review': {
231 'title': 'Review...',
232 'action': guicmds.review_branch,
233 'icon': 'compare',
235 'Branch::Create': {
236 'title': 'Create...',
237 'action': createbranch.create_new_branch,
238 'icon': 'branch',
240 'Branch::Checkout': {
241 'title': 'Checkout...',
242 'action': guicmds.checkout_branch,
243 'icon': 'branch',
245 'Branch::Delete': {
246 'title': 'Delete...',
247 'action': guicmds.delete_branch,
248 'icon': 'discard',
250 'Branch::DeleteRemote': {
251 'title': 'Delete Remote Branch...',
252 'action': guicmds.delete_remote_branch,
253 'icon': 'discard',
255 'Branch::Rename': {
256 'title': 'Rename Branch...',
257 'action': guicmds.rename_branch,
258 'icon': 'edit',
260 'Branch::BrowseCurrent': {
261 'title': 'Browse Current Branch...',
262 'action': guicmds.browse_current,
263 'icon': 'directory',
265 'Branch::BrowseOther': {
266 'title': 'Browse Other Branch...',
267 'action': guicmds.browse_other,
268 'icon': 'directory',
270 'Branch::VisualizeCurrent': {
271 'title': 'Visualize Current Branch...',
272 'action': cmds.run(cmds.VisualizeCurrent),
273 'icon': 'visualize',
275 'Branch::VisualizeAll': {
276 'title': 'Visualize All Branches...',
277 'action': cmds.run(cmds.VisualizeAll),
278 'icon': 'visualize',
280 'View::FileBrowser': {
281 'title': 'File Browser...',
282 'action': browse.worktree_browser,
283 'icon': 'cola',
285 'View::DAG': {'title': 'DAG...', 'action': dag.git_dag, 'icon': 'cola'},
287 # 'Rebase::StartInteractive': {
288 # 'title': 'Start Interactive Rebase...',
289 # 'action': lambda: app().activeWindow().rebase_start(),
290 # 'icon': None
291 # },
292 # 'Rebase::Edit': {
293 # 'title': 'Edit...',
294 # 'action': lambda: cmds.rebase_edit_todo(),
295 # 'icon': None
296 # },
297 # 'Rebase::Continue': {
298 # 'title': 'Continue',
299 # 'action': lambda: cmds.rebase_continue(),
300 # 'icon': None
301 # },
302 # 'Rebase::SkipCurrentPatch': {
303 # 'title': 'Skip Current Patch',
304 # 'action': lambda: cmds.rebase_skip(),
305 # 'icon': None
306 # },
307 # 'Rebase::Abort': {
308 # 'title': 'Abort',
309 # 'action': lambda: cmds.rebase_abort(),
310 # 'icon': None