diff --git a/darcs-beta.cabal b/darcs-beta.cabal
--- a/darcs-beta.cabal
+++ b/darcs-beta.cabal
@@ -1,5 +1,5 @@
 Name: darcs-beta
-version:        2.7.99.1
+version:        2.7.99.2
 License:        GPL
 License-file:   COPYING
 Author:         David Roundy <droundy@darcs.net>, <darcs-users@darcs.net>
@@ -34,7 +34,6 @@
 
 Build-Type:     Custom
 Cabal-Version:  >= 1.8
-Tested-with:    GHC==6.8.2
 
 extra-source-files:
   -- C headers
diff --git a/release/distributed-context b/release/distributed-context
--- a/release/distributed-context
+++ b/release/distributed-context
@@ -1,1 +1,1 @@
-Just "\nContext:\n\n[TAG 2.7.99.1\nFlorent Becker <florent.becker@ens-lyon.org>**20120401092449\n Ignore-this: 23fef1226d1278f70993402dc13ea30d\n] \n"
+Just "\nContext:\n\n[TAG 2.7.99.2\nGanesh Sittampalam <ganesh@earth.li>**20120407193707\n Ignore-this: 7f29828f935216eb111971563e8c0d04\n] \n"
diff --git a/src/Darcs/Arguments.hs b/src/Darcs/Arguments.hs
--- a/src/Darcs/Arguments.hs
+++ b/src/Darcs/Arguments.hs
@@ -554,7 +554,8 @@
           f2o _ = Nothing
 
 pipeInteractive, allPipeInteractive, allInteractive,
-  humanReadable, diffflags, allowProblematicFilenames, noskipBoring,
+  humanReadable, machineReadable,
+  diffflags, allowProblematicFilenames, noskipBoring,
   askLongComment, matchOneNontag, changesReverse, creatorhash,
   changesFormat, matchOneContext, happyForwarding, sendToContext,
   diffCmdFlag, storeInMemory, useExternalMerge,
@@ -567,7 +568,7 @@
   author, askdeps, lookforadds, ignoretimes, test, notest, help, forceReplace,
   allowUnrelatedRepos,
   matchOne, matchRange, matchSeveral, sendmailCmd,
-  logfile, rmlogfile, leaveTestDir, fromOpt,  recordRollback
+  logfile, rmlogfile, leaveTestDir, fromOpt,  recordRollback, amendUnrecord
       :: DarcsOption
 
 sign, applyas, verify :: DarcsOption
diff --git a/src/Darcs/Commands/WhatsNew.hs b/src/Darcs/Commands/WhatsNew.hs
--- a/src/Darcs/Commands/WhatsNew.hs
+++ b/src/Darcs/Commands/WhatsNew.hs
@@ -112,7 +112,7 @@
 
 whatsnewCmd :: [DarcsFlag] -> [String] -> IO ()
 whatsnewCmd opts args =
-   withRepository opts $ RepoJob $ \(repo :: Repository p C(r u t)) -> do
+   withRepository opts $ RepoJob $ \(repo :: Repository p C(r u r)) -> do
     files <- if null args
                  then return Nothing
                  else Just <$> fixSubPaths opts args
diff --git a/src/Darcs/Global.hs b/src/Darcs/Global.hs
--- a/src/Darcs/Global.hs
+++ b/src/Darcs/Global.hs
@@ -73,7 +73,6 @@
 import System.Process ( readProcessWithExitCode )
 import System.Time ( calendarTimeToString, toCalendarTime, getClockTime )
 import System.Environment ( getEnv )
-import System.Exit ( ExitCode(..) )
 import Prelude hiding (catch)
 
 
diff --git a/src/Darcs/Patch/ApplyMonad.hs b/src/Darcs/Patch/ApplyMonad.hs
--- a/src/Darcs/Patch/ApplyMonad.hs
+++ b/src/Darcs/Patch/ApplyMonad.hs
@@ -35,7 +35,7 @@
 import Darcs.MonadProgress
 
 -- TODO should UUID/Object live somewhere more central?
-import Darcs.Patch.Prim.V3.ObjectMap ( UUID, Object, ObjectMap, DirContent )
+import Darcs.Patch.Prim.V3.ObjectMap ( UUID, ObjectMap, DirContent )
 
 fn2ap :: FileName -> AnchoredPath
 fn2ap = floatPath . fn2fp
@@ -93,9 +93,9 @@
 instance (Functor m, Monad m) => ApplyMonad (HSM.TreeMonad m) Tree where
     type ApplyMonadBase (HSM.TreeMonad m) = m
     getApplyState = gets HSM.tree
-    nestedApply a init = lift $ runApplyMonad a init
-    liftApply a init = do x <- gets HSM.tree
-                          lift $ runApplyMonad (lift $ a x) init
+    nestedApply a start = lift $ runApplyMonad a start
+    liftApply a start = do x <- gets HSM.tree
+                           lift $ runApplyMonad (lift $ a x) start
 
     -- putApplyState needs some support from HSM
 
@@ -134,7 +134,7 @@
 withFileNames :: (Maybe [OrigFileNameOf]) -> [FileName] -> FilePathMonad a
     -> FilePathMonadState
 withFileNames mbofnos fps x = execState x ([], fps, ofnos) where
-    ofnos = maybe (map (\x -> (x, x)) fps) id mbofnos
+    ofnos = maybe (map (\y -> (y, y)) fps) id mbofnos
 
 instance ApplyMonad FilePathMonad Tree where
     type ApplyMonadBase FilePathMonad = Identity
diff --git a/src/Darcs/Patch/Choices.hs b/src/Darcs/Patch/Choices.hs
--- a/src/Darcs/Patch/Choices.hs
+++ b/src/Darcs/Patch/Choices.hs
@@ -61,7 +61,7 @@
                     ) where
 
 import Control.Monad.Identity ( Identity )
-import Control.Monad.State ( StateT(..), State )
+import Control.Monad.State ( StateT(..) )
 
 import Prelude hiding ( pred )
 
diff --git a/src/Darcs/Patch/Patchy/Instances.hs b/src/Darcs/Patch/Patchy/Instances.hs
--- a/src/Darcs/Patch/Patchy/Instances.hs
+++ b/src/Darcs/Patch/Patchy/Instances.hs
@@ -7,9 +7,7 @@
 import Darcs.Patch.Permutations ()
 import Darcs.Patch.FileHunk ( IsHunk )
 import Darcs.Patch.Viewing ()
-import Darcs.Patch.Apply( ApplyState )
 import Darcs.Witnesses.Ordered ( FL, RL )
-import Storage.Hashed.Tree( Tree )
 
 instance (IsHunk p, PatchListFormat p, Patchy p) => Patchy (FL p)
 instance (IsHunk p, PatchListFormat p, Patchy p) => Patchy (RL p)
diff --git a/src/Darcs/Patch/Prim.hs b/src/Darcs/Patch/Prim.hs
--- a/src/Darcs/Patch/Prim.hs
+++ b/src/Darcs/Patch/Prim.hs
@@ -1,9 +1,6 @@
 {-# OPTIONS_GHC -fno-warn-orphans #-}
 module Darcs.Patch.Prim
        ( showPrim, showPrimFL,
-         adddir, addfile, binary, changepref,
-         hunk, move, rmdir, rmfile, tokreplace,
-         primFromHunk,
          primIsAddfile, primIsHunk, primIsBinary, primIsSetpref,
          primIsAdddir, is_filepatch,
          canonize, tryToShrink,
diff --git a/src/Darcs/Patch/Prim/V1/Apply.hs b/src/Darcs/Patch/Prim/V1/Apply.hs
--- a/src/Darcs/Patch/Prim/V1/Apply.hs
+++ b/src/Darcs/Patch/Prim/V1/Apply.hs
@@ -10,23 +10,19 @@
       DirPatchType(..), FilePatchType(..) )
 import Darcs.Patch.Prim.V1.Show ( showHunk )
 
-import Darcs.Patch.FileName ( fn2fp, fp2fn )
+import Darcs.Patch.FileName ( fn2fp )
 import Darcs.Patch.Format ( FileNameFormat(..) )
 import Darcs.Patch.TokenReplace ( tryTokInternal )
 
-import Darcs.Global ( darcsdir )
 import Darcs.Patch.ApplyMonad ( ApplyMonad(..) )
 import Storage.Hashed.Tree( Tree )
 
-import Darcs.Repository.Prefs ( changePrefval )
-
 import Darcs.Witnesses.Ordered ( FL(..), mapFL_FL, spanFL, (:>)(..) )
 import Darcs.Witnesses.Unsafe ( unsafeCoercePStart )
 
 import ByteStringUtils ( unlinesPS, breakAfterNthNewline, breakBeforeNthNewline, )
 import Printer( renderString )
 
-import Control.Monad ( when )
 import qualified Data.ByteString as B ( ByteString, empty, null, concat )
 import qualified Data.ByteString.Char8 as BC (pack, singleton, unpack)
 import Data.List ( intersperse )
diff --git a/src/Darcs/Patch/Prim/V1/Show.hs b/src/Darcs/Patch/Prim/V1/Show.hs
--- a/src/Darcs/Patch/Prim/V1/Show.hs
+++ b/src/Darcs/Patch/Prim/V1/Show.hs
@@ -6,7 +6,6 @@
 
 import Prelude hiding ( pi )
 
-import Control.Monad ( join )
 import ByteStringUtils ( fromPS2Hex )
 import qualified Data.ByteString as B (ByteString, length, take, drop)
 import qualified Data.ByteString.Char8 as BC (head)
diff --git a/src/Darcs/Patch/RepoPatch.hs b/src/Darcs/Patch/RepoPatch.hs
--- a/src/Darcs/Patch/RepoPatch.hs
+++ b/src/Darcs/Patch/RepoPatch.hs
@@ -7,7 +7,7 @@
 import Darcs.Patch.Merge ( Merge )
 import Darcs.Patch.Patchy ( Patchy )
 import Darcs.Patch.Patchy.Instances ()
-import Darcs.Patch.Prim ( PrimPatchBase, PrimOf, FromPrim, FromPrims )
+import Darcs.Patch.Prim ( PrimPatchBase, PrimOf, FromPrim )
 import Darcs.Patch.Repair ( RepairToFL, Check )
 
 class (Patchy p, Merge p, Effect p, IsHunk p, FromPrim p, Conflict p, CommuteNoConflicts p,
diff --git a/src/Darcs/Patch/V1/Viewing.hs b/src/Darcs/Patch/V1/Viewing.hs
--- a/src/Darcs/Patch/V1/Viewing.hs
+++ b/src/Darcs/Patch/V1/Viewing.hs
@@ -2,11 +2,9 @@
 {-# LANGUAGE ViewPatterns #-}
 module Darcs.Patch.V1.Viewing () where
 
-import Darcs.Patch.FileHunk ( isHunk )
 import Darcs.Patch.Prim ( PrimPatch )
 import Darcs.Patch.Show ( ShowPatchBasic(..), ShowPatch(..) )
 import Darcs.Patch.Summary ( plainSummary )
-import Darcs.Patch.Viewing ( showContextHunk )
 
 import Darcs.Patch.V1.Apply ()
 import Darcs.Patch.V1.Core ( Patch(..) )
diff --git a/src/Darcs/Patch/V2/Non.hs b/src/Darcs/Patch/V2/Non.hs
--- a/src/Darcs/Patch/V2/Non.hs
+++ b/src/Darcs/Patch/V2/Non.hs
@@ -15,7 +15,7 @@
 -- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 -- Boston, MA 02110-1301, USA.
 
-{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-name-shadowing #-}
 {-# LANGUAGE CPP, FlexibleContexts, UndecidableInstances #-}
 
 #include "gadts.h"
@@ -64,8 +64,8 @@
 import Darcs.Witnesses.Show ( ShowDict(..), Show1(..), Show2(..), appPrec
                             , showsPrec2 )
 import Darcs.Witnesses.Sealed ( Sealed(Sealed) )
-import Printer ( Doc, empty, vcat, hiddenPrefix, blueText, redText, ($$) )
-import qualified Data.ByteString.Char8 as BC ( pack, singleton, ByteString )
+import Printer ( Doc, empty, vcat, hiddenPrefix, blueText, ($$) )
+import qualified Data.ByteString.Char8 as BC ( pack, singleton )
 
 -- |A 'Non' stores a context with a 'Prim' patch. It is a patch whose effect
 -- isn't visible - a Non-affecting patch.
diff --git a/src/Darcs/Patch/V2/Real.hs b/src/Darcs/Patch/V2/Real.hs
--- a/src/Darcs/Patch/V2/Real.hs
+++ b/src/Darcs/Patch/V2/Real.hs
@@ -15,7 +15,7 @@
 -- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 -- Boston, MA 02110-1301, USA.
 
-{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-name-shadowing #-}
 {-# LANGUAGE CPP #-}
 
 #include "gadts.h"
@@ -128,11 +128,11 @@
 -- | 'isForward' @p@ is @True@ if @p@ is either an 'InvConflictor' or
 -- 'Etacilpud'.
 isForward :: PrimPatch prim => RealPatch prim C(s y) -> Maybe Doc
-isForward = isForward'
+isForward p = case p of
+    p@(InvConflictor _ _ _) -> justRedP "An inverse conflictor" p
+    p@(Etacilpud _) -> justRedP "An inverse duplicate" p
+    _ -> Nothing
   where
-    isForward' p@(InvConflictor _ _ _) = justRedP "An inverse conflictor" p
-    isForward' p@(Etacilpud _) = justRedP "An inverse duplicate" p
-    isForward' _ = Nothing
     justRedP msg p = Just $ redText msg $$ showPatch p
 
 -- |'mergeUnravelled' is used when converting from Darcs V1 patches (Mergers)
diff --git a/src/Darcs/Repository/HashedIO.hs b/src/Darcs/Repository/HashedIO.hs
--- a/src/Darcs/Repository/HashedIO.hs
+++ b/src/Darcs/Repository/HashedIO.hs
@@ -65,7 +65,6 @@
                              compress :: !Compression, rootHash :: !String }
 type HashedIO p = StateT (HashDir RW p) IO
 
-data RO = RO
 data RW = RW
 {-
 class Readable r where
@@ -76,6 +75,7 @@
     isRO RO = True
 -}
 
+mWithCurrentDirectory :: FileName -> HashedIO p a -> HashedIO p a
 mWithCurrentDirectory fn j
     | fn' == fp2fn "" = j
     | otherwise =
@@ -94,6 +94,7 @@
                                            return x
     where fn' = normPath fn
 
+mInCurrentDirectory :: FileName -> HashedIO p a -> HashedIO p a
 mInCurrentDirectory fn j | fn' == fp2fn "" = j
                          | otherwise =
                              case breakOnDir fn' of
diff --git a/src/Darcs/Repository/Prefs.hs b/src/Darcs/Repository/Prefs.hs
--- a/src/Darcs/Repository/Prefs.hs
+++ b/src/Darcs/Repository/Prefs.hs
@@ -48,7 +48,6 @@
 import Darcs.Flags ( DarcsFlag( NoCache, NoSetDefault, DryRun, RemoteRepo ) )
 import Darcs.RepoPath ( AbsolutePath, ioAbsolute, toFilePath, getCurrentDirectory )
 import Darcs.Utils ( catchall, stripCr )
-import Darcs.Patch.ApplyMonad ( ApplyMonad(..) )
 import Darcs.External ( gzFetchFilePS, Cachable( Cachable ) )
 import qualified Data.ByteString.Char8 as BC ( unpack )
 import qualified Data.ByteString       as B  ( empty )
diff --git a/src/Darcs/Repository/Repair.hs b/src/Darcs/Repository/Repair.hs
--- a/src/Darcs/Repository/Repair.hs
+++ b/src/Darcs/Repository/Repair.hs
@@ -22,7 +22,6 @@
                                  mapRL, nullFL, (:||:)(..) )
 import Darcs.Witnesses.Sealed ( Sealed2(..), Sealed(..), unFreeLeft )
 import Darcs.Patch.Apply( ApplyState )
-import Darcs.Patch.ApplyMonad( ApplyMonad )
 import Darcs.Patch.Repair ( Repair(applyAndTryToFix) )
 import Darcs.Patch.PatchInfoAnd( hopefully )
 import Darcs.Patch.Info ( humanFriendly )
diff --git a/src/Darcs/Repository/State.hs b/src/Darcs/Repository/State.hs
--- a/src/Darcs/Repository/State.hs
+++ b/src/Darcs/Repository/State.hs
@@ -35,9 +35,9 @@
 import Prelude hiding ( filter )
 import Control.Monad( when )
 import Control.Applicative( (<$>) )
-import Data.Maybe( isJust, isNothing )
+import Data.Maybe( isJust )
 import Data.List( union )
-import Text.Regex( mkRegex, matchRegex )
+import Text.Regex( matchRegex )
 
 import System.Directory( removeFile, doesFileExist, doesDirectoryExist, renameFile )
 import System.FilePath ( (</>) )
@@ -194,9 +194,9 @@
 -- pretend that the working dir updates magically to the tentative state.
 workDirLessRepoWitness :: Repository p C(r u t)
                           -> (EqCheck C(u t))
-workDirLessRepoWitness r@(Repo _ _ rf _) | formatHas NoWorkingDir rf =
+workDirLessRepoWitness (Repo _ _ rf _) | formatHas NoWorkingDir rf =
   unsafeCoerceP IsEq
-                                         | otherwise = NotEq
+                                       | otherwise = NotEq
 
 -- | Obtains a Tree corresponding to the "recorded" state of the repository:
 -- this is the same as the pristine cache, which is the same as the result of
diff --git a/src/Darcs/Ssh.hs b/src/Darcs/Ssh.hs
--- a/src/Darcs/Ssh.hs
+++ b/src/Darcs/Ssh.hs
@@ -25,12 +25,6 @@
 import System.Environment ( getEnv )
 import System.Exit ( ExitCode(..) )
 
-#ifdef WIN32
-import Data.Bits ( (.&.) )
-import System.Random ( randomIO )
-import Darcs.Utils ( showHexLen )
-#endif
-
 import Control.Monad ( when )
 
 import qualified Data.ByteString as B (ByteString, hGet, writeFile )
diff --git a/src/Darcs/Test/Patch/Arbitrary/Generic.hs b/src/Darcs/Test/Patch/Arbitrary/Generic.hs
--- a/src/Darcs/Test/Patch/Arbitrary/Generic.hs
+++ b/src/Darcs/Test/Patch/Arbitrary/Generic.hs
@@ -25,7 +25,7 @@
 import Darcs.Witnesses.Ordered
 import Darcs.Patch.Merge ( Merge(..) )
 import Darcs.Patch.Patchy ( Invert(..), Commute(..) )
-import Darcs.Patch.Prim ( PrimOf, PrimPatch, PrimPatchBase, FromPrim(..), PrimConstruct( anIdentity ), move )
+import Darcs.Patch.Prim ( PrimOf, PrimPatch, PrimPatchBase, FromPrim(..), PrimConstruct( anIdentity ) )
 import Darcs.Patch.Prim.V1 ()
 import Darcs.Patch.V2 ( RealPatch ) -- XXX this is more or less a hack
 --import Darcs.ColorPrinter ( errorDoc )
diff --git a/src/Darcs/Test/Patch/Arbitrary/PatchV1.hs b/src/Darcs/Test/Patch/Arbitrary/PatchV1.hs
--- a/src/Darcs/Test/Patch/Arbitrary/PatchV1.hs
+++ b/src/Darcs/Test/Patch/Arbitrary/PatchV1.hs
@@ -29,29 +29,16 @@
 import Control.Monad ( liftM, liftM2, liftM3, liftM4, replicateM )
 
 import Darcs.Patch.Info ( PatchInfo, patchinfo )
-import Darcs.Test.Patch.Check ( PatchCheck,
-                                checkMove, removeDir, createDir,
-                                isValid, insertLine, fileEmpty, fileExists,
-                                deleteLine, modifyFile, createFile, removeFile,
-                                doCheck, doVerboseCheck, FileContents(..)
-                              )
-import Darcs.Patch.RegChars ( regChars )
-import ByteStringUtils ( linesPS )
-import qualified Data.ByteString as B ( ByteString, null, concat )
-import qualified Data.ByteString.Char8 as BC ( break, pack )
-import Darcs.Patch.FileName ( fn2fp )
-import qualified Data.Map as M ( mapMaybe )
+import qualified Data.ByteString as B ( ByteString )
+import qualified Data.ByteString.Char8 as BC ( pack )
 
 import Darcs.Patch ( addfile, adddir, move,
                      hunk, tokreplace, binary,
-                     changepref, invert, merge,
-                     effect )
-import Darcs.Patch.Invert ( Invert )
+                     changepref, invert, merge )
 import Darcs.Patch.V1 ()
 import qualified Darcs.Patch.V1.Core as V1 ( Patch(..) )
-import Darcs.Patch.V1.Core ( isMerger )
 import Darcs.Patch.Prim.V1 ()
-import Darcs.Patch.Prim.V1.Core ( Prim(..), DirPatchType(..), FilePatchType(..) )
+import Darcs.Patch.Prim.V1.Core ( Prim(..) )
 import Darcs.Witnesses.Ordered
 import Darcs.Witnesses.Sealed ( Sealed(Sealed), unseal, mapSeal, Sealed2(..) )
 import Darcs.Witnesses.Unsafe
diff --git a/src/Darcs/Test/Patch/Arbitrary/PrimV3.hs b/src/Darcs/Test/Patch/Arbitrary/PrimV3.hs
--- a/src/Darcs/Test/Patch/Arbitrary/PrimV3.hs
+++ b/src/Darcs/Test/Patch/Arbitrary/PrimV3.hs
@@ -1,5 +1,6 @@
+-- TODO: Remove these warning disabling flags...
+{-# OPTIONS_GHC -w #-}
 {-# LANGUAGE MultiParamTypeClasses, OverloadedStrings #-}
-{-# OPTIONS_GHC -fno-warn-orphans #-}
 module Darcs.Test.Patch.Arbitrary.PrimV3 where
 
 import qualified Darcs.Test.Patch.Arbitrary.Generic as T
diff --git a/src/Darcs/Test/Patch/Properties/Generic.hs b/src/Darcs/Test/Patch/Properties/Generic.hs
--- a/src/Darcs/Test/Patch/Properties/Generic.hs
+++ b/src/Darcs/Test/Patch/Properties/Generic.hs
@@ -33,7 +33,7 @@
 import Darcs.Test.Util.TestResult ( TestResult, succeeded, failed, rejected,
                                     (<&&>), fromMaybe )
 import Darcs.Test.Patch.RepoModel ( RepoModel, RepoState, repoApply, eqModel, showModel
-                                  , maybeFail, Fail )
+                                  , maybeFail )
 import Darcs.Test.Patch.WithState ( WithState(..), WithStartState(..) )
 import Darcs.Test.Patch.Arbitrary.Generic ( Tree, flattenOne )
 
diff --git a/src/Darcs/Test/Patch/Properties/V1Set2.hs b/src/Darcs/Test/Patch/Properties/V1Set2.hs
--- a/src/Darcs/Test/Patch/Properties/V1Set2.hs
+++ b/src/Darcs/Test/Patch/Properties/V1Set2.hs
@@ -49,7 +49,7 @@
                      readPatch, resolveConflicts,
                      fromPrim, showPatch )
 import Darcs.Patch.Commute ( Commute )
-import Darcs.Patch.Invert ( Invert, invertFL )
+import Darcs.Patch.Invert ( Invert )
 import qualified Darcs.Patch.V1 as V1 ( Patch )
 import Darcs.Patch.V1.Commute ( unravel, merger )
 import Darcs.Patch.Prim.V1 ()
diff --git a/src/Darcs/Test/Patch/RepoModel.hs b/src/Darcs/Test/Patch/RepoModel.hs
--- a/src/Darcs/Test/Patch/RepoModel.hs
+++ b/src/Darcs/Test/Patch/RepoModel.hs
@@ -1,12 +1,14 @@
 module Darcs.Test.Patch.RepoModel where
 import Darcs.Patch.Apply ( Apply, ApplyState )
-import Darcs.Witnesses.Show( Show1 )
 import Test.QuickCheck ( Gen )
 
 type Fail = Either String
+
+unFail :: Either [Char] t -> t
 unFail (Right x) = x
 unFail (Left err) = error $ "unFail failed: " ++ err
 
+maybeFail :: Either t a -> Maybe a
 maybeFail (Right x) = Just x
 maybeFail _ = Nothing
 
diff --git a/src/Darcs/Test/Patch/V1Model.hs b/src/Darcs/Test/Patch/V1Model.hs
--- a/src/Darcs/Test/Patch/V1Model.hs
+++ b/src/Darcs/Test/Patch/V1Model.hs
@@ -29,7 +29,7 @@
 import Darcs.Test.Util.QuickCheck ( alpha, uniques, bSized )
 import Darcs.Test.Patch.RepoModel
 
-import Darcs.Patch.Apply( Apply(..), applyToTree )
+import Darcs.Patch.Apply( applyToTree )
 import Darcs.Witnesses.Sealed ( Sealed, seal )
 import Darcs.Witnesses.Show
 
@@ -77,7 +77,7 @@
 -- Instances
 
 instance Show (V1Model C(x)) where
-  show repo = "V1Model{ " 
+  show repo = "V1Model{ "
             ++ intercalate " " (map showEntry $ list repo)
             ++ " }"
     where
@@ -145,13 +145,13 @@
 isDir _other                   = False
 
 fileContent :: File -> Content
-fileContent (RepoItem (T.File blob)) 
+fileContent (RepoItem (T.File blob))
   = lbs2content $ unFail $ T.readBlob blob
 fileContent _other
   = error "fileContent: Not a file."
 
 dirContent :: Dir -> [(Name, RepoItem)]
-dirContent (RepoItem (T.SubTree subtree)) 
+dirContent (RepoItem (T.SubTree subtree))
   = map (second RepoItem) $ M.toList $ T.items subtree
 dirContent _other
   = error "dirContent: Not a directory."
@@ -189,7 +189,7 @@
 -- * Comparing repositories
 
 diffRepos :: V1Model C(x) -> V1Model C(y) -> (V1Model C(u), V1Model C(v))
-diffRepos repo1 repo2 = 
+diffRepos repo1 repo2 =
   let (diff1,diff2) = unFail $ T.diffTrees hashedTree1 hashedTree2
     in (V1Model diff1, V1Model diff2)
   where
@@ -204,7 +204,7 @@
 ----------------------------------------------------------------------
 -- * QuickCheck generators
 
--- Testing code assumes that aFilename and aDirname generators 
+-- Testing code assumes that aFilename and aDirname generators
 -- will always be able to generate a unique name given a list of
 -- existing names. This should be OK as long as the number of possible
 -- file/dirnames is much bigger than the number of files/dirs per repository.
@@ -250,8 +250,8 @@
         -> Gen Dir
 aDir filesL dirL = root <$> aRepo filesL dirL
 
--- | @aRepo filesNo dirsNo@ produces repositories with *at most* 
--- @filesNo@ files and @dirsNo@ directories. 
+-- | @aRepo filesNo dirsNo@ produces repositories with *at most*
+-- @filesNo@ files and @dirsNo@ directories.
 -- The structure of the repository is aleatory.
 aRepo :: Int                -- ^ Maximum number of files
         -> Int              -- ^ Maximum number of directories
@@ -276,6 +276,7 @@
 -- Small repositories help generating (potentially) conflicting patches.
 instance RepoModel V1Model where
   type RepoState V1Model = Tree
+  showModel m = show m
   aSmallRepo = do filesNo <- frequency [(3, return 1), (1, return 2)]
                   dirsNo <- frequency [(3, return 1), (1, return 0)]
                   aRepo filesNo dirsNo
diff --git a/src/Darcs/Test/Patch/V3Model.hs b/src/Darcs/Test/Patch/V3Model.hs
--- a/src/Darcs/Test/Patch/V3Model.hs
+++ b/src/Darcs/Test/Patch/V3Model.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports -fno-warn-orphans #-}
 {-# LANGUAGE CPP, OverloadedStrings, MultiParamTypeClasses, StandaloneDeriving #-}
 
 #include "gadts.h"
diff --git a/src/win32/System/Posix/IO.hsc b/src/win32/System/Posix/IO.hsc
--- a/src/win32/System/Posix/IO.hsc
+++ b/src/win32/System/Posix/IO.hsc
@@ -9,7 +9,7 @@
 
 import Foreign.C.Error ( throwErrnoIfMinus1, throwErrnoIfMinus1_ )
 
-import GHC.Handle ( fdToHandle )
+import GHC.IO.Handle.FD ( fdToHandle )
 
 import System.Posix.Internals ( c_open, c_close, c_dup2 )
 import System.Posix.Types ( Fd(..), FileMode )
@@ -64,7 +64,7 @@
 
 
 fdToHandle :: Fd -> IO Handle
-fdToHandle fd = GHC.Handle.fdToHandle (fromIntegral fd)
+fdToHandle fd = GHC.IO.Handle.FD.fdToHandle (fromIntegral fd)
 
 dupTo :: Fd -> Fd -> IO Fd
 dupTo (Fd fd1) (Fd fd2) = do
diff --git a/tests/bin/hspwd.hi b/tests/bin/hspwd.hi
new file mode 100644
Binary files /dev/null and b/tests/bin/hspwd.hi differ
diff --git a/tests/bin/hspwd.o b/tests/bin/hspwd.o
new file mode 100644
Binary files /dev/null and b/tests/bin/hspwd.o differ
diff --git a/tests/bin/trackdown-bisect-helper.hi b/tests/bin/trackdown-bisect-helper.hi
new file mode 100644
Binary files /dev/null and b/tests/bin/trackdown-bisect-helper.hi differ
diff --git a/tests/bin/trackdown-bisect-helper.o b/tests/bin/trackdown-bisect-helper.o
new file mode 100644
Binary files /dev/null and b/tests/bin/trackdown-bisect-helper.o differ
diff --git a/tests/lib b/tests/lib
--- a/tests/lib
+++ b/tests/lib
@@ -16,16 +16,22 @@
     "./hspwd"
 }
 
-# switch locale to latin9 if supported if there's a locale command, skip test
-# otherwise
+# switch locale to one supporting the latin-9 (ISO 8859-15) character set if possible, otherwise skip test
+
+no_latin9_locale_warning () {
+    echo "no ISO 8859-15 locale found, skipping test"
+    echo "try (eg): sudo locale-gen en_US.ISO-8859-15"
+}
+
 switch_to_latin9_locale () {
     if ! which locale ; then
-        echo "no locale command"
-        exit 200 # skip test
+        echo "no locale command, skipping test"
+        exit 200
     fi
 
-    latin9_locale=`locale -a | grep @euro | head -n 1` || exit 200
-    test -n "$latin9_locale" || exit 200
+    # look for a ISO 8859-15 locale. locale -a shows iso885915, on ubuntu at least
+    latin9_locale=`locale -a | grep -i iso885915 | head -n 1` || (no_latin9_locale_warning; exit 200)
+    test -n "$latin9_locale" || (no_latin9_locale_warning; exit 200)
 
     echo "Using locale $latin9_locale"
     export LC_ALL=$latin9_locale
@@ -47,7 +53,6 @@
     export LC_ALL=$utf8_locale
     echo "character encoding is now `locale charmap`"
 }
-
 
 serve_http() {
     cat > light.conf <<EOF
