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