resolve issue1643: optimize --upgrade should do optimize
--------------------------------------------------------
> optimize_cmd :: [DarcsFlag] -> [String] -> IO ()
> -optimize_cmd opts _ | UpgradeFormat `elem` opts = optimizeUpgradeFormat
> -optimize_cmd origopts _ = withRepoLock opts $- \repository -> do
> +optimize_cmd origopts _ = do
> + when (UpgradeFormat `elem` origopts) optimizeUpgradeFormat
> + withRepoLock opts $- \repository -> do
Looks good to me.
Possible future work: I suspect that you could also get a hacky
implementation of http://bugs.darcs.net/issue1642 out of this, but I
guess it's better to do it the way that the ticket above suggests to
avoid doing double work of creating the hashed pristine and then
upgrading it.
Alternatively, people could just do darcs optimize --upgrade --pristine
thanks to your patch...
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
|