##// END OF EJS Templates
tests: tolerate differences between Linux and Windows error strings...
Matt Harbison -
r26952:4e566f51 default
parent child Browse files
Show More
@@ -1,466 +1,466 b''
1 Set up a server
1 Set up a server
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [format]
4 > [format]
5 > usegeneraldelta=yes
5 > usegeneraldelta=yes
6 > EOF
6 > EOF
7 $ hg init server
7 $ hg init server
8 $ cd server
8 $ cd server
9 $ cat >> .hg/hgrc << EOF
9 $ cat >> .hg/hgrc << EOF
10 > [extensions]
10 > [extensions]
11 > clonebundles =
11 > clonebundles =
12 > EOF
12 > EOF
13
13
14 $ touch foo
14 $ touch foo
15 $ hg -q commit -A -m 'add foo'
15 $ hg -q commit -A -m 'add foo'
16 $ touch bar
16 $ touch bar
17 $ hg -q commit -A -m 'add bar'
17 $ hg -q commit -A -m 'add bar'
18
18
19 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
19 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
20 $ cat hg.pid >> $DAEMON_PIDS
20 $ cat hg.pid >> $DAEMON_PIDS
21 $ cd ..
21 $ cd ..
22
22
23 Feature disabled by default
23 Feature disabled by default
24 (client should not request manifest)
24 (client should not request manifest)
25
25
26 $ hg clone -U http://localhost:$HGPORT feature-disabled
26 $ hg clone -U http://localhost:$HGPORT feature-disabled
27 requesting all changes
27 requesting all changes
28 adding changesets
28 adding changesets
29 adding manifests
29 adding manifests
30 adding file changes
30 adding file changes
31 added 2 changesets with 2 changes to 2 files
31 added 2 changesets with 2 changes to 2 files
32
32
33 $ cat server/access.log
33 $ cat server/access.log
34 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
34 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
35 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
35 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
36 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
36 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
37 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
37 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
38
38
39 $ cat >> $HGRCPATH << EOF
39 $ cat >> $HGRCPATH << EOF
40 > [experimental]
40 > [experimental]
41 > clonebundles = true
41 > clonebundles = true
42 > EOF
42 > EOF
43
43
44 Missing manifest should not result in server lookup
44 Missing manifest should not result in server lookup
45
45
46 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
46 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
47 requesting all changes
47 requesting all changes
48 adding changesets
48 adding changesets
49 adding manifests
49 adding manifests
50 adding file changes
50 adding file changes
51 added 2 changesets with 2 changes to 2 files
51 added 2 changesets with 2 changes to 2 files
52
52
53 $ tail -4 server/access.log
53 $ tail -4 server/access.log
54 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
54 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
55 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
55 * - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D (glob)
56 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
56 * - - [*] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bundlecaps=HG20%2Cbundle2%3DHG20%250Achangegroup%253D01%252C02%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=phase%2Cbookmarks (glob)
57 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
57 * - - [*] "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases (glob)
58
58
59 Empty manifest file results in retrieval
59 Empty manifest file results in retrieval
60 (the extension only checks if the manifest file exists)
60 (the extension only checks if the manifest file exists)
61
61
62 $ touch server/.hg/clonebundles.manifest
62 $ touch server/.hg/clonebundles.manifest
63 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
63 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
64 no clone bundles available on remote; falling back to regular clone
64 no clone bundles available on remote; falling back to regular clone
65 requesting all changes
65 requesting all changes
66 adding changesets
66 adding changesets
67 adding manifests
67 adding manifests
68 adding file changes
68 adding file changes
69 added 2 changesets with 2 changes to 2 files
69 added 2 changesets with 2 changes to 2 files
70
70
71 Server advertises presence of feature to client requesting full clone
71 Server advertises presence of feature to client requesting full clone
72
72
73 $ hg --config experimental.clonebundles=false clone -U http://localhost:$HGPORT advertise-on-clone
73 $ hg --config experimental.clonebundles=false clone -U http://localhost:$HGPORT advertise-on-clone
74 requesting all changes
74 requesting all changes
75 remote: this server supports the experimental "clone bundles" feature that should enable faster and more reliable cloning
75 remote: this server supports the experimental "clone bundles" feature that should enable faster and more reliable cloning
76 remote: help test it by setting the "experimental.clonebundles" config flag to "true"
76 remote: help test it by setting the "experimental.clonebundles" config flag to "true"
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 2 changesets with 2 changes to 2 files
80 added 2 changesets with 2 changes to 2 files
81
81
82 Manifest file with invalid URL aborts
82 Manifest file with invalid URL aborts
83
83
84 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
84 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
85 $ hg clone http://localhost:$HGPORT 404-url
85 $ hg clone http://localhost:$HGPORT 404-url
86 applying clone bundle from http://does.not.exist/bundle.hg
86 applying clone bundle from http://does.not.exist/bundle.hg
87 error fetching bundle: * not known (glob)
87 error fetching bundle: (.* not known|getaddrinfo failed) (re)
88 abort: error applying bundle
88 abort: error applying bundle
89 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
89 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
90 [255]
90 [255]
91
91
92 Server is not running aborts
92 Server is not running aborts
93
93
94 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
94 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
95 $ hg clone http://localhost:$HGPORT server-not-runner
95 $ hg clone http://localhost:$HGPORT server-not-runner
96 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
96 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
97 error fetching bundle: Connection refused
97 error fetching bundle: * refused* (glob)
98 abort: error applying bundle
98 abort: error applying bundle
99 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
99 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
100 [255]
100 [255]
101
101
102 Server returns 404
102 Server returns 404
103
103
104 $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
104 $ python $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
105 $ cat http.pid >> $DAEMON_PIDS
105 $ cat http.pid >> $DAEMON_PIDS
106 $ hg clone http://localhost:$HGPORT running-404
106 $ hg clone http://localhost:$HGPORT running-404
107 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
107 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
108 HTTP error fetching bundle: HTTP Error 404: File not found
108 HTTP error fetching bundle: HTTP Error 404: File not found
109 abort: error applying bundle
109 abort: error applying bundle
110 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
110 (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
111 [255]
111 [255]
112
112
113 We can override failure to fall back to regular clone
113 We can override failure to fall back to regular clone
114
114
115 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
115 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
116 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
116 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
117 HTTP error fetching bundle: HTTP Error 404: File not found
117 HTTP error fetching bundle: HTTP Error 404: File not found
118 falling back to normal clone
118 falling back to normal clone
119 requesting all changes
119 requesting all changes
120 adding changesets
120 adding changesets
121 adding manifests
121 adding manifests
122 adding file changes
122 adding file changes
123 added 2 changesets with 2 changes to 2 files
123 added 2 changesets with 2 changes to 2 files
124
124
125 Bundle with partial content works
125 Bundle with partial content works
126
126
127 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
127 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
128 1 changesets found
128 1 changesets found
129
129
130 We verify exact bundle content as an extra check against accidental future
130 We verify exact bundle content as an extra check against accidental future
131 changes. If this output changes, we could break old clients.
131 changes. If this output changes, we could break old clients.
132
132
133 $ f --size --hexdump partial.hg
133 $ f --size --hexdump partial.hg
134 partial.hg: size=208
134 partial.hg: size=208
135 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
135 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
136 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
136 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
137 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
137 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
138 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
138 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
139 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
139 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
140 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
140 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
141 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
141 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
142 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
142 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
143 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
143 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
144 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
144 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
145 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
145 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
146 00b0: 96 b0 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
146 00b0: 96 b0 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
147 00c0: 78 ed fc d5 76 f1 36 95 dc 05 07 00 ad 39 5e d3 |x...v.6......9^.|
147 00c0: 78 ed fc d5 76 f1 36 95 dc 05 07 00 ad 39 5e d3 |x...v.6......9^.|
148
148
149 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
149 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
150 $ hg clone -U http://localhost:$HGPORT partial-bundle
150 $ hg clone -U http://localhost:$HGPORT partial-bundle
151 applying clone bundle from http://localhost:$HGPORT1/partial.hg
151 applying clone bundle from http://localhost:$HGPORT1/partial.hg
152 adding changesets
152 adding changesets
153 adding manifests
153 adding manifests
154 adding file changes
154 adding file changes
155 added 1 changesets with 1 changes to 1 files
155 added 1 changesets with 1 changes to 1 files
156 finished applying clone bundle
156 finished applying clone bundle
157 searching for changes
157 searching for changes
158 adding changesets
158 adding changesets
159 adding manifests
159 adding manifests
160 adding file changes
160 adding file changes
161 added 1 changesets with 1 changes to 1 files
161 added 1 changesets with 1 changes to 1 files
162
162
163 Incremental pull doesn't fetch bundle
163 Incremental pull doesn't fetch bundle
164
164
165 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
165 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
166 adding changesets
166 adding changesets
167 adding manifests
167 adding manifests
168 adding file changes
168 adding file changes
169 added 1 changesets with 1 changes to 1 files
169 added 1 changesets with 1 changes to 1 files
170
170
171 $ cd partial-clone
171 $ cd partial-clone
172 $ hg pull
172 $ hg pull
173 pulling from http://localhost:$HGPORT/
173 pulling from http://localhost:$HGPORT/
174 searching for changes
174 searching for changes
175 adding changesets
175 adding changesets
176 adding manifests
176 adding manifests
177 adding file changes
177 adding file changes
178 added 1 changesets with 1 changes to 1 files
178 added 1 changesets with 1 changes to 1 files
179 (run 'hg update' to get a working copy)
179 (run 'hg update' to get a working copy)
180 $ cd ..
180 $ cd ..
181
181
182 Bundle with full content works
182 Bundle with full content works
183
183
184 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
184 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
185 2 changesets found
185 2 changesets found
186
186
187 Again, we perform an extra check against bundle content changes. If this content
187 Again, we perform an extra check against bundle content changes. If this content
188 changes, clone bundles produced by new Mercurial versions may not be readable
188 changes, clone bundles produced by new Mercurial versions may not be readable
189 by old clients.
189 by old clients.
190
190
191 $ f --size --hexdump full.hg
191 $ f --size --hexdump full.hg
192 full.hg: size=408
192 full.hg: size=408
193 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
193 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
194 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 90 e5 76 f6 70 |ion=GZx.c``..v.p|
194 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 90 e5 76 f6 70 |ion=GZx.c``..v.p|
195 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 06 76 a6 b2 |.swu....`..F.v..|
195 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 06 76 a6 b2 |.swu....`..F.v..|
196 0030: d4 a2 e2 cc fc 3c 03 23 06 06 e6 7d 40 b1 4d c1 |.....<.#...}@.M.|
196 0030: d4 a2 e2 cc fc 3c 03 23 06 06 e6 7d 40 b1 4d c1 |.....<.#...}@.M.|
197 0040: 2a 31 09 cf 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 |*1...:R.........|
197 0040: 2a 31 09 cf 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 |*1...:R.........|
198 0050: 97 17 b2 c9 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 |...........%....|
198 0050: 97 17 b2 c9 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 |...........%....|
199 0060: a4 a4 1a 5b 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 |...[X..'..Y..Y..|
199 0060: a4 a4 1a 5b 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 |...[X..'..Y..Y..|
200 0070: a4 59 26 5a 18 9a 18 59 5a 26 1a 27 27 25 99 a6 |.Y&Z...YZ&.''%..|
200 0070: a4 59 26 5a 18 9a 18 59 5a 26 1a 27 27 25 99 a6 |.Y&Z...YZ&.''%..|
201 0080: 99 1a 70 95 a4 16 97 70 19 28 18 70 a5 e5 e7 73 |..p....p.(.p...s|
201 0080: 99 1a 70 95 a4 16 97 70 19 28 18 70 a5 e5 e7 73 |..p....p.(.p...s|
202 0090: 71 25 a6 a4 28 00 19 40 13 0e ac fa df ab ff 7b |q%..(..@.......{|
202 0090: 71 25 a6 a4 28 00 19 40 13 0e ac fa df ab ff 7b |q%..(..@.......{|
203 00a0: 3f fb 92 dc 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 |?.....b......=ZD|
203 00a0: 3f fb 92 dc 8b 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 |?.....b......=ZD|
204 00b0: ac 2f b0 a9 c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 |./...f.T.&......|
204 00b0: ac 2f b0 a9 c3 66 1e 54 b9 26 08 a7 1a 1b 1a a7 |./...f.T.&......|
205 00c0: 25 1b 9a 1b 99 19 9a 5a 18 9b a6 18 19 00 dd 67 |%......Z.......g|
205 00c0: 25 1b 9a 1b 99 19 9a 5a 18 9b a6 18 19 00 dd 67 |%......Z.......g|
206 00d0: 61 61 98 06 f4 80 49 4a 8a 65 52 92 41 9a 81 81 |aa....IJ.eR.A...|
206 00d0: 61 61 98 06 f4 80 49 4a 8a 65 52 92 41 9a 81 81 |aa....IJ.eR.A...|
207 00e0: a5 11 17 50 31 30 58 19 cc 80 98 25 29 b1 08 c4 |...P10X....%)...|
207 00e0: a5 11 17 50 31 30 58 19 cc 80 98 25 29 b1 08 c4 |...P10X....%)...|
208 00f0: 37 07 79 19 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb |7.y...A...A.].e.|
208 00f0: 37 07 79 19 88 d9 41 ee 07 8a 41 cd 5d 98 65 fb |7.y...A...A.].e.|
209 0100: e5 9e 45 bf 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec |..E.......+D4g..|
209 0100: e5 9e 45 bf 8d 7f 9f c6 97 9f 2b 44 34 67 d9 ec |..E.......+D4g..|
210 0110: 8e 0f a0 61 a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 |...a....... %.4.|
210 0110: 8e 0f a0 61 a8 eb 82 82 2e c9 c2 20 25 d5 34 c5 |...a....... %.4.|
211 0120: d0 d8 c2 dc d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc |........0.4.....|
211 0120: d0 d8 c2 dc d4 c2 d4 c4 30 d9 34 cd c0 d4 c8 cc |........0.4.....|
212 0130: 34 31 c5 d0 c4 24 31 c9 32 2d d1 c2 2c c5 30 25 |41...$1.2-..,.0%|
212 0130: 34 31 c5 d0 c4 24 31 c9 32 2d d1 c2 2c c5 30 25 |41...$1.2-..,.0%|
213 0140: 09 e4 ee 85 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 |..........6.*.G4|
213 0140: 09 e4 ee 85 8f 85 ff 88 ab 89 36 c7 2a c4 47 34 |..........6.*.G4|
214 0150: fe f8 ec 7b 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 |...{s7?.$b..M..@|
214 0150: fe f8 ec 7b 73 37 3f c3 24 62 1d 8d 4d 1d 9e 40 |...{s7?.$b..M..@|
215 0160: 06 3b 10 14 36 a4 38 10 04 d8 21 01 5a b2 83 f7 |.;..6.8...!.Z...|
215 0160: 06 3b 10 14 36 a4 38 10 04 d8 21 01 5a b2 83 f7 |.;..6.8...!.Z...|
216 0170: e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 |.E..V....R..x...|
216 0170: e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a 78 ed fc d5 |.E..V....R..x...|
217 0180: 76 f1 36 25 81 49 c0 ad 30 c0 0e 49 8f 54 b7 9e |v.6%.I..0..I.T..|
217 0180: 76 f1 36 25 81 49 c0 ad 30 c0 0e 49 8f 54 b7 9e |v.6%.I..0..I.T..|
218 0190: d4 1c 09 00 bb 8d f0 bd |........|
218 0190: d4 1c 09 00 bb 8d f0 bd |........|
219
219
220 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
220 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
221 $ hg clone -U http://localhost:$HGPORT full-bundle
221 $ hg clone -U http://localhost:$HGPORT full-bundle
222 applying clone bundle from http://localhost:$HGPORT1/full.hg
222 applying clone bundle from http://localhost:$HGPORT1/full.hg
223 adding changesets
223 adding changesets
224 adding manifests
224 adding manifests
225 adding file changes
225 adding file changes
226 added 2 changesets with 2 changes to 2 files
226 added 2 changesets with 2 changes to 2 files
227 finished applying clone bundle
227 finished applying clone bundle
228 searching for changes
228 searching for changes
229 no changes found
229 no changes found
230
230
231 Feature works over SSH
231 Feature works over SSH
232
232
233 $ hg clone -U -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
233 $ hg clone -U -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
234 applying clone bundle from http://localhost:$HGPORT1/full.hg
234 applying clone bundle from http://localhost:$HGPORT1/full.hg
235 adding changesets
235 adding changesets
236 adding manifests
236 adding manifests
237 adding file changes
237 adding file changes
238 added 2 changesets with 2 changes to 2 files
238 added 2 changesets with 2 changes to 2 files
239 finished applying clone bundle
239 finished applying clone bundle
240 searching for changes
240 searching for changes
241 no changes found
241 no changes found
242
242
243 Entry with unknown BUNDLESPEC is filtered and not used
243 Entry with unknown BUNDLESPEC is filtered and not used
244
244
245 $ cat > server/.hg/clonebundles.manifest << EOF
245 $ cat > server/.hg/clonebundles.manifest << EOF
246 > http://bad.entry1 BUNDLESPEC=UNKNOWN
246 > http://bad.entry1 BUNDLESPEC=UNKNOWN
247 > http://bad.entry2 BUNDLESPEC=xz-v1
247 > http://bad.entry2 BUNDLESPEC=xz-v1
248 > http://bad.entry3 BUNDLESPEC=none-v100
248 > http://bad.entry3 BUNDLESPEC=none-v100
249 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
249 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
250 > EOF
250 > EOF
251
251
252 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
252 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
253 applying clone bundle from http://localhost:$HGPORT1/full.hg
253 applying clone bundle from http://localhost:$HGPORT1/full.hg
254 adding changesets
254 adding changesets
255 adding manifests
255 adding manifests
256 adding file changes
256 adding file changes
257 added 2 changesets with 2 changes to 2 files
257 added 2 changesets with 2 changes to 2 files
258 finished applying clone bundle
258 finished applying clone bundle
259 searching for changes
259 searching for changes
260 no changes found
260 no changes found
261
261
262 Automatic fallback when all entries are filtered
262 Automatic fallback when all entries are filtered
263
263
264 $ cat > server/.hg/clonebundles.manifest << EOF
264 $ cat > server/.hg/clonebundles.manifest << EOF
265 > http://bad.entry BUNDLESPEC=UNKNOWN
265 > http://bad.entry BUNDLESPEC=UNKNOWN
266 > EOF
266 > EOF
267
267
268 $ hg clone -U http://localhost:$HGPORT filter-all
268 $ hg clone -U http://localhost:$HGPORT filter-all
269 no compatible clone bundles available on server; falling back to regular clone
269 no compatible clone bundles available on server; falling back to regular clone
270 (you may want to report this to the server operator)
270 (you may want to report this to the server operator)
271 requesting all changes
271 requesting all changes
272 adding changesets
272 adding changesets
273 adding manifests
273 adding manifests
274 adding file changes
274 adding file changes
275 added 2 changesets with 2 changes to 2 files
275 added 2 changesets with 2 changes to 2 files
276
276
277 URLs requiring SNI are filtered in Python <2.7.9
277 URLs requiring SNI are filtered in Python <2.7.9
278
278
279 $ cp full.hg sni.hg
279 $ cp full.hg sni.hg
280 $ cat > server/.hg/clonebundles.manifest << EOF
280 $ cat > server/.hg/clonebundles.manifest << EOF
281 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
281 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
282 > http://localhost:$HGPORT1/full.hg
282 > http://localhost:$HGPORT1/full.hg
283 > EOF
283 > EOF
284
284
285 #if sslcontext
285 #if sslcontext
286 Python 2.7.9+ support SNI
286 Python 2.7.9+ support SNI
287
287
288 $ hg clone -U http://localhost:$HGPORT sni-supported
288 $ hg clone -U http://localhost:$HGPORT sni-supported
289 applying clone bundle from http://localhost:$HGPORT1/sni.hg
289 applying clone bundle from http://localhost:$HGPORT1/sni.hg
290 adding changesets
290 adding changesets
291 adding manifests
291 adding manifests
292 adding file changes
292 adding file changes
293 added 2 changesets with 2 changes to 2 files
293 added 2 changesets with 2 changes to 2 files
294 finished applying clone bundle
294 finished applying clone bundle
295 searching for changes
295 searching for changes
296 no changes found
296 no changes found
297 #else
297 #else
298 Python <2.7.9 will filter SNI URLs
298 Python <2.7.9 will filter SNI URLs
299
299
300 $ hg clone -U http://localhost:$HGPORT sni-unsupported
300 $ hg clone -U http://localhost:$HGPORT sni-unsupported
301 applying clone bundle from http://localhost:$HGPORT1/full.hg
301 applying clone bundle from http://localhost:$HGPORT1/full.hg
302 adding changesets
302 adding changesets
303 adding manifests
303 adding manifests
304 adding file changes
304 adding file changes
305 added 2 changesets with 2 changes to 2 files
305 added 2 changesets with 2 changes to 2 files
306 finished applying clone bundle
306 finished applying clone bundle
307 searching for changes
307 searching for changes
308 no changes found
308 no changes found
309 #endif
309 #endif
310
310
311 Stream clone bundles are supported
311 Stream clone bundles are supported
312
312
313 $ hg -R server debugcreatestreamclonebundle packed.hg
313 $ hg -R server debugcreatestreamclonebundle packed.hg
314 writing 613 bytes for 4 files
314 writing 613 bytes for 4 files
315 bundle requirements: generaldelta, revlogv1
315 bundle requirements: generaldelta, revlogv1
316
316
317 No bundle spec should work
317 No bundle spec should work
318
318
319 $ cat > server/.hg/clonebundles.manifest << EOF
319 $ cat > server/.hg/clonebundles.manifest << EOF
320 > http://localhost:$HGPORT1/packed.hg
320 > http://localhost:$HGPORT1/packed.hg
321 > EOF
321 > EOF
322
322
323 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
323 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
324 applying clone bundle from http://localhost:$HGPORT1/packed.hg
324 applying clone bundle from http://localhost:$HGPORT1/packed.hg
325 4 files to transfer, 613 bytes of data
325 4 files to transfer, 613 bytes of data
326 transferred 613 bytes in *.* seconds (*) (glob)
326 transferred 613 bytes in *.* seconds (*) (glob)
327 finished applying clone bundle
327 finished applying clone bundle
328 searching for changes
328 searching for changes
329 no changes found
329 no changes found
330
330
331 Bundle spec without parameters should work
331 Bundle spec without parameters should work
332
332
333 $ cat > server/.hg/clonebundles.manifest << EOF
333 $ cat > server/.hg/clonebundles.manifest << EOF
334 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
334 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
335 > EOF
335 > EOF
336
336
337 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
337 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
338 applying clone bundle from http://localhost:$HGPORT1/packed.hg
338 applying clone bundle from http://localhost:$HGPORT1/packed.hg
339 4 files to transfer, 613 bytes of data
339 4 files to transfer, 613 bytes of data
340 transferred 613 bytes in *.* seconds (*) (glob)
340 transferred 613 bytes in *.* seconds (*) (glob)
341 finished applying clone bundle
341 finished applying clone bundle
342 searching for changes
342 searching for changes
343 no changes found
343 no changes found
344
344
345 Bundle spec with format requirements should work
345 Bundle spec with format requirements should work
346
346
347 $ cat > server/.hg/clonebundles.manifest << EOF
347 $ cat > server/.hg/clonebundles.manifest << EOF
348 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
348 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
349 > EOF
349 > EOF
350
350
351 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
351 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
352 applying clone bundle from http://localhost:$HGPORT1/packed.hg
352 applying clone bundle from http://localhost:$HGPORT1/packed.hg
353 4 files to transfer, 613 bytes of data
353 4 files to transfer, 613 bytes of data
354 transferred 613 bytes in *.* seconds (*) (glob)
354 transferred 613 bytes in *.* seconds (*) (glob)
355 finished applying clone bundle
355 finished applying clone bundle
356 searching for changes
356 searching for changes
357 no changes found
357 no changes found
358
358
359 Stream bundle spec with unknown requirements should be filtered out
359 Stream bundle spec with unknown requirements should be filtered out
360
360
361 $ cat > server/.hg/clonebundles.manifest << EOF
361 $ cat > server/.hg/clonebundles.manifest << EOF
362 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
362 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
363 > EOF
363 > EOF
364
364
365 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
365 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
366 no compatible clone bundles available on server; falling back to regular clone
366 no compatible clone bundles available on server; falling back to regular clone
367 (you may want to report this to the server operator)
367 (you may want to report this to the server operator)
368 requesting all changes
368 requesting all changes
369 adding changesets
369 adding changesets
370 adding manifests
370 adding manifests
371 adding file changes
371 adding file changes
372 added 2 changesets with 2 changes to 2 files
372 added 2 changesets with 2 changes to 2 files
373
373
374 Set up manifest for testing preferences
374 Set up manifest for testing preferences
375 (Remember, the TYPE does not have to match reality - the URL is
375 (Remember, the TYPE does not have to match reality - the URL is
376 important)
376 important)
377
377
378 $ cp full.hg gz-a.hg
378 $ cp full.hg gz-a.hg
379 $ cp full.hg gz-b.hg
379 $ cp full.hg gz-b.hg
380 $ cp full.hg bz2-a.hg
380 $ cp full.hg bz2-a.hg
381 $ cp full.hg bz2-b.hg
381 $ cp full.hg bz2-b.hg
382 $ cat > server/.hg/clonebundles.manifest << EOF
382 $ cat > server/.hg/clonebundles.manifest << EOF
383 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
383 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
384 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
384 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
385 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
385 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
386 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
386 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
387 > EOF
387 > EOF
388
388
389 Preferring an undefined attribute will take first entry
389 Preferring an undefined attribute will take first entry
390
390
391 $ hg --config experimental.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
391 $ hg --config experimental.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
392 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
392 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
393 adding changesets
393 adding changesets
394 adding manifests
394 adding manifests
395 adding file changes
395 adding file changes
396 added 2 changesets with 2 changes to 2 files
396 added 2 changesets with 2 changes to 2 files
397 finished applying clone bundle
397 finished applying clone bundle
398 searching for changes
398 searching for changes
399 no changes found
399 no changes found
400
400
401 Preferring bz2 type will download first entry of that type
401 Preferring bz2 type will download first entry of that type
402
402
403 $ hg --config experimental.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
403 $ hg --config experimental.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
404 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
404 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
405 adding changesets
405 adding changesets
406 adding manifests
406 adding manifests
407 adding file changes
407 adding file changes
408 added 2 changesets with 2 changes to 2 files
408 added 2 changesets with 2 changes to 2 files
409 finished applying clone bundle
409 finished applying clone bundle
410 searching for changes
410 searching for changes
411 no changes found
411 no changes found
412
412
413 Preferring multiple values of an option works
413 Preferring multiple values of an option works
414
414
415 $ hg --config experimental.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
415 $ hg --config experimental.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
416 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
416 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
417 adding changesets
417 adding changesets
418 adding manifests
418 adding manifests
419 adding file changes
419 adding file changes
420 added 2 changesets with 2 changes to 2 files
420 added 2 changesets with 2 changes to 2 files
421 finished applying clone bundle
421 finished applying clone bundle
422 searching for changes
422 searching for changes
423 no changes found
423 no changes found
424
424
425 Sorting multiple values should get us back to original first entry
425 Sorting multiple values should get us back to original first entry
426
426
427 $ hg --config experimental.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
427 $ hg --config experimental.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
428 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
428 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
429 adding changesets
429 adding changesets
430 adding manifests
430 adding manifests
431 adding file changes
431 adding file changes
432 added 2 changesets with 2 changes to 2 files
432 added 2 changesets with 2 changes to 2 files
433 finished applying clone bundle
433 finished applying clone bundle
434 searching for changes
434 searching for changes
435 no changes found
435 no changes found
436
436
437 Preferring multiple attributes has correct order
437 Preferring multiple attributes has correct order
438
438
439 $ hg --config experimental.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
439 $ hg --config experimental.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
440 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
440 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
441 adding changesets
441 adding changesets
442 adding manifests
442 adding manifests
443 adding file changes
443 adding file changes
444 added 2 changesets with 2 changes to 2 files
444 added 2 changesets with 2 changes to 2 files
445 finished applying clone bundle
445 finished applying clone bundle
446 searching for changes
446 searching for changes
447 no changes found
447 no changes found
448
448
449 Test where attribute is missing from some entries
449 Test where attribute is missing from some entries
450
450
451 $ cat > server/.hg/clonebundles.manifest << EOF
451 $ cat > server/.hg/clonebundles.manifest << EOF
452 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
452 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
453 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
453 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
454 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
454 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
455 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
455 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
456 > EOF
456 > EOF
457
457
458 $ hg --config experimental.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
458 $ hg --config experimental.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
459 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
459 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
460 adding changesets
460 adding changesets
461 adding manifests
461 adding manifests
462 adding file changes
462 adding file changes
463 added 2 changesets with 2 changes to 2 files
463 added 2 changesets with 2 changes to 2 files
464 finished applying clone bundle
464 finished applying clone bundle
465 searching for changes
465 searching for changes
466 no changes found
466 no changes found
@@ -1,349 +1,349 b''
1 Test argument handling and various data parsing
1 Test argument handling and various data parsing
2 ==================================================
2 ==================================================
3
3
4
4
5 Enable extensions used by this test.
5 Enable extensions used by this test.
6 $ cat >>$HGRCPATH <<EOF
6 $ cat >>$HGRCPATH <<EOF
7 > [extensions]
7 > [extensions]
8 > histedit=
8 > histedit=
9 > EOF
9 > EOF
10
10
11 Repo setup.
11 Repo setup.
12 $ hg init foo
12 $ hg init foo
13 $ cd foo
13 $ cd foo
14 $ echo alpha >> alpha
14 $ echo alpha >> alpha
15 $ hg addr
15 $ hg addr
16 adding alpha
16 adding alpha
17 $ hg ci -m one
17 $ hg ci -m one
18 $ echo alpha >> alpha
18 $ echo alpha >> alpha
19 $ hg ci -m two
19 $ hg ci -m two
20 $ echo alpha >> alpha
20 $ echo alpha >> alpha
21 $ hg ci -m three
21 $ hg ci -m three
22 $ echo alpha >> alpha
22 $ echo alpha >> alpha
23 $ hg ci -m four
23 $ hg ci -m four
24 $ echo alpha >> alpha
24 $ echo alpha >> alpha
25 $ hg ci -m five
25 $ hg ci -m five
26
26
27 $ hg log --style compact --graph
27 $ hg log --style compact --graph
28 @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test
28 @ 4[tip] 08d98a8350f3 1970-01-01 00:00 +0000 test
29 | five
29 | five
30 |
30 |
31 o 3 c8e68270e35a 1970-01-01 00:00 +0000 test
31 o 3 c8e68270e35a 1970-01-01 00:00 +0000 test
32 | four
32 | four
33 |
33 |
34 o 2 eb57da33312f 1970-01-01 00:00 +0000 test
34 o 2 eb57da33312f 1970-01-01 00:00 +0000 test
35 | three
35 | three
36 |
36 |
37 o 1 579e40513370 1970-01-01 00:00 +0000 test
37 o 1 579e40513370 1970-01-01 00:00 +0000 test
38 | two
38 | two
39 |
39 |
40 o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test
40 o 0 6058cbb6cfd7 1970-01-01 00:00 +0000 test
41 one
41 one
42
42
43
43
44 histedit --continue/--abort with no existing state
44 histedit --continue/--abort with no existing state
45 --------------------------------------------------
45 --------------------------------------------------
46
46
47 $ hg histedit --continue
47 $ hg histedit --continue
48 abort: no histedit in progress
48 abort: no histedit in progress
49 [255]
49 [255]
50 $ hg histedit --abort
50 $ hg histedit --abort
51 abort: no histedit in progress
51 abort: no histedit in progress
52 [255]
52 [255]
53
53
54 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
54 Run a dummy edit to make sure we get tip^^ correctly via revsingle.
55 --------------------------------------------------------------------
55 --------------------------------------------------------------------
56
56
57 $ HGEDITOR=cat hg histedit "tip^^"
57 $ HGEDITOR=cat hg histedit "tip^^"
58 pick eb57da33312f 2 three
58 pick eb57da33312f 2 three
59 pick c8e68270e35a 3 four
59 pick c8e68270e35a 3 four
60 pick 08d98a8350f3 4 five
60 pick 08d98a8350f3 4 five
61
61
62 # Edit history between eb57da33312f and 08d98a8350f3
62 # Edit history between eb57da33312f and 08d98a8350f3
63 #
63 #
64 # Commits are listed from least to most recent
64 # Commits are listed from least to most recent
65 #
65 #
66 # Commands:
66 # Commands:
67 # p, pick = use commit
67 # p, pick = use commit
68 # e, edit = use commit, but stop for amending
68 # e, edit = use commit, but stop for amending
69 # f, fold = use commit, but combine it with the one above
69 # f, fold = use commit, but combine it with the one above
70 # r, roll = like fold, but discard this commit's description
70 # r, roll = like fold, but discard this commit's description
71 # d, drop = remove commit from history
71 # d, drop = remove commit from history
72 # m, mess = edit commit message without changing commit content
72 # m, mess = edit commit message without changing commit content
73 #
73 #
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
75
75
76 Run on a revision not ancestors of the current working directory.
76 Run on a revision not ancestors of the current working directory.
77 --------------------------------------------------------------------
77 --------------------------------------------------------------------
78
78
79 $ hg up 2
79 $ hg up 2
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 $ hg histedit -r 4
81 $ hg histedit -r 4
82 abort: 08d98a8350f3 is not an ancestor of working directory
82 abort: 08d98a8350f3 is not an ancestor of working directory
83 [255]
83 [255]
84 $ hg up --quiet
84 $ hg up --quiet
85
85
86
86
87 Test that we pick the minimum of a revrange
87 Test that we pick the minimum of a revrange
88 ---------------------------------------
88 ---------------------------------------
89
89
90 $ HGEDITOR=cat hg histedit '2::' --commands - << EOF
90 $ HGEDITOR=cat hg histedit '2::' --commands - << EOF
91 > pick eb57da33312f 2 three
91 > pick eb57da33312f 2 three
92 > pick c8e68270e35a 3 four
92 > pick c8e68270e35a 3 four
93 > pick 08d98a8350f3 4 five
93 > pick 08d98a8350f3 4 five
94 > EOF
94 > EOF
95 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 $ hg up --quiet
96 $ hg up --quiet
97
97
98 $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF
98 $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF
99 > pick eb57da33312f 2 three
99 > pick eb57da33312f 2 three
100 > pick c8e68270e35a 3 four
100 > pick c8e68270e35a 3 four
101 > pick 08d98a8350f3 4 five
101 > pick 08d98a8350f3 4 five
102 > EOF
102 > EOF
103 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 $ hg up --quiet
104 $ hg up --quiet
105
105
106 Test config specified default
106 Test config specified default
107 -----------------------------
107 -----------------------------
108
108
109 $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF
109 $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF
110 > pick c8e68270e35a 3 four
110 > pick c8e68270e35a 3 four
111 > pick 08d98a8350f3 4 five
111 > pick 08d98a8350f3 4 five
112 > EOF
112 > EOF
113 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
114
114
115 Run on a revision not descendants of the initial parent
115 Run on a revision not descendants of the initial parent
116 --------------------------------------------------------------------
116 --------------------------------------------------------------------
117
117
118 Test the message shown for inconsistent histedit state, which may be
118 Test the message shown for inconsistent histedit state, which may be
119 created (and forgotten) by Mercurial earlier than 2.7. This emulates
119 created (and forgotten) by Mercurial earlier than 2.7. This emulates
120 Mercurial earlier than 2.7 by renaming ".hg/histedit-state"
120 Mercurial earlier than 2.7 by renaming ".hg/histedit-state"
121 temporarily.
121 temporarily.
122
122
123 $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
123 $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
124 @ 4 08d9 five
124 @ 4 08d9 five
125 |
125 |
126 o 3 c8e6 four
126 o 3 c8e6 four
127 |
127 |
128 o 2 eb57 three
128 o 2 eb57 three
129 |
129 |
130 $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
130 $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
131 > edit 08d98a8350f3 4 five
131 > edit 08d98a8350f3 4 five
132 > EOF
132 > EOF
133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 reverting alpha
134 reverting alpha
135 Make changes as needed, you may commit or record as needed now.
135 Make changes as needed, you may commit or record as needed now.
136 When you are finished, run hg histedit --continue to resume.
136 When you are finished, run hg histedit --continue to resume.
137 [1]
137 [1]
138
138
139 $ mv .hg/histedit-state .hg/histedit-state.back
139 $ mv .hg/histedit-state .hg/histedit-state.back
140 $ hg update --quiet --clean 2
140 $ hg update --quiet --clean 2
141 $ echo alpha >> alpha
141 $ echo alpha >> alpha
142 $ mv .hg/histedit-state.back .hg/histedit-state
142 $ mv .hg/histedit-state.back .hg/histedit-state
143
143
144 $ hg histedit --continue
144 $ hg histedit --continue
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg (glob)
146 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg (glob)
147 $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
147 $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
148 @ 4 f5ed five
148 @ 4 f5ed five
149 |
149 |
150 | o 3 c8e6 four
150 | o 3 c8e6 four
151 |/
151 |/
152 o 2 eb57 three
152 o 2 eb57 three
153 |
153 |
154
154
155 $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg
155 $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg
156 $ hg strip -q -r f5ed --config extensions.strip=
156 $ hg strip -q -r f5ed --config extensions.strip=
157 $ hg up -q 08d98a8350f3
157 $ hg up -q 08d98a8350f3
158
158
159 Test that missing revisions are detected
159 Test that missing revisions are detected
160 ---------------------------------------
160 ---------------------------------------
161
161
162 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
162 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
163 > pick eb57da33312f 2 three
163 > pick eb57da33312f 2 three
164 > pick 08d98a8350f3 4 five
164 > pick 08d98a8350f3 4 five
165 > EOF
165 > EOF
166 abort: missing rules for changeset c8e68270e35a
166 abort: missing rules for changeset c8e68270e35a
167 (do you want to use the drop action?)
167 (do you want to use the drop action?)
168 [255]
168 [255]
169
169
170 Test that extra revisions are detected
170 Test that extra revisions are detected
171 ---------------------------------------
171 ---------------------------------------
172
172
173 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
173 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
174 > pick 6058cbb6cfd7 0 one
174 > pick 6058cbb6cfd7 0 one
175 > pick c8e68270e35a 3 four
175 > pick c8e68270e35a 3 four
176 > pick 08d98a8350f3 4 five
176 > pick 08d98a8350f3 4 five
177 > EOF
177 > EOF
178 abort: may not use changesets other than the ones listed
178 abort: may not use changesets other than the ones listed
179 [255]
179 [255]
180
180
181 Test malformed line
181 Test malformed line
182 ---------------------------------------
182 ---------------------------------------
183
183
184 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
184 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
185 > pickeb57da33312f2three
185 > pickeb57da33312f2three
186 > pick c8e68270e35a 3 four
186 > pick c8e68270e35a 3 four
187 > pick 08d98a8350f3 4 five
187 > pick 08d98a8350f3 4 five
188 > EOF
188 > EOF
189 abort: malformed line "pickeb57da33312f2three"
189 abort: malformed line "pickeb57da33312f2three"
190 [255]
190 [255]
191
191
192 Test unknown changeset
192 Test unknown changeset
193 ---------------------------------------
193 ---------------------------------------
194
194
195 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
195 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
196 > pick 0123456789ab 2 three
196 > pick 0123456789ab 2 three
197 > pick c8e68270e35a 3 four
197 > pick c8e68270e35a 3 four
198 > pick 08d98a8350f3 4 five
198 > pick 08d98a8350f3 4 five
199 > EOF
199 > EOF
200 abort: unknown changeset 0123456789ab listed
200 abort: unknown changeset 0123456789ab listed
201 [255]
201 [255]
202
202
203 Test unknown command
203 Test unknown command
204 ---------------------------------------
204 ---------------------------------------
205
205
206 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
206 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
207 > coin eb57da33312f 2 three
207 > coin eb57da33312f 2 three
208 > pick c8e68270e35a 3 four
208 > pick c8e68270e35a 3 four
209 > pick 08d98a8350f3 4 five
209 > pick 08d98a8350f3 4 five
210 > EOF
210 > EOF
211 abort: unknown action "coin"
211 abort: unknown action "coin"
212 [255]
212 [255]
213
213
214 Test duplicated changeset
214 Test duplicated changeset
215 ---------------------------------------
215 ---------------------------------------
216
216
217 So one is missing and one appear twice.
217 So one is missing and one appear twice.
218
218
219 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
219 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
220 > pick eb57da33312f 2 three
220 > pick eb57da33312f 2 three
221 > pick eb57da33312f 2 three
221 > pick eb57da33312f 2 three
222 > pick 08d98a8350f3 4 five
222 > pick 08d98a8350f3 4 five
223 > EOF
223 > EOF
224 abort: duplicated command for changeset eb57da33312f
224 abort: duplicated command for changeset eb57da33312f
225 [255]
225 [255]
226
226
227 Test short version of command
227 Test short version of command
228 ---------------------------------------
228 ---------------------------------------
229
229
230 Note: we use varying amounts of white space between command name and changeset
230 Note: we use varying amounts of white space between command name and changeset
231 short hash. This tests issue3893.
231 short hash. This tests issue3893.
232
232
233 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
233 $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
234 > pick eb57da33312f 2 three
234 > pick eb57da33312f 2 three
235 > p c8e68270e35a 3 four
235 > p c8e68270e35a 3 four
236 > f 08d98a8350f3 4 five
236 > f 08d98a8350f3 4 five
237 > EOF
237 > EOF
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 reverting alpha
239 reverting alpha
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 four
241 four
242 ***
242 ***
243 five
243 five
244
244
245
245
246
246
247 HG: Enter commit message. Lines beginning with 'HG:' are removed.
247 HG: Enter commit message. Lines beginning with 'HG:' are removed.
248 HG: Leave message empty to abort commit.
248 HG: Leave message empty to abort commit.
249 HG: --
249 HG: --
250 HG: user: test
250 HG: user: test
251 HG: branch 'default'
251 HG: branch 'default'
252 HG: changed alpha
252 HG: changed alpha
253 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
253 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)
255 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)
256 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-23a13bf9-backup.hg (glob)
256 saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-23a13bf9-backup.hg (glob)
257
257
258 $ hg update -q 2
258 $ hg update -q 2
259 $ echo x > x
259 $ echo x > x
260 $ hg add x
260 $ hg add x
261 $ hg commit -m'x' x
261 $ hg commit -m'x' x
262 created new head
262 created new head
263 $ hg histedit -r 'heads(all())'
263 $ hg histedit -r 'heads(all())'
264 abort: The specified revisions must have exactly one common root
264 abort: The specified revisions must have exactly one common root
265 [255]
265 [255]
266
266
267 Test that trimming description using multi-byte characters
267 Test that trimming description using multi-byte characters
268 --------------------------------------------------------------------
268 --------------------------------------------------------------------
269
269
270 $ python <<EOF
270 $ python <<EOF
271 > fp = open('logfile', 'w')
271 > fp = open('logfile', 'w')
272 > fp.write('12345678901234567890123456789012345678901234567890' +
272 > fp.write('12345678901234567890123456789012345678901234567890' +
273 > '12345') # there are 5 more columns for 80 columns
273 > '12345') # there are 5 more columns for 80 columns
274 >
274 >
275 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
275 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
276 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
276 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
277 >
277 >
278 > fp.close()
278 > fp.close()
279 > EOF
279 > EOF
280 $ echo xx >> x
280 $ echo xx >> x
281 $ hg --encoding utf-8 commit --logfile logfile
281 $ hg --encoding utf-8 commit --logfile logfile
282
282
283 $ HGEDITOR=cat hg --encoding utf-8 histedit tip
283 $ HGEDITOR=cat hg --encoding utf-8 histedit tip
284 pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc)
284 pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc)
285
285
286 # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b
286 # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b
287 #
287 #
288 # Commits are listed from least to most recent
288 # Commits are listed from least to most recent
289 #
289 #
290 # Commands:
290 # Commands:
291 # p, pick = use commit
291 # p, pick = use commit
292 # e, edit = use commit, but stop for amending
292 # e, edit = use commit, but stop for amending
293 # f, fold = use commit, but combine it with the one above
293 # f, fold = use commit, but combine it with the one above
294 # r, roll = like fold, but discard this commit's description
294 # r, roll = like fold, but discard this commit's description
295 # d, drop = remove commit from history
295 # d, drop = remove commit from history
296 # m, mess = edit commit message without changing commit content
296 # m, mess = edit commit message without changing commit content
297 #
297 #
298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
299
299
300 Test --continue with --keep
300 Test --continue with --keep
301
301
302 $ hg strip -q -r . --config extensions.strip=
302 $ hg strip -q -r . --config extensions.strip=
303 $ hg histedit '.^' -q --keep --commands - << EOF
303 $ hg histedit '.^' -q --keep --commands - << EOF
304 > edit eb57da33312f 2 three
304 > edit eb57da33312f 2 three
305 > pick f3cfcca30c44 4 x
305 > pick f3cfcca30c44 4 x
306 > EOF
306 > EOF
307 Make changes as needed, you may commit or record as needed now.
307 Make changes as needed, you may commit or record as needed now.
308 When you are finished, run hg histedit --continue to resume.
308 When you are finished, run hg histedit --continue to resume.
309 [1]
309 [1]
310 $ echo edit >> alpha
310 $ echo edit >> alpha
311 $ hg histedit -q --continue
311 $ hg histedit -q --continue
312 $ hg log -G -T '{rev}:{node|short} {desc}'
312 $ hg log -G -T '{rev}:{node|short} {desc}'
313 @ 6:8fda0c726bf2 x
313 @ 6:8fda0c726bf2 x
314 |
314 |
315 o 5:63379946892c three
315 o 5:63379946892c three
316 |
316 |
317 | o 4:f3cfcca30c44 x
317 | o 4:f3cfcca30c44 x
318 | |
318 | |
319 | | o 3:2a30f3cfee78 four
319 | | o 3:2a30f3cfee78 four
320 | |/ ***
320 | |/ ***
321 | | five
321 | | five
322 | o 2:eb57da33312f three
322 | o 2:eb57da33312f three
323 |/
323 |/
324 o 1:579e40513370 two
324 o 1:579e40513370 two
325 |
325 |
326 o 0:6058cbb6cfd7 one
326 o 0:6058cbb6cfd7 one
327
327
328
328
329 Test that abort fails gracefully on exception
329 Test that abort fails gracefully on exception
330 ----------------------------------------------
330 ----------------------------------------------
331 $ hg histedit . -q --commands - << EOF
331 $ hg histedit . -q --commands - << EOF
332 > edit 8fda0c726bf2 6 x
332 > edit 8fda0c726bf2 6 x
333 > EOF
333 > EOF
334 Make changes as needed, you may commit or record as needed now.
334 Make changes as needed, you may commit or record as needed now.
335 When you are finished, run hg histedit --continue to resume.
335 When you are finished, run hg histedit --continue to resume.
336 [1]
336 [1]
337 Corrupt histedit state file
337 Corrupt histedit state file
338 $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit
338 $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit
339 $ mv ../corrupt-histedit .hg/histedit-state
339 $ mv ../corrupt-histedit .hg/histedit-state
340 $ hg histedit --abort
340 $ hg histedit --abort
341 warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
341 warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
342 abort: No such file or directory: * (glob)
342 abort: .*(No such file or directory:|The system cannot find the file specified).* (re)
343 [255]
343 [255]
344 Histedit state has been exited
344 Histedit state has been exited
345 $ hg summary -q
345 $ hg summary -q
346 parent: 5:63379946892c
346 parent: 5:63379946892c
347 commit: 1 added, 1 unknown (new branch head)
347 commit: 1 added, 1 unknown (new branch head)
348 update: 4 new changesets (update)
348 update: 4 new changesets (update)
349
349
@@ -1,1221 +1,1221 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > mq =
3 > mq =
4 > shelve =
4 > shelve =
5 > [defaults]
5 > [defaults]
6 > diff = --nodates --git
6 > diff = --nodates --git
7 > qnew = --date '0 0'
7 > qnew = --date '0 0'
8 > [shelve]
8 > [shelve]
9 > maxbackups = 2
9 > maxbackups = 2
10 > EOF
10 > EOF
11
11
12 $ hg init repo
12 $ hg init repo
13 $ cd repo
13 $ cd repo
14 $ mkdir a b
14 $ mkdir a b
15 $ echo a > a/a
15 $ echo a > a/a
16 $ echo b > b/b
16 $ echo b > b/b
17 $ echo c > c
17 $ echo c > c
18 $ echo d > d
18 $ echo d > d
19 $ echo x > x
19 $ echo x > x
20 $ hg addremove -q
20 $ hg addremove -q
21
21
22 shelve has a help message
22 shelve has a help message
23 $ hg shelve -h
23 $ hg shelve -h
24 hg shelve [OPTION]... [FILE]...
24 hg shelve [OPTION]... [FILE]...
25
25
26 save and set aside changes from the working directory
26 save and set aside changes from the working directory
27
27
28 Shelving takes files that "hg status" reports as not clean, saves the
28 Shelving takes files that "hg status" reports as not clean, saves the
29 modifications to a bundle (a shelved change), and reverts the files so
29 modifications to a bundle (a shelved change), and reverts the files so
30 that their state in the working directory becomes clean.
30 that their state in the working directory becomes clean.
31
31
32 To restore these changes to the working directory, using "hg unshelve";
32 To restore these changes to the working directory, using "hg unshelve";
33 this will work even if you switch to a different commit.
33 this will work even if you switch to a different commit.
34
34
35 When no files are specified, "hg shelve" saves all not-clean files. If
35 When no files are specified, "hg shelve" saves all not-clean files. If
36 specific files or directories are named, only changes to those files are
36 specific files or directories are named, only changes to those files are
37 shelved.
37 shelved.
38
38
39 Each shelved change has a name that makes it easier to find later. The
39 Each shelved change has a name that makes it easier to find later. The
40 name of a shelved change defaults to being based on the active bookmark,
40 name of a shelved change defaults to being based on the active bookmark,
41 or if there is no active bookmark, the current named branch. To specify a
41 or if there is no active bookmark, the current named branch. To specify a
42 different name, use "--name".
42 different name, use "--name".
43
43
44 To see a list of existing shelved changes, use the "--list" option. For
44 To see a list of existing shelved changes, use the "--list" option. For
45 each shelved change, this will print its name, age, and description; use "
45 each shelved change, this will print its name, age, and description; use "
46 --patch" or "--stat" for more details.
46 --patch" or "--stat" for more details.
47
47
48 To delete specific shelved changes, use "--delete". To delete all shelved
48 To delete specific shelved changes, use "--delete". To delete all shelved
49 changes, use "--cleanup".
49 changes, use "--cleanup".
50
50
51 (use "hg help -e shelve" to show help for the shelve extension)
51 (use "hg help -e shelve" to show help for the shelve extension)
52
52
53 options ([+] can be repeated):
53 options ([+] can be repeated):
54
54
55 -A --addremove mark new/missing files as added/removed before
55 -A --addremove mark new/missing files as added/removed before
56 shelving
56 shelving
57 --cleanup delete all shelved changes
57 --cleanup delete all shelved changes
58 --date DATE shelve with the specified commit date
58 --date DATE shelve with the specified commit date
59 -d --delete delete the named shelved change(s)
59 -d --delete delete the named shelved change(s)
60 -e --edit invoke editor on commit messages
60 -e --edit invoke editor on commit messages
61 -l --list list current shelves
61 -l --list list current shelves
62 -m --message TEXT use text as shelve message
62 -m --message TEXT use text as shelve message
63 -n --name NAME use the given name for the shelved commit
63 -n --name NAME use the given name for the shelved commit
64 -p --patch show patch
64 -p --patch show patch
65 -i --interactive interactive mode, only works while creating a shelve
65 -i --interactive interactive mode, only works while creating a shelve
66 --stat output diffstat-style summary of changes
66 --stat output diffstat-style summary of changes
67 -I --include PATTERN [+] include names matching the given patterns
67 -I --include PATTERN [+] include names matching the given patterns
68 -X --exclude PATTERN [+] exclude names matching the given patterns
68 -X --exclude PATTERN [+] exclude names matching the given patterns
69 --mq operate on patch repository
69 --mq operate on patch repository
70
70
71 (some details hidden, use --verbose to show complete help)
71 (some details hidden, use --verbose to show complete help)
72
72
73 shelving in an empty repo should be possible
73 shelving in an empty repo should be possible
74 (this tests also that editor is not invoked, if '--edit' is not
74 (this tests also that editor is not invoked, if '--edit' is not
75 specified)
75 specified)
76
76
77 $ HGEDITOR=cat hg shelve
77 $ HGEDITOR=cat hg shelve
78 shelved as default
78 shelved as default
79 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
79 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
80
80
81 $ hg unshelve
81 $ hg unshelve
82 unshelving change 'default'
82 unshelving change 'default'
83
83
84 $ hg commit -q -m 'initial commit'
84 $ hg commit -q -m 'initial commit'
85
85
86 $ hg shelve
86 $ hg shelve
87 nothing changed
87 nothing changed
88 [1]
88 [1]
89
89
90 make sure shelve files were backed up
90 make sure shelve files were backed up
91
91
92 $ ls .hg/shelve-backup
92 $ ls .hg/shelve-backup
93 default.hg
93 default.hg
94 default.patch
94 default.patch
95
95
96 create an mq patch - shelving should work fine with a patch applied
96 create an mq patch - shelving should work fine with a patch applied
97
97
98 $ echo n > n
98 $ echo n > n
99 $ hg add n
99 $ hg add n
100 $ hg commit n -m second
100 $ hg commit n -m second
101 $ hg qnew second.patch
101 $ hg qnew second.patch
102
102
103 shelve a change that we will delete later
103 shelve a change that we will delete later
104
104
105 $ echo a >> a/a
105 $ echo a >> a/a
106 $ hg shelve
106 $ hg shelve
107 shelved as default
107 shelved as default
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109
109
110 set up some more complex changes to shelve
110 set up some more complex changes to shelve
111
111
112 $ echo a >> a/a
112 $ echo a >> a/a
113 $ hg mv b b.rename
113 $ hg mv b b.rename
114 moving b/b to b.rename/b (glob)
114 moving b/b to b.rename/b (glob)
115 $ hg cp c c.copy
115 $ hg cp c c.copy
116 $ hg status -C
116 $ hg status -C
117 M a/a
117 M a/a
118 A b.rename/b
118 A b.rename/b
119 b/b
119 b/b
120 A c.copy
120 A c.copy
121 c
121 c
122 R b/b
122 R b/b
123
123
124 prevent some foot-shooting
124 prevent some foot-shooting
125
125
126 $ hg shelve -n foo/bar
126 $ hg shelve -n foo/bar
127 abort: shelved change names may not contain slashes
127 abort: shelved change names may not contain slashes
128 [255]
128 [255]
129 $ hg shelve -n .baz
129 $ hg shelve -n .baz
130 abort: shelved change names may not start with '.'
130 abort: shelved change names may not start with '.'
131 [255]
131 [255]
132
132
133 the common case - no options or filenames
133 the common case - no options or filenames
134
134
135 $ hg shelve
135 $ hg shelve
136 shelved as default-01
136 shelved as default-01
137 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
137 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
138 $ hg status -C
138 $ hg status -C
139
139
140 ensure that our shelved changes exist
140 ensure that our shelved changes exist
141
141
142 $ hg shelve -l
142 $ hg shelve -l
143 default-01 (*)* changes to '[mq]: second.patch' (glob)
143 default-01 (*)* changes to '[mq]: second.patch' (glob)
144 default (*)* changes to '[mq]: second.patch' (glob)
144 default (*)* changes to '[mq]: second.patch' (glob)
145
145
146 $ hg shelve -l -p default
146 $ hg shelve -l -p default
147 default (*)* changes to '[mq]: second.patch' (glob)
147 default (*)* changes to '[mq]: second.patch' (glob)
148
148
149 diff --git a/a/a b/a/a
149 diff --git a/a/a b/a/a
150 --- a/a/a
150 --- a/a/a
151 +++ b/a/a
151 +++ b/a/a
152 @@ -1,1 +1,2 @@
152 @@ -1,1 +1,2 @@
153 a
153 a
154 +a
154 +a
155
155
156 $ hg shelve --list --addremove
156 $ hg shelve --list --addremove
157 abort: options '--list' and '--addremove' may not be used together
157 abort: options '--list' and '--addremove' may not be used together
158 [255]
158 [255]
159
159
160 delete our older shelved change
160 delete our older shelved change
161
161
162 $ hg shelve -d default
162 $ hg shelve -d default
163 $ hg qfinish -a -q
163 $ hg qfinish -a -q
164
164
165 ensure shelve backups aren't overwritten
165 ensure shelve backups aren't overwritten
166
166
167 $ ls .hg/shelve-backup/
167 $ ls .hg/shelve-backup/
168 default-1.hg
168 default-1.hg
169 default-1.patch
169 default-1.patch
170 default.hg
170 default.hg
171 default.patch
171 default.patch
172
172
173 local edits should not prevent a shelved change from applying
173 local edits should not prevent a shelved change from applying
174
174
175 $ printf "z\na\n" > a/a
175 $ printf "z\na\n" > a/a
176 $ hg unshelve --keep
176 $ hg unshelve --keep
177 unshelving change 'default-01'
177 unshelving change 'default-01'
178 temporarily committing pending changes (restore with 'hg unshelve --abort')
178 temporarily committing pending changes (restore with 'hg unshelve --abort')
179 rebasing shelved changes
179 rebasing shelved changes
180 rebasing 4:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
180 rebasing 4:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
181 merging a/a
181 merging a/a
182
182
183 $ hg revert --all -q
183 $ hg revert --all -q
184 $ rm a/a.orig b.rename/b c.copy
184 $ rm a/a.orig b.rename/b c.copy
185
185
186 apply it and make sure our state is as expected
186 apply it and make sure our state is as expected
187
187
188 (this also tests that same timestamp prevents backups from being
188 (this also tests that same timestamp prevents backups from being
189 removed, even though there are more than 'maxbackups' backups)
189 removed, even though there are more than 'maxbackups' backups)
190
190
191 $ f -t .hg/shelve-backup/default.hg
191 $ f -t .hg/shelve-backup/default.hg
192 .hg/shelve-backup/default.hg: file
192 .hg/shelve-backup/default.hg: file
193 $ touch -t 200001010000 .hg/shelve-backup/default.hg
193 $ touch -t 200001010000 .hg/shelve-backup/default.hg
194 $ f -t .hg/shelve-backup/default-1.hg
194 $ f -t .hg/shelve-backup/default-1.hg
195 .hg/shelve-backup/default-1.hg: file
195 .hg/shelve-backup/default-1.hg: file
196 $ touch -t 200001010000 .hg/shelve-backup/default-1.hg
196 $ touch -t 200001010000 .hg/shelve-backup/default-1.hg
197
197
198 $ hg unshelve
198 $ hg unshelve
199 unshelving change 'default-01'
199 unshelving change 'default-01'
200 $ hg status -C
200 $ hg status -C
201 M a/a
201 M a/a
202 A b.rename/b
202 A b.rename/b
203 b/b
203 b/b
204 A c.copy
204 A c.copy
205 c
205 c
206 R b/b
206 R b/b
207 $ hg shelve -l
207 $ hg shelve -l
208
208
209 (both of default.hg and default-1.hg should be still kept, because it
209 (both of default.hg and default-1.hg should be still kept, because it
210 is difficult to decide actual order of them from same timestamp)
210 is difficult to decide actual order of them from same timestamp)
211
211
212 $ ls .hg/shelve-backup/
212 $ ls .hg/shelve-backup/
213 default-01.hg
213 default-01.hg
214 default-01.patch
214 default-01.patch
215 default-1.hg
215 default-1.hg
216 default-1.patch
216 default-1.patch
217 default.hg
217 default.hg
218 default.patch
218 default.patch
219
219
220 $ hg unshelve
220 $ hg unshelve
221 abort: no shelved changes to apply!
221 abort: no shelved changes to apply!
222 [255]
222 [255]
223 $ hg unshelve foo
223 $ hg unshelve foo
224 abort: shelved change 'foo' not found
224 abort: shelved change 'foo' not found
225 [255]
225 [255]
226
226
227 named shelves, specific filenames, and "commit messages" should all work
227 named shelves, specific filenames, and "commit messages" should all work
228 (this tests also that editor is invoked, if '--edit' is specified)
228 (this tests also that editor is invoked, if '--edit' is specified)
229
229
230 $ hg status -C
230 $ hg status -C
231 M a/a
231 M a/a
232 A b.rename/b
232 A b.rename/b
233 b/b
233 b/b
234 A c.copy
234 A c.copy
235 c
235 c
236 R b/b
236 R b/b
237 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
237 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
238 wat
238 wat
239
239
240
240
241 HG: Enter commit message. Lines beginning with 'HG:' are removed.
241 HG: Enter commit message. Lines beginning with 'HG:' are removed.
242 HG: Leave message empty to abort commit.
242 HG: Leave message empty to abort commit.
243 HG: --
243 HG: --
244 HG: user: shelve@localhost
244 HG: user: shelve@localhost
245 HG: branch 'default'
245 HG: branch 'default'
246 HG: changed a/a
246 HG: changed a/a
247
247
248 expect "a" to no longer be present, but status otherwise unchanged
248 expect "a" to no longer be present, but status otherwise unchanged
249
249
250 $ hg status -C
250 $ hg status -C
251 A b.rename/b
251 A b.rename/b
252 b/b
252 b/b
253 A c.copy
253 A c.copy
254 c
254 c
255 R b/b
255 R b/b
256 $ hg shelve -l --stat
256 $ hg shelve -l --stat
257 wibble (*) wat (glob)
257 wibble (*) wat (glob)
258 a/a | 1 +
258 a/a | 1 +
259 1 files changed, 1 insertions(+), 0 deletions(-)
259 1 files changed, 1 insertions(+), 0 deletions(-)
260
260
261 and now "a/a" should reappear
261 and now "a/a" should reappear
262
262
263 $ cd a
263 $ cd a
264 $ hg unshelve -q wibble
264 $ hg unshelve -q wibble
265 $ cd ..
265 $ cd ..
266 $ hg status -C
266 $ hg status -C
267 M a/a
267 M a/a
268 A b.rename/b
268 A b.rename/b
269 b/b
269 b/b
270 A c.copy
270 A c.copy
271 c
271 c
272 R b/b
272 R b/b
273
273
274 ensure old shelve backups are being deleted automatically
274 ensure old shelve backups are being deleted automatically
275
275
276 $ ls .hg/shelve-backup/
276 $ ls .hg/shelve-backup/
277 default-01.hg
277 default-01.hg
278 default-01.patch
278 default-01.patch
279 wibble.hg
279 wibble.hg
280 wibble.patch
280 wibble.patch
281
281
282 cause unshelving to result in a merge with 'a' conflicting
282 cause unshelving to result in a merge with 'a' conflicting
283
283
284 $ hg shelve -q
284 $ hg shelve -q
285 $ echo c>>a/a
285 $ echo c>>a/a
286 $ hg commit -m second
286 $ hg commit -m second
287 $ hg tip --template '{files}\n'
287 $ hg tip --template '{files}\n'
288 a/a
288 a/a
289
289
290 add an unrelated change that should be preserved
290 add an unrelated change that should be preserved
291
291
292 $ mkdir foo
292 $ mkdir foo
293 $ echo foo > foo/foo
293 $ echo foo > foo/foo
294 $ hg add foo/foo
294 $ hg add foo/foo
295
295
296 force a conflicted merge to occur
296 force a conflicted merge to occur
297
297
298 $ hg unshelve
298 $ hg unshelve
299 unshelving change 'default'
299 unshelving change 'default'
300 temporarily committing pending changes (restore with 'hg unshelve --abort')
300 temporarily committing pending changes (restore with 'hg unshelve --abort')
301 rebasing shelved changes
301 rebasing shelved changes
302 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
302 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
303 merging a/a
303 merging a/a
304 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
304 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
305 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
305 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
306 [1]
306 [1]
307
307
308 ensure that we have a merge with unresolved conflicts
308 ensure that we have a merge with unresolved conflicts
309
309
310 $ hg heads -q --template '{rev}\n'
310 $ hg heads -q --template '{rev}\n'
311 5
311 5
312 4
312 4
313 $ hg parents -q --template '{rev}\n'
313 $ hg parents -q --template '{rev}\n'
314 4
314 4
315 5
315 5
316 $ hg status
316 $ hg status
317 M a/a
317 M a/a
318 M b.rename/b
318 M b.rename/b
319 M c.copy
319 M c.copy
320 R b/b
320 R b/b
321 ? a/a.orig
321 ? a/a.orig
322 $ hg diff
322 $ hg diff
323 diff --git a/a/a b/a/a
323 diff --git a/a/a b/a/a
324 --- a/a/a
324 --- a/a/a
325 +++ b/a/a
325 +++ b/a/a
326 @@ -1,2 +1,6 @@
326 @@ -1,2 +1,6 @@
327 a
327 a
328 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
328 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
329 c
329 c
330 +=======
330 +=======
331 +a
331 +a
332 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
332 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
333 diff --git a/b/b b/b.rename/b
333 diff --git a/b/b b/b.rename/b
334 rename from b/b
334 rename from b/b
335 rename to b.rename/b
335 rename to b.rename/b
336 diff --git a/c b/c.copy
336 diff --git a/c b/c.copy
337 copy from c
337 copy from c
338 copy to c.copy
338 copy to c.copy
339 $ hg resolve -l
339 $ hg resolve -l
340 U a/a
340 U a/a
341
341
342 $ hg shelve
342 $ hg shelve
343 abort: unshelve already in progress
343 abort: unshelve already in progress
344 (use 'hg unshelve --continue' or 'hg unshelve --abort')
344 (use 'hg unshelve --continue' or 'hg unshelve --abort')
345 [255]
345 [255]
346
346
347 abort the unshelve and be happy
347 abort the unshelve and be happy
348
348
349 $ hg status
349 $ hg status
350 M a/a
350 M a/a
351 M b.rename/b
351 M b.rename/b
352 M c.copy
352 M c.copy
353 R b/b
353 R b/b
354 ? a/a.orig
354 ? a/a.orig
355 $ hg unshelve -a
355 $ hg unshelve -a
356 rebase aborted
356 rebase aborted
357 unshelve of 'default' aborted
357 unshelve of 'default' aborted
358 $ hg heads -q
358 $ hg heads -q
359 3:2e69b451d1ea
359 3:2e69b451d1ea
360 $ hg parents
360 $ hg parents
361 changeset: 3:2e69b451d1ea
361 changeset: 3:2e69b451d1ea
362 tag: tip
362 tag: tip
363 user: test
363 user: test
364 date: Thu Jan 01 00:00:00 1970 +0000
364 date: Thu Jan 01 00:00:00 1970 +0000
365 summary: second
365 summary: second
366
366
367 $ hg resolve -l
367 $ hg resolve -l
368 $ hg status
368 $ hg status
369 A foo/foo
369 A foo/foo
370 ? a/a.orig
370 ? a/a.orig
371
371
372 try to continue with no unshelve underway
372 try to continue with no unshelve underway
373
373
374 $ hg unshelve -c
374 $ hg unshelve -c
375 abort: no unshelve operation underway
375 abort: no unshelve operation underway
376 [255]
376 [255]
377 $ hg status
377 $ hg status
378 A foo/foo
378 A foo/foo
379 ? a/a.orig
379 ? a/a.orig
380
380
381 redo the unshelve to get a conflict
381 redo the unshelve to get a conflict
382
382
383 $ hg unshelve -q
383 $ hg unshelve -q
384 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
384 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
385 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
385 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
386 [1]
386 [1]
387
387
388 attempt to continue
388 attempt to continue
389
389
390 $ hg unshelve -c
390 $ hg unshelve -c
391 abort: unresolved conflicts, can't continue
391 abort: unresolved conflicts, can't continue
392 (see 'hg resolve', then 'hg unshelve --continue')
392 (see 'hg resolve', then 'hg unshelve --continue')
393 [255]
393 [255]
394
394
395 $ hg revert -r . a/a
395 $ hg revert -r . a/a
396 $ hg resolve -m a/a
396 $ hg resolve -m a/a
397 (no more unresolved files)
397 (no more unresolved files)
398
398
399 $ hg commit -m 'commit while unshelve in progress'
399 $ hg commit -m 'commit while unshelve in progress'
400 abort: unshelve already in progress
400 abort: unshelve already in progress
401 (use 'hg unshelve --continue' or 'hg unshelve --abort')
401 (use 'hg unshelve --continue' or 'hg unshelve --abort')
402 [255]
402 [255]
403
403
404 $ hg unshelve -c
404 $ hg unshelve -c
405 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
405 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
406 unshelve of 'default' complete
406 unshelve of 'default' complete
407
407
408 ensure the repo is as we hope
408 ensure the repo is as we hope
409
409
410 $ hg parents
410 $ hg parents
411 changeset: 3:2e69b451d1ea
411 changeset: 3:2e69b451d1ea
412 tag: tip
412 tag: tip
413 user: test
413 user: test
414 date: Thu Jan 01 00:00:00 1970 +0000
414 date: Thu Jan 01 00:00:00 1970 +0000
415 summary: second
415 summary: second
416
416
417 $ hg heads -q
417 $ hg heads -q
418 3:2e69b451d1ea
418 3:2e69b451d1ea
419
419
420 $ hg status -C
420 $ hg status -C
421 A b.rename/b
421 A b.rename/b
422 b/b
422 b/b
423 A c.copy
423 A c.copy
424 c
424 c
425 A foo/foo
425 A foo/foo
426 R b/b
426 R b/b
427 ? a/a.orig
427 ? a/a.orig
428
428
429 there should be no shelves left
429 there should be no shelves left
430
430
431 $ hg shelve -l
431 $ hg shelve -l
432
432
433 #if execbit
433 #if execbit
434
434
435 ensure that metadata-only changes are shelved
435 ensure that metadata-only changes are shelved
436
436
437 $ chmod +x a/a
437 $ chmod +x a/a
438 $ hg shelve -q -n execbit a/a
438 $ hg shelve -q -n execbit a/a
439 $ hg status a/a
439 $ hg status a/a
440 $ hg unshelve -q execbit
440 $ hg unshelve -q execbit
441 $ hg status a/a
441 $ hg status a/a
442 M a/a
442 M a/a
443 $ hg revert a/a
443 $ hg revert a/a
444
444
445 #endif
445 #endif
446
446
447 #if symlink
447 #if symlink
448
448
449 $ rm a/a
449 $ rm a/a
450 $ ln -s foo a/a
450 $ ln -s foo a/a
451 $ hg shelve -q -n symlink a/a
451 $ hg shelve -q -n symlink a/a
452 $ hg status a/a
452 $ hg status a/a
453 $ hg unshelve -q symlink
453 $ hg unshelve -q symlink
454 $ hg status a/a
454 $ hg status a/a
455 M a/a
455 M a/a
456 $ hg revert a/a
456 $ hg revert a/a
457
457
458 #endif
458 #endif
459
459
460 set up another conflict between a commit and a shelved change
460 set up another conflict between a commit and a shelved change
461
461
462 $ hg revert -q -C -a
462 $ hg revert -q -C -a
463 $ rm a/a.orig b.rename/b c.copy
463 $ rm a/a.orig b.rename/b c.copy
464 $ echo a >> a/a
464 $ echo a >> a/a
465 $ hg shelve -q
465 $ hg shelve -q
466 $ echo x >> a/a
466 $ echo x >> a/a
467 $ hg ci -m 'create conflict'
467 $ hg ci -m 'create conflict'
468 $ hg add foo/foo
468 $ hg add foo/foo
469
469
470 if we resolve a conflict while unshelving, the unshelve should succeed
470 if we resolve a conflict while unshelving, the unshelve should succeed
471
471
472 $ HGMERGE=true hg unshelve
472 $ HGMERGE=true hg unshelve
473 unshelving change 'default'
473 unshelving change 'default'
474 temporarily committing pending changes (restore with 'hg unshelve --abort')
474 temporarily committing pending changes (restore with 'hg unshelve --abort')
475 rebasing shelved changes
475 rebasing shelved changes
476 rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
476 rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
477 merging a/a
477 merging a/a
478 note: rebase of 6:c5e6910e7601 created no changes to commit
478 note: rebase of 6:c5e6910e7601 created no changes to commit
479 $ hg parents -q
479 $ hg parents -q
480 4:33f7f61e6c5e
480 4:33f7f61e6c5e
481 $ hg shelve -l
481 $ hg shelve -l
482 $ hg status
482 $ hg status
483 A foo/foo
483 A foo/foo
484 $ cat a/a
484 $ cat a/a
485 a
485 a
486 c
486 c
487 x
487 x
488
488
489 test keep and cleanup
489 test keep and cleanup
490
490
491 $ hg shelve
491 $ hg shelve
492 shelved as default
492 shelved as default
493 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
493 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
494 $ hg shelve --list
494 $ hg shelve --list
495 default (*) changes to 'create conflict' (glob)
495 default (*) changes to 'create conflict' (glob)
496 $ hg unshelve --keep
496 $ hg unshelve --keep
497 unshelving change 'default'
497 unshelving change 'default'
498 $ hg shelve --list
498 $ hg shelve --list
499 default (*) changes to 'create conflict' (glob)
499 default (*) changes to 'create conflict' (glob)
500 $ hg shelve --cleanup
500 $ hg shelve --cleanup
501 $ hg shelve --list
501 $ hg shelve --list
502
502
503 $ hg shelve --cleanup --delete
503 $ hg shelve --cleanup --delete
504 abort: options '--cleanup' and '--delete' may not be used together
504 abort: options '--cleanup' and '--delete' may not be used together
505 [255]
505 [255]
506 $ hg shelve --cleanup --patch
506 $ hg shelve --cleanup --patch
507 abort: options '--cleanup' and '--patch' may not be used together
507 abort: options '--cleanup' and '--patch' may not be used together
508 [255]
508 [255]
509 $ hg shelve --cleanup --message MESSAGE
509 $ hg shelve --cleanup --message MESSAGE
510 abort: options '--cleanup' and '--message' may not be used together
510 abort: options '--cleanup' and '--message' may not be used together
511 [255]
511 [255]
512
512
513 test bookmarks
513 test bookmarks
514
514
515 $ hg bookmark test
515 $ hg bookmark test
516 $ hg bookmark
516 $ hg bookmark
517 * test 4:33f7f61e6c5e
517 * test 4:33f7f61e6c5e
518 $ hg shelve
518 $ hg shelve
519 shelved as test
519 shelved as test
520 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
520 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
521 $ hg bookmark
521 $ hg bookmark
522 * test 4:33f7f61e6c5e
522 * test 4:33f7f61e6c5e
523 $ hg unshelve
523 $ hg unshelve
524 unshelving change 'test'
524 unshelving change 'test'
525 $ hg bookmark
525 $ hg bookmark
526 * test 4:33f7f61e6c5e
526 * test 4:33f7f61e6c5e
527
527
528 shelve should still work even if mq is disabled
528 shelve should still work even if mq is disabled
529
529
530 $ hg --config extensions.mq=! shelve
530 $ hg --config extensions.mq=! shelve
531 shelved as test
531 shelved as test
532 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
532 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
533 $ hg --config extensions.mq=! shelve --list
533 $ hg --config extensions.mq=! shelve --list
534 test (*) changes to 'create conflict' (glob)
534 test (*) changes to 'create conflict' (glob)
535 $ hg bookmark
535 $ hg bookmark
536 * test 4:33f7f61e6c5e
536 * test 4:33f7f61e6c5e
537 $ hg --config extensions.mq=! unshelve
537 $ hg --config extensions.mq=! unshelve
538 unshelving change 'test'
538 unshelving change 'test'
539 $ hg bookmark
539 $ hg bookmark
540 * test 4:33f7f61e6c5e
540 * test 4:33f7f61e6c5e
541
541
542 shelve should leave dirstate clean (issue4055)
542 shelve should leave dirstate clean (issue4055)
543
543
544 $ cd ..
544 $ cd ..
545 $ hg init shelverebase
545 $ hg init shelverebase
546 $ cd shelverebase
546 $ cd shelverebase
547 $ printf 'x\ny\n' > x
547 $ printf 'x\ny\n' > x
548 $ echo z > z
548 $ echo z > z
549 $ hg commit -Aqm xy
549 $ hg commit -Aqm xy
550 $ echo z >> x
550 $ echo z >> x
551 $ hg commit -Aqm z
551 $ hg commit -Aqm z
552 $ hg up 0
552 $ hg up 0
553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
554 $ printf 'a\nx\ny\nz\n' > x
554 $ printf 'a\nx\ny\nz\n' > x
555 $ hg commit -Aqm xyz
555 $ hg commit -Aqm xyz
556 $ echo c >> z
556 $ echo c >> z
557 $ hg shelve
557 $ hg shelve
558 shelved as default
558 shelved as default
559 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
559 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
560 $ hg rebase -d 1 --config extensions.rebase=
560 $ hg rebase -d 1 --config extensions.rebase=
561 rebasing 2:323bfa07f744 "xyz" (tip)
561 rebasing 2:323bfa07f744 "xyz" (tip)
562 merging x
562 merging x
563 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-78114325-backup.hg (glob)
563 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-78114325-backup.hg (glob)
564 $ hg unshelve
564 $ hg unshelve
565 unshelving change 'default'
565 unshelving change 'default'
566 rebasing shelved changes
566 rebasing shelved changes
567 rebasing 4:b8fefe789ed0 "changes to 'xyz'" (tip)
567 rebasing 4:b8fefe789ed0 "changes to 'xyz'" (tip)
568 $ hg status
568 $ hg status
569 M z
569 M z
570
570
571 $ cd ..
571 $ cd ..
572
572
573 shelve should only unshelve pending changes (issue4068)
573 shelve should only unshelve pending changes (issue4068)
574
574
575 $ hg init onlypendingchanges
575 $ hg init onlypendingchanges
576 $ cd onlypendingchanges
576 $ cd onlypendingchanges
577 $ touch a
577 $ touch a
578 $ hg ci -Aqm a
578 $ hg ci -Aqm a
579 $ touch b
579 $ touch b
580 $ hg ci -Aqm b
580 $ hg ci -Aqm b
581 $ hg up -q 0
581 $ hg up -q 0
582 $ touch c
582 $ touch c
583 $ hg ci -Aqm c
583 $ hg ci -Aqm c
584
584
585 $ touch d
585 $ touch d
586 $ hg add d
586 $ hg add d
587 $ hg shelve
587 $ hg shelve
588 shelved as default
588 shelved as default
589 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
589 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
590 $ hg up -q 1
590 $ hg up -q 1
591 $ hg unshelve
591 $ hg unshelve
592 unshelving change 'default'
592 unshelving change 'default'
593 rebasing shelved changes
593 rebasing shelved changes
594 rebasing 3:0cae6656c016 "changes to 'c'" (tip)
594 rebasing 3:0cae6656c016 "changes to 'c'" (tip)
595 $ hg status
595 $ hg status
596 A d
596 A d
597
597
598 unshelve should work on an ancestor of the original commit
598 unshelve should work on an ancestor of the original commit
599
599
600 $ hg shelve
600 $ hg shelve
601 shelved as default
601 shelved as default
602 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
602 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
603 $ hg up 0
603 $ hg up 0
604 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
604 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
605 $ hg unshelve
605 $ hg unshelve
606 unshelving change 'default'
606 unshelving change 'default'
607 rebasing shelved changes
607 rebasing shelved changes
608 rebasing 3:be58f65f55fb "changes to 'b'" (tip)
608 rebasing 3:be58f65f55fb "changes to 'b'" (tip)
609 $ hg status
609 $ hg status
610 A d
610 A d
611
611
612 test bug 4073 we need to enable obsolete markers for it
612 test bug 4073 we need to enable obsolete markers for it
613
613
614 $ cat >> $HGRCPATH << EOF
614 $ cat >> $HGRCPATH << EOF
615 > [experimental]
615 > [experimental]
616 > evolution=createmarkers
616 > evolution=createmarkers
617 > EOF
617 > EOF
618 $ hg shelve
618 $ hg shelve
619 shelved as default
619 shelved as default
620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
621 $ hg debugobsolete `hg --debug id -i -r 1`
621 $ hg debugobsolete `hg --debug id -i -r 1`
622 $ hg unshelve
622 $ hg unshelve
623 unshelving change 'default'
623 unshelving change 'default'
624
624
625 unshelve should leave unknown files alone (issue4113)
625 unshelve should leave unknown files alone (issue4113)
626
626
627 $ echo e > e
627 $ echo e > e
628 $ hg shelve
628 $ hg shelve
629 shelved as default
629 shelved as default
630 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
630 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
631 $ hg status
631 $ hg status
632 ? e
632 ? e
633 $ hg unshelve
633 $ hg unshelve
634 unshelving change 'default'
634 unshelving change 'default'
635 $ hg status
635 $ hg status
636 A d
636 A d
637 ? e
637 ? e
638 $ cat e
638 $ cat e
639 e
639 e
640
640
641 unshelve should keep a copy of unknown files
641 unshelve should keep a copy of unknown files
642
642
643 $ hg add e
643 $ hg add e
644 $ hg shelve
644 $ hg shelve
645 shelved as default
645 shelved as default
646 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
646 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
647 $ echo z > e
647 $ echo z > e
648 $ hg unshelve
648 $ hg unshelve
649 unshelving change 'default'
649 unshelving change 'default'
650 $ cat e
650 $ cat e
651 e
651 e
652 $ cat e.orig
652 $ cat e.orig
653 z
653 z
654
654
655
655
656 unshelve and conflicts with tracked and untracked files
656 unshelve and conflicts with tracked and untracked files
657
657
658 preparing:
658 preparing:
659
659
660 $ rm *.orig
660 $ rm *.orig
661 $ hg ci -qm 'commit stuff'
661 $ hg ci -qm 'commit stuff'
662 $ hg phase -p null:
662 $ hg phase -p null:
663
663
664 no other changes - no merge:
664 no other changes - no merge:
665
665
666 $ echo f > f
666 $ echo f > f
667 $ hg add f
667 $ hg add f
668 $ hg shelve
668 $ hg shelve
669 shelved as default
669 shelved as default
670 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
670 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
671 $ echo g > f
671 $ echo g > f
672 $ hg unshelve
672 $ hg unshelve
673 unshelving change 'default'
673 unshelving change 'default'
674 $ hg st
674 $ hg st
675 A f
675 A f
676 ? f.orig
676 ? f.orig
677 $ cat f
677 $ cat f
678 f
678 f
679 $ cat f.orig
679 $ cat f.orig
680 g
680 g
681
681
682 other uncommitted changes - merge:
682 other uncommitted changes - merge:
683
683
684 $ hg st
684 $ hg st
685 A f
685 A f
686 ? f.orig
686 ? f.orig
687 $ hg shelve
687 $ hg shelve
688 shelved as default
688 shelved as default
689 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
689 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
690 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
690 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
691 o 4 changes to 'commit stuff' shelve@localhost
691 o 4 changes to 'commit stuff' shelve@localhost
692 |
692 |
693 $ hg log -G --template '{rev} {desc|firstline} {author}'
693 $ hg log -G --template '{rev} {desc|firstline} {author}'
694 @ 3 commit stuff test
694 @ 3 commit stuff test
695 |
695 |
696 | o 2 c test
696 | o 2 c test
697 |/
697 |/
698 o 0 a test
698 o 0 a test
699
699
700 $ mv f.orig f
700 $ mv f.orig f
701 $ echo 1 > a
701 $ echo 1 > a
702 $ hg unshelve --date '1073741824 0'
702 $ hg unshelve --date '1073741824 0'
703 unshelving change 'default'
703 unshelving change 'default'
704 temporarily committing pending changes (restore with 'hg unshelve --abort')
704 temporarily committing pending changes (restore with 'hg unshelve --abort')
705 rebasing shelved changes
705 rebasing shelved changes
706 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
706 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
707 merging f
707 merging f
708 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
708 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
709 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
709 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
710 [1]
710 [1]
711 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
711 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
712 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
712 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
713 |
713 |
714 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
714 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
715 |/
715 |/
716 o 3 commit stuff test 1970-01-01 00:00 +0000
716 o 3 commit stuff test 1970-01-01 00:00 +0000
717 |
717 |
718 | o 2 c test 1970-01-01 00:00 +0000
718 | o 2 c test 1970-01-01 00:00 +0000
719 |/
719 |/
720 o 0 a test 1970-01-01 00:00 +0000
720 o 0 a test 1970-01-01 00:00 +0000
721
721
722 $ hg st
722 $ hg st
723 M f
723 M f
724 ? f.orig
724 ? f.orig
725 $ cat f
725 $ cat f
726 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
726 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
727 g
727 g
728 =======
728 =======
729 f
729 f
730 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
730 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
731 $ cat f.orig
731 $ cat f.orig
732 g
732 g
733 $ hg unshelve --abort
733 $ hg unshelve --abort
734 rebase aborted
734 rebase aborted
735 unshelve of 'default' aborted
735 unshelve of 'default' aborted
736 $ hg st
736 $ hg st
737 M a
737 M a
738 ? f.orig
738 ? f.orig
739 $ cat f.orig
739 $ cat f.orig
740 g
740 g
741 $ hg unshelve
741 $ hg unshelve
742 unshelving change 'default'
742 unshelving change 'default'
743 temporarily committing pending changes (restore with 'hg unshelve --abort')
743 temporarily committing pending changes (restore with 'hg unshelve --abort')
744 rebasing shelved changes
744 rebasing shelved changes
745 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
745 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
746 $ hg st
746 $ hg st
747 M a
747 M a
748 A f
748 A f
749 ? f.orig
749 ? f.orig
750
750
751 other committed changes - merge:
751 other committed changes - merge:
752
752
753 $ hg shelve f
753 $ hg shelve f
754 shelved as default
754 shelved as default
755 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
755 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
756 $ hg ci a -m 'intermediate other change'
756 $ hg ci a -m 'intermediate other change'
757 $ mv f.orig f
757 $ mv f.orig f
758 $ hg unshelve
758 $ hg unshelve
759 unshelving change 'default'
759 unshelving change 'default'
760 rebasing shelved changes
760 rebasing shelved changes
761 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
761 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
762 merging f
762 merging f
763 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
763 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
764 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
764 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
765 [1]
765 [1]
766 $ hg st
766 $ hg st
767 M f
767 M f
768 ? f.orig
768 ? f.orig
769 $ cat f
769 $ cat f
770 <<<<<<< dest: * - test: intermediate other change (glob)
770 <<<<<<< dest: * - test: intermediate other change (glob)
771 g
771 g
772 =======
772 =======
773 f
773 f
774 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
774 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
775 $ cat f.orig
775 $ cat f.orig
776 g
776 g
777 $ hg unshelve --abort
777 $ hg unshelve --abort
778 rebase aborted
778 rebase aborted
779 unshelve of 'default' aborted
779 unshelve of 'default' aborted
780 $ hg st
780 $ hg st
781 ? f.orig
781 ? f.orig
782 $ cat f.orig
782 $ cat f.orig
783 g
783 g
784 $ hg shelve --delete default
784 $ hg shelve --delete default
785
785
786 Recreate some conflict again
786 Recreate some conflict again
787
787
788 $ cd ../repo
788 $ cd ../repo
789 $ hg up -C -r 3
789 $ hg up -C -r 3
790 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
790 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
791 (leaving bookmark test)
791 (leaving bookmark test)
792 $ echo y >> a/a
792 $ echo y >> a/a
793 $ hg shelve
793 $ hg shelve
794 shelved as default
794 shelved as default
795 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 $ hg up test
796 $ hg up test
797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
798 (activating bookmark test)
798 (activating bookmark test)
799 $ hg bookmark
799 $ hg bookmark
800 * test 4:33f7f61e6c5e
800 * test 4:33f7f61e6c5e
801 $ hg unshelve
801 $ hg unshelve
802 unshelving change 'default'
802 unshelving change 'default'
803 rebasing shelved changes
803 rebasing shelved changes
804 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
804 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
805 merging a/a
805 merging a/a
806 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
806 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
807 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
807 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
808 [1]
808 [1]
809 $ hg bookmark
809 $ hg bookmark
810 test 4:33f7f61e6c5e
810 test 4:33f7f61e6c5e
811
811
812 Test that resolving all conflicts in one direction (so that the rebase
812 Test that resolving all conflicts in one direction (so that the rebase
813 is a no-op), works (issue4398)
813 is a no-op), works (issue4398)
814
814
815 $ hg revert -a -r .
815 $ hg revert -a -r .
816 reverting a/a (glob)
816 reverting a/a (glob)
817 $ hg resolve -m a/a
817 $ hg resolve -m a/a
818 (no more unresolved files)
818 (no more unresolved files)
819 $ hg unshelve -c
819 $ hg unshelve -c
820 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
820 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
821 note: rebase of 5:4b555fdb4e96 created no changes to commit
821 note: rebase of 5:4b555fdb4e96 created no changes to commit
822 unshelve of 'default' complete
822 unshelve of 'default' complete
823 $ hg bookmark
823 $ hg bookmark
824 * test 4:33f7f61e6c5e
824 * test 4:33f7f61e6c5e
825 $ hg diff
825 $ hg diff
826 $ hg status
826 $ hg status
827 ? a/a.orig
827 ? a/a.orig
828 ? foo/foo
828 ? foo/foo
829 $ hg summary
829 $ hg summary
830 parent: 4:33f7f61e6c5e tip
830 parent: 4:33f7f61e6c5e tip
831 create conflict
831 create conflict
832 branch: default
832 branch: default
833 bookmarks: *test
833 bookmarks: *test
834 commit: 2 unknown (clean)
834 commit: 2 unknown (clean)
835 update: (current)
835 update: (current)
836 phases: 5 draft
836 phases: 5 draft
837
837
838 $ hg shelve --delete --stat
838 $ hg shelve --delete --stat
839 abort: options '--delete' and '--stat' may not be used together
839 abort: options '--delete' and '--stat' may not be used together
840 [255]
840 [255]
841 $ hg shelve --delete --name NAME
841 $ hg shelve --delete --name NAME
842 abort: options '--delete' and '--name' may not be used together
842 abort: options '--delete' and '--name' may not be used together
843 [255]
843 [255]
844
844
845 Test interactive shelve
845 Test interactive shelve
846 $ cat <<EOF >> $HGRCPATH
846 $ cat <<EOF >> $HGRCPATH
847 > [ui]
847 > [ui]
848 > interactive = true
848 > interactive = true
849 > EOF
849 > EOF
850 $ echo 'a' >> a/b
850 $ echo 'a' >> a/b
851 $ cat a/a >> a/b
851 $ cat a/a >> a/b
852 $ echo 'x' >> a/b
852 $ echo 'x' >> a/b
853 $ mv a/b a/a
853 $ mv a/b a/a
854 $ echo 'a' >> foo/foo
854 $ echo 'a' >> foo/foo
855 $ hg st
855 $ hg st
856 M a/a
856 M a/a
857 ? a/a.orig
857 ? a/a.orig
858 ? foo/foo
858 ? foo/foo
859 $ cat a/a
859 $ cat a/a
860 a
860 a
861 a
861 a
862 c
862 c
863 x
863 x
864 x
864 x
865 $ cat foo/foo
865 $ cat foo/foo
866 foo
866 foo
867 a
867 a
868 $ hg shelve --interactive --config ui.interactive=false
868 $ hg shelve --interactive --config ui.interactive=false
869 abort: running non-interactively
869 abort: running non-interactively
870 [255]
870 [255]
871 $ hg shelve --interactive << EOF
871 $ hg shelve --interactive << EOF
872 > y
872 > y
873 > y
873 > y
874 > n
874 > n
875 > EOF
875 > EOF
876 diff --git a/a/a b/a/a
876 diff --git a/a/a b/a/a
877 2 hunks, 2 lines changed
877 2 hunks, 2 lines changed
878 examine changes to 'a/a'? [Ynesfdaq?] y
878 examine changes to 'a/a'? [Ynesfdaq?] y
879
879
880 @@ -1,3 +1,4 @@
880 @@ -1,3 +1,4 @@
881 +a
881 +a
882 a
882 a
883 c
883 c
884 x
884 x
885 record change 1/2 to 'a/a'? [Ynesfdaq?] y
885 record change 1/2 to 'a/a'? [Ynesfdaq?] y
886
886
887 @@ -1,3 +2,4 @@
887 @@ -1,3 +2,4 @@
888 a
888 a
889 c
889 c
890 x
890 x
891 +x
891 +x
892 record change 2/2 to 'a/a'? [Ynesfdaq?] n
892 record change 2/2 to 'a/a'? [Ynesfdaq?] n
893
893
894 shelved as test
894 shelved as test
895 merging a/a
895 merging a/a
896 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
896 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
897 $ cat a/a
897 $ cat a/a
898 a
898 a
899 c
899 c
900 x
900 x
901 x
901 x
902 $ cat foo/foo
902 $ cat foo/foo
903 foo
903 foo
904 a
904 a
905 $ hg st
905 $ hg st
906 M a/a
906 M a/a
907 ? foo/foo
907 ? foo/foo
908 $ hg bookmark
908 $ hg bookmark
909 * test 4:33f7f61e6c5e
909 * test 4:33f7f61e6c5e
910 $ hg unshelve
910 $ hg unshelve
911 unshelving change 'test'
911 unshelving change 'test'
912 temporarily committing pending changes (restore with 'hg unshelve --abort')
912 temporarily committing pending changes (restore with 'hg unshelve --abort')
913 rebasing shelved changes
913 rebasing shelved changes
914 rebasing 6:65b5d1c34c34 "changes to 'create conflict'" (tip)
914 rebasing 6:65b5d1c34c34 "changes to 'create conflict'" (tip)
915 merging a/a
915 merging a/a
916 $ hg bookmark
916 $ hg bookmark
917 * test 4:33f7f61e6c5e
917 * test 4:33f7f61e6c5e
918 $ cat a/a
918 $ cat a/a
919 a
919 a
920 a
920 a
921 c
921 c
922 x
922 x
923 x
923 x
924
924
925 shelve --patch and shelve --stat should work with a single valid shelfname
925 shelve --patch and shelve --stat should work with a single valid shelfname
926
926
927 $ hg up --clean .
927 $ hg up --clean .
928 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
929 (leaving bookmark test)
929 (leaving bookmark test)
930 $ hg shelve --list
930 $ hg shelve --list
931 $ echo 'patch a' > shelf-patch-a
931 $ echo 'patch a' > shelf-patch-a
932 $ hg add shelf-patch-a
932 $ hg add shelf-patch-a
933 $ hg shelve
933 $ hg shelve
934 shelved as default
934 shelved as default
935 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
935 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
936 $ echo 'patch b' > shelf-patch-b
936 $ echo 'patch b' > shelf-patch-b
937 $ hg add shelf-patch-b
937 $ hg add shelf-patch-b
938 $ hg shelve
938 $ hg shelve
939 shelved as default-01
939 shelved as default-01
940 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
940 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
941 $ hg shelve --patch default default-01
941 $ hg shelve --patch default default-01
942 abort: --patch expects a single shelf
942 abort: --patch expects a single shelf
943 [255]
943 [255]
944 $ hg shelve --stat default default-01
944 $ hg shelve --stat default default-01
945 abort: --stat expects a single shelf
945 abort: --stat expects a single shelf
946 [255]
946 [255]
947 $ hg shelve --patch default
947 $ hg shelve --patch default
948 default (* ago) changes to 'create conflict' (glob)
948 default (* ago) changes to 'create conflict' (glob)
949
949
950 diff --git a/shelf-patch-a b/shelf-patch-a
950 diff --git a/shelf-patch-a b/shelf-patch-a
951 new file mode 100644
951 new file mode 100644
952 --- /dev/null
952 --- /dev/null
953 +++ b/shelf-patch-a
953 +++ b/shelf-patch-a
954 @@ -0,0 +1,1 @@
954 @@ -0,0 +1,1 @@
955 +patch a
955 +patch a
956 $ hg shelve --stat default
956 $ hg shelve --stat default
957 default (* ago) changes to 'create conflict' (glob)
957 default (* ago) changes to 'create conflict' (glob)
958 shelf-patch-a | 1 +
958 shelf-patch-a | 1 +
959 1 files changed, 1 insertions(+), 0 deletions(-)
959 1 files changed, 1 insertions(+), 0 deletions(-)
960 $ hg shelve --patch nonexistentshelf
960 $ hg shelve --patch nonexistentshelf
961 abort: cannot find shelf nonexistentshelf
961 abort: cannot find shelf nonexistentshelf
962 [255]
962 [255]
963 $ hg shelve --stat nonexistentshelf
963 $ hg shelve --stat nonexistentshelf
964 abort: cannot find shelf nonexistentshelf
964 abort: cannot find shelf nonexistentshelf
965 [255]
965 [255]
966
966
967 $ cd ..
967 $ cd ..
968
968
969 Shelve from general delta repo uses bundle2 on disk
969 Shelve from general delta repo uses bundle2 on disk
970 --------------------------------------------------
970 --------------------------------------------------
971
971
972 no general delta
972 no general delta
973
973
974 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
974 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
975 requesting all changes
975 requesting all changes
976 adding changesets
976 adding changesets
977 adding manifests
977 adding manifests
978 adding file changes
978 adding file changes
979 added 5 changesets with 8 changes to 6 files
979 added 5 changesets with 8 changes to 6 files
980 updating to branch default
980 updating to branch default
981 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
981 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
982 $ cd bundle1
982 $ cd bundle1
983 $ echo babar > jungle
983 $ echo babar > jungle
984 $ hg add jungle
984 $ hg add jungle
985 $ hg shelve
985 $ hg shelve
986 shelved as default
986 shelved as default
987 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
987 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
988 $ hg debugbundle .hg/shelved/*.hg
988 $ hg debugbundle .hg/shelved/*.hg
989 7e30d8ac6f23cfc84330fd7e698730374615d21a
989 7e30d8ac6f23cfc84330fd7e698730374615d21a
990 $ cd ..
990 $ cd ..
991
991
992 with general delta
992 with general delta
993
993
994 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
994 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
995 requesting all changes
995 requesting all changes
996 adding changesets
996 adding changesets
997 adding manifests
997 adding manifests
998 adding file changes
998 adding file changes
999 added 5 changesets with 8 changes to 6 files
999 added 5 changesets with 8 changes to 6 files
1000 updating to branch default
1000 updating to branch default
1001 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1001 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1002 $ cd bundle2
1002 $ cd bundle2
1003 $ echo babar > jungle
1003 $ echo babar > jungle
1004 $ hg add jungle
1004 $ hg add jungle
1005 $ hg shelve
1005 $ hg shelve
1006 shelved as default
1006 shelved as default
1007 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1007 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1008 $ hg debugbundle .hg/shelved/*.hg
1008 $ hg debugbundle .hg/shelved/*.hg
1009 Stream params: {'Compression': 'BZ'}
1009 Stream params: {'Compression': 'BZ'}
1010 changegroup -- "{'version': '02'}"
1010 changegroup -- "{'version': '02'}"
1011 7e30d8ac6f23cfc84330fd7e698730374615d21a
1011 7e30d8ac6f23cfc84330fd7e698730374615d21a
1012 $ cd ..
1012 $ cd ..
1013
1013
1014 Test visibility of in-memory changes inside transaction to external hook
1014 Test visibility of in-memory changes inside transaction to external hook
1015 ------------------------------------------------------------------------
1015 ------------------------------------------------------------------------
1016
1016
1017 $ cd repo
1017 $ cd repo
1018
1018
1019 $ echo xxxx >> x
1019 $ echo xxxx >> x
1020 $ hg commit -m "#5: changes to invoke rebase"
1020 $ hg commit -m "#5: changes to invoke rebase"
1021
1021
1022 $ cat > $TESTTMP/checkvisibility.sh <<EOF
1022 $ cat > $TESTTMP/checkvisibility.sh <<EOF
1023 > echo "==== \$1:"
1023 > echo "==== \$1:"
1024 > hg parents --template "VISIBLE {rev}:{node|short}\n"
1024 > hg parents --template "VISIBLE {rev}:{node|short}\n"
1025 > # test that pending changes are hidden
1025 > # test that pending changes are hidden
1026 > unset HG_PENDING
1026 > unset HG_PENDING
1027 > hg parents --template "ACTUAL {rev}:{node|short}\n"
1027 > hg parents --template "ACTUAL {rev}:{node|short}\n"
1028 > echo "===="
1028 > echo "===="
1029 > EOF
1029 > EOF
1030
1030
1031 $ cat >> .hg/hgrc <<EOF
1031 $ cat >> .hg/hgrc <<EOF
1032 > [defaults]
1032 > [defaults]
1033 > # to fix hash id of temporary revisions
1033 > # to fix hash id of temporary revisions
1034 > unshelve = --date '0 0'
1034 > unshelve = --date '0 0'
1035 > EOF
1035 > EOF
1036
1036
1037 "hg unshelve" at REV5 implies steps below:
1037 "hg unshelve" at REV5 implies steps below:
1038
1038
1039 (1) commit changes in the working directory (REV6)
1039 (1) commit changes in the working directory (REV6)
1040 (2) unbundle shelved revision (REV7)
1040 (2) unbundle shelved revision (REV7)
1041 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
1041 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
1042 (4) rebase: commit merged revision (REV8)
1042 (4) rebase: commit merged revision (REV8)
1043 (5) rebase: update to REV6 (REV8 => REV6)
1043 (5) rebase: update to REV6 (REV8 => REV6)
1044 (6) update to REV5 (REV6 => REV5)
1044 (6) update to REV5 (REV6 => REV5)
1045 (7) abort transaction
1045 (7) abort transaction
1046
1046
1047 == test visibility to external preupdate hook
1047 == test visibility to external preupdate hook
1048
1048
1049 $ cat >> .hg/hgrc <<EOF
1049 $ cat >> .hg/hgrc <<EOF
1050 > [hooks]
1050 > [hooks]
1051 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
1051 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
1052 > EOF
1052 > EOF
1053
1053
1054 $ echo nnnn >> n
1054 $ echo nnnn >> n
1055
1055
1056 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1056 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1057 ==== before-unshelving:
1057 ==== before-unshelving:
1058 VISIBLE 5:703117a2acfb
1058 VISIBLE 5:703117a2acfb
1059 ACTUAL 5:703117a2acfb
1059 ACTUAL 5:703117a2acfb
1060 ====
1060 ====
1061
1061
1062 $ hg unshelve --keep default
1062 $ hg unshelve --keep default
1063 temporarily committing pending changes (restore with 'hg unshelve --abort')
1063 temporarily committing pending changes (restore with 'hg unshelve --abort')
1064 rebasing shelved changes
1064 rebasing shelved changes
1065 rebasing 7:fcbb97608399 "changes to 'create conflict'" (tip)
1065 rebasing 7:fcbb97608399 "changes to 'create conflict'" (tip)
1066 ==== preupdate:
1066 ==== preupdate:
1067 VISIBLE 6:66b86db80ee4
1067 VISIBLE 6:66b86db80ee4
1068 ACTUAL 5:703117a2acfb
1068 ACTUAL 5:703117a2acfb
1069 ====
1069 ====
1070 ==== preupdate:
1070 ==== preupdate:
1071 VISIBLE 8:cb2a4e59c2d5
1071 VISIBLE 8:cb2a4e59c2d5
1072 ACTUAL 5:703117a2acfb
1072 ACTUAL 5:703117a2acfb
1073 ====
1073 ====
1074 ==== preupdate:
1074 ==== preupdate:
1075 VISIBLE 6:66b86db80ee4
1075 VISIBLE 6:66b86db80ee4
1076 ACTUAL 5:703117a2acfb
1076 ACTUAL 5:703117a2acfb
1077 ====
1077 ====
1078
1078
1079 $ cat >> .hg/hgrc <<EOF
1079 $ cat >> .hg/hgrc <<EOF
1080 > [hooks]
1080 > [hooks]
1081 > preupdate.visibility =
1081 > preupdate.visibility =
1082 > EOF
1082 > EOF
1083
1083
1084 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1084 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1085 ==== after-unshelving:
1085 ==== after-unshelving:
1086 VISIBLE 5:703117a2acfb
1086 VISIBLE 5:703117a2acfb
1087 ACTUAL 5:703117a2acfb
1087 ACTUAL 5:703117a2acfb
1088 ====
1088 ====
1089
1089
1090 == test visibility to external update hook
1090 == test visibility to external update hook
1091
1091
1092 $ hg update -q -C 5
1092 $ hg update -q -C 5
1093
1093
1094 $ cat >> .hg/hgrc <<EOF
1094 $ cat >> .hg/hgrc <<EOF
1095 > [hooks]
1095 > [hooks]
1096 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1096 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1097 > EOF
1097 > EOF
1098
1098
1099 $ echo nnnn >> n
1099 $ echo nnnn >> n
1100
1100
1101 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1101 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1102 ==== before-unshelving:
1102 ==== before-unshelving:
1103 VISIBLE 5:703117a2acfb
1103 VISIBLE 5:703117a2acfb
1104 ACTUAL 5:703117a2acfb
1104 ACTUAL 5:703117a2acfb
1105 ====
1105 ====
1106
1106
1107 $ hg unshelve --keep default
1107 $ hg unshelve --keep default
1108 temporarily committing pending changes (restore with 'hg unshelve --abort')
1108 temporarily committing pending changes (restore with 'hg unshelve --abort')
1109 rebasing shelved changes
1109 rebasing shelved changes
1110 rebasing 7:fcbb97608399 "changes to 'create conflict'" (tip)
1110 rebasing 7:fcbb97608399 "changes to 'create conflict'" (tip)
1111 ==== update:
1111 ==== update:
1112 VISIBLE 6:66b86db80ee4
1112 VISIBLE 6:66b86db80ee4
1113 VISIBLE 7:fcbb97608399
1113 VISIBLE 7:fcbb97608399
1114 ACTUAL 5:703117a2acfb
1114 ACTUAL 5:703117a2acfb
1115 ====
1115 ====
1116 ==== update:
1116 ==== update:
1117 VISIBLE 6:66b86db80ee4
1117 VISIBLE 6:66b86db80ee4
1118 ACTUAL 5:703117a2acfb
1118 ACTUAL 5:703117a2acfb
1119 ====
1119 ====
1120 ==== update:
1120 ==== update:
1121 VISIBLE 5:703117a2acfb
1121 VISIBLE 5:703117a2acfb
1122 ACTUAL 5:703117a2acfb
1122 ACTUAL 5:703117a2acfb
1123 ====
1123 ====
1124
1124
1125 $ cat >> .hg/hgrc <<EOF
1125 $ cat >> .hg/hgrc <<EOF
1126 > [hooks]
1126 > [hooks]
1127 > update.visibility =
1127 > update.visibility =
1128 > EOF
1128 > EOF
1129
1129
1130 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1130 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1131 ==== after-unshelving:
1131 ==== after-unshelving:
1132 VISIBLE 5:703117a2acfb
1132 VISIBLE 5:703117a2acfb
1133 ACTUAL 5:703117a2acfb
1133 ACTUAL 5:703117a2acfb
1134 ====
1134 ====
1135
1135
1136 $ cd ..
1136 $ cd ..
1137
1137
1138 test .orig files go where the user wants them to
1138 test .orig files go where the user wants them to
1139 ---------------------------------------------------------------
1139 ---------------------------------------------------------------
1140 $ hg init salvage
1140 $ hg init salvage
1141 $ cd salvage
1141 $ cd salvage
1142 $ echo 'content' > root
1142 $ echo 'content' > root
1143 $ hg commit -A -m 'root' -q
1143 $ hg commit -A -m 'root' -q
1144 $ echo '' > root
1144 $ echo '' > root
1145 $ hg shelve -q
1145 $ hg shelve -q
1146 $ echo 'contADDent' > root
1146 $ echo 'contADDent' > root
1147 $ hg unshelve -q --config 'ui.origbackuppath=.hg/origbackups'
1147 $ hg unshelve -q --config 'ui.origbackuppath=.hg/origbackups'
1148 warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
1148 warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
1149 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1149 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1150 [1]
1150 [1]
1151 $ ls .hg/origbackups
1151 $ ls .hg/origbackups
1152 root.orig
1152 root.orig
1153 $ rm -rf .hg/origbackups
1153 $ rm -rf .hg/origbackups
1154
1154
1155 test Abort unshelve always gets user out of the unshelved state
1155 test Abort unshelve always gets user out of the unshelved state
1156 ---------------------------------------------------------------
1156 ---------------------------------------------------------------
1157 Wreak havoc on the unshelve process
1157 Wreak havoc on the unshelve process
1158 $ rm .hg/unshelverebasestate
1158 $ rm .hg/unshelverebasestate
1159 $ hg unshelve --abort
1159 $ hg unshelve --abort
1160 unshelve of 'default' aborted
1160 unshelve of 'default' aborted
1161 abort: No such file or directory
1161 abort: (No such file or directory|The system cannot find the file specified) (re)
1162 [255]
1162 [255]
1163 Can the user leave the current state?
1163 Can the user leave the current state?
1164 $ hg up -C .
1164 $ hg up -C .
1165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1166
1166
1167 Try again but with a corrupted shelve state file
1167 Try again but with a corrupted shelve state file
1168 $ hg strip -r 2 -r 1 -q
1168 $ hg strip -r 2 -r 1 -q
1169 $ hg up -r 0 -q
1169 $ hg up -r 0 -q
1170 $ echo '' > root
1170 $ echo '' > root
1171 $ hg shelve -q
1171 $ hg shelve -q
1172 $ echo 'contADDent' > root
1172 $ echo 'contADDent' > root
1173 $ hg unshelve -q
1173 $ hg unshelve -q
1174 warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
1174 warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
1175 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1175 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1176 [1]
1176 [1]
1177 $ sed 's/ae8c668541e8/123456789012/' .hg/shelvedstate > ../corrupt-shelvedstate
1177 $ sed 's/ae8c668541e8/123456789012/' .hg/shelvedstate > ../corrupt-shelvedstate
1178 $ mv ../corrupt-shelvedstate .hg/histedit-state
1178 $ mv ../corrupt-shelvedstate .hg/histedit-state
1179 $ hg unshelve --abort 2>&1 | grep 'rebase aborted'
1179 $ hg unshelve --abort 2>&1 | grep 'rebase aborted'
1180 rebase aborted
1180 rebase aborted
1181 $ hg up -C .
1181 $ hg up -C .
1182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1183
1183
1184 $ cd ..
1184 $ cd ..
1185
1185
1186 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1186 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1187 -----------------------------------------------------------------------
1187 -----------------------------------------------------------------------
1188
1188
1189 $ cat <<EOF >> $HGRCPATH
1189 $ cat <<EOF >> $HGRCPATH
1190 > [extensions]
1190 > [extensions]
1191 > share =
1191 > share =
1192 > EOF
1192 > EOF
1193
1193
1194 $ hg bookmarks -R repo
1194 $ hg bookmarks -R repo
1195 test 4:33f7f61e6c5e
1195 test 4:33f7f61e6c5e
1196 $ hg share -B repo share
1196 $ hg share -B repo share
1197 updating working directory
1197 updating working directory
1198 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1198 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1199 $ cd share
1199 $ cd share
1200
1200
1201 $ hg bookmarks
1201 $ hg bookmarks
1202 test 4:33f7f61e6c5e
1202 test 4:33f7f61e6c5e
1203 $ hg bookmarks foo
1203 $ hg bookmarks foo
1204 $ hg bookmarks
1204 $ hg bookmarks
1205 * foo 5:703117a2acfb
1205 * foo 5:703117a2acfb
1206 test 4:33f7f61e6c5e
1206 test 4:33f7f61e6c5e
1207 $ echo x >> x
1207 $ echo x >> x
1208 $ hg shelve
1208 $ hg shelve
1209 shelved as foo
1209 shelved as foo
1210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1211 $ hg bookmarks
1211 $ hg bookmarks
1212 * foo 5:703117a2acfb
1212 * foo 5:703117a2acfb
1213 test 4:33f7f61e6c5e
1213 test 4:33f7f61e6c5e
1214
1214
1215 $ hg unshelve
1215 $ hg unshelve
1216 unshelving change 'foo'
1216 unshelving change 'foo'
1217 $ hg bookmarks
1217 $ hg bookmarks
1218 * foo 5:703117a2acfb
1218 * foo 5:703117a2acfb
1219 test 4:33f7f61e6c5e
1219 test 4:33f7f61e6c5e
1220
1220
1221 $ cd ..
1221 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now