Hi all,

Here's a fix for issue805.  I'm pushing the former patch (which is
just a refactor), and leaving the changing of the default repository
format for a bit more discussion.

David

Wed Sep 24 09:53:19 EDT 2008  David Roundy <[EMAIL PROTECTED]>
  * make flagsToPristine obey repository format.
  This reduces the number of places we set the default repository format
  (hopefully to one?).

Wed Sep 24 10:11:58 EDT 2008  David Roundy <[EMAIL PROTECTED]>
  * resolve issue805: make darcs-2 format the default for new repositories.

New patches:

[make flagsToPristine obey repository format.
David Roundy <[EMAIL PROTECTED]>**20080924135319
 Ignore-this: 6038a7d05126af9e446406022ca608a0
 This reduces the number of places we set the default repository format
 (hopefully to one?).
] hunk ./src/Darcs/Repository.lhs 125
       (\e-> if isAlreadyExistsError e
             then fail "Tree has already been initialized!"
             else fail $ "Error creating directory `"++darcsdir++"'.")
-  createPristine $ flagsToPristine opts
+  let rf = create_repo_format opts
+  createPristine $ flagsToPristine opts rf
   createDirectory $ darcsdir ++ "/patches"
   createDirectory $ darcsdir ++ "/prefs"
   write_default_prefs
hunk ./src/Darcs/Repository.lhs 130
-  let rf = create_repo_format opts
   writeRepoFormat rf (darcsdir++"/format")
   if format_has HashedInventory rf
       then writeBinFile (darcsdir++"/hashed_inventory") ""
hunk ./src/Darcs/Repository/Pristine.lhs 45
 import Darcs.Utils ( catchall )
 
 import Darcs.PopulationData ( Population, getPopFrom )
-import Darcs.Flags ( DarcsFlag( PristinePlain, PristineNone, UseHashedInventory, UseFormat2 ) )
+import Darcs.Flags ( DarcsFlag( PristinePlain, PristineNone ) )
+import Darcs.Repository.Format ( RepoFormat, format_has,
+                                 RepoProperty(HashedInventory) )
 import Darcs.IO ( WriteableDirectory(mWithCurrentDirectory) )
 import Darcs.Patch ( Patchy, apply )
 import Darcs.Patch.Info ( PatchInfo )
hunk ./src/Darcs/Repository/Pristine.lhs 97
               where  n1 = darcsdir++"/pristine" ++ ext
                      n2 = darcsdir++"/current" ++ ext
 
-flagsToPristine :: [DarcsFlag] -> Pristine
-flagsToPristine fs | UseFormat2 `elem` fs || UseHashedInventory `elem` fs = HashedPristine
-flagsToPristine (PristineNone : _) = NoPristine (darcsdir++"/" ++ pristineName ++ ".none")
-flagsToPristine (PristinePlain : _) = PlainPristine (darcsdir++"/" ++ pristineName)
-flagsToPristine (_ : t) = flagsToPristine t
-flagsToPristine [] = flagsToPristine [PristinePlain]
+flagsToPristine :: [DarcsFlag] -> RepoFormat -> Pristine
+flagsToPristine _ rf | format_has HashedInventory rf = HashedPristine
+flagsToPristine (PristineNone : _) _ = NoPristine (darcsdir++"/" ++ pristineName ++ ".none")
+flagsToPristine (PristinePlain : _) _ = PlainPristine (darcsdir++"/" ++ pristineName)
+flagsToPristine (_ : t) rf = flagsToPristine t rf
+flagsToPristine [] rf = flagsToPristine [PristinePlain] rf
 
 createPristine :: Pristine -> IO Pristine
 createPristine p = 
[resolve issue805: make darcs-2 format the default for new repositories.
David Roundy <[EMAIL PROTECTED]>**20080924141158
 Ignore-this: e7952cb0cdc3124ffa50b0775822000e
] hunk ./src/Darcs/Arguments.lhs 857
     [DarcsNoArgOption [] ["hashed"] UseHashedInventory
                           "Some new features. Compatible with older repos",
      DarcsNoArgOption [] ["darcs-2"] UseFormat2
-                          "All features. Related repos must use same format",
+                          "All features. Related repos must use same format [DEFAULT]",
      DarcsNoArgOption [] ["old-fashioned-inventory"] UseOldFashionedInventory
hunk ./src/Darcs/Arguments.lhs 859
-                          "Minimal features. What older repos use. [DEFAULT]"]
+                          "Minimal features. What older repos use."]
 
 get_inventory_choices :: DarcsOption
 get_inventory_choices =
hunk ./src/Darcs/Commands/Get.lhs 137
   when (format_has Darcs2 rfsource && UseOldFashionedInventory `elem` opts) $
     putInfo $ text "Warning: 'old-fashioned-inventory' is ignored with a darcs-2 repository\n"
   let opts' = if format_has Darcs2 rfsource
-              then UseFormat2:filter (/= UseOldFashionedInventory) opts
+              then UseFormat2:opts
               else if format_has HashedInventory rfsource &&
                       not (UseOldFashionedInventory `elem` opts)
                    then UseHashedInventory:filter (/= UseFormat2) opts
hunk ./src/Darcs/Commands/Get.lhs 141
-                   else filter (/= UseFormat2) opts
+                   else UseOldFashionedInventory:filter (/= UseFormat2) opts
   (command_command initialize) opts' []
   debugMessage "Finished initializing new directory."
   set_defaultrepo repodir opts
hunk ./src/Darcs/Repository/Format.lhs 21
 import Darcs.External ( fetchFilePS, Cachable( Cachable ) )
 import FastPackedString ( PackedString, packString, nilPS, unpackPS,
                           nullPS, linesPS, splitPS, findPS )
-import Darcs.Flags ( DarcsFlag ( UseFormat2, UseHashedInventory ) )
+import Darcs.Flags ( DarcsFlag ( UseFormat2, UseHashedInventory,
+                                 UseOldFashionedInventory ) )
 import Darcs.Lock ( writeBinFile )
 import Darcs.Utils ( catchall, prettyException )
 import Darcs.Progress ( beginTedious, endTedious, finishedOneIO )
hunk ./src/Darcs/Repository/Format.lhs 71
 
 create_repo_format :: [DarcsFlag] -> RepoFormat
 create_repo_format fs = RF ([map rp2ps flags2inv] ++ maybe2)
-    where flags2inv | UseFormat2 `elem` fs || UseHashedInventory `elem` fs = [HashedInventory]
-                    | otherwise = [Darcs1_0]
-          maybe2 = if UseFormat2 `elem` fs then [[rp2ps Darcs2]] else []
+    where flags2inv | UseFormat2 `elem` fs = [HashedInventory]
+                    | UseOldFashionedInventory `elem` fs = [Darcs1_0]
+                    | otherwise = [HashedInventory]
+          maybe2 = if UseFormat2 `notElem` fs &&
+                      (UseOldFashionedInventory `elem` fs ||
+                       UseHashedInventory `elem` fs)
+                   then []
+                   else [[rp2ps Darcs2]]
 
 \end{code}
 

Context:

[fix filepath code to work with FilePath package that preceded filepath.
[EMAIL PROTECTED]
 Ignore-this: 6aa0d8b357b0f966403ebe5965dcdec4
] 
[fix type witness bug in createRepository.
David Roundy <[EMAIL PROTECTED]>**20080922234321
 Ignore-this: 2c50393ca25740ce3e210dd24fe8d8fa
] 
[Resolve conflict between replace patches in Darcs.Arguments
Eric Kow <[EMAIL PROTECTED]>**20080922202647] 
[Resolve issue53: check for windows filename validity in darcs add/mv.
Eric Kow <[EMAIL PROTECTED]>**20080922172004] 
[Use --reserved-ok to allow a file with ':' in it in tests.
Eric Kow <[EMAIL PROTECTED]>**20080922171519
 It's likely that this test will just fail under Windows and
 we will have to disable it.
] 
[Add test for issue53.
Eric Kow <[EMAIL PROTECTED]>**20080922152256] 
[Add --reserved-ok flag for darcs add and mv.
Eric Kow <[EMAIL PROTECTED]>**20080922141532
 This is just the flag, not the actual effect.
] 
[Check for filepath package in configure.
Eric Kow <[EMAIL PROTECTED]>**20080922140520] 
[simplify fix for issue1041.
David Roundy <[EMAIL PROTECTED]>**20080922233019
 Ignore-this: a3002e9bba5271790c62ac634e08f472
 It turns out that the simple solution works once a bug in the
 conflict-doppleganger test was fixed!
] 
[translate conflict-doppleganger test to bash.
David Roundy <[EMAIL PROTECTED]>**20080922232839
 Ignore-this: de2a050022dea4251cdc2cc5e8b55c8c
] 
[Translate mark-conflicts test into shell.
Eric Kow <[EMAIL PROTECTED]>**20080922224858
 It was failing because it expects init to be completely silent.  Since we
 were going to tweak it anyway, we might as well simplify the script.
] 
[Stop calling the darcs-2 format experimental.
Eric Kow <[EMAIL PROTECTED]>**20080922221024] 
[Move repository creation to Darcs.Repository.
Eric Kow <[EMAIL PROTECTED]>**20080922215913
 This is just to avoid importing the DarcsRepo and HashedRepo code in higher
 level code.
] 
[remove test_unit from disttest to speed things up.
David Roundy <[EMAIL PROTECTED]>**20080922225355
 Ignore-this: b3b21bcd3fa72c8d602b5bd0e601021a
 The unit test is only affected by very rarely-modified code, and it's
 overkill to run it absolutely every single time we push code
 (particularly as it sometimes takes exponentially long to generate its
 test cases).
] 
[resolve issue1041: add test for issue1041.
David Roundy <[EMAIL PROTECTED]>**20080922183320
 Ignore-this: 5a6330158d16a24d45f58268c0edb823
 Note that this issue was actually resolved by Vlad Dogaru.  I just
 wrote the test.
] 
[Get: if URL is invalid, direcotry is not created (#1041)
Vlad Dogaru <[EMAIL PROTECTED]>**20080922171705] 
[Replace --without-docs with less ambiguous --without-manual (issue1082).
Trent W. Buck <[EMAIL PROTECTED]>**20080922002602
 It's confusing for ./configure --without-docs to complain about missing haddock.
] 
[Documentation for --allow-unrelated-repos.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080922121122
 Ignore-this: d2630826313c8aeb00acb6853030c22d
] 
[Rename --ignore-unrelated-repos to --allow-unrelated-repos.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080922120727
 Ignore-this: a5990f1741c867316a948e6721118651
] 
[fix  bug I introduced into issue1039 test.
David Roundy <[EMAIL PROTECTED]>**20080921213043
 Ignore-this: 5b3c6476abae6bb050be014555d05bbe
] 
[Fix hang after a user input error (for example, EOF).
Judah Jacobson <[EMAIL PROTECTED]>**20080918163017] 
[replace consRLSealed with a more  general mapFlipped.
David Roundy <[EMAIL PROTECTED]>**20080921185241
 Ignore-this: c28f73f165254582cba6a14ba6ce93
] 
[make issue1039 fix allow small dissimilar  repositories.
David Roundy <[EMAIL PROTECTED]>**20080921184515
 Ignore-this: 918a09df18ef48c649c1bfaa866d6176
] 
[revert refactor that breaks type witnesses.
David Roundy <[EMAIL PROTECTED]>**20080921182331
 Ignore-this: dd692cffc1a238d6726448bacfe9cacc
] 
[Add '--ignore-unrelated-repos' option to disable unrelated repositories check.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919152631] 
[Resolve issue1039: detect seemingly unrelated repositories when doing push, pull and send.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919144553] 
[Refactor in pull_cmd.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919135349
 Ignore-this: e26a489a7a53aeaba544ae5ad0006700
] 
[Test for issue1039.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919153011] 
[manual: add an example of record --pipe prompts similar to tag --pipe docs
Simon Michael <[EMAIL PROTECTED]>**20080918205353] 
[user manual corrections regarding what record and tag --pipe prompt for
Simon Michael <[EMAIL PROTECTED]>**20080918204500] 
[clarify the short help for --pipe
Simon Michael <[EMAIL PROTECTED]>**20080918193717] 
[Spaces in Darcs.Arguments.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919150440] 
[Spaces in Darcs.Commands.Send.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919150139] 
[Spaces in Darcs.Commands.Pull.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919145812] 
[Spaces in Darcs.Commands.Push.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919145553] 
[Print "We have the following patches to send:" only when we really have somthing to send.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080919114229] 
[Use gmakeisms for prettier output.
Trent W. Buck <[EMAIL PROTECTED]>**20080919071358] 
[fix changes.pl test (translating to bash)
David Roundy <[EMAIL PROTECTED]>**20080917182432
 Ignore-this: 5f8bc7e1f9eadc073402a935142281c4
 This test made assumptions such as that darcs wouldn't ever add a long
 comment to its internal representation of changes, which are now
 broken.
] 
[hokey fix to allow unit tests to generate random input.
David Roundy <[EMAIL PROTECTED]>**20080917170913
 Ignore-this: 31e847e82eef741f4c6cc857fd79a245
 A nicer fix would be to move namepatch and patchinfo into some sort of
 random-number monad rather than leaving them in IO and using
 unsafePerformIO in the example-generation scripts.
] 
[resolve issue27: add junk to patch identifiers.
David Roundy <[EMAIL PROTECTED]>**20080917154657
 Ignore-this: b91ab6f6e05e0fda25488fa51653b741
] 
[TAG 2.0.3pre1
Eric Kow <[EMAIL PROTECTED]>**20080918023645] 
Patch bundle hash:
a607db0425f23353fc555215cc4a5bd4e2ce6185
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to