%Copyright(C)2002-2003DavidRoundy%%Thisprogramisfreesoftware;youcanredistributeitand/ormodify%itunderthetermsoftheGNUGeneralPublicLicenseaspublishedby%theFreeSoftwareFoundation;eitherversion2,or(atyouroption)%anylaterversion.%%Thisprogramisdistributedinthehopethatitwillbeuseful,%butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof%MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe%GNUGeneralPublicLicenseformoredetails.%%YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense%alongwiththisprogram;seethefileCOPYING.Ifnot,writeto%theFreeSoftwareFoundation,Inc.,51FranklinStreet,FifthFloor,%Boston,MA02110-1301,USA.\subsection{darcsinitialize}\label{initialize}\begin{code}moduleDarcs.Commands.Init(initialize,initialize_cmd)whereimportDarcs.Commands(DarcsCommand(..),nodefaults)importDarcs.Arguments(DarcsFlag,working_repo_dir,inventory_choices)importDarcs.Repository(amNotInRepository,createRepository)\end{code}\options{initialize}\haskell{initialize_description}\begin{code}initialize_description::Stringinitialize_description="Initialize a new source tree as a darcs repository."\end{code}Call\verb|initialize|onceforeachprojectyouworkon.Runitfromthetopleveldirectoryoftheproject,withtheprojectfilesalreadythere.\verb|initialize|willsetupallthedirectoriesandfilesdarcsneedsinordertostartkeepingtrackofrevisionsforyourproject.\begin{code}initialize_help::Stringinitialize_help="Call initialize once for each project you work on. Run it from the top\n"++"level directory of the project, with the project files already there.\n"++"Initialize will set up all the directories and files darcs needs in order to\n"++"start keeping track of revisions for your project.\n"initialize::DarcsCommandinitialize=DarcsCommand{command_name="initialize",command_help=initialize_help,command_description=initialize_description,command_extra_args=0,command_extra_arg_help=[],command_prereq=amNotInRepository,command_command=initialize_cmd,command_get_arg_possibilities=return[],command_argdefaults=nodefaults,command_advanced_options=[],command_basic_options=[inventory_choices,working_repo_dir]}\end{code}\verb|initialize|createsasingledirectorynamed\verb|_darcs|,withcontentsforinternaluse.Theonesubdictoryofinteresttousersis\verb'_darcs/prefs',whichwillincludeanemptyfile\verb'_darcs/prefs/motd'(seeSection~\ref{motd}),aswellasfilesnamed\verb'boring'and\verb'binaries',whichcontainusefuldefaultsasdescribedinSections\ref{boring}\emph{etseq.}\begin{options}--old-fashioned-inventory--hashed--darcs-2\end{options}Theseoptionsforceaparticularrepositoryformattobeused.\begin{code}initialize_cmd::[DarcsFlag]->[String]->IO()initialize_cmdopts_=createRepositoryopts\end{code}