[darcs-users] "darcs change <file>" fails on partial repositories

Andrew Pimlott andrew at pimlott.net
Fri Apr 30 20:48:38 UTC 2004


because it calls filter_patches_by_names, which expects to find all the
patches.  This change quiets the error by skipping the patches that
can't be found.  It would really be better to print a warning about some
patches being skipped.  Arguably, this patch is worse than the current
code, because it doesn't tell you the output is partial.

    hunk ./Changes.lhs 156
         case look_touch fs (invert p) of
         (True, fs') -> (pinfo, Just p) : filter_patches_by_names fs' ps
         (False, fs') -> filter_patches_by_names fs' ps
    -filter_patches_by_names _ _ = bug "bug in filter_patches_by_names"
    +filter_patches_by_names fs ((_, Nothing):ps) = filter_patches_by_names fs ps

     changelog :: [DarcsFlag] -> [(PatchInfo, Maybe Patch)] -> String
     changelog opts pis
    }

The last case is removed because ghc was smart enough to warn me that it
was dead.

BTW, I really like the ability to record only some changes even within a
single file.  Running "darcs record Changes.lhs" and interactively
choosing the hunks I want is very slick.

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-darcs-patch
Size: 4857 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20040430/f9929755/attachment.bin 


More information about the darcs-users mailing list