[darcs-users] Can't download darcs 2.0.1rc2

Eric Y. Kow eric.kow at gmail.com
Tue Jul 8 06:34:40 UTC 2008


On Tue, Jul 08, 2008 at 13:10:41 +1000, Trent W. Buck wrote:
> I suggest patching src/Darcs/Utils.lhs to implement "view_file" on top
> of get_viewer, similar to how get_editor and edit_file behave.  It's
> extremely sensible to try running more, then cat, if less can't be
> executed -- even on Unix.

Darcs already tries does this.  Please see src/Darcs/External.hs

viewDocWith :: Printers -> Doc -> IO ()
viewDocWith pr msg = do
  isTerminal <- hIsTerminalDevice stdout
  if isTerminal && lengthGreaterThan (20 :: Int) (lines $ renderString msg)
     then do viewer <- get_viewer
             pipeDocToPager viewer [] pr msg
               `ortryrunning` pipeDocToPager  "less" [] pr msg
               `ortryrunning` pipeDocToPager  "more" [] pr msg
               `ortryrunning` pipeDocToPager "" [] pr msg
     else pipeDocToPager "" [] pr msg
  return ()
              where lengthGreaterThan n _ | n <= 0 = True
                    lengthGreaterThan _ [] = False
                    lengthGreaterThan n (_:xs) = lengthGreaterThan (n-1) xs

There is a known mystery issue with darcs which causes the problem
originally reported in this thread.  I'm not sure what to do about
it, although I do know that using MSYS or Cygwin makes it go away.

There was a related issue that is solved in darcs 2.0.2, where darcs
would not notice that 'less' failed to run (because it was expecting
an exit 127, which does not happen on Windows).  But now it does
pick up on these failures, and so should try the alternative editors
it was always meant to try.  Maybe Salvatore was referring to that
issue.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20080708/fab5f8fb/attachment.pgp 


More information about the darcs-users mailing list