Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: fallback to hgtk.cmd if hgtk.exe not found

Changeset 243940fe4a1d

Parent aa28a21c1b0a

by Steve Borho

Changes to one file · Browse files at 243940fe4a1d Showing diff from parent aa28a21c1b0a Diff from another changeset...

 
350
351
352
 
 
353
354
355
 
358
359
360
361
 
 
 
 
 
 
 
 
 
 
362
363
364
 
350
351
352
353
354
355
356
357
 
360
361
362
 
363
364
365
366
367
368
369
370
371
372
373
374
375
@@ -350,6 +350,8 @@
  return NOERROR;  }   +#include "Winstat.h" +  void CShellExt::DoHgtk(const std::string &cmd)  {   std::string dir = GetTHgProgRoot(); @@ -358,7 +360,16 @@
  TDEBUG_TRACE("DoHgtk: THG root is empty");   return;   } - std::string hgcmd = Quote(dir + "\\hgtk.exe") + " " + cmd; + std::string hgcmd = Quote(dir + "\\hgtk.exe"); + + WIN32_FIND_DATAA data; + HANDLE hfind = FindFirstFileA(hgcmd.c_str(), &data); + if (hfind == INVALID_HANDLE_VALUE) + std::string hgcmd = Quote(dir + "\\hgtk.cmd"); + else + FindClose(hfind); + + hgcmd += " " + cmd;     std::string cwd;   if (!myFolder.empty())