Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • thg thg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 835
    • Issues 835
    • List
    • Boards
    • Service Desk
    • Milestones
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Mercurial Paris conference scheduled ! Main event : 2022-09-22. Call for papers deadline: 2022-06-17.

  • mercurial
  • TortoiseHg
  • thgthg
  • Issues
  • #5792

Closed
Open
Created May 10, 2022 by Mathieu OLIVIER@molivierDeveloper

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.

Edited May 10, 2022 by Mathieu OLIVIER
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking