diff --git a/Main.sublime-menu b/Main.sublime-menu index cb8d1f96..d163417a 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -26,6 +26,7 @@ ,{ "caption": "-" } ,{ "caption": "Reset", "command": "git_raw", "args": { "command": "git reset HEAD", "append_current_file": true, "show_in": "suppress" } } ,{ "caption": "Checkout (Discard Changes)", "command": "git_raw", "args": { "command": "git checkout", "append_current_file": true } } + ,{ "caption": "Checkout (Any version)", "command": "git_log_checkout" } ,{ "caption": "-" } ,{ "caption": "Quick Commit Current File", "command": "git_quick_commit" } ,{ "caption": "Commit Selected Hunk", "command": "git_commit_selected_hunk" } diff --git a/git/history.py b/git/history.py index ccb959a9..4e006198 100644 --- a/git/history.py +++ b/git/history.py @@ -106,6 +106,16 @@ class GitLogAllCommand(GitLog, GitWindowCommand): pass +class GitLogCheckoutCommand(GitLogCommand): + """This command is used to check any version of a file.""" + def log_result(self, ref): + self.run_command( + ['git', 'checkout', ref, '--', self.get_file_name()]) + + def details_done(self, result): + pass + + class GitShow(object): def run(self, edit=None): # GitLog Copy-Past