[darcs-devel] darcs patch: Added prehooks
Jason Dagit
dagit at codersbase.com
Sat May 5 03:31:11 PDT 2007
Hello,
I just tried to send this patch to darcs-devel but it seems my email
didn't make it through, so I'm resending.
I implemented prehooks by just copying the code for posthooks and
changing what little needed to be changed. It could use some
refactoring. I've included a few manual updates as well as a very
simple test.
I believe it's ready for testing by others (it behaves the way I
expected on the commands I tried it with).
Thanks,
Jason
-------------- next part --------------
New patches:
[Added prehooks
Jason Dagit <dagit at codersbase.com>**20070505100247] {
hunk ./src/Darcs/ArgumentDefaults.lhs 96
-\end{verbatim}
+\end{verbatim}
+
+Similarly, if you need a command to run automatically before darcs
+preforms an action you can use a prehook. Using prehooks it could be
+possible to canonicalize line endings before recording patches.
hunk ./src/Darcs/Arguments.lhs 67
- get_posthook_cmd, nullFlag,
+ get_posthook_cmd,
+ prehook_cmd, prehook_prompt,
+ get_prehook_cmd, nullFlag,
hunk ./src/Darcs/Arguments.lhs 118
+get_content (PrehookCmd s) = Just s
hunk ./src/Darcs/Arguments.lhs 1108
+\begin{options}
+--prehook=COMMAND, --no-prehook
+\end{options}
+To provide a command that should be run before a darcs command is executed,
+ use \verb!--prehook! to specify the command. An example use is
+for people who want to have a command run whenever a patch is to be recorded, such as
+translating line endings before recording patches. Using
+\verb!--no-prehook! will disable running the command.
+\begin{options}
+--prompt-prehook, --run-prehook
+\end{options}
+These options control prompting before running the prehook. Use
+\verb!--prompt-prehook! to force prompting before running the
+prehook command. For security reasons, this is the default.
+\begin{code}
+prehook_cmd :: DarcsOption
+prehook_cmd = DarcsMultipleChoiceOption
+ [DarcsArgOption [] ["prehook"] PrehookCmd
+ "COMMAND" "specify command to run before this darcs command.",
+ DarcsNoArgOption [] ["no-prehook"] NoPrehook
+ "Do not run prehook command."]
+
+prehook_prompt :: DarcsOption
+prehook_prompt = DarcsMultipleChoiceOption
+ [DarcsNoArgOption [] ["prompt-prehook"] AskPrehook
+ "Prompt before running prehook. [DEFAULT]",
+ DarcsNoArgOption [] ["run-prehook"] RunPrehook
+ "Run prehook command without prompting."]
+
+get_prehook_cmd :: [DarcsFlag] -> Maybe String
+get_prehook_cmd (PrehookCmd a:_) = Just a
+get_prehook_cmd (_:flags) = get_prehook_cmd flags
+get_prehook_cmd [] = Nothing
+\end{code}
hunk ./src/Darcs/Commands.lhs 41
-import Darcs.Test ( run_posthook )
+import Darcs.Test ( run_posthook, run_prehook )
hunk ./src/Darcs/Commands.lhs 162
- = opts ++ [disable, help, posthook_cmd, posthook_prompt]
+ = opts ++ [disable, help, posthook_cmd, posthook_prompt
+ ,prehook_cmd, prehook_prompt]
hunk ./src/Darcs/Commands.lhs 307
- then runWithPostHook specops extra
+ then runWithHooks specops extra
hunk ./src/Darcs/Commands.lhs 315
- else runWithPostHook specops extra
+ else runWithHooks specops extra
hunk ./src/Darcs/Commands.lhs 320
- runWithPostHook os ex =
- do here <- getCurrentDirectory
- -- set any global variables
- unless (SSHControlMaster `elem` os) setSshControlMasterDisabled
- -- actually run the command and its posthooks
- (command_command cmd) (FixFilePath fix_path : os) ex
- `Control.Exception.catch`
- (\e -> case e of ExitException ExitSuccess -> return ()
- _ -> throwIO e)
- postHookExitCode <- run_posthook os here
- --
- exitWith postHookExitCode
-
+ runWithHooks os ex = do
+ here <- getCurrentDirectory
+ -- set any global variables
+ unless (SSHControlMaster `elem` os) setSshControlMasterDisabled
+ -- actually run the command and its hooks
+ preHookExitCode <- run_prehook os here
+ if preHookExitCode /= ExitSuccess
+ then exitWith preHookExitCode
+ else do (command_command cmd) (FixFilePath fix_path : os) ex
+ `Control.Exception.catch`
+ (\e -> case e of
+ ExitException ExitSuccess -> return ()
+ _ -> throwIO e)
+ postHookExitCode <- run_posthook os here
+ --
+ exitWith postHookExitCode
hunk ./src/Darcs/Flags.lhs 77
+ | PrehookCmd String | NoPrehook | AskPrehook | RunPrehook
hunk ./src/Darcs/Test.lhs 19
-module Darcs.Test ( run_test, get_test, test_patch, run_posthook ) where
+module Darcs.Test ( run_test, get_test, test_patch,
+ run_posthook, run_prehook )
+where
hunk ./src/Darcs/Test.lhs 33
- NoPosthook, RunPosthook ),
- get_posthook_cmd )
+ NoPosthook, RunPosthook,
+ NoPrehook, RunPrehook ),
+ get_posthook_cmd, get_prehook_cmd )
hunk ./src/Darcs/Test.lhs 123
- yorn <- maybeAskUser ("\nThe following command is set to execute.\n"++
- "Execute the following command now (yes or no)?\n"++
+ yorn <- maybeAskUser("\nThe following command is set to execute.\n"++
+ "Execute the following command now (yes or no)?\n"++
hunk ./src/Darcs/Test.lhs 138
+\begin{code}
+run_prehook :: [DarcsFlag] -> FilePath -> IO ExitCode
+run_prehook opts repodir
+ | NoPrehook `elem` opts = return ExitSuccess
+ | otherwise = withCurrentDirectory repodir $ get_prehook opts
+
+get_prehook :: [DarcsFlag] -> IO ExitCode
+get_prehook opts =
+ let putInfo s = when (Verbose `elem` opts) $ putStr s
+ putErr s = when (Quiet `notElem` opts) $ hPutStr stderr s
+ in case get_prehook_cmd opts of
+ Nothing -> return ExitSuccess
+ Just command -> do
+ yorn <- maybeAskUser("\nThe following command is set to execute.\n"++
+ "Execute the following command now (yes or no)?\n"++
+ command++"\n")
+ case yorn of ('y':_) -> do ec <- system command
+ if ec == ExitSuccess
+ then putInfo "Prehook ran successfully.\n"
+ else putErr "Prehook failed!\n"
+ return ec
+ _ -> do putInfo "Prehook cancelled..."
+ return ExitSuccess
+ where maybeAskUser
+ | RunPrehook `elem` opts = const $ return "yes"
+ | otherwise = askUser
+\end{code}
addfile ./tests/prehook.sh
hunk ./tests/prehook.sh 1
+#!/bin/sh
+
+
+set -ev
+
+test $DARCS || DARCS=$PWD/../darcs
+
+rm -rf temp1
+mkdir temp1
+cd temp1
+$DARCS init
+touch foo
+$DARCS add foo
+
+# Check that prompting works as expected when answering yes...
+echo yes | $DARCS whatsnew -s --prehook 'touch prehook-ran'
+test -f prehook-ran
+rm prehook-ran
+
+# Check that prompting works as expected when answering no...
+echo no | $DARCS whatsnew -s --prehook 'touch prehook-ran'
+test ! -f prehook-ran
+
+# Check that prompting works as expected with defaults (yes)...
+echo ALL --prehook touch prehook-ran > _darcs/prefs/defaults
+echo yes | $DARCS whatsnew -s
+test -f prehook-ran
+rm prehook-ran
+
+# Check that prompting works as expected with defaults (no)...
+echo no | $DARCS whatsnew -s
+test ! -f prehook-ran
+
+# Check that --run-prehook works in defaults
+echo ALL --run-prehook >> _darcs/prefs/defaults
+$DARCS whatsnew -s
+test -f prehook-ran
+rm prehook-ran
+
+# Check that --run-prehook works when specified both in defaults and on
+# command line
+$DARCS whatsnew --run-prehook -s
+test -f prehook-ran
+rm prehook-ran
+
+# Check that --prehook works when --run-prehook is in defaults
+echo ALL --run-prehook > _darcs/prefs/defaults
+$DARCS whatsnew --prehook 'touch prehook-ran' -s
+test -f prehook-ran
+rm prehook-ran
+
+echo Successful.
+
+cd ..
+rm -rf temp1
}
Context:
[Use system for calling interactive cmds in Windows instead of rawSystem.
Eric Kow <eric.kow at loria.fr>**20070415132608
This lets us support switches, for example, in DARCS_EDITOR.
]
[resolve conflict.
David Roundy <droundy at darcs.net>**20070422213416]
[make copyInventory work for all permutations of repo formats.
David Roundy <droundy at darcs.net>**20070422155344]
[fix bug in Internal.
David Roundy <droundy at darcs.net>**20070422155324]
[add support for different kinds of get.
David Roundy <droundy at darcs.net>**20070422152934]
[fix strict get to a hashed repo from another.
David Roundy <droundy at darcs.net>**20070422151300
The trouble was that my clever idea of lazily downloading patches even
during a strict get didn't work, since we didn't have the source while
reading the patches the second time. One option would be to add that
source while applying patches the second time, but that seems like it'd
require a more tricky interface than just copying things strictly the first
time.
]
[don't print "partial repository" guess.
David Roundy <droundy at darcs.net>**20070422150603
This guess is all too often inaccurate, and with the new hashed
inventories, it'll be even more often inaccurate.
]
[remove redundant copyInventory.
David Roundy <droundy at darcs.net>**20070422144910]
[add tests for mixed inventories to hashed_inventory.sh.
David Roundy <droundy at darcs.net>**20070418234821]
[rewrite --lazy to be more flexible.
David Roundy <droundy at darcs.net>**20070416154113
This change makes it so we can handle a configured set of URLs for patch
origins. See the description in the Prefs.lhs documentation for details.
In addition, I've added a new --ephemeral option, which allows the user to
create repositories without any patch files at all (which seems a bit
scary, but potentially handy).
]
[Renable --quiet test for rmdir.
Eric Kow <eric.kow at loria.fr>**20070422072009]
[fix test_scripts bug pointed out by Eric.
David Roundy <droundy at darcs.net>**20070421213635]
[fix FIXME for handling hashed+normal inventory at the same time.
David Roundy <droundy at darcs.net>**20070418215614
This fix also makes the tests pass with both inventory types enabled,
so I added that to the test suite. This was easier than I expected!
]
[add test (but don't do it) for both sorts of inventories.
David Roundy <droundy at darcs.net>**20070418175214]
[remove unused export from RepoFormat.
David Roundy <droundy at darcs.net>**20070414174933]
[Modify match test for escaping quotes in match strings.
Dave Love <fx at gnu.org>**20070415170419]
[Allow escaped quotes in `quoted' for match text.
Dave Love <fx at gnu.org>**20070415180132]
[Modernise imports of Foreign.Ptr.
Eric Kow <eric.kow at loria.fr>**20070407102536]
[Make revert_interactive.sh test work under Windows.
Eric Kow <eric.kow at loria.fr>**20070415140652]
[Make set_scripts_executable.pl test work under Windows.
Eric Kow <eric.kow at loria.fr>**20070415133233]
[Make record_editor.pl test work under Windows.
Eric Kow <eric.kow at loria.fr>**20070415132932
I believe setting the PATH to '' was giving me libcurl4.dll complaints
under Windows.
Note also that this simplifies away part of a test, in that we were
initially trying to create stuff in a directory called 'temp dir2 " "',
but just creating the dir itself got so tricky that I just gave up and
switched to 'temp dir2', still with a space, no quotes.
]
[Make mv.pl test pass on Windows.
Eric Kow <eric.kow at loria.fr>**20070415114122
Fixed test count mismatch, and recovery of absolute path under msys.
]
[Make external.pl test work on Windows.
Eric Kow <eric.kow at loria.fr>**20070414212029
One of the tests in this script is to see if darcs calls ssh correctly.
We create a fake ssh program in the form of a shell script (it just
creates a file 'fakessh' to let us know it ran). Windows got confused
by this, so we (1) made sure the script also works as a DOS batch file
(2) gave it a .bat extension so that Windows knows how to run it.
]
[Abuse test counter to get a pull_many_files.pl progress meter.
Eric Kow <eric.kow at loria.fr>**20070415142352]
[don't exit with failure when there are no perl tests.
David Roundy <droundy at darcs.net>**20070418233016
This happens when tests_to_run is used.
]
[Include src/Darcs/Patch in makefile's SRC_DIRS.
Dave Love <fx at gnu.org>**20070415215139]
[Re-fix MAKEMANUAL.
Dave Love <fx at gnu.org>**20070415122733]
[revamp TolerantIO to be simpler.
David Roundy <droundy at darcs.net>**20070421224551]
[Fix applyToWorking conflicts.
Eric Kow <eric.kow at loria.fr>**20070422060319
Was recorded against darcs stable post 1.0.9rc2.
]
[reenable --quiet mode in apply.
David Roundy <droundy at darcs.net>**20070421001933]
[Apply patches 'tolerantly' to the working directory (issue434).
Eric Kow <eric.kow at loria.fr>**20070419200558
If there are any exceptions applying a patch to the working directory, catch
the exceptions, emit a pretty warning and move on. This is meant to ease
the scenario where the user is pulling in a large patch, but there is a
permissions error (or something similar) in the working directory.
Without this patch, darcs typically dies and leaves the working directory in
a 'corrupted' state. The corruption is relatively minor in that patches and
pristine are perfectly fine. The problem is that the user has large portions
of the patch still upapplied and when he does a darcs whatsnew, gets a mass
of seemingly incomprehensible goop (the inverse of the unapplied changes)
mixed in with his changes. We reduce the incomprehensible goop effect by
catching exceptions so that darcs can continue to apply as much of the patch
as it can.
]
[Add tests specifically for applying patches to the working dir (issue434).
Eric Kow <eric.kow at loria.fr>**20070419200048]
[Fix MAKEMANUAL conflict.
Eric Kow <eric.kow at loria.fr>**20070413231608]
[Fix MAKEMANUAL make target.
Dave Love <fx at gnu.org>**20070410192153]
[Move packaging related stuff to its own directory (release).
Eric Kow <eric.kow at loria.fr>**20070401071845]
[Move extras to their own directory (tools).
Eric Kow <eric.kow at loria.fr>**20070401071734
Shell completion scripts, cgi.
]
[Move documentation to its own directory (doc).
Eric Kow <eric.kow at loria.fr>**20070401071635]
[Generalise HACKING file into a README (issue287).
Eric Kow <eric.kow at loria.fr>**20070401063734
The README parts are largely inspired from GHC.
]
[Remove unused bugs directory.
Eric Kow <eric.kow at loria.fr>**20070314203416]
[Resolve Makefile conflict.
Eric Kow <eric.kow at loria.fr>**20070413231906]
[add support for partial and lazy downloading of hashed repos.
David Roundy <droundy at darcs.net>**20070405000616]
[add framework for lazily fetching hash files.
David Roundy <droundy at darcs.net>**20070403232223
This patch doesn't yet actually have any effect, but prepares
the way for changes to allow a variety of --partial that won't
have the downside of sometimes causing darcs to fail later,
since one can always download the patch files from the original
server.
]
[fix bug Eric pointed out (which has also now bitten me).
David Roundy <droundy at darcs.net>**20070404233317
This was a bug in the Checkpoint repo, where we assumed we were
looking at the current working directory, incorrectly.
]
[Exit with error if any Perl tests fail (Makefile).
Eric Kow <eric.kow at loria.fr>**20070406062704]
[Fix unit.lhs import.
Eric Kow <eric.kow at loria.fr>**20070331194046
...due to sloppy scripting during the hierarchical shakeup.
]
[make --set-scripts-executable work with get and hashed inventories.
David Roundy <droundy at darcs.net>**20070329010828]
[Fix conflicts; adapt QueryTag to new hierarchical structure.
Eric Kow <eric.kow at loria.fr>**20070331191925]
[Mention the query tags command in the tag documentation
Florian Weimer <fw at deneb.enyo.de>**20070325171247]
[Add the query tags command
Florian Weimer <fw at deneb.enyo.de>**20070325170617]
[Implement PatchInfo.pi_tag
Florian Weimer <fw at deneb.enyo.de>**20070325160343]
[Include the query commands in the manual
Florian Weimer <fw at deneb.enyo.de>**20070325170019]
[fix checkpoint handling with hashed inventories.
David Roundy <droundy at darcs.net>**20070330154325]
[fix bug in makefile regarding manual.
David Roundy <droundy at darcs.net>**20070330154259]
[whitespace cleanups in makefile.
David Roundy <droundy at darcs.net>**20070330152018]
[by default test hashed inventories plus normal.
David Roundy <droundy at darcs.net>**20070329010900]
[fail on error in get_patches_beyond_tag.
David Roundy <droundy at darcs.net>**20070328172408
This will expose any bugs where we use this function wrongly.
(As was the case in darcs check --partial with hashed inventories.)
]
[fix unrecord.sh to use proper darcs.
David Roundy <droundy at darcs.net>**20070328181345]
[Fix manual compilation errors (due to source reorganisation).
Eric Kow <eric.kow at loria.fr>**20070313214302]
[Fix conflicts.
Eric Kow <eric.kow at loria.fr>**20070313210908]
[Modernise imports of Data.(Char|Int|List|Maybe).
Eric Kow <eric.kow at loria.fr>**20070313210805]
[Modernise imports of Control.Monad.
Eric Kow <eric.kow at loria.fr>**20070313205312]
[Modernise imports of System.Directory.
Eric Kow <eric.kow at loria.fr>**20070313205200]
[Correct compilation errors in win32 due to src reorganisation.
Eric Kow <eric.kow at loria.fr>**20070313210732]
[Move Haskell sources to src directory with hierarchical structure.
Eric Kow <eric.kow at loria.fr>**20070313200751
src
general modules, possibly to be spun off as non-darcs libraries
administrative stuff (e.g., modules generated by autoconf)
src/Darcs
darcs-specific modules, catch-all for modules I didn't know what
to do with
src/Darcs/Patch
core patch operations
src/Darcs/Repository
modules specific to the maintenance of the darcs repo, especially the _darcs
stuff
src/Darcs/Commands
the darcs commands, e.g. pull, record, whatsnew
]
[Move osx directory to src.
Eric Kow <eric.kow at loria.fr>**20070313200304]
[Move C files to src directory.
Eric Kow <eric.kow at loria.fr>**20070313200135]
[Add subdirectories for source files.
Eric Kow <eric.kow at loria.fr>**20070313194050]
[Extend GHCFLAGS override mechanism to allow for subdirectories.
Eric Kow <eric.kow at loria.fr>**20070313193917]
[Fix date.t pathname construction in whatsnew test.
Dave Love <fx at gnu.org>**20070305203305]
[In tests, don't assume diff has -u, -x flags.
Dave Love <fx at gnu.org>**20070305202838]
[Fixes for Solaris sh in tests: no $(...), test -e, or ! pipelines.
Dave Love <fx at gnu.org>**20070311170210]
[Fix conflicts related to --ssh-cm flag.
Eric Kow <eric.kow at loria.fr>**20070311205820]
[Fix test/ssh.sh conflicts.
Eric Kow <eric.kow at loria.fr>**20070311205156]
[Flip ssh test to accept a --ssh-cm argument.
Eric Kow <eric.kow at loria.fr>**20070310063327]
[Add a --ssh-cm flag with --no-ssh-cm as the default.
Eric Kow <eric.kow at loria.fr>**20070310063132
Previously, darcs would launch the ControlMaster by default, but it seems to
hang on some large repositories and cause pain. The user can always add
--ssh-cm if s/he wants it on.
]
[Rename --disable-ssh-cm to --no-ssh-cm.
Eric Kow <eric.kow at loria.fr>**20070310061124
This appears to be more consistent with other darcs flags.
]
[Do not append a colon to hostname when calling sftp (issue362).
Eric Kow <eric.kow at loria.fr>**20070308201844
This does not solve all of issue362, just a minor annoyance along its way.
]
[Add changelog entries (file: quick) for pull --complement changes.
Kevin Quick <quick at sparq.org>**20070205185329]
[In tests, don't assume grep has -q and -x flags.
Dave Love <fx at gnu.org>**20070225114022]
[Don't depend on `seq' in tests.
Dave Love <fx at gnu.org>**20070225113255]
[Fix bash-ism `export foo=' in tests.
Dave Love <fx at gnu.org>**20070225113216]
[Get `open' and `psignal' declared on Solaris.
Dave Love <fx at gnu.org>**20070225113041
The header requirements for open are actually as documented for glibc.
]
[Make test harnesses define PWD in environment in case shell doesn't.
Dave Love <fx at gnu.org>**20070225112124]
[Zsh completion: support repos that use _darcs/pristine
Georg Neis <gn at oglaroon.de>**20070301103113]
[Add send --output-auto-name information to the documentation.
Zachary P. Landau <kapheine at divineinvasion.net>**20070221014555]
[Add test for send --output-auto-name.
Zachary P. Landau <kapheine at divineinvasion.net>**20070221014501]
[Add --output-auto-name option to Send.
Zachary P. Landau <kapheine at divineinvasion.net>**20070221014327]
[More sed compliance on pull_compl test.
Eric Kow <eric.kow at loria.fr>**20070217073744]
[Fix pull_compl test sed compliance.
Kevin Quick <quick at sparq.org>**20070214033347]
[Add pull_compl test; note interesting duplicate repo elimination in docs.
Kevin Quick <quick at sparq.org>**20070206065236]
[Use LaTeX for ISO 8601 hyperlink.
Eric Kow <eric.kow at loria.fr>**20070217071601]
[Documentation only: add link for ISO 8601 format
Kirsten Chevalier <chevalier at alum.wellesley.edu>**20070216004007
In the documentation, make "ISO 8601 format" a link to the official
W3C page describing the format (for those who don't know it by heart).
]
[fix some changelog entries
Tommy Pettersson <ptp at lysator.liu.se>**20061231210024]
[change "current" to (or add) "pristine" in verbose message and doc
Tommy Pettersson <ptp at lysator.liu.se>**20070211191942]
[Resolve conflict between complement add and get_recorded_unsorted.
Kevin Quick <quick at sparq.org>**20070206071832]
[Added --complement to pull to allow "exclusion" repos
Kevin Quick <quick at sparq.org>**20070204181301]
[Correct test for quoted arguments in DARCS_EDITOR.
Eric Kow <eric.kow at loria.fr>**20070204211312
1) On MacOS X, grep lives in /usr/bin, not /bin
2) We shouldn't escape the double quotes because they're already protected
by the single quotes
]
[Restore working directory if no repository is found (issue385).
Zachary P. Landau <kapheine at divineinvasion.net>**20070203173440
seekRepo continues to go further up the directory tree looking for a
repository. If we are not in a repository, our current working directory
becomes /. This causes problems with code that falls back on creating
temporary files in the current directory. This patch will restore the
directory the user started in if seekRepo fails.
]
[refactor get_unrecorded.
David Roundy <droundy at darcs.net>**20070128231405
I've removed the [DarcsFlag] argument, and added two new functions
get_unrecorded_unsorted, and get_unrecorded_no_look_for_adds, which do what
they say. I think this simplifies its use, and cleans things up a tad. It
doesn't scale to many different ways to get_unrecorded, but I don't think
we want to go there.
]
[use (empty) opts to Repository in list_authors and make_changelog
Tommy Pettersson <ptp at lysator.liu.se>**20070128165840
They where left out in the opts Repository refactoring.
]
[fix bug triggered in replace.sh
David Roundy <droundy at darcs.net>**20070128002206
This bug was an annoying one that seemed to involve trouble caused by
unsafeInterleaveIO and the order of evaluation, since we change the working
directory. I've simplified the code significantly. Complicating the debug
process was a race condition caused by the lack of --ignore-times in
replace.sh, which was because darcs replace didn't accept that option.
]
[refactor: add opts into Repository.
David Roundy <droundy at darcs.net>**20070128000728]
[add test for replace that messes with unrecorded hunks
Tommy Pettersson <ptp at lysator.liu.se>**20070125153803]
[go back to using system for edit_file/view_file instead of exec (system 'cmd "$ARG"')
Benedikt Schmidt <beschmi at cloaked.de>**20070131162811]
[use TODO instead of pass for record_editor test
Benedikt Schmidt <beschmi at cloaked.de>**20070131161635]
[add some tests for edit_file and DARCS_EDITOR handling
Benedikt Schmidt <beschmi at cloaked.de>**20070131011526]
[fix bugs in replace.sh script--running wrong darcs.
David Roundy <droundy at darcs.net>**20070128001826]
[Remove extraneous parentheses (RepoFormat).
Eric Kow <eric.kow at loria.fr>**20070127231359]
[make write_repo_format agree with read_repo_format (use | for separating properties)
Benedikt Schmidt <beschmi at cloaked.de>**20070126143752]
[add documentation for DARCS_PAGER
Benedikt Schmidt <beschmi at cloaked.de>**20070126142649]
[Fix issue383 - allow --disable-ssh-cm for 'darcs changes'.
Georg Neis <gn at oglaroon.de>**20070121224417]
[(add a + mv a b = add b) and (mv a b + remove b = remove a)
malebria at riseup.net**20070108160933]
[update web page for new mailing list server.
David Roundy <droundy at darcs.net>**20070116162930]
[Canonize Marco T??lio Gontijo e Silva.
Eric Kow <eric.kow at loria.fr>**20070113231736
Sorry for stripping off the accent.
]
[Redundant noncomments
malebria at riseup.net**20070109125519
noncomments was already called by get_preffile via get_lines.
]
[Remove unused functions from Population.
Eric Kow <eric.kow at gmail.com>**20070107232034
The functions are not shown to be used by any other part of darcs.
Perhaps they should be restored if we ever get to work seriously on
libdarcs.
]
[Import IO.bracket instead of Control.Exception.bracket in Exec.
Eric Kow <eric.kow at loria.fr>**20070107211935
This makes darcs work on *nix the same way it did before Simon Marlow's
runProcess patch for Windows and my conflict-resolution tweaks.
]
[Import bracketOnError from Workaound instead of Control.Exception.
Eric Kow <eric.kow at gmail.com>**20061225212444
bracketOnError was introduced in GHC 6.6, whereas we want to support 6.4.1 and
higher.
]
[Fix conflicts and compile errors (Exec runProcess stuff).
Eric Kow <eric.kow at gmail.com>**20061225212423
Side A:
Simon Marlow: Use System.Process on Windows
Side B:
Edwin Thomson : Make Exec.lhs not import unneeded Control.Exception functions
when compiling on Windows.
Magnus Jonsson : Added rigorous error checking in exec
Compile errors in question were just import-related issues.
]
[Add Workaround.bracketOnError (introduced in GHC 6.6).
Eric Kow <eric.kow at gmail.com>**20061225201830
This is to compensate for the missing Control.Exception.bracketOnError
in GHC 6.4.2
]
[Use System.Process on Windows
Simon Marlow <simonmar at microsoft.com>**20061129160710
This was an attempt to address "[issue218] Patch bundle failed hash",
but unfortunately it doesn't fix the problem. Still, System.Process
is a better way to invoke external commands these days.
For now, the new code only replaces the Windows version of exec. This
means that GHC 6.4 will be required to build darcs on Windows. Better
would be to add a configure test, but I ran out of time here.
]
[Fix issue376 - inconsistent punctuation in darcs get.
Eric Kow <eric.kow at gmail.com>**20061231180024
]
[Fix issue367 - pull help message.
Eric Kow <eric.kow at gmail.com>**20061231174322]
[fix [issue370], darcs ignored args contained in VISUAL variable
Benedikt Schmidt <beschmi at cloaked.de>**20061220110807
given VISUAL="emacs -nw", darcs would run "emacs file" instead of
"emacs -nw file"
]
[Make annotate work on files with spaces in the name
edwin.thomson at businesswebsoftware.com**20061218094210
]
[fix spelling errors in comments
Benedikt Schmidt <beschmi at cloaked.de>**20061222020037]
[fix link error with gcc 4.12/glibc 2.4
Benedikt Schmidt <beschmi at cloaked.de>**20061220091436
errno is a C macro that expands to a function call in
some versions of glibc, so it can't be treated like
a CInt there
]
[Fix includes in External.hs.
Dave Love <fx at gnu.org>**20061218224158
You can't put comments before {-# INCLUDE ...
]
[Fix ssh.sh test.
Dave Love <fx at gnu.org>**20061218223442]
[Prettify exceptions in identifyRepository.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061218025453]
[Implement prettyException.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061218025440]
[Simplify common libcurl errors.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061218025419]
[fix issue369 by failing if quickcheck isn't available
David Roundy <droundy at darcs.net>**20061218021545]
[QP-encode bundles when putting to a remote repo.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061218003034]
[Don't QP-encode bundles when pushing locally.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061218002533]
[Make darcs push QP-encode the bundle before transferring.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061217234635
This should hopefully fix issues with scp/sftp corrupting bundles in transit.
]
[Adapt callers to new calling convention for make_email.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061217234608
Use Just at the right places.
]
[Make arguments to make_email optional.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20061217234501
Makes contents and filename optional. If they are omitted, we still
generate a conforming MIME message.
]
[add warning about ALL and obliterate --all to documentation
Tommy Pettersson <ptp at lysator.liu.se>**20061219180302]
[fix pending bug in darcs get --tag.
David Roundy <droundy at darcs.net>**20061217225256
This patch addresses the bug displayed in Tommy's test:
Mon Dec 11 20:28:21 CET 2006 Tommy Pettersson <ptp at lysator.liu.se>
* add test for get --tag and pending
]
[add test for get --tag and pending
Tommy Pettersson <ptp at lysator.liu.se>**20061211192821]
[add new test related to issue262.
David Roundy <droundy at darcs.net>**20061217221041
This issue seems to already have been fixed.
]
[fix issue360, with darcs mv foo foo.
David Roundy <droundy at darcs.net>**20061217212340]
[Separate comment from OPTIONS pragma for GHC 6.4 compatibility.
Eric Kow <eric.kow at gmail.com>**20061217041212
]
[Resolve conflicts in David's hashed_inventory optimize patches.
Eric Kow <eric.kow at loria.fr>**20061217031027
]
[Make hashed inventories support optimize and reordering.
David Roundy <droundy at darcs.net>**20061216193913]
[Canonize Kirsten Chevalier.
Kirsten Chevalier <chevalier at alum.wellesley.edu>**20061217025004
Added my name to the list of authors who originally only submitted an email
address.
]
[Documentation only - clarify meaning of --from and --author
Kirsten Chevalier <chevalier at alum.wellesley.edu>**20061217024927
Clarified the meaning of --from and --author. I had assumed that these
options also set the From: address on the email sent by "darcs sent". Of
course they don't, but it's better to make this clear.
]
[Added test for reverting an unrecorded add
edwin.thomson at businesswebsoftware.com**20061215180047]
[fix bug in haskell_policy check for HopefullyPrivate.
David Roundy <droundy at darcs.net>**20061210234453
Perhaps with this test, we can rename it to CertainlyPrivate? :)
]
[don't use HopefullyPrivate outside of Hopefully.
David Roundy <droundy at darcs.net>**20061210231623
The idea is to hide the Hopefully constructors, so I can hide some more
information in there, if I like, which should be handy for the hashed
inventories, and may also come in handy (for similar reasons) with git
repositories.
]
[change Maybe Patch to Hopefully Patch.
David Roundy <droundy at darcs.net>**20061210213536
This rather pervasive change move us to using a new Hopefully type, which
is similar to Either String for storing patches that may or may not exist.
This should improve error reporting. At a minimum it'll making easier to
improve error reporting.
]
[resolve conflict in white space.
David Roundy <droundy at darcs.net>**20061210211846]
[fix pending bug that broke several_commands.sh.
David Roundy <droundy at darcs.net>**20061209223916]
[add test for reverting removed directory
Tommy Pettersson <ptp at lysator.liu.se>**20061108202344]
[allow commented tests in tests_to_run.
David Roundy <droundy at darcs.net>**20061211000322]
[remove link to obsolete mirror of kernel repo.
David Roundy <droundy at darcs.net>**20061212012644]
[add test that sigPIPE doesn't make darcs fail.
David Roundy <droundy at darcs.net>**20061209230155]
[make optimize less DarcsRepo-specific.
David Roundy <droundy at darcs.net>**20061209205755]
[Hard link support on Windows
Simon Marlow <simonmar at microsoft.com>*-20061204162040
This works only on NTFS filesystems. Also it requires Windows 2000 or
later; this may or may not be acceptable, I'll leave that up to the
darcs maintainers to decide.
]
[eliminate DarcsRepo.am_in_repo.
David Roundy <droundy at darcs.net>**20061204153128
This patch is a Good Thing, even though repair and optimize don't yet
properly support anything bug old-fashioned repositories, because without
it, when using such repositories, one can find those command operating on a
different repository than intended (e.g. the test suite runs optimize on
the darcs repository itself). Now they'll fail as they ought to, when run
on a repo format they don't support.
]
[fix hashed inventory bug in add and prevent it happening again.
David Roundy <droundy at darcs.net>**20061204020823]
[make get and put reuse initialize code.
David Roundy <droundy at darcs.net>**20061203220833
This patch actually fixes put to properly accept and use any flags that
init accepts, which is a Good Thing. It also ensures that get behaves
consistently with init in the future. Also a Good Thing.
]
[make put work with hashed inventories (and test for this).
David Roundy <droundy at darcs.net>**20061203211141]
[make it an error to "put" into a preexisting directory.
David Roundy <droundy at darcs.net>**20061203205826
This changes darcs' behavior I believe for the better. Often one could be
tempted to try to put into a directory, expecting to have the repository
created as a subdirectory there, and it seems confusing (confused me) to
have instead the repository contents mingled with whatever was already in
that directory. Put should behave like get in this regard, in that it
shouldn't mix the new repo with a preexisting directory.
]
[fix new get to not mess up pending (fixes latest hashed_inventory.sh tests).
David Roundy <droundy at darcs.net>**20061203173722]
[add some more hashed_inventory.sh tests.
David Roundy <droundy at darcs.net>**20061203173207]
[fix more incompatible uses of DarcsRepo.
David Roundy <droundy at darcs.net>**20061203064355]
[make replace work with hashed inventories.
David Roundy <droundy at darcs.net>**20061203055452]
[Make get_tag test work with hashed inventories.
David Roundy <droundy at darcs.net>**20061203055019]
[make directory_confusion pass with hashed inventories.
David Roundy <droundy at darcs.net>**20061203035551
I'm not sure whether there is still a bug in the pending handling here, but
at least it doesn't crash...
]
[catch exceptions in stdout_is_a_pipe
Simon Marlow <simonmar at microsoft.com>**20061129160620]
[hFlush after "waiting for lock" message
Simon Marlow <simonmar at microsoft.com>**20061129160342
On Windows, stdout isn't always in line-buffered mode, but we really
want to see the message about waiting for a lock quickly. Mostly
because ^C isn't always caught properly on Windows and lock files are
often left behind, but that's another storey...
]
[add explicit import list
Simon Marlow <simonmar at microsoft.com>**20061129160144]
[Improve error messages in push_cmd
chevalier at alum.wellesley.edu**20061207040701
I ran into this because MSYS was munging my repository directory in a
horrible way. This resulted in a bad repo directory getting passed into
darcs, which resulted in a fromJust error, which we all know makes the
baby Jesus cry. So, I at least refactored the code to give a better
error message, though there may well be a better solution.
]
[Hard link support on Windows
Simon Marlow <simonmar at microsoft.com>**20061204162040
This works only on NTFS filesystems. Also it requires Windows 2000 or
later; this may or may not be acceptable, I'll leave that up to the
darcs maintainers to decide.
]
[adapt test sametwice to new obliterate --all feature
Tommy Pettersson <ptp at lysator.liu.se>**20061130132058]
[Adapt test perms.sh to obliterate --all feature.
Eric Kow <eric.kow at gmail.com>**20061209200625]
[fix for Issue111, obliterate --all
David Roundy <droundy at darcs.net>**20061129164016
This is a patch to implement the wishless item Issue111,
which asks for an --all option to obliterate. The idea is
that you might use the --patches flag to select a bunch of
patches and not want to have to say yess to all of them.
For good measure, I also added it to unpull and unrecord.
]
[use impossible to document impossible case in Repair.
David Roundy <droundy at darcs.net>**20061204152854]
[use variable TEST_FILTER_FILE in makefile.
David Roundy <droundy at darcs.net>**20061204151217]
[configure should fail if a required module isn't present.
David Roundy <droundy at darcs.net>**20061128024557]
[Remove raw_mode functions from atomic_create.h.
Eric Kow <eric.kow at gmail.com>**20061008202738
It seems these were once implemented in compat.c and have since been
reimplemented in Haskell by Ian Lynagh on 2005-07-30. These appear to
just be leftover declarations in the C header.
]
[resolve conflicts
Tommy Pettersson <ptp at lysator.liu.se>**20061117222757
between 'clean up unrevert and pending handling'
and 'ignore failure from hSetBufferin'
]
[ignore failure from hSetBuffering
Tommy Pettersson <ptp at lysator.liu.se>**20061117221424
This affects:
issue41 Doesn't like pasted text.
issue94 Crash on bogus input
issue146 hSetBuffering: invalid argument
issue318 buffering error of darcs record under bash/cmd.exe
It doesn't necessarily "fix" anything. It prevents darcs from quiting,
instead continuing with perhaps an undesirable buffering mode, which may or
may not be better ... or worse.
]
[Fix curses stuff, especially on Solaris 10.
Dave Love <fx at gnu.org>**20061120171211]
[Define infodepspatch locally in AmendRecord instead of exporting it from Patch
edwin.thomson at businesswebsoftware.com**20061121093332
]
[Make libcurl use any http authentication.
Tobias Gruetzmacher <darcs at portfolio16.de>**20061118230406
This let darcs use repositories protected with digest authentication.
]
[Redirect stderr to Null when exiting SSH control master.
Eric Kow <eric.kow at loria.fr>**20061118212115
This suppresses the output
* Pseudo-terminal will not be allocated because stdin is not a terminal.
(result of redirecting stdin from /dev/null)
* Exit request sent.
(seems to be normal output. Seems also that there is no way to suppress
this; -q does not do the job, for example)
]
[Overhaul and improve automation of ssh_test.
Eric Kow <eric.kow at gmail.com>**20061121141802
* Now quits if you don't supply REMOTE; does not have any
silly default values
* Options now passed in through environment variables, so:
NO_CONTROL_MASTER=1 REMOTE=me at 192.168.2.12 ./ssh_test
* Performs some automated success checks (which means that
it should be possible to use this from the harness if you
have ssh-agent running)
* Performs darcs send test
* Does not try to pass darcs-ssh flags (like --disable-ssh-cm)
to non-ssh-using commands like record
]
[Rename ssh_test to ssh.sh (for shell harness).
Eric Kow <eric.kow at gmail.com>**20061121141101
Note that you must set environment variables for it do anything
useful (namely REMOTE=you at someserver); something like the following
should work:
REMOTE=me at 192.168.2.3 make test
You need to be using public key authentication to have a fully
automated test.
]
[Support darcs send --disable-ssh-cm.
Eric Kow <eric.kow at loria.fr>**20061121134158]
[Canonize Edwin Thomson.
Eric Kow <eric.kow at gmail.com>**20061118174454]
[Make Exec.lhs not import unneeded Control.Exception functions when compiling on Windows.
edwin.thomson at businesswebsoftware.com**20061114182952
]
[Annotate various boring patterns.
Dave Love <fx at gnu.org>**20061113225701]
[Add make rules for tags files.
Dave Love <fx at gnu.org>**20061113213923]
[Amending a patch doesn't remove explicit dependencies
edwin.thomson at gmail.com**20061110222837]
[look for --disable-ssh-cm in defaults files (issue351)
Tommy Pettersson <ptp at lysator.liu.se>**20061117180942]
[Add a semi-automated test for SSH-related things.
Eric Kow <eric.kow at gmail.com>**20061110110801
Testing SSH stuff is tricky in that (1) you need some place to connect
to and (2) you often want to make sure that the user interactions work
out right. But it can't hurt to script away the boring stuff so that
you are naturally encouraged to test things out more thoroughly.
]
[Resolve conflict in Resolution.lhs.
Eric Kow <eric.kow at loria.fr>**20061113032236
]
[External resolution can resolve conflicting adds
edwin.thomson at businesswebsoftware.com**20061106114755]
[Only copy files needed in external_resolution
edwin.thomson at businesswebsoftware.com**20061106114719]
[change message in 'darcs check' from "applying" to "checking" (issue147)
Tommy Pettersson <ptp at lysator.liu.se>**20061111154259]
[update annotate for hashed inventories
Jason Dagit <dagit at codersbase.com>**20061108033202
Fixes test suite failure for annotate on a repository with hashed inventory.
]
[make Get work with hashed inventory.
David Roundy <droundy at darcs.net>**20061101150901
This is inefficient, but it uses only the pre-existing refactored
functions, so it's the easiest approach. Later we can write an efficient
bit of code to do the same thing.
]
[make darcs check use Repository framework.
David Roundy <droundy at darcs.net>**20060927024514]
[fix parsing of hashed inventories.
David Roundy <droundy at darcs.net>**20060927024505]
[put Repository in Show class for debugging ease.
David Roundy <droundy at darcs.net>**20060927021202]
[add test target for testing hashed inventories.
David Roundy <droundy at darcs.net>**20060927020127]
[add a bit of hashed inventory code.
David Roundy <droundy at darcs.net>**20060918173904]
[resolve conflicts
Tommy Pettersson <ptp at lysator.liu.se>**20061102184834
Merge Unrecord fix for checkpoints inventory with Repository code refactoring.
]
[Do _not_ allow escaped quotes in `quoted'.
Eric Kow <eric.kow at loria.fr>**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 <wiml at hhhh.org>**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)
]
[Replace tabs with spaces (escaped quotes in PatchMatch).
Eric Kow <eric.kow at loria.fr>**20061023192003]
[Allow escaped quotes in `quoted'.
Dave Love <fx at gnu.org>**20060716193940]
[Added --store-in-memory option for diff
edwin.thomson at businesswebsoftware.com**20061006122802
]
[Move RawMode into DarcsUtils to break cyclic imports on Win32
Josef Svenningsson <josef.svenningsson at gmail.com>**20061004120024]
[Added rigorous error checking in exec
Magnus Jonsson <magnus at smartelectronix.com>**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.
]
[remove duplicate file names in fix_filepaths (fixes issue273)
Tommy Pettersson <ptp at lysator.liu.se>**20060929145335]
[add test for replace command with duplicated file name
Tommy Pettersson <ptp at lysator.liu.se>**20060929144008]
[Move bug reporting code to its own module.
Eric Kow <eric.kow at loria.fr>**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 <droundy at darcs.net>**20060917214136]
[redirect errors to stderr where exec output is used
Tommy Pettersson <ptp at lysator.liu.se>**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.
]
[Be explicit about timezone handling (issue220); assume local by default.
Eric Kow <eric.kow at gmail.com>**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 <eric.kow at gmail.com>**20060610193049
]
[Fix merge conflicts.
Juliusz Chroboczek <jch at pps.jussieu.fr>**20060906191317]
[fix bug in pristine handling when dealing with multiple patches.
David Roundy <droundy at darcs.net>**20060731111404]
[fix ordering of operations to call pull_first_middles properly.
David Roundy <droundy at darcs.net>**20060730111409]
[fix bug in refactoring of get.
David Roundy <droundy at darcs.net>**20060726121655]
[refactor Population.
David Roundy <droundy at darcs.net>**20060716034837]
[add TODO for refactoring get_markedup_file.
David Roundy <droundy at darcs.net>**20060716034339]
[partial refactoring in annotate.
David Roundy <droundy at darcs.net>**20060716034319]
[don't use DarcsRepo in list_authors.
David Roundy <droundy at darcs.net>**20060716033450]
[I've now eliminated need to export DarcsRepo.write_patch.
David Roundy <droundy at darcs.net>**20060716033109]
[partially refactor Optimize.
David Roundy <droundy at darcs.net>**20060716032934]
[partial refactoring of Get.
David Roundy <droundy at darcs.net>**20060716031605]
[refactor amend-record.
David Roundy <droundy at darcs.net>**20060716021003]
[add TODO to refactor unrevert handling.
David Roundy <droundy at darcs.net>**20060716020247]
[refactor Unrecord, adding tentativelyRemovePatches.
David Roundy <droundy at darcs.net>**20060716015150]
[refactor tag.
David Roundy <droundy at darcs.net>**20060716011853]
[refactor Repository to allow truly atomic updates.
David Roundy <droundy at darcs.net>**20060716011245]
[TAG darcs-unstable-20060831
Juliusz Chroboczek <jch at pps.jussieu.fr>**20060831191554]
[Test pull.pl, CREATE_DIR_ERROR: removed TODO now that directory name is printed in error message
Marnix Klooster <marnix.klooster at gmail.com>**20060304164033
Also removes a superfluous (and erroneous) chdir statement, which tried to
change to non-existing directory templ (last character was ell instead of one).
Also improves the description of this test.
]
[TAG 1.0.9rc2
Tommy Pettersson <ptp at lysator.liu.se>**20061116140351]
Patch bundle hash:
9d42d6b2e162f07321174c474e423e0d08750b80
More information about the darcs-devel
mailing list