diff mercurial/localrepo.py @ 4166:c0271aba6abe

small fixes for the parent patch - format.usestore is a boolean option - python wart: ("revlogv1") is a string, not a tuple - only create a dummy changelog if we're using a store - add a test
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 08 Mar 2007 20:08:24 -0300
parents fe41d9a186ab
children ac9e891f2c0f
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Mar 08 16:13:16 2007 -0600
+++ b/mercurial/localrepo.py	Thu Mar 08 20:08:24 2007 -0300
@@ -41,20 +41,19 @@
                 if not os.path.exists(path):
                     os.mkdir(path)
                 os.mkdir(self.path)
-                if parentui.config('format', 'usestore', 1):
+                requirements = ["revlogv1"]
+                if parentui.configbool('format', 'usestore', True):
                     os.mkdir(os.path.join(self.path, "store"))
-                    requirements = ("revlogv1", "store")
-                else:
-                    requirements = ("revlogv1")
+                    requirements.append("store")
+                    # create an invalid changelog
+                    self.opener("00changelog.i", "a").write(
+                        '\0\0\0\2' # represents revlogv2
+                        ' dummy changelog to prevent using the old repo layout'
+                    )
                 reqfile = self.opener("requires", "w")
                 for r in requirements:
                     reqfile.write("%s\n" % r)
                 reqfile.close()
-                # create an invalid changelog
-                self.opener("00changelog.i", "a").write(
-                    '\0\0\0\2' # represents revlogv2
-                    ' dummy changelog to prevent using the old repo layout'
-                )
             else:
                 raise repo.RepoError(_("repository %s not found") % path)
         elif create: