Exploring a repository can lead to a file execution on Windows
I have a BAT file that has the same base name than one of my project directory (ex: "D:\Projects\MyTool.bat" and "D:\Projects\MyTool\..."). On Windows, when I click on "Explore" for this particular project in the repository registry, it does not open an explorer window with the project directory. Instead, it runs the BAT file.
I took a brief look at the code and I think the problem comes from the "explore" function in "tortoisehg/hgqt/reporegistry.py" (line 558). I think
def explore(self):
qtlib.openlocalurl(self._currentRepoRoot())
... should be replaced by:
def explore(self):
qtlib.openlocalurl(os.path.join(self._currentRepoRoot(), ''))
... to have a backslash at the end of the directory name. It should prevent the confusion between the directory and executable name on Windows.
Since I don't know how to generate a TortoiseHg binary on Windows, I haven't been able to test this fix. I tested it on Linux though, and at least it doesn't seem to break the "explore" function there.