Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix VCS browse and commit functionality (Files) #15895

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions spyder/plugins/explorer/widgets/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,7 @@ def update_actions(self):
dirname = ''
basedir = ''

vcs_visible = (only_files and len(fnames) == 1
and vcs.is_vcs_repository(dirname))
vcs_visible = vcs.is_vcs_repository(dirname)

# Make actions visible conditionally
self.move_action.setVisible(
Expand Down Expand Up @@ -1443,9 +1442,17 @@ def check_launch_error_codes(self, return_codes):
def vcs_command(self, action):
"""VCS action (commit, browse)"""
fnames = self.get_selected_filenames()

# Get dirname of selection
if osp.isdir(fnames[0]):
dirname = fnames[0]
else:
dirname = osp.dirname(fnames[0])

# Run action
try:
for path in sorted(fnames):
vcs.run_vcs_tool(path, action)
vcs.run_vcs_tool(dirname, action)
except vcs.ActionToolNotFound as error:
msg = _("For %s support, please install one of the<br/> "
"following tools:<br/><br/> %s")\
Expand Down