1. TortoiseHg
  2. TortoiseHg
  3. thg
  4. Issues
Issue #1798 resolved

"Edit Local" on Windows UNC repo opens empty file in C:\Windows

Wolfgang Strobl
created an issue

Context: Repo living on a windows share (actually samba), accessed via UNC (i.e. \ \ depot-ng0.example.com\tahoe\allmydata-tahoe-1.9.1)

I've just switched vom 1.1.10 to 2.3.1 (both x64) on Win7/64 german. thg locale forced back to english.

Edit Local (right click) or Ctrl Shift E in the Workspace calls the editor specified (scite.exe) , but, as it seems, with the path part stripped, so scite opens an empty file with the correct name in c:\windows. Changing to "notepad.exe" as local editor results in notepad asking "file not found, shall I create it?" (translated from German).

"copy path" and then pasting it into a command window (i.e. notepad.exe <pasted here> or scite.exe <pasted here>) works as expected.

Comments (4)

  1. Wolfgang Strobl reporter
    • changed status to open

    The relevant file is ./tortoisehg/hgqt/revdetails.py. Copying the code from copypath (i.e.

                        for f in self.filelist.getSelectedFiles()]

    fixes it, but only if the number of files is >1. Arrrgh.

    IMHO, the code in qtlib.py / editfiles is broken.

       if len(files) == 1:
            path = repo.wjoin(files[0])
            cwd = os.path.dirname(path)
            files = [os.path.basename(path)]

    strips the path from the filename in "files" and depends on finding the file in the current working directory. Alas, there is no such thing as a current working directory with UNC names.

    Removing the special case for one file probably solves the problem (haven't tried, running out of time), but I hope it was added for a reason, so I think further investigation is necessary.

  2. Log in to comment