Hi all,
Here's a quick fix for issue27. I've been resistent on this, but it
seems that since so many people don't know how to use darcs properly
(particularly when they're first starting by converting old
repositories using tailor), it'll be simples to just make darcs more
robust.
David
Wed Sep 17 11:10:46 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* resolve issue27: add junk to patch identifiers.
New patches:
[resolve issue27: add junk to patch identifiers.
David Roundy <[EMAIL PROTECTED]>**20080917151046
Ignore-this: d48103060a01aee66ed65d17c5028372
] hunk ./configure.ac 203
dnl See if we need any packages from after the split base
+GHC_CHECK_MODULE(System.Random, random, randomRIO (0,10) :: IO Integer,,
+ AC_MSG_ERROR(Cannot find System.Random; try installing the Haskell package random?))
+
GHC_CHECK_MODULE(System.Directory, directory, doesFileExist "foo" :: IO Bool,,
AC_MSG_ERROR(Cannot find System.Directory; try installing the Haskell package directory?))
GHC_CHECK_MODULE(System.Time, old-time, getClockTime :: IO ClockTime,,
hunk ./src/Darcs/Commands/AmendRecord.lhs 153
Just a -> a
Nothing -> pi_author old_pinf
maybe_invert = if is_inverted old_pinf then invert_name else id
- new_pinf = maybe_invert $ patchinfo date new_name new_author new_log
- newp = fixp oldp chs new_pinf
+ new_pinf <- maybe_invert `fmap` patchinfo date new_name
+ new_author new_log
+ let newp = fixp oldp chs new_pinf
defineChanges newp
withGutsOf repository $ do
tentativelyRemovePatches repository opts (hopefully oldp :>: NilFL)
hunk ./src/Darcs/Commands/Record.lhs 200
-> [PatchInfo] -> FL Prim -> IO ()
do_actual_record repository opts name date my_author my_log logf deps chs =
do debugMessage "Writing the patch file..."
+ mypatch <- namepatch date name my_author my_log $
+ fromPrims $ progressFL "Writing changes:" chs
tentativelyAddPatch repository opts $ n2pia $ adddeps mypatch deps
debugMessage "Applying to pristine..."
withGutsOf repository (finalizeRepositoryChanges repository)
hunk ./src/Darcs/Commands/Record.lhs 211
when (isJust logf) $ removeFile (fromJust logf)
logMessage $ "Finished recording patch '"++name++"'"
where (logMessage,_,_) = loggers opts
- mypatch = namepatch date name my_author my_log $ fromPrims $ progressFL "Writing changes:" chs
failuremessage = "Failed to record patch '"++name++"'" ++
case logf of Just lf -> "\nLogfile left in "++lf++"."
Nothing -> ""
hunk ./src/Darcs/Commands/Record.lhs 390
ask_about_depends :: RepoPatch p => Repository p -> FL Prim -> [DarcsFlag] -> IO [PatchInfo]
ask_about_depends repository pa' opts = do
pps <- read_repo repository
- let pa = n2pia $ anonymous $ fromPrims pa'
- ps = (reverseRL $ headRL pps)+>+(pa:>:NilFL)
+ pa <- n2pia `fmap` anonymous (fromPrims pa')
+ let ps = (reverseRL $ headRL pps)+>+(pa:>:NilFL)
(pc, tps) = patch_choices_tps ps
ta = case filter ((pa `unsafeCompare`) . tp_patch) $ unsafeUnFL tps of
[tp] -> tag tp
hunk ./src/Darcs/Commands/Rollback.lhs 137
(name, my_log, logf) <- get_log opts newlog make_log $ invert ps''
date <- getIsoDateTime
my_author <- get_author opts
- let rbp = n2pia $ namepatch date name my_author my_log $ fromPrims $ invert ps''
+ rbp <- n2pia `fmap` namepatch date name my_author my_log
+ (fromPrims $ invert ps'')
debugMessage "Adding rollback patch to repository."
Sealed pw <- tentativelyMergePatches repository "rollback" (MarkConflicts : opts)
NilFL (rbp :>: NilFL)
hunk ./src/Darcs/Commands/Tag.lhs 83
name <- if (not . null) args
then return $ "TAG " ++ unwords args
else get_patchname opts
- let mypatch = namepatch date name the_author [] identity
- myinfo = patchinfo date name the_author []
+ myinfo <- patchinfo date name the_author []
+ let mypatch = infopatch myinfo identity
in do
tentativelyAddPatch repository opts $ n2pia $ adddeps mypatch deps
finalizeRepositoryChanges repository
hunk ./src/Darcs/Commands/Unrevert.lhs 129
case get_common_and_uncommon (rep,rep) of
(common,_ :\/: _) -> do
date <- getIsoDateTime
+ np <- namepatch date "unrevert" "anon" [] (fromRepoPrims repository p')
writeDocBinFile (unrevertUrl repository) $
hunk ./src/Darcs/Commands/Unrevert.lhs 131
- make_bundle [Unified] rec common
- (namepatch date "unrevert" "anonymous" []
- (fromRepoPrims repository p') :>: NilFL)
+ make_bundle [Unified] rec common (np :>: NilFL)
where fromRepoPrims :: RepoPatch p => Repository p C(r u t) -> FL Prim C(r y) -> p C(r y)
fromRepoPrims _ xs = fromPrims xs
\end{code}
hunk ./src/Darcs/Patch/Core.lhs 104
join_patchesFL :: FL Patch C(x y) -> Patch C(x y)
join_patchesFL ps = ComP $! ps
-namepatch :: Patchy p => String -> String -> String -> [String] -> p C(x y) -> Named p C(x y)
infopatch :: Patchy p => PatchInfo -> p C(x y) -> Named p C(x y)
adddeps :: Named p C(x y) -> [PatchInfo] -> Named p C(x y)
getdeps :: Named p C(x y) -> [PatchInfo]
hunk ./src/Darcs/Patch/Core.lhs 107
+
+namepatch :: Patchy p => String -> String -> String -> [String] -> p C(x y) -> IO (Named p C(x y))
namepatch date name author desc p
| '\n' `elem` name = error "Patch names cannot contain newlines."
hunk ./src/Darcs/Patch/Core.lhs 111
- | otherwise = NamedP (patchinfo date name author desc) [] p
-anonymous :: Patchy p => p C(x y) -> Named p C(x y)
+ | otherwise = do pinf <- patchinfo date name author desc
+ return $ NamedP pinf [] p
+
+anonymous :: Patchy p => p C(x y) -> IO (Named p C(x y))
anonymous p = namepatch "today" "anonymous" "unknown" ["anonymous"] p
hunk ./src/Darcs/Patch/Core.lhs 116
+
infopatch pi p = NamedP pi [] p
adddeps (NamedP pi _ p) ds = NamedP pi ds p
getdeps (NamedP _ ds _) = ds
hunk ./src/Darcs/Patch/Info.lhs 20
\begin{code}
module Darcs.Patch.Info ( PatchInfo, patchinfo, invert_name, is_inverted,
- idpatchinfo,
+ idpatchinfo, add_junk,
make_filename, make_alt_filename, readPatchInfo,
just_name, just_author, repopatchinfo, RepoPatchInfo,
human_friendly, to_xml, pi_date, set_pi_date,
hunk ./src/Darcs/Patch/Info.lhs 28
showPatchInfo,
) where
import Text.Html hiding (name, text)
+import System.Random ( randomRIO )
+import Numeric ( showHex )
+import Data.List ( isPrefixOf )
+
import FastPackedString
import Printer ( renderString, Doc, packedString,
empty, ($$), (<>), (<+>), vcat, text, blueText, prefix )
hunk ./src/Darcs/Patch/Info.lhs 56
deriving (Eq,Ord)
idpatchinfo :: PatchInfo
-idpatchinfo = patchinfo "identity" "identity" "identity" []
+idpatchinfo = PatchInfo myid myid myid [] False
+ where myid = packString "identity"
hunk ./src/Darcs/Patch/Info.lhs 59
-patchinfo :: String -> String -> String -> [String] -> PatchInfo
+patchinfo :: String -> String -> String -> [String] -> IO PatchInfo
patchinfo date name author log =
hunk ./src/Darcs/Patch/Info.lhs 61
- PatchInfo { _pi_date = packString date
- , _pi_name = packString name
- , _pi_author = packString author
- , _pi_log = map packString log
- , is_inverted = False }
+ add_junk $ PatchInfo { _pi_date = packString date
+ , _pi_name = packString name
+ , _pi_author = packString author
+ , _pi_log = map packString log
+ , is_inverted = False }
+
+add_junk :: PatchInfo -> IO PatchInfo
+add_junk pinf =
+ do x <- randomRIO (0,2^128 :: Integer)
+ return $ pinf { _pi_log = packString (head ignored++showHex x ""):
+ ignore_junk (_pi_log pinf) }
+
+ignored :: [String] -- this is a [String] so we can change the junk header.
+ignored = ["Ignore-this: "]
+
+ignore_junk :: [PackedString] -> [PackedString]
+ignore_junk = filter isnt_ignored
+ where isnt_ignored x = doesnt_start_with (unpackPS x) ignored
+ doesnt_start_with x ys = not $ any (`isPrefixOf` x) ys
+
\end{code}
\section{Patch info formatting}
hunk ./src/Darcs/Patch/Info.lhs 103
human_friendly pi =
text (friendly_d $ _pi_date pi) <> text " " <> packedString (_pi_author pi)
$$ hfn (_pi_name pi)
- $$ vcat (map ((text " " <>) . packedString) (_pi_log pi))
+ $$ vcat (map ((text " " <>) . packedString) (ignore_junk $ _pi_log pi))
where hfn x = case pi_tag pi of
Nothing -> inverted <+> packedString x
Just t -> text " tagged" <+> text t
hunk ./src/Darcs/Population.lhs 43
import Darcs.Patch ( RepoPatch, applyToPop, patchcontents, patchChanges,
Effect, effect )
import Darcs.Ordered ( FL(..), RL(..), reverseRL, concatRL, mapRL )
-import Darcs.Patch.Info ( PatchInfo, patchinfo, to_xml )
+import Darcs.Patch.Info ( PatchInfo, idpatchinfo, to_xml )
import Darcs.Patch.Set ( PatchSet )
import Darcs.Sealed ( Sealed(..), seal, unseal )
import Darcs.Repository ( withRepositoryDirectory, ($-), read_repo )
hunk ./src/Darcs/Population.lhs 59
\begin{code}
nullPI :: PatchInfo
-nullPI = patchinfo [] [] [] []
+nullPI = idpatchinfo
\end{code}
population of an empty repository
hunk ./src/Darcs/Repository/Internal.lhs 523
them = mapFL_FL hopefully themi
_ :/\: pc <- return $ merge (progressFL "Merging them" them :\/: progressFL "Merging us" us)
pend <- get_unrecorded_unsorted r -- we don't care if it looks pretty...
- pend' :/\: pw <- return $ merge (pc :\/: anonymous (fromPrims pend) :>: NilFL)
+ anonpend <- anonymous (fromPrims pend)
+ pend' :/\: pw <- return $ merge (pc :\/: anonpend :>: NilFL)
let pwprim = joinPatches $ progressFL "Examining patches for conflicts" $ mapFL_FL patchcontents pw
Sealed standard_resolved_pw <- return $ standard_resolution pwprim
debugMessage "Checking for conflicts..."
hunk ./src/Darcs/SelectChanges.lhs 199
Sealed pend <- if ignore_pending
then return $ seal (NilFL :: FL Prim C(r r))
else read_pending repository
- let pend_ = n2pia $ anonymous $ fromPrims pend
+ pend_ <- n2pia `fmap` anonymous (fromPrims pend)
sp <- without_buffering $ wspfr jn (doesnt_not_match opts)
(concatRL p_s) NilFL pend_
case sp of
Context:
[add a couple of tests of unrecord.
David Roundy <[EMAIL PROTECTED]>**20080917133738]
[add a few (passing) tests of pending handling in obliterate and unrecord.
David Roundy <[EMAIL PROTECTED]>**20080917130423]
[Use putStrLn for "Cancelled." message.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080916205014]
[remove now-unused is_addrmfile and is_addrmdir.
David Roundy <[EMAIL PROTECTED]>**20080916173136]
[resolve issue1012: it seems to be fixed by the fix for issue709.
David Roundy <[EMAIL PROTECTED]>**20080916173116]
[resolve issue885: fix patchSetToRepository to work with hashed.
David Roundy <[EMAIL PROTECTED]>**20080916173030]
[resolve issue709: avoid adding changes to pending in rmpend when possible.
David Roundy <[EMAIL PROTECTED]>**20080916173002]
[first-stage fix for issue709.
David Roundy <[EMAIL PROTECTED]>**20080916170333
Here I fix the bug which leads to a corrupt pending being left, with a
rmfile change but no hunk removing the contents. This doesn't fix
issue709, since an incorrect pending is left, it's just no longer a
corrupt pending (i.e. it's still got the rmfile, but if you record it
there's no problem).
]
[add new test that we don't do anything when repairing a clean repo.
David Roundy <[EMAIL PROTECTED]>**20080916165437]
[whitespace change in prepend.
David Roundy <[EMAIL PROTECTED]>**20080916160425]
[tiny refactor in Internal.lhs.
David Roundy <[EMAIL PROTECTED]>**20080916155922]
[simplify issue965 test (which took quite a while for me to figure out).
David Roundy <[EMAIL PROTECTED]>**20080916152028]
[make shell_harness print summary of passing tests when running bugs tests.
David Roundy <[EMAIL PROTECTED]>**20080916145820]
[trailing whitespace cleanup in Repository.Internal.
David Roundy <[EMAIL PROTECTED]>**20080916142112]
[Test for issue691.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080916111332]
[Make match.pl test understand Windows dates.
Eric Kow <[EMAIL PROTECTED]>**20080916011339
Windows does not abbreviate its timezones.
]
[Disable some tests that don't work under Windows.
Eric Kow <[EMAIL PROTECTED]>**20080916000912]
[Translate get.pl test into shell.
Eric Kow <[EMAIL PROTECTED]>**20080916000227
The original get.pl uses the Perl Cwd library, which seems not
to work for purposes of this test under MSYS.
]
[Resolve issue691: distinguish between NoArg and ReqArg in defaults parser.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080915224046]
[Move get_default_flag type to definition.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080915220316]
[reverse overly-invasive haddocking.
David Roundy <[EMAIL PROTECTED]>**20080915110353]
[In darcs send if POST fails try sendmail.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914234314]
[Grammar in Darcs.Commands.Send.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914232923]
[Print "Successfully sent patch bundle to" only when we really sent something.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914232905]
[Fix overzealous escaping in haddock.
Eric Kow <[EMAIL PROTECTED]>**20080915070926]
[Haddock documentation for English.lhs
[EMAIL PROTECTED]
Docstrings by Eric Kow
]
[Haddock documentation for PrintPatch
[EMAIL PROTECTED]
[Haddock documentation for Flags
[EMAIL PROTECTED]
[Haddock documentation for Motd
[EMAIL PROTECTED]
docstring by Eric Kow
]
[Haddock string for TheCommands
[EMAIL PROTECTED]
Docstring by Eric Kow
]
[Run testing in temp directories to avoid collosions, fail if DarcsURL header is not found.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914223930]
[Use tempfile() UNLINK option to automatically remove temp files at exit.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914223827]
[Coding style in upload.cgi.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914223751]
[Stop after we found the first DarcsURL: in patch bundle.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914220421]
[Spaces in upload.cgi.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080914220324]
[Really allow pull.sh test to pass on Windows.
Eric Kow <[EMAIL PROTECTED]>**20080914211458
It seems that these redirections cause an openBinaryFile failure under
Windows. I do not yet understand why using different names makes a
difference, but it could provide an interesting clue.
]
[rewrite upload.cgi so it won't need any customization by default.
David Roundy <[EMAIL PROTECTED]>**20080913171447
The downside is that it has to do a darcs get --lazy in order to check if
the patch can be applied. If you define $target_repo, however, it doesn't
need to do this (but then can only accept patches to a single
locally-present repo).
]
[when _darcs/prefs/post is present, use _darcs/prefs/post for To: header.
David Roundy <[EMAIL PROTECTED]>**20080913171025]
[sketchy documentation of _darcs/prefs/post
David Roundy <[EMAIL PROTECTED]>**20080913115655]
[ChangeLog entries for darcs 2.0.3pre1
Eric Kow <[EMAIL PROTECTED]>**20080914094144]
[Disable amend-cancelling test under Cygwin.
Eric Kow <[EMAIL PROTECTED]>**20080913213039]
[Make binary.sh test more portable (avoid copying an exe).
Eric Kow <[EMAIL PROTECTED]>**20080913212843
Under Windows, copying the exe file will result in an .exe extension
being appended to the filename. This confuses the test.
]
[set default upload.cgi to work on darcs-unstable.
David Roundy <[EMAIL PROTECTED]>**20080913112227]
[Improve upload.cgi.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912230953
- check if patch is valid before sending
- use sendmail to send patches or drop to maildir
]
[Spaces and punctuation in upload.cgi.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912230827]
[fix problem in Darcs.URL refactor pointed out by Eric.
David Roundy <[EMAIL PROTECTED]>**20080913104327]
[Disable a pull.sh test under Windows.
Eric Kow <[EMAIL PROTECTED]>**20080912224027
It relies on darcs not working if we chmod u-r a file.
This seems to have little effect in Windows.
]
[refactor Darcs.URL to eliminate use of Regexes.
David Roundy <[EMAIL PROTECTED]>**20080912173611
The algorithms here are not tricky, and I find this easier to read.
]
[change is_file to return false on [EMAIL PROTECTED]:
David Roundy <[EMAIL PROTECTED]>**20080912173501]
[clean up whitespace.
David Roundy <[EMAIL PROTECTED]>**20080912150248]
[fix manual for optional arguments.
David Roundy <[EMAIL PROTECTED]>**20080912150231]
[clean up whitespace.
David Roundy <[EMAIL PROTECTED]>**20080912145708]
[add test for new --output-auto-name feature.
David Roundy <[EMAIL PROTECTED]>**20080912145648]
[Spaces in Darcs.Commands.Send module.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912122223]
[Make '--output-auto-name' accept optional directory argument.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912120516]
[Add DarcsOptAbsPathOption for options with optional path argument.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912112458]
[Refactor Darcs.Repository.Prefs.getCaches.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912055204]
[Print warning when '--http-pipelining' option is used, but darcs is compiled without HTTP pipelining support.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912054253]
[Do not download URL we have speculated before.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912053236]
[Spaces and parentheses in URL module.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912053000]
[Coding style in Darcs.Arguments.network_options.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911140710]
[Resolve issue1054: --no-cache option to ignore patch caches.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911140233]
[Remove unused variable from configure.ac.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911132107]
[Comment in configure.ac.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911115840]
[Indentation fixes in configure.ac.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911115117]
[Formating and minor refactoring in URL.urlThread.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080910061227]
[insecure printfs - fix the two that I can currently hit
Steve Cotton <[EMAIL PROTECTED]>**20080910230659]
[TAG this version works.
David Roundy <[EMAIL PROTECTED]>**20080910212908]
Patch bundle hash:
ca6376058ead441d10189ea220f8eb02891afcf7
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users