Show More
@@ -1,23 +1,23 | |||
|
1 | 1 | Test issue2761 |
|
2 | 2 | |
|
3 | 3 | $ hg init |
|
4 | 4 | |
|
5 | 5 | $ touch to-be-deleted |
|
6 | 6 | $ hg add |
|
7 | 7 | adding to-be-deleted |
|
8 | 8 | $ hg ci -m first |
|
9 | 9 | $ echo a > to-be-deleted |
|
10 | 10 | $ hg ci -m second |
|
11 | 11 | $ rm to-be-deleted |
|
12 | 12 | $ hg diff -r 0 |
|
13 | 13 | |
|
14 | 14 | Same issue, different code path |
|
15 | 15 | |
|
16 | 16 | $ hg up -C |
|
17 | 17 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
18 | $ touch doesnt-exist-in-1 | |
|
18 | $ touch does-not-exist-in-1 | |
|
19 | 19 | $ hg add |
|
20 | adding doesnt-exist-in-1 | |
|
20 | adding does-not-exist-in-1 | |
|
21 | 21 | $ hg ci -m third |
|
22 | $ rm doesnt-exist-in-1 | |
|
22 | $ rm does-not-exist-in-1 | |
|
23 | 23 | $ hg diff -r 1 |
@@ -1,55 +1,55 | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """ |
|
3 | 3 | Tests the behaviour of filelog w.r.t. data starting with '\1\n' |
|
4 | 4 | """ |
|
5 | 5 | from mercurial import ui, hg |
|
6 | 6 | from mercurial.node import nullid, hex |
|
7 | 7 | |
|
8 | 8 | myui = ui.ui() |
|
9 | 9 | repo = hg.repository(myui, path='.', create=True) |
|
10 | 10 | |
|
11 | 11 | fl = repo.file('foobar') |
|
12 | 12 | |
|
13 | 13 | def addrev(text, renamed=False): |
|
14 | 14 | if renamed: |
|
15 | # data doesnt matter. Just make sure filelog.renamed() returns True | |
|
15 | # data doesn't matter. Just make sure filelog.renamed() returns True | |
|
16 | 16 | meta = dict(copyrev=hex(nullid), copy='bar') |
|
17 | 17 | else: |
|
18 | 18 | meta = {} |
|
19 | 19 | |
|
20 | 20 | lock = t = None |
|
21 | 21 | try: |
|
22 | 22 | lock = repo.lock() |
|
23 | 23 | t = repo.transaction('commit') |
|
24 | 24 | node = fl.add(text, meta, t, 0, nullid, nullid) |
|
25 | 25 | return node |
|
26 | 26 | finally: |
|
27 | 27 | if t: |
|
28 | 28 | t.close() |
|
29 | 29 | if lock: |
|
30 | 30 | lock.release() |
|
31 | 31 | |
|
32 | 32 | def error(text): |
|
33 | 33 | print 'ERROR: ' + text |
|
34 | 34 | |
|
35 | 35 | textwith = '\1\nfoo' |
|
36 | 36 | without = 'foo' |
|
37 | 37 | |
|
38 | 38 | node = addrev(textwith) |
|
39 | 39 | if not textwith == fl.read(node): |
|
40 | 40 | error('filelog.read for data starting with \\1\\n') |
|
41 | 41 | if fl.cmp(node, textwith) or not fl.cmp(node, without): |
|
42 | 42 | error('filelog.cmp for data starting with \\1\\n') |
|
43 | 43 | if fl.size(0) != len(textwith): |
|
44 | 44 | error('FIXME: This is a known failure of filelog.size for data starting ' |
|
45 | 45 | 'with \\1\\n') |
|
46 | 46 | |
|
47 | 47 | node = addrev(textwith, renamed=True) |
|
48 | 48 | if not textwith == fl.read(node): |
|
49 | 49 | error('filelog.read for a renaming + data starting with \\1\\n') |
|
50 | 50 | if fl.cmp(node, textwith) or not fl.cmp(node, without): |
|
51 | 51 | error('filelog.cmp for a renaming + data starting with \\1\\n') |
|
52 | 52 | if fl.size(1) != len(textwith): |
|
53 | 53 | error('filelog.size for a renaming + data starting with \\1\\n') |
|
54 | 54 | |
|
55 | 55 | print 'OK.' |
@@ -1,92 +1,92 | |||
|
1 | 1 | $ "$TESTDIR/hghave" serve || exit 80 |
|
2 | 2 | |
|
3 | 3 | $ hg init test |
|
4 | 4 | $ cd test |
|
5 | 5 | |
|
6 | 6 | $ echo foo>foo |
|
7 | 7 | $ hg addremove |
|
8 | 8 | adding foo |
|
9 | 9 | $ hg commit -m 1 |
|
10 | 10 | |
|
11 | 11 | $ hg verify |
|
12 | 12 | checking changesets |
|
13 | 13 | checking manifests |
|
14 | 14 | crosschecking files in changesets and manifests |
|
15 | 15 | checking files |
|
16 | 16 | 1 files, 1 changesets, 1 total revisions |
|
17 | 17 | |
|
18 | 18 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
19 | 19 | $ cat hg.pid >> $DAEMON_PIDS |
|
20 | 20 | $ cd .. |
|
21 | 21 | |
|
22 | 22 | $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy |
|
23 | 23 | requesting all changes |
|
24 | 24 | adding changesets |
|
25 | 25 | adding manifests |
|
26 | 26 | adding file changes |
|
27 | 27 | added 1 changesets with 1 changes to 1 files |
|
28 | 28 | updating to branch default |
|
29 | 29 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
30 | 30 | |
|
31 | 31 | $ cd copy |
|
32 | 32 | $ hg verify |
|
33 | 33 | checking changesets |
|
34 | 34 | checking manifests |
|
35 | 35 | crosschecking files in changesets and manifests |
|
36 | 36 | checking files |
|
37 | 37 | 1 files, 1 changesets, 1 total revisions |
|
38 | 38 | |
|
39 | 39 | $ hg co |
|
40 | 40 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 41 | $ cat foo |
|
42 | 42 | foo |
|
43 | 43 | |
|
44 | 44 | $ hg manifest --debug |
|
45 | 45 | 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo |
|
46 | 46 | |
|
47 | 47 | $ hg pull |
|
48 | 48 | pulling from http://foo@localhost:$HGPORT/ |
|
49 | 49 | searching for changes |
|
50 | 50 | no changes found |
|
51 | 51 | |
|
52 | 52 | $ hg rollback --dry-run --verbose |
|
53 | 53 | repository tip rolled back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/) |
|
54 | 54 | |
|
55 | 55 | Issue622: hg init && hg pull -u URL doesn't checkout default branch |
|
56 | 56 | |
|
57 | 57 | $ cd .. |
|
58 | 58 | $ hg init empty |
|
59 | 59 | $ cd empty |
|
60 | 60 | $ hg pull -u ../test |
|
61 | 61 | pulling from ../test |
|
62 | 62 | requesting all changes |
|
63 | 63 | adding changesets |
|
64 | 64 | adding manifests |
|
65 | 65 | adding file changes |
|
66 | 66 | added 1 changesets with 1 changes to 1 files |
|
67 | 67 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 68 | |
|
69 | 69 | Test 'file:' uri handling: |
|
70 | 70 | |
|
71 | $ hg pull -q file://../test-doesnt-exist | |
|
71 | $ hg pull -q file://../test-does-not-exist | |
|
72 | 72 | abort: file:// URLs can only refer to localhost |
|
73 | 73 | [255] |
|
74 | 74 | |
|
75 | 75 | $ hg pull -q file://../test |
|
76 | 76 | abort: file:// URLs can only refer to localhost |
|
77 | 77 | [255] |
|
78 | 78 | |
|
79 | 79 | $ hg pull -q file:../test |
|
80 | 80 | |
|
81 | 81 | It's tricky to make file:// URLs working on every platform with |
|
82 | 82 | regular shell commands. |
|
83 | 83 | |
|
84 | 84 | $ URL=`python -c "import os; print 'file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` |
|
85 | 85 | $ hg pull -q "$URL" |
|
86 | 86 | abort: file:// URLs can only refer to localhost |
|
87 | 87 | [255] |
|
88 | 88 | |
|
89 | 89 | $ URL=`python -c "import os; print 'file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test'"` |
|
90 | 90 | $ hg pull -q "$URL" |
|
91 | 91 | |
|
92 | 92 | $ cd .. |
@@ -1,174 +1,174 | |||
|
1 | 1 | $ "$TESTDIR/hghave" serve || exit 80 |
|
2 | 2 | |
|
3 | 3 | #if windows |
|
4 | 4 | $ hg clone http://localhost:$HGPORT/ copy |
|
5 | 5 | abort: * (glob) |
|
6 | 6 | [255] |
|
7 | 7 | #else |
|
8 | 8 | $ hg clone http://localhost:$HGPORT/ copy |
|
9 | 9 | abort: error: Connection refused |
|
10 | 10 | [255] |
|
11 | 11 | #endif |
|
12 | 12 | $ test -d copy |
|
13 | 13 | [1] |
|
14 | 14 | |
|
15 | 15 | This server doesn't do range requests so it's basically only good for |
|
16 | 16 | one pull |
|
17 | 17 | |
|
18 | 18 | $ cat > dumb.py <<EOF |
|
19 | 19 | > import BaseHTTPServer, SimpleHTTPServer, os, signal, sys |
|
20 | 20 | > |
|
21 | 21 | > def run(server_class=BaseHTTPServer.HTTPServer, |
|
22 | 22 | > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): |
|
23 | 23 | > server_address = ('localhost', int(os.environ['HGPORT'])) |
|
24 | 24 | > httpd = server_class(server_address, handler_class) |
|
25 | 25 | > httpd.serve_forever() |
|
26 | 26 | > |
|
27 | 27 | > signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0)) |
|
28 | 28 | > run() |
|
29 | 29 | > EOF |
|
30 | 30 | $ python dumb.py 2>/dev/null & |
|
31 | 31 | $ echo $! >> $DAEMON_PIDS |
|
32 | 32 | $ hg init remote |
|
33 | 33 | $ cd remote |
|
34 | 34 | $ echo foo > bar |
|
35 | 35 | $ echo c2 > '.dotfile with spaces' |
|
36 | 36 | $ hg add |
|
37 | 37 | adding .dotfile with spaces |
|
38 | 38 | adding bar |
|
39 | 39 | $ hg commit -m"test" |
|
40 | 40 | $ hg tip |
|
41 | 41 | changeset: 0:02770d679fb8 |
|
42 | 42 | tag: tip |
|
43 | 43 | user: test |
|
44 | 44 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | summary: test |
|
46 | 46 | |
|
47 | 47 | $ cd .. |
|
48 | 48 | $ hg clone static-http://localhost:$HGPORT/remote local |
|
49 | 49 | requesting all changes |
|
50 | 50 | adding changesets |
|
51 | 51 | adding manifests |
|
52 | 52 | adding file changes |
|
53 | 53 | added 1 changesets with 2 changes to 2 files |
|
54 | 54 | updating to branch default |
|
55 | 55 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
56 | 56 | $ cd local |
|
57 | 57 | $ hg verify |
|
58 | 58 | checking changesets |
|
59 | 59 | checking manifests |
|
60 | 60 | crosschecking files in changesets and manifests |
|
61 | 61 | checking files |
|
62 | 62 | 2 files, 1 changesets, 2 total revisions |
|
63 | 63 | $ cat bar |
|
64 | 64 | foo |
|
65 | 65 | $ cd ../remote |
|
66 | 66 | $ echo baz > quux |
|
67 | 67 | $ hg commit -A -mtest2 |
|
68 | 68 | adding quux |
|
69 | 69 | |
|
70 | 70 | check for HTTP opener failures when cachefile does not exist |
|
71 | 71 | |
|
72 | 72 | $ rm .hg/cache/* |
|
73 | 73 | $ cd ../local |
|
74 | 74 | $ echo '[hooks]' >> .hg/hgrc |
|
75 | 75 | $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup" >> .hg/hgrc |
|
76 | 76 | $ hg pull |
|
77 | 77 | pulling from static-http://localhost:$HGPORT/remote |
|
78 | 78 | searching for changes |
|
79 | 79 | adding changesets |
|
80 | 80 | adding manifests |
|
81 | 81 | adding file changes |
|
82 | 82 | added 1 changesets with 1 changes to 1 files |
|
83 | 83 | changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote |
|
84 | 84 | (run 'hg update' to get a working copy) |
|
85 | 85 | |
|
86 | 86 | trying to push |
|
87 | 87 | |
|
88 | 88 | $ hg update |
|
89 | 89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 90 | $ echo more foo >> bar |
|
91 | 91 | $ hg commit -m"test" |
|
92 | 92 | $ hg push |
|
93 | 93 | pushing to static-http://localhost:$HGPORT/remote |
|
94 | 94 | abort: destination does not support push |
|
95 | 95 | [255] |
|
96 | 96 | |
|
97 | 97 | trying clone -r |
|
98 | 98 | |
|
99 | 99 | $ cd .. |
|
100 | $ hg clone -r donotexist static-http://localhost:$HGPORT/remote local0 | |
|
101 | abort: unknown revision 'donotexist'! | |
|
100 | $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0 | |
|
101 | abort: unknown revision 'doesnotexist'! | |
|
102 | 102 | [255] |
|
103 | 103 | $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0 |
|
104 | 104 | adding changesets |
|
105 | 105 | adding manifests |
|
106 | 106 | adding file changes |
|
107 | 107 | added 1 changesets with 2 changes to 2 files |
|
108 | 108 | updating to branch default |
|
109 | 109 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | |
|
111 | 111 | test with "/" URI (issue 747) and subrepo |
|
112 | 112 | |
|
113 | 113 | $ hg init |
|
114 | 114 | $ hg init sub |
|
115 | 115 | $ touch sub/test |
|
116 | 116 | $ hg -R sub commit -A -m "test" |
|
117 | 117 | adding test |
|
118 | 118 | $ hg -R sub tag not-empty |
|
119 | 119 | $ echo sub=sub > .hgsub |
|
120 | 120 | $ echo a > a |
|
121 | 121 | $ hg add a .hgsub |
|
122 | 122 | $ hg -q ci -ma |
|
123 | 123 | $ hg clone static-http://localhost:$HGPORT/ local2 |
|
124 | 124 | requesting all changes |
|
125 | 125 | adding changesets |
|
126 | 126 | adding manifests |
|
127 | 127 | adding file changes |
|
128 | 128 | added 1 changesets with 3 changes to 3 files |
|
129 | 129 | updating to branch default |
|
130 | 130 | cloning subrepo sub from static-http://localhost:$HGPORT/sub |
|
131 | 131 | requesting all changes |
|
132 | 132 | adding changesets |
|
133 | 133 | adding manifests |
|
134 | 134 | adding file changes |
|
135 | 135 | added 2 changesets with 2 changes to 2 files |
|
136 | 136 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
137 | 137 | $ cd local2 |
|
138 | 138 | $ hg verify |
|
139 | 139 | checking changesets |
|
140 | 140 | checking manifests |
|
141 | 141 | crosschecking files in changesets and manifests |
|
142 | 142 | checking files |
|
143 | 143 | 3 files, 1 changesets, 3 total revisions |
|
144 | 144 | $ cat a |
|
145 | 145 | a |
|
146 | 146 | $ hg paths |
|
147 | 147 | default = static-http://localhost:$HGPORT/ |
|
148 | 148 | |
|
149 | 149 | test with empty repo (issue965) |
|
150 | 150 | |
|
151 | 151 | $ cd .. |
|
152 | 152 | $ hg init remotempty |
|
153 | 153 | $ hg clone static-http://localhost:$HGPORT/remotempty local3 |
|
154 | 154 | no changes found |
|
155 | 155 | updating to branch default |
|
156 | 156 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
157 | 157 | $ cd local3 |
|
158 | 158 | $ hg verify |
|
159 | 159 | checking changesets |
|
160 | 160 | checking manifests |
|
161 | 161 | crosschecking files in changesets and manifests |
|
162 | 162 | checking files |
|
163 | 163 | 0 files, 0 changesets, 0 total revisions |
|
164 | 164 | $ hg paths |
|
165 | 165 | default = static-http://localhost:$HGPORT/remotempty |
|
166 | 166 | |
|
167 | 167 | test with non-repo |
|
168 | 168 | |
|
169 | 169 | $ cd .. |
|
170 | 170 | $ mkdir notarepo |
|
171 | 171 | $ hg clone static-http://localhost:$HGPORT/notarepo local3 |
|
172 | 172 | abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository! |
|
173 | 173 | [255] |
|
174 | 174 | $ kill $! |
General Comments 0
You need to be logged in to leave comments.
Login now