[darcs-users] Re: traditional patch output?

Samuel Tardieu sam at rfc1149.net
Fri Nov 26 13:49:32 UTC 2004


>>>>> "Jani" == Jani Monoses <jani at iv.ro> writes:

Jani> Hello which would be the easiest way (if possible) of getting
Jani> patches output in a format that patch (and people used to that
Jani> format) can grok? I guess a script to transform the hunk-based
Jani> output could do it but I wonder if the darcs patch format
Jani> provides all the info needed ?

The darcs patch format doesn't provide everything you need; it has
first to build two versions that it can diff.

Look at: darcs diff -u -p patchregexp

For example, in the repository for Darcs itself:

% darcs diff -u -p "don't need use_mmap"
Fri Jun 18 13:20:00 CEST 2004  David Roundy <droundy at abridgegame.org>
  * don't need use_mmap in Repository.lhs.

diff -rN -u -u darcs-old/Repository.lhs darcs-new/Repository.lhs
--- darcs-old/Repository.lhs    2004-11-26 14:48:04.000000000 +0100
+++ darcs-new/Repository.lhs    2004-11-26 14:48:18.000000000 +0100
@@ -99,7 +99,6 @@
                  get_patches_beyond_tag, get_patches_in_tag )
 import RepoPrefs ( filetype_function,
                    darcsdir_filter, boring_file_filter )
-import Autoconf ( use_mmap )
 import PatchChoices ( patch_choices, get_first_choice,
                       force_first, force_last,
                     )
@@ -251,12 +250,11 @@
 unempty l = Just l
 
 slurp_recorded :: FilePath -> IO Slurpy
-slurp_recorded d = if use_mmap then mmap_slurp $ d++"/_darcs/current"
-                               else slurp $ d++"/_darcs/current"
+slurp_recorded d = mmap_slurp $ d++"/_darcs/current"
 
 mmap_slurp_all_but_darcs :: FilePath -> IO Slurpy
 mmap_slurp_all_but_darcs d = do
-    s <- if use_mmap then mmap_slurp d else slurp d
+    s <- mmap_slurp d
     case slurp_remove (fp2fn "./_darcs") s of
         Nothing -> return s
         Just s' -> return s'
@@ -274,8 +272,7 @@
 \begin{code}
 slurp_pending :: FilePath -> IO Slurpy
 slurp_pending d = do
-  cur <- if use_mmap then mmap_slurp $ d ++ "/_darcs/current"
-                     else slurp $ d ++ "/_darcs/current"
+  cur <- mmap_slurp $ d ++ "/_darcs/current"
   mbpend <- read_pending
   case mbpend of
     Just pend ->





More information about the darcs-users mailing list