##// END OF EJS Templates
repoview: do not crash when localtags refers to non existing revisions...
Angel Ezquerra -
r21823:925d1bb9 stable
parent child Browse files
Show More
@@ -1,312 +1,321 b''
1 1 # tags.py - read tag info from local repository
2 2 #
3 3 # Copyright 2009 Matt Mackall <mpm@selenic.com>
4 4 # Copyright 2009 Greg Ward <greg@gerg.ca>
5 5 #
6 6 # This software may be used and distributed according to the terms of the
7 7 # GNU General Public License version 2 or any later version.
8 8
9 9 # Currently this module only deals with reading and caching tags.
10 10 # Eventually, it could take care of updating (adding/removing/moving)
11 11 # tags too.
12 12
13 13 from node import nullid, bin, hex, short
14 14 from i18n import _
15 15 import encoding
16 16 import error
17 17 import errno
18 18 import time
19 19
20 20 def findglobaltags(ui, repo, alltags, tagtypes):
21 21 '''Find global tags in repo by reading .hgtags from every head that
22 22 has a distinct version of it, using a cache to avoid excess work.
23 23 Updates the dicts alltags, tagtypes in place: alltags maps tag name
24 24 to (node, hist) pair (see _readtags() below), and tagtypes maps tag
25 25 name to tag type ("global" in this case).'''
26 26 # This is so we can be lazy and assume alltags contains only global
27 27 # tags when we pass it to _writetagcache().
28 28 assert len(alltags) == len(tagtypes) == 0, \
29 29 "findglobaltags() should be called first"
30 30
31 31 (heads, tagfnode, cachetags, shouldwrite) = _readtagcache(ui, repo)
32 32 if cachetags is not None:
33 33 assert not shouldwrite
34 34 # XXX is this really 100% correct? are there oddball special
35 35 # cases where a global tag should outrank a local tag but won't,
36 36 # because cachetags does not contain rank info?
37 37 _updatetags(cachetags, 'global', alltags, tagtypes)
38 38 return
39 39
40 40 seen = set() # set of fnode
41 41 fctx = None
42 42 for head in reversed(heads): # oldest to newest
43 43 assert head in repo.changelog.nodemap, \
44 44 "tag cache returned bogus head %s" % short(head)
45 45
46 46 fnode = tagfnode.get(head)
47 47 if fnode and fnode not in seen:
48 48 seen.add(fnode)
49 49 if not fctx:
50 50 fctx = repo.filectx('.hgtags', fileid=fnode)
51 51 else:
52 52 fctx = fctx.filectx(fnode)
53 53
54 54 filetags = _readtags(ui, repo, fctx.data().splitlines(), fctx)
55 55 _updatetags(filetags, 'global', alltags, tagtypes)
56 56
57 57 # and update the cache (if necessary)
58 58 if shouldwrite:
59 59 _writetagcache(ui, repo, heads, tagfnode, alltags)
60 60
61 61 def readlocaltags(ui, repo, alltags, tagtypes):
62 62 '''Read local tags in repo. Update alltags and tagtypes.'''
63 63 try:
64 64 data = repo.opener.read("localtags")
65 65 except IOError, inst:
66 66 if inst.errno != errno.ENOENT:
67 67 raise
68 68 return
69 69
70 70 # localtags is in the local encoding; re-encode to UTF-8 on
71 71 # input for consistency with the rest of this module.
72 72 filetags = _readtags(
73 73 ui, repo, data.splitlines(), "localtags",
74 74 recode=encoding.fromlocal)
75
76 # remove tags pointing to invalid nodes
77 cl = repo.changelog
78 for t in filetags.keys():
79 try:
80 cl.rev(filetags[t][0])
81 except (LookupError, ValueError):
82 del filetags[t]
83
75 84 _updatetags(filetags, "local", alltags, tagtypes)
76 85
77 86 def _readtags(ui, repo, lines, fn, recode=None):
78 87 '''Read tag definitions from a file (or any source of lines).
79 88 Return a mapping from tag name to (node, hist): node is the node id
80 89 from the last line read for that name, and hist is the list of node
81 90 ids previously associated with it (in file order). All node ids are
82 91 binary, not hex.'''
83 92
84 93 filetags = {} # map tag name to (node, hist)
85 94 count = 0
86 95
87 96 def warn(msg):
88 97 ui.warn(_("%s, line %s: %s\n") % (fn, count, msg))
89 98
90 99 for line in lines:
91 100 count += 1
92 101 if not line:
93 102 continue
94 103 try:
95 104 (nodehex, name) = line.split(" ", 1)
96 105 except ValueError:
97 106 warn(_("cannot parse entry"))
98 107 continue
99 108 name = name.strip()
100 109 if recode:
101 110 name = recode(name)
102 111 try:
103 112 nodebin = bin(nodehex)
104 113 except TypeError:
105 114 warn(_("node '%s' is not well formed") % nodehex)
106 115 continue
107 116
108 117 # update filetags
109 118 hist = []
110 119 if name in filetags:
111 120 n, hist = filetags[name]
112 121 hist.append(n)
113 122 filetags[name] = (nodebin, hist)
114 123 return filetags
115 124
116 125 def _updatetags(filetags, tagtype, alltags, tagtypes):
117 126 '''Incorporate the tag info read from one file into the two
118 127 dictionaries, alltags and tagtypes, that contain all tag
119 128 info (global across all heads plus local).'''
120 129
121 130 for name, nodehist in filetags.iteritems():
122 131 if name not in alltags:
123 132 alltags[name] = nodehist
124 133 tagtypes[name] = tagtype
125 134 continue
126 135
127 136 # we prefer alltags[name] if:
128 137 # it supersedes us OR
129 138 # mutual supersedes and it has a higher rank
130 139 # otherwise we win because we're tip-most
131 140 anode, ahist = nodehist
132 141 bnode, bhist = alltags[name]
133 142 if (bnode != anode and anode in bhist and
134 143 (bnode not in ahist or len(bhist) > len(ahist))):
135 144 anode = bnode
136 145 else:
137 146 tagtypes[name] = tagtype
138 147 ahist.extend([n for n in bhist if n not in ahist])
139 148 alltags[name] = anode, ahist
140 149
141 150
142 151 # The tag cache only stores info about heads, not the tag contents
143 152 # from each head. I.e. it doesn't try to squeeze out the maximum
144 153 # performance, but is simpler has a better chance of actually
145 154 # working correctly. And this gives the biggest performance win: it
146 155 # avoids looking up .hgtags in the manifest for every head, and it
147 156 # can avoid calling heads() at all if there have been no changes to
148 157 # the repo.
149 158
150 159 def _readtagcache(ui, repo):
151 160 '''Read the tag cache and return a tuple (heads, fnodes, cachetags,
152 161 shouldwrite). If the cache is completely up-to-date, cachetags is a
153 162 dict of the form returned by _readtags(); otherwise, it is None and
154 163 heads and fnodes are set. In that case, heads is the list of all
155 164 heads currently in the repository (ordered from tip to oldest) and
156 165 fnodes is a mapping from head to .hgtags filenode. If those two are
157 166 set, caller is responsible for reading tag info from each head.'''
158 167
159 168 try:
160 169 cachefile = repo.opener('cache/tags', 'r')
161 170 # force reading the file for static-http
162 171 cachelines = iter(cachefile)
163 172 except IOError:
164 173 cachefile = None
165 174
166 175 # The cache file consists of lines like
167 176 # <headrev> <headnode> [<tagnode>]
168 177 # where <headrev> and <headnode> redundantly identify a repository
169 178 # head from the time the cache was written, and <tagnode> is the
170 179 # filenode of .hgtags on that head. Heads with no .hgtags file will
171 180 # have no <tagnode>. The cache is ordered from tip to oldest (which
172 181 # is part of why <headrev> is there: a quick visual check is all
173 182 # that's required to ensure correct order).
174 183 #
175 184 # This information is enough to let us avoid the most expensive part
176 185 # of finding global tags, which is looking up <tagnode> in the
177 186 # manifest for each head.
178 187 cacherevs = [] # list of headrev
179 188 cacheheads = [] # list of headnode
180 189 cachefnode = {} # map headnode to filenode
181 190 if cachefile:
182 191 try:
183 192 for line in cachelines:
184 193 if line == "\n":
185 194 break
186 195 line = line.split()
187 196 cacherevs.append(int(line[0]))
188 197 headnode = bin(line[1])
189 198 cacheheads.append(headnode)
190 199 if len(line) == 3:
191 200 fnode = bin(line[2])
192 201 cachefnode[headnode] = fnode
193 202 except Exception:
194 203 # corruption of the tags cache, just recompute it
195 204 ui.warn(_('.hg/cache/tags is corrupt, rebuilding it\n'))
196 205 cacheheads = []
197 206 cacherevs = []
198 207 cachefnode = {}
199 208
200 209 tipnode = repo.changelog.tip()
201 210 tiprev = len(repo.changelog) - 1
202 211
203 212 # Case 1 (common): tip is the same, so nothing has changed.
204 213 # (Unchanged tip trivially means no changesets have been added.
205 214 # But, thanks to localrepository.destroyed(), it also means none
206 215 # have been destroyed by strip or rollback.)
207 216 if cacheheads and cacheheads[0] == tipnode and cacherevs[0] == tiprev:
208 217 tags = _readtags(ui, repo, cachelines, cachefile.name)
209 218 cachefile.close()
210 219 return (None, None, tags, False)
211 220 if cachefile:
212 221 cachefile.close() # ignore rest of file
213 222
214 223 repoheads = repo.heads()
215 224 # Case 2 (uncommon): empty repo; get out quickly and don't bother
216 225 # writing an empty cache.
217 226 if repoheads == [nullid]:
218 227 return ([], {}, {}, False)
219 228
220 229 # Case 3 (uncommon): cache file missing or empty.
221 230
222 231 # Case 4 (uncommon): tip rev decreased. This should only happen
223 232 # when we're called from localrepository.destroyed(). Refresh the
224 233 # cache so future invocations will not see disappeared heads in the
225 234 # cache.
226 235
227 236 # Case 5 (common): tip has changed, so we've added/replaced heads.
228 237
229 238 # As it happens, the code to handle cases 3, 4, 5 is the same.
230 239
231 240 # N.B. in case 4 (nodes destroyed), "new head" really means "newly
232 241 # exposed".
233 242 if not len(repo.file('.hgtags')):
234 243 # No tags have ever been committed, so we can avoid a
235 244 # potentially expensive search.
236 245 return (repoheads, cachefnode, None, True)
237 246
238 247 starttime = time.time()
239 248
240 249 newheads = [head
241 250 for head in repoheads
242 251 if head not in set(cacheheads)]
243 252
244 253 # Now we have to lookup the .hgtags filenode for every new head.
245 254 # This is the most expensive part of finding tags, so performance
246 255 # depends primarily on the size of newheads. Worst case: no cache
247 256 # file, so newheads == repoheads.
248 257 for head in reversed(newheads):
249 258 cctx = repo[head]
250 259 try:
251 260 fnode = cctx.filenode('.hgtags')
252 261 cachefnode[head] = fnode
253 262 except error.LookupError:
254 263 # no .hgtags file on this head
255 264 pass
256 265
257 266 duration = time.time() - starttime
258 267 ui.log('tagscache',
259 268 'resolved %d tags cache entries from %d manifests in %0.4f '
260 269 'seconds\n',
261 270 len(cachefnode), len(newheads), duration)
262 271
263 272 # Caller has to iterate over all heads, but can use the filenodes in
264 273 # cachefnode to get to each .hgtags revision quickly.
265 274 return (repoheads, cachefnode, None, True)
266 275
267 276 def _writetagcache(ui, repo, heads, tagfnode, cachetags):
268 277
269 278 try:
270 279 cachefile = repo.opener('cache/tags', 'w', atomictemp=True)
271 280 except (OSError, IOError):
272 281 return
273 282
274 283 ui.log('tagscache', 'writing tags cache file with %d heads and %d tags\n',
275 284 len(heads), len(cachetags))
276 285
277 286 realheads = repo.heads() # for sanity checks below
278 287 for head in heads:
279 288 # temporary sanity checks; these can probably be removed
280 289 # once this code has been in crew for a few weeks
281 290 assert head in repo.changelog.nodemap, \
282 291 'trying to write non-existent node %s to tag cache' % short(head)
283 292 assert head in realheads, \
284 293 'trying to write non-head %s to tag cache' % short(head)
285 294 assert head != nullid, \
286 295 'trying to write nullid to tag cache'
287 296
288 297 # This can't fail because of the first assert above. When/if we
289 298 # remove that assert, we might want to catch LookupError here
290 299 # and downgrade it to a warning.
291 300 rev = repo.changelog.rev(head)
292 301
293 302 fnode = tagfnode.get(head)
294 303 if fnode:
295 304 cachefile.write('%d %s %s\n' % (rev, hex(head), hex(fnode)))
296 305 else:
297 306 cachefile.write('%d %s\n' % (rev, hex(head)))
298 307
299 308 # Tag names in the cache are in UTF-8 -- which is the whole reason
300 309 # we keep them in UTF-8 throughout this module. If we converted
301 310 # them local encoding on input, we would lose info writing them to
302 311 # the cache.
303 312 cachefile.write('\n')
304 313 for (name, (node, hist)) in cachetags.iteritems():
305 314 for n in hist:
306 315 cachefile.write("%s %s\n" % (hex(n), name))
307 316 cachefile.write("%s %s\n" % (hex(node), name))
308 317
309 318 try:
310 319 cachefile.close()
311 320 except (OSError, IOError):
312 321 pass
@@ -1,909 +1,921 b''
1 1 $ cat >> $HGRCPATH << EOF
2 2 > [phases]
3 3 > # public changeset are not obsolete
4 4 > publish=false
5 5 > EOF
6 6 $ mkcommit() {
7 7 > echo "$1" > "$1"
8 8 > hg add "$1"
9 9 > hg ci -m "add $1"
10 10 > }
11 11 $ getid() {
12 12 > hg id --debug --hidden -ir "desc('$1')"
13 13 > }
14 14
15 15 $ cat > debugkeys.py <<EOF
16 16 > def reposetup(ui, repo):
17 17 > class debugkeysrepo(repo.__class__):
18 18 > def listkeys(self, namespace):
19 19 > ui.write('listkeys %s\n' % (namespace,))
20 20 > return super(debugkeysrepo, self).listkeys(namespace)
21 21 >
22 22 > if repo.local():
23 23 > repo.__class__ = debugkeysrepo
24 24 > EOF
25 25
26 26 $ hg init tmpa
27 27 $ cd tmpa
28 28 $ mkcommit kill_me
29 29
30 30 Checking that the feature is properly disabled
31 31
32 32 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
33 33 abort: obsolete feature is not enabled on this repo
34 34 [255]
35 35
36 36 Enabling it
37 37
38 38 $ cat > ../obs.py << EOF
39 39 > import mercurial.obsolete
40 40 > mercurial.obsolete._enabled = True
41 41 > EOF
42 42 $ echo '[extensions]' >> $HGRCPATH
43 43 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
44 44
45 45 Killing a single changeset without replacement
46 46
47 47 $ hg debugobsolete 0
48 48 abort: changeset references must be full hexadecimal node identifiers
49 49 [255]
50 50 $ hg debugobsolete '00'
51 51 abort: changeset references must be full hexadecimal node identifiers
52 52 [255]
53 53 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
54 54 $ hg debugobsolete
55 55 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
56 56
57 57 (test that mercurial is not confused)
58 58
59 59 $ hg up null --quiet # having 0 as parent prevents it to be hidden
60 60 $ hg tip
61 61 changeset: -1:000000000000
62 62 tag: tip
63 63 user:
64 64 date: Thu Jan 01 00:00:00 1970 +0000
65 65
66 66 $ hg up --hidden tip --quiet
67 67 $ cd ..
68 68
69 69 Killing a single changeset with replacement
70 70
71 71 $ hg init tmpb
72 72 $ cd tmpb
73 73 $ mkcommit a
74 74 $ mkcommit b
75 75 $ mkcommit original_c
76 76 $ hg up "desc('b')"
77 77 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
78 78 $ mkcommit new_c
79 79 created new head
80 80 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
81 81 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
82 82 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
83 83 2:245bde4270cd add original_c
84 84 $ hg debugrevlog -cd
85 85 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads
86 86 0 -1 -1 0 59 0 0 0 0 58 58 0 1
87 87 1 0 -1 59 118 59 59 0 0 58 116 0 1
88 88 2 1 -1 118 204 59 59 59 0 76 192 0 1
89 89 3 1 -1 204 271 204 204 59 0 66 258 0 2
90 90 $ hg debugobsolete
91 91 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
92 92
93 93 do it again (it read the obsstore before adding new changeset)
94 94
95 95 $ hg up '.^'
96 96 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
97 97 $ mkcommit new_2_c
98 98 created new head
99 99 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
100 100 $ hg debugobsolete
101 101 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
102 102 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
103 103
104 104 Register two markers with a missing node
105 105
106 106 $ hg up '.^'
107 107 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
108 108 $ mkcommit new_3_c
109 109 created new head
110 110 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
111 111 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
112 112 $ hg debugobsolete
113 113 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
114 114 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
115 115 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
116 116 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
117 117
118 118 Refuse pathological nullid successors
119 119 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
120 120 transaction abort!
121 121 rollback completed
122 122 abort: bad obsolescence marker detected: invalid successors nullid
123 123 [255]
124 124
125 125 Check that graphlog detect that a changeset is obsolete:
126 126
127 127 $ hg log -G
128 128 @ changeset: 5:5601fb93a350
129 129 | tag: tip
130 130 | parent: 1:7c3bad9141dc
131 131 | user: test
132 132 | date: Thu Jan 01 00:00:00 1970 +0000
133 133 | summary: add new_3_c
134 134 |
135 135 o changeset: 1:7c3bad9141dc
136 136 | user: test
137 137 | date: Thu Jan 01 00:00:00 1970 +0000
138 138 | summary: add b
139 139 |
140 140 o changeset: 0:1f0dee641bb7
141 141 user: test
142 142 date: Thu Jan 01 00:00:00 1970 +0000
143 143 summary: add a
144 144
145 145
146 146 check that heads does not report them
147 147
148 148 $ hg heads
149 149 changeset: 5:5601fb93a350
150 150 tag: tip
151 151 parent: 1:7c3bad9141dc
152 152 user: test
153 153 date: Thu Jan 01 00:00:00 1970 +0000
154 154 summary: add new_3_c
155 155
156 156 $ hg heads --hidden
157 157 changeset: 5:5601fb93a350
158 158 tag: tip
159 159 parent: 1:7c3bad9141dc
160 160 user: test
161 161 date: Thu Jan 01 00:00:00 1970 +0000
162 162 summary: add new_3_c
163 163
164 164 changeset: 4:ca819180edb9
165 165 parent: 1:7c3bad9141dc
166 166 user: test
167 167 date: Thu Jan 01 00:00:00 1970 +0000
168 168 summary: add new_2_c
169 169
170 170 changeset: 3:cdbce2fbb163
171 171 parent: 1:7c3bad9141dc
172 172 user: test
173 173 date: Thu Jan 01 00:00:00 1970 +0000
174 174 summary: add new_c
175 175
176 176 changeset: 2:245bde4270cd
177 177 user: test
178 178 date: Thu Jan 01 00:00:00 1970 +0000
179 179 summary: add original_c
180 180
181 181
182 182
183 183 check that summary does not report them
184 184
185 185 $ hg init ../sink
186 186 $ echo '[paths]' >> .hg/hgrc
187 187 $ echo 'default=../sink' >> .hg/hgrc
188 188 $ hg summary --remote
189 189 parent: 5:5601fb93a350 tip
190 190 add new_3_c
191 191 branch: default
192 192 commit: (clean)
193 193 update: (current)
194 194 remote: 3 outgoing
195 195
196 196 $ hg summary --remote --hidden
197 197 parent: 5:5601fb93a350 tip
198 198 add new_3_c
199 199 branch: default
200 200 commit: (clean)
201 201 update: 3 new changesets, 4 branch heads (merge)
202 202 remote: 3 outgoing
203 203
204 204 check that various commands work well with filtering
205 205
206 206 $ hg tip
207 207 changeset: 5:5601fb93a350
208 208 tag: tip
209 209 parent: 1:7c3bad9141dc
210 210 user: test
211 211 date: Thu Jan 01 00:00:00 1970 +0000
212 212 summary: add new_3_c
213 213
214 214 $ hg log -r 6
215 215 abort: unknown revision '6'!
216 216 [255]
217 217 $ hg log -r 4
218 218 abort: unknown revision '4'!
219 219 [255]
220 220
221 221 Check that public changeset are not accounted as obsolete:
222 222
223 223 $ hg --hidden phase --public 2
224 224 $ hg log -G
225 225 @ changeset: 5:5601fb93a350
226 226 | tag: tip
227 227 | parent: 1:7c3bad9141dc
228 228 | user: test
229 229 | date: Thu Jan 01 00:00:00 1970 +0000
230 230 | summary: add new_3_c
231 231 |
232 232 | o changeset: 2:245bde4270cd
233 233 |/ user: test
234 234 | date: Thu Jan 01 00:00:00 1970 +0000
235 235 | summary: add original_c
236 236 |
237 237 o changeset: 1:7c3bad9141dc
238 238 | user: test
239 239 | date: Thu Jan 01 00:00:00 1970 +0000
240 240 | summary: add b
241 241 |
242 242 o changeset: 0:1f0dee641bb7
243 243 user: test
244 244 date: Thu Jan 01 00:00:00 1970 +0000
245 245 summary: add a
246 246
247 247
248 248 And that bumped changeset are detected
249 249 --------------------------------------
250 250
251 251 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
252 252 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
253 253 the public changeset
254 254
255 255 $ hg log --hidden -r 'bumped()'
256 256 changeset: 5:5601fb93a350
257 257 tag: tip
258 258 parent: 1:7c3bad9141dc
259 259 user: test
260 260 date: Thu Jan 01 00:00:00 1970 +0000
261 261 summary: add new_3_c
262 262
263 263
264 264 And that we can't push bumped changeset
265 265
266 266 $ hg push ../tmpa -r 0 --force #(make repo related)
267 267 pushing to ../tmpa
268 268 searching for changes
269 269 warning: repository is unrelated
270 270 adding changesets
271 271 adding manifests
272 272 adding file changes
273 273 added 1 changesets with 1 changes to 1 files (+1 heads)
274 274 $ hg push ../tmpa
275 275 pushing to ../tmpa
276 276 searching for changes
277 277 abort: push includes bumped changeset: 5601fb93a350!
278 278 [255]
279 279
280 280 Fixing "bumped" situation
281 281 We need to create a clone of 5 and add a special marker with a flag
282 282
283 283 $ hg up '5^'
284 284 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
285 285 $ hg revert -ar 5
286 286 adding new_3_c
287 287 $ hg ci -m 'add n3w_3_c'
288 288 created new head
289 289 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
290 290 $ hg log -r 'bumped()'
291 291 $ hg log -G
292 292 @ changeset: 6:6f9641995072
293 293 | tag: tip
294 294 | parent: 1:7c3bad9141dc
295 295 | user: test
296 296 | date: Thu Jan 01 00:00:00 1970 +0000
297 297 | summary: add n3w_3_c
298 298 |
299 299 | o changeset: 2:245bde4270cd
300 300 |/ user: test
301 301 | date: Thu Jan 01 00:00:00 1970 +0000
302 302 | summary: add original_c
303 303 |
304 304 o changeset: 1:7c3bad9141dc
305 305 | user: test
306 306 | date: Thu Jan 01 00:00:00 1970 +0000
307 307 | summary: add b
308 308 |
309 309 o changeset: 0:1f0dee641bb7
310 310 user: test
311 311 date: Thu Jan 01 00:00:00 1970 +0000
312 312 summary: add a
313 313
314 314
315 315
316 316
317 317 $ cd ..
318 318
319 319 Exchange Test
320 320 ============================
321 321
322 322 Destination repo does not have any data
323 323 ---------------------------------------
324 324
325 325 Simple incoming test
326 326
327 327 $ hg init tmpc
328 328 $ cd tmpc
329 329 $ hg incoming ../tmpb
330 330 comparing with ../tmpb
331 331 changeset: 0:1f0dee641bb7
332 332 user: test
333 333 date: Thu Jan 01 00:00:00 1970 +0000
334 334 summary: add a
335 335
336 336 changeset: 1:7c3bad9141dc
337 337 user: test
338 338 date: Thu Jan 01 00:00:00 1970 +0000
339 339 summary: add b
340 340
341 341 changeset: 2:245bde4270cd
342 342 user: test
343 343 date: Thu Jan 01 00:00:00 1970 +0000
344 344 summary: add original_c
345 345
346 346 changeset: 6:6f9641995072
347 347 tag: tip
348 348 parent: 1:7c3bad9141dc
349 349 user: test
350 350 date: Thu Jan 01 00:00:00 1970 +0000
351 351 summary: add n3w_3_c
352 352
353 353
354 354 Try to pull markers
355 355 (extinct changeset are excluded but marker are pushed)
356 356
357 357 $ hg pull ../tmpb
358 358 pulling from ../tmpb
359 359 requesting all changes
360 360 adding changesets
361 361 adding manifests
362 362 adding file changes
363 363 added 4 changesets with 4 changes to 4 files (+1 heads)
364 364 (run 'hg heads' to see heads, 'hg merge' to merge)
365 365 $ hg debugobsolete
366 366 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
367 367 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
368 368 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
369 369 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
370 370 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
371 371
372 372 Rollback//Transaction support
373 373
374 374 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
375 375 $ hg debugobsolete
376 376 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
377 377 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
378 378 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
379 379 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
380 380 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
381 381 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
382 382 $ hg rollback -n
383 383 repository tip rolled back to revision 3 (undo debugobsolete)
384 384 $ hg rollback
385 385 repository tip rolled back to revision 3 (undo debugobsolete)
386 386 $ hg debugobsolete
387 387 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
388 388 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
389 389 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
390 390 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
391 391 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
392 392
393 393 $ cd ..
394 394
395 395 Try to push markers
396 396
397 397 $ hg init tmpd
398 398 $ hg -R tmpb push tmpd
399 399 pushing to tmpd
400 400 searching for changes
401 401 adding changesets
402 402 adding manifests
403 403 adding file changes
404 404 added 4 changesets with 4 changes to 4 files (+1 heads)
405 405 $ hg -R tmpd debugobsolete
406 406 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
407 407 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
408 408 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
409 409 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
410 410 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
411 411
412 412 Check obsolete keys are exchanged only if source has an obsolete store
413 413
414 414 $ hg init empty
415 415 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
416 416 pushing to tmpd
417 417 no changes found
418 418 listkeys phases
419 419 listkeys bookmarks
420 420 [1]
421 421
422 422 clone support
423 423 (markers are copied and extinct changesets are included to allow hardlinks)
424 424
425 425 $ hg clone tmpb clone-dest
426 426 updating to branch default
427 427 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 428 $ hg -R clone-dest log -G --hidden
429 429 @ changeset: 6:6f9641995072
430 430 | tag: tip
431 431 | parent: 1:7c3bad9141dc
432 432 | user: test
433 433 | date: Thu Jan 01 00:00:00 1970 +0000
434 434 | summary: add n3w_3_c
435 435 |
436 436 | x changeset: 5:5601fb93a350
437 437 |/ parent: 1:7c3bad9141dc
438 438 | user: test
439 439 | date: Thu Jan 01 00:00:00 1970 +0000
440 440 | summary: add new_3_c
441 441 |
442 442 | x changeset: 4:ca819180edb9
443 443 |/ parent: 1:7c3bad9141dc
444 444 | user: test
445 445 | date: Thu Jan 01 00:00:00 1970 +0000
446 446 | summary: add new_2_c
447 447 |
448 448 | x changeset: 3:cdbce2fbb163
449 449 |/ parent: 1:7c3bad9141dc
450 450 | user: test
451 451 | date: Thu Jan 01 00:00:00 1970 +0000
452 452 | summary: add new_c
453 453 |
454 454 | o changeset: 2:245bde4270cd
455 455 |/ user: test
456 456 | date: Thu Jan 01 00:00:00 1970 +0000
457 457 | summary: add original_c
458 458 |
459 459 o changeset: 1:7c3bad9141dc
460 460 | user: test
461 461 | date: Thu Jan 01 00:00:00 1970 +0000
462 462 | summary: add b
463 463 |
464 464 o changeset: 0:1f0dee641bb7
465 465 user: test
466 466 date: Thu Jan 01 00:00:00 1970 +0000
467 467 summary: add a
468 468
469 469 $ hg -R clone-dest debugobsolete
470 470 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
471 471 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
472 472 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
473 473 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
474 474 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
475 475
476 476
477 477 Destination repo have existing data
478 478 ---------------------------------------
479 479
480 480 On pull
481 481
482 482 $ hg init tmpe
483 483 $ cd tmpe
484 484 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
485 485 $ hg pull ../tmpb
486 486 pulling from ../tmpb
487 487 requesting all changes
488 488 adding changesets
489 489 adding manifests
490 490 adding file changes
491 491 added 4 changesets with 4 changes to 4 files (+1 heads)
492 492 (run 'hg heads' to see heads, 'hg merge' to merge)
493 493 $ hg debugobsolete
494 494 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
495 495 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
496 496 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
497 497 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
498 498 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
499 499 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
500 500
501 501
502 502 On push
503 503
504 504 $ hg push ../tmpc
505 505 pushing to ../tmpc
506 506 searching for changes
507 507 no changes found
508 508 [1]
509 509 $ hg -R ../tmpc debugobsolete
510 510 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
511 511 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
512 512 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
513 513 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
514 514 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
515 515 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
516 516
517 517 detect outgoing obsolete and unstable
518 518 ---------------------------------------
519 519
520 520
521 521 $ hg log -G
522 522 o changeset: 3:6f9641995072
523 523 | tag: tip
524 524 | parent: 1:7c3bad9141dc
525 525 | user: test
526 526 | date: Thu Jan 01 00:00:00 1970 +0000
527 527 | summary: add n3w_3_c
528 528 |
529 529 | o changeset: 2:245bde4270cd
530 530 |/ user: test
531 531 | date: Thu Jan 01 00:00:00 1970 +0000
532 532 | summary: add original_c
533 533 |
534 534 o changeset: 1:7c3bad9141dc
535 535 | user: test
536 536 | date: Thu Jan 01 00:00:00 1970 +0000
537 537 | summary: add b
538 538 |
539 539 o changeset: 0:1f0dee641bb7
540 540 user: test
541 541 date: Thu Jan 01 00:00:00 1970 +0000
542 542 summary: add a
543 543
544 544 $ hg up 'desc("n3w_3_c")'
545 545 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
546 546 $ mkcommit original_d
547 547 $ mkcommit original_e
548 548 $ hg debugobsolete `getid original_d` -d '0 0'
549 549 $ hg log -r 'obsolete()'
550 550 changeset: 4:94b33453f93b
551 551 user: test
552 552 date: Thu Jan 01 00:00:00 1970 +0000
553 553 summary: add original_d
554 554
555 555 $ hg log -G -r '::unstable()'
556 556 @ changeset: 5:cda648ca50f5
557 557 | tag: tip
558 558 | user: test
559 559 | date: Thu Jan 01 00:00:00 1970 +0000
560 560 | summary: add original_e
561 561 |
562 562 x changeset: 4:94b33453f93b
563 563 | user: test
564 564 | date: Thu Jan 01 00:00:00 1970 +0000
565 565 | summary: add original_d
566 566 |
567 567 o changeset: 3:6f9641995072
568 568 | parent: 1:7c3bad9141dc
569 569 | user: test
570 570 | date: Thu Jan 01 00:00:00 1970 +0000
571 571 | summary: add n3w_3_c
572 572 |
573 573 o changeset: 1:7c3bad9141dc
574 574 | user: test
575 575 | date: Thu Jan 01 00:00:00 1970 +0000
576 576 | summary: add b
577 577 |
578 578 o changeset: 0:1f0dee641bb7
579 579 user: test
580 580 date: Thu Jan 01 00:00:00 1970 +0000
581 581 summary: add a
582 582
583 583
584 584 refuse to push obsolete changeset
585 585
586 586 $ hg push ../tmpc/ -r 'desc("original_d")'
587 587 pushing to ../tmpc/
588 588 searching for changes
589 589 abort: push includes obsolete changeset: 94b33453f93b!
590 590 [255]
591 591
592 592 refuse to push unstable changeset
593 593
594 594 $ hg push ../tmpc/
595 595 pushing to ../tmpc/
596 596 searching for changes
597 597 abort: push includes unstable changeset: cda648ca50f5!
598 598 [255]
599 599
600 600 Test that extinct changeset are properly detected
601 601
602 602 $ hg log -r 'extinct()'
603 603
604 604 Don't try to push extinct changeset
605 605
606 606 $ hg init ../tmpf
607 607 $ hg out ../tmpf
608 608 comparing with ../tmpf
609 609 searching for changes
610 610 changeset: 0:1f0dee641bb7
611 611 user: test
612 612 date: Thu Jan 01 00:00:00 1970 +0000
613 613 summary: add a
614 614
615 615 changeset: 1:7c3bad9141dc
616 616 user: test
617 617 date: Thu Jan 01 00:00:00 1970 +0000
618 618 summary: add b
619 619
620 620 changeset: 2:245bde4270cd
621 621 user: test
622 622 date: Thu Jan 01 00:00:00 1970 +0000
623 623 summary: add original_c
624 624
625 625 changeset: 3:6f9641995072
626 626 parent: 1:7c3bad9141dc
627 627 user: test
628 628 date: Thu Jan 01 00:00:00 1970 +0000
629 629 summary: add n3w_3_c
630 630
631 631 changeset: 4:94b33453f93b
632 632 user: test
633 633 date: Thu Jan 01 00:00:00 1970 +0000
634 634 summary: add original_d
635 635
636 636 changeset: 5:cda648ca50f5
637 637 tag: tip
638 638 user: test
639 639 date: Thu Jan 01 00:00:00 1970 +0000
640 640 summary: add original_e
641 641
642 642 $ hg push ../tmpf -f # -f because be push unstable too
643 643 pushing to ../tmpf
644 644 searching for changes
645 645 adding changesets
646 646 adding manifests
647 647 adding file changes
648 648 added 6 changesets with 6 changes to 6 files (+1 heads)
649 649
650 650 no warning displayed
651 651
652 652 $ hg push ../tmpf
653 653 pushing to ../tmpf
654 654 searching for changes
655 655 no changes found
656 656 [1]
657 657
658 658 Do not warn about new head when the new head is a successors of a remote one
659 659
660 660 $ hg log -G
661 661 @ changeset: 5:cda648ca50f5
662 662 | tag: tip
663 663 | user: test
664 664 | date: Thu Jan 01 00:00:00 1970 +0000
665 665 | summary: add original_e
666 666 |
667 667 x changeset: 4:94b33453f93b
668 668 | user: test
669 669 | date: Thu Jan 01 00:00:00 1970 +0000
670 670 | summary: add original_d
671 671 |
672 672 o changeset: 3:6f9641995072
673 673 | parent: 1:7c3bad9141dc
674 674 | user: test
675 675 | date: Thu Jan 01 00:00:00 1970 +0000
676 676 | summary: add n3w_3_c
677 677 |
678 678 | o changeset: 2:245bde4270cd
679 679 |/ user: test
680 680 | date: Thu Jan 01 00:00:00 1970 +0000
681 681 | summary: add original_c
682 682 |
683 683 o changeset: 1:7c3bad9141dc
684 684 | user: test
685 685 | date: Thu Jan 01 00:00:00 1970 +0000
686 686 | summary: add b
687 687 |
688 688 o changeset: 0:1f0dee641bb7
689 689 user: test
690 690 date: Thu Jan 01 00:00:00 1970 +0000
691 691 summary: add a
692 692
693 693 $ hg up -q 'desc(n3w_3_c)'
694 694 $ mkcommit obsolete_e
695 695 created new head
696 696 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
697 697 $ hg outgoing ../tmpf # parasite hg outgoing testin
698 698 comparing with ../tmpf
699 699 searching for changes
700 700 changeset: 6:3de5eca88c00
701 701 tag: tip
702 702 parent: 3:6f9641995072
703 703 user: test
704 704 date: Thu Jan 01 00:00:00 1970 +0000
705 705 summary: add obsolete_e
706 706
707 707 $ hg push ../tmpf
708 708 pushing to ../tmpf
709 709 searching for changes
710 710 adding changesets
711 711 adding manifests
712 712 adding file changes
713 713 added 1 changesets with 1 changes to 1 files (+1 heads)
714 714
715 715 #if serve
716 716
717 717 check hgweb does not explode
718 718 ====================================
719 719
720 720 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
721 721 adding changesets
722 722 adding manifests
723 723 adding file changes
724 724 added 62 changesets with 63 changes to 9 files (+60 heads)
725 725 (run 'hg heads .' to see heads, 'hg merge' to merge)
726 726 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
727 727 > do
728 728 > hg debugobsolete $node
729 729 > done
730 730 $ hg up tip
731 731 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
732 732
733 733 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
734 734 $ cat hg.pid >> $DAEMON_PIDS
735 735
736 736 check changelog view
737 737
738 738 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/'
739 739 200 Script output follows
740 740
741 741 check graph view
742 742
743 743 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph'
744 744 200 Script output follows
745 745
746 746 check filelog view
747 747
748 748 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
749 749 200 Script output follows
750 750
751 751 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68'
752 752 200 Script output follows
753 753 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
754 754 404 Not Found
755 755 [1]
756 756
757 757 check that web.view config option:
758 758
759 759 $ "$TESTDIR/killdaemons.py" hg.pid
760 760 $ cat >> .hg/hgrc << EOF
761 761 > [web]
762 762 > view=all
763 763 > EOF
764 764 $ wait
765 765 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
766 766 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
767 767 200 Script output follows
768 768 $ "$TESTDIR/killdaemons.py" hg.pid
769 769
770 770 Checking _enable=False warning if obsolete marker exists
771 771
772 772 $ echo '[extensions]' >> $HGRCPATH
773 773 $ echo "obs=!" >> $HGRCPATH
774 774 $ hg log -r tip
775 775 obsolete feature not enabled but 68 markers found!
776 776 changeset: 68:c15e9edfca13
777 777 tag: tip
778 778 parent: 7:50c51b361e60
779 779 user: test
780 780 date: Thu Jan 01 00:00:00 1970 +0000
781 781 summary: add celestine
782 782
783 783
784 784 reenable for later test
785 785
786 786 $ echo '[extensions]' >> $HGRCPATH
787 787 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
788 788
789 789 #endif
790 790
791 791 Test incoming/outcoming with changesets obsoleted remotely, known locally
792 792 ===============================================================================
793 793
794 794 This test issue 3805
795 795
796 796 $ hg init repo-issue3805
797 797 $ cd repo-issue3805
798 798 $ echo "foo" > foo
799 799 $ hg ci -Am "A"
800 800 adding foo
801 801 $ hg clone . ../other-issue3805
802 802 updating to branch default
803 803 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
804 804 $ echo "bar" >> foo
805 805 $ hg ci --amend
806 806 $ cd ../other-issue3805
807 807 $ hg log -G
808 808 @ changeset: 0:193e9254ce7e
809 809 tag: tip
810 810 user: test
811 811 date: Thu Jan 01 00:00:00 1970 +0000
812 812 summary: A
813 813
814 814 $ hg log -G -R ../repo-issue3805
815 815 @ changeset: 2:3816541e5485
816 816 tag: tip
817 817 parent: -1:000000000000
818 818 user: test
819 819 date: Thu Jan 01 00:00:00 1970 +0000
820 820 summary: A
821 821
822 822 $ hg incoming
823 823 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
824 824 searching for changes
825 825 changeset: 2:3816541e5485
826 826 tag: tip
827 827 parent: -1:000000000000
828 828 user: test
829 829 date: Thu Jan 01 00:00:00 1970 +0000
830 830 summary: A
831 831
832 832 $ hg incoming --bundle ../issue3805.hg
833 833 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
834 834 searching for changes
835 835 changeset: 2:3816541e5485
836 836 tag: tip
837 837 parent: -1:000000000000
838 838 user: test
839 839 date: Thu Jan 01 00:00:00 1970 +0000
840 840 summary: A
841 841
842 842 $ hg outgoing
843 843 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
844 844 searching for changes
845 845 no changes found
846 846 [1]
847 847
848 848 #if serve
849 849
850 850 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
851 851 $ cat hg.pid >> $DAEMON_PIDS
852 852
853 853 $ hg incoming http://localhost:$HGPORT
854 854 comparing with http://localhost:$HGPORT/
855 855 searching for changes
856 856 changeset: 1:3816541e5485
857 857 tag: tip
858 858 parent: -1:000000000000
859 859 user: test
860 860 date: Thu Jan 01 00:00:00 1970 +0000
861 861 summary: A
862 862
863 863 $ hg outgoing http://localhost:$HGPORT
864 864 comparing with http://localhost:$HGPORT/
865 865 searching for changes
866 866 no changes found
867 867 [1]
868 868
869 869 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
870 870
871 871 #endif
872 872
873 873 This test issue 3814
874 874
875 875 (nothing to push but locally hidden changeset)
876 876
877 877 $ cd ..
878 878 $ hg init repo-issue3814
879 879 $ cd repo-issue3805
880 880 $ hg push -r 3816541e5485 ../repo-issue3814
881 881 pushing to ../repo-issue3814
882 882 searching for changes
883 883 adding changesets
884 884 adding manifests
885 885 adding file changes
886 886 added 1 changesets with 1 changes to 1 files
887 887 $ hg out ../repo-issue3814
888 888 comparing with ../repo-issue3814
889 889 searching for changes
890 890 no changes found
891 891 [1]
892 892
893 893 Test that a local tag blocks a changeset from being hidden
894 894
895 895 $ hg tag -l visible -r 0 --hidden
896 896 $ hg log -G
897 897 @ changeset: 2:3816541e5485
898 898 tag: tip
899 899 parent: -1:000000000000
900 900 user: test
901 901 date: Thu Jan 01 00:00:00 1970 +0000
902 902 summary: A
903 903
904 904 x changeset: 0:193e9254ce7e
905 905 tag: visible
906 906 user: test
907 907 date: Thu Jan 01 00:00:00 1970 +0000
908 908 summary: A
909 909
910 Test that removing a local tag does not cause some commands to fail
911
912 $ hg tag -l -r tip tiptag
913 $ hg tags
914 tiptag 2:3816541e5485
915 tip 2:3816541e5485
916 visible 0:193e9254ce7e
917 $ hg --config extensions.strip= strip -r tip --no-backup
918 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
919 $ hg tags
920 visible 0:193e9254ce7e
921 tip 0:193e9254ce7e
General Comments 0
You need to be logged in to leave comments. Login now