Hi all,
Here's a bunch of simple bug fixes that I'm pushing. The most
interesting one is the pending fix, which might affect other bugs that
don't have test scripts.
David
Tue Sep 16 10:11:32 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* first-stage fix for issue709.
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).
Tue Sep 16 10:15:05 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* remove now-unused is_addrmfile and is_addrmdir.
Tue Sep 16 10:21:12 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* trailing whitespace cleanup in Repository.Internal.
Tue Sep 16 10:58:20 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* make shell_harness print summary of passing tests when running bugs tests.
Tue Sep 16 10:59:35 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* resolve issue885: fix patchSetToRepository to work with hashed.
Tue Sep 16 11:04:43 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* resolve issue1012: it seems to be fixed by the fix for issue709.
Tue Sep 16 11:17:27 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* resolve issue709: avoid adding changes to pending in rmpend when possible.
Tue Sep 16 11:20:28 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* simplify issue965 test (which took quite a while for me to figure out).
New patches:
[first-stage fix for issue709.
David Roundy <[EMAIL PROTECTED]>**20080916141132
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).
] hunk ./bugs/issue709_pending_look-for-adds.sh 3
#!/bin/sh
set -ve
+
+## I would use the builtin !, but that has the wrong semantics.
+not () { "$@" && exit 1 || :; }
+
rm -rf temp1
mkdir temp1
cd temp1
hunk ./bugs/issue709_pending_look-for-adds.sh 11
darcs init
+
+# Here we check whether recording just one of two --look-for-add
+# addfiles causes any trouble (which it doesn't)
+
+date > f1
+date > f2
+echo yyd | darcs record -l -m ff
+
+cat _darcs/patches/pending
+
+not darcs wh
+rm f2
+
+# Try recording a file add without --look-for-adds, with a setpref
+# patch present that we don't record.
+
darcs setpref boringfile .boring
hunk ./bugs/issue709_pending_look-for-adds.sh 28
-echo bar > foo
-echo yyd | darcs record --look-for-adds -mP1
+
+echo bar > bar
+darcs add bar
+echo yyd | darcs record -mbar
+
+cat _darcs/patches/pending
+
darcs whatsnew -s
hunk ./bugs/issue709_pending_look-for-adds.sh 36
+
test -z "`darcs whatsnew -s`"
hunk ./bugs/issue709_pending_look-for-adds.sh 38
+
+# Now try the same thing using --look-for-adds
+
+echo foo > foo
+
+darcs wh -l
+
+echo yyd | darcs record --look-for-adds -mfoo
+
+cat _darcs/patches/pending
+
+darcs whatsnew -s
+
+test -z "`darcs whatsnew -s`"
+
+cd ..
+rm -rf temp1
hunk ./src/Darcs/Repository/Internal.lhs 113
patch2patchinfo, readPatch,
writePatch, effect, invert,
is_addfile, is_adddir,
- is_addrmfile, is_addrmdir, is_setpref,
+ is_setpref,
apply, apply_to_slurpy,
empty_markedup_file, MarkedUpFile
)
hunk ./src/Darcs/Repository/Internal.lhs 460
handle_pend_for_add (Repo _ _ _ rt) p =
do let pn = pendingName rt ++ ".tentative"
Sealed pend <- (readPrims `fmap` gzReadFilePS pn) `catchall` (return $ Sealed NilFL)
- let effectp = if allFL is_simple pend then crude_sift $ effect p
+ let effectp = if allFL is_simple pend then invert $ crude_sift $ invert $ effect p
else effect p
Sealed newpend <- return $ rmpend (progressFL "Removing from pending:" effectp) pend
writePatch pn $ fromPrims_ newpend
hunk ./src/Darcs/Repository/Internal.lhs 475
is_simple :: Prim C(x y) -> Bool
is_simple x = is_hunk x || is_binary x || is_setpref x ||
- is_addrmfile x || is_addrmdir x
+ is_addfile x || is_adddir x
crude_sift :: FL Prim C(x y) -> FL Prim C(x y)
crude_sift xs = if allFL is_simple xs then filterFL ishunkbinary xs else xs
[remove now-unused is_addrmfile and is_addrmdir.
David Roundy <[EMAIL PROTECTED]>**20080916141505] hunk ./src/Darcs/Patch.lhs 56
showContextPatch, showPatch, showNicely,
infopatch, changepref,
thing, things,
- is_similar, is_addfile, is_addrmfile, is_hunk, is_setpref,
+ is_similar, is_addfile, is_hunk, is_setpref,
#ifndef GADT_WITNESSES
merger, is_merger, merge,
commute, commutex, list_touched_files,
hunk ./src/Darcs/Patch.lhs 67
#endif
resolve_conflicts,
Effect, effect,
- is_binary, gzWritePatch, writePatch, is_adddir, is_addrmdir,
+ is_binary, gzWritePatch, writePatch, is_adddir,
invert, invertFL, invertRL, identity,
commuteFL, commuteRL,
readPatch,
hunk ./src/Darcs/Patch.lhs 126
sort_coalesceFL,
rmdir, rmfile, tokreplace, adddir, addfile,
binary, changepref, hunk, move,
- is_adddir, is_addrmdir, is_addfile, is_addrmfile,
+ is_adddir, is_addfile,
is_hunk, is_binary, is_setpref,
is_similar,
try_to_shrink )
hunk ./src/Darcs/Patch/Prim.lhs 33
formatFileName, FileNameFormat(..),
adddir, addfile, binary, changepref,
hunk, move, rmdir, rmfile, tokreplace,
- is_addrmfile, is_addfile, is_hunk, is_binary, is_setpref,
- is_similar, is_adddir, is_addrmdir, is_filepatch,
+ is_addfile, is_hunk, is_binary, is_setpref,
+ is_similar, is_adddir, is_filepatch,
canonize, try_to_shrink, modernizePrim,
subcommutes, sort_coalesceFL, join,
applyBinary, try_tok_internal,
hunk ./src/Darcs/Patch/Prim.lhs 136
is_adddir (DP _ AddDir) = True
is_adddir _ = False
-is_addrmfile :: Prim C(x y) -> Bool
-is_addrmfile (FP _ AddFile) = True
-is_addrmfile (FP _ RmFile) = True
-is_addrmfile _ = False
-
-is_addrmdir :: Prim C(x y) -> Bool
-is_addrmdir (DP _ AddDir) = True
-is_addrmdir (DP _ RmDir) = True
-is_addrmdir _ = False
-
is_hunk :: Prim C(x y) -> Bool
is_hunk (FP _ (Hunk _ _ _)) = True
is_hunk _ = False
[trailing whitespace cleanup in Repository.Internal.
David Roundy <[EMAIL PROTECTED]>**20080916142112] hunk ./src/Darcs/Repository/Internal.lhs 239
then return (Right ())
else return (Left "You need to be in a repository directory to run this command.")
amInRepository (_:fs) = amInRepository fs
-amInRepository [] =
+amInRepository [] =
seekRepo (Left "You need to be in a repository directory to run this command.")
-- | hunt upwards for the darcs repository
hunk ./src/Darcs/Repository/Internal.lhs 416
-- @todo: we should not have to open the result of HashedRepo and
-- seal it. Instead, update this function to work with type witnesses
--- by fixing DarcsRepo to match HashedRepo in the handling of
+-- by fixing DarcsRepo to match HashedRepo in the handling of
-- Repository state.
read_repo :: RepoPatch p => Repository p C(r u t) -> IO (PatchSet p C(r))
read_repo repo@(Repo r opts rf _)
hunk ./src/Darcs/Repository/Internal.lhs 454
then runSilently $ apply opts patch
else runTolerantly $ apply opts patch
-handle_pend_for_add :: forall p q C(r u t x y). (RepoPatch p, Effect q)
+handle_pend_for_add :: forall p q C(r u t x y). (RepoPatch p, Effect q)
=> Repository p C(r u t) -> q C(x y) -> IO ()
handle_pend_for_add (Repo _ opts _ _) _ | NoUpdateWorking `elem` opts = return ()
handle_pend_for_add (Repo _ _ _ rt) p =
hunk ./src/Darcs/Repository/Internal.lhs 570
"If you would rather apply the patch and mark the conflicts,\n"++
"use the --mark-conflicts or --allow-conflicts options to "++cmd++"\n"++
"These can set as defaults by adding\n"++
- " "++cmd++" mark-conflicts\n"++
+ " "++cmd++" mark-conflicts\n"++
"to "++darcsdir++"/prefs/defaults in the target repo. "
check_unrecorded_conflicts :: forall p C(r y). RepoPatch p => [DarcsFlag] -> FL (Named p) C(r y) -> IO Bool
[make shell_harness print summary of passing tests when running bugs tests.
David Roundy <[EMAIL PROTECTED]>**20080916145820] hunk ./tests/shell_harness 38
my $OK = 1;
my @Failures;
-
+my @Passes;
+
`which bash`;
if( $? != 0 ) {
die "You need bash to run the shell tests!"
hunk ./tests/shell_harness 53
my $output = `bash $test 2>&1`;
if( $? == 0 ) {
+ push @Passes, $test;
print " passed.\n";
}
else {
hunk ./tests/shell_harness 65
}
}
+my $CWD = cwd();
+if ($CWD =~ /bugs/ && $#Passes >= 0) {
+ print "Some tests passed:\n";
+ print "\t$_\n" for @Passes;
+}
if ($OK) {
print "All tests successful!\n";
}
[resolve issue885: fix patchSetToRepository to work with hashed.
David Roundy <[EMAIL PROTECTED]>**20080916145935] move ./bugs/issue885_get_to_match.sh ./tests/issue885_get_to_match.sh
hunk ./src/Darcs/Commands/Get.lhs 159
debugMessage "Using economical get --to-match handling"
fromrepo <- identifyRepositoryFor repository repodir
Sealed patches_to_get <- get_one_patchset fromrepo opts
- patchSetToRepository patches_to_get opts
+ patchSetToRepository fromrepo patches_to_get opts
debugMessage "Finished converting selected patch set to new repository"
else copy_repo_and_go_to_chosen_version opts repodir rfsource rf putInfo
where am_informative = not $ Quiet `elem` opts
hunk ./src/Darcs/Repository.lhs 227
Left e -> bug ("Current directory not repository in writePatchSet: " ++ e)
debugMessage "Writing inventory"
if format_has HashedInventory rf2
- then do HashedRepo.write_tentative_inventory c (compression opts) patchset
+ then do writeFile "_darcs/tentative_pristine" ""
+ HashedRepo.write_tentative_inventory c (compression opts) patchset
HashedRepo.finalize_tentative_changes repo (compression opts)
else DarcsRepo.write_inventory_and_patches opts patchset
return repo
hunk ./src/Darcs/Repository.lhs 238
-- repository with the --to-match flag and the new repository is not in hashed format.
-- This function does not (yet) work for hashed repositories. If the passed @[EMAIL PROTECTED] tell
-- darcs to create a hashed repository, this function will call @[EMAIL PROTECTED]
-patchSetToRepository :: RepoPatch p => PatchSet p C(x) -> [DarcsFlag] -> IO (Repository p C(r u t))
-patchSetToRepository patchset opts = do
+patchSetToRepository :: RepoPatch p => Repository p -> PatchSet p C(x)
+ -> [DarcsFlag] -> IO (Repository p C(r u t))
+patchSetToRepository (Repo fromrepo _ rf _) patchset opts = do
+ when (format_has HashedInventory rf) $ -- set up sources and all that
+ do repox <- writePatchSet patchset opts
+ HashedRepo.copy_repo repox opts fromrepo
repo <- writePatchSet patchset opts
read_repo repo >>= (apply_patches opts . reverseRL . concatRL)
debugMessage "Writing the pristine"
[resolve issue1012: it seems to be fixed by the fix for issue709.
David Roundy <[EMAIL PROTECTED]>**20080916150443] move ./bugs/issue1012_unrecord_remove.sh ./tests/issue1012_unrecord_remove.sh
[resolve issue709: avoid adding changes to pending in rmpend when possible.
David Roundy <[EMAIL PROTECTED]>**20080916151727] move ./bugs/issue709_pending_look-for-adds.sh ./tests/issue709_pending_look-for-adds.sh
hunk ./src/Darcs/Repository.lhs 238
-- repository with the --to-match flag and the new repository is not in hashed format.
-- This function does not (yet) work for hashed repositories. If the passed @[EMAIL PROTECTED] tell
-- darcs to create a hashed repository, this function will call @[EMAIL PROTECTED]
-patchSetToRepository :: RepoPatch p => Repository p -> PatchSet p C(x)
+patchSetToRepository :: RepoPatch p => Repository p C(r1 u1 r1) -> PatchSet p C(x)
-> [DarcsFlag] -> IO (Repository p C(r u t))
patchSetToRepository (Repo fromrepo _ rf _) patchset opts = do
when (format_has HashedInventory rf) $ -- set up sources and all that
hunk ./src/Darcs/Repository/Internal.lhs 75
import Workaround ( createDirectoryIfMissing, getCurrentDirectory, renameFile, setExecutable )
import FastPackedString ( PackedString, readFilePS, gzReadFilePS, nilPS, packString, takePS )
import Darcs.Patch ( Patch, RealPatch, Effect, is_hunk, is_binary, description,
- try_to_shrink, commuteFL )
+ try_to_shrink, commuteFL, commute )
import Darcs.Patch.Prim ( try_shrinking_inverse, Conflict )
import Darcs.Patch.Bundle ( scan_bundle, make_bundle )
import Darcs.SlurpDirectory ( Slurpy, slurp_unboring, mmap_slurp, co_slurp,
hunk ./src/Darcs/Repository/Internal.lhs 133
getCaches )
import Darcs.Lock ( withLock, writeDocBinFile, withDelayedDir, removeFileMayNotExist,
withTempDir, withPermDir )
-import Darcs.Sealed ( Sealed(Sealed), mapSeal, seal, FlippedSeal(FlippedSeal), flipSeal )
+import Darcs.Sealed ( Sealed(Sealed), seal, FlippedSeal(FlippedSeal), flipSeal )
import Darcs.Repository.InternalTypes( Repository(..), RepoType(..) )
import Darcs.Global ( darcsdir )
#include "impossible.h"
hunk ./src/Darcs/Repository/Internal.lhs 468
rmpend NilFL x = Sealed x
rmpend _ NilFL = Sealed NilFL
rmpend (x:>:xs) xys | Just ys <- removeFL x xys = rmpend xs ys
- rmpend (x:>:xs) ys = case commuteWhatWeCanFL (x:>xs) of
- a:>x':>b -> (invert (x':>:b) +>+) `mapSeal` rmpend a ys
+ rmpend (x:>:xs) ys =
+ case commuteWhatWeCanFL (x:>xs) of
+ a:>x':>b -> case rmpend a ys of
+ Sealed ys' -> case commute (invert (x':>:b) :> ys') of
+ Just (ys'' :> _) -> seal ys''
+ Nothing -> seal $ invert (x':>:b)+>+ys'
+ -- DJR: I don't think this
+ -- last case should be
+ -- reached, but it also
+ -- shouldn't lead to
+ -- corruption.
fromPrims_ :: FL Prim C(a b) -> Patch C(a b)
fromPrims_ = fromPrims
[simplify issue965 test (which took quite a while for me to figure out).
David Roundy <[EMAIL PROTECTED]>**20080916152028] hunk ./bugs/issue865_replace_in_moved.sh 28
darcs add file1
darcs record -a -m "0" --author X
-ed file1 <<EOF
-1s/aa/aaaa/
-w
-q
+cat <<EOF > file1
+aaaa
+bb
+cc
+aa
+bb
+cc
EOF
hunk ./bugs/issue865_replace_in_moved.sh 37
-darcs replace aa aaaa file1
+darcs replace aa aaaa file1 > out
+cat out
+grep 'Skipping file' out && exit 1
darcs mv file1 file2
hunk ./bugs/issue865_replace_in_moved.sh 43
-ed file2 <<EOF
-2s/bb/beebee/
-w
-q
+cat <<EOF > file2
+aaaa
+beebee
+cc
+aa
+bb
+cc
EOF
hunk ./bugs/issue865_replace_in_moved.sh 52
-! darcs replace bb beebee file2 2>&1 |
-tee /dev/tty |
-grep -q 'Skipping file'
-exit=$?
+darcs replace bb beebee file2 > out
+cat out
+grep 'Skipping file' out && exit 1
hunk ./bugs/issue865_replace_in_moved.sh 56
-cd .. && rm -rf temp
-
-exit $exit
+cd ..
+rm -rf temp
Context:
[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:
06c06cb64478310636dafef94e6a1f3bfe27cc1e
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users