8 dirAA
= "in-AAcommon-6077-1660"
10 dirCC
= "in-CCaixbranch"
13 maybe_do
:: String -> IO ()
15 = let r
= dirRR
++ "/" ++ f
20 do x
<- doesFileExist r
22 then hPutStrLn stderr ("done: " ++ f
)
24 do hPutStrLn stderr (" do: " ++ f
)
25 xx
<- system ("mkdir -p " ++ basename r
)
27 hPutStrLn stderr (rs
++ f
)
30 merge3
:: String -> String -> String -> String -> IO String
35 let same
= identical3 ca cb cc
38 do ec
<- system ("/bin/cp " ++ a
++ " " ++ r
)
41 else barf
"/bin/cp failed"
43 do ec
<- system ("kdiff3 -m -o " ++ r
++ " -b "
44 ++ a
++ " " ++ b
++ " " ++ c
++ " &> /dev/null" )
47 else barf
"kdiff3 failed"
49 barf
:: String -> IO a
51 = do hPutStrLn stderr ("FAIL: " ++ who
)
54 identical3
:: String -> String -> String -> Bool
55 identical3
[] [] [] = True
56 identical3
(x
:xs
) (y
:ys
) (z
:zs
)
57 = x
== y
&& y
== z
&& identical3 xs ys zs
58 identical3 _ _ _
= False
62 = do t
<- readFile "FILEScba"
66 basename
= reverse . drop 1 . dropWhile (/= '/') . reverse