Here is the complete fix for Issue281, with a patch that merges
it all with darcs-unstable.
In some e-mail I can't find, Eric Kow wrote:
> Some questions/comments:
> 1. How come remove_from_checkpoint_inventory takes a repodir and
> write_checkpoint_patch does not?
I tried to find a pattern to which functions take a dir
argument, and which do not but rely on cwd, but failed. So I
changed remove_from_checkpoint_inventory to rely on cwd.
> 2. What if repodir is "" -- can that ever happen? perhaps (///) is a
> better choice than (++)
I agree (///) is better, but not needed any more due to 1.
> 3. (minor and silly) Maybe mapMaybe is better than catMaybes . map
Much better, thanks!
> 4. I notice that we're creating the checkpoint directory if it's
> missing. Is this so that read_checkpoints doesn't blow up?
> Shouldn't this be read_checkpoints' job, then?
Hm, no. read_<whatever> wouldn't blow up, but probably return
Nothing, since that's what's there. Write_<whatever> would
however blow up with some dir doesn't exist exception, since we
need that place to write in.
Sat Oct 7 17:26:48 CEST 2006 Tommy Pettersson <[EMAIL PROTECTED]>
* add test that unrecord of tag removes checkpoint
Tue Oct 31 23:01:57 CET 2006 Tommy Pettersson <[EMAIL PROTECTED]>
* remove unrecorded tags from the checkpoint inventory (issue281)
The commands Check, Get and Repair all can make use of the checkpoint
inventory. Unrecord, Unpull and Obliterate forgot to remove deleted patches
from that inventory.
Thu Nov 2 19:48:34 CET 2006 Tommy Pettersson <[EMAIL PROTECTED]>
* resolve conflicts
Merge Unrecord fix for checkpoints inventory with Repository code refactoring.
New patches:
[add test that unrecord of tag removes checkpoint
Tommy Pettersson <[EMAIL PROTECTED]>**20061007152648]
<
> {
addfile ./tests/unrecord.sh
hunk ./tests/unrecord.sh 1
+#!/bin/sh
+set -ev
+
+# Check that checkpoints are removed when tags are unrecorded
+
+rm -rf temp1
+mkdir temp1
+cd temp1
+darcs init
+echo foo > f
+darcs rec -Ax -alm init
+darcs tag -Ax --checkpoint t
+echo y | darcs unrec -t t
+# the complete inventory has only one patch to check
+darcs check --complete > out
+grep -q '1 of 1' out
+# the checkpoint (if left) has two patches to check
+# but is should have been removed
+darcs check --partial > out
+grep -q '1 of 1' out
+cd ..
+rm -rf temp1
}
[remove unrecorded tags from the checkpoint inventory (issue281)
Tommy Pettersson <[EMAIL PROTECTED]>**20061031220157
The commands Check, Get and Repair all can make use of the checkpoint
inventory. Unrecord, Unpull and Obliterate forgot to remove deleted patches
from that inventory.
]
<
> {
hunk ./DarcsRepo.lhs 68
get_checkpoint, get_checkpoint_by_default,
write_checkpoint, write_recorded_checkpoint,
write_checkpoint_patch,
+ remove_from_checkpoint_inventory,
apply_patches,
apply_patches_with_feedback,
simple_feedback,
hunk ./DarcsRepo.lhs 83
import System.IO ( hPutStrLn, stderr, hFlush, stdout )
import System.IO.Unsafe ( unsafeInterleaveIO )
import Monad ( liftM, when, unless )
-import Maybe ( maybeToList, isNothing )
+import Maybe ( maybeToList, isNothing,
+ mapMaybe,
+ )
import SignalHandler ( withSignalsBlocked )
import FastPackedString ( PackedString, packString, gzReadFilePS,
readFilePS, writeFilePS,
hunk ./DarcsRepo.lhs 109
import PatchInfo ( PatchInfo, make_filename, readPatchInfo,
human_friendly, showPatchInfo,
)
+import Depends ( is_tag,
+ )
import Diff ( smart_diff )
import External ( gzFetchFilePS, fetchFilePS, copyFilesOrUrls, Cachable(..),
clonePartialsTree )
hunk ./DarcsRepo.lhs 612
$ format_inv $ reverse $ pinfo:cpi
Nothing -> bug "bad patch in write_checkpoint_patch"
+remove_from_checkpoint_inventory :: [Patch] -> IO ()
+remove_from_checkpoint_inventory ps = do
+ -- only tags can be checkpoints
+ let pinfos = filter is_tag $ mapMaybe patch2patchinfo ps
+ unless (null pinfos) $ do
+ createDirectoryIfMissing False "_darcs/checkpoints"
+ cpi <- (map fst) `liftM` read_checkpoints "."
+ writeDocBinFile "_darcs/checkpoints/inventory" $
+ format_inv $ reverse $ filter (`notElem` pinfos) cpi
+
with_tag :: PatchInfo -> (IO ()) -> IO ()
with_tag pinfo job = do
ps <- read_repo "."
merger 0.0 (
hunk ./Unrecord.lhs 39
-import DarcsRepo ( read_repo,
- write_inventory, write_patch,
- am_in_repo,
- )
-import Pristine ( identifyPristine, applyPristine )
hunk ./Unrecord.lhs 41
+ remove_from_checkpoint_inventory,
)
merger 0.0 (
hunk ./Unrecord.lhs 160
- remove_from_unrevert_context to_unrecord
- let newpend = join_patches (to_unrecord ++ pend)
- withSignalsBlocked $ with_new_pending repository newpend $ do
- when (Verbose `elem` opts) $
- logMessage "About to write out (potentially) modified patches..."
- tentativelyRemovePatches repository opts to_unrecord
+ when (Verbose `elem` opts) $
+ logMessage "About to write out (potentially) modified patches..."
+ withSignalsBlocked $ do tentativelyRemovePatches repository opts to_unrecord
+ finalizeRepositoryChanges repository
merger 0.0 (
hunk ./Unrecord.lhs 165
- let (_, skipped) = commute_to_end to_unrecord allpatches
- sequence_ $ map (write_patch opts) skipped
- repo_patches <- read_repo "."
- when (Verbose `elem` opts) $
- logMessage "About to write inventory..."
- write_inventory "." $ foldl (flip rempatch) repo_patches (reverse to_unrecord)
- when (Verbose `elem` opts) $ logMessage "Updating pristine tree..."
- pris <- identifyPristine
- applyPristine pris (invert $ join_patches to_unrecord) `catch` \e ->
- fail ("Unable to apply inverse patch!\n" ++ show e)
+ tentativelyRemovePatches repository opts to_unrecord
hunk ./Unrecord.lhs 171
+ when (Verbose `elem` opts) $
+ logMessage "About to write checkpoint inventory..."
+ remove_from_checkpoint_inventory to_unrecord
)
)
merger 0.0 (
hunk ./Unrecord.lhs 379
- remove_from_unrevert_context ps
- withSignalsBlocked $ with_new_pending repository pend' $ do
- tentativelyRemovePatches repository opts ps
- finalizeRepositoryChanges repository
- apply opts True (invert p_after_pending) `catch` \e ->
- fail ("Couldn't undo patch in working dir.\n" ++ show e)
+ withSignalsBlocked $ do tentativelyRemovePatches repository opts ps
+ tentativelyAddToPending repository opts $
+ invert $ join_patches ps
+ finalizeRepositoryChanges repository
+ apply opts True (invert p_after_pending) `catch` \e ->
+ fail ("Couldn't undo patch in working dir.\n" ++ show e)
merger 0.0 (
hunk ./Unrecord.lhs 381
- let (_, skipped) = commute_to_end ps allpatches
- sequence_ $ map (write_patch opts) skipped
- repo_patches <- read_repo "."
- write_inventory "." $ foldl (flip rempatch) repo_patches (reverse ps)
- pris <- identifyPristine
- applyPristine pris (invert $ join_patches ps) `catch` \e ->
- fail ("Unable to apply inverse patch!\n" ++ show e)
+ tentativelyRemovePatches repository opts ps
+ finalizeRepositoryChanges repository
hunk ./Unrecord.lhs 385
+ remove_from_checkpoint_inventory ps
)
)
}
[resolve conflicts
Tommy Pettersson <[EMAIL PROTECTED]>**20061102184834
Merge Unrecord fix for checkpoints inventory with Repository code refactoring.
]
<
> {
hunk ./DarcsRepo.lhs 400
sequence_ $ map (write_patch opts) skipped
repo_patches <- read_repo "."
write_inventory "." $ foldl (flip rempatch) repo_patches (reverse to_remove)
+ remove_from_checkpoint_inventory to_remove
pris <- identifyPristine
repairable $ applyPristine pris (invert $ join_patches to_remove)
revert_tentative_changes
hunk ./Unrecord.lhs 39
get_unrecorded, read_repo, amInRepository,
sync_repo,
)
-import DarcsRepo ( read_repo,
- write_inventory, write_patch,
- am_in_repo,
- )
-import Pristine ( identifyPristine, applyPristine )
import Patch ( Patch, invert, patch2patchinfo,
join_patches, commute, null_patch, apply
)
hunk ./Unrecord.lhs 155
\ (to_unrecord, _) -> do
when (null to_unrecord) $ do logMessage "No patches selected!"
exitWith ExitSuccess
- remove_from_unrevert_context to_unrecord
- let newpend = join_patches (to_unrecord ++ pend)
- withSignalsBlocked $ with_new_pending repository newpend $ do
- when (Verbose `elem` opts) $
- logMessage "About to write out (potentially) modified patches..."
- let (_, skipped) = commute_to_end to_unrecord allpatches
- sequence_ $ map (write_patch opts) skipped
- repo_patches <- read_repo "."
- when (Verbose `elem` opts) $
- logMessage "About to write inventory..."
- write_inventory "." $ foldl (flip rempatch) repo_patches (reverse to_unrecord)
- when (Verbose `elem` opts) $ logMessage "Updating pristine tree..."
- pris <- identifyPristine
- applyPristine pris (invert $ join_patches to_unrecord) `catch` \e ->
- fail ("Unable to apply inverse patch!\n" ++ show e)
+ when (Verbose `elem` opts) $
+ logMessage "About to write out (potentially) modified patches..."
+ withSignalsBlocked $ do tentativelyRemovePatches repository opts to_unrecord
+ finalizeRepositoryChanges repository
sync_repo repository
logMessage "Finished unrecording."
hunk ./Unrecord.lhs 363
Just (p_after_pending,_) -> do
when (null ps) $ do logMessage "No patches selected!"
exitWith ExitSuccess
- remove_from_unrevert_context ps
- withSignalsBlocked $ with_new_pending repository pend' $ do
- let (_, skipped) = commute_to_end ps allpatches
- sequence_ $ map (write_patch opts) skipped
- repo_patches <- read_repo "."
- write_inventory "." $ foldl (flip rempatch) repo_patches (reverse ps)
- pris <- identifyPristine
- applyPristine pris (invert $ join_patches ps) `catch` \e ->
- fail ("Unable to apply inverse patch!\n" ++ show e)
- apply opts True (invert p_after_pending) `catch` \e ->
- fail ("Couldn't undo patch in working dir.\n" ++ show e)
+ withSignalsBlocked $ do tentativelyRemovePatches repository opts ps
+ tentativelyAddToPending repository opts $
+ invert $ join_patches ps
+ finalizeRepositoryChanges repository
+ apply opts True (invert p_after_pending) `catch` \e ->
+ fail ("Couldn't undo patch in working dir.\n" ++ show e)
sync_repo repository
logMessage $ "Finished " ++ present_participle cmdname ++ "."
}
Context:
[Do _not_ allow escaped quotes in `quoted'.
Eric Kow <[EMAIL PROTECTED]>**20061030064531
This undoes the patch by Dave Love: Allow escaped quotes in `quoted'.
The immediate problem is that it breaks make_changelog (because one of
Tommy's entries matches on a backslash). This feature might need more
discussion before we include it (or not).
]
[Tidy filenames before invoking tar
Wim Lewis <[EMAIL PROTECTED]>**20061026035535
Only use the last path component of --dist-name for the distribution
name; the rest is still used when creating the final tar file. (issue323)
]
[Add hi-boot and o-boot extensions in default boring file.
Eric Kow <[EMAIL PROTECTED]>**20061019071304
These are automatically generated from hs-boot.
Suggested by Bulat Ziganshin.
]
[Replace tabs with spaces (escaped quotes in PatchMatch).
Eric Kow <[EMAIL PROTECTED]>**20061023192003]
[Fix some obsolete autoconf stuff.
Dave Love <[EMAIL PROTECTED]>**20061015155914]
[Allow escaped quotes in `quoted'.
Dave Love <[EMAIL PROTECTED]>**20060716193940]
[TAG 1.0.9rc1
Tommy Pettersson <[EMAIL PROTECTED]>**20061008175207]
[bump version to 1.0.9rc1
Tommy Pettersson <[EMAIL PROTECTED]>**20061008175156]
[Added --store-in-memory option for diff
[EMAIL PROTECTED]
]
[Move RawMode into DarcsUtils to break cyclic imports on Win32
Josef Svenningsson <[EMAIL PROTECTED]>**20061004120024]
[Look for Text.Regex in package regex-compat. Needed for GHC 6.6
Josef Svenningsson <[EMAIL PROTECTED]>**20061004123158]
[Added rigorous error checking in exec
Magnus Jonsson <[EMAIL PROTECTED]>**20061006222630
All lowlevel C return values are checked and turned into
exceptions if they are error codes. In darcs main
ExecExceptions are caught and turned into error messages
to help the user.
]
[Require 'permission denied' test for MacOS X again.
Eric Kow <[EMAIL PROTECTED]>**20060930121032
This removes a workaround that had demoted a pull.pl test to a mere TODO under
MacOS X. For some reason, under MacOS X, we would occasionally get "Unexpected
error: 0" instead of "permission denied". The error was first reported on
2005-11-06 by Erik Schnetter. We still don't know why it does this, but now
test seems to systematically "unexpectedly succeed" under MacOS X 10.4.7.
Perhaps something in MacOS X that was fixed since the error was reported?
]
[In procmail examples, don't use a lock file
[EMAIL PROTECTED]
[add some changelog entries
Tommy Pettersson <[EMAIL PROTECTED]>**20060930120140]
[remove duplicate file names in fix_filepaths (fixes issue273)
Tommy Pettersson <[EMAIL PROTECTED]>**20060929145335]
[add test for replace command with duplicated file name
Tommy Pettersson <[EMAIL PROTECTED]>**20060929144008]
[remove some tabs from darcs source
Tommy Pettersson <[EMAIL PROTECTED]>**20060929211203]
[--matches now accepts logical 'and' 'or' '!' in addition to '&&' '||' 'not'.
Pekka Pessi <[EMAIL PROTECTED]>**20060915140406]
[Canonize Era Eriksson.
Eric Kow <[EMAIL PROTECTED]>**20060928223224]
[Move bug reporting code to its own module.
Eric Kow <[EMAIL PROTECTED]>**20060928222826
Fixes circular dependency caused by David's unrevert cleanup (which moves
edit_file to DarcsUtil, thus causing it to depend on Exec) and Tommy's
exec patches (which add impossible.h to Exec, thus causing it to depend
on DarcsUtil).
]
[clean up unrevert and pending handling.
David Roundy <[EMAIL PROTECTED]>**20060917214136]
[Reword paragraph about Procmail's umask handling
[EMAIL PROTECTED]
The explanation now helpfully hints that similar tricks may be necessary
in other mail programs, too
]
[Wrap .muttrc example so it doesn't bleed into margin in PostScript version
[EMAIL PROTECTED]
["Granting access to a repository": remove odd orphaned? sentence
[EMAIL PROTECTED]
[era's trivial typo fixes
[EMAIL PROTECTED]
* best_practices.tex (subsection{Conflicts}): \emph pro \verb
around emphasized word "only"
* DarcsArguments.lhs (intersection_or_union): uppercase "[DEFAULT]";
(disable_ssh_cm docs): remove duplicate "which"
* Help.lhs: Missing full stop in description of --extended-help
* Mv.lhs (mv_description): Missing apostrophe in "Apple's"
* PatchShow.lhs (showHunk): Replace "that the white space must not"
with "that whitespace must not"
]
[show error messages when starting and stoping the ssh control master
Tommy Pettersson <[EMAIL PROTECTED]>**20060916010645]
[redirect errors to null where exec output is used but failure is not fatal
Tommy Pettersson <[EMAIL PROTECTED]>**20060916010116
Error messages in the output would destroy the result, but if the command
fails some other action is taken, so error messages shall not be displayed
to the user.
]
[redirect errors to stderr where exec output is used
Tommy Pettersson <[EMAIL PROTECTED]>**20060916005651
Error messages would destroy the result if they ended up in the output.
If the external command fails, darcs should (but does not always) fail.
]
[redirect errors to stderr where exec is checked and darcs fails
Tommy Pettersson <[EMAIL PROTECTED]>**20060916004407
In these situations the user will get both the error message from the
failing external command and a message from darcs about what action it
could not perform.
]
[simplify helper function stupidexec in copyRemoteCmd
Tommy Pettersson <[EMAIL PROTECTED]>**20060915222923]
[reindent some long lines
Tommy Pettersson <[EMAIL PROTECTED]>**20060915222654]
[update calls to exec and exec_fancy to new interface
Tommy Pettersson <[EMAIL PROTECTED]>**20060915222226]
[fix typo
Tommy Pettersson <[EMAIL PROTECTED]>**20060915164446]
[rewrite Exec.lhs, new exec interface with Redirects
Tommy Pettersson <[EMAIL PROTECTED]>**20060911102933
Make the code structure a bit simpler and easier to understand.
Only one (fancy) version of exec.
]
[Fix Windows stderr non-redirection.
Eric Kow <[EMAIL PROTECTED]>**20060909055204
(It was consistently redirecting to stdout.)
Also make the exec code more readable/transparent.
]
[whatsnew --look-for-adds doesn't read unadded files (fix for issue79)
Jason Dagit <[EMAIL PROTECTED]>**20060910193803
The default mode for whatsnew --look-for-adds is summary mode. In summary
mode full patches are not needed. This fix changes whatsnew
--look-for-adds to stop computing the full patch for a file when the
file is not managed by darcs.
]
[Correct canonical email for Kirill Smelkov
Kirill Smelkov <[EMAIL PROTECTED]>**20060912080004]
[Be explicit about timezone handling (issue220); assume local by default.
Eric Kow <[EMAIL PROTECTED]>**20060812102034
Except for the local timezone in the user interface, this patch is not
expected to change darcs's behaviour. It merely makes current practice
explicit:
- Assume local timezone when parsing date strings from the user
interface (previous behaviour was assuming UTC).
- Assume UTC timezone when parsing date strings from PatchInfo.
Newer patch date strings do *not* specify the timezone, so it
would be prudent to treat these as UTC.
- Disregard timezone information altogether when reading patch
dates (issue220). Note that this bug was not caused by assuming local
timezone, because legacy patch date strings explicitly tell you what
the timezone to use. The bug was caused by a patch that fixed
issue173 by using timezone information correctly. To preserve
backwards-compatability, we deliberatly replicate the incorrect
behaviour of overriding the timezone with UTC.
(PatchInfo.make_filename)
]
[Account for timezone offset in cleanDate (Fixes issue173).
Eric Kow <[EMAIL PROTECTED]>**20060610193049
]
[move test for tabs from makefile to haskell_policy test
Tommy Pettersson <[EMAIL PROTECTED]>**20060730122348]
[add test for haskell policy
Tommy Pettersson <[EMAIL PROTECTED]>**20060730121404]
[ratify some uses of readFile and hGetContents
Tommy Pettersson <[EMAIL PROTECTED]>**20060730121158]
[Remove direct dependency to mapi32.dll; Improve MAPI compatibility.
Esa Ilari Vuokko <[EMAIL PROTECTED]>**20051130000915]
[Canonize Kirill Smelkov and Anders Hockersten.
Eric Kow <[EMAIL PROTECTED]>**20060910052541]
[Correct 'one one' in web page.
Eric Kow <[EMAIL PROTECTED]>**20060908191241]
[Fix merge conflicts.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20060906191317]
[fix bug in pristine handling when dealing with multiple patches.
David Roundy <[EMAIL PROTECTED]>**20060731111404]
[fix ordering of operations to call pull_first_middles properly.
David Roundy <[EMAIL PROTECTED]>**20060730111409]
[make amend-record.pl test a bit pickier.
David Roundy <[EMAIL PROTECTED]>**20060730103854]
[simplify code a tad in get.
David Roundy <[EMAIL PROTECTED]>**20060726121737]
[fix bug in refactoring of get.
David Roundy <[EMAIL PROTECTED]>**20060726121655]
[refactor Population.
David Roundy <[EMAIL PROTECTED]>**20060716034837]
[add TODO for refactoring get_markedup_file.
David Roundy <[EMAIL PROTECTED]>**20060716034339]
[partial refactoring in annotate.
David Roundy <[EMAIL PROTECTED]>**20060716034319]
[don't use DarcsRepo in list_authors.
David Roundy <[EMAIL PROTECTED]>**20060716033450]
[I've now eliminated need to export DarcsRepo.write_patch.
David Roundy <[EMAIL PROTECTED]>**20060716033109]
[partially refactor Optimize.
David Roundy <[EMAIL PROTECTED]>**20060716032934]
[partial refactoring of Get.
David Roundy <[EMAIL PROTECTED]>**20060716031605]
[refactor amend-record.
David Roundy <[EMAIL PROTECTED]>**20060716021003]
[add TODO to refactor unrevert handling.
David Roundy <[EMAIL PROTECTED]>**20060716020247]
[refactor Unrecord, adding tentativelyRemovePatches.
David Roundy <[EMAIL PROTECTED]>**20060716015150]
[refactor tag.
David Roundy <[EMAIL PROTECTED]>**20060716011853]
[refactor Repository to allow truly atomic updates.
David Roundy <[EMAIL PROTECTED]>**20060716011245]
[Do not redirect to or from /dev/null when calling ssh.
Eric Kow <[EMAIL PROTECTED]>**20060903214831
Redirection of stdin and stdout breaks putty, which uses these to
interact with the user. Quiet mode, and redirecting stderr are good
enough for making ssh silent.
]
[Exec improvements : Windows redirection, and more redirection control.
Eric Kow <[EMAIL PROTECTED]>**20060707054134
- Implement ability to redirect to /dev/null under Windows
(eivuokko on #darcs points out that it is NUL under Windows)
- Add exec_ function, which does the same thing as exec,
but allows redirection on stderr, and also allows us
to NOT redirect stdin/stderr
]
[Ignore .git if _darcs found.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20060831231933]
[overhaul the darcs.net front page.
Mark Stosberg <[EMAIL PROTECTED]>**20060820191415
The themes to this change are:
- Focus on the key benefits of darcs:
Distributed. Interactive. Smart.
- Recognize that the wiki is the central resource,
and remove some information that is duplicated here
and reference the wik instead.
I can post a demo of this HTML for easy comparison if you'd like.
Mark
]
[Reimplement --disable-ssh-cm flag (issue239).
Eric Kow <[EMAIL PROTECTED]>**20060812134856
My patch to "Only launch SSH control master on demand" accidentally
removed the ability to disable use of SSH ControlMaster. Also, the
way it was implemented is not compatible with launching on demand.
This implementation relies on a notion of global variables using
unsafe IORefs.
]
[Compile Global.lhs in place of AtExit.lhs.
Eric Kow <[EMAIL PROTECTED]>**20060812121943]
[Rename AtExit module to Global.
Eric Kow <[EMAIL PROTECTED]>**20060812121925
The goal is to capture some broad "global" notions like exit handlers
and global variables. Note the GPL header thrown in for good measure.
]
[Raise exception if unable to open logfile (issue142).
Zachary P. Landau <[EMAIL PROTECTED]>**20060810034035]
[Make the pull 'permission test' work when run as root
Jon Olsson <[EMAIL PROTECTED]>**20060831193834]
[TAG darcs-unstable-20060831
Juliusz Chroboczek <[EMAIL PROTECTED]>**20060831191554]
Patch bundle hash:
1ab3db32ac3e320ab1ed633ced7e6143facb2076
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel