Show More
@@ -0,0 +1,14 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | mkdir t | |||
|
4 | cd t | |||
|
5 | hg init | |||
|
6 | echo a > a | |||
|
7 | hg add a | |||
|
8 | hg commit -m test -d "1000000 0" | |||
|
9 | rm .hg/requires | |||
|
10 | hg tip | |||
|
11 | echo indoor-pool > .hg/requires | |||
|
12 | hg tip | |||
|
13 | ||||
|
14 | true |
@@ -0,0 +1,2 b'' | |||||
|
1 | abort: index 00changelog.i unknown format 2! | |||
|
2 | abort: requirement 'indoor-pool' not supported! |
@@ -128,15 +128,13 b' def clone(ui, source, dest=None, pull=Fa' | |||||
128 | if self.dir_: |
|
128 | if self.dir_: | |
129 | self.rmtree(self.dir_, True) |
|
129 | self.rmtree(self.dir_, True) | |
130 |
|
130 | |||
131 | dest_repo = repository(ui, dest, create=True) |
|
|||
132 |
|
||||
133 | dir_cleanup = None |
|
131 | dir_cleanup = None | |
134 |
if |
|
132 | if islocal(dest): | |
135 |
dir_cleanup = DirCleanup( |
|
133 | dir_cleanup = DirCleanup(dest) | |
136 |
|
134 | |||
137 | abspath = source |
|
135 | abspath = source | |
138 | copy = False |
|
136 | copy = False | |
139 |
if src_repo.local() and |
|
137 | if src_repo.local() and islocal(dest): | |
140 | abspath = os.path.abspath(source) |
|
138 | abspath = os.path.abspath(source) | |
141 | copy = not pull and not rev |
|
139 | copy = not pull and not rev | |
142 |
|
140 | |||
@@ -152,9 +150,27 b' def clone(ui, source, dest=None, pull=Fa' | |||||
152 | copy = False |
|
150 | copy = False | |
153 |
|
151 | |||
154 | if copy: |
|
152 | if copy: | |
155 | # we lock here to avoid premature writing to the target |
|
153 | def force_copy(src, dst): | |
|
154 | try: | |||
|
155 | util.copyfiles(src, dst) | |||
|
156 | except OSError, inst: | |||
|
157 | if inst.errno != errno.ENOENT: | |||
|
158 | raise | |||
|
159 | ||||
156 | src_store = os.path.realpath(src_repo.spath) |
|
160 | src_store = os.path.realpath(src_repo.spath) | |
157 | dest_store = os.path.realpath(dest_repo.spath) |
|
161 | if not os.path.exists(dest): | |
|
162 | os.mkdir(dest) | |||
|
163 | dest_path = os.path.realpath(os.path.join(dest, ".hg")) | |||
|
164 | os.mkdir(dest_path) | |||
|
165 | if src_repo.spath != src_repo.path: | |||
|
166 | dest_store = os.path.join(dest_path, "store") | |||
|
167 | os.mkdir(dest_store) | |||
|
168 | else: | |||
|
169 | dest_store = dest_path | |||
|
170 | # copy the requires file | |||
|
171 | force_copy(src_repo.join("requires"), | |||
|
172 | os.path.join(dest_path, "requires")) | |||
|
173 | # we lock here to avoid premature writing to the target | |||
158 | dest_lock = lock.lock(os.path.join(dest_store, "lock")) |
|
174 | dest_lock = lock.lock(os.path.join(dest_store, "lock")) | |
159 |
|
175 | |||
160 | files = ("data", |
|
176 | files = ("data", | |
@@ -163,17 +179,15 b' def clone(ui, source, dest=None, pull=Fa' | |||||
163 | for f in files: |
|
179 | for f in files: | |
164 | src = os.path.join(src_store, f) |
|
180 | src = os.path.join(src_store, f) | |
165 | dst = os.path.join(dest_store, f) |
|
181 | dst = os.path.join(dest_store, f) | |
166 | try: |
|
182 | force_copy(src, dst) | |
167 | util.copyfiles(src, dst) |
|
|||
168 | except OSError, inst: |
|
|||
169 | if inst.errno != errno.ENOENT: |
|
|||
170 | raise |
|
|||
171 |
|
183 | |||
172 | # we need to re-init the repo after manually copying the data |
|
184 | # we need to re-init the repo after manually copying the data | |
173 | # into it |
|
185 | # into it | |
174 | dest_repo = repository(ui, dest) |
|
186 | dest_repo = repository(ui, dest) | |
175 |
|
187 | |||
176 | else: |
|
188 | else: | |
|
189 | dest_repo = repository(ui, dest, create=True) | |||
|
190 | ||||
177 | revs = None |
|
191 | revs = None | |
178 | if rev: |
|
192 | if rev: | |
179 | if 'lookup' not in src_repo.capabilities: |
|
193 | if 'lookup' not in src_repo.capabilities: |
@@ -10,12 +10,14 b' import os, mimetypes' | |||||
10 | import os.path |
|
10 | import os.path | |
11 |
|
11 | |||
12 | def get_mtime(repo_path): |
|
12 | def get_mtime(repo_path): | |
13 |
|
|
13 | store_path = os.path.join(repo_path, ".hg") | |
14 | cl_path = os.path.join(hg_path, "00changelog.i") |
|
14 | if not os.path.isdir(os.path.join(store_path, "data")): | |
15 | if os.path.exists(os.path.join(cl_path)): |
|
15 | store_path = os.path.join(store_path, "store") | |
|
16 | cl_path = os.path.join(store_path, "00changelog.i") | |||
|
17 | if os.path.exists(cl_path): | |||
16 | return os.stat(cl_path).st_mtime |
|
18 | return os.stat(cl_path).st_mtime | |
17 | else: |
|
19 | else: | |
18 |
return os.stat( |
|
20 | return os.stat(store_path).st_mtime | |
19 |
|
21 | |||
20 | def staticfile(directory, fname, req): |
|
22 | def staticfile(directory, fname, req): | |
21 | """return a file inside directory with guessed content-type header |
|
23 | """return a file inside directory with guessed content-type header |
@@ -16,6 +16,7 b' demandload(globals(), "os revlog time ut' | |||||
16 |
|
16 | |||
17 | class localrepository(repo.repository): |
|
17 | class localrepository(repo.repository): | |
18 | capabilities = ('lookup', 'changegroupsubset') |
|
18 | capabilities = ('lookup', 'changegroupsubset') | |
|
19 | supported = ('revlogv1', 'store') | |||
19 |
|
20 | |||
20 | def __del__(self): |
|
21 | def __del__(self): | |
21 | self.transhandle = None |
|
22 | self.transhandle = None | |
@@ -30,28 +31,55 b' class localrepository(repo.repository):' | |||||
30 | raise repo.RepoError(_("There is no Mercurial repository" |
|
31 | raise repo.RepoError(_("There is no Mercurial repository" | |
31 | " here (.hg not found)")) |
|
32 | " here (.hg not found)")) | |
32 | path = p |
|
33 | path = p | |
|
34 | ||||
33 | self.path = os.path.join(path, ".hg") |
|
35 | self.path = os.path.join(path, ".hg") | |
34 |
self. |
|
36 | self.root = os.path.realpath(path) | |
|
37 | self.origroot = path | |||
|
38 | self.opener = util.opener(self.path) | |||
|
39 | self.wopener = util.opener(self.root) | |||
35 |
|
40 | |||
36 | if not os.path.isdir(self.path): |
|
41 | if not os.path.isdir(self.path): | |
37 | if create: |
|
42 | if create: | |
38 | if not os.path.exists(path): |
|
43 | if not os.path.exists(path): | |
39 | os.mkdir(path) |
|
44 | os.mkdir(path) | |
40 | os.mkdir(self.path) |
|
45 | os.mkdir(self.path) | |
41 |
|
|
46 | os.mkdir(os.path.join(self.path, "store")) | |
42 | os.mkdir(self.spath) |
|
47 | requirements = ("revlogv1", "store") | |
|
48 | reqfile = self.opener("requires", "w") | |||
|
49 | for r in requirements: | |||
|
50 | reqfile.write("%s\n" % r) | |||
|
51 | reqfile.close() | |||
|
52 | # create an invalid changelog | |||
|
53 | self.opener("00changelog.i", "a").write('\0\0\0\2') | |||
43 | else: |
|
54 | else: | |
44 | raise repo.RepoError(_("repository %s not found") % path) |
|
55 | raise repo.RepoError(_("repository %s not found") % path) | |
45 | elif create: |
|
56 | elif create: | |
46 | raise repo.RepoError(_("repository %s already exists") % path) |
|
57 | raise repo.RepoError(_("repository %s already exists") % path) | |
|
58 | else: | |||
|
59 | # find requirements | |||
|
60 | try: | |||
|
61 | requirements = self.opener("requires").read().splitlines() | |||
|
62 | except IOError, inst: | |||
|
63 | if inst.errno != errno.ENOENT: | |||
|
64 | raise | |||
|
65 | requirements = [] | |||
|
66 | # check them | |||
|
67 | for r in requirements: | |||
|
68 | if r not in self.supported: | |||
|
69 | raise repo.RepoError(_("requirement '%s' not supported") % r) | |||
47 |
|
70 | |||
48 | self.root = os.path.realpath(path) |
|
71 | # setup store | |
49 | self.origroot = path |
|
72 | if "store" in requirements: | |
|
73 | self.encodefn = util.encodefilename | |||
|
74 | self.decodefn = util.decodefilename | |||
|
75 | self.spath = os.path.join(self.path, "store") | |||
|
76 | else: | |||
|
77 | self.encodefn = lambda x: x | |||
|
78 | self.decodefn = lambda x: x | |||
|
79 | self.spath = self.path | |||
|
80 | self.sopener = util.encodedopener(util.opener(self.spath), self.encodefn) | |||
|
81 | ||||
50 | self.ui = ui.ui(parentui=parentui) |
|
82 | self.ui = ui.ui(parentui=parentui) | |
51 | self.opener = util.opener(self.path) |
|
|||
52 | self.sopener = util.opener(self.spath) |
|
|||
53 | self.wopener = util.opener(self.root) |
|
|||
54 |
|
||||
55 | try: |
|
83 | try: | |
56 | self.ui.readconfig(self.join("hgrc"), self.root) |
|
84 | self.ui.readconfig(self.join("hgrc"), self.root) | |
57 | except IOError: |
|
85 | except IOError: | |
@@ -408,6 +436,7 b' class localrepository(repo.repository):' | |||||
408 | return os.path.join(self.path, f) |
|
436 | return os.path.join(self.path, f) | |
409 |
|
437 | |||
410 | def sjoin(self, f): |
|
438 | def sjoin(self, f): | |
|
439 | f = self.encodefn(f) | |||
411 | return os.path.join(self.spath, f) |
|
440 | return os.path.join(self.spath, f) | |
412 |
|
441 | |||
413 | def wjoin(self, f): |
|
442 | def wjoin(self, f): |
@@ -32,12 +32,32 b' def opener(base):' | |||||
32 | class statichttprepository(localrepo.localrepository): |
|
32 | class statichttprepository(localrepo.localrepository): | |
33 | def __init__(self, ui, path): |
|
33 | def __init__(self, ui, path): | |
34 | self._url = path |
|
34 | self._url = path | |
35 | self.path = (path + "/.hg") |
|
|||
36 | self.spath = self.path |
|
|||
37 | self.ui = ui |
|
35 | self.ui = ui | |
38 | self.revlogversion = 0 |
|
36 | self.revlogversion = 0 | |
|
37 | ||||
|
38 | self.path = (path + "/.hg") | |||
39 | self.opener = opener(self.path) |
|
39 | self.opener = opener(self.path) | |
40 | self.sopener = opener(self.spath) |
|
40 | # find requirements | |
|
41 | try: | |||
|
42 | requirements = self.opener("requires").read().splitlines() | |||
|
43 | except IOError: | |||
|
44 | requirements = [] | |||
|
45 | # check them | |||
|
46 | for r in requirements: | |||
|
47 | if r not in self.supported: | |||
|
48 | raise repo.RepoError(_("requirement '%s' not supported") % r) | |||
|
49 | ||||
|
50 | # setup store | |||
|
51 | if "store" in requirements: | |||
|
52 | self.encodefn = util.encodefilename | |||
|
53 | self.decodefn = util.decodefilename | |||
|
54 | self.spath = self.path + "/store" | |||
|
55 | else: | |||
|
56 | self.encodefn = lambda x: x | |||
|
57 | self.decodefn = lambda x: x | |||
|
58 | self.spath = self.path | |||
|
59 | self.sopener = util.encodedopener(opener(self.spath), self.encodefn) | |||
|
60 | ||||
41 | self.manifest = manifest.manifest(self.sopener) |
|
61 | self.manifest = manifest.manifest(self.sopener) | |
42 | self.changelog = changelog.changelog(self.sopener) |
|
62 | self.changelog = changelog.changelog(self.sopener) | |
43 | self.tagscache = None |
|
63 | self.tagscache = None |
@@ -79,6 +79,8 b' def stream_out(repo, fileobj):' | |||||
79 | entries = [] |
|
79 | entries = [] | |
80 | total_bytes = 0 |
|
80 | total_bytes = 0 | |
81 | for name, size in walkrepo(repo.spath): |
|
81 | for name, size in walkrepo(repo.spath): | |
|
82 | if repo.decodefn: | |||
|
83 | name = repo.decodefn(name) | |||
82 | entries.append((name, size)) |
|
84 | entries.append((name, size)) | |
83 | total_bytes += size |
|
85 | total_bytes += size | |
84 | repolock.release() |
|
86 | repolock.release() |
@@ -905,6 +905,38 b' else:' | |||||
905 | st = fstat(f) |
|
905 | st = fstat(f) | |
906 | return st.st_uid == os.getuid() |
|
906 | return st.st_uid == os.getuid() | |
907 |
|
907 | |||
|
908 | def _buildencodefun(): | |||
|
909 | e = '_' | |||
|
910 | win_reserved = [ord(x) for x in '|\?*<":>+[]'] | |||
|
911 | cmap = dict([ (chr(x), chr(x)) for x in xrange(127) ]) | |||
|
912 | for x in (range(32) + range(126, 256) + win_reserved): | |||
|
913 | cmap[chr(x)] = "~%02x" % x | |||
|
914 | for x in range(ord("A"), ord("Z")+1) + [ord(e)]: | |||
|
915 | cmap[chr(x)] = e + chr(x).lower() | |||
|
916 | dmap = {} | |||
|
917 | for k, v in cmap.iteritems(): | |||
|
918 | dmap[v] = k | |||
|
919 | def decode(s): | |||
|
920 | i = 0 | |||
|
921 | while i < len(s): | |||
|
922 | for l in xrange(1, 4): | |||
|
923 | try: | |||
|
924 | yield dmap[s[i:i+l]] | |||
|
925 | i += l | |||
|
926 | break | |||
|
927 | except KeyError: | |||
|
928 | pass | |||
|
929 | else: | |||
|
930 | raise KeyError | |||
|
931 | return (lambda s: "".join([cmap[c] for c in s]), | |||
|
932 | lambda s: "".join(list(decode(s)))) | |||
|
933 | ||||
|
934 | encodefilename, decodefilename = _buildencodefun() | |||
|
935 | ||||
|
936 | def encodedopener(openerfn, fn): | |||
|
937 | def o(path, *args, **kw): | |||
|
938 | return openerfn(fn(path), *args, **kw) | |||
|
939 | return o | |||
908 |
|
940 | |||
909 | def opener(base, audit=True): |
|
941 | def opener(base, audit=True): | |
910 | """ |
|
942 | """ |
@@ -41,11 +41,11 b' hg commit -m "1.3m" -d "1000000 0"' | |||||
41 | hg update -C 3 |
|
41 | hg update -C 3 | |
42 | hg mv afile anotherfile |
|
42 | hg mv afile anotherfile | |
43 | hg commit -m "0.3m" -d "1000000 0" |
|
43 | hg commit -m "0.3m" -d "1000000 0" | |
44 | hg debugindex .hg/data/afile.i |
|
44 | hg debugindex .hg/store/data/afile.i | |
45 | hg debugindex .hg/data/adifferentfile.i |
|
45 | hg debugindex .hg/store/data/adifferentfile.i | |
46 | hg debugindex .hg/data/anotherfile.i |
|
46 | hg debugindex .hg/store/data/anotherfile.i | |
47 | hg debugindex .hg/data/fred.i |
|
47 | hg debugindex .hg/store/data/fred.i | |
48 | hg debugindex .hg/00manifest.i |
|
48 | hg debugindex .hg/store/00manifest.i | |
49 | hg verify |
|
49 | hg verify | |
50 | cd .. |
|
50 | cd .. | |
51 | for i in 0 1 2 3 4 5 6 7 8; do |
|
51 | for i in 0 1 2 3 4 5 6 7 8; do |
@@ -41,11 +41,11 b' hg commit -m "1.3m"' | |||||
41 | hg update -C 3 |
|
41 | hg update -C 3 | |
42 | hg mv afile anotherfile |
|
42 | hg mv afile anotherfile | |
43 | hg commit -m "0.3m" |
|
43 | hg commit -m "0.3m" | |
44 | hg debugindex .hg/data/afile.i |
|
44 | hg debugindex .hg/store/data/afile.i | |
45 | hg debugindex .hg/data/adifferentfile.i |
|
45 | hg debugindex .hg/store/data/adifferentfile.i | |
46 | hg debugindex .hg/data/anotherfile.i |
|
46 | hg debugindex .hg/store/data/anotherfile.i | |
47 | hg debugindex .hg/data/fred.i |
|
47 | hg debugindex .hg/store/data/fred.i | |
48 | hg debugindex .hg/00manifest.i |
|
48 | hg debugindex .hg/store/00manifest.i | |
49 | hg verify |
|
49 | hg verify | |
50 | cd .. |
|
50 | cd .. | |
51 | for i in 0 1 2 3 4 5 6 7 8; do |
|
51 | for i in 0 1 2 3 4 5 6 7 8; do |
@@ -11,4 +11,4 b' echo >> bar' | |||||
11 | hg ci -m 'cp bar foo; change bar' |
|
11 | hg ci -m 'cp bar foo; change bar' | |
12 |
|
12 | |||
13 | hg debugrename foo |
|
13 | hg debugrename foo | |
14 | hg debugindex .hg/data/bar.i |
|
14 | hg debugindex .hg/store/data/bar.i |
@@ -13,16 +13,16 b' hg history -v' | |||||
13 | echo "we should see one log entry for a" |
|
13 | echo "we should see one log entry for a" | |
14 | hg log a |
|
14 | hg log a | |
15 | echo "this should show a revision linked to changeset 0" |
|
15 | echo "this should show a revision linked to changeset 0" | |
16 | hg debugindex .hg/data/a.i |
|
16 | hg debugindex .hg/store/data/a.i | |
17 | echo "we should see one log entry for b" |
|
17 | echo "we should see one log entry for b" | |
18 | hg log b |
|
18 | hg log b | |
19 | echo "this should show a revision linked to changeset 1" |
|
19 | echo "this should show a revision linked to changeset 1" | |
20 | hg debugindex .hg/data/b.i |
|
20 | hg debugindex .hg/store/data/b.i | |
21 |
|
21 | |||
22 | echo "this should show the rename information in the metadata" |
|
22 | echo "this should show the rename information in the metadata" | |
23 | hg debugdata .hg/data/b.d 0 | head -3 | tail -2 |
|
23 | hg debugdata .hg/store/data/b.d 0 | head -3 | tail -2 | |
24 |
|
24 | |||
25 | $TESTDIR/md5sum.py .hg/data/b.i |
|
25 | $TESTDIR/md5sum.py .hg/store/data/b.i | |
26 | hg cat b > bsum |
|
26 | hg cat b > bsum | |
27 | $TESTDIR/md5sum.py bsum |
|
27 | $TESTDIR/md5sum.py bsum | |
28 | hg cat a > asum |
|
28 | hg cat a > asum |
@@ -41,7 +41,7 b' this should show a revision linked to ch' | |||||
41 | this should show the rename information in the metadata |
|
41 | this should show the rename information in the metadata | |
42 | copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 |
|
42 | copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 | |
43 | copy: a |
|
43 | copy: a | |
44 | ed156f22f0a6fde642de0b5eba0cbbb2 .hg/data/b.i |
|
44 | ed156f22f0a6fde642de0b5eba0cbbb2 .hg/store/data/b.i | |
45 | 60b725f10c9c85c70d97880dfe8191b3 bsum |
|
45 | 60b725f10c9c85c70d97880dfe8191b3 bsum | |
46 | 60b725f10c9c85c70d97880dfe8191b3 asum |
|
46 | 60b725f10c9c85c70d97880dfe8191b3 asum | |
47 | checking changesets |
|
47 | checking changesets |
@@ -14,7 +14,7 b' hg commit -m2 -d"0 0"' | |||||
14 | hg debugstate|grep '^copy' |
|
14 | hg debugstate|grep '^copy' | |
15 |
|
15 | |||
16 | echo "# should match" |
|
16 | echo "# should match" | |
17 | hg debugindex .hg/data/foo.i |
|
17 | hg debugindex .hg/store/data/foo.i | |
18 | hg debugrename bar |
|
18 | hg debugrename bar | |
19 |
|
19 | |||
20 | echo bleah > foo |
|
20 | echo bleah > foo | |
@@ -30,9 +30,9 b" hg debugstate|grep '^copy'" | |||||
30 | hg commit -m3 -d"0 0" |
|
30 | hg commit -m3 -d"0 0" | |
31 |
|
31 | |||
32 | echo "# should show no parents for tip" |
|
32 | echo "# should show no parents for tip" | |
33 | hg debugindex .hg/data/bar.i |
|
33 | hg debugindex .hg/store/data/bar.i | |
34 | echo "# should match" |
|
34 | echo "# should match" | |
35 | hg debugindex .hg/data/foo.i |
|
35 | hg debugindex .hg/store/data/foo.i | |
36 | hg debugrename bar |
|
36 | hg debugrename bar | |
37 |
|
37 | |||
38 | echo "# should show no copies" |
|
38 | echo "# should show no copies" |
@@ -30,12 +30,12 b' hg ci -A -m 2 -d "1000000 0"' | |||||
30 | hg merge 1 |
|
30 | hg merge 1 | |
31 | hg ci -A -m m1 -d "1000000 0" |
|
31 | hg ci -A -m m1 -d "1000000 0" | |
32 | #hg log |
|
32 | #hg log | |
33 | #hg debugindex .hg/00manifest.i |
|
33 | #hg debugindex .hg/store/00manifest.i | |
34 | hg update -C 1 |
|
34 | hg update -C 1 | |
35 | hg merge 2 |
|
35 | hg merge 2 | |
36 | hg ci -A -m m2 -d "1000000 0" |
|
36 | hg ci -A -m m2 -d "1000000 0" | |
37 | #hg log |
|
37 | #hg log | |
38 | #hg debugindex .hg/00manifest.i |
|
38 | #hg debugindex .hg/store/00manifest.i | |
39 |
|
39 | |||
40 | cd .. |
|
40 | cd .. | |
41 | hg clone -r 3 a b |
|
41 | hg clone -r 3 a b |
@@ -22,7 +22,7 b' echo %% no changes' | |||||
22 | hg status |
|
22 | hg status | |
23 |
|
23 | |||
24 | echo %% uncompressed contents in repo |
|
24 | echo %% uncompressed contents in repo | |
25 | hg debugdata .hg/data/a.gz.d 0 |
|
25 | hg debugdata .hg/store/data/a.gz.d 0 | |
26 |
|
26 | |||
27 | echo %% uncompress our working dir copy |
|
27 | echo %% uncompress our working dir copy | |
28 | gunzip < a.gz |
|
28 | gunzip < a.gz |
@@ -26,7 +26,7 b' HGMERGE=true hg merge 2' | |||||
26 | hg ci -m "merge a/b -> blah" -d "1000000 0" |
|
26 | hg ci -m "merge a/b -> blah" -d "1000000 0" | |
27 |
|
27 | |||
28 | hg log |
|
28 | hg log | |
29 | hg debugindex .hg/00changelog.i |
|
29 | hg debugindex .hg/store/00changelog.i | |
30 |
|
30 | |||
31 | echo |
|
31 | echo | |
32 |
|
32 | |||
@@ -41,6 +41,6 b' hg manifest --debug 4' | |||||
41 |
|
41 | |||
42 | echo |
|
42 | echo | |
43 |
|
43 | |||
44 | hg debugindex .hg/data/a.i |
|
44 | hg debugindex .hg/store/data/a.i | |
45 |
|
45 | |||
46 | hg verify |
|
46 | hg verify |
@@ -53,22 +53,22 b' hg debugstate | cut -b 1-16,35- | grep "' | |||||
53 | hg ci -m "merge" -d "1000000 0" |
|
53 | hg ci -m "merge" -d "1000000 0" | |
54 |
|
54 | |||
55 | echo "main: we should have a merge here" |
|
55 | echo "main: we should have a merge here" | |
56 | hg debugindex .hg/00changelog.i |
|
56 | hg debugindex .hg/store/00changelog.i | |
57 |
|
57 | |||
58 | echo "log should show foo and quux changed" |
|
58 | echo "log should show foo and quux changed" | |
59 | hg log -v -r tip |
|
59 | hg log -v -r tip | |
60 |
|
60 | |||
61 | echo "foo: we should have a merge here" |
|
61 | echo "foo: we should have a merge here" | |
62 | hg debugindex .hg/data/foo.i |
|
62 | hg debugindex .hg/store/data/foo.i | |
63 |
|
63 | |||
64 | echo "bar: we shouldn't have a merge here" |
|
64 | echo "bar: we shouldn't have a merge here" | |
65 | hg debugindex .hg/data/bar.i |
|
65 | hg debugindex .hg/store/data/bar.i | |
66 |
|
66 | |||
67 | echo "baz: we shouldn't have a merge here" |
|
67 | echo "baz: we shouldn't have a merge here" | |
68 | hg debugindex .hg/data/baz.i |
|
68 | hg debugindex .hg/store/data/baz.i | |
69 |
|
69 | |||
70 | echo "quux: we shouldn't have a merge here" |
|
70 | echo "quux: we shouldn't have a merge here" | |
71 | hg debugindex .hg/data/quux.i |
|
71 | hg debugindex .hg/store/data/quux.i | |
72 |
|
72 | |||
73 | echo "manifest entries should match tips of all files" |
|
73 | echo "manifest entries should match tips of all files" | |
74 | hg manifest --debug |
|
74 | hg manifest --debug |
@@ -43,6 +43,6 b' hg -v merge' | |||||
43 | ls -l ../test[123]/a > foo |
|
43 | ls -l ../test[123]/a > foo | |
44 | cut -b 1-10 < foo |
|
44 | cut -b 1-10 < foo | |
45 |
|
45 | |||
46 | hg debugindex .hg/data/a.i |
|
46 | hg debugindex .hg/store/data/a.i | |
47 | hg debugindex ../test2/.hg/data/a.i |
|
47 | hg debugindex ../test2/.hg/store/data/a.i | |
48 | hg debugindex ../test1/.hg/data/a.i |
|
48 | hg debugindex ../test1/.hg/store/data/a.i |
@@ -42,11 +42,11 b' hg commit -m "1.3m"' | |||||
42 | hg update -C 3 |
|
42 | hg update -C 3 | |
43 | hg mv afile anotherfile |
|
43 | hg mv afile anotherfile | |
44 | hg commit -m "0.3m" |
|
44 | hg commit -m "0.3m" | |
45 | hg debugindex .hg/data/afile.i |
|
45 | hg debugindex .hg/store/data/afile.i | |
46 | hg debugindex .hg/data/adifferentfile.i |
|
46 | hg debugindex .hg/store/data/adifferentfile.i | |
47 | hg debugindex .hg/data/anotherfile.i |
|
47 | hg debugindex .hg/store/data/anotherfile.i | |
48 | hg debugindex .hg/data/fred.i |
|
48 | hg debugindex .hg/store/data/fred.i | |
49 | hg debugindex .hg/00manifest.i |
|
49 | hg debugindex .hg/store/00manifest.i | |
50 | hg verify |
|
50 | hg verify | |
51 | echo "# Starting server" |
|
51 | echo "# Starting server" | |
52 | hg serve -p 20061 -d --pid-file=../hg1.pid |
|
52 | hg serve -p 20061 -d --pid-file=../hg1.pid |
@@ -10,7 +10,7 b' Q=$!' | |||||
10 | sleep 3 |
|
10 | sleep 3 | |
11 | kill -HUP $P |
|
11 | kill -HUP $P | |
12 | wait |
|
12 | wait | |
13 | ls .hg |
|
13 | ls -R .hg | |
14 |
|
14 | |||
15 |
|
15 | |||
16 |
|
16 |
@@ -4,5 +4,11 b' adding changesets' | |||||
4 | killed! |
|
4 | killed! | |
5 | transaction abort! |
|
5 | transaction abort! | |
6 | rollback completed |
|
6 | rollback completed | |
|
7 | .hg: | |||
7 | 00changelog.i |
|
8 | 00changelog.i | |
8 | journal.dirstate |
|
9 | journal.dirstate | |
|
10 | requires | |||
|
11 | store | |||
|
12 | ||||
|
13 | .hg/store: | |||
|
14 | 00changelog.i |
@@ -6,6 +6,6 b' hg --cwd a ci -A -m a' | |||||
6 | hg clone a b |
|
6 | hg clone a b | |
7 | echo b > b/b |
|
7 | echo b > b/b | |
8 | hg --cwd b ci -A -m b |
|
8 | hg --cwd b ci -A -m b | |
9 | chmod 100 a/.hg |
|
9 | chmod 100 a/.hg/store | |
10 | hg --cwd b push ../a |
|
10 | hg --cwd b push ../a | |
11 | chmod 700 a/.hg |
|
11 | chmod 700 a/.hg/store |
@@ -61,6 +61,6 b' HGMERGE=merge hg merge --debug' | |||||
61 |
|
61 | |||
62 | cat test.txt | sed "s% .*%%" |
|
62 | cat test.txt | sed "s% .*%%" | |
63 |
|
63 | |||
64 | hg debugindex .hg/data/test.txt.i |
|
64 | hg debugindex .hg/store/data/test.txt.i | |
65 |
|
65 | |||
66 | hg log |
|
66 | hg log |
@@ -43,7 +43,7 b' def opener(*args):' | |||||
43 | return singlebyteread(f) |
|
43 | return singlebyteread(f) | |
44 | return wrapper |
|
44 | return wrapper | |
45 |
|
45 | |||
46 | cl = changelog.changelog(opener('.hg')) |
|
46 | cl = changelog.changelog(opener('.hg/store')) | |
47 | print cl.count(), 'revisions:' |
|
47 | print cl.count(), 'revisions:' | |
48 | for r in xrange(cl.count()): |
|
48 | for r in xrange(cl.count()): | |
49 | print short(cl.node(r)) |
|
49 | print short(cl.node(r)) |
@@ -5,11 +5,11 b' echo foo > a' | |||||
5 | hg add a |
|
5 | hg add a | |
6 | hg commit -m "1" -d "1000000 0" |
|
6 | hg commit -m "1" -d "1000000 0" | |
7 | hg verify |
|
7 | hg verify | |
8 | chmod -r .hg/data/a.i |
|
8 | chmod -r .hg/store/data/a.i | |
9 | hg verify 2>/dev/null || echo verify failed |
|
9 | hg verify 2>/dev/null || echo verify failed | |
10 | chmod +r .hg/data/a.i |
|
10 | chmod +r .hg/store/data/a.i | |
11 | hg verify 2>/dev/null || echo verify failed |
|
11 | hg verify 2>/dev/null || echo verify failed | |
12 | chmod -w .hg/data/a.i |
|
12 | chmod -w .hg/store/data/a.i | |
13 | echo barber > a |
|
13 | echo barber > a | |
14 | hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed |
|
14 | hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed | |
15 |
|
15 |
@@ -7,13 +7,13 b' echo foo > b' | |||||
7 | hg add b |
|
7 | hg add b | |
8 | hg ci -m "b" -d "1000000 0" |
|
8 | hg ci -m "b" -d "1000000 0" | |
9 |
|
9 | |||
10 | chmod -w .hg |
|
10 | chmod -w .hg/store | |
11 |
|
11 | |||
12 | cd .. |
|
12 | cd .. | |
13 |
|
13 | |||
14 | hg clone a b |
|
14 | hg clone a b | |
15 |
|
15 | |||
16 | chmod +w a/.hg # let test clean up |
|
16 | chmod +w a/.hg/store # let test clean up | |
17 |
|
17 | |||
18 | cd b |
|
18 | cd b | |
19 | hg verify |
|
19 | hg verify |
@@ -41,11 +41,11 b' hg commit -m "1.3m"' | |||||
41 | hg update -C 3 |
|
41 | hg update -C 3 | |
42 | hg mv afile anotherfile |
|
42 | hg mv afile anotherfile | |
43 | hg commit -m "0.3m" |
|
43 | hg commit -m "0.3m" | |
44 | hg debugindex .hg/data/afile.i |
|
44 | hg debugindex .hg/store/data/afile.i | |
45 | hg debugindex .hg/data/adifferentfile.i |
|
45 | hg debugindex .hg/store/data/adifferentfile.i | |
46 | hg debugindex .hg/data/anotherfile.i |
|
46 | hg debugindex .hg/store/data/anotherfile.i | |
47 | hg debugindex .hg/data/fred.i |
|
47 | hg debugindex .hg/store/data/fred.i | |
48 | hg debugindex .hg/00manifest.i |
|
48 | hg debugindex .hg/store/00manifest.i | |
49 | hg verify |
|
49 | hg verify | |
50 | cd .. |
|
50 | cd .. | |
51 | for i in 0 1 2 3 4 5 6 7 8; do |
|
51 | for i in 0 1 2 3 4 5 6 7 8; do |
@@ -23,5 +23,5 b' hg merge -y --debug' | |||||
23 | hg status -AC |
|
23 | hg status -AC | |
24 | cat b |
|
24 | cat b | |
25 | hg ci -m "merge" -d "0 0" |
|
25 | hg ci -m "merge" -d "0 0" | |
26 | hg debugindex .hg/data/b.i |
|
26 | hg debugindex .hg/store/data/b.i | |
27 | hg debugrename b No newline at end of file |
|
27 | hg debugrename b |
@@ -28,7 +28,8 b' echo "# creating \'remote\'"' | |||||
28 | hg init remote |
|
28 | hg init remote | |
29 | cd remote |
|
29 | cd remote | |
30 | echo this > foo |
|
30 | echo this > foo | |
31 | hg ci -A -m "init" -d "1000000 0" foo |
|
31 | echo this > fooO | |
|
32 | hg ci -A -m "init" -d "1000000 0" foo fooO | |||
32 | echo '[server]' > .hg/hgrc |
|
33 | echo '[server]' > .hg/hgrc | |
33 | echo 'uncompressed = True' >> .hg/hgrc |
|
34 | echo 'uncompressed = True' >> .hg/hgrc | |
34 | echo '[hooks]' >> .hg/hgrc |
|
35 | echo '[hooks]' >> .hg/hgrc |
@@ -66,11 +66,11 b' hg commit -m "1.3m"' | |||||
66 | hg update -C 3 |
|
66 | hg update -C 3 | |
67 | hg mv afile anotherfile |
|
67 | hg mv afile anotherfile | |
68 | hg commit -m "0.3m" |
|
68 | hg commit -m "0.3m" | |
69 | hg debugindex .hg/data/afile.i |
|
69 | hg debugindex .hg/store/data/afile.i | |
70 | hg debugindex .hg/data/adifferentfile.i |
|
70 | hg debugindex .hg/store/data/adifferentfile.i | |
71 | hg debugindex .hg/data/anotherfile.i |
|
71 | hg debugindex .hg/store/data/anotherfile.i | |
72 | hg debugindex .hg/data/fred.i |
|
72 | hg debugindex .hg/store/data/fred.i | |
73 | hg debugindex .hg/00manifest.i |
|
73 | hg debugindex .hg/store/00manifest.i | |
74 | hg verify |
|
74 | hg verify | |
75 | cd .. |
|
75 | cd .. | |
76 |
|
76 |
@@ -11,20 +11,20 b' checking changesets' | |||||
11 | checking manifests |
|
11 | checking manifests | |
12 | crosschecking files in changesets and manifests |
|
12 | crosschecking files in changesets and manifests | |
13 | checking files |
|
13 | checking files | |
14 |
|
|
14 | 2 files, 1 changesets, 2 total revisions | |
15 | # clone remote via pull |
|
15 | # clone remote via pull | |
16 | requesting all changes |
|
16 | requesting all changes | |
17 | adding changesets |
|
17 | adding changesets | |
18 | adding manifests |
|
18 | adding manifests | |
19 | adding file changes |
|
19 | adding file changes | |
20 |
added 1 changesets with |
|
20 | added 1 changesets with 2 changes to 2 files | |
21 |
|
|
21 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
22 | # verify |
|
22 | # verify | |
23 | checking changesets |
|
23 | checking changesets | |
24 | checking manifests |
|
24 | checking manifests | |
25 | crosschecking files in changesets and manifests |
|
25 | crosschecking files in changesets and manifests | |
26 | checking files |
|
26 | checking files | |
27 |
|
|
27 | 2 files, 1 changesets, 2 total revisions | |
28 | # empty default pull |
|
28 | # empty default pull | |
29 | default = ssh://user@dummy/remote |
|
29 | default = ssh://user@dummy/remote | |
30 | pulling from ssh://user@dummy/remote |
|
30 | pulling from ssh://user@dummy/remote | |
@@ -34,7 +34,7 b' no changes found' | |||||
34 | # updating rc |
|
34 | # updating rc | |
35 | # find outgoing |
|
35 | # find outgoing | |
36 | searching for changes |
|
36 | searching for changes | |
37 |
changeset: 1: |
|
37 | changeset: 1:572896fe480d | |
38 | tag: tip |
|
38 | tag: tip | |
39 | user: test |
|
39 | user: test | |
40 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
40 | date: Mon Jan 12 13:46:40 1970 +0000 | |
@@ -42,7 +42,7 b' summary: add' | |||||
42 |
|
42 | |||
43 | # find incoming on the remote side |
|
43 | # find incoming on the remote side | |
44 | searching for changes |
|
44 | searching for changes | |
45 |
changeset: 1: |
|
45 | changeset: 1:572896fe480d | |
46 | tag: tip |
|
46 | tag: tip | |
47 | user: test |
|
47 | user: test | |
48 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
48 | date: Mon Jan 12 13:46:40 1970 +0000 | |
@@ -56,7 +56,7 b' remote: adding manifests' | |||||
56 | remote: adding file changes |
|
56 | remote: adding file changes | |
57 | remote: added 1 changesets with 1 changes to 1 files |
|
57 | remote: added 1 changesets with 1 changes to 1 files | |
58 | # check remote tip |
|
58 | # check remote tip | |
59 |
changeset: 1: |
|
59 | changeset: 1:572896fe480d | |
60 | tag: tip |
|
60 | tag: tip | |
61 | user: test |
|
61 | user: test | |
62 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
62 | date: Mon Jan 12 13:46:40 1970 +0000 | |
@@ -66,7 +66,7 b' checking changesets' | |||||
66 | checking manifests |
|
66 | checking manifests | |
67 | crosschecking files in changesets and manifests |
|
67 | crosschecking files in changesets and manifests | |
68 | checking files |
|
68 | checking files | |
69 |
|
|
69 | 2 files, 2 changesets, 3 total revisions | |
70 | bleah |
|
70 | bleah | |
71 | # push should succeed |
|
71 | # push should succeed | |
72 | pushing to ssh://user@dummy/remote |
|
72 | pushing to ssh://user@dummy/remote |
General Comments 0
You need to be logged in to leave comments.
Login now