##// END OF EJS Templates
small fixes for the parent patch...
Alexis S. L. Carvalho -
r4166:c0271aba default
parent child Browse files
Show More
@@ -41,20 +41,19 b' class localrepository(repo.repository):'
41 if not os.path.exists(path):
41 if not os.path.exists(path):
42 os.mkdir(path)
42 os.mkdir(path)
43 os.mkdir(self.path)
43 os.mkdir(self.path)
44 if parentui.config('format', 'usestore', 1):
44 requirements = ["revlogv1"]
45 if parentui.configbool('format', 'usestore', True):
45 os.mkdir(os.path.join(self.path, "store"))
46 os.mkdir(os.path.join(self.path, "store"))
46 requirements = ("revlogv1", "store")
47 requirements.append("store")
47 else:
48 # create an invalid changelog
48 requirements = ("revlogv1")
49 self.opener("00changelog.i", "a").write(
50 '\0\0\0\2' # represents revlogv2
51 ' dummy changelog to prevent using the old repo layout'
52 )
49 reqfile = self.opener("requires", "w")
53 reqfile = self.opener("requires", "w")
50 for r in requirements:
54 for r in requirements:
51 reqfile.write("%s\n" % r)
55 reqfile.write("%s\n" % r)
52 reqfile.close()
56 reqfile.close()
53 # create an invalid changelog
54 self.opener("00changelog.i", "a").write(
55 '\0\0\0\2' # represents revlogv2
56 ' dummy changelog to prevent using the old repo layout'
57 )
58 else:
57 else:
59 raise repo.RepoError(_("repository %s not found") % path)
58 raise repo.RepoError(_("repository %s not found") % path)
60 elif create:
59 elif create:
@@ -22,11 +22,31 b' echo Got arguments 1:$1 2:$2 3:$3 4:$4 5'
22 EOF
22 EOF
23 chmod +x dummyssh
23 chmod +x dummyssh
24
24
25 checknewrepo()
26 {
27 name=$1
28
29 if [ -d $name/.hg/store ]; then
30 echo store created
31 fi
32
33 if [ -f $name/.hg/00changelog.i ]; then
34 echo 00changelog.i created
35 fi
36
37 cat $name/.hg/requires
38 }
39
25 echo "# creating 'local'"
40 echo "# creating 'local'"
26 hg init local
41 hg init local
42 checknewrepo local
27 echo this > local/foo
43 echo this > local/foo
28 hg ci --cwd local -A -m "init" -d "1000000 0"
44 hg ci --cwd local -A -m "init" -d "1000000 0"
29
45
46 echo "# creating repo with old format"
47 hg --config format.usestore=false init old
48 checknewrepo old
49
30 echo "#test failure"
50 echo "#test failure"
31 hg init local
51 hg init local
32
52
@@ -1,5 +1,11 b''
1 # creating 'local'
1 # creating 'local'
2 store created
3 00changelog.i created
4 revlogv1
5 store
2 adding foo
6 adding foo
7 # creating repo with old format
8 revlogv1
3 #test failure
9 #test failure
4 abort: repository local already exists!
10 abort: repository local already exists!
5 # init+push to remote2
11 # init+push to remote2
General Comments 0
You need to be logged in to leave comments. Login now