745a746 > set hgopt "" 756a758 > set hgopt "-r$r" 909a912,928 > } elseif {[is-mercurial-repository $dirname]} { > # mercurial support > set cmd "hg" > if {$::tcl_platform(platform) == "windows"} { > append cmd ".exe" > } > if {"$r" == "" || "$rev" == "PARENT"} { > # in hg, the revision for cat defaults to the parent revision > # of the working directory > set finfo(lbl,$index) "$f (HG PARENT)" > debug-info " Setting lbl $finfo(lbl,$index)" > die-unless "exec $cmd cat $f" $finfo(pth,$index) > } else { > set finfo(lbl,$index) "$f (HG $rev)" > debug-info " Setting lbl $finfo(lbl,$index)" > die-unless "exec $cmd cat $hgopt $f" $finfo(pth,$index) > } 920a940,952 > proc is-mercurial-repository {dirname} { > # check for a .hg directory in all parent directories > set dirname [file normalize $dirname] > set prevdir {} > while {$dirname != $prevdir} { > set hgfilename [file join $dirname .hg] > if {[file isdirectory $hgfilename]} { return true } > set prevdir $dirname > set dirname [file dirname $dirname] > } > return false > } > 6108,6109c6140,6141 < Source control (AccuRev, BitKeeper, CVS, Subversion, Perforce, PVCS, < RCS, SCCS, ClearCase) --- > Source control (AccuRev, BitKeeper, ClearCase, CVS, Mercurial, Perforce, > PVCS, RCS, SCCS, and Subversion) 6128c6160,6162 < P4CLIENT, and CLEARCASE_ROOT respectively. --- > P4CLIENT, and CLEARCASE_ROOT respectively. It detects and supports \ > Mercurial by looking for a directory named ".hg" in the current \ > directory or any of its ancestor directories. 6142c6176 < Where AccuRev, RCS, CVS, Subversion, SCCS, PVCS or Perforce is implied \ --- > When a source control system (RCS, CVS, etc.) is detected (see above) \ 6144c6178 < the the revision most recently checked in. --- > the revision most recently checked in. 6152c6186,6187 < Subversion version, followed by the SCCS version -- i.e. if a CVS \ --- > Subversion version, followed by the SCCS version, followed by RCS, \ > PVCS, Perforce, AccuRev, ClearCase, and Mercurial -- i.e. if a CVS \ 6154,6158c6189 < present, Subversion; if not and an SCCS directory is present, SCCS is \ < assumed; otherwise, if a CVS.CFG file is found, PVCS is assumed; \ < otherwise RCS is assumed. If none of the above apply and the AccuRev \ < environment variable ACCUREV_BIN is found, AccuRev is used. If P4CLIENT \ < is found, Perforce is used. If CLEARCASE_ROOT is found, ClearCase is used. --- > present, Subversion; etc.