Skip to content

Commit

Permalink
Merge from 5.x: PR #15895
Browse files Browse the repository at this point in the history
Fixes #15458
  • Loading branch information
ccordoba12 committed Jun 17, 2021
2 parents dc31fbb + d59d470 commit 7a4103d
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit 7a4103d

Please sign in to comment.