[ANN] tortoise-hg

Steve Borho steve at borho.org
Thu Apr 26 15:24:08 CDT 2007

On Thursday 26 April 2007 3:13:33 pm TK Soh wrote:
> On 4/26/07, Andrei Vermel <avermel at mail.ru> wrote:
> > qct looks consequently for 'hg', 'hg.cmd', 'hg.bat' and 'hg.exe' in
> > your path. If any one is found, it is then gets called.
> >
> > In your case 'hg' happened to be in the path, so qct tries to
> > execute 'hg root' without any success apparently.
> >
> > To work around you can change order of checks for 'hg', 'hg.cmd',
> > 'hg.bat', 'hg.exe' in qctlib\vcs\hg.py.
> >
> > A proper fix apparently should be to try to execute the various
> > hg.* before using one for real work.
> Why is Qct looking for 'hg' first? IIRC, windoze can execute 'hg'. It
> needs to have the usual executable extension, ie, hg, hg.bat, hg.ext,
> etc.
> p/s: I cc the mailing list on this conversation, I'm sure some people
> will get some benefit from it, or provide their comments.

The mercurial back-end for Qct does this when you start it up:

        # Find the mercurial binary name
        if findInSystemPath('hg') != None:
            self.hg_exe = 'hg'
        elif findInSystemPath('hg.cmd') != None:
            self.hg_exe = 'hg.cmd'
        elif findInSystemPath('hg.bat') != None:
            self.hg_exe = 'hg.bat'
        elif findInSystemPath('hg.exe') != None:
            self.hg_exe = 'hg.exe'
            print "Unable to find hg (.exe, .bat, .cmd) in your path"
            return -1

with findInSystemPath() defined as:

def findInSystemPath(filename):
    '''Search for an executable in the system path'''
    paths = split(os.environ['PATH'], os.path.pathsep)
    for path in paths:
        fullName = os.path.join(path, filename)
        if os.path.exists(fullName):
            return os.path.abspath(os.path.join(path, filename))
    return None

So the problem you're encountering is that Qct is finding a file 
named 'hg' in your system path, but apparently Windows doesn't think 
that 'hg' is an executable file.

Steve Borho (steve at borho.org)
Key fingerprint = 2D08 E7CF B624 624C DE1F  E2E4 B0C2 5292 F2C6 2C8C

More information about the Mercurial mailing list