##// END OF EJS Templates
caches: stop warming the cache after changegroup application...
Pierre-Yves David -
r32268:24f55686 default
parent child Browse files
Show More
@@ -1,1027 +1,1020 b''
1 # changegroup.py - Mercurial changegroup manipulation functions
1 # changegroup.py - Mercurial changegroup manipulation functions
2 #
2 #
3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import os
10 import os
11 import struct
11 import struct
12 import tempfile
12 import tempfile
13 import weakref
13 import weakref
14
14
15 from .i18n import _
15 from .i18n import _
16 from .node import (
16 from .node import (
17 hex,
17 hex,
18 nullrev,
18 nullrev,
19 short,
19 short,
20 )
20 )
21
21
22 from . import (
22 from . import (
23 branchmap,
24 dagutil,
23 dagutil,
25 discovery,
24 discovery,
26 error,
25 error,
27 mdiff,
26 mdiff,
28 phases,
27 phases,
29 pycompat,
28 pycompat,
30 util,
29 util,
31 )
30 )
32
31
33 _CHANGEGROUPV1_DELTA_HEADER = "20s20s20s20s"
32 _CHANGEGROUPV1_DELTA_HEADER = "20s20s20s20s"
34 _CHANGEGROUPV2_DELTA_HEADER = "20s20s20s20s20s"
33 _CHANGEGROUPV2_DELTA_HEADER = "20s20s20s20s20s"
35 _CHANGEGROUPV3_DELTA_HEADER = ">20s20s20s20s20sH"
34 _CHANGEGROUPV3_DELTA_HEADER = ">20s20s20s20s20sH"
36
35
37 def readexactly(stream, n):
36 def readexactly(stream, n):
38 '''read n bytes from stream.read and abort if less was available'''
37 '''read n bytes from stream.read and abort if less was available'''
39 s = stream.read(n)
38 s = stream.read(n)
40 if len(s) < n:
39 if len(s) < n:
41 raise error.Abort(_("stream ended unexpectedly"
40 raise error.Abort(_("stream ended unexpectedly"
42 " (got %d bytes, expected %d)")
41 " (got %d bytes, expected %d)")
43 % (len(s), n))
42 % (len(s), n))
44 return s
43 return s
45
44
46 def getchunk(stream):
45 def getchunk(stream):
47 """return the next chunk from stream as a string"""
46 """return the next chunk from stream as a string"""
48 d = readexactly(stream, 4)
47 d = readexactly(stream, 4)
49 l = struct.unpack(">l", d)[0]
48 l = struct.unpack(">l", d)[0]
50 if l <= 4:
49 if l <= 4:
51 if l:
50 if l:
52 raise error.Abort(_("invalid chunk length %d") % l)
51 raise error.Abort(_("invalid chunk length %d") % l)
53 return ""
52 return ""
54 return readexactly(stream, l - 4)
53 return readexactly(stream, l - 4)
55
54
56 def chunkheader(length):
55 def chunkheader(length):
57 """return a changegroup chunk header (string)"""
56 """return a changegroup chunk header (string)"""
58 return struct.pack(">l", length + 4)
57 return struct.pack(">l", length + 4)
59
58
60 def closechunk():
59 def closechunk():
61 """return a changegroup chunk header (string) for a zero-length chunk"""
60 """return a changegroup chunk header (string) for a zero-length chunk"""
62 return struct.pack(">l", 0)
61 return struct.pack(">l", 0)
63
62
64 def combineresults(results):
63 def combineresults(results):
65 """logic to combine 0 or more addchangegroup results into one"""
64 """logic to combine 0 or more addchangegroup results into one"""
66 changedheads = 0
65 changedheads = 0
67 result = 1
66 result = 1
68 for ret in results:
67 for ret in results:
69 # If any changegroup result is 0, return 0
68 # If any changegroup result is 0, return 0
70 if ret == 0:
69 if ret == 0:
71 result = 0
70 result = 0
72 break
71 break
73 if ret < -1:
72 if ret < -1:
74 changedheads += ret + 1
73 changedheads += ret + 1
75 elif ret > 1:
74 elif ret > 1:
76 changedheads += ret - 1
75 changedheads += ret - 1
77 if changedheads > 0:
76 if changedheads > 0:
78 result = 1 + changedheads
77 result = 1 + changedheads
79 elif changedheads < 0:
78 elif changedheads < 0:
80 result = -1 + changedheads
79 result = -1 + changedheads
81 return result
80 return result
82
81
83 def writechunks(ui, chunks, filename, vfs=None):
82 def writechunks(ui, chunks, filename, vfs=None):
84 """Write chunks to a file and return its filename.
83 """Write chunks to a file and return its filename.
85
84
86 The stream is assumed to be a bundle file.
85 The stream is assumed to be a bundle file.
87 Existing files will not be overwritten.
86 Existing files will not be overwritten.
88 If no filename is specified, a temporary file is created.
87 If no filename is specified, a temporary file is created.
89 """
88 """
90 fh = None
89 fh = None
91 cleanup = None
90 cleanup = None
92 try:
91 try:
93 if filename:
92 if filename:
94 if vfs:
93 if vfs:
95 fh = vfs.open(filename, "wb")
94 fh = vfs.open(filename, "wb")
96 else:
95 else:
97 # Increase default buffer size because default is usually
96 # Increase default buffer size because default is usually
98 # small (4k is common on Linux).
97 # small (4k is common on Linux).
99 fh = open(filename, "wb", 131072)
98 fh = open(filename, "wb", 131072)
100 else:
99 else:
101 fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg")
100 fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg")
102 fh = os.fdopen(fd, pycompat.sysstr("wb"))
101 fh = os.fdopen(fd, pycompat.sysstr("wb"))
103 cleanup = filename
102 cleanup = filename
104 for c in chunks:
103 for c in chunks:
105 fh.write(c)
104 fh.write(c)
106 cleanup = None
105 cleanup = None
107 return filename
106 return filename
108 finally:
107 finally:
109 if fh is not None:
108 if fh is not None:
110 fh.close()
109 fh.close()
111 if cleanup is not None:
110 if cleanup is not None:
112 if filename and vfs:
111 if filename and vfs:
113 vfs.unlink(cleanup)
112 vfs.unlink(cleanup)
114 else:
113 else:
115 os.unlink(cleanup)
114 os.unlink(cleanup)
116
115
117 class cg1unpacker(object):
116 class cg1unpacker(object):
118 """Unpacker for cg1 changegroup streams.
117 """Unpacker for cg1 changegroup streams.
119
118
120 A changegroup unpacker handles the framing of the revision data in
119 A changegroup unpacker handles the framing of the revision data in
121 the wire format. Most consumers will want to use the apply()
120 the wire format. Most consumers will want to use the apply()
122 method to add the changes from the changegroup to a repository.
121 method to add the changes from the changegroup to a repository.
123
122
124 If you're forwarding a changegroup unmodified to another consumer,
123 If you're forwarding a changegroup unmodified to another consumer,
125 use getchunks(), which returns an iterator of changegroup
124 use getchunks(), which returns an iterator of changegroup
126 chunks. This is mostly useful for cases where you need to know the
125 chunks. This is mostly useful for cases where you need to know the
127 data stream has ended by observing the end of the changegroup.
126 data stream has ended by observing the end of the changegroup.
128
127
129 deltachunk() is useful only if you're applying delta data. Most
128 deltachunk() is useful only if you're applying delta data. Most
130 consumers should prefer apply() instead.
129 consumers should prefer apply() instead.
131
130
132 A few other public methods exist. Those are used only for
131 A few other public methods exist. Those are used only for
133 bundlerepo and some debug commands - their use is discouraged.
132 bundlerepo and some debug commands - their use is discouraged.
134 """
133 """
135 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
134 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
136 deltaheadersize = struct.calcsize(deltaheader)
135 deltaheadersize = struct.calcsize(deltaheader)
137 version = '01'
136 version = '01'
138 _grouplistcount = 1 # One list of files after the manifests
137 _grouplistcount = 1 # One list of files after the manifests
139
138
140 def __init__(self, fh, alg, extras=None):
139 def __init__(self, fh, alg, extras=None):
141 if alg is None:
140 if alg is None:
142 alg = 'UN'
141 alg = 'UN'
143 if alg not in util.compengines.supportedbundletypes:
142 if alg not in util.compengines.supportedbundletypes:
144 raise error.Abort(_('unknown stream compression type: %s')
143 raise error.Abort(_('unknown stream compression type: %s')
145 % alg)
144 % alg)
146 if alg == 'BZ':
145 if alg == 'BZ':
147 alg = '_truncatedBZ'
146 alg = '_truncatedBZ'
148
147
149 compengine = util.compengines.forbundletype(alg)
148 compengine = util.compengines.forbundletype(alg)
150 self._stream = compengine.decompressorreader(fh)
149 self._stream = compengine.decompressorreader(fh)
151 self._type = alg
150 self._type = alg
152 self.extras = extras or {}
151 self.extras = extras or {}
153 self.callback = None
152 self.callback = None
154
153
155 # These methods (compressed, read, seek, tell) all appear to only
154 # These methods (compressed, read, seek, tell) all appear to only
156 # be used by bundlerepo, but it's a little hard to tell.
155 # be used by bundlerepo, but it's a little hard to tell.
157 def compressed(self):
156 def compressed(self):
158 return self._type is not None and self._type != 'UN'
157 return self._type is not None and self._type != 'UN'
159 def read(self, l):
158 def read(self, l):
160 return self._stream.read(l)
159 return self._stream.read(l)
161 def seek(self, pos):
160 def seek(self, pos):
162 return self._stream.seek(pos)
161 return self._stream.seek(pos)
163 def tell(self):
162 def tell(self):
164 return self._stream.tell()
163 return self._stream.tell()
165 def close(self):
164 def close(self):
166 return self._stream.close()
165 return self._stream.close()
167
166
168 def _chunklength(self):
167 def _chunklength(self):
169 d = readexactly(self._stream, 4)
168 d = readexactly(self._stream, 4)
170 l = struct.unpack(">l", d)[0]
169 l = struct.unpack(">l", d)[0]
171 if l <= 4:
170 if l <= 4:
172 if l:
171 if l:
173 raise error.Abort(_("invalid chunk length %d") % l)
172 raise error.Abort(_("invalid chunk length %d") % l)
174 return 0
173 return 0
175 if self.callback:
174 if self.callback:
176 self.callback()
175 self.callback()
177 return l - 4
176 return l - 4
178
177
179 def changelogheader(self):
178 def changelogheader(self):
180 """v10 does not have a changelog header chunk"""
179 """v10 does not have a changelog header chunk"""
181 return {}
180 return {}
182
181
183 def manifestheader(self):
182 def manifestheader(self):
184 """v10 does not have a manifest header chunk"""
183 """v10 does not have a manifest header chunk"""
185 return {}
184 return {}
186
185
187 def filelogheader(self):
186 def filelogheader(self):
188 """return the header of the filelogs chunk, v10 only has the filename"""
187 """return the header of the filelogs chunk, v10 only has the filename"""
189 l = self._chunklength()
188 l = self._chunklength()
190 if not l:
189 if not l:
191 return {}
190 return {}
192 fname = readexactly(self._stream, l)
191 fname = readexactly(self._stream, l)
193 return {'filename': fname}
192 return {'filename': fname}
194
193
195 def _deltaheader(self, headertuple, prevnode):
194 def _deltaheader(self, headertuple, prevnode):
196 node, p1, p2, cs = headertuple
195 node, p1, p2, cs = headertuple
197 if prevnode is None:
196 if prevnode is None:
198 deltabase = p1
197 deltabase = p1
199 else:
198 else:
200 deltabase = prevnode
199 deltabase = prevnode
201 flags = 0
200 flags = 0
202 return node, p1, p2, deltabase, cs, flags
201 return node, p1, p2, deltabase, cs, flags
203
202
204 def deltachunk(self, prevnode):
203 def deltachunk(self, prevnode):
205 l = self._chunklength()
204 l = self._chunklength()
206 if not l:
205 if not l:
207 return {}
206 return {}
208 headerdata = readexactly(self._stream, self.deltaheadersize)
207 headerdata = readexactly(self._stream, self.deltaheadersize)
209 header = struct.unpack(self.deltaheader, headerdata)
208 header = struct.unpack(self.deltaheader, headerdata)
210 delta = readexactly(self._stream, l - self.deltaheadersize)
209 delta = readexactly(self._stream, l - self.deltaheadersize)
211 node, p1, p2, deltabase, cs, flags = self._deltaheader(header, prevnode)
210 node, p1, p2, deltabase, cs, flags = self._deltaheader(header, prevnode)
212 return {'node': node, 'p1': p1, 'p2': p2, 'cs': cs,
211 return {'node': node, 'p1': p1, 'p2': p2, 'cs': cs,
213 'deltabase': deltabase, 'delta': delta, 'flags': flags}
212 'deltabase': deltabase, 'delta': delta, 'flags': flags}
214
213
215 def getchunks(self):
214 def getchunks(self):
216 """returns all the chunks contains in the bundle
215 """returns all the chunks contains in the bundle
217
216
218 Used when you need to forward the binary stream to a file or another
217 Used when you need to forward the binary stream to a file or another
219 network API. To do so, it parse the changegroup data, otherwise it will
218 network API. To do so, it parse the changegroup data, otherwise it will
220 block in case of sshrepo because it don't know the end of the stream.
219 block in case of sshrepo because it don't know the end of the stream.
221 """
220 """
222 # an empty chunkgroup is the end of the changegroup
221 # an empty chunkgroup is the end of the changegroup
223 # a changegroup has at least 2 chunkgroups (changelog and manifest).
222 # a changegroup has at least 2 chunkgroups (changelog and manifest).
224 # after that, changegroup versions 1 and 2 have a series of groups
223 # after that, changegroup versions 1 and 2 have a series of groups
225 # with one group per file. changegroup 3 has a series of directory
224 # with one group per file. changegroup 3 has a series of directory
226 # manifests before the files.
225 # manifests before the files.
227 count = 0
226 count = 0
228 emptycount = 0
227 emptycount = 0
229 while emptycount < self._grouplistcount:
228 while emptycount < self._grouplistcount:
230 empty = True
229 empty = True
231 count += 1
230 count += 1
232 while True:
231 while True:
233 chunk = getchunk(self)
232 chunk = getchunk(self)
234 if not chunk:
233 if not chunk:
235 if empty and count > 2:
234 if empty and count > 2:
236 emptycount += 1
235 emptycount += 1
237 break
236 break
238 empty = False
237 empty = False
239 yield chunkheader(len(chunk))
238 yield chunkheader(len(chunk))
240 pos = 0
239 pos = 0
241 while pos < len(chunk):
240 while pos < len(chunk):
242 next = pos + 2**20
241 next = pos + 2**20
243 yield chunk[pos:next]
242 yield chunk[pos:next]
244 pos = next
243 pos = next
245 yield closechunk()
244 yield closechunk()
246
245
247 def _unpackmanifests(self, repo, revmap, trp, prog, numchanges):
246 def _unpackmanifests(self, repo, revmap, trp, prog, numchanges):
248 # We know that we'll never have more manifests than we had
247 # We know that we'll never have more manifests than we had
249 # changesets.
248 # changesets.
250 self.callback = prog(_('manifests'), numchanges)
249 self.callback = prog(_('manifests'), numchanges)
251 # no need to check for empty manifest group here:
250 # no need to check for empty manifest group here:
252 # if the result of the merge of 1 and 2 is the same in 3 and 4,
251 # if the result of the merge of 1 and 2 is the same in 3 and 4,
253 # no new manifest will be created and the manifest group will
252 # no new manifest will be created and the manifest group will
254 # be empty during the pull
253 # be empty during the pull
255 self.manifestheader()
254 self.manifestheader()
256 repo.manifestlog._revlog.addgroup(self, revmap, trp)
255 repo.manifestlog._revlog.addgroup(self, revmap, trp)
257 repo.ui.progress(_('manifests'), None)
256 repo.ui.progress(_('manifests'), None)
258 self.callback = None
257 self.callback = None
259
258
260 def apply(self, repo, srctype, url, emptyok=False,
259 def apply(self, repo, srctype, url, emptyok=False,
261 targetphase=phases.draft, expectedtotal=None):
260 targetphase=phases.draft, expectedtotal=None):
262 """Add the changegroup returned by source.read() to this repo.
261 """Add the changegroup returned by source.read() to this repo.
263 srctype is a string like 'push', 'pull', or 'unbundle'. url is
262 srctype is a string like 'push', 'pull', or 'unbundle'. url is
264 the URL of the repo where this changegroup is coming from.
263 the URL of the repo where this changegroup is coming from.
265
264
266 Return an integer summarizing the change to this repo:
265 Return an integer summarizing the change to this repo:
267 - nothing changed or no source: 0
266 - nothing changed or no source: 0
268 - more heads than before: 1+added heads (2..n)
267 - more heads than before: 1+added heads (2..n)
269 - fewer heads than before: -1-removed heads (-2..-n)
268 - fewer heads than before: -1-removed heads (-2..-n)
270 - number of heads stays the same: 1
269 - number of heads stays the same: 1
271 """
270 """
272 repo = repo.unfiltered()
271 repo = repo.unfiltered()
273 def csmap(x):
272 def csmap(x):
274 repo.ui.debug("add changeset %s\n" % short(x))
273 repo.ui.debug("add changeset %s\n" % short(x))
275 return len(cl)
274 return len(cl)
276
275
277 def revmap(x):
276 def revmap(x):
278 return cl.rev(x)
277 return cl.rev(x)
279
278
280 changesets = files = revisions = 0
279 changesets = files = revisions = 0
281
280
282 try:
281 try:
283 with repo.transaction("\n".join([srctype,
282 with repo.transaction("\n".join([srctype,
284 util.hidepassword(url)])) as tr:
283 util.hidepassword(url)])) as tr:
285 # The transaction could have been created before and already
284 # The transaction could have been created before and already
286 # carries source information. In this case we use the top
285 # carries source information. In this case we use the top
287 # level data. We overwrite the argument because we need to use
286 # level data. We overwrite the argument because we need to use
288 # the top level value (if they exist) in this function.
287 # the top level value (if they exist) in this function.
289 srctype = tr.hookargs.setdefault('source', srctype)
288 srctype = tr.hookargs.setdefault('source', srctype)
290 url = tr.hookargs.setdefault('url', url)
289 url = tr.hookargs.setdefault('url', url)
291 repo.hook('prechangegroup', throw=True, **tr.hookargs)
290 repo.hook('prechangegroup', throw=True, **tr.hookargs)
292
291
293 # write changelog data to temp files so concurrent readers
292 # write changelog data to temp files so concurrent readers
294 # will not see an inconsistent view
293 # will not see an inconsistent view
295 cl = repo.changelog
294 cl = repo.changelog
296 cl.delayupdate(tr)
295 cl.delayupdate(tr)
297 oldheads = set(cl.heads())
296 oldheads = set(cl.heads())
298
297
299 trp = weakref.proxy(tr)
298 trp = weakref.proxy(tr)
300 # pull off the changeset group
299 # pull off the changeset group
301 repo.ui.status(_("adding changesets\n"))
300 repo.ui.status(_("adding changesets\n"))
302 clstart = len(cl)
301 clstart = len(cl)
303 class prog(object):
302 class prog(object):
304 def __init__(self, step, total):
303 def __init__(self, step, total):
305 self._step = step
304 self._step = step
306 self._total = total
305 self._total = total
307 self._count = 1
306 self._count = 1
308 def __call__(self):
307 def __call__(self):
309 repo.ui.progress(self._step, self._count,
308 repo.ui.progress(self._step, self._count,
310 unit=_('chunks'), total=self._total)
309 unit=_('chunks'), total=self._total)
311 self._count += 1
310 self._count += 1
312 self.callback = prog(_('changesets'), expectedtotal)
311 self.callback = prog(_('changesets'), expectedtotal)
313
312
314 efiles = set()
313 efiles = set()
315 def onchangelog(cl, node):
314 def onchangelog(cl, node):
316 efiles.update(cl.readfiles(node))
315 efiles.update(cl.readfiles(node))
317
316
318 self.changelogheader()
317 self.changelogheader()
319 srccontent = cl.addgroup(self, csmap, trp,
318 srccontent = cl.addgroup(self, csmap, trp,
320 addrevisioncb=onchangelog)
319 addrevisioncb=onchangelog)
321 efiles = len(efiles)
320 efiles = len(efiles)
322
321
323 if not (srccontent or emptyok):
322 if not (srccontent or emptyok):
324 raise error.Abort(_("received changelog group is empty"))
323 raise error.Abort(_("received changelog group is empty"))
325 clend = len(cl)
324 clend = len(cl)
326 changesets = clend - clstart
325 changesets = clend - clstart
327 repo.ui.progress(_('changesets'), None)
326 repo.ui.progress(_('changesets'), None)
328 self.callback = None
327 self.callback = None
329
328
330 # pull off the manifest group
329 # pull off the manifest group
331 repo.ui.status(_("adding manifests\n"))
330 repo.ui.status(_("adding manifests\n"))
332 self._unpackmanifests(repo, revmap, trp, prog, changesets)
331 self._unpackmanifests(repo, revmap, trp, prog, changesets)
333
332
334 needfiles = {}
333 needfiles = {}
335 if repo.ui.configbool('server', 'validate', default=False):
334 if repo.ui.configbool('server', 'validate', default=False):
336 cl = repo.changelog
335 cl = repo.changelog
337 ml = repo.manifestlog
336 ml = repo.manifestlog
338 # validate incoming csets have their manifests
337 # validate incoming csets have their manifests
339 for cset in xrange(clstart, clend):
338 for cset in xrange(clstart, clend):
340 mfnode = cl.changelogrevision(cset).manifest
339 mfnode = cl.changelogrevision(cset).manifest
341 mfest = ml[mfnode].readdelta()
340 mfest = ml[mfnode].readdelta()
342 # store file nodes we must see
341 # store file nodes we must see
343 for f, n in mfest.iteritems():
342 for f, n in mfest.iteritems():
344 needfiles.setdefault(f, set()).add(n)
343 needfiles.setdefault(f, set()).add(n)
345
344
346 # process the files
345 # process the files
347 repo.ui.status(_("adding file changes\n"))
346 repo.ui.status(_("adding file changes\n"))
348 newrevs, newfiles = _addchangegroupfiles(
347 newrevs, newfiles = _addchangegroupfiles(
349 repo, self, revmap, trp, efiles, needfiles)
348 repo, self, revmap, trp, efiles, needfiles)
350 revisions += newrevs
349 revisions += newrevs
351 files += newfiles
350 files += newfiles
352
351
353 dh = 0
352 dh = 0
354 if oldheads:
353 if oldheads:
355 heads = cl.heads()
354 heads = cl.heads()
356 dh = len(heads) - len(oldheads)
355 dh = len(heads) - len(oldheads)
357 for h in heads:
356 for h in heads:
358 if h not in oldheads and repo[h].closesbranch():
357 if h not in oldheads and repo[h].closesbranch():
359 dh -= 1
358 dh -= 1
360 htext = ""
359 htext = ""
361 if dh:
360 if dh:
362 htext = _(" (%+d heads)") % dh
361 htext = _(" (%+d heads)") % dh
363
362
364 repo.ui.status(_("added %d changesets"
363 repo.ui.status(_("added %d changesets"
365 " with %d changes to %d files%s\n")
364 " with %d changes to %d files%s\n")
366 % (changesets, revisions, files, htext))
365 % (changesets, revisions, files, htext))
367 repo.invalidatevolatilesets()
366 repo.invalidatevolatilesets()
368
367
369 if changesets > 0:
368 if changesets > 0:
370 if 'node' not in tr.hookargs:
369 if 'node' not in tr.hookargs:
371 tr.hookargs['node'] = hex(cl.node(clstart))
370 tr.hookargs['node'] = hex(cl.node(clstart))
372 tr.hookargs['node_last'] = hex(cl.node(clend - 1))
371 tr.hookargs['node_last'] = hex(cl.node(clend - 1))
373 hookargs = dict(tr.hookargs)
372 hookargs = dict(tr.hookargs)
374 else:
373 else:
375 hookargs = dict(tr.hookargs)
374 hookargs = dict(tr.hookargs)
376 hookargs['node'] = hex(cl.node(clstart))
375 hookargs['node'] = hex(cl.node(clstart))
377 hookargs['node_last'] = hex(cl.node(clend - 1))
376 hookargs['node_last'] = hex(cl.node(clend - 1))
378 repo.hook('pretxnchangegroup', throw=True, **hookargs)
377 repo.hook('pretxnchangegroup', throw=True, **hookargs)
379
378
380 added = [cl.node(r) for r in xrange(clstart, clend)]
379 added = [cl.node(r) for r in xrange(clstart, clend)]
381 publishing = repo.publishing()
380 publishing = repo.publishing()
382 if srctype in ('push', 'serve'):
381 if srctype in ('push', 'serve'):
383 # Old servers can not push the boundary themselves.
382 # Old servers can not push the boundary themselves.
384 # New servers won't push the boundary if changeset already
383 # New servers won't push the boundary if changeset already
385 # exists locally as secret
384 # exists locally as secret
386 #
385 #
387 # We should not use added here but the list of all change in
386 # We should not use added here but the list of all change in
388 # the bundle
387 # the bundle
389 if publishing:
388 if publishing:
390 phases.advanceboundary(repo, tr, phases.public,
389 phases.advanceboundary(repo, tr, phases.public,
391 srccontent)
390 srccontent)
392 else:
391 else:
393 # Those changesets have been pushed from the
392 # Those changesets have been pushed from the
394 # outside, their phases are going to be pushed
393 # outside, their phases are going to be pushed
395 # alongside. Therefor `targetphase` is
394 # alongside. Therefor `targetphase` is
396 # ignored.
395 # ignored.
397 phases.advanceboundary(repo, tr, phases.draft,
396 phases.advanceboundary(repo, tr, phases.draft,
398 srccontent)
397 srccontent)
399 phases.retractboundary(repo, tr, phases.draft, added)
398 phases.retractboundary(repo, tr, phases.draft, added)
400 elif srctype != 'strip':
399 elif srctype != 'strip':
401 # publishing only alter behavior during push
400 # publishing only alter behavior during push
402 #
401 #
403 # strip should not touch boundary at all
402 # strip should not touch boundary at all
404 phases.retractboundary(repo, tr, targetphase, added)
403 phases.retractboundary(repo, tr, targetphase, added)
405
404
406 if changesets > 0:
405 if changesets > 0:
407 if srctype != 'strip':
408 # During strip, branchcache is invalid but
409 # coming call to `destroyed` will repair it.
410 # In other case we can safely update cache on
411 # disk.
412 branchmap.updatecache(repo.filtered('served'))
413
406
414 def runhooks():
407 def runhooks():
415 # These hooks run when the lock releases, not when the
408 # These hooks run when the lock releases, not when the
416 # transaction closes. So it's possible for the changelog
409 # transaction closes. So it's possible for the changelog
417 # to have changed since we last saw it.
410 # to have changed since we last saw it.
418 if clstart >= len(repo):
411 if clstart >= len(repo):
419 return
412 return
420
413
421 repo.hook("changegroup", **hookargs)
414 repo.hook("changegroup", **hookargs)
422
415
423 for n in added:
416 for n in added:
424 args = hookargs.copy()
417 args = hookargs.copy()
425 args['node'] = hex(n)
418 args['node'] = hex(n)
426 del args['node_last']
419 del args['node_last']
427 repo.hook("incoming", **args)
420 repo.hook("incoming", **args)
428
421
429 newheads = [h for h in repo.heads()
422 newheads = [h for h in repo.heads()
430 if h not in oldheads]
423 if h not in oldheads]
431 repo.ui.log("incoming",
424 repo.ui.log("incoming",
432 "%s incoming changes - new heads: %s\n",
425 "%s incoming changes - new heads: %s\n",
433 len(added),
426 len(added),
434 ', '.join([hex(c[:6]) for c in newheads]))
427 ', '.join([hex(c[:6]) for c in newheads]))
435
428
436 tr.addpostclose('changegroup-runhooks-%020i' % clstart,
429 tr.addpostclose('changegroup-runhooks-%020i' % clstart,
437 lambda tr: repo._afterlock(runhooks))
430 lambda tr: repo._afterlock(runhooks))
438 finally:
431 finally:
439 repo.ui.flush()
432 repo.ui.flush()
440 # never return 0 here:
433 # never return 0 here:
441 if dh < 0:
434 if dh < 0:
442 return dh - 1
435 return dh - 1
443 else:
436 else:
444 return dh + 1
437 return dh + 1
445
438
446 class cg2unpacker(cg1unpacker):
439 class cg2unpacker(cg1unpacker):
447 """Unpacker for cg2 streams.
440 """Unpacker for cg2 streams.
448
441
449 cg2 streams add support for generaldelta, so the delta header
442 cg2 streams add support for generaldelta, so the delta header
450 format is slightly different. All other features about the data
443 format is slightly different. All other features about the data
451 remain the same.
444 remain the same.
452 """
445 """
453 deltaheader = _CHANGEGROUPV2_DELTA_HEADER
446 deltaheader = _CHANGEGROUPV2_DELTA_HEADER
454 deltaheadersize = struct.calcsize(deltaheader)
447 deltaheadersize = struct.calcsize(deltaheader)
455 version = '02'
448 version = '02'
456
449
457 def _deltaheader(self, headertuple, prevnode):
450 def _deltaheader(self, headertuple, prevnode):
458 node, p1, p2, deltabase, cs = headertuple
451 node, p1, p2, deltabase, cs = headertuple
459 flags = 0
452 flags = 0
460 return node, p1, p2, deltabase, cs, flags
453 return node, p1, p2, deltabase, cs, flags
461
454
462 class cg3unpacker(cg2unpacker):
455 class cg3unpacker(cg2unpacker):
463 """Unpacker for cg3 streams.
456 """Unpacker for cg3 streams.
464
457
465 cg3 streams add support for exchanging treemanifests and revlog
458 cg3 streams add support for exchanging treemanifests and revlog
466 flags. It adds the revlog flags to the delta header and an empty chunk
459 flags. It adds the revlog flags to the delta header and an empty chunk
467 separating manifests and files.
460 separating manifests and files.
468 """
461 """
469 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
462 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
470 deltaheadersize = struct.calcsize(deltaheader)
463 deltaheadersize = struct.calcsize(deltaheader)
471 version = '03'
464 version = '03'
472 _grouplistcount = 2 # One list of manifests and one list of files
465 _grouplistcount = 2 # One list of manifests and one list of files
473
466
474 def _deltaheader(self, headertuple, prevnode):
467 def _deltaheader(self, headertuple, prevnode):
475 node, p1, p2, deltabase, cs, flags = headertuple
468 node, p1, p2, deltabase, cs, flags = headertuple
476 return node, p1, p2, deltabase, cs, flags
469 return node, p1, p2, deltabase, cs, flags
477
470
478 def _unpackmanifests(self, repo, revmap, trp, prog, numchanges):
471 def _unpackmanifests(self, repo, revmap, trp, prog, numchanges):
479 super(cg3unpacker, self)._unpackmanifests(repo, revmap, trp, prog,
472 super(cg3unpacker, self)._unpackmanifests(repo, revmap, trp, prog,
480 numchanges)
473 numchanges)
481 for chunkdata in iter(self.filelogheader, {}):
474 for chunkdata in iter(self.filelogheader, {}):
482 # If we get here, there are directory manifests in the changegroup
475 # If we get here, there are directory manifests in the changegroup
483 d = chunkdata["filename"]
476 d = chunkdata["filename"]
484 repo.ui.debug("adding %s revisions\n" % d)
477 repo.ui.debug("adding %s revisions\n" % d)
485 dirlog = repo.manifestlog._revlog.dirlog(d)
478 dirlog = repo.manifestlog._revlog.dirlog(d)
486 if not dirlog.addgroup(self, revmap, trp):
479 if not dirlog.addgroup(self, revmap, trp):
487 raise error.Abort(_("received dir revlog group is empty"))
480 raise error.Abort(_("received dir revlog group is empty"))
488
481
489 class headerlessfixup(object):
482 class headerlessfixup(object):
490 def __init__(self, fh, h):
483 def __init__(self, fh, h):
491 self._h = h
484 self._h = h
492 self._fh = fh
485 self._fh = fh
493 def read(self, n):
486 def read(self, n):
494 if self._h:
487 if self._h:
495 d, self._h = self._h[:n], self._h[n:]
488 d, self._h = self._h[:n], self._h[n:]
496 if len(d) < n:
489 if len(d) < n:
497 d += readexactly(self._fh, n - len(d))
490 d += readexactly(self._fh, n - len(d))
498 return d
491 return d
499 return readexactly(self._fh, n)
492 return readexactly(self._fh, n)
500
493
501 class cg1packer(object):
494 class cg1packer(object):
502 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
495 deltaheader = _CHANGEGROUPV1_DELTA_HEADER
503 version = '01'
496 version = '01'
504 def __init__(self, repo):
497 def __init__(self, repo):
505 """Given a source repo, construct a bundler.
498 """Given a source repo, construct a bundler.
506 """
499 """
507 # experimental config: bundle.reorder
500 # experimental config: bundle.reorder
508 reorder = repo.ui.config('bundle', 'reorder', 'auto')
501 reorder = repo.ui.config('bundle', 'reorder', 'auto')
509 if reorder == 'auto':
502 if reorder == 'auto':
510 reorder = None
503 reorder = None
511 else:
504 else:
512 reorder = util.parsebool(reorder)
505 reorder = util.parsebool(reorder)
513 self._repo = repo
506 self._repo = repo
514 self._reorder = reorder
507 self._reorder = reorder
515 self._progress = repo.ui.progress
508 self._progress = repo.ui.progress
516 if self._repo.ui.verbose and not self._repo.ui.debugflag:
509 if self._repo.ui.verbose and not self._repo.ui.debugflag:
517 self._verbosenote = self._repo.ui.note
510 self._verbosenote = self._repo.ui.note
518 else:
511 else:
519 self._verbosenote = lambda s: None
512 self._verbosenote = lambda s: None
520
513
521 def close(self):
514 def close(self):
522 return closechunk()
515 return closechunk()
523
516
524 def fileheader(self, fname):
517 def fileheader(self, fname):
525 return chunkheader(len(fname)) + fname
518 return chunkheader(len(fname)) + fname
526
519
527 # Extracted both for clarity and for overriding in extensions.
520 # Extracted both for clarity and for overriding in extensions.
528 def _sortgroup(self, revlog, nodelist, lookup):
521 def _sortgroup(self, revlog, nodelist, lookup):
529 """Sort nodes for change group and turn them into revnums."""
522 """Sort nodes for change group and turn them into revnums."""
530 # for generaldelta revlogs, we linearize the revs; this will both be
523 # for generaldelta revlogs, we linearize the revs; this will both be
531 # much quicker and generate a much smaller bundle
524 # much quicker and generate a much smaller bundle
532 if (revlog._generaldelta and self._reorder is None) or self._reorder:
525 if (revlog._generaldelta and self._reorder is None) or self._reorder:
533 dag = dagutil.revlogdag(revlog)
526 dag = dagutil.revlogdag(revlog)
534 return dag.linearize(set(revlog.rev(n) for n in nodelist))
527 return dag.linearize(set(revlog.rev(n) for n in nodelist))
535 else:
528 else:
536 return sorted([revlog.rev(n) for n in nodelist])
529 return sorted([revlog.rev(n) for n in nodelist])
537
530
538 def group(self, nodelist, revlog, lookup, units=None):
531 def group(self, nodelist, revlog, lookup, units=None):
539 """Calculate a delta group, yielding a sequence of changegroup chunks
532 """Calculate a delta group, yielding a sequence of changegroup chunks
540 (strings).
533 (strings).
541
534
542 Given a list of changeset revs, return a set of deltas and
535 Given a list of changeset revs, return a set of deltas and
543 metadata corresponding to nodes. The first delta is
536 metadata corresponding to nodes. The first delta is
544 first parent(nodelist[0]) -> nodelist[0], the receiver is
537 first parent(nodelist[0]) -> nodelist[0], the receiver is
545 guaranteed to have this parent as it has all history before
538 guaranteed to have this parent as it has all history before
546 these changesets. In the case firstparent is nullrev the
539 these changesets. In the case firstparent is nullrev the
547 changegroup starts with a full revision.
540 changegroup starts with a full revision.
548
541
549 If units is not None, progress detail will be generated, units specifies
542 If units is not None, progress detail will be generated, units specifies
550 the type of revlog that is touched (changelog, manifest, etc.).
543 the type of revlog that is touched (changelog, manifest, etc.).
551 """
544 """
552 # if we don't have any revisions touched by these changesets, bail
545 # if we don't have any revisions touched by these changesets, bail
553 if len(nodelist) == 0:
546 if len(nodelist) == 0:
554 yield self.close()
547 yield self.close()
555 return
548 return
556
549
557 revs = self._sortgroup(revlog, nodelist, lookup)
550 revs = self._sortgroup(revlog, nodelist, lookup)
558
551
559 # add the parent of the first rev
552 # add the parent of the first rev
560 p = revlog.parentrevs(revs[0])[0]
553 p = revlog.parentrevs(revs[0])[0]
561 revs.insert(0, p)
554 revs.insert(0, p)
562
555
563 # build deltas
556 # build deltas
564 total = len(revs) - 1
557 total = len(revs) - 1
565 msgbundling = _('bundling')
558 msgbundling = _('bundling')
566 for r in xrange(len(revs) - 1):
559 for r in xrange(len(revs) - 1):
567 if units is not None:
560 if units is not None:
568 self._progress(msgbundling, r + 1, unit=units, total=total)
561 self._progress(msgbundling, r + 1, unit=units, total=total)
569 prev, curr = revs[r], revs[r + 1]
562 prev, curr = revs[r], revs[r + 1]
570 linknode = lookup(revlog.node(curr))
563 linknode = lookup(revlog.node(curr))
571 for c in self.revchunk(revlog, curr, prev, linknode):
564 for c in self.revchunk(revlog, curr, prev, linknode):
572 yield c
565 yield c
573
566
574 if units is not None:
567 if units is not None:
575 self._progress(msgbundling, None)
568 self._progress(msgbundling, None)
576 yield self.close()
569 yield self.close()
577
570
578 # filter any nodes that claim to be part of the known set
571 # filter any nodes that claim to be part of the known set
579 def prune(self, revlog, missing, commonrevs):
572 def prune(self, revlog, missing, commonrevs):
580 rr, rl = revlog.rev, revlog.linkrev
573 rr, rl = revlog.rev, revlog.linkrev
581 return [n for n in missing if rl(rr(n)) not in commonrevs]
574 return [n for n in missing if rl(rr(n)) not in commonrevs]
582
575
583 def _packmanifests(self, dir, mfnodes, lookuplinknode):
576 def _packmanifests(self, dir, mfnodes, lookuplinknode):
584 """Pack flat manifests into a changegroup stream."""
577 """Pack flat manifests into a changegroup stream."""
585 assert not dir
578 assert not dir
586 for chunk in self.group(mfnodes, self._repo.manifestlog._revlog,
579 for chunk in self.group(mfnodes, self._repo.manifestlog._revlog,
587 lookuplinknode, units=_('manifests')):
580 lookuplinknode, units=_('manifests')):
588 yield chunk
581 yield chunk
589
582
590 def _manifestsdone(self):
583 def _manifestsdone(self):
591 return ''
584 return ''
592
585
593 def generate(self, commonrevs, clnodes, fastpathlinkrev, source):
586 def generate(self, commonrevs, clnodes, fastpathlinkrev, source):
594 '''yield a sequence of changegroup chunks (strings)'''
587 '''yield a sequence of changegroup chunks (strings)'''
595 repo = self._repo
588 repo = self._repo
596 cl = repo.changelog
589 cl = repo.changelog
597
590
598 clrevorder = {}
591 clrevorder = {}
599 mfs = {} # needed manifests
592 mfs = {} # needed manifests
600 fnodes = {} # needed file nodes
593 fnodes = {} # needed file nodes
601 changedfiles = set()
594 changedfiles = set()
602
595
603 # Callback for the changelog, used to collect changed files and manifest
596 # Callback for the changelog, used to collect changed files and manifest
604 # nodes.
597 # nodes.
605 # Returns the linkrev node (identity in the changelog case).
598 # Returns the linkrev node (identity in the changelog case).
606 def lookupcl(x):
599 def lookupcl(x):
607 c = cl.read(x)
600 c = cl.read(x)
608 clrevorder[x] = len(clrevorder)
601 clrevorder[x] = len(clrevorder)
609 n = c[0]
602 n = c[0]
610 # record the first changeset introducing this manifest version
603 # record the first changeset introducing this manifest version
611 mfs.setdefault(n, x)
604 mfs.setdefault(n, x)
612 # Record a complete list of potentially-changed files in
605 # Record a complete list of potentially-changed files in
613 # this manifest.
606 # this manifest.
614 changedfiles.update(c[3])
607 changedfiles.update(c[3])
615 return x
608 return x
616
609
617 self._verbosenote(_('uncompressed size of bundle content:\n'))
610 self._verbosenote(_('uncompressed size of bundle content:\n'))
618 size = 0
611 size = 0
619 for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets')):
612 for chunk in self.group(clnodes, cl, lookupcl, units=_('changesets')):
620 size += len(chunk)
613 size += len(chunk)
621 yield chunk
614 yield chunk
622 self._verbosenote(_('%8.i (changelog)\n') % size)
615 self._verbosenote(_('%8.i (changelog)\n') % size)
623
616
624 # We need to make sure that the linkrev in the changegroup refers to
617 # We need to make sure that the linkrev in the changegroup refers to
625 # the first changeset that introduced the manifest or file revision.
618 # the first changeset that introduced the manifest or file revision.
626 # The fastpath is usually safer than the slowpath, because the filelogs
619 # The fastpath is usually safer than the slowpath, because the filelogs
627 # are walked in revlog order.
620 # are walked in revlog order.
628 #
621 #
629 # When taking the slowpath with reorder=None and the manifest revlog
622 # When taking the slowpath with reorder=None and the manifest revlog
630 # uses generaldelta, the manifest may be walked in the "wrong" order.
623 # uses generaldelta, the manifest may be walked in the "wrong" order.
631 # Without 'clrevorder', we would get an incorrect linkrev (see fix in
624 # Without 'clrevorder', we would get an incorrect linkrev (see fix in
632 # cc0ff93d0c0c).
625 # cc0ff93d0c0c).
633 #
626 #
634 # When taking the fastpath, we are only vulnerable to reordering
627 # When taking the fastpath, we are only vulnerable to reordering
635 # of the changelog itself. The changelog never uses generaldelta, so
628 # of the changelog itself. The changelog never uses generaldelta, so
636 # it is only reordered when reorder=True. To handle this case, we
629 # it is only reordered when reorder=True. To handle this case, we
637 # simply take the slowpath, which already has the 'clrevorder' logic.
630 # simply take the slowpath, which already has the 'clrevorder' logic.
638 # This was also fixed in cc0ff93d0c0c.
631 # This was also fixed in cc0ff93d0c0c.
639 fastpathlinkrev = fastpathlinkrev and not self._reorder
632 fastpathlinkrev = fastpathlinkrev and not self._reorder
640 # Treemanifests don't work correctly with fastpathlinkrev
633 # Treemanifests don't work correctly with fastpathlinkrev
641 # either, because we don't discover which directory nodes to
634 # either, because we don't discover which directory nodes to
642 # send along with files. This could probably be fixed.
635 # send along with files. This could probably be fixed.
643 fastpathlinkrev = fastpathlinkrev and (
636 fastpathlinkrev = fastpathlinkrev and (
644 'treemanifest' not in repo.requirements)
637 'treemanifest' not in repo.requirements)
645
638
646 for chunk in self.generatemanifests(commonrevs, clrevorder,
639 for chunk in self.generatemanifests(commonrevs, clrevorder,
647 fastpathlinkrev, mfs, fnodes):
640 fastpathlinkrev, mfs, fnodes):
648 yield chunk
641 yield chunk
649 mfs.clear()
642 mfs.clear()
650 clrevs = set(cl.rev(x) for x in clnodes)
643 clrevs = set(cl.rev(x) for x in clnodes)
651
644
652 if not fastpathlinkrev:
645 if not fastpathlinkrev:
653 def linknodes(unused, fname):
646 def linknodes(unused, fname):
654 return fnodes.get(fname, {})
647 return fnodes.get(fname, {})
655 else:
648 else:
656 cln = cl.node
649 cln = cl.node
657 def linknodes(filerevlog, fname):
650 def linknodes(filerevlog, fname):
658 llr = filerevlog.linkrev
651 llr = filerevlog.linkrev
659 fln = filerevlog.node
652 fln = filerevlog.node
660 revs = ((r, llr(r)) for r in filerevlog)
653 revs = ((r, llr(r)) for r in filerevlog)
661 return dict((fln(r), cln(lr)) for r, lr in revs if lr in clrevs)
654 return dict((fln(r), cln(lr)) for r, lr in revs if lr in clrevs)
662
655
663 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
656 for chunk in self.generatefiles(changedfiles, linknodes, commonrevs,
664 source):
657 source):
665 yield chunk
658 yield chunk
666
659
667 yield self.close()
660 yield self.close()
668
661
669 if clnodes:
662 if clnodes:
670 repo.hook('outgoing', node=hex(clnodes[0]), source=source)
663 repo.hook('outgoing', node=hex(clnodes[0]), source=source)
671
664
672 def generatemanifests(self, commonrevs, clrevorder, fastpathlinkrev, mfs,
665 def generatemanifests(self, commonrevs, clrevorder, fastpathlinkrev, mfs,
673 fnodes):
666 fnodes):
674 repo = self._repo
667 repo = self._repo
675 mfl = repo.manifestlog
668 mfl = repo.manifestlog
676 dirlog = mfl._revlog.dirlog
669 dirlog = mfl._revlog.dirlog
677 tmfnodes = {'': mfs}
670 tmfnodes = {'': mfs}
678
671
679 # Callback for the manifest, used to collect linkrevs for filelog
672 # Callback for the manifest, used to collect linkrevs for filelog
680 # revisions.
673 # revisions.
681 # Returns the linkrev node (collected in lookupcl).
674 # Returns the linkrev node (collected in lookupcl).
682 def makelookupmflinknode(dir):
675 def makelookupmflinknode(dir):
683 if fastpathlinkrev:
676 if fastpathlinkrev:
684 assert not dir
677 assert not dir
685 return mfs.__getitem__
678 return mfs.__getitem__
686
679
687 def lookupmflinknode(x):
680 def lookupmflinknode(x):
688 """Callback for looking up the linknode for manifests.
681 """Callback for looking up the linknode for manifests.
689
682
690 Returns the linkrev node for the specified manifest.
683 Returns the linkrev node for the specified manifest.
691
684
692 SIDE EFFECT:
685 SIDE EFFECT:
693
686
694 1) fclnodes gets populated with the list of relevant
687 1) fclnodes gets populated with the list of relevant
695 file nodes if we're not using fastpathlinkrev
688 file nodes if we're not using fastpathlinkrev
696 2) When treemanifests are in use, collects treemanifest nodes
689 2) When treemanifests are in use, collects treemanifest nodes
697 to send
690 to send
698
691
699 Note that this means manifests must be completely sent to
692 Note that this means manifests must be completely sent to
700 the client before you can trust the list of files and
693 the client before you can trust the list of files and
701 treemanifests to send.
694 treemanifests to send.
702 """
695 """
703 clnode = tmfnodes[dir][x]
696 clnode = tmfnodes[dir][x]
704 mdata = mfl.get(dir, x).readfast(shallow=True)
697 mdata = mfl.get(dir, x).readfast(shallow=True)
705 for p, n, fl in mdata.iterentries():
698 for p, n, fl in mdata.iterentries():
706 if fl == 't': # subdirectory manifest
699 if fl == 't': # subdirectory manifest
707 subdir = dir + p + '/'
700 subdir = dir + p + '/'
708 tmfclnodes = tmfnodes.setdefault(subdir, {})
701 tmfclnodes = tmfnodes.setdefault(subdir, {})
709 tmfclnode = tmfclnodes.setdefault(n, clnode)
702 tmfclnode = tmfclnodes.setdefault(n, clnode)
710 if clrevorder[clnode] < clrevorder[tmfclnode]:
703 if clrevorder[clnode] < clrevorder[tmfclnode]:
711 tmfclnodes[n] = clnode
704 tmfclnodes[n] = clnode
712 else:
705 else:
713 f = dir + p
706 f = dir + p
714 fclnodes = fnodes.setdefault(f, {})
707 fclnodes = fnodes.setdefault(f, {})
715 fclnode = fclnodes.setdefault(n, clnode)
708 fclnode = fclnodes.setdefault(n, clnode)
716 if clrevorder[clnode] < clrevorder[fclnode]:
709 if clrevorder[clnode] < clrevorder[fclnode]:
717 fclnodes[n] = clnode
710 fclnodes[n] = clnode
718 return clnode
711 return clnode
719 return lookupmflinknode
712 return lookupmflinknode
720
713
721 size = 0
714 size = 0
722 while tmfnodes:
715 while tmfnodes:
723 dir = min(tmfnodes)
716 dir = min(tmfnodes)
724 nodes = tmfnodes[dir]
717 nodes = tmfnodes[dir]
725 prunednodes = self.prune(dirlog(dir), nodes, commonrevs)
718 prunednodes = self.prune(dirlog(dir), nodes, commonrevs)
726 if not dir or prunednodes:
719 if not dir or prunednodes:
727 for x in self._packmanifests(dir, prunednodes,
720 for x in self._packmanifests(dir, prunednodes,
728 makelookupmflinknode(dir)):
721 makelookupmflinknode(dir)):
729 size += len(x)
722 size += len(x)
730 yield x
723 yield x
731 del tmfnodes[dir]
724 del tmfnodes[dir]
732 self._verbosenote(_('%8.i (manifests)\n') % size)
725 self._verbosenote(_('%8.i (manifests)\n') % size)
733 yield self._manifestsdone()
726 yield self._manifestsdone()
734
727
735 # The 'source' parameter is useful for extensions
728 # The 'source' parameter is useful for extensions
736 def generatefiles(self, changedfiles, linknodes, commonrevs, source):
729 def generatefiles(self, changedfiles, linknodes, commonrevs, source):
737 repo = self._repo
730 repo = self._repo
738 progress = self._progress
731 progress = self._progress
739 msgbundling = _('bundling')
732 msgbundling = _('bundling')
740
733
741 total = len(changedfiles)
734 total = len(changedfiles)
742 # for progress output
735 # for progress output
743 msgfiles = _('files')
736 msgfiles = _('files')
744 for i, fname in enumerate(sorted(changedfiles)):
737 for i, fname in enumerate(sorted(changedfiles)):
745 filerevlog = repo.file(fname)
738 filerevlog = repo.file(fname)
746 if not filerevlog:
739 if not filerevlog:
747 raise error.Abort(_("empty or missing revlog for %s") % fname)
740 raise error.Abort(_("empty or missing revlog for %s") % fname)
748
741
749 linkrevnodes = linknodes(filerevlog, fname)
742 linkrevnodes = linknodes(filerevlog, fname)
750 # Lookup for filenodes, we collected the linkrev nodes above in the
743 # Lookup for filenodes, we collected the linkrev nodes above in the
751 # fastpath case and with lookupmf in the slowpath case.
744 # fastpath case and with lookupmf in the slowpath case.
752 def lookupfilelog(x):
745 def lookupfilelog(x):
753 return linkrevnodes[x]
746 return linkrevnodes[x]
754
747
755 filenodes = self.prune(filerevlog, linkrevnodes, commonrevs)
748 filenodes = self.prune(filerevlog, linkrevnodes, commonrevs)
756 if filenodes:
749 if filenodes:
757 progress(msgbundling, i + 1, item=fname, unit=msgfiles,
750 progress(msgbundling, i + 1, item=fname, unit=msgfiles,
758 total=total)
751 total=total)
759 h = self.fileheader(fname)
752 h = self.fileheader(fname)
760 size = len(h)
753 size = len(h)
761 yield h
754 yield h
762 for chunk in self.group(filenodes, filerevlog, lookupfilelog):
755 for chunk in self.group(filenodes, filerevlog, lookupfilelog):
763 size += len(chunk)
756 size += len(chunk)
764 yield chunk
757 yield chunk
765 self._verbosenote(_('%8.i %s\n') % (size, fname))
758 self._verbosenote(_('%8.i %s\n') % (size, fname))
766 progress(msgbundling, None)
759 progress(msgbundling, None)
767
760
768 def deltaparent(self, revlog, rev, p1, p2, prev):
761 def deltaparent(self, revlog, rev, p1, p2, prev):
769 return prev
762 return prev
770
763
771 def revchunk(self, revlog, rev, prev, linknode):
764 def revchunk(self, revlog, rev, prev, linknode):
772 node = revlog.node(rev)
765 node = revlog.node(rev)
773 p1, p2 = revlog.parentrevs(rev)
766 p1, p2 = revlog.parentrevs(rev)
774 base = self.deltaparent(revlog, rev, p1, p2, prev)
767 base = self.deltaparent(revlog, rev, p1, p2, prev)
775
768
776 prefix = ''
769 prefix = ''
777 if revlog.iscensored(base) or revlog.iscensored(rev):
770 if revlog.iscensored(base) or revlog.iscensored(rev):
778 try:
771 try:
779 delta = revlog.revision(node, raw=True)
772 delta = revlog.revision(node, raw=True)
780 except error.CensoredNodeError as e:
773 except error.CensoredNodeError as e:
781 delta = e.tombstone
774 delta = e.tombstone
782 if base == nullrev:
775 if base == nullrev:
783 prefix = mdiff.trivialdiffheader(len(delta))
776 prefix = mdiff.trivialdiffheader(len(delta))
784 else:
777 else:
785 baselen = revlog.rawsize(base)
778 baselen = revlog.rawsize(base)
786 prefix = mdiff.replacediffheader(baselen, len(delta))
779 prefix = mdiff.replacediffheader(baselen, len(delta))
787 elif base == nullrev:
780 elif base == nullrev:
788 delta = revlog.revision(node, raw=True)
781 delta = revlog.revision(node, raw=True)
789 prefix = mdiff.trivialdiffheader(len(delta))
782 prefix = mdiff.trivialdiffheader(len(delta))
790 else:
783 else:
791 delta = revlog.revdiff(base, rev)
784 delta = revlog.revdiff(base, rev)
792 p1n, p2n = revlog.parents(node)
785 p1n, p2n = revlog.parents(node)
793 basenode = revlog.node(base)
786 basenode = revlog.node(base)
794 flags = revlog.flags(rev)
787 flags = revlog.flags(rev)
795 meta = self.builddeltaheader(node, p1n, p2n, basenode, linknode, flags)
788 meta = self.builddeltaheader(node, p1n, p2n, basenode, linknode, flags)
796 meta += prefix
789 meta += prefix
797 l = len(meta) + len(delta)
790 l = len(meta) + len(delta)
798 yield chunkheader(l)
791 yield chunkheader(l)
799 yield meta
792 yield meta
800 yield delta
793 yield delta
801 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
794 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
802 # do nothing with basenode, it is implicitly the previous one in HG10
795 # do nothing with basenode, it is implicitly the previous one in HG10
803 # do nothing with flags, it is implicitly 0 for cg1 and cg2
796 # do nothing with flags, it is implicitly 0 for cg1 and cg2
804 return struct.pack(self.deltaheader, node, p1n, p2n, linknode)
797 return struct.pack(self.deltaheader, node, p1n, p2n, linknode)
805
798
806 class cg2packer(cg1packer):
799 class cg2packer(cg1packer):
807 version = '02'
800 version = '02'
808 deltaheader = _CHANGEGROUPV2_DELTA_HEADER
801 deltaheader = _CHANGEGROUPV2_DELTA_HEADER
809
802
810 def __init__(self, repo):
803 def __init__(self, repo):
811 super(cg2packer, self).__init__(repo)
804 super(cg2packer, self).__init__(repo)
812 if self._reorder is None:
805 if self._reorder is None:
813 # Since generaldelta is directly supported by cg2, reordering
806 # Since generaldelta is directly supported by cg2, reordering
814 # generally doesn't help, so we disable it by default (treating
807 # generally doesn't help, so we disable it by default (treating
815 # bundle.reorder=auto just like bundle.reorder=False).
808 # bundle.reorder=auto just like bundle.reorder=False).
816 self._reorder = False
809 self._reorder = False
817
810
818 def deltaparent(self, revlog, rev, p1, p2, prev):
811 def deltaparent(self, revlog, rev, p1, p2, prev):
819 dp = revlog.deltaparent(rev)
812 dp = revlog.deltaparent(rev)
820 if dp == nullrev and revlog.storedeltachains:
813 if dp == nullrev and revlog.storedeltachains:
821 # Avoid sending full revisions when delta parent is null. Pick prev
814 # Avoid sending full revisions when delta parent is null. Pick prev
822 # in that case. It's tempting to pick p1 in this case, as p1 will
815 # in that case. It's tempting to pick p1 in this case, as p1 will
823 # be smaller in the common case. However, computing a delta against
816 # be smaller in the common case. However, computing a delta against
824 # p1 may require resolving the raw text of p1, which could be
817 # p1 may require resolving the raw text of p1, which could be
825 # expensive. The revlog caches should have prev cached, meaning
818 # expensive. The revlog caches should have prev cached, meaning
826 # less CPU for changegroup generation. There is likely room to add
819 # less CPU for changegroup generation. There is likely room to add
827 # a flag and/or config option to control this behavior.
820 # a flag and/or config option to control this behavior.
828 return prev
821 return prev
829 elif dp == nullrev:
822 elif dp == nullrev:
830 # revlog is configured to use full snapshot for a reason,
823 # revlog is configured to use full snapshot for a reason,
831 # stick to full snapshot.
824 # stick to full snapshot.
832 return nullrev
825 return nullrev
833 elif dp not in (p1, p2, prev):
826 elif dp not in (p1, p2, prev):
834 # Pick prev when we can't be sure remote has the base revision.
827 # Pick prev when we can't be sure remote has the base revision.
835 return prev
828 return prev
836 else:
829 else:
837 return dp
830 return dp
838
831
839 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
832 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
840 # Do nothing with flags, it is implicitly 0 in cg1 and cg2
833 # Do nothing with flags, it is implicitly 0 in cg1 and cg2
841 return struct.pack(self.deltaheader, node, p1n, p2n, basenode, linknode)
834 return struct.pack(self.deltaheader, node, p1n, p2n, basenode, linknode)
842
835
843 class cg3packer(cg2packer):
836 class cg3packer(cg2packer):
844 version = '03'
837 version = '03'
845 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
838 deltaheader = _CHANGEGROUPV3_DELTA_HEADER
846
839
847 def _packmanifests(self, dir, mfnodes, lookuplinknode):
840 def _packmanifests(self, dir, mfnodes, lookuplinknode):
848 if dir:
841 if dir:
849 yield self.fileheader(dir)
842 yield self.fileheader(dir)
850
843
851 dirlog = self._repo.manifestlog._revlog.dirlog(dir)
844 dirlog = self._repo.manifestlog._revlog.dirlog(dir)
852 for chunk in self.group(mfnodes, dirlog, lookuplinknode,
845 for chunk in self.group(mfnodes, dirlog, lookuplinknode,
853 units=_('manifests')):
846 units=_('manifests')):
854 yield chunk
847 yield chunk
855
848
856 def _manifestsdone(self):
849 def _manifestsdone(self):
857 return self.close()
850 return self.close()
858
851
859 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
852 def builddeltaheader(self, node, p1n, p2n, basenode, linknode, flags):
860 return struct.pack(
853 return struct.pack(
861 self.deltaheader, node, p1n, p2n, basenode, linknode, flags)
854 self.deltaheader, node, p1n, p2n, basenode, linknode, flags)
862
855
863 _packermap = {'01': (cg1packer, cg1unpacker),
856 _packermap = {'01': (cg1packer, cg1unpacker),
864 # cg2 adds support for exchanging generaldelta
857 # cg2 adds support for exchanging generaldelta
865 '02': (cg2packer, cg2unpacker),
858 '02': (cg2packer, cg2unpacker),
866 # cg3 adds support for exchanging revlog flags and treemanifests
859 # cg3 adds support for exchanging revlog flags and treemanifests
867 '03': (cg3packer, cg3unpacker),
860 '03': (cg3packer, cg3unpacker),
868 }
861 }
869
862
870 def allsupportedversions(repo):
863 def allsupportedversions(repo):
871 versions = set(_packermap.keys())
864 versions = set(_packermap.keys())
872 if not (repo.ui.configbool('experimental', 'changegroup3') or
865 if not (repo.ui.configbool('experimental', 'changegroup3') or
873 repo.ui.configbool('experimental', 'treemanifest') or
866 repo.ui.configbool('experimental', 'treemanifest') or
874 'treemanifest' in repo.requirements):
867 'treemanifest' in repo.requirements):
875 versions.discard('03')
868 versions.discard('03')
876 return versions
869 return versions
877
870
878 # Changegroup versions that can be applied to the repo
871 # Changegroup versions that can be applied to the repo
879 def supportedincomingversions(repo):
872 def supportedincomingversions(repo):
880 return allsupportedversions(repo)
873 return allsupportedversions(repo)
881
874
882 # Changegroup versions that can be created from the repo
875 # Changegroup versions that can be created from the repo
883 def supportedoutgoingversions(repo):
876 def supportedoutgoingversions(repo):
884 versions = allsupportedversions(repo)
877 versions = allsupportedversions(repo)
885 if 'treemanifest' in repo.requirements:
878 if 'treemanifest' in repo.requirements:
886 # Versions 01 and 02 support only flat manifests and it's just too
879 # Versions 01 and 02 support only flat manifests and it's just too
887 # expensive to convert between the flat manifest and tree manifest on
880 # expensive to convert between the flat manifest and tree manifest on
888 # the fly. Since tree manifests are hashed differently, all of history
881 # the fly. Since tree manifests are hashed differently, all of history
889 # would have to be converted. Instead, we simply don't even pretend to
882 # would have to be converted. Instead, we simply don't even pretend to
890 # support versions 01 and 02.
883 # support versions 01 and 02.
891 versions.discard('01')
884 versions.discard('01')
892 versions.discard('02')
885 versions.discard('02')
893 return versions
886 return versions
894
887
895 def safeversion(repo):
888 def safeversion(repo):
896 # Finds the smallest version that it's safe to assume clients of the repo
889 # Finds the smallest version that it's safe to assume clients of the repo
897 # will support. For example, all hg versions that support generaldelta also
890 # will support. For example, all hg versions that support generaldelta also
898 # support changegroup 02.
891 # support changegroup 02.
899 versions = supportedoutgoingversions(repo)
892 versions = supportedoutgoingversions(repo)
900 if 'generaldelta' in repo.requirements:
893 if 'generaldelta' in repo.requirements:
901 versions.discard('01')
894 versions.discard('01')
902 assert versions
895 assert versions
903 return min(versions)
896 return min(versions)
904
897
905 def getbundler(version, repo):
898 def getbundler(version, repo):
906 assert version in supportedoutgoingversions(repo)
899 assert version in supportedoutgoingversions(repo)
907 return _packermap[version][0](repo)
900 return _packermap[version][0](repo)
908
901
909 def getunbundler(version, fh, alg, extras=None):
902 def getunbundler(version, fh, alg, extras=None):
910 return _packermap[version][1](fh, alg, extras=extras)
903 return _packermap[version][1](fh, alg, extras=extras)
911
904
912 def _changegroupinfo(repo, nodes, source):
905 def _changegroupinfo(repo, nodes, source):
913 if repo.ui.verbose or source == 'bundle':
906 if repo.ui.verbose or source == 'bundle':
914 repo.ui.status(_("%d changesets found\n") % len(nodes))
907 repo.ui.status(_("%d changesets found\n") % len(nodes))
915 if repo.ui.debugflag:
908 if repo.ui.debugflag:
916 repo.ui.debug("list of changesets:\n")
909 repo.ui.debug("list of changesets:\n")
917 for node in nodes:
910 for node in nodes:
918 repo.ui.debug("%s\n" % hex(node))
911 repo.ui.debug("%s\n" % hex(node))
919
912
920 def getsubsetraw(repo, outgoing, bundler, source, fastpath=False):
913 def getsubsetraw(repo, outgoing, bundler, source, fastpath=False):
921 repo = repo.unfiltered()
914 repo = repo.unfiltered()
922 commonrevs = outgoing.common
915 commonrevs = outgoing.common
923 csets = outgoing.missing
916 csets = outgoing.missing
924 heads = outgoing.missingheads
917 heads = outgoing.missingheads
925 # We go through the fast path if we get told to, or if all (unfiltered
918 # We go through the fast path if we get told to, or if all (unfiltered
926 # heads have been requested (since we then know there all linkrevs will
919 # heads have been requested (since we then know there all linkrevs will
927 # be pulled by the client).
920 # be pulled by the client).
928 heads.sort()
921 heads.sort()
929 fastpathlinkrev = fastpath or (
922 fastpathlinkrev = fastpath or (
930 repo.filtername is None and heads == sorted(repo.heads()))
923 repo.filtername is None and heads == sorted(repo.heads()))
931
924
932 repo.hook('preoutgoing', throw=True, source=source)
925 repo.hook('preoutgoing', throw=True, source=source)
933 _changegroupinfo(repo, csets, source)
926 _changegroupinfo(repo, csets, source)
934 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
927 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
935
928
936 def getsubset(repo, outgoing, bundler, source, fastpath=False):
929 def getsubset(repo, outgoing, bundler, source, fastpath=False):
937 gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath)
930 gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath)
938 return getunbundler(bundler.version, util.chunkbuffer(gengroup), None,
931 return getunbundler(bundler.version, util.chunkbuffer(gengroup), None,
939 {'clcount': len(outgoing.missing)})
932 {'clcount': len(outgoing.missing)})
940
933
941 def changegroupsubset(repo, roots, heads, source, version='01'):
934 def changegroupsubset(repo, roots, heads, source, version='01'):
942 """Compute a changegroup consisting of all the nodes that are
935 """Compute a changegroup consisting of all the nodes that are
943 descendants of any of the roots and ancestors of any of the heads.
936 descendants of any of the roots and ancestors of any of the heads.
944 Return a chunkbuffer object whose read() method will return
937 Return a chunkbuffer object whose read() method will return
945 successive changegroup chunks.
938 successive changegroup chunks.
946
939
947 It is fairly complex as determining which filenodes and which
940 It is fairly complex as determining which filenodes and which
948 manifest nodes need to be included for the changeset to be complete
941 manifest nodes need to be included for the changeset to be complete
949 is non-trivial.
942 is non-trivial.
950
943
951 Another wrinkle is doing the reverse, figuring out which changeset in
944 Another wrinkle is doing the reverse, figuring out which changeset in
952 the changegroup a particular filenode or manifestnode belongs to.
945 the changegroup a particular filenode or manifestnode belongs to.
953 """
946 """
954 outgoing = discovery.outgoing(repo, missingroots=roots, missingheads=heads)
947 outgoing = discovery.outgoing(repo, missingroots=roots, missingheads=heads)
955 bundler = getbundler(version, repo)
948 bundler = getbundler(version, repo)
956 return getsubset(repo, outgoing, bundler, source)
949 return getsubset(repo, outgoing, bundler, source)
957
950
958 def getlocalchangegroupraw(repo, source, outgoing, version='01'):
951 def getlocalchangegroupraw(repo, source, outgoing, version='01'):
959 """Like getbundle, but taking a discovery.outgoing as an argument.
952 """Like getbundle, but taking a discovery.outgoing as an argument.
960
953
961 This is only implemented for local repos and reuses potentially
954 This is only implemented for local repos and reuses potentially
962 precomputed sets in outgoing. Returns a raw changegroup generator."""
955 precomputed sets in outgoing. Returns a raw changegroup generator."""
963 if not outgoing.missing:
956 if not outgoing.missing:
964 return None
957 return None
965 bundler = getbundler(version, repo)
958 bundler = getbundler(version, repo)
966 return getsubsetraw(repo, outgoing, bundler, source)
959 return getsubsetraw(repo, outgoing, bundler, source)
967
960
968 def getchangegroup(repo, source, outgoing, version='01'):
961 def getchangegroup(repo, source, outgoing, version='01'):
969 """Like getbundle, but taking a discovery.outgoing as an argument.
962 """Like getbundle, but taking a discovery.outgoing as an argument.
970
963
971 This is only implemented for local repos and reuses potentially
964 This is only implemented for local repos and reuses potentially
972 precomputed sets in outgoing."""
965 precomputed sets in outgoing."""
973 if not outgoing.missing:
966 if not outgoing.missing:
974 return None
967 return None
975 bundler = getbundler(version, repo)
968 bundler = getbundler(version, repo)
976 return getsubset(repo, outgoing, bundler, source)
969 return getsubset(repo, outgoing, bundler, source)
977
970
978 def getlocalchangegroup(repo, *args, **kwargs):
971 def getlocalchangegroup(repo, *args, **kwargs):
979 repo.ui.deprecwarn('getlocalchangegroup is deprecated, use getchangegroup',
972 repo.ui.deprecwarn('getlocalchangegroup is deprecated, use getchangegroup',
980 '4.3')
973 '4.3')
981 return getchangegroup(repo, *args, **kwargs)
974 return getchangegroup(repo, *args, **kwargs)
982
975
983 def changegroup(repo, basenodes, source):
976 def changegroup(repo, basenodes, source):
984 # to avoid a race we use changegroupsubset() (issue1320)
977 # to avoid a race we use changegroupsubset() (issue1320)
985 return changegroupsubset(repo, basenodes, repo.heads(), source)
978 return changegroupsubset(repo, basenodes, repo.heads(), source)
986
979
987 def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles):
980 def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles):
988 revisions = 0
981 revisions = 0
989 files = 0
982 files = 0
990 for chunkdata in iter(source.filelogheader, {}):
983 for chunkdata in iter(source.filelogheader, {}):
991 files += 1
984 files += 1
992 f = chunkdata["filename"]
985 f = chunkdata["filename"]
993 repo.ui.debug("adding %s revisions\n" % f)
986 repo.ui.debug("adding %s revisions\n" % f)
994 repo.ui.progress(_('files'), files, unit=_('files'),
987 repo.ui.progress(_('files'), files, unit=_('files'),
995 total=expectedfiles)
988 total=expectedfiles)
996 fl = repo.file(f)
989 fl = repo.file(f)
997 o = len(fl)
990 o = len(fl)
998 try:
991 try:
999 if not fl.addgroup(source, revmap, trp):
992 if not fl.addgroup(source, revmap, trp):
1000 raise error.Abort(_("received file revlog group is empty"))
993 raise error.Abort(_("received file revlog group is empty"))
1001 except error.CensoredBaseError as e:
994 except error.CensoredBaseError as e:
1002 raise error.Abort(_("received delta base is censored: %s") % e)
995 raise error.Abort(_("received delta base is censored: %s") % e)
1003 revisions += len(fl) - o
996 revisions += len(fl) - o
1004 if f in needfiles:
997 if f in needfiles:
1005 needs = needfiles[f]
998 needs = needfiles[f]
1006 for new in xrange(o, len(fl)):
999 for new in xrange(o, len(fl)):
1007 n = fl.node(new)
1000 n = fl.node(new)
1008 if n in needs:
1001 if n in needs:
1009 needs.remove(n)
1002 needs.remove(n)
1010 else:
1003 else:
1011 raise error.Abort(
1004 raise error.Abort(
1012 _("received spurious file revlog entry"))
1005 _("received spurious file revlog entry"))
1013 if not needs:
1006 if not needs:
1014 del needfiles[f]
1007 del needfiles[f]
1015 repo.ui.progress(_('files'), None)
1008 repo.ui.progress(_('files'), None)
1016
1009
1017 for f, needs in needfiles.iteritems():
1010 for f, needs in needfiles.iteritems():
1018 fl = repo.file(f)
1011 fl = repo.file(f)
1019 for n in needs:
1012 for n in needs:
1020 try:
1013 try:
1021 fl.rev(n)
1014 fl.rev(n)
1022 except error.LookupError:
1015 except error.LookupError:
1023 raise error.Abort(
1016 raise error.Abort(
1024 _('missing file data for %s:%s - run hg verify') %
1017 _('missing file data for %s:%s - run hg verify') %
1025 (f, hex(n)))
1018 (f, hex(n)))
1026
1019
1027 return revisions, files
1020 return revisions, files
@@ -1,2148 +1,2131 b''
1 > do_push()
1 > do_push()
2 > {
2 > {
3 > user=$1
3 > user=$1
4 > shift
4 > shift
5 > echo "Pushing as user $user"
5 > echo "Pushing as user $user"
6 > echo 'hgrc = """'
6 > echo 'hgrc = """'
7 > sed -n '/\[[ha]/,$p' b/.hg/hgrc | grep -v fakegroups.py
7 > sed -n '/\[[ha]/,$p' b/.hg/hgrc | grep -v fakegroups.py
8 > echo '"""'
8 > echo '"""'
9 > if test -f acl.config; then
9 > if test -f acl.config; then
10 > echo 'acl.config = """'
10 > echo 'acl.config = """'
11 > cat acl.config
11 > cat acl.config
12 > echo '"""'
12 > echo '"""'
13 > fi
13 > fi
14 > # On AIX /etc/profile sets LOGNAME read-only. So
14 > # On AIX /etc/profile sets LOGNAME read-only. So
15 > # LOGNAME=$user hg --cws a --debug push ../b
15 > # LOGNAME=$user hg --cws a --debug push ../b
16 > # fails with "This variable is read only."
16 > # fails with "This variable is read only."
17 > # Use env to work around this.
17 > # Use env to work around this.
18 > env LOGNAME=$user hg --cwd a --debug push ../b
18 > env LOGNAME=$user hg --cwd a --debug push ../b
19 > hg --cwd b rollback
19 > hg --cwd b rollback
20 > hg --cwd b --quiet tip
20 > hg --cwd b --quiet tip
21 > echo
21 > echo
22 > }
22 > }
23
23
24 > init_config()
24 > init_config()
25 > {
25 > {
26 > cat > fakegroups.py <<EOF
26 > cat > fakegroups.py <<EOF
27 > from hgext import acl
27 > from hgext import acl
28 > def fakegetusers(ui, group):
28 > def fakegetusers(ui, group):
29 > try:
29 > try:
30 > return acl._getusersorig(ui, group)
30 > return acl._getusersorig(ui, group)
31 > except:
31 > except:
32 > return ["fred", "betty"]
32 > return ["fred", "betty"]
33 > acl._getusersorig = acl._getusers
33 > acl._getusersorig = acl._getusers
34 > acl._getusers = fakegetusers
34 > acl._getusers = fakegetusers
35 > EOF
35 > EOF
36 > rm -f acl.config
36 > rm -f acl.config
37 > cat > $config <<EOF
37 > cat > $config <<EOF
38 > [hooks]
38 > [hooks]
39 > pretxnchangegroup.acl = python:hgext.acl.hook
39 > pretxnchangegroup.acl = python:hgext.acl.hook
40 > [acl]
40 > [acl]
41 > sources = push
41 > sources = push
42 > [extensions]
42 > [extensions]
43 > f=`pwd`/fakegroups.py
43 > f=`pwd`/fakegroups.py
44 > EOF
44 > EOF
45 > }
45 > }
46
46
47 $ hg init a
47 $ hg init a
48 $ cd a
48 $ cd a
49 $ mkdir foo foo/Bar quux
49 $ mkdir foo foo/Bar quux
50 $ echo 'in foo' > foo/file.txt
50 $ echo 'in foo' > foo/file.txt
51 $ echo 'in foo/Bar' > foo/Bar/file.txt
51 $ echo 'in foo/Bar' > foo/Bar/file.txt
52 $ echo 'in quux' > quux/file.py
52 $ echo 'in quux' > quux/file.py
53 $ hg add -q
53 $ hg add -q
54 $ hg ci -m 'add files' -d '1000000 0'
54 $ hg ci -m 'add files' -d '1000000 0'
55 $ echo >> foo/file.txt
55 $ echo >> foo/file.txt
56 $ hg ci -m 'change foo/file' -d '1000001 0'
56 $ hg ci -m 'change foo/file' -d '1000001 0'
57 $ echo >> foo/Bar/file.txt
57 $ echo >> foo/Bar/file.txt
58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
58 $ hg ci -m 'change foo/Bar/file' -d '1000002 0'
59 $ echo >> quux/file.py
59 $ echo >> quux/file.py
60 $ hg ci -m 'change quux/file' -d '1000003 0'
60 $ hg ci -m 'change quux/file' -d '1000003 0'
61 $ hg tip --quiet
61 $ hg tip --quiet
62 3:911600dab2ae
62 3:911600dab2ae
63
63
64 $ cd ..
64 $ cd ..
65 $ hg clone -r 0 a b
65 $ hg clone -r 0 a b
66 adding changesets
66 adding changesets
67 adding manifests
67 adding manifests
68 adding file changes
68 adding file changes
69 added 1 changesets with 3 changes to 3 files
69 added 1 changesets with 3 changes to 3 files
70 updating to branch default
70 updating to branch default
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
72
72
73 $ config=b/.hg/hgrc
73 $ config=b/.hg/hgrc
74
74
75 Extension disabled for lack of a hook
75 Extension disabled for lack of a hook
76
76
77 $ do_push fred
77 $ do_push fred
78 Pushing as user fred
78 Pushing as user fred
79 hgrc = """
79 hgrc = """
80 """
80 """
81 pushing to ../b
81 pushing to ../b
82 query 1; heads
82 query 1; heads
83 searching for changes
83 searching for changes
84 all remote heads known locally
84 all remote heads known locally
85 listing keys for "phases"
85 listing keys for "phases"
86 checking for updated bookmarks
86 checking for updated bookmarks
87 listing keys for "bookmarks"
87 listing keys for "bookmarks"
88 listing keys for "bookmarks"
88 listing keys for "bookmarks"
89 3 changesets found
89 3 changesets found
90 list of changesets:
90 list of changesets:
91 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
91 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
92 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
92 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
93 911600dab2ae7a9baff75958b84fe606851ce955
93 911600dab2ae7a9baff75958b84fe606851ce955
94 bundle2-output-bundle: "HG20", 4 parts total
94 bundle2-output-bundle: "HG20", 4 parts total
95 bundle2-output-part: "replycaps" 155 bytes payload
95 bundle2-output-part: "replycaps" 155 bytes payload
96 bundle2-output-part: "check:heads" streamed payload
96 bundle2-output-part: "check:heads" streamed payload
97 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
97 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
98 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
98 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
99 bundle2-input-bundle: with-transaction
99 bundle2-input-bundle: with-transaction
100 bundle2-input-part: "replycaps" supported
100 bundle2-input-part: "replycaps" supported
101 bundle2-input-part: total payload size 155
101 bundle2-input-part: total payload size 155
102 bundle2-input-part: "check:heads" supported
102 bundle2-input-part: "check:heads" supported
103 bundle2-input-part: total payload size 20
103 bundle2-input-part: total payload size 20
104 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
104 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
105 adding changesets
105 adding changesets
106 add changeset ef1ea85a6374
106 add changeset ef1ea85a6374
107 add changeset f9cafe1212c8
107 add changeset f9cafe1212c8
108 add changeset 911600dab2ae
108 add changeset 911600dab2ae
109 adding manifests
109 adding manifests
110 adding file changes
110 adding file changes
111 adding foo/Bar/file.txt revisions
111 adding foo/Bar/file.txt revisions
112 adding foo/file.txt revisions
112 adding foo/file.txt revisions
113 adding quux/file.py revisions
113 adding quux/file.py revisions
114 added 3 changesets with 3 changes to 3 files
114 added 3 changesets with 3 changes to 3 files
115 bundle2-input-part: total payload size 1553
115 bundle2-input-part: total payload size 1553
116 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
116 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
117 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
117 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
118 bundle2-input-bundle: 3 parts total
118 bundle2-input-bundle: 3 parts total
119 updating the branch cache
119 updating the branch cache
120 bundle2-output-bundle: "HG20", 2 parts total
120 bundle2-output-bundle: "HG20", 2 parts total
121 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
121 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
122 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
122 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
123 bundle2-input-bundle: with-transaction
123 bundle2-input-bundle: with-transaction
124 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
124 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
125 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
125 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
126 bundle2-input-bundle: 1 parts total
126 bundle2-input-bundle: 1 parts total
127 listing keys for "phases"
127 listing keys for "phases"
128 repository tip rolled back to revision 0 (undo push)
128 repository tip rolled back to revision 0 (undo push)
129 0:6675d58eff77
129 0:6675d58eff77
130
130
131
131
132 $ echo '[hooks]' >> $config
132 $ echo '[hooks]' >> $config
133 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
133 $ echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
134
134
135 Extension disabled for lack of acl.sources
135 Extension disabled for lack of acl.sources
136
136
137 $ do_push fred
137 $ do_push fred
138 Pushing as user fred
138 Pushing as user fred
139 hgrc = """
139 hgrc = """
140 [hooks]
140 [hooks]
141 pretxnchangegroup.acl = python:hgext.acl.hook
141 pretxnchangegroup.acl = python:hgext.acl.hook
142 """
142 """
143 pushing to ../b
143 pushing to ../b
144 query 1; heads
144 query 1; heads
145 searching for changes
145 searching for changes
146 all remote heads known locally
146 all remote heads known locally
147 listing keys for "phases"
147 listing keys for "phases"
148 checking for updated bookmarks
148 checking for updated bookmarks
149 listing keys for "bookmarks"
149 listing keys for "bookmarks"
150 invalid branchheads cache (served): tip differs
151 listing keys for "bookmarks"
150 listing keys for "bookmarks"
152 3 changesets found
151 3 changesets found
153 list of changesets:
152 list of changesets:
154 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
153 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
155 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
154 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
156 911600dab2ae7a9baff75958b84fe606851ce955
155 911600dab2ae7a9baff75958b84fe606851ce955
157 bundle2-output-bundle: "HG20", 4 parts total
156 bundle2-output-bundle: "HG20", 4 parts total
158 bundle2-output-part: "replycaps" 155 bytes payload
157 bundle2-output-part: "replycaps" 155 bytes payload
159 bundle2-output-part: "check:heads" streamed payload
158 bundle2-output-part: "check:heads" streamed payload
160 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
159 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
161 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
160 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
162 bundle2-input-bundle: with-transaction
161 bundle2-input-bundle: with-transaction
163 bundle2-input-part: "replycaps" supported
162 bundle2-input-part: "replycaps" supported
164 bundle2-input-part: total payload size 155
163 bundle2-input-part: total payload size 155
165 bundle2-input-part: "check:heads" supported
164 bundle2-input-part: "check:heads" supported
166 bundle2-input-part: total payload size 20
165 bundle2-input-part: total payload size 20
167 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
166 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
168 adding changesets
167 adding changesets
169 add changeset ef1ea85a6374
168 add changeset ef1ea85a6374
170 add changeset f9cafe1212c8
169 add changeset f9cafe1212c8
171 add changeset 911600dab2ae
170 add changeset 911600dab2ae
172 adding manifests
171 adding manifests
173 adding file changes
172 adding file changes
174 adding foo/Bar/file.txt revisions
173 adding foo/Bar/file.txt revisions
175 adding foo/file.txt revisions
174 adding foo/file.txt revisions
176 adding quux/file.py revisions
175 adding quux/file.py revisions
177 added 3 changesets with 3 changes to 3 files
176 added 3 changesets with 3 changes to 3 files
178 calling hook pretxnchangegroup.acl: hgext.acl.hook
177 calling hook pretxnchangegroup.acl: hgext.acl.hook
179 acl: changes have source "push" - skipping
178 acl: changes have source "push" - skipping
180 bundle2-input-part: total payload size 1553
179 bundle2-input-part: total payload size 1553
181 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
180 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
182 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
181 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
183 bundle2-input-bundle: 3 parts total
182 bundle2-input-bundle: 3 parts total
184 updating the branch cache
183 updating the branch cache
185 bundle2-output-bundle: "HG20", 2 parts total
184 bundle2-output-bundle: "HG20", 2 parts total
186 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
185 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
187 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
186 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
188 bundle2-input-bundle: with-transaction
187 bundle2-input-bundle: with-transaction
189 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
188 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
190 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
189 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
191 bundle2-input-bundle: 1 parts total
190 bundle2-input-bundle: 1 parts total
192 listing keys for "phases"
191 listing keys for "phases"
193 repository tip rolled back to revision 0 (undo push)
192 repository tip rolled back to revision 0 (undo push)
194 0:6675d58eff77
193 0:6675d58eff77
195
194
196
195
197 No [acl.allow]/[acl.deny]
196 No [acl.allow]/[acl.deny]
198
197
199 $ echo '[acl]' >> $config
198 $ echo '[acl]' >> $config
200 $ echo 'sources = push' >> $config
199 $ echo 'sources = push' >> $config
201 $ do_push fred
200 $ do_push fred
202 Pushing as user fred
201 Pushing as user fred
203 hgrc = """
202 hgrc = """
204 [hooks]
203 [hooks]
205 pretxnchangegroup.acl = python:hgext.acl.hook
204 pretxnchangegroup.acl = python:hgext.acl.hook
206 [acl]
205 [acl]
207 sources = push
206 sources = push
208 """
207 """
209 pushing to ../b
208 pushing to ../b
210 query 1; heads
209 query 1; heads
211 searching for changes
210 searching for changes
212 all remote heads known locally
211 all remote heads known locally
213 listing keys for "phases"
212 listing keys for "phases"
214 checking for updated bookmarks
213 checking for updated bookmarks
215 listing keys for "bookmarks"
214 listing keys for "bookmarks"
216 invalid branchheads cache (served): tip differs
217 listing keys for "bookmarks"
215 listing keys for "bookmarks"
218 3 changesets found
216 3 changesets found
219 list of changesets:
217 list of changesets:
220 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
218 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
221 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
219 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
222 911600dab2ae7a9baff75958b84fe606851ce955
220 911600dab2ae7a9baff75958b84fe606851ce955
223 bundle2-output-bundle: "HG20", 4 parts total
221 bundle2-output-bundle: "HG20", 4 parts total
224 bundle2-output-part: "replycaps" 155 bytes payload
222 bundle2-output-part: "replycaps" 155 bytes payload
225 bundle2-output-part: "check:heads" streamed payload
223 bundle2-output-part: "check:heads" streamed payload
226 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
224 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
227 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
225 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
228 bundle2-input-bundle: with-transaction
226 bundle2-input-bundle: with-transaction
229 bundle2-input-part: "replycaps" supported
227 bundle2-input-part: "replycaps" supported
230 bundle2-input-part: total payload size 155
228 bundle2-input-part: total payload size 155
231 bundle2-input-part: "check:heads" supported
229 bundle2-input-part: "check:heads" supported
232 bundle2-input-part: total payload size 20
230 bundle2-input-part: total payload size 20
233 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
231 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
234 adding changesets
232 adding changesets
235 add changeset ef1ea85a6374
233 add changeset ef1ea85a6374
236 add changeset f9cafe1212c8
234 add changeset f9cafe1212c8
237 add changeset 911600dab2ae
235 add changeset 911600dab2ae
238 adding manifests
236 adding manifests
239 adding file changes
237 adding file changes
240 adding foo/Bar/file.txt revisions
238 adding foo/Bar/file.txt revisions
241 adding foo/file.txt revisions
239 adding foo/file.txt revisions
242 adding quux/file.py revisions
240 adding quux/file.py revisions
243 added 3 changesets with 3 changes to 3 files
241 added 3 changesets with 3 changes to 3 files
244 calling hook pretxnchangegroup.acl: hgext.acl.hook
242 calling hook pretxnchangegroup.acl: hgext.acl.hook
245 acl: checking access for user "fred"
243 acl: checking access for user "fred"
246 acl: acl.allow.branches not enabled
244 acl: acl.allow.branches not enabled
247 acl: acl.deny.branches not enabled
245 acl: acl.deny.branches not enabled
248 acl: acl.allow not enabled
246 acl: acl.allow not enabled
249 acl: acl.deny not enabled
247 acl: acl.deny not enabled
250 acl: branch access granted: "ef1ea85a6374" on branch "default"
248 acl: branch access granted: "ef1ea85a6374" on branch "default"
251 acl: path access granted: "ef1ea85a6374"
249 acl: path access granted: "ef1ea85a6374"
252 acl: branch access granted: "f9cafe1212c8" on branch "default"
250 acl: branch access granted: "f9cafe1212c8" on branch "default"
253 acl: path access granted: "f9cafe1212c8"
251 acl: path access granted: "f9cafe1212c8"
254 acl: branch access granted: "911600dab2ae" on branch "default"
252 acl: branch access granted: "911600dab2ae" on branch "default"
255 acl: path access granted: "911600dab2ae"
253 acl: path access granted: "911600dab2ae"
256 bundle2-input-part: total payload size 1553
254 bundle2-input-part: total payload size 1553
257 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
255 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
258 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
256 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
259 bundle2-input-bundle: 3 parts total
257 bundle2-input-bundle: 3 parts total
260 updating the branch cache
258 updating the branch cache
261 bundle2-output-bundle: "HG20", 2 parts total
259 bundle2-output-bundle: "HG20", 2 parts total
262 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
260 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
263 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
261 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
264 bundle2-input-bundle: with-transaction
262 bundle2-input-bundle: with-transaction
265 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
263 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
266 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
264 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
267 bundle2-input-bundle: 1 parts total
265 bundle2-input-bundle: 1 parts total
268 listing keys for "phases"
266 listing keys for "phases"
269 repository tip rolled back to revision 0 (undo push)
267 repository tip rolled back to revision 0 (undo push)
270 0:6675d58eff77
268 0:6675d58eff77
271
269
272
270
273 Empty [acl.allow]
271 Empty [acl.allow]
274
272
275 $ echo '[acl.allow]' >> $config
273 $ echo '[acl.allow]' >> $config
276 $ do_push fred
274 $ do_push fred
277 Pushing as user fred
275 Pushing as user fred
278 hgrc = """
276 hgrc = """
279 [hooks]
277 [hooks]
280 pretxnchangegroup.acl = python:hgext.acl.hook
278 pretxnchangegroup.acl = python:hgext.acl.hook
281 [acl]
279 [acl]
282 sources = push
280 sources = push
283 [acl.allow]
281 [acl.allow]
284 """
282 """
285 pushing to ../b
283 pushing to ../b
286 query 1; heads
284 query 1; heads
287 searching for changes
285 searching for changes
288 all remote heads known locally
286 all remote heads known locally
289 listing keys for "phases"
287 listing keys for "phases"
290 checking for updated bookmarks
288 checking for updated bookmarks
291 listing keys for "bookmarks"
289 listing keys for "bookmarks"
292 invalid branchheads cache (served): tip differs
293 listing keys for "bookmarks"
290 listing keys for "bookmarks"
294 3 changesets found
291 3 changesets found
295 list of changesets:
292 list of changesets:
296 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
293 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
297 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
294 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
298 911600dab2ae7a9baff75958b84fe606851ce955
295 911600dab2ae7a9baff75958b84fe606851ce955
299 bundle2-output-bundle: "HG20", 4 parts total
296 bundle2-output-bundle: "HG20", 4 parts total
300 bundle2-output-part: "replycaps" 155 bytes payload
297 bundle2-output-part: "replycaps" 155 bytes payload
301 bundle2-output-part: "check:heads" streamed payload
298 bundle2-output-part: "check:heads" streamed payload
302 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
299 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
303 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
300 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
304 bundle2-input-bundle: with-transaction
301 bundle2-input-bundle: with-transaction
305 bundle2-input-part: "replycaps" supported
302 bundle2-input-part: "replycaps" supported
306 bundle2-input-part: total payload size 155
303 bundle2-input-part: total payload size 155
307 bundle2-input-part: "check:heads" supported
304 bundle2-input-part: "check:heads" supported
308 bundle2-input-part: total payload size 20
305 bundle2-input-part: total payload size 20
309 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
306 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
310 adding changesets
307 adding changesets
311 add changeset ef1ea85a6374
308 add changeset ef1ea85a6374
312 add changeset f9cafe1212c8
309 add changeset f9cafe1212c8
313 add changeset 911600dab2ae
310 add changeset 911600dab2ae
314 adding manifests
311 adding manifests
315 adding file changes
312 adding file changes
316 adding foo/Bar/file.txt revisions
313 adding foo/Bar/file.txt revisions
317 adding foo/file.txt revisions
314 adding foo/file.txt revisions
318 adding quux/file.py revisions
315 adding quux/file.py revisions
319 added 3 changesets with 3 changes to 3 files
316 added 3 changesets with 3 changes to 3 files
320 calling hook pretxnchangegroup.acl: hgext.acl.hook
317 calling hook pretxnchangegroup.acl: hgext.acl.hook
321 acl: checking access for user "fred"
318 acl: checking access for user "fred"
322 acl: acl.allow.branches not enabled
319 acl: acl.allow.branches not enabled
323 acl: acl.deny.branches not enabled
320 acl: acl.deny.branches not enabled
324 acl: acl.allow enabled, 0 entries for user fred
321 acl: acl.allow enabled, 0 entries for user fred
325 acl: acl.deny not enabled
322 acl: acl.deny not enabled
326 acl: branch access granted: "ef1ea85a6374" on branch "default"
323 acl: branch access granted: "ef1ea85a6374" on branch "default"
327 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
324 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
328 bundle2-input-part: total payload size 1553
325 bundle2-input-part: total payload size 1553
329 bundle2-input-bundle: 3 parts total
326 bundle2-input-bundle: 3 parts total
330 transaction abort!
327 transaction abort!
331 rollback completed
328 rollback completed
332 abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
329 abort: acl: user "fred" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
333 no rollback information available
330 no rollback information available
334 0:6675d58eff77
331 0:6675d58eff77
335
332
336
333
337 fred is allowed inside foo/
334 fred is allowed inside foo/
338
335
339 $ echo 'foo/** = fred' >> $config
336 $ echo 'foo/** = fred' >> $config
340 $ do_push fred
337 $ do_push fred
341 Pushing as user fred
338 Pushing as user fred
342 hgrc = """
339 hgrc = """
343 [hooks]
340 [hooks]
344 pretxnchangegroup.acl = python:hgext.acl.hook
341 pretxnchangegroup.acl = python:hgext.acl.hook
345 [acl]
342 [acl]
346 sources = push
343 sources = push
347 [acl.allow]
344 [acl.allow]
348 foo/** = fred
345 foo/** = fred
349 """
346 """
350 pushing to ../b
347 pushing to ../b
351 query 1; heads
348 query 1; heads
352 searching for changes
349 searching for changes
353 all remote heads known locally
350 all remote heads known locally
354 listing keys for "phases"
351 listing keys for "phases"
355 checking for updated bookmarks
352 checking for updated bookmarks
356 listing keys for "bookmarks"
353 listing keys for "bookmarks"
357 invalid branchheads cache (served): tip differs
358 listing keys for "bookmarks"
354 listing keys for "bookmarks"
359 3 changesets found
355 3 changesets found
360 list of changesets:
356 list of changesets:
361 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
357 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
362 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
358 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
363 911600dab2ae7a9baff75958b84fe606851ce955
359 911600dab2ae7a9baff75958b84fe606851ce955
364 bundle2-output-bundle: "HG20", 4 parts total
360 bundle2-output-bundle: "HG20", 4 parts total
365 bundle2-output-part: "replycaps" 155 bytes payload
361 bundle2-output-part: "replycaps" 155 bytes payload
366 bundle2-output-part: "check:heads" streamed payload
362 bundle2-output-part: "check:heads" streamed payload
367 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
363 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
368 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
364 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
369 bundle2-input-bundle: with-transaction
365 bundle2-input-bundle: with-transaction
370 bundle2-input-part: "replycaps" supported
366 bundle2-input-part: "replycaps" supported
371 bundle2-input-part: total payload size 155
367 bundle2-input-part: total payload size 155
372 bundle2-input-part: "check:heads" supported
368 bundle2-input-part: "check:heads" supported
373 bundle2-input-part: total payload size 20
369 bundle2-input-part: total payload size 20
374 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
370 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
375 adding changesets
371 adding changesets
376 add changeset ef1ea85a6374
372 add changeset ef1ea85a6374
377 add changeset f9cafe1212c8
373 add changeset f9cafe1212c8
378 add changeset 911600dab2ae
374 add changeset 911600dab2ae
379 adding manifests
375 adding manifests
380 adding file changes
376 adding file changes
381 adding foo/Bar/file.txt revisions
377 adding foo/Bar/file.txt revisions
382 adding foo/file.txt revisions
378 adding foo/file.txt revisions
383 adding quux/file.py revisions
379 adding quux/file.py revisions
384 added 3 changesets with 3 changes to 3 files
380 added 3 changesets with 3 changes to 3 files
385 calling hook pretxnchangegroup.acl: hgext.acl.hook
381 calling hook pretxnchangegroup.acl: hgext.acl.hook
386 acl: checking access for user "fred"
382 acl: checking access for user "fred"
387 acl: acl.allow.branches not enabled
383 acl: acl.allow.branches not enabled
388 acl: acl.deny.branches not enabled
384 acl: acl.deny.branches not enabled
389 acl: acl.allow enabled, 1 entries for user fred
385 acl: acl.allow enabled, 1 entries for user fred
390 acl: acl.deny not enabled
386 acl: acl.deny not enabled
391 acl: branch access granted: "ef1ea85a6374" on branch "default"
387 acl: branch access granted: "ef1ea85a6374" on branch "default"
392 acl: path access granted: "ef1ea85a6374"
388 acl: path access granted: "ef1ea85a6374"
393 acl: branch access granted: "f9cafe1212c8" on branch "default"
389 acl: branch access granted: "f9cafe1212c8" on branch "default"
394 acl: path access granted: "f9cafe1212c8"
390 acl: path access granted: "f9cafe1212c8"
395 acl: branch access granted: "911600dab2ae" on branch "default"
391 acl: branch access granted: "911600dab2ae" on branch "default"
396 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
392 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
397 bundle2-input-part: total payload size 1553
393 bundle2-input-part: total payload size 1553
398 bundle2-input-bundle: 3 parts total
394 bundle2-input-bundle: 3 parts total
399 transaction abort!
395 transaction abort!
400 rollback completed
396 rollback completed
401 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
397 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
402 no rollback information available
398 no rollback information available
403 0:6675d58eff77
399 0:6675d58eff77
404
400
405
401
406 Empty [acl.deny]
402 Empty [acl.deny]
407
403
408 $ echo '[acl.deny]' >> $config
404 $ echo '[acl.deny]' >> $config
409 $ do_push barney
405 $ do_push barney
410 Pushing as user barney
406 Pushing as user barney
411 hgrc = """
407 hgrc = """
412 [hooks]
408 [hooks]
413 pretxnchangegroup.acl = python:hgext.acl.hook
409 pretxnchangegroup.acl = python:hgext.acl.hook
414 [acl]
410 [acl]
415 sources = push
411 sources = push
416 [acl.allow]
412 [acl.allow]
417 foo/** = fred
413 foo/** = fred
418 [acl.deny]
414 [acl.deny]
419 """
415 """
420 pushing to ../b
416 pushing to ../b
421 query 1; heads
417 query 1; heads
422 searching for changes
418 searching for changes
423 all remote heads known locally
419 all remote heads known locally
424 listing keys for "phases"
420 listing keys for "phases"
425 checking for updated bookmarks
421 checking for updated bookmarks
426 listing keys for "bookmarks"
422 listing keys for "bookmarks"
427 invalid branchheads cache (served): tip differs
428 listing keys for "bookmarks"
423 listing keys for "bookmarks"
429 3 changesets found
424 3 changesets found
430 list of changesets:
425 list of changesets:
431 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
426 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
432 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
427 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
433 911600dab2ae7a9baff75958b84fe606851ce955
428 911600dab2ae7a9baff75958b84fe606851ce955
434 bundle2-output-bundle: "HG20", 4 parts total
429 bundle2-output-bundle: "HG20", 4 parts total
435 bundle2-output-part: "replycaps" 155 bytes payload
430 bundle2-output-part: "replycaps" 155 bytes payload
436 bundle2-output-part: "check:heads" streamed payload
431 bundle2-output-part: "check:heads" streamed payload
437 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
432 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
438 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
433 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
439 bundle2-input-bundle: with-transaction
434 bundle2-input-bundle: with-transaction
440 bundle2-input-part: "replycaps" supported
435 bundle2-input-part: "replycaps" supported
441 bundle2-input-part: total payload size 155
436 bundle2-input-part: total payload size 155
442 bundle2-input-part: "check:heads" supported
437 bundle2-input-part: "check:heads" supported
443 bundle2-input-part: total payload size 20
438 bundle2-input-part: total payload size 20
444 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
439 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
445 adding changesets
440 adding changesets
446 add changeset ef1ea85a6374
441 add changeset ef1ea85a6374
447 add changeset f9cafe1212c8
442 add changeset f9cafe1212c8
448 add changeset 911600dab2ae
443 add changeset 911600dab2ae
449 adding manifests
444 adding manifests
450 adding file changes
445 adding file changes
451 adding foo/Bar/file.txt revisions
446 adding foo/Bar/file.txt revisions
452 adding foo/file.txt revisions
447 adding foo/file.txt revisions
453 adding quux/file.py revisions
448 adding quux/file.py revisions
454 added 3 changesets with 3 changes to 3 files
449 added 3 changesets with 3 changes to 3 files
455 calling hook pretxnchangegroup.acl: hgext.acl.hook
450 calling hook pretxnchangegroup.acl: hgext.acl.hook
456 acl: checking access for user "barney"
451 acl: checking access for user "barney"
457 acl: acl.allow.branches not enabled
452 acl: acl.allow.branches not enabled
458 acl: acl.deny.branches not enabled
453 acl: acl.deny.branches not enabled
459 acl: acl.allow enabled, 0 entries for user barney
454 acl: acl.allow enabled, 0 entries for user barney
460 acl: acl.deny enabled, 0 entries for user barney
455 acl: acl.deny enabled, 0 entries for user barney
461 acl: branch access granted: "ef1ea85a6374" on branch "default"
456 acl: branch access granted: "ef1ea85a6374" on branch "default"
462 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
457 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
463 bundle2-input-part: total payload size 1553
458 bundle2-input-part: total payload size 1553
464 bundle2-input-bundle: 3 parts total
459 bundle2-input-bundle: 3 parts total
465 transaction abort!
460 transaction abort!
466 rollback completed
461 rollback completed
467 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
462 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
468 no rollback information available
463 no rollback information available
469 0:6675d58eff77
464 0:6675d58eff77
470
465
471
466
472 fred is allowed inside foo/, but not foo/bar/ (case matters)
467 fred is allowed inside foo/, but not foo/bar/ (case matters)
473
468
474 $ echo 'foo/bar/** = fred' >> $config
469 $ echo 'foo/bar/** = fred' >> $config
475 $ do_push fred
470 $ do_push fred
476 Pushing as user fred
471 Pushing as user fred
477 hgrc = """
472 hgrc = """
478 [hooks]
473 [hooks]
479 pretxnchangegroup.acl = python:hgext.acl.hook
474 pretxnchangegroup.acl = python:hgext.acl.hook
480 [acl]
475 [acl]
481 sources = push
476 sources = push
482 [acl.allow]
477 [acl.allow]
483 foo/** = fred
478 foo/** = fred
484 [acl.deny]
479 [acl.deny]
485 foo/bar/** = fred
480 foo/bar/** = fred
486 """
481 """
487 pushing to ../b
482 pushing to ../b
488 query 1; heads
483 query 1; heads
489 searching for changes
484 searching for changes
490 all remote heads known locally
485 all remote heads known locally
491 listing keys for "phases"
486 listing keys for "phases"
492 checking for updated bookmarks
487 checking for updated bookmarks
493 listing keys for "bookmarks"
488 listing keys for "bookmarks"
494 invalid branchheads cache (served): tip differs
495 listing keys for "bookmarks"
489 listing keys for "bookmarks"
496 3 changesets found
490 3 changesets found
497 list of changesets:
491 list of changesets:
498 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
492 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
499 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
493 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
500 911600dab2ae7a9baff75958b84fe606851ce955
494 911600dab2ae7a9baff75958b84fe606851ce955
501 bundle2-output-bundle: "HG20", 4 parts total
495 bundle2-output-bundle: "HG20", 4 parts total
502 bundle2-output-part: "replycaps" 155 bytes payload
496 bundle2-output-part: "replycaps" 155 bytes payload
503 bundle2-output-part: "check:heads" streamed payload
497 bundle2-output-part: "check:heads" streamed payload
504 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
498 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
505 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
499 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
506 bundle2-input-bundle: with-transaction
500 bundle2-input-bundle: with-transaction
507 bundle2-input-part: "replycaps" supported
501 bundle2-input-part: "replycaps" supported
508 bundle2-input-part: total payload size 155
502 bundle2-input-part: total payload size 155
509 bundle2-input-part: "check:heads" supported
503 bundle2-input-part: "check:heads" supported
510 bundle2-input-part: total payload size 20
504 bundle2-input-part: total payload size 20
511 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
505 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
512 adding changesets
506 adding changesets
513 add changeset ef1ea85a6374
507 add changeset ef1ea85a6374
514 add changeset f9cafe1212c8
508 add changeset f9cafe1212c8
515 add changeset 911600dab2ae
509 add changeset 911600dab2ae
516 adding manifests
510 adding manifests
517 adding file changes
511 adding file changes
518 adding foo/Bar/file.txt revisions
512 adding foo/Bar/file.txt revisions
519 adding foo/file.txt revisions
513 adding foo/file.txt revisions
520 adding quux/file.py revisions
514 adding quux/file.py revisions
521 added 3 changesets with 3 changes to 3 files
515 added 3 changesets with 3 changes to 3 files
522 calling hook pretxnchangegroup.acl: hgext.acl.hook
516 calling hook pretxnchangegroup.acl: hgext.acl.hook
523 acl: checking access for user "fred"
517 acl: checking access for user "fred"
524 acl: acl.allow.branches not enabled
518 acl: acl.allow.branches not enabled
525 acl: acl.deny.branches not enabled
519 acl: acl.deny.branches not enabled
526 acl: acl.allow enabled, 1 entries for user fred
520 acl: acl.allow enabled, 1 entries for user fred
527 acl: acl.deny enabled, 1 entries for user fred
521 acl: acl.deny enabled, 1 entries for user fred
528 acl: branch access granted: "ef1ea85a6374" on branch "default"
522 acl: branch access granted: "ef1ea85a6374" on branch "default"
529 acl: path access granted: "ef1ea85a6374"
523 acl: path access granted: "ef1ea85a6374"
530 acl: branch access granted: "f9cafe1212c8" on branch "default"
524 acl: branch access granted: "f9cafe1212c8" on branch "default"
531 acl: path access granted: "f9cafe1212c8"
525 acl: path access granted: "f9cafe1212c8"
532 acl: branch access granted: "911600dab2ae" on branch "default"
526 acl: branch access granted: "911600dab2ae" on branch "default"
533 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
527 error: pretxnchangegroup.acl hook failed: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
534 bundle2-input-part: total payload size 1553
528 bundle2-input-part: total payload size 1553
535 bundle2-input-bundle: 3 parts total
529 bundle2-input-bundle: 3 parts total
536 transaction abort!
530 transaction abort!
537 rollback completed
531 rollback completed
538 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
532 abort: acl: user "fred" not allowed on "quux/file.py" (changeset "911600dab2ae")
539 no rollback information available
533 no rollback information available
540 0:6675d58eff77
534 0:6675d58eff77
541
535
542
536
543 fred is allowed inside foo/, but not foo/Bar/
537 fred is allowed inside foo/, but not foo/Bar/
544
538
545 $ echo 'foo/Bar/** = fred' >> $config
539 $ echo 'foo/Bar/** = fred' >> $config
546 $ do_push fred
540 $ do_push fred
547 Pushing as user fred
541 Pushing as user fred
548 hgrc = """
542 hgrc = """
549 [hooks]
543 [hooks]
550 pretxnchangegroup.acl = python:hgext.acl.hook
544 pretxnchangegroup.acl = python:hgext.acl.hook
551 [acl]
545 [acl]
552 sources = push
546 sources = push
553 [acl.allow]
547 [acl.allow]
554 foo/** = fred
548 foo/** = fred
555 [acl.deny]
549 [acl.deny]
556 foo/bar/** = fred
550 foo/bar/** = fred
557 foo/Bar/** = fred
551 foo/Bar/** = fred
558 """
552 """
559 pushing to ../b
553 pushing to ../b
560 query 1; heads
554 query 1; heads
561 searching for changes
555 searching for changes
562 all remote heads known locally
556 all remote heads known locally
563 listing keys for "phases"
557 listing keys for "phases"
564 checking for updated bookmarks
558 checking for updated bookmarks
565 listing keys for "bookmarks"
559 listing keys for "bookmarks"
566 invalid branchheads cache (served): tip differs
567 listing keys for "bookmarks"
560 listing keys for "bookmarks"
568 3 changesets found
561 3 changesets found
569 list of changesets:
562 list of changesets:
570 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
563 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
571 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
564 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
572 911600dab2ae7a9baff75958b84fe606851ce955
565 911600dab2ae7a9baff75958b84fe606851ce955
573 bundle2-output-bundle: "HG20", 4 parts total
566 bundle2-output-bundle: "HG20", 4 parts total
574 bundle2-output-part: "replycaps" 155 bytes payload
567 bundle2-output-part: "replycaps" 155 bytes payload
575 bundle2-output-part: "check:heads" streamed payload
568 bundle2-output-part: "check:heads" streamed payload
576 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
569 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
577 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
570 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
578 bundle2-input-bundle: with-transaction
571 bundle2-input-bundle: with-transaction
579 bundle2-input-part: "replycaps" supported
572 bundle2-input-part: "replycaps" supported
580 bundle2-input-part: total payload size 155
573 bundle2-input-part: total payload size 155
581 bundle2-input-part: "check:heads" supported
574 bundle2-input-part: "check:heads" supported
582 bundle2-input-part: total payload size 20
575 bundle2-input-part: total payload size 20
583 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
576 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
584 adding changesets
577 adding changesets
585 add changeset ef1ea85a6374
578 add changeset ef1ea85a6374
586 add changeset f9cafe1212c8
579 add changeset f9cafe1212c8
587 add changeset 911600dab2ae
580 add changeset 911600dab2ae
588 adding manifests
581 adding manifests
589 adding file changes
582 adding file changes
590 adding foo/Bar/file.txt revisions
583 adding foo/Bar/file.txt revisions
591 adding foo/file.txt revisions
584 adding foo/file.txt revisions
592 adding quux/file.py revisions
585 adding quux/file.py revisions
593 added 3 changesets with 3 changes to 3 files
586 added 3 changesets with 3 changes to 3 files
594 calling hook pretxnchangegroup.acl: hgext.acl.hook
587 calling hook pretxnchangegroup.acl: hgext.acl.hook
595 acl: checking access for user "fred"
588 acl: checking access for user "fred"
596 acl: acl.allow.branches not enabled
589 acl: acl.allow.branches not enabled
597 acl: acl.deny.branches not enabled
590 acl: acl.deny.branches not enabled
598 acl: acl.allow enabled, 1 entries for user fred
591 acl: acl.allow enabled, 1 entries for user fred
599 acl: acl.deny enabled, 2 entries for user fred
592 acl: acl.deny enabled, 2 entries for user fred
600 acl: branch access granted: "ef1ea85a6374" on branch "default"
593 acl: branch access granted: "ef1ea85a6374" on branch "default"
601 acl: path access granted: "ef1ea85a6374"
594 acl: path access granted: "ef1ea85a6374"
602 acl: branch access granted: "f9cafe1212c8" on branch "default"
595 acl: branch access granted: "f9cafe1212c8" on branch "default"
603 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
596 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
604 bundle2-input-part: total payload size 1553
597 bundle2-input-part: total payload size 1553
605 bundle2-input-bundle: 3 parts total
598 bundle2-input-bundle: 3 parts total
606 transaction abort!
599 transaction abort!
607 rollback completed
600 rollback completed
608 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
601 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
609 no rollback information available
602 no rollback information available
610 0:6675d58eff77
603 0:6675d58eff77
611
604
612
605
613 $ echo 'barney is not mentioned => not allowed anywhere'
606 $ echo 'barney is not mentioned => not allowed anywhere'
614 barney is not mentioned => not allowed anywhere
607 barney is not mentioned => not allowed anywhere
615 $ do_push barney
608 $ do_push barney
616 Pushing as user barney
609 Pushing as user barney
617 hgrc = """
610 hgrc = """
618 [hooks]
611 [hooks]
619 pretxnchangegroup.acl = python:hgext.acl.hook
612 pretxnchangegroup.acl = python:hgext.acl.hook
620 [acl]
613 [acl]
621 sources = push
614 sources = push
622 [acl.allow]
615 [acl.allow]
623 foo/** = fred
616 foo/** = fred
624 [acl.deny]
617 [acl.deny]
625 foo/bar/** = fred
618 foo/bar/** = fred
626 foo/Bar/** = fred
619 foo/Bar/** = fred
627 """
620 """
628 pushing to ../b
621 pushing to ../b
629 query 1; heads
622 query 1; heads
630 searching for changes
623 searching for changes
631 all remote heads known locally
624 all remote heads known locally
632 listing keys for "phases"
625 listing keys for "phases"
633 checking for updated bookmarks
626 checking for updated bookmarks
634 listing keys for "bookmarks"
627 listing keys for "bookmarks"
635 invalid branchheads cache (served): tip differs
636 listing keys for "bookmarks"
628 listing keys for "bookmarks"
637 3 changesets found
629 3 changesets found
638 list of changesets:
630 list of changesets:
639 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
631 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
640 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
632 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
641 911600dab2ae7a9baff75958b84fe606851ce955
633 911600dab2ae7a9baff75958b84fe606851ce955
642 bundle2-output-bundle: "HG20", 4 parts total
634 bundle2-output-bundle: "HG20", 4 parts total
643 bundle2-output-part: "replycaps" 155 bytes payload
635 bundle2-output-part: "replycaps" 155 bytes payload
644 bundle2-output-part: "check:heads" streamed payload
636 bundle2-output-part: "check:heads" streamed payload
645 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
637 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
646 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
638 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
647 bundle2-input-bundle: with-transaction
639 bundle2-input-bundle: with-transaction
648 bundle2-input-part: "replycaps" supported
640 bundle2-input-part: "replycaps" supported
649 bundle2-input-part: total payload size 155
641 bundle2-input-part: total payload size 155
650 bundle2-input-part: "check:heads" supported
642 bundle2-input-part: "check:heads" supported
651 bundle2-input-part: total payload size 20
643 bundle2-input-part: total payload size 20
652 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
644 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
653 adding changesets
645 adding changesets
654 add changeset ef1ea85a6374
646 add changeset ef1ea85a6374
655 add changeset f9cafe1212c8
647 add changeset f9cafe1212c8
656 add changeset 911600dab2ae
648 add changeset 911600dab2ae
657 adding manifests
649 adding manifests
658 adding file changes
650 adding file changes
659 adding foo/Bar/file.txt revisions
651 adding foo/Bar/file.txt revisions
660 adding foo/file.txt revisions
652 adding foo/file.txt revisions
661 adding quux/file.py revisions
653 adding quux/file.py revisions
662 added 3 changesets with 3 changes to 3 files
654 added 3 changesets with 3 changes to 3 files
663 calling hook pretxnchangegroup.acl: hgext.acl.hook
655 calling hook pretxnchangegroup.acl: hgext.acl.hook
664 acl: checking access for user "barney"
656 acl: checking access for user "barney"
665 acl: acl.allow.branches not enabled
657 acl: acl.allow.branches not enabled
666 acl: acl.deny.branches not enabled
658 acl: acl.deny.branches not enabled
667 acl: acl.allow enabled, 0 entries for user barney
659 acl: acl.allow enabled, 0 entries for user barney
668 acl: acl.deny enabled, 0 entries for user barney
660 acl: acl.deny enabled, 0 entries for user barney
669 acl: branch access granted: "ef1ea85a6374" on branch "default"
661 acl: branch access granted: "ef1ea85a6374" on branch "default"
670 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
662 error: pretxnchangegroup.acl hook failed: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
671 bundle2-input-part: total payload size 1553
663 bundle2-input-part: total payload size 1553
672 bundle2-input-bundle: 3 parts total
664 bundle2-input-bundle: 3 parts total
673 transaction abort!
665 transaction abort!
674 rollback completed
666 rollback completed
675 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
667 abort: acl: user "barney" not allowed on "foo/file.txt" (changeset "ef1ea85a6374")
676 no rollback information available
668 no rollback information available
677 0:6675d58eff77
669 0:6675d58eff77
678
670
679
671
680 barney is allowed everywhere
672 barney is allowed everywhere
681
673
682 $ echo '[acl.allow]' >> $config
674 $ echo '[acl.allow]' >> $config
683 $ echo '** = barney' >> $config
675 $ echo '** = barney' >> $config
684 $ do_push barney
676 $ do_push barney
685 Pushing as user barney
677 Pushing as user barney
686 hgrc = """
678 hgrc = """
687 [hooks]
679 [hooks]
688 pretxnchangegroup.acl = python:hgext.acl.hook
680 pretxnchangegroup.acl = python:hgext.acl.hook
689 [acl]
681 [acl]
690 sources = push
682 sources = push
691 [acl.allow]
683 [acl.allow]
692 foo/** = fred
684 foo/** = fred
693 [acl.deny]
685 [acl.deny]
694 foo/bar/** = fred
686 foo/bar/** = fred
695 foo/Bar/** = fred
687 foo/Bar/** = fred
696 [acl.allow]
688 [acl.allow]
697 ** = barney
689 ** = barney
698 """
690 """
699 pushing to ../b
691 pushing to ../b
700 query 1; heads
692 query 1; heads
701 searching for changes
693 searching for changes
702 all remote heads known locally
694 all remote heads known locally
703 listing keys for "phases"
695 listing keys for "phases"
704 checking for updated bookmarks
696 checking for updated bookmarks
705 listing keys for "bookmarks"
697 listing keys for "bookmarks"
706 invalid branchheads cache (served): tip differs
707 listing keys for "bookmarks"
698 listing keys for "bookmarks"
708 3 changesets found
699 3 changesets found
709 list of changesets:
700 list of changesets:
710 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
701 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
711 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
702 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
712 911600dab2ae7a9baff75958b84fe606851ce955
703 911600dab2ae7a9baff75958b84fe606851ce955
713 bundle2-output-bundle: "HG20", 4 parts total
704 bundle2-output-bundle: "HG20", 4 parts total
714 bundle2-output-part: "replycaps" 155 bytes payload
705 bundle2-output-part: "replycaps" 155 bytes payload
715 bundle2-output-part: "check:heads" streamed payload
706 bundle2-output-part: "check:heads" streamed payload
716 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
707 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
717 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
708 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
718 bundle2-input-bundle: with-transaction
709 bundle2-input-bundle: with-transaction
719 bundle2-input-part: "replycaps" supported
710 bundle2-input-part: "replycaps" supported
720 bundle2-input-part: total payload size 155
711 bundle2-input-part: total payload size 155
721 bundle2-input-part: "check:heads" supported
712 bundle2-input-part: "check:heads" supported
722 bundle2-input-part: total payload size 20
713 bundle2-input-part: total payload size 20
723 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
714 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
724 adding changesets
715 adding changesets
725 add changeset ef1ea85a6374
716 add changeset ef1ea85a6374
726 add changeset f9cafe1212c8
717 add changeset f9cafe1212c8
727 add changeset 911600dab2ae
718 add changeset 911600dab2ae
728 adding manifests
719 adding manifests
729 adding file changes
720 adding file changes
730 adding foo/Bar/file.txt revisions
721 adding foo/Bar/file.txt revisions
731 adding foo/file.txt revisions
722 adding foo/file.txt revisions
732 adding quux/file.py revisions
723 adding quux/file.py revisions
733 added 3 changesets with 3 changes to 3 files
724 added 3 changesets with 3 changes to 3 files
734 calling hook pretxnchangegroup.acl: hgext.acl.hook
725 calling hook pretxnchangegroup.acl: hgext.acl.hook
735 acl: checking access for user "barney"
726 acl: checking access for user "barney"
736 acl: acl.allow.branches not enabled
727 acl: acl.allow.branches not enabled
737 acl: acl.deny.branches not enabled
728 acl: acl.deny.branches not enabled
738 acl: acl.allow enabled, 1 entries for user barney
729 acl: acl.allow enabled, 1 entries for user barney
739 acl: acl.deny enabled, 0 entries for user barney
730 acl: acl.deny enabled, 0 entries for user barney
740 acl: branch access granted: "ef1ea85a6374" on branch "default"
731 acl: branch access granted: "ef1ea85a6374" on branch "default"
741 acl: path access granted: "ef1ea85a6374"
732 acl: path access granted: "ef1ea85a6374"
742 acl: branch access granted: "f9cafe1212c8" on branch "default"
733 acl: branch access granted: "f9cafe1212c8" on branch "default"
743 acl: path access granted: "f9cafe1212c8"
734 acl: path access granted: "f9cafe1212c8"
744 acl: branch access granted: "911600dab2ae" on branch "default"
735 acl: branch access granted: "911600dab2ae" on branch "default"
745 acl: path access granted: "911600dab2ae"
736 acl: path access granted: "911600dab2ae"
746 bundle2-input-part: total payload size 1553
737 bundle2-input-part: total payload size 1553
747 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
738 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
748 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
739 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
749 bundle2-input-bundle: 3 parts total
740 bundle2-input-bundle: 3 parts total
750 updating the branch cache
741 updating the branch cache
751 bundle2-output-bundle: "HG20", 2 parts total
742 bundle2-output-bundle: "HG20", 2 parts total
752 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
743 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
753 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
744 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
754 bundle2-input-bundle: with-transaction
745 bundle2-input-bundle: with-transaction
755 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
746 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
756 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
747 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
757 bundle2-input-bundle: 1 parts total
748 bundle2-input-bundle: 1 parts total
758 listing keys for "phases"
749 listing keys for "phases"
759 repository tip rolled back to revision 0 (undo push)
750 repository tip rolled back to revision 0 (undo push)
760 0:6675d58eff77
751 0:6675d58eff77
761
752
762
753
763 wilma can change files with a .txt extension
754 wilma can change files with a .txt extension
764
755
765 $ echo '**/*.txt = wilma' >> $config
756 $ echo '**/*.txt = wilma' >> $config
766 $ do_push wilma
757 $ do_push wilma
767 Pushing as user wilma
758 Pushing as user wilma
768 hgrc = """
759 hgrc = """
769 [hooks]
760 [hooks]
770 pretxnchangegroup.acl = python:hgext.acl.hook
761 pretxnchangegroup.acl = python:hgext.acl.hook
771 [acl]
762 [acl]
772 sources = push
763 sources = push
773 [acl.allow]
764 [acl.allow]
774 foo/** = fred
765 foo/** = fred
775 [acl.deny]
766 [acl.deny]
776 foo/bar/** = fred
767 foo/bar/** = fred
777 foo/Bar/** = fred
768 foo/Bar/** = fred
778 [acl.allow]
769 [acl.allow]
779 ** = barney
770 ** = barney
780 **/*.txt = wilma
771 **/*.txt = wilma
781 """
772 """
782 pushing to ../b
773 pushing to ../b
783 query 1; heads
774 query 1; heads
784 searching for changes
775 searching for changes
785 all remote heads known locally
776 all remote heads known locally
786 listing keys for "phases"
777 listing keys for "phases"
787 checking for updated bookmarks
778 checking for updated bookmarks
788 listing keys for "bookmarks"
779 listing keys for "bookmarks"
789 invalid branchheads cache (served): tip differs
790 listing keys for "bookmarks"
780 listing keys for "bookmarks"
791 3 changesets found
781 3 changesets found
792 list of changesets:
782 list of changesets:
793 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
783 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
794 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
784 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
795 911600dab2ae7a9baff75958b84fe606851ce955
785 911600dab2ae7a9baff75958b84fe606851ce955
796 bundle2-output-bundle: "HG20", 4 parts total
786 bundle2-output-bundle: "HG20", 4 parts total
797 bundle2-output-part: "replycaps" 155 bytes payload
787 bundle2-output-part: "replycaps" 155 bytes payload
798 bundle2-output-part: "check:heads" streamed payload
788 bundle2-output-part: "check:heads" streamed payload
799 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
789 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
800 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
790 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
801 bundle2-input-bundle: with-transaction
791 bundle2-input-bundle: with-transaction
802 bundle2-input-part: "replycaps" supported
792 bundle2-input-part: "replycaps" supported
803 bundle2-input-part: total payload size 155
793 bundle2-input-part: total payload size 155
804 bundle2-input-part: "check:heads" supported
794 bundle2-input-part: "check:heads" supported
805 bundle2-input-part: total payload size 20
795 bundle2-input-part: total payload size 20
806 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
796 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
807 adding changesets
797 adding changesets
808 add changeset ef1ea85a6374
798 add changeset ef1ea85a6374
809 add changeset f9cafe1212c8
799 add changeset f9cafe1212c8
810 add changeset 911600dab2ae
800 add changeset 911600dab2ae
811 adding manifests
801 adding manifests
812 adding file changes
802 adding file changes
813 adding foo/Bar/file.txt revisions
803 adding foo/Bar/file.txt revisions
814 adding foo/file.txt revisions
804 adding foo/file.txt revisions
815 adding quux/file.py revisions
805 adding quux/file.py revisions
816 added 3 changesets with 3 changes to 3 files
806 added 3 changesets with 3 changes to 3 files
817 calling hook pretxnchangegroup.acl: hgext.acl.hook
807 calling hook pretxnchangegroup.acl: hgext.acl.hook
818 acl: checking access for user "wilma"
808 acl: checking access for user "wilma"
819 acl: acl.allow.branches not enabled
809 acl: acl.allow.branches not enabled
820 acl: acl.deny.branches not enabled
810 acl: acl.deny.branches not enabled
821 acl: acl.allow enabled, 1 entries for user wilma
811 acl: acl.allow enabled, 1 entries for user wilma
822 acl: acl.deny enabled, 0 entries for user wilma
812 acl: acl.deny enabled, 0 entries for user wilma
823 acl: branch access granted: "ef1ea85a6374" on branch "default"
813 acl: branch access granted: "ef1ea85a6374" on branch "default"
824 acl: path access granted: "ef1ea85a6374"
814 acl: path access granted: "ef1ea85a6374"
825 acl: branch access granted: "f9cafe1212c8" on branch "default"
815 acl: branch access granted: "f9cafe1212c8" on branch "default"
826 acl: path access granted: "f9cafe1212c8"
816 acl: path access granted: "f9cafe1212c8"
827 acl: branch access granted: "911600dab2ae" on branch "default"
817 acl: branch access granted: "911600dab2ae" on branch "default"
828 error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
818 error: pretxnchangegroup.acl hook failed: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
829 bundle2-input-part: total payload size 1553
819 bundle2-input-part: total payload size 1553
830 bundle2-input-bundle: 3 parts total
820 bundle2-input-bundle: 3 parts total
831 transaction abort!
821 transaction abort!
832 rollback completed
822 rollback completed
833 abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
823 abort: acl: user "wilma" not allowed on "quux/file.py" (changeset "911600dab2ae")
834 no rollback information available
824 no rollback information available
835 0:6675d58eff77
825 0:6675d58eff77
836
826
837
827
838 file specified by acl.config does not exist
828 file specified by acl.config does not exist
839
829
840 $ echo '[acl]' >> $config
830 $ echo '[acl]' >> $config
841 $ echo 'config = ../acl.config' >> $config
831 $ echo 'config = ../acl.config' >> $config
842 $ do_push barney
832 $ do_push barney
843 Pushing as user barney
833 Pushing as user barney
844 hgrc = """
834 hgrc = """
845 [hooks]
835 [hooks]
846 pretxnchangegroup.acl = python:hgext.acl.hook
836 pretxnchangegroup.acl = python:hgext.acl.hook
847 [acl]
837 [acl]
848 sources = push
838 sources = push
849 [acl.allow]
839 [acl.allow]
850 foo/** = fred
840 foo/** = fred
851 [acl.deny]
841 [acl.deny]
852 foo/bar/** = fred
842 foo/bar/** = fred
853 foo/Bar/** = fred
843 foo/Bar/** = fred
854 [acl.allow]
844 [acl.allow]
855 ** = barney
845 ** = barney
856 **/*.txt = wilma
846 **/*.txt = wilma
857 [acl]
847 [acl]
858 config = ../acl.config
848 config = ../acl.config
859 """
849 """
860 pushing to ../b
850 pushing to ../b
861 query 1; heads
851 query 1; heads
862 searching for changes
852 searching for changes
863 all remote heads known locally
853 all remote heads known locally
864 listing keys for "phases"
854 listing keys for "phases"
865 checking for updated bookmarks
855 checking for updated bookmarks
866 listing keys for "bookmarks"
856 listing keys for "bookmarks"
867 invalid branchheads cache (served): tip differs
868 listing keys for "bookmarks"
857 listing keys for "bookmarks"
869 3 changesets found
858 3 changesets found
870 list of changesets:
859 list of changesets:
871 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
860 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
872 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
861 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
873 911600dab2ae7a9baff75958b84fe606851ce955
862 911600dab2ae7a9baff75958b84fe606851ce955
874 bundle2-output-bundle: "HG20", 4 parts total
863 bundle2-output-bundle: "HG20", 4 parts total
875 bundle2-output-part: "replycaps" 155 bytes payload
864 bundle2-output-part: "replycaps" 155 bytes payload
876 bundle2-output-part: "check:heads" streamed payload
865 bundle2-output-part: "check:heads" streamed payload
877 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
866 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
878 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
867 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
879 bundle2-input-bundle: with-transaction
868 bundle2-input-bundle: with-transaction
880 bundle2-input-part: "replycaps" supported
869 bundle2-input-part: "replycaps" supported
881 bundle2-input-part: total payload size 155
870 bundle2-input-part: total payload size 155
882 bundle2-input-part: "check:heads" supported
871 bundle2-input-part: "check:heads" supported
883 bundle2-input-part: total payload size 20
872 bundle2-input-part: total payload size 20
884 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
873 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
885 adding changesets
874 adding changesets
886 add changeset ef1ea85a6374
875 add changeset ef1ea85a6374
887 add changeset f9cafe1212c8
876 add changeset f9cafe1212c8
888 add changeset 911600dab2ae
877 add changeset 911600dab2ae
889 adding manifests
878 adding manifests
890 adding file changes
879 adding file changes
891 adding foo/Bar/file.txt revisions
880 adding foo/Bar/file.txt revisions
892 adding foo/file.txt revisions
881 adding foo/file.txt revisions
893 adding quux/file.py revisions
882 adding quux/file.py revisions
894 added 3 changesets with 3 changes to 3 files
883 added 3 changesets with 3 changes to 3 files
895 calling hook pretxnchangegroup.acl: hgext.acl.hook
884 calling hook pretxnchangegroup.acl: hgext.acl.hook
896 acl: checking access for user "barney"
885 acl: checking access for user "barney"
897 error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
886 error: pretxnchangegroup.acl hook raised an exception: [Errno 2] No such file or directory: '../acl.config'
898 bundle2-input-part: total payload size 1553
887 bundle2-input-part: total payload size 1553
899 bundle2-input-bundle: 3 parts total
888 bundle2-input-bundle: 3 parts total
900 transaction abort!
889 transaction abort!
901 rollback completed
890 rollback completed
902 abort: No such file or directory: ../acl.config
891 abort: No such file or directory: ../acl.config
903 no rollback information available
892 no rollback information available
904 0:6675d58eff77
893 0:6675d58eff77
905
894
906
895
907 betty is allowed inside foo/ by a acl.config file
896 betty is allowed inside foo/ by a acl.config file
908
897
909 $ echo '[acl.allow]' >> acl.config
898 $ echo '[acl.allow]' >> acl.config
910 $ echo 'foo/** = betty' >> acl.config
899 $ echo 'foo/** = betty' >> acl.config
911 $ do_push betty
900 $ do_push betty
912 Pushing as user betty
901 Pushing as user betty
913 hgrc = """
902 hgrc = """
914 [hooks]
903 [hooks]
915 pretxnchangegroup.acl = python:hgext.acl.hook
904 pretxnchangegroup.acl = python:hgext.acl.hook
916 [acl]
905 [acl]
917 sources = push
906 sources = push
918 [acl.allow]
907 [acl.allow]
919 foo/** = fred
908 foo/** = fred
920 [acl.deny]
909 [acl.deny]
921 foo/bar/** = fred
910 foo/bar/** = fred
922 foo/Bar/** = fred
911 foo/Bar/** = fred
923 [acl.allow]
912 [acl.allow]
924 ** = barney
913 ** = barney
925 **/*.txt = wilma
914 **/*.txt = wilma
926 [acl]
915 [acl]
927 config = ../acl.config
916 config = ../acl.config
928 """
917 """
929 acl.config = """
918 acl.config = """
930 [acl.allow]
919 [acl.allow]
931 foo/** = betty
920 foo/** = betty
932 """
921 """
933 pushing to ../b
922 pushing to ../b
934 query 1; heads
923 query 1; heads
935 searching for changes
924 searching for changes
936 all remote heads known locally
925 all remote heads known locally
937 listing keys for "phases"
926 listing keys for "phases"
938 checking for updated bookmarks
927 checking for updated bookmarks
939 listing keys for "bookmarks"
928 listing keys for "bookmarks"
940 invalid branchheads cache (served): tip differs
941 listing keys for "bookmarks"
929 listing keys for "bookmarks"
942 3 changesets found
930 3 changesets found
943 list of changesets:
931 list of changesets:
944 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
932 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
945 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
933 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
946 911600dab2ae7a9baff75958b84fe606851ce955
934 911600dab2ae7a9baff75958b84fe606851ce955
947 bundle2-output-bundle: "HG20", 4 parts total
935 bundle2-output-bundle: "HG20", 4 parts total
948 bundle2-output-part: "replycaps" 155 bytes payload
936 bundle2-output-part: "replycaps" 155 bytes payload
949 bundle2-output-part: "check:heads" streamed payload
937 bundle2-output-part: "check:heads" streamed payload
950 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
938 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
951 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
939 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
952 bundle2-input-bundle: with-transaction
940 bundle2-input-bundle: with-transaction
953 bundle2-input-part: "replycaps" supported
941 bundle2-input-part: "replycaps" supported
954 bundle2-input-part: total payload size 155
942 bundle2-input-part: total payload size 155
955 bundle2-input-part: "check:heads" supported
943 bundle2-input-part: "check:heads" supported
956 bundle2-input-part: total payload size 20
944 bundle2-input-part: total payload size 20
957 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
945 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
958 adding changesets
946 adding changesets
959 add changeset ef1ea85a6374
947 add changeset ef1ea85a6374
960 add changeset f9cafe1212c8
948 add changeset f9cafe1212c8
961 add changeset 911600dab2ae
949 add changeset 911600dab2ae
962 adding manifests
950 adding manifests
963 adding file changes
951 adding file changes
964 adding foo/Bar/file.txt revisions
952 adding foo/Bar/file.txt revisions
965 adding foo/file.txt revisions
953 adding foo/file.txt revisions
966 adding quux/file.py revisions
954 adding quux/file.py revisions
967 added 3 changesets with 3 changes to 3 files
955 added 3 changesets with 3 changes to 3 files
968 calling hook pretxnchangegroup.acl: hgext.acl.hook
956 calling hook pretxnchangegroup.acl: hgext.acl.hook
969 acl: checking access for user "betty"
957 acl: checking access for user "betty"
970 acl: acl.allow.branches not enabled
958 acl: acl.allow.branches not enabled
971 acl: acl.deny.branches not enabled
959 acl: acl.deny.branches not enabled
972 acl: acl.allow enabled, 1 entries for user betty
960 acl: acl.allow enabled, 1 entries for user betty
973 acl: acl.deny enabled, 0 entries for user betty
961 acl: acl.deny enabled, 0 entries for user betty
974 acl: branch access granted: "ef1ea85a6374" on branch "default"
962 acl: branch access granted: "ef1ea85a6374" on branch "default"
975 acl: path access granted: "ef1ea85a6374"
963 acl: path access granted: "ef1ea85a6374"
976 acl: branch access granted: "f9cafe1212c8" on branch "default"
964 acl: branch access granted: "f9cafe1212c8" on branch "default"
977 acl: path access granted: "f9cafe1212c8"
965 acl: path access granted: "f9cafe1212c8"
978 acl: branch access granted: "911600dab2ae" on branch "default"
966 acl: branch access granted: "911600dab2ae" on branch "default"
979 error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
967 error: pretxnchangegroup.acl hook failed: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
980 bundle2-input-part: total payload size 1553
968 bundle2-input-part: total payload size 1553
981 bundle2-input-bundle: 3 parts total
969 bundle2-input-bundle: 3 parts total
982 transaction abort!
970 transaction abort!
983 rollback completed
971 rollback completed
984 abort: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
972 abort: acl: user "betty" not allowed on "quux/file.py" (changeset "911600dab2ae")
985 no rollback information available
973 no rollback information available
986 0:6675d58eff77
974 0:6675d58eff77
987
975
988
976
989 acl.config can set only [acl.allow]/[acl.deny]
977 acl.config can set only [acl.allow]/[acl.deny]
990
978
991 $ echo '[hooks]' >> acl.config
979 $ echo '[hooks]' >> acl.config
992 $ echo 'changegroup.acl = false' >> acl.config
980 $ echo 'changegroup.acl = false' >> acl.config
993 $ do_push barney
981 $ do_push barney
994 Pushing as user barney
982 Pushing as user barney
995 hgrc = """
983 hgrc = """
996 [hooks]
984 [hooks]
997 pretxnchangegroup.acl = python:hgext.acl.hook
985 pretxnchangegroup.acl = python:hgext.acl.hook
998 [acl]
986 [acl]
999 sources = push
987 sources = push
1000 [acl.allow]
988 [acl.allow]
1001 foo/** = fred
989 foo/** = fred
1002 [acl.deny]
990 [acl.deny]
1003 foo/bar/** = fred
991 foo/bar/** = fred
1004 foo/Bar/** = fred
992 foo/Bar/** = fred
1005 [acl.allow]
993 [acl.allow]
1006 ** = barney
994 ** = barney
1007 **/*.txt = wilma
995 **/*.txt = wilma
1008 [acl]
996 [acl]
1009 config = ../acl.config
997 config = ../acl.config
1010 """
998 """
1011 acl.config = """
999 acl.config = """
1012 [acl.allow]
1000 [acl.allow]
1013 foo/** = betty
1001 foo/** = betty
1014 [hooks]
1002 [hooks]
1015 changegroup.acl = false
1003 changegroup.acl = false
1016 """
1004 """
1017 pushing to ../b
1005 pushing to ../b
1018 query 1; heads
1006 query 1; heads
1019 searching for changes
1007 searching for changes
1020 all remote heads known locally
1008 all remote heads known locally
1021 listing keys for "phases"
1009 listing keys for "phases"
1022 checking for updated bookmarks
1010 checking for updated bookmarks
1023 listing keys for "bookmarks"
1011 listing keys for "bookmarks"
1024 invalid branchheads cache (served): tip differs
1025 listing keys for "bookmarks"
1012 listing keys for "bookmarks"
1026 3 changesets found
1013 3 changesets found
1027 list of changesets:
1014 list of changesets:
1028 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1015 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1029 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1016 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1030 911600dab2ae7a9baff75958b84fe606851ce955
1017 911600dab2ae7a9baff75958b84fe606851ce955
1031 bundle2-output-bundle: "HG20", 4 parts total
1018 bundle2-output-bundle: "HG20", 4 parts total
1032 bundle2-output-part: "replycaps" 155 bytes payload
1019 bundle2-output-part: "replycaps" 155 bytes payload
1033 bundle2-output-part: "check:heads" streamed payload
1020 bundle2-output-part: "check:heads" streamed payload
1034 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1021 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1035 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1022 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1036 bundle2-input-bundle: with-transaction
1023 bundle2-input-bundle: with-transaction
1037 bundle2-input-part: "replycaps" supported
1024 bundle2-input-part: "replycaps" supported
1038 bundle2-input-part: total payload size 155
1025 bundle2-input-part: total payload size 155
1039 bundle2-input-part: "check:heads" supported
1026 bundle2-input-part: "check:heads" supported
1040 bundle2-input-part: total payload size 20
1027 bundle2-input-part: total payload size 20
1041 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1028 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1042 adding changesets
1029 adding changesets
1043 add changeset ef1ea85a6374
1030 add changeset ef1ea85a6374
1044 add changeset f9cafe1212c8
1031 add changeset f9cafe1212c8
1045 add changeset 911600dab2ae
1032 add changeset 911600dab2ae
1046 adding manifests
1033 adding manifests
1047 adding file changes
1034 adding file changes
1048 adding foo/Bar/file.txt revisions
1035 adding foo/Bar/file.txt revisions
1049 adding foo/file.txt revisions
1036 adding foo/file.txt revisions
1050 adding quux/file.py revisions
1037 adding quux/file.py revisions
1051 added 3 changesets with 3 changes to 3 files
1038 added 3 changesets with 3 changes to 3 files
1052 calling hook pretxnchangegroup.acl: hgext.acl.hook
1039 calling hook pretxnchangegroup.acl: hgext.acl.hook
1053 acl: checking access for user "barney"
1040 acl: checking access for user "barney"
1054 acl: acl.allow.branches not enabled
1041 acl: acl.allow.branches not enabled
1055 acl: acl.deny.branches not enabled
1042 acl: acl.deny.branches not enabled
1056 acl: acl.allow enabled, 1 entries for user barney
1043 acl: acl.allow enabled, 1 entries for user barney
1057 acl: acl.deny enabled, 0 entries for user barney
1044 acl: acl.deny enabled, 0 entries for user barney
1058 acl: branch access granted: "ef1ea85a6374" on branch "default"
1045 acl: branch access granted: "ef1ea85a6374" on branch "default"
1059 acl: path access granted: "ef1ea85a6374"
1046 acl: path access granted: "ef1ea85a6374"
1060 acl: branch access granted: "f9cafe1212c8" on branch "default"
1047 acl: branch access granted: "f9cafe1212c8" on branch "default"
1061 acl: path access granted: "f9cafe1212c8"
1048 acl: path access granted: "f9cafe1212c8"
1062 acl: branch access granted: "911600dab2ae" on branch "default"
1049 acl: branch access granted: "911600dab2ae" on branch "default"
1063 acl: path access granted: "911600dab2ae"
1050 acl: path access granted: "911600dab2ae"
1064 bundle2-input-part: total payload size 1553
1051 bundle2-input-part: total payload size 1553
1065 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1052 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1066 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1053 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1067 bundle2-input-bundle: 3 parts total
1054 bundle2-input-bundle: 3 parts total
1068 updating the branch cache
1055 updating the branch cache
1069 bundle2-output-bundle: "HG20", 2 parts total
1056 bundle2-output-bundle: "HG20", 2 parts total
1070 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1057 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1071 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1058 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1072 bundle2-input-bundle: with-transaction
1059 bundle2-input-bundle: with-transaction
1073 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1060 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1074 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1061 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1075 bundle2-input-bundle: 1 parts total
1062 bundle2-input-bundle: 1 parts total
1076 listing keys for "phases"
1063 listing keys for "phases"
1077 repository tip rolled back to revision 0 (undo push)
1064 repository tip rolled back to revision 0 (undo push)
1078 0:6675d58eff77
1065 0:6675d58eff77
1079
1066
1080
1067
1081 asterisk
1068 asterisk
1082
1069
1083 $ init_config
1070 $ init_config
1084
1071
1085 asterisk test
1072 asterisk test
1086
1073
1087 $ echo '[acl.allow]' >> $config
1074 $ echo '[acl.allow]' >> $config
1088 $ echo "** = fred" >> $config
1075 $ echo "** = fred" >> $config
1089
1076
1090 fred is always allowed
1077 fred is always allowed
1091
1078
1092 $ do_push fred
1079 $ do_push fred
1093 Pushing as user fred
1080 Pushing as user fred
1094 hgrc = """
1081 hgrc = """
1095 [hooks]
1082 [hooks]
1096 pretxnchangegroup.acl = python:hgext.acl.hook
1083 pretxnchangegroup.acl = python:hgext.acl.hook
1097 [acl]
1084 [acl]
1098 sources = push
1085 sources = push
1099 [extensions]
1086 [extensions]
1100 [acl.allow]
1087 [acl.allow]
1101 ** = fred
1088 ** = fred
1102 """
1089 """
1103 pushing to ../b
1090 pushing to ../b
1104 query 1; heads
1091 query 1; heads
1105 searching for changes
1092 searching for changes
1106 all remote heads known locally
1093 all remote heads known locally
1107 listing keys for "phases"
1094 listing keys for "phases"
1108 checking for updated bookmarks
1095 checking for updated bookmarks
1109 listing keys for "bookmarks"
1096 listing keys for "bookmarks"
1110 invalid branchheads cache (served): tip differs
1111 listing keys for "bookmarks"
1097 listing keys for "bookmarks"
1112 3 changesets found
1098 3 changesets found
1113 list of changesets:
1099 list of changesets:
1114 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1100 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1115 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1101 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1116 911600dab2ae7a9baff75958b84fe606851ce955
1102 911600dab2ae7a9baff75958b84fe606851ce955
1117 bundle2-output-bundle: "HG20", 4 parts total
1103 bundle2-output-bundle: "HG20", 4 parts total
1118 bundle2-output-part: "replycaps" 155 bytes payload
1104 bundle2-output-part: "replycaps" 155 bytes payload
1119 bundle2-output-part: "check:heads" streamed payload
1105 bundle2-output-part: "check:heads" streamed payload
1120 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1106 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1121 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1107 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1122 bundle2-input-bundle: with-transaction
1108 bundle2-input-bundle: with-transaction
1123 bundle2-input-part: "replycaps" supported
1109 bundle2-input-part: "replycaps" supported
1124 bundle2-input-part: total payload size 155
1110 bundle2-input-part: total payload size 155
1125 bundle2-input-part: "check:heads" supported
1111 bundle2-input-part: "check:heads" supported
1126 bundle2-input-part: total payload size 20
1112 bundle2-input-part: total payload size 20
1127 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1113 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1128 adding changesets
1114 adding changesets
1129 add changeset ef1ea85a6374
1115 add changeset ef1ea85a6374
1130 add changeset f9cafe1212c8
1116 add changeset f9cafe1212c8
1131 add changeset 911600dab2ae
1117 add changeset 911600dab2ae
1132 adding manifests
1118 adding manifests
1133 adding file changes
1119 adding file changes
1134 adding foo/Bar/file.txt revisions
1120 adding foo/Bar/file.txt revisions
1135 adding foo/file.txt revisions
1121 adding foo/file.txt revisions
1136 adding quux/file.py revisions
1122 adding quux/file.py revisions
1137 added 3 changesets with 3 changes to 3 files
1123 added 3 changesets with 3 changes to 3 files
1138 calling hook pretxnchangegroup.acl: hgext.acl.hook
1124 calling hook pretxnchangegroup.acl: hgext.acl.hook
1139 acl: checking access for user "fred"
1125 acl: checking access for user "fred"
1140 acl: acl.allow.branches not enabled
1126 acl: acl.allow.branches not enabled
1141 acl: acl.deny.branches not enabled
1127 acl: acl.deny.branches not enabled
1142 acl: acl.allow enabled, 1 entries for user fred
1128 acl: acl.allow enabled, 1 entries for user fred
1143 acl: acl.deny not enabled
1129 acl: acl.deny not enabled
1144 acl: branch access granted: "ef1ea85a6374" on branch "default"
1130 acl: branch access granted: "ef1ea85a6374" on branch "default"
1145 acl: path access granted: "ef1ea85a6374"
1131 acl: path access granted: "ef1ea85a6374"
1146 acl: branch access granted: "f9cafe1212c8" on branch "default"
1132 acl: branch access granted: "f9cafe1212c8" on branch "default"
1147 acl: path access granted: "f9cafe1212c8"
1133 acl: path access granted: "f9cafe1212c8"
1148 acl: branch access granted: "911600dab2ae" on branch "default"
1134 acl: branch access granted: "911600dab2ae" on branch "default"
1149 acl: path access granted: "911600dab2ae"
1135 acl: path access granted: "911600dab2ae"
1150 bundle2-input-part: total payload size 1553
1136 bundle2-input-part: total payload size 1553
1151 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1137 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1152 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1138 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1153 bundle2-input-bundle: 3 parts total
1139 bundle2-input-bundle: 3 parts total
1154 updating the branch cache
1140 updating the branch cache
1155 bundle2-output-bundle: "HG20", 2 parts total
1141 bundle2-output-bundle: "HG20", 2 parts total
1156 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1142 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1157 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1143 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1158 bundle2-input-bundle: with-transaction
1144 bundle2-input-bundle: with-transaction
1159 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1145 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1160 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1146 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1161 bundle2-input-bundle: 1 parts total
1147 bundle2-input-bundle: 1 parts total
1162 listing keys for "phases"
1148 listing keys for "phases"
1163 repository tip rolled back to revision 0 (undo push)
1149 repository tip rolled back to revision 0 (undo push)
1164 0:6675d58eff77
1150 0:6675d58eff77
1165
1151
1166
1152
1167 $ echo '[acl.deny]' >> $config
1153 $ echo '[acl.deny]' >> $config
1168 $ echo "foo/Bar/** = *" >> $config
1154 $ echo "foo/Bar/** = *" >> $config
1169
1155
1170 no one is allowed inside foo/Bar/
1156 no one is allowed inside foo/Bar/
1171
1157
1172 $ do_push fred
1158 $ do_push fred
1173 Pushing as user fred
1159 Pushing as user fred
1174 hgrc = """
1160 hgrc = """
1175 [hooks]
1161 [hooks]
1176 pretxnchangegroup.acl = python:hgext.acl.hook
1162 pretxnchangegroup.acl = python:hgext.acl.hook
1177 [acl]
1163 [acl]
1178 sources = push
1164 sources = push
1179 [extensions]
1165 [extensions]
1180 [acl.allow]
1166 [acl.allow]
1181 ** = fred
1167 ** = fred
1182 [acl.deny]
1168 [acl.deny]
1183 foo/Bar/** = *
1169 foo/Bar/** = *
1184 """
1170 """
1185 pushing to ../b
1171 pushing to ../b
1186 query 1; heads
1172 query 1; heads
1187 searching for changes
1173 searching for changes
1188 all remote heads known locally
1174 all remote heads known locally
1189 listing keys for "phases"
1175 listing keys for "phases"
1190 checking for updated bookmarks
1176 checking for updated bookmarks
1191 listing keys for "bookmarks"
1177 listing keys for "bookmarks"
1192 invalid branchheads cache (served): tip differs
1193 listing keys for "bookmarks"
1178 listing keys for "bookmarks"
1194 3 changesets found
1179 3 changesets found
1195 list of changesets:
1180 list of changesets:
1196 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1181 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1197 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1182 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1198 911600dab2ae7a9baff75958b84fe606851ce955
1183 911600dab2ae7a9baff75958b84fe606851ce955
1199 bundle2-output-bundle: "HG20", 4 parts total
1184 bundle2-output-bundle: "HG20", 4 parts total
1200 bundle2-output-part: "replycaps" 155 bytes payload
1185 bundle2-output-part: "replycaps" 155 bytes payload
1201 bundle2-output-part: "check:heads" streamed payload
1186 bundle2-output-part: "check:heads" streamed payload
1202 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1187 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1203 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1188 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1204 bundle2-input-bundle: with-transaction
1189 bundle2-input-bundle: with-transaction
1205 bundle2-input-part: "replycaps" supported
1190 bundle2-input-part: "replycaps" supported
1206 bundle2-input-part: total payload size 155
1191 bundle2-input-part: total payload size 155
1207 bundle2-input-part: "check:heads" supported
1192 bundle2-input-part: "check:heads" supported
1208 bundle2-input-part: total payload size 20
1193 bundle2-input-part: total payload size 20
1209 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1194 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1210 adding changesets
1195 adding changesets
1211 add changeset ef1ea85a6374
1196 add changeset ef1ea85a6374
1212 add changeset f9cafe1212c8
1197 add changeset f9cafe1212c8
1213 add changeset 911600dab2ae
1198 add changeset 911600dab2ae
1214 adding manifests
1199 adding manifests
1215 adding file changes
1200 adding file changes
1216 adding foo/Bar/file.txt revisions
1201 adding foo/Bar/file.txt revisions
1217 adding foo/file.txt revisions
1202 adding foo/file.txt revisions
1218 adding quux/file.py revisions
1203 adding quux/file.py revisions
1219 added 3 changesets with 3 changes to 3 files
1204 added 3 changesets with 3 changes to 3 files
1220 calling hook pretxnchangegroup.acl: hgext.acl.hook
1205 calling hook pretxnchangegroup.acl: hgext.acl.hook
1221 acl: checking access for user "fred"
1206 acl: checking access for user "fred"
1222 acl: acl.allow.branches not enabled
1207 acl: acl.allow.branches not enabled
1223 acl: acl.deny.branches not enabled
1208 acl: acl.deny.branches not enabled
1224 acl: acl.allow enabled, 1 entries for user fred
1209 acl: acl.allow enabled, 1 entries for user fred
1225 acl: acl.deny enabled, 1 entries for user fred
1210 acl: acl.deny enabled, 1 entries for user fred
1226 acl: branch access granted: "ef1ea85a6374" on branch "default"
1211 acl: branch access granted: "ef1ea85a6374" on branch "default"
1227 acl: path access granted: "ef1ea85a6374"
1212 acl: path access granted: "ef1ea85a6374"
1228 acl: branch access granted: "f9cafe1212c8" on branch "default"
1213 acl: branch access granted: "f9cafe1212c8" on branch "default"
1229 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1214 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1230 bundle2-input-part: total payload size 1553
1215 bundle2-input-part: total payload size 1553
1231 bundle2-input-bundle: 3 parts total
1216 bundle2-input-bundle: 3 parts total
1232 transaction abort!
1217 transaction abort!
1233 rollback completed
1218 rollback completed
1234 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1219 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1235 no rollback information available
1220 no rollback information available
1236 0:6675d58eff77
1221 0:6675d58eff77
1237
1222
1238
1223
1239 Groups
1224 Groups
1240
1225
1241 $ init_config
1226 $ init_config
1242
1227
1243 OS-level groups
1228 OS-level groups
1244
1229
1245 $ echo '[acl.allow]' >> $config
1230 $ echo '[acl.allow]' >> $config
1246 $ echo "** = @group1" >> $config
1231 $ echo "** = @group1" >> $config
1247
1232
1248 @group1 is always allowed
1233 @group1 is always allowed
1249
1234
1250 $ do_push fred
1235 $ do_push fred
1251 Pushing as user fred
1236 Pushing as user fred
1252 hgrc = """
1237 hgrc = """
1253 [hooks]
1238 [hooks]
1254 pretxnchangegroup.acl = python:hgext.acl.hook
1239 pretxnchangegroup.acl = python:hgext.acl.hook
1255 [acl]
1240 [acl]
1256 sources = push
1241 sources = push
1257 [extensions]
1242 [extensions]
1258 [acl.allow]
1243 [acl.allow]
1259 ** = @group1
1244 ** = @group1
1260 """
1245 """
1261 pushing to ../b
1246 pushing to ../b
1262 query 1; heads
1247 query 1; heads
1263 searching for changes
1248 searching for changes
1264 all remote heads known locally
1249 all remote heads known locally
1265 listing keys for "phases"
1250 listing keys for "phases"
1266 checking for updated bookmarks
1251 checking for updated bookmarks
1267 listing keys for "bookmarks"
1252 listing keys for "bookmarks"
1268 invalid branchheads cache (served): tip differs
1269 listing keys for "bookmarks"
1253 listing keys for "bookmarks"
1270 3 changesets found
1254 3 changesets found
1271 list of changesets:
1255 list of changesets:
1272 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1256 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1273 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1257 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1274 911600dab2ae7a9baff75958b84fe606851ce955
1258 911600dab2ae7a9baff75958b84fe606851ce955
1275 bundle2-output-bundle: "HG20", 4 parts total
1259 bundle2-output-bundle: "HG20", 4 parts total
1276 bundle2-output-part: "replycaps" 155 bytes payload
1260 bundle2-output-part: "replycaps" 155 bytes payload
1277 bundle2-output-part: "check:heads" streamed payload
1261 bundle2-output-part: "check:heads" streamed payload
1278 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1262 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1279 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1263 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1280 bundle2-input-bundle: with-transaction
1264 bundle2-input-bundle: with-transaction
1281 bundle2-input-part: "replycaps" supported
1265 bundle2-input-part: "replycaps" supported
1282 bundle2-input-part: total payload size 155
1266 bundle2-input-part: total payload size 155
1283 bundle2-input-part: "check:heads" supported
1267 bundle2-input-part: "check:heads" supported
1284 bundle2-input-part: total payload size 20
1268 bundle2-input-part: total payload size 20
1285 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1269 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1286 adding changesets
1270 adding changesets
1287 add changeset ef1ea85a6374
1271 add changeset ef1ea85a6374
1288 add changeset f9cafe1212c8
1272 add changeset f9cafe1212c8
1289 add changeset 911600dab2ae
1273 add changeset 911600dab2ae
1290 adding manifests
1274 adding manifests
1291 adding file changes
1275 adding file changes
1292 adding foo/Bar/file.txt revisions
1276 adding foo/Bar/file.txt revisions
1293 adding foo/file.txt revisions
1277 adding foo/file.txt revisions
1294 adding quux/file.py revisions
1278 adding quux/file.py revisions
1295 added 3 changesets with 3 changes to 3 files
1279 added 3 changesets with 3 changes to 3 files
1296 calling hook pretxnchangegroup.acl: hgext.acl.hook
1280 calling hook pretxnchangegroup.acl: hgext.acl.hook
1297 acl: checking access for user "fred"
1281 acl: checking access for user "fred"
1298 acl: acl.allow.branches not enabled
1282 acl: acl.allow.branches not enabled
1299 acl: acl.deny.branches not enabled
1283 acl: acl.deny.branches not enabled
1300 acl: "group1" not defined in [acl.groups]
1284 acl: "group1" not defined in [acl.groups]
1301 acl: acl.allow enabled, 1 entries for user fred
1285 acl: acl.allow enabled, 1 entries for user fred
1302 acl: acl.deny not enabled
1286 acl: acl.deny not enabled
1303 acl: branch access granted: "ef1ea85a6374" on branch "default"
1287 acl: branch access granted: "ef1ea85a6374" on branch "default"
1304 acl: path access granted: "ef1ea85a6374"
1288 acl: path access granted: "ef1ea85a6374"
1305 acl: branch access granted: "f9cafe1212c8" on branch "default"
1289 acl: branch access granted: "f9cafe1212c8" on branch "default"
1306 acl: path access granted: "f9cafe1212c8"
1290 acl: path access granted: "f9cafe1212c8"
1307 acl: branch access granted: "911600dab2ae" on branch "default"
1291 acl: branch access granted: "911600dab2ae" on branch "default"
1308 acl: path access granted: "911600dab2ae"
1292 acl: path access granted: "911600dab2ae"
1309 bundle2-input-part: total payload size 1553
1293 bundle2-input-part: total payload size 1553
1310 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1294 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1311 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1295 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1312 bundle2-input-bundle: 3 parts total
1296 bundle2-input-bundle: 3 parts total
1313 updating the branch cache
1297 updating the branch cache
1314 bundle2-output-bundle: "HG20", 2 parts total
1298 bundle2-output-bundle: "HG20", 2 parts total
1315 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1299 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1316 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1300 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1317 bundle2-input-bundle: with-transaction
1301 bundle2-input-bundle: with-transaction
1318 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1302 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1319 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1303 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1320 bundle2-input-bundle: 1 parts total
1304 bundle2-input-bundle: 1 parts total
1321 listing keys for "phases"
1305 listing keys for "phases"
1322 repository tip rolled back to revision 0 (undo push)
1306 repository tip rolled back to revision 0 (undo push)
1323 0:6675d58eff77
1307 0:6675d58eff77
1324
1308
1325
1309
1326 $ echo '[acl.deny]' >> $config
1310 $ echo '[acl.deny]' >> $config
1327 $ echo "foo/Bar/** = @group1" >> $config
1311 $ echo "foo/Bar/** = @group1" >> $config
1328
1312
1329 @group is allowed inside anything but foo/Bar/
1313 @group is allowed inside anything but foo/Bar/
1330
1314
1331 $ do_push fred
1315 $ do_push fred
1332 Pushing as user fred
1316 Pushing as user fred
1333 hgrc = """
1317 hgrc = """
1334 [hooks]
1318 [hooks]
1335 pretxnchangegroup.acl = python:hgext.acl.hook
1319 pretxnchangegroup.acl = python:hgext.acl.hook
1336 [acl]
1320 [acl]
1337 sources = push
1321 sources = push
1338 [extensions]
1322 [extensions]
1339 [acl.allow]
1323 [acl.allow]
1340 ** = @group1
1324 ** = @group1
1341 [acl.deny]
1325 [acl.deny]
1342 foo/Bar/** = @group1
1326 foo/Bar/** = @group1
1343 """
1327 """
1344 pushing to ../b
1328 pushing to ../b
1345 query 1; heads
1329 query 1; heads
1346 searching for changes
1330 searching for changes
1347 all remote heads known locally
1331 all remote heads known locally
1348 listing keys for "phases"
1332 listing keys for "phases"
1349 checking for updated bookmarks
1333 checking for updated bookmarks
1350 listing keys for "bookmarks"
1334 listing keys for "bookmarks"
1351 invalid branchheads cache (served): tip differs
1352 listing keys for "bookmarks"
1335 listing keys for "bookmarks"
1353 3 changesets found
1336 3 changesets found
1354 list of changesets:
1337 list of changesets:
1355 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1338 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1356 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1339 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1357 911600dab2ae7a9baff75958b84fe606851ce955
1340 911600dab2ae7a9baff75958b84fe606851ce955
1358 bundle2-output-bundle: "HG20", 4 parts total
1341 bundle2-output-bundle: "HG20", 4 parts total
1359 bundle2-output-part: "replycaps" 155 bytes payload
1342 bundle2-output-part: "replycaps" 155 bytes payload
1360 bundle2-output-part: "check:heads" streamed payload
1343 bundle2-output-part: "check:heads" streamed payload
1361 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1344 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1362 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1345 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1363 bundle2-input-bundle: with-transaction
1346 bundle2-input-bundle: with-transaction
1364 bundle2-input-part: "replycaps" supported
1347 bundle2-input-part: "replycaps" supported
1365 bundle2-input-part: total payload size 155
1348 bundle2-input-part: total payload size 155
1366 bundle2-input-part: "check:heads" supported
1349 bundle2-input-part: "check:heads" supported
1367 bundle2-input-part: total payload size 20
1350 bundle2-input-part: total payload size 20
1368 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1351 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1369 adding changesets
1352 adding changesets
1370 add changeset ef1ea85a6374
1353 add changeset ef1ea85a6374
1371 add changeset f9cafe1212c8
1354 add changeset f9cafe1212c8
1372 add changeset 911600dab2ae
1355 add changeset 911600dab2ae
1373 adding manifests
1356 adding manifests
1374 adding file changes
1357 adding file changes
1375 adding foo/Bar/file.txt revisions
1358 adding foo/Bar/file.txt revisions
1376 adding foo/file.txt revisions
1359 adding foo/file.txt revisions
1377 adding quux/file.py revisions
1360 adding quux/file.py revisions
1378 added 3 changesets with 3 changes to 3 files
1361 added 3 changesets with 3 changes to 3 files
1379 calling hook pretxnchangegroup.acl: hgext.acl.hook
1362 calling hook pretxnchangegroup.acl: hgext.acl.hook
1380 acl: checking access for user "fred"
1363 acl: checking access for user "fred"
1381 acl: acl.allow.branches not enabled
1364 acl: acl.allow.branches not enabled
1382 acl: acl.deny.branches not enabled
1365 acl: acl.deny.branches not enabled
1383 acl: "group1" not defined in [acl.groups]
1366 acl: "group1" not defined in [acl.groups]
1384 acl: acl.allow enabled, 1 entries for user fred
1367 acl: acl.allow enabled, 1 entries for user fred
1385 acl: "group1" not defined in [acl.groups]
1368 acl: "group1" not defined in [acl.groups]
1386 acl: acl.deny enabled, 1 entries for user fred
1369 acl: acl.deny enabled, 1 entries for user fred
1387 acl: branch access granted: "ef1ea85a6374" on branch "default"
1370 acl: branch access granted: "ef1ea85a6374" on branch "default"
1388 acl: path access granted: "ef1ea85a6374"
1371 acl: path access granted: "ef1ea85a6374"
1389 acl: branch access granted: "f9cafe1212c8" on branch "default"
1372 acl: branch access granted: "f9cafe1212c8" on branch "default"
1390 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1373 error: pretxnchangegroup.acl hook failed: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1391 bundle2-input-part: total payload size 1553
1374 bundle2-input-part: total payload size 1553
1392 bundle2-input-bundle: 3 parts total
1375 bundle2-input-bundle: 3 parts total
1393 transaction abort!
1376 transaction abort!
1394 rollback completed
1377 rollback completed
1395 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1378 abort: acl: user "fred" denied on "foo/Bar/file.txt" (changeset "f9cafe1212c8")
1396 no rollback information available
1379 no rollback information available
1397 0:6675d58eff77
1380 0:6675d58eff77
1398
1381
1399
1382
1400 Invalid group
1383 Invalid group
1401
1384
1402 Disable the fakegroups trick to get real failures
1385 Disable the fakegroups trick to get real failures
1403
1386
1404 $ grep -v fakegroups $config > config.tmp
1387 $ grep -v fakegroups $config > config.tmp
1405 $ mv config.tmp $config
1388 $ mv config.tmp $config
1406 $ echo '[acl.allow]' >> $config
1389 $ echo '[acl.allow]' >> $config
1407 $ echo "** = @unlikelytoexist" >> $config
1390 $ echo "** = @unlikelytoexist" >> $config
1408 $ do_push fred 2>&1 | grep unlikelytoexist
1391 $ do_push fred 2>&1 | grep unlikelytoexist
1409 ** = @unlikelytoexist
1392 ** = @unlikelytoexist
1410 acl: "unlikelytoexist" not defined in [acl.groups]
1393 acl: "unlikelytoexist" not defined in [acl.groups]
1411 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1394 error: pretxnchangegroup.acl hook failed: group 'unlikelytoexist' is undefined
1412 abort: group 'unlikelytoexist' is undefined
1395 abort: group 'unlikelytoexist' is undefined
1413
1396
1414
1397
1415 Branch acl tests setup
1398 Branch acl tests setup
1416
1399
1417 $ init_config
1400 $ init_config
1418 $ cd b
1401 $ cd b
1419 $ hg up
1402 $ hg up
1420 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1403 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1421 $ hg branch foobar
1404 $ hg branch foobar
1422 marked working directory as branch foobar
1405 marked working directory as branch foobar
1423 (branches are permanent and global, did you want a bookmark?)
1406 (branches are permanent and global, did you want a bookmark?)
1424 $ hg commit -m 'create foobar'
1407 $ hg commit -m 'create foobar'
1425 $ echo 'foo contents' > abc.txt
1408 $ echo 'foo contents' > abc.txt
1426 $ hg add abc.txt
1409 $ hg add abc.txt
1427 $ hg commit -m 'foobar contents'
1410 $ hg commit -m 'foobar contents'
1428 $ cd ..
1411 $ cd ..
1429 $ hg --cwd a pull ../b
1412 $ hg --cwd a pull ../b
1430 pulling from ../b
1413 pulling from ../b
1431 searching for changes
1414 searching for changes
1432 adding changesets
1415 adding changesets
1433 adding manifests
1416 adding manifests
1434 adding file changes
1417 adding file changes
1435 added 2 changesets with 1 changes to 1 files (+1 heads)
1418 added 2 changesets with 1 changes to 1 files (+1 heads)
1436 (run 'hg heads' to see heads)
1419 (run 'hg heads' to see heads)
1437
1420
1438 Create additional changeset on foobar branch
1421 Create additional changeset on foobar branch
1439
1422
1440 $ cd a
1423 $ cd a
1441 $ hg up -C foobar
1424 $ hg up -C foobar
1442 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1425 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1443 $ echo 'foo contents2' > abc.txt
1426 $ echo 'foo contents2' > abc.txt
1444 $ hg commit -m 'foobar contents2'
1427 $ hg commit -m 'foobar contents2'
1445 $ cd ..
1428 $ cd ..
1446
1429
1447
1430
1448 No branch acls specified
1431 No branch acls specified
1449
1432
1450 $ do_push astro
1433 $ do_push astro
1451 Pushing as user astro
1434 Pushing as user astro
1452 hgrc = """
1435 hgrc = """
1453 [hooks]
1436 [hooks]
1454 pretxnchangegroup.acl = python:hgext.acl.hook
1437 pretxnchangegroup.acl = python:hgext.acl.hook
1455 [acl]
1438 [acl]
1456 sources = push
1439 sources = push
1457 [extensions]
1440 [extensions]
1458 """
1441 """
1459 pushing to ../b
1442 pushing to ../b
1460 query 1; heads
1443 query 1; heads
1461 searching for changes
1444 searching for changes
1462 all remote heads known locally
1445 all remote heads known locally
1463 listing keys for "phases"
1446 listing keys for "phases"
1464 checking for updated bookmarks
1447 checking for updated bookmarks
1465 listing keys for "bookmarks"
1448 listing keys for "bookmarks"
1466 listing keys for "bookmarks"
1449 listing keys for "bookmarks"
1467 4 changesets found
1450 4 changesets found
1468 list of changesets:
1451 list of changesets:
1469 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1452 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1470 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1453 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1471 911600dab2ae7a9baff75958b84fe606851ce955
1454 911600dab2ae7a9baff75958b84fe606851ce955
1472 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1455 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1473 bundle2-output-bundle: "HG20", 5 parts total
1456 bundle2-output-bundle: "HG20", 5 parts total
1474 bundle2-output-part: "replycaps" 155 bytes payload
1457 bundle2-output-part: "replycaps" 155 bytes payload
1475 bundle2-output-part: "check:heads" streamed payload
1458 bundle2-output-part: "check:heads" streamed payload
1476 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1459 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1477 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1460 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1478 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1461 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1479 bundle2-input-bundle: with-transaction
1462 bundle2-input-bundle: with-transaction
1480 bundle2-input-part: "replycaps" supported
1463 bundle2-input-part: "replycaps" supported
1481 bundle2-input-part: total payload size 155
1464 bundle2-input-part: total payload size 155
1482 bundle2-input-part: "check:heads" supported
1465 bundle2-input-part: "check:heads" supported
1483 bundle2-input-part: total payload size 20
1466 bundle2-input-part: total payload size 20
1484 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1467 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1485 adding changesets
1468 adding changesets
1486 add changeset ef1ea85a6374
1469 add changeset ef1ea85a6374
1487 add changeset f9cafe1212c8
1470 add changeset f9cafe1212c8
1488 add changeset 911600dab2ae
1471 add changeset 911600dab2ae
1489 add changeset e8fc755d4d82
1472 add changeset e8fc755d4d82
1490 adding manifests
1473 adding manifests
1491 adding file changes
1474 adding file changes
1492 adding abc.txt revisions
1475 adding abc.txt revisions
1493 adding foo/Bar/file.txt revisions
1476 adding foo/Bar/file.txt revisions
1494 adding foo/file.txt revisions
1477 adding foo/file.txt revisions
1495 adding quux/file.py revisions
1478 adding quux/file.py revisions
1496 added 4 changesets with 4 changes to 4 files (+1 heads)
1479 added 4 changesets with 4 changes to 4 files (+1 heads)
1497 calling hook pretxnchangegroup.acl: hgext.acl.hook
1480 calling hook pretxnchangegroup.acl: hgext.acl.hook
1498 acl: checking access for user "astro"
1481 acl: checking access for user "astro"
1499 acl: acl.allow.branches not enabled
1482 acl: acl.allow.branches not enabled
1500 acl: acl.deny.branches not enabled
1483 acl: acl.deny.branches not enabled
1501 acl: acl.allow not enabled
1484 acl: acl.allow not enabled
1502 acl: acl.deny not enabled
1485 acl: acl.deny not enabled
1503 acl: branch access granted: "ef1ea85a6374" on branch "default"
1486 acl: branch access granted: "ef1ea85a6374" on branch "default"
1504 acl: path access granted: "ef1ea85a6374"
1487 acl: path access granted: "ef1ea85a6374"
1505 acl: branch access granted: "f9cafe1212c8" on branch "default"
1488 acl: branch access granted: "f9cafe1212c8" on branch "default"
1506 acl: path access granted: "f9cafe1212c8"
1489 acl: path access granted: "f9cafe1212c8"
1507 acl: branch access granted: "911600dab2ae" on branch "default"
1490 acl: branch access granted: "911600dab2ae" on branch "default"
1508 acl: path access granted: "911600dab2ae"
1491 acl: path access granted: "911600dab2ae"
1509 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1492 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1510 acl: path access granted: "e8fc755d4d82"
1493 acl: path access granted: "e8fc755d4d82"
1511 bundle2-input-part: total payload size 2068
1494 bundle2-input-part: total payload size 2068
1512 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1495 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1513 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1496 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1514 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1497 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1515 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
1498 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
1516 bundle2-input-bundle: 4 parts total
1499 bundle2-input-bundle: 4 parts total
1517 updating the branch cache
1500 updating the branch cache
1518 bundle2-output-bundle: "HG20", 3 parts total
1501 bundle2-output-bundle: "HG20", 3 parts total
1519 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1502 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1520 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1503 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1521 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1504 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1522 bundle2-input-bundle: with-transaction
1505 bundle2-input-bundle: with-transaction
1523 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1506 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1524 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1507 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1525 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1508 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1526 bundle2-input-bundle: 2 parts total
1509 bundle2-input-bundle: 2 parts total
1527 listing keys for "phases"
1510 listing keys for "phases"
1528 repository tip rolled back to revision 2 (undo push)
1511 repository tip rolled back to revision 2 (undo push)
1529 2:fb35475503ef
1512 2:fb35475503ef
1530
1513
1531
1514
1532 Branch acl deny test
1515 Branch acl deny test
1533
1516
1534 $ echo "[acl.deny.branches]" >> $config
1517 $ echo "[acl.deny.branches]" >> $config
1535 $ echo "foobar = *" >> $config
1518 $ echo "foobar = *" >> $config
1536 $ do_push astro
1519 $ do_push astro
1537 Pushing as user astro
1520 Pushing as user astro
1538 hgrc = """
1521 hgrc = """
1539 [hooks]
1522 [hooks]
1540 pretxnchangegroup.acl = python:hgext.acl.hook
1523 pretxnchangegroup.acl = python:hgext.acl.hook
1541 [acl]
1524 [acl]
1542 sources = push
1525 sources = push
1543 [extensions]
1526 [extensions]
1544 [acl.deny.branches]
1527 [acl.deny.branches]
1545 foobar = *
1528 foobar = *
1546 """
1529 """
1547 pushing to ../b
1530 pushing to ../b
1548 query 1; heads
1531 query 1; heads
1549 searching for changes
1532 searching for changes
1550 all remote heads known locally
1533 all remote heads known locally
1551 listing keys for "phases"
1534 listing keys for "phases"
1552 checking for updated bookmarks
1535 checking for updated bookmarks
1553 listing keys for "bookmarks"
1536 listing keys for "bookmarks"
1554 listing keys for "bookmarks"
1537 listing keys for "bookmarks"
1555 4 changesets found
1538 4 changesets found
1556 list of changesets:
1539 list of changesets:
1557 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1540 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1558 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1541 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1559 911600dab2ae7a9baff75958b84fe606851ce955
1542 911600dab2ae7a9baff75958b84fe606851ce955
1560 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1543 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1561 bundle2-output-bundle: "HG20", 5 parts total
1544 bundle2-output-bundle: "HG20", 5 parts total
1562 bundle2-output-part: "replycaps" 155 bytes payload
1545 bundle2-output-part: "replycaps" 155 bytes payload
1563 bundle2-output-part: "check:heads" streamed payload
1546 bundle2-output-part: "check:heads" streamed payload
1564 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1547 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1565 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1548 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1566 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1549 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1567 bundle2-input-bundle: with-transaction
1550 bundle2-input-bundle: with-transaction
1568 bundle2-input-part: "replycaps" supported
1551 bundle2-input-part: "replycaps" supported
1569 bundle2-input-part: total payload size 155
1552 bundle2-input-part: total payload size 155
1570 bundle2-input-part: "check:heads" supported
1553 bundle2-input-part: "check:heads" supported
1571 bundle2-input-part: total payload size 20
1554 bundle2-input-part: total payload size 20
1572 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1555 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1573 adding changesets
1556 adding changesets
1574 add changeset ef1ea85a6374
1557 add changeset ef1ea85a6374
1575 add changeset f9cafe1212c8
1558 add changeset f9cafe1212c8
1576 add changeset 911600dab2ae
1559 add changeset 911600dab2ae
1577 add changeset e8fc755d4d82
1560 add changeset e8fc755d4d82
1578 adding manifests
1561 adding manifests
1579 adding file changes
1562 adding file changes
1580 adding abc.txt revisions
1563 adding abc.txt revisions
1581 adding foo/Bar/file.txt revisions
1564 adding foo/Bar/file.txt revisions
1582 adding foo/file.txt revisions
1565 adding foo/file.txt revisions
1583 adding quux/file.py revisions
1566 adding quux/file.py revisions
1584 added 4 changesets with 4 changes to 4 files (+1 heads)
1567 added 4 changesets with 4 changes to 4 files (+1 heads)
1585 calling hook pretxnchangegroup.acl: hgext.acl.hook
1568 calling hook pretxnchangegroup.acl: hgext.acl.hook
1586 acl: checking access for user "astro"
1569 acl: checking access for user "astro"
1587 acl: acl.allow.branches not enabled
1570 acl: acl.allow.branches not enabled
1588 acl: acl.deny.branches enabled, 1 entries for user astro
1571 acl: acl.deny.branches enabled, 1 entries for user astro
1589 acl: acl.allow not enabled
1572 acl: acl.allow not enabled
1590 acl: acl.deny not enabled
1573 acl: acl.deny not enabled
1591 acl: branch access granted: "ef1ea85a6374" on branch "default"
1574 acl: branch access granted: "ef1ea85a6374" on branch "default"
1592 acl: path access granted: "ef1ea85a6374"
1575 acl: path access granted: "ef1ea85a6374"
1593 acl: branch access granted: "f9cafe1212c8" on branch "default"
1576 acl: branch access granted: "f9cafe1212c8" on branch "default"
1594 acl: path access granted: "f9cafe1212c8"
1577 acl: path access granted: "f9cafe1212c8"
1595 acl: branch access granted: "911600dab2ae" on branch "default"
1578 acl: branch access granted: "911600dab2ae" on branch "default"
1596 acl: path access granted: "911600dab2ae"
1579 acl: path access granted: "911600dab2ae"
1597 error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1580 error: pretxnchangegroup.acl hook failed: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1598 bundle2-input-part: total payload size 2068
1581 bundle2-input-part: total payload size 2068
1599 bundle2-input-bundle: 4 parts total
1582 bundle2-input-bundle: 4 parts total
1600 transaction abort!
1583 transaction abort!
1601 rollback completed
1584 rollback completed
1602 abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1585 abort: acl: user "astro" denied on branch "foobar" (changeset "e8fc755d4d82")
1603 no rollback information available
1586 no rollback information available
1604 2:fb35475503ef
1587 2:fb35475503ef
1605
1588
1606
1589
1607 Branch acl empty allow test
1590 Branch acl empty allow test
1608
1591
1609 $ init_config
1592 $ init_config
1610 $ echo "[acl.allow.branches]" >> $config
1593 $ echo "[acl.allow.branches]" >> $config
1611 $ do_push astro
1594 $ do_push astro
1612 Pushing as user astro
1595 Pushing as user astro
1613 hgrc = """
1596 hgrc = """
1614 [hooks]
1597 [hooks]
1615 pretxnchangegroup.acl = python:hgext.acl.hook
1598 pretxnchangegroup.acl = python:hgext.acl.hook
1616 [acl]
1599 [acl]
1617 sources = push
1600 sources = push
1618 [extensions]
1601 [extensions]
1619 [acl.allow.branches]
1602 [acl.allow.branches]
1620 """
1603 """
1621 pushing to ../b
1604 pushing to ../b
1622 query 1; heads
1605 query 1; heads
1623 searching for changes
1606 searching for changes
1624 all remote heads known locally
1607 all remote heads known locally
1625 listing keys for "phases"
1608 listing keys for "phases"
1626 checking for updated bookmarks
1609 checking for updated bookmarks
1627 listing keys for "bookmarks"
1610 listing keys for "bookmarks"
1628 listing keys for "bookmarks"
1611 listing keys for "bookmarks"
1629 4 changesets found
1612 4 changesets found
1630 list of changesets:
1613 list of changesets:
1631 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1614 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1632 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1615 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1633 911600dab2ae7a9baff75958b84fe606851ce955
1616 911600dab2ae7a9baff75958b84fe606851ce955
1634 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1617 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1635 bundle2-output-bundle: "HG20", 5 parts total
1618 bundle2-output-bundle: "HG20", 5 parts total
1636 bundle2-output-part: "replycaps" 155 bytes payload
1619 bundle2-output-part: "replycaps" 155 bytes payload
1637 bundle2-output-part: "check:heads" streamed payload
1620 bundle2-output-part: "check:heads" streamed payload
1638 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1621 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1639 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1622 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1640 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1623 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1641 bundle2-input-bundle: with-transaction
1624 bundle2-input-bundle: with-transaction
1642 bundle2-input-part: "replycaps" supported
1625 bundle2-input-part: "replycaps" supported
1643 bundle2-input-part: total payload size 155
1626 bundle2-input-part: total payload size 155
1644 bundle2-input-part: "check:heads" supported
1627 bundle2-input-part: "check:heads" supported
1645 bundle2-input-part: total payload size 20
1628 bundle2-input-part: total payload size 20
1646 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1629 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1647 adding changesets
1630 adding changesets
1648 add changeset ef1ea85a6374
1631 add changeset ef1ea85a6374
1649 add changeset f9cafe1212c8
1632 add changeset f9cafe1212c8
1650 add changeset 911600dab2ae
1633 add changeset 911600dab2ae
1651 add changeset e8fc755d4d82
1634 add changeset e8fc755d4d82
1652 adding manifests
1635 adding manifests
1653 adding file changes
1636 adding file changes
1654 adding abc.txt revisions
1637 adding abc.txt revisions
1655 adding foo/Bar/file.txt revisions
1638 adding foo/Bar/file.txt revisions
1656 adding foo/file.txt revisions
1639 adding foo/file.txt revisions
1657 adding quux/file.py revisions
1640 adding quux/file.py revisions
1658 added 4 changesets with 4 changes to 4 files (+1 heads)
1641 added 4 changesets with 4 changes to 4 files (+1 heads)
1659 calling hook pretxnchangegroup.acl: hgext.acl.hook
1642 calling hook pretxnchangegroup.acl: hgext.acl.hook
1660 acl: checking access for user "astro"
1643 acl: checking access for user "astro"
1661 acl: acl.allow.branches enabled, 0 entries for user astro
1644 acl: acl.allow.branches enabled, 0 entries for user astro
1662 acl: acl.deny.branches not enabled
1645 acl: acl.deny.branches not enabled
1663 acl: acl.allow not enabled
1646 acl: acl.allow not enabled
1664 acl: acl.deny not enabled
1647 acl: acl.deny not enabled
1665 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1648 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1666 bundle2-input-part: total payload size 2068
1649 bundle2-input-part: total payload size 2068
1667 bundle2-input-bundle: 4 parts total
1650 bundle2-input-bundle: 4 parts total
1668 transaction abort!
1651 transaction abort!
1669 rollback completed
1652 rollback completed
1670 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1653 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1671 no rollback information available
1654 no rollback information available
1672 2:fb35475503ef
1655 2:fb35475503ef
1673
1656
1674
1657
1675 Branch acl allow other
1658 Branch acl allow other
1676
1659
1677 $ init_config
1660 $ init_config
1678 $ echo "[acl.allow.branches]" >> $config
1661 $ echo "[acl.allow.branches]" >> $config
1679 $ echo "* = george" >> $config
1662 $ echo "* = george" >> $config
1680 $ do_push astro
1663 $ do_push astro
1681 Pushing as user astro
1664 Pushing as user astro
1682 hgrc = """
1665 hgrc = """
1683 [hooks]
1666 [hooks]
1684 pretxnchangegroup.acl = python:hgext.acl.hook
1667 pretxnchangegroup.acl = python:hgext.acl.hook
1685 [acl]
1668 [acl]
1686 sources = push
1669 sources = push
1687 [extensions]
1670 [extensions]
1688 [acl.allow.branches]
1671 [acl.allow.branches]
1689 * = george
1672 * = george
1690 """
1673 """
1691 pushing to ../b
1674 pushing to ../b
1692 query 1; heads
1675 query 1; heads
1693 searching for changes
1676 searching for changes
1694 all remote heads known locally
1677 all remote heads known locally
1695 listing keys for "phases"
1678 listing keys for "phases"
1696 checking for updated bookmarks
1679 checking for updated bookmarks
1697 listing keys for "bookmarks"
1680 listing keys for "bookmarks"
1698 listing keys for "bookmarks"
1681 listing keys for "bookmarks"
1699 4 changesets found
1682 4 changesets found
1700 list of changesets:
1683 list of changesets:
1701 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1684 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1702 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1685 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1703 911600dab2ae7a9baff75958b84fe606851ce955
1686 911600dab2ae7a9baff75958b84fe606851ce955
1704 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1687 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1705 bundle2-output-bundle: "HG20", 5 parts total
1688 bundle2-output-bundle: "HG20", 5 parts total
1706 bundle2-output-part: "replycaps" 155 bytes payload
1689 bundle2-output-part: "replycaps" 155 bytes payload
1707 bundle2-output-part: "check:heads" streamed payload
1690 bundle2-output-part: "check:heads" streamed payload
1708 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1691 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1709 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1692 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1710 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1693 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1711 bundle2-input-bundle: with-transaction
1694 bundle2-input-bundle: with-transaction
1712 bundle2-input-part: "replycaps" supported
1695 bundle2-input-part: "replycaps" supported
1713 bundle2-input-part: total payload size 155
1696 bundle2-input-part: total payload size 155
1714 bundle2-input-part: "check:heads" supported
1697 bundle2-input-part: "check:heads" supported
1715 bundle2-input-part: total payload size 20
1698 bundle2-input-part: total payload size 20
1716 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1699 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1717 adding changesets
1700 adding changesets
1718 add changeset ef1ea85a6374
1701 add changeset ef1ea85a6374
1719 add changeset f9cafe1212c8
1702 add changeset f9cafe1212c8
1720 add changeset 911600dab2ae
1703 add changeset 911600dab2ae
1721 add changeset e8fc755d4d82
1704 add changeset e8fc755d4d82
1722 adding manifests
1705 adding manifests
1723 adding file changes
1706 adding file changes
1724 adding abc.txt revisions
1707 adding abc.txt revisions
1725 adding foo/Bar/file.txt revisions
1708 adding foo/Bar/file.txt revisions
1726 adding foo/file.txt revisions
1709 adding foo/file.txt revisions
1727 adding quux/file.py revisions
1710 adding quux/file.py revisions
1728 added 4 changesets with 4 changes to 4 files (+1 heads)
1711 added 4 changesets with 4 changes to 4 files (+1 heads)
1729 calling hook pretxnchangegroup.acl: hgext.acl.hook
1712 calling hook pretxnchangegroup.acl: hgext.acl.hook
1730 acl: checking access for user "astro"
1713 acl: checking access for user "astro"
1731 acl: acl.allow.branches enabled, 0 entries for user astro
1714 acl: acl.allow.branches enabled, 0 entries for user astro
1732 acl: acl.deny.branches not enabled
1715 acl: acl.deny.branches not enabled
1733 acl: acl.allow not enabled
1716 acl: acl.allow not enabled
1734 acl: acl.deny not enabled
1717 acl: acl.deny not enabled
1735 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1718 error: pretxnchangegroup.acl hook failed: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1736 bundle2-input-part: total payload size 2068
1719 bundle2-input-part: total payload size 2068
1737 bundle2-input-bundle: 4 parts total
1720 bundle2-input-bundle: 4 parts total
1738 transaction abort!
1721 transaction abort!
1739 rollback completed
1722 rollback completed
1740 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1723 abort: acl: user "astro" not allowed on branch "default" (changeset "ef1ea85a6374")
1741 no rollback information available
1724 no rollback information available
1742 2:fb35475503ef
1725 2:fb35475503ef
1743
1726
1744 $ do_push george
1727 $ do_push george
1745 Pushing as user george
1728 Pushing as user george
1746 hgrc = """
1729 hgrc = """
1747 [hooks]
1730 [hooks]
1748 pretxnchangegroup.acl = python:hgext.acl.hook
1731 pretxnchangegroup.acl = python:hgext.acl.hook
1749 [acl]
1732 [acl]
1750 sources = push
1733 sources = push
1751 [extensions]
1734 [extensions]
1752 [acl.allow.branches]
1735 [acl.allow.branches]
1753 * = george
1736 * = george
1754 """
1737 """
1755 pushing to ../b
1738 pushing to ../b
1756 query 1; heads
1739 query 1; heads
1757 searching for changes
1740 searching for changes
1758 all remote heads known locally
1741 all remote heads known locally
1759 listing keys for "phases"
1742 listing keys for "phases"
1760 checking for updated bookmarks
1743 checking for updated bookmarks
1761 listing keys for "bookmarks"
1744 listing keys for "bookmarks"
1762 listing keys for "bookmarks"
1745 listing keys for "bookmarks"
1763 4 changesets found
1746 4 changesets found
1764 list of changesets:
1747 list of changesets:
1765 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1748 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1766 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1749 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1767 911600dab2ae7a9baff75958b84fe606851ce955
1750 911600dab2ae7a9baff75958b84fe606851ce955
1768 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1751 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1769 bundle2-output-bundle: "HG20", 5 parts total
1752 bundle2-output-bundle: "HG20", 5 parts total
1770 bundle2-output-part: "replycaps" 155 bytes payload
1753 bundle2-output-part: "replycaps" 155 bytes payload
1771 bundle2-output-part: "check:heads" streamed payload
1754 bundle2-output-part: "check:heads" streamed payload
1772 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1755 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1773 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1756 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1774 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1757 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1775 bundle2-input-bundle: with-transaction
1758 bundle2-input-bundle: with-transaction
1776 bundle2-input-part: "replycaps" supported
1759 bundle2-input-part: "replycaps" supported
1777 bundle2-input-part: total payload size 155
1760 bundle2-input-part: total payload size 155
1778 bundle2-input-part: "check:heads" supported
1761 bundle2-input-part: "check:heads" supported
1779 bundle2-input-part: total payload size 20
1762 bundle2-input-part: total payload size 20
1780 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1763 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1781 adding changesets
1764 adding changesets
1782 add changeset ef1ea85a6374
1765 add changeset ef1ea85a6374
1783 add changeset f9cafe1212c8
1766 add changeset f9cafe1212c8
1784 add changeset 911600dab2ae
1767 add changeset 911600dab2ae
1785 add changeset e8fc755d4d82
1768 add changeset e8fc755d4d82
1786 adding manifests
1769 adding manifests
1787 adding file changes
1770 adding file changes
1788 adding abc.txt revisions
1771 adding abc.txt revisions
1789 adding foo/Bar/file.txt revisions
1772 adding foo/Bar/file.txt revisions
1790 adding foo/file.txt revisions
1773 adding foo/file.txt revisions
1791 adding quux/file.py revisions
1774 adding quux/file.py revisions
1792 added 4 changesets with 4 changes to 4 files (+1 heads)
1775 added 4 changesets with 4 changes to 4 files (+1 heads)
1793 calling hook pretxnchangegroup.acl: hgext.acl.hook
1776 calling hook pretxnchangegroup.acl: hgext.acl.hook
1794 acl: checking access for user "george"
1777 acl: checking access for user "george"
1795 acl: acl.allow.branches enabled, 1 entries for user george
1778 acl: acl.allow.branches enabled, 1 entries for user george
1796 acl: acl.deny.branches not enabled
1779 acl: acl.deny.branches not enabled
1797 acl: acl.allow not enabled
1780 acl: acl.allow not enabled
1798 acl: acl.deny not enabled
1781 acl: acl.deny not enabled
1799 acl: branch access granted: "ef1ea85a6374" on branch "default"
1782 acl: branch access granted: "ef1ea85a6374" on branch "default"
1800 acl: path access granted: "ef1ea85a6374"
1783 acl: path access granted: "ef1ea85a6374"
1801 acl: branch access granted: "f9cafe1212c8" on branch "default"
1784 acl: branch access granted: "f9cafe1212c8" on branch "default"
1802 acl: path access granted: "f9cafe1212c8"
1785 acl: path access granted: "f9cafe1212c8"
1803 acl: branch access granted: "911600dab2ae" on branch "default"
1786 acl: branch access granted: "911600dab2ae" on branch "default"
1804 acl: path access granted: "911600dab2ae"
1787 acl: path access granted: "911600dab2ae"
1805 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1788 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1806 acl: path access granted: "e8fc755d4d82"
1789 acl: path access granted: "e8fc755d4d82"
1807 bundle2-input-part: total payload size 2068
1790 bundle2-input-part: total payload size 2068
1808 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1791 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1809 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1792 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1810 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1793 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1811 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
1794 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
1812 bundle2-input-bundle: 4 parts total
1795 bundle2-input-bundle: 4 parts total
1813 updating the branch cache
1796 updating the branch cache
1814 bundle2-output-bundle: "HG20", 3 parts total
1797 bundle2-output-bundle: "HG20", 3 parts total
1815 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1798 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1816 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1799 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1817 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1800 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1818 bundle2-input-bundle: with-transaction
1801 bundle2-input-bundle: with-transaction
1819 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1802 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1820 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1803 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1821 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1804 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1822 bundle2-input-bundle: 2 parts total
1805 bundle2-input-bundle: 2 parts total
1823 listing keys for "phases"
1806 listing keys for "phases"
1824 repository tip rolled back to revision 2 (undo push)
1807 repository tip rolled back to revision 2 (undo push)
1825 2:fb35475503ef
1808 2:fb35475503ef
1826
1809
1827
1810
1828 Branch acl conflicting allow
1811 Branch acl conflicting allow
1829 asterisk ends up applying to all branches and allowing george to
1812 asterisk ends up applying to all branches and allowing george to
1830 push foobar into the remote
1813 push foobar into the remote
1831
1814
1832 $ init_config
1815 $ init_config
1833 $ echo "[acl.allow.branches]" >> $config
1816 $ echo "[acl.allow.branches]" >> $config
1834 $ echo "foobar = astro" >> $config
1817 $ echo "foobar = astro" >> $config
1835 $ echo "* = george" >> $config
1818 $ echo "* = george" >> $config
1836 $ do_push george
1819 $ do_push george
1837 Pushing as user george
1820 Pushing as user george
1838 hgrc = """
1821 hgrc = """
1839 [hooks]
1822 [hooks]
1840 pretxnchangegroup.acl = python:hgext.acl.hook
1823 pretxnchangegroup.acl = python:hgext.acl.hook
1841 [acl]
1824 [acl]
1842 sources = push
1825 sources = push
1843 [extensions]
1826 [extensions]
1844 [acl.allow.branches]
1827 [acl.allow.branches]
1845 foobar = astro
1828 foobar = astro
1846 * = george
1829 * = george
1847 """
1830 """
1848 pushing to ../b
1831 pushing to ../b
1849 query 1; heads
1832 query 1; heads
1850 searching for changes
1833 searching for changes
1851 all remote heads known locally
1834 all remote heads known locally
1852 listing keys for "phases"
1835 listing keys for "phases"
1853 checking for updated bookmarks
1836 checking for updated bookmarks
1854 listing keys for "bookmarks"
1837 listing keys for "bookmarks"
1855 listing keys for "bookmarks"
1838 listing keys for "bookmarks"
1856 4 changesets found
1839 4 changesets found
1857 list of changesets:
1840 list of changesets:
1858 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1841 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1859 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1842 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1860 911600dab2ae7a9baff75958b84fe606851ce955
1843 911600dab2ae7a9baff75958b84fe606851ce955
1861 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1844 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1862 bundle2-output-bundle: "HG20", 5 parts total
1845 bundle2-output-bundle: "HG20", 5 parts total
1863 bundle2-output-part: "replycaps" 155 bytes payload
1846 bundle2-output-part: "replycaps" 155 bytes payload
1864 bundle2-output-part: "check:heads" streamed payload
1847 bundle2-output-part: "check:heads" streamed payload
1865 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1848 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1866 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1849 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1867 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1850 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1868 bundle2-input-bundle: with-transaction
1851 bundle2-input-bundle: with-transaction
1869 bundle2-input-part: "replycaps" supported
1852 bundle2-input-part: "replycaps" supported
1870 bundle2-input-part: total payload size 155
1853 bundle2-input-part: total payload size 155
1871 bundle2-input-part: "check:heads" supported
1854 bundle2-input-part: "check:heads" supported
1872 bundle2-input-part: total payload size 20
1855 bundle2-input-part: total payload size 20
1873 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1856 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1874 adding changesets
1857 adding changesets
1875 add changeset ef1ea85a6374
1858 add changeset ef1ea85a6374
1876 add changeset f9cafe1212c8
1859 add changeset f9cafe1212c8
1877 add changeset 911600dab2ae
1860 add changeset 911600dab2ae
1878 add changeset e8fc755d4d82
1861 add changeset e8fc755d4d82
1879 adding manifests
1862 adding manifests
1880 adding file changes
1863 adding file changes
1881 adding abc.txt revisions
1864 adding abc.txt revisions
1882 adding foo/Bar/file.txt revisions
1865 adding foo/Bar/file.txt revisions
1883 adding foo/file.txt revisions
1866 adding foo/file.txt revisions
1884 adding quux/file.py revisions
1867 adding quux/file.py revisions
1885 added 4 changesets with 4 changes to 4 files (+1 heads)
1868 added 4 changesets with 4 changes to 4 files (+1 heads)
1886 calling hook pretxnchangegroup.acl: hgext.acl.hook
1869 calling hook pretxnchangegroup.acl: hgext.acl.hook
1887 acl: checking access for user "george"
1870 acl: checking access for user "george"
1888 acl: acl.allow.branches enabled, 1 entries for user george
1871 acl: acl.allow.branches enabled, 1 entries for user george
1889 acl: acl.deny.branches not enabled
1872 acl: acl.deny.branches not enabled
1890 acl: acl.allow not enabled
1873 acl: acl.allow not enabled
1891 acl: acl.deny not enabled
1874 acl: acl.deny not enabled
1892 acl: branch access granted: "ef1ea85a6374" on branch "default"
1875 acl: branch access granted: "ef1ea85a6374" on branch "default"
1893 acl: path access granted: "ef1ea85a6374"
1876 acl: path access granted: "ef1ea85a6374"
1894 acl: branch access granted: "f9cafe1212c8" on branch "default"
1877 acl: branch access granted: "f9cafe1212c8" on branch "default"
1895 acl: path access granted: "f9cafe1212c8"
1878 acl: path access granted: "f9cafe1212c8"
1896 acl: branch access granted: "911600dab2ae" on branch "default"
1879 acl: branch access granted: "911600dab2ae" on branch "default"
1897 acl: path access granted: "911600dab2ae"
1880 acl: path access granted: "911600dab2ae"
1898 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1881 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1899 acl: path access granted: "e8fc755d4d82"
1882 acl: path access granted: "e8fc755d4d82"
1900 bundle2-input-part: total payload size 2068
1883 bundle2-input-part: total payload size 2068
1901 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1884 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1902 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1885 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
1903 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1886 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
1904 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
1887 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
1905 bundle2-input-bundle: 4 parts total
1888 bundle2-input-bundle: 4 parts total
1906 updating the branch cache
1889 updating the branch cache
1907 bundle2-output-bundle: "HG20", 3 parts total
1890 bundle2-output-bundle: "HG20", 3 parts total
1908 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1891 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
1909 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1892 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1910 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1893 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
1911 bundle2-input-bundle: with-transaction
1894 bundle2-input-bundle: with-transaction
1912 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1895 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
1913 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1896 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1914 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1897 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
1915 bundle2-input-bundle: 2 parts total
1898 bundle2-input-bundle: 2 parts total
1916 listing keys for "phases"
1899 listing keys for "phases"
1917 repository tip rolled back to revision 2 (undo push)
1900 repository tip rolled back to revision 2 (undo push)
1918 2:fb35475503ef
1901 2:fb35475503ef
1919
1902
1920 Branch acl conflicting deny
1903 Branch acl conflicting deny
1921
1904
1922 $ init_config
1905 $ init_config
1923 $ echo "[acl.deny.branches]" >> $config
1906 $ echo "[acl.deny.branches]" >> $config
1924 $ echo "foobar = astro" >> $config
1907 $ echo "foobar = astro" >> $config
1925 $ echo "default = astro" >> $config
1908 $ echo "default = astro" >> $config
1926 $ echo "* = george" >> $config
1909 $ echo "* = george" >> $config
1927 $ do_push george
1910 $ do_push george
1928 Pushing as user george
1911 Pushing as user george
1929 hgrc = """
1912 hgrc = """
1930 [hooks]
1913 [hooks]
1931 pretxnchangegroup.acl = python:hgext.acl.hook
1914 pretxnchangegroup.acl = python:hgext.acl.hook
1932 [acl]
1915 [acl]
1933 sources = push
1916 sources = push
1934 [extensions]
1917 [extensions]
1935 [acl.deny.branches]
1918 [acl.deny.branches]
1936 foobar = astro
1919 foobar = astro
1937 default = astro
1920 default = astro
1938 * = george
1921 * = george
1939 """
1922 """
1940 pushing to ../b
1923 pushing to ../b
1941 query 1; heads
1924 query 1; heads
1942 searching for changes
1925 searching for changes
1943 all remote heads known locally
1926 all remote heads known locally
1944 listing keys for "phases"
1927 listing keys for "phases"
1945 checking for updated bookmarks
1928 checking for updated bookmarks
1946 listing keys for "bookmarks"
1929 listing keys for "bookmarks"
1947 listing keys for "bookmarks"
1930 listing keys for "bookmarks"
1948 4 changesets found
1931 4 changesets found
1949 list of changesets:
1932 list of changesets:
1950 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1933 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
1951 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1934 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
1952 911600dab2ae7a9baff75958b84fe606851ce955
1935 911600dab2ae7a9baff75958b84fe606851ce955
1953 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1936 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
1954 bundle2-output-bundle: "HG20", 5 parts total
1937 bundle2-output-bundle: "HG20", 5 parts total
1955 bundle2-output-part: "replycaps" 155 bytes payload
1938 bundle2-output-part: "replycaps" 155 bytes payload
1956 bundle2-output-part: "check:heads" streamed payload
1939 bundle2-output-part: "check:heads" streamed payload
1957 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1940 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
1958 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1941 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1959 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1942 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
1960 bundle2-input-bundle: with-transaction
1943 bundle2-input-bundle: with-transaction
1961 bundle2-input-part: "replycaps" supported
1944 bundle2-input-part: "replycaps" supported
1962 bundle2-input-part: total payload size 155
1945 bundle2-input-part: total payload size 155
1963 bundle2-input-part: "check:heads" supported
1946 bundle2-input-part: "check:heads" supported
1964 bundle2-input-part: total payload size 20
1947 bundle2-input-part: total payload size 20
1965 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1948 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
1966 adding changesets
1949 adding changesets
1967 add changeset ef1ea85a6374
1950 add changeset ef1ea85a6374
1968 add changeset f9cafe1212c8
1951 add changeset f9cafe1212c8
1969 add changeset 911600dab2ae
1952 add changeset 911600dab2ae
1970 add changeset e8fc755d4d82
1953 add changeset e8fc755d4d82
1971 adding manifests
1954 adding manifests
1972 adding file changes
1955 adding file changes
1973 adding abc.txt revisions
1956 adding abc.txt revisions
1974 adding foo/Bar/file.txt revisions
1957 adding foo/Bar/file.txt revisions
1975 adding foo/file.txt revisions
1958 adding foo/file.txt revisions
1976 adding quux/file.py revisions
1959 adding quux/file.py revisions
1977 added 4 changesets with 4 changes to 4 files (+1 heads)
1960 added 4 changesets with 4 changes to 4 files (+1 heads)
1978 calling hook pretxnchangegroup.acl: hgext.acl.hook
1961 calling hook pretxnchangegroup.acl: hgext.acl.hook
1979 acl: checking access for user "george"
1962 acl: checking access for user "george"
1980 acl: acl.allow.branches not enabled
1963 acl: acl.allow.branches not enabled
1981 acl: acl.deny.branches enabled, 1 entries for user george
1964 acl: acl.deny.branches enabled, 1 entries for user george
1982 acl: acl.allow not enabled
1965 acl: acl.allow not enabled
1983 acl: acl.deny not enabled
1966 acl: acl.deny not enabled
1984 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1967 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1985 bundle2-input-part: total payload size 2068
1968 bundle2-input-part: total payload size 2068
1986 bundle2-input-bundle: 4 parts total
1969 bundle2-input-bundle: 4 parts total
1987 transaction abort!
1970 transaction abort!
1988 rollback completed
1971 rollback completed
1989 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1972 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
1990 no rollback information available
1973 no rollback information available
1991 2:fb35475503ef
1974 2:fb35475503ef
1992
1975
1993 User 'astro' must not be denied
1976 User 'astro' must not be denied
1994
1977
1995 $ init_config
1978 $ init_config
1996 $ echo "[acl.deny.branches]" >> $config
1979 $ echo "[acl.deny.branches]" >> $config
1997 $ echo "default = !astro" >> $config
1980 $ echo "default = !astro" >> $config
1998 $ do_push astro
1981 $ do_push astro
1999 Pushing as user astro
1982 Pushing as user astro
2000 hgrc = """
1983 hgrc = """
2001 [hooks]
1984 [hooks]
2002 pretxnchangegroup.acl = python:hgext.acl.hook
1985 pretxnchangegroup.acl = python:hgext.acl.hook
2003 [acl]
1986 [acl]
2004 sources = push
1987 sources = push
2005 [extensions]
1988 [extensions]
2006 [acl.deny.branches]
1989 [acl.deny.branches]
2007 default = !astro
1990 default = !astro
2008 """
1991 """
2009 pushing to ../b
1992 pushing to ../b
2010 query 1; heads
1993 query 1; heads
2011 searching for changes
1994 searching for changes
2012 all remote heads known locally
1995 all remote heads known locally
2013 listing keys for "phases"
1996 listing keys for "phases"
2014 checking for updated bookmarks
1997 checking for updated bookmarks
2015 listing keys for "bookmarks"
1998 listing keys for "bookmarks"
2016 listing keys for "bookmarks"
1999 listing keys for "bookmarks"
2017 4 changesets found
2000 4 changesets found
2018 list of changesets:
2001 list of changesets:
2019 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2002 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2020 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2003 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2021 911600dab2ae7a9baff75958b84fe606851ce955
2004 911600dab2ae7a9baff75958b84fe606851ce955
2022 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2005 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2023 bundle2-output-bundle: "HG20", 5 parts total
2006 bundle2-output-bundle: "HG20", 5 parts total
2024 bundle2-output-part: "replycaps" 155 bytes payload
2007 bundle2-output-part: "replycaps" 155 bytes payload
2025 bundle2-output-part: "check:heads" streamed payload
2008 bundle2-output-part: "check:heads" streamed payload
2026 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2009 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2027 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2010 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2028 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2011 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2029 bundle2-input-bundle: with-transaction
2012 bundle2-input-bundle: with-transaction
2030 bundle2-input-part: "replycaps" supported
2013 bundle2-input-part: "replycaps" supported
2031 bundle2-input-part: total payload size 155
2014 bundle2-input-part: total payload size 155
2032 bundle2-input-part: "check:heads" supported
2015 bundle2-input-part: "check:heads" supported
2033 bundle2-input-part: total payload size 20
2016 bundle2-input-part: total payload size 20
2034 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2017 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2035 adding changesets
2018 adding changesets
2036 add changeset ef1ea85a6374
2019 add changeset ef1ea85a6374
2037 add changeset f9cafe1212c8
2020 add changeset f9cafe1212c8
2038 add changeset 911600dab2ae
2021 add changeset 911600dab2ae
2039 add changeset e8fc755d4d82
2022 add changeset e8fc755d4d82
2040 adding manifests
2023 adding manifests
2041 adding file changes
2024 adding file changes
2042 adding abc.txt revisions
2025 adding abc.txt revisions
2043 adding foo/Bar/file.txt revisions
2026 adding foo/Bar/file.txt revisions
2044 adding foo/file.txt revisions
2027 adding foo/file.txt revisions
2045 adding quux/file.py revisions
2028 adding quux/file.py revisions
2046 added 4 changesets with 4 changes to 4 files (+1 heads)
2029 added 4 changesets with 4 changes to 4 files (+1 heads)
2047 calling hook pretxnchangegroup.acl: hgext.acl.hook
2030 calling hook pretxnchangegroup.acl: hgext.acl.hook
2048 acl: checking access for user "astro"
2031 acl: checking access for user "astro"
2049 acl: acl.allow.branches not enabled
2032 acl: acl.allow.branches not enabled
2050 acl: acl.deny.branches enabled, 0 entries for user astro
2033 acl: acl.deny.branches enabled, 0 entries for user astro
2051 acl: acl.allow not enabled
2034 acl: acl.allow not enabled
2052 acl: acl.deny not enabled
2035 acl: acl.deny not enabled
2053 acl: branch access granted: "ef1ea85a6374" on branch "default"
2036 acl: branch access granted: "ef1ea85a6374" on branch "default"
2054 acl: path access granted: "ef1ea85a6374"
2037 acl: path access granted: "ef1ea85a6374"
2055 acl: branch access granted: "f9cafe1212c8" on branch "default"
2038 acl: branch access granted: "f9cafe1212c8" on branch "default"
2056 acl: path access granted: "f9cafe1212c8"
2039 acl: path access granted: "f9cafe1212c8"
2057 acl: branch access granted: "911600dab2ae" on branch "default"
2040 acl: branch access granted: "911600dab2ae" on branch "default"
2058 acl: path access granted: "911600dab2ae"
2041 acl: path access granted: "911600dab2ae"
2059 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2042 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2060 acl: path access granted: "e8fc755d4d82"
2043 acl: path access granted: "e8fc755d4d82"
2061 bundle2-input-part: total payload size 2068
2044 bundle2-input-part: total payload size 2068
2062 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
2045 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
2063 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
2046 pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
2064 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
2047 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
2065 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
2048 pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
2066 bundle2-input-bundle: 4 parts total
2049 bundle2-input-bundle: 4 parts total
2067 updating the branch cache
2050 updating the branch cache
2068 bundle2-output-bundle: "HG20", 3 parts total
2051 bundle2-output-bundle: "HG20", 3 parts total
2069 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
2052 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
2070 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
2053 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
2071 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
2054 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
2072 bundle2-input-bundle: with-transaction
2055 bundle2-input-bundle: with-transaction
2073 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
2056 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
2074 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
2057 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
2075 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
2058 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
2076 bundle2-input-bundle: 2 parts total
2059 bundle2-input-bundle: 2 parts total
2077 listing keys for "phases"
2060 listing keys for "phases"
2078 repository tip rolled back to revision 2 (undo push)
2061 repository tip rolled back to revision 2 (undo push)
2079 2:fb35475503ef
2062 2:fb35475503ef
2080
2063
2081
2064
2082 Non-astro users must be denied
2065 Non-astro users must be denied
2083
2066
2084 $ do_push george
2067 $ do_push george
2085 Pushing as user george
2068 Pushing as user george
2086 hgrc = """
2069 hgrc = """
2087 [hooks]
2070 [hooks]
2088 pretxnchangegroup.acl = python:hgext.acl.hook
2071 pretxnchangegroup.acl = python:hgext.acl.hook
2089 [acl]
2072 [acl]
2090 sources = push
2073 sources = push
2091 [extensions]
2074 [extensions]
2092 [acl.deny.branches]
2075 [acl.deny.branches]
2093 default = !astro
2076 default = !astro
2094 """
2077 """
2095 pushing to ../b
2078 pushing to ../b
2096 query 1; heads
2079 query 1; heads
2097 searching for changes
2080 searching for changes
2098 all remote heads known locally
2081 all remote heads known locally
2099 listing keys for "phases"
2082 listing keys for "phases"
2100 checking for updated bookmarks
2083 checking for updated bookmarks
2101 listing keys for "bookmarks"
2084 listing keys for "bookmarks"
2102 listing keys for "bookmarks"
2085 listing keys for "bookmarks"
2103 4 changesets found
2086 4 changesets found
2104 list of changesets:
2087 list of changesets:
2105 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2088 ef1ea85a6374b77d6da9dcda9541f498f2d17df7
2106 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2089 f9cafe1212c8c6fa1120d14a556e18cc44ff8bdd
2107 911600dab2ae7a9baff75958b84fe606851ce955
2090 911600dab2ae7a9baff75958b84fe606851ce955
2108 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2091 e8fc755d4d8217ee5b0c2bb41558c40d43b92c01
2109 bundle2-output-bundle: "HG20", 5 parts total
2092 bundle2-output-bundle: "HG20", 5 parts total
2110 bundle2-output-part: "replycaps" 155 bytes payload
2093 bundle2-output-part: "replycaps" 155 bytes payload
2111 bundle2-output-part: "check:heads" streamed payload
2094 bundle2-output-part: "check:heads" streamed payload
2112 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2095 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
2113 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2096 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2114 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2097 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
2115 bundle2-input-bundle: with-transaction
2098 bundle2-input-bundle: with-transaction
2116 bundle2-input-part: "replycaps" supported
2099 bundle2-input-part: "replycaps" supported
2117 bundle2-input-part: total payload size 155
2100 bundle2-input-part: total payload size 155
2118 bundle2-input-part: "check:heads" supported
2101 bundle2-input-part: "check:heads" supported
2119 bundle2-input-part: total payload size 20
2102 bundle2-input-part: total payload size 20
2120 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2103 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
2121 adding changesets
2104 adding changesets
2122 add changeset ef1ea85a6374
2105 add changeset ef1ea85a6374
2123 add changeset f9cafe1212c8
2106 add changeset f9cafe1212c8
2124 add changeset 911600dab2ae
2107 add changeset 911600dab2ae
2125 add changeset e8fc755d4d82
2108 add changeset e8fc755d4d82
2126 adding manifests
2109 adding manifests
2127 adding file changes
2110 adding file changes
2128 adding abc.txt revisions
2111 adding abc.txt revisions
2129 adding foo/Bar/file.txt revisions
2112 adding foo/Bar/file.txt revisions
2130 adding foo/file.txt revisions
2113 adding foo/file.txt revisions
2131 adding quux/file.py revisions
2114 adding quux/file.py revisions
2132 added 4 changesets with 4 changes to 4 files (+1 heads)
2115 added 4 changesets with 4 changes to 4 files (+1 heads)
2133 calling hook pretxnchangegroup.acl: hgext.acl.hook
2116 calling hook pretxnchangegroup.acl: hgext.acl.hook
2134 acl: checking access for user "george"
2117 acl: checking access for user "george"
2135 acl: acl.allow.branches not enabled
2118 acl: acl.allow.branches not enabled
2136 acl: acl.deny.branches enabled, 1 entries for user george
2119 acl: acl.deny.branches enabled, 1 entries for user george
2137 acl: acl.allow not enabled
2120 acl: acl.allow not enabled
2138 acl: acl.deny not enabled
2121 acl: acl.deny not enabled
2139 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2122 error: pretxnchangegroup.acl hook failed: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2140 bundle2-input-part: total payload size 2068
2123 bundle2-input-part: total payload size 2068
2141 bundle2-input-bundle: 4 parts total
2124 bundle2-input-bundle: 4 parts total
2142 transaction abort!
2125 transaction abort!
2143 rollback completed
2126 rollback completed
2144 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2127 abort: acl: user "george" denied on branch "default" (changeset "ef1ea85a6374")
2145 no rollback information available
2128 no rollback information available
2146 2:fb35475503ef
2129 2:fb35475503ef
2147
2130
2148
2131
@@ -1,383 +1,391 b''
1 #require hardlink
1 #require hardlink
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > import sys
4 > import sys
5 > from mercurial import util
5 > from mercurial import util
6 > for f in sorted(sys.stdin.readlines()):
6 > for f in sorted(sys.stdin.readlines()):
7 > f = f[:-1]
7 > f = f[:-1]
8 > print util.nlinks(f), f
8 > print util.nlinks(f), f
9 > EOF
9 > EOF
10
10
11 $ nlinksdir()
11 $ nlinksdir()
12 > {
12 > {
13 > find $1 -type f | python $TESTTMP/nlinks.py
13 > find $1 -type f | python $TESTTMP/nlinks.py
14 > }
14 > }
15
15
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17
17
18 $ cat > linkcp.py <<EOF
18 $ cat > linkcp.py <<EOF
19 > from mercurial import util
19 > from mercurial import util
20 > import sys
20 > import sys
21 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
21 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
22 > EOF
22 > EOF
23
23
24 $ linkcp()
24 $ linkcp()
25 > {
25 > {
26 > python $TESTTMP/linkcp.py $1 $2
26 > python $TESTTMP/linkcp.py $1 $2
27 > }
27 > }
28
28
29 Prepare repo r1:
29 Prepare repo r1:
30
30
31 $ hg init r1
31 $ hg init r1
32 $ cd r1
32 $ cd r1
33
33
34 $ echo c1 > f1
34 $ echo c1 > f1
35 $ hg add f1
35 $ hg add f1
36 $ hg ci -m0
36 $ hg ci -m0
37
37
38 $ mkdir d1
38 $ mkdir d1
39 $ cd d1
39 $ cd d1
40 $ echo c2 > f2
40 $ echo c2 > f2
41 $ hg add f2
41 $ hg add f2
42 $ hg ci -m1
42 $ hg ci -m1
43 $ cd ../..
43 $ cd ../..
44
44
45 $ nlinksdir r1/.hg/store
45 $ nlinksdir r1/.hg/store
46 1 r1/.hg/store/00changelog.i
46 1 r1/.hg/store/00changelog.i
47 1 r1/.hg/store/00manifest.i
47 1 r1/.hg/store/00manifest.i
48 1 r1/.hg/store/data/d1/f2.i
48 1 r1/.hg/store/data/d1/f2.i
49 1 r1/.hg/store/data/f1.i
49 1 r1/.hg/store/data/f1.i
50 1 r1/.hg/store/fncache
50 1 r1/.hg/store/fncache
51 1 r1/.hg/store/phaseroots
51 1 r1/.hg/store/phaseroots
52 1 r1/.hg/store/undo
52 1 r1/.hg/store/undo
53 1 r1/.hg/store/undo.backup.fncache
53 1 r1/.hg/store/undo.backup.fncache
54 1 r1/.hg/store/undo.backupfiles
54 1 r1/.hg/store/undo.backupfiles
55 1 r1/.hg/store/undo.phaseroots
55 1 r1/.hg/store/undo.phaseroots
56
56
57
57
58 Create hardlinked clone r2:
58 Create hardlinked clone r2:
59
59
60 $ hg clone -U --debug r1 r2 --config progress.debug=true
60 $ hg clone -U --debug r1 r2 --config progress.debug=true
61 linking: 1
61 linking: 1
62 linking: 2
62 linking: 2
63 linking: 3
63 linking: 3
64 linking: 4
64 linking: 4
65 linking: 5
65 linking: 5
66 linking: 6
66 linking: 6
67 linking: 7
67 linking: 7
68 linked 7 files
68 linked 7 files
69
69
70 Create non-hardlinked clone r3:
70 Create non-hardlinked clone r3:
71
71
72 $ hg clone --pull r1 r3
72 $ hg clone --pull r1 r3
73 requesting all changes
73 requesting all changes
74 adding changesets
74 adding changesets
75 adding manifests
75 adding manifests
76 adding file changes
76 adding file changes
77 added 2 changesets with 2 changes to 2 files
77 added 2 changesets with 2 changes to 2 files
78 updating to branch default
78 updating to branch default
79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
80
80
81
81
82 Repos r1 and r2 should now contain hardlinked files:
82 Repos r1 and r2 should now contain hardlinked files:
83
83
84 $ nlinksdir r1/.hg/store
84 $ nlinksdir r1/.hg/store
85 2 r1/.hg/store/00changelog.i
85 2 r1/.hg/store/00changelog.i
86 2 r1/.hg/store/00manifest.i
86 2 r1/.hg/store/00manifest.i
87 2 r1/.hg/store/data/d1/f2.i
87 2 r1/.hg/store/data/d1/f2.i
88 2 r1/.hg/store/data/f1.i
88 2 r1/.hg/store/data/f1.i
89 2 r1/.hg/store/fncache
89 2 r1/.hg/store/fncache
90 1 r1/.hg/store/phaseroots
90 1 r1/.hg/store/phaseroots
91 1 r1/.hg/store/undo
91 1 r1/.hg/store/undo
92 1 r1/.hg/store/undo.backup.fncache
92 1 r1/.hg/store/undo.backup.fncache
93 1 r1/.hg/store/undo.backupfiles
93 1 r1/.hg/store/undo.backupfiles
94 1 r1/.hg/store/undo.phaseroots
94 1 r1/.hg/store/undo.phaseroots
95
95
96 $ nlinksdir r2/.hg/store
96 $ nlinksdir r2/.hg/store
97 2 r2/.hg/store/00changelog.i
97 2 r2/.hg/store/00changelog.i
98 2 r2/.hg/store/00manifest.i
98 2 r2/.hg/store/00manifest.i
99 2 r2/.hg/store/data/d1/f2.i
99 2 r2/.hg/store/data/d1/f2.i
100 2 r2/.hg/store/data/f1.i
100 2 r2/.hg/store/data/f1.i
101 2 r2/.hg/store/fncache
101 2 r2/.hg/store/fncache
102
102
103 Repo r3 should not be hardlinked:
103 Repo r3 should not be hardlinked:
104
104
105 $ nlinksdir r3/.hg/store
105 $ nlinksdir r3/.hg/store
106 1 r3/.hg/store/00changelog.i
106 1 r3/.hg/store/00changelog.i
107 1 r3/.hg/store/00manifest.i
107 1 r3/.hg/store/00manifest.i
108 1 r3/.hg/store/data/d1/f2.i
108 1 r3/.hg/store/data/d1/f2.i
109 1 r3/.hg/store/data/f1.i
109 1 r3/.hg/store/data/f1.i
110 1 r3/.hg/store/fncache
110 1 r3/.hg/store/fncache
111 1 r3/.hg/store/phaseroots
111 1 r3/.hg/store/phaseroots
112 1 r3/.hg/store/undo
112 1 r3/.hg/store/undo
113 1 r3/.hg/store/undo.backupfiles
113 1 r3/.hg/store/undo.backupfiles
114 1 r3/.hg/store/undo.phaseroots
114 1 r3/.hg/store/undo.phaseroots
115
115
116
116
117 Create a non-inlined filelog in r3:
117 Create a non-inlined filelog in r3:
118
118
119 $ cd r3/d1
119 $ cd r3/d1
120 >>> f = open('data1', 'wb')
120 >>> f = open('data1', 'wb')
121 >>> for x in range(10000):
121 >>> for x in range(10000):
122 ... f.write("%s\n" % str(x))
122 ... f.write("%s\n" % str(x))
123 >>> f.close()
123 >>> f.close()
124 $ for j in 0 1 2 3 4 5 6 7 8 9; do
124 $ for j in 0 1 2 3 4 5 6 7 8 9; do
125 > cat data1 >> f2
125 > cat data1 >> f2
126 > hg commit -m$j
126 > hg commit -m$j
127 > done
127 > done
128 $ cd ../..
128 $ cd ../..
129
129
130 $ nlinksdir r3/.hg/store
130 $ nlinksdir r3/.hg/store
131 1 r3/.hg/store/00changelog.i
131 1 r3/.hg/store/00changelog.i
132 1 r3/.hg/store/00manifest.i
132 1 r3/.hg/store/00manifest.i
133 1 r3/.hg/store/data/d1/f2.d
133 1 r3/.hg/store/data/d1/f2.d
134 1 r3/.hg/store/data/d1/f2.i
134 1 r3/.hg/store/data/d1/f2.i
135 1 r3/.hg/store/data/f1.i
135 1 r3/.hg/store/data/f1.i
136 1 r3/.hg/store/fncache
136 1 r3/.hg/store/fncache
137 1 r3/.hg/store/phaseroots
137 1 r3/.hg/store/phaseroots
138 1 r3/.hg/store/undo
138 1 r3/.hg/store/undo
139 1 r3/.hg/store/undo.backup.fncache
139 1 r3/.hg/store/undo.backup.fncache
140 1 r3/.hg/store/undo.backup.phaseroots
140 1 r3/.hg/store/undo.backup.phaseroots
141 1 r3/.hg/store/undo.backupfiles
141 1 r3/.hg/store/undo.backupfiles
142 1 r3/.hg/store/undo.phaseroots
142 1 r3/.hg/store/undo.phaseroots
143
143
144 Push to repo r1 should break up most hardlinks in r2:
144 Push to repo r1 should break up most hardlinks in r2:
145
145
146 $ hg -R r2 verify
146 $ hg -R r2 verify
147 checking changesets
147 checking changesets
148 checking manifests
148 checking manifests
149 crosschecking files in changesets and manifests
149 crosschecking files in changesets and manifests
150 checking files
150 checking files
151 2 files, 2 changesets, 2 total revisions
151 2 files, 2 changesets, 2 total revisions
152
152
153 $ cd r3
153 $ cd r3
154 $ hg push
154 $ hg push
155 pushing to $TESTTMP/r1 (glob)
155 pushing to $TESTTMP/r1 (glob)
156 searching for changes
156 searching for changes
157 adding changesets
157 adding changesets
158 adding manifests
158 adding manifests
159 adding file changes
159 adding file changes
160 added 10 changesets with 10 changes to 1 files
160 added 10 changesets with 10 changes to 1 files
161
161
162 $ cd ..
162 $ cd ..
163
163
164 $ nlinksdir r2/.hg/store
164 $ nlinksdir r2/.hg/store
165 1 r2/.hg/store/00changelog.i
165 1 r2/.hg/store/00changelog.i
166 1 r2/.hg/store/00manifest.i
166 1 r2/.hg/store/00manifest.i
167 1 r2/.hg/store/data/d1/f2.i
167 1 r2/.hg/store/data/d1/f2.i
168 2 r2/.hg/store/data/f1.i
168 2 r2/.hg/store/data/f1.i
169 [12] r2/\.hg/store/fncache (re)
169 [12] r2/\.hg/store/fncache (re)
170
170
171 $ hg -R r2 verify
171 $ hg -R r2 verify
172 checking changesets
172 checking changesets
173 checking manifests
173 checking manifests
174 crosschecking files in changesets and manifests
174 crosschecking files in changesets and manifests
175 checking files
175 checking files
176 2 files, 2 changesets, 2 total revisions
176 2 files, 2 changesets, 2 total revisions
177
177
178
178
179 $ cd r1
179 $ cd r1
180 $ hg up
180 $ hg up
181 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
182
182
183 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
183 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
184
184
185 $ echo c1c1 >> f1
185 $ echo c1c1 >> f1
186 $ hg ci -m00
186 $ hg ci -m00
187 $ cd ..
187 $ cd ..
188
188
189 $ nlinksdir r2/.hg/store
189 $ nlinksdir r2/.hg/store
190 1 r2/.hg/store/00changelog.i
190 1 r2/.hg/store/00changelog.i
191 1 r2/.hg/store/00manifest.i
191 1 r2/.hg/store/00manifest.i
192 1 r2/.hg/store/data/d1/f2.i
192 1 r2/.hg/store/data/d1/f2.i
193 1 r2/.hg/store/data/f1.i
193 1 r2/.hg/store/data/f1.i
194 [12] r2/\.hg/store/fncache (re)
194 [12] r2/\.hg/store/fncache (re)
195
195
196
196
197 $ cd r3
197 $ cd r3
198 $ hg tip --template '{rev}:{node|short}\n'
198 $ hg tip --template '{rev}:{node|short}\n'
199 11:a6451b6bc41f
199 11:a6451b6bc41f
200 $ echo bla > f1
200 $ echo bla > f1
201 $ hg ci -m1
201 $ hg ci -m1
202 $ cd ..
202 $ cd ..
203
203
204 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
204 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
205
205
206 $ linkcp r3 r4
206 $ linkcp r3 r4
207
207
208 r4 has hardlinks in the working dir (not just inside .hg):
208 r4 has hardlinks in the working dir (not just inside .hg):
209
209
210 $ nlinksdir r4
210 $ nlinksdir r4
211 2 r4/.hg/00changelog.i
211 2 r4/.hg/00changelog.i
212 2 r4/.hg/branch
212 2 r4/.hg/branch
213 2 r4/.hg/cache/branch2-served
214 2 r4/.hg/cache/checkisexec (execbit !)
213 2 r4/.hg/cache/checkisexec (execbit !)
215 3 r4/.hg/cache/checklink (?)
214 3 r4/.hg/cache/checklink (?)
216 ? r4/.hg/cache/checklink-target (glob) (symlink !)
215 ? r4/.hg/cache/checklink-target (glob) (symlink !)
217 2 r4/.hg/cache/checknoexec (execbit !)
216 2 r4/.hg/cache/checknoexec (execbit !)
217 2 r4/.hg/cache/branch2-base
218 2 r4/.hg/cache/branch2-served
219 2 r4/.hg/cache/checkisexec
220 2 r4/.hg/cache/checklink-target
221 2 r4/.hg/cache/checknoexec
218 2 r4/.hg/cache/rbc-names-v1
222 2 r4/.hg/cache/rbc-names-v1
219 2 r4/.hg/cache/rbc-revs-v1
223 2 r4/.hg/cache/rbc-revs-v1
220 2 r4/.hg/dirstate
224 2 r4/.hg/dirstate
221 2 r4/.hg/hgrc
225 2 r4/.hg/hgrc
222 2 r4/.hg/last-message.txt
226 2 r4/.hg/last-message.txt
223 2 r4/.hg/requires
227 2 r4/.hg/requires
224 2 r4/.hg/store/00changelog.i
228 2 r4/.hg/store/00changelog.i
225 2 r4/.hg/store/00manifest.i
229 2 r4/.hg/store/00manifest.i
226 2 r4/.hg/store/data/d1/f2.d
230 2 r4/.hg/store/data/d1/f2.d
227 2 r4/.hg/store/data/d1/f2.i
231 2 r4/.hg/store/data/d1/f2.i
228 2 r4/.hg/store/data/f1.i
232 2 r4/.hg/store/data/f1.i
229 2 r4/.hg/store/fncache
233 2 r4/.hg/store/fncache
230 2 r4/.hg/store/phaseroots
234 2 r4/.hg/store/phaseroots
231 2 r4/.hg/store/undo
235 2 r4/.hg/store/undo
232 2 r4/.hg/store/undo.backup.fncache
236 2 r4/.hg/store/undo.backup.fncache
233 2 r4/.hg/store/undo.backup.phaseroots
237 2 r4/.hg/store/undo.backup.phaseroots
234 2 r4/.hg/store/undo.backupfiles
238 2 r4/.hg/store/undo.backupfiles
235 2 r4/.hg/store/undo.phaseroots
239 2 r4/.hg/store/undo.phaseroots
236 [24] r4/\.hg/undo\.backup\.dirstate (re)
240 [24] r4/\.hg/undo\.backup\.dirstate (re)
237 2 r4/.hg/undo.bookmarks
241 2 r4/.hg/undo.bookmarks
238 2 r4/.hg/undo.branch
242 2 r4/.hg/undo.branch
239 2 r4/.hg/undo.desc
243 2 r4/.hg/undo.desc
240 [24] r4/\.hg/undo\.dirstate (re)
244 [24] r4/\.hg/undo\.dirstate (re)
241 2 r4/d1/data1
245 2 r4/d1/data1
242 2 r4/d1/f2
246 2 r4/d1/f2
243 2 r4/f1
247 2 r4/f1
244
248
245 Update back to revision 11 in r4 should break hardlink of file f1:
249 Update back to revision 11 in r4 should break hardlink of file f1:
246
250
247 $ hg -R r4 up 11
251 $ hg -R r4 up 11
248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
249
253
250 $ nlinksdir r4
254 $ nlinksdir r4
251 2 r4/.hg/00changelog.i
255 2 r4/.hg/00changelog.i
252 1 r4/.hg/branch
256 1 r4/.hg/branch
253 2 r4/.hg/cache/branch2-served
254 2 r4/.hg/cache/checkisexec (execbit !)
257 2 r4/.hg/cache/checkisexec (execbit !)
255 2 r4/.hg/cache/checklink-target (symlink !)
258 2 r4/.hg/cache/checklink-target (symlink !)
256 2 r4/.hg/cache/checknoexec (execbit !)
259 2 r4/.hg/cache/checknoexec (execbit !)
260 2 r4/.hg/cache/branch2-base
261 2 r4/.hg/cache/branch2-served
262 2 r4/.hg/cache/checkisexec
263 2 r4/.hg/cache/checklink-target
264 2 r4/.hg/cache/checknoexec
257 2 r4/.hg/cache/rbc-names-v1
265 2 r4/.hg/cache/rbc-names-v1
258 2 r4/.hg/cache/rbc-revs-v1
266 2 r4/.hg/cache/rbc-revs-v1
259 1 r4/.hg/dirstate
267 1 r4/.hg/dirstate
260 2 r4/.hg/hgrc
268 2 r4/.hg/hgrc
261 2 r4/.hg/last-message.txt
269 2 r4/.hg/last-message.txt
262 2 r4/.hg/requires
270 2 r4/.hg/requires
263 2 r4/.hg/store/00changelog.i
271 2 r4/.hg/store/00changelog.i
264 2 r4/.hg/store/00manifest.i
272 2 r4/.hg/store/00manifest.i
265 2 r4/.hg/store/data/d1/f2.d
273 2 r4/.hg/store/data/d1/f2.d
266 2 r4/.hg/store/data/d1/f2.i
274 2 r4/.hg/store/data/d1/f2.i
267 2 r4/.hg/store/data/f1.i
275 2 r4/.hg/store/data/f1.i
268 2 r4/.hg/store/fncache
276 2 r4/.hg/store/fncache
269 2 r4/.hg/store/phaseroots
277 2 r4/.hg/store/phaseroots
270 2 r4/.hg/store/undo
278 2 r4/.hg/store/undo
271 2 r4/.hg/store/undo.backup.fncache
279 2 r4/.hg/store/undo.backup.fncache
272 2 r4/.hg/store/undo.backup.phaseroots
280 2 r4/.hg/store/undo.backup.phaseroots
273 2 r4/.hg/store/undo.backupfiles
281 2 r4/.hg/store/undo.backupfiles
274 2 r4/.hg/store/undo.phaseroots
282 2 r4/.hg/store/undo.phaseroots
275 [24] r4/\.hg/undo\.backup\.dirstate (re)
283 [24] r4/\.hg/undo\.backup\.dirstate (re)
276 2 r4/.hg/undo.bookmarks
284 2 r4/.hg/undo.bookmarks
277 2 r4/.hg/undo.branch
285 2 r4/.hg/undo.branch
278 2 r4/.hg/undo.desc
286 2 r4/.hg/undo.desc
279 [24] r4/\.hg/undo\.dirstate (re)
287 [24] r4/\.hg/undo\.dirstate (re)
280 2 r4/d1/data1
288 2 r4/d1/data1
281 2 r4/d1/f2
289 2 r4/d1/f2
282 1 r4/f1
290 1 r4/f1
283
291
284
292
285 Test hardlinking outside hg:
293 Test hardlinking outside hg:
286
294
287 $ mkdir x
295 $ mkdir x
288 $ echo foo > x/a
296 $ echo foo > x/a
289
297
290 $ linkcp x y
298 $ linkcp x y
291 $ echo bar >> y/a
299 $ echo bar >> y/a
292
300
293 No diff if hardlink:
301 No diff if hardlink:
294
302
295 $ diff x/a y/a
303 $ diff x/a y/a
296
304
297 Test mq hardlinking:
305 Test mq hardlinking:
298
306
299 $ echo "[extensions]" >> $HGRCPATH
307 $ echo "[extensions]" >> $HGRCPATH
300 $ echo "mq=" >> $HGRCPATH
308 $ echo "mq=" >> $HGRCPATH
301
309
302 $ hg init a
310 $ hg init a
303 $ cd a
311 $ cd a
304
312
305 $ hg qimport -n foo - << EOF
313 $ hg qimport -n foo - << EOF
306 > # HG changeset patch
314 > # HG changeset patch
307 > # Date 1 0
315 > # Date 1 0
308 > diff -r 2588a8b53d66 a
316 > diff -r 2588a8b53d66 a
309 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
318 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
311 > @@ -0,0 +1,1 @@
319 > @@ -0,0 +1,1 @@
312 > +a
320 > +a
313 > EOF
321 > EOF
314 adding foo to series file
322 adding foo to series file
315
323
316 $ hg qpush
324 $ hg qpush
317 applying foo
325 applying foo
318 now at: foo
326 now at: foo
319
327
320 $ cd ..
328 $ cd ..
321 $ linkcp a b
329 $ linkcp a b
322 $ cd b
330 $ cd b
323
331
324 $ hg qimport -n bar - << EOF
332 $ hg qimport -n bar - << EOF
325 > # HG changeset patch
333 > # HG changeset patch
326 > # Date 2 0
334 > # Date 2 0
327 > diff -r 2588a8b53d66 a
335 > diff -r 2588a8b53d66 a
328 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
336 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
329 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
337 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
330 > @@ -0,0 +1,1 @@
338 > @@ -0,0 +1,1 @@
331 > +b
339 > +b
332 > EOF
340 > EOF
333 adding bar to series file
341 adding bar to series file
334
342
335 $ hg qpush
343 $ hg qpush
336 applying bar
344 applying bar
337 now at: bar
345 now at: bar
338
346
339 $ cat .hg/patches/status
347 $ cat .hg/patches/status
340 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
348 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
341 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
349 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
342
350
343 $ cat .hg/patches/series
351 $ cat .hg/patches/series
344 foo
352 foo
345 bar
353 bar
346
354
347 $ cat ../a/.hg/patches/status
355 $ cat ../a/.hg/patches/status
348 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
356 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
349
357
350 $ cat ../a/.hg/patches/series
358 $ cat ../a/.hg/patches/series
351 foo
359 foo
352
360
353 Test tags hardlinking:
361 Test tags hardlinking:
354
362
355 $ hg qdel -r qbase:qtip
363 $ hg qdel -r qbase:qtip
356 patch foo finalized without changeset message
364 patch foo finalized without changeset message
357 patch bar finalized without changeset message
365 patch bar finalized without changeset message
358
366
359 $ hg tag -l lfoo
367 $ hg tag -l lfoo
360 $ hg tag foo
368 $ hg tag foo
361
369
362 $ cd ..
370 $ cd ..
363 $ linkcp b c
371 $ linkcp b c
364 $ cd c
372 $ cd c
365
373
366 $ hg tag -l -r 0 lbar
374 $ hg tag -l -r 0 lbar
367 $ hg tag -r 0 bar
375 $ hg tag -r 0 bar
368
376
369 $ cat .hgtags
377 $ cat .hgtags
370 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
378 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
371 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
379 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
372
380
373 $ cat .hg/localtags
381 $ cat .hg/localtags
374 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
382 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
375 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
383 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
376
384
377 $ cat ../b/.hgtags
385 $ cat ../b/.hgtags
378 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
386 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
379
387
380 $ cat ../b/.hg/localtags
388 $ cat ../b/.hg/localtags
381 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
389 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
382
390
383 $ cd ..
391 $ cd ..
@@ -1,158 +1,156 b''
1 #require unix-permissions
1 #require unix-permissions
2
2
3 test that new files created in .hg inherit the permissions from .hg/store
3 test that new files created in .hg inherit the permissions from .hg/store
4
4
5 $ mkdir dir
5 $ mkdir dir
6
6
7 just in case somebody has a strange $TMPDIR
7 just in case somebody has a strange $TMPDIR
8
8
9 $ chmod g-s dir
9 $ chmod g-s dir
10 $ cd dir
10 $ cd dir
11
11
12 $ cat >printmodes.py <<EOF
12 $ cat >printmodes.py <<EOF
13 > import os, sys
13 > import os, sys
14 >
14 >
15 > allnames = []
15 > allnames = []
16 > isdir = {}
16 > isdir = {}
17 > for root, dirs, files in os.walk(sys.argv[1]):
17 > for root, dirs, files in os.walk(sys.argv[1]):
18 > for d in dirs:
18 > for d in dirs:
19 > name = os.path.join(root, d)
19 > name = os.path.join(root, d)
20 > isdir[name] = 1
20 > isdir[name] = 1
21 > allnames.append(name)
21 > allnames.append(name)
22 > for f in files:
22 > for f in files:
23 > name = os.path.join(root, f)
23 > name = os.path.join(root, f)
24 > allnames.append(name)
24 > allnames.append(name)
25 > allnames.sort()
25 > allnames.sort()
26 > for name in allnames:
26 > for name in allnames:
27 > suffix = name in isdir and '/' or ''
27 > suffix = name in isdir and '/' or ''
28 > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
28 > print '%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)
29 > EOF
29 > EOF
30
30
31 $ cat >mode.py <<EOF
31 $ cat >mode.py <<EOF
32 > import sys
32 > import sys
33 > import os
33 > import os
34 > print '%05o' % os.lstat(sys.argv[1]).st_mode
34 > print '%05o' % os.lstat(sys.argv[1]).st_mode
35 > EOF
35 > EOF
36
36
37 $ umask 077
37 $ umask 077
38
38
39 $ hg init repo
39 $ hg init repo
40 $ cd repo
40 $ cd repo
41
41
42 $ chmod 0770 .hg/store
42 $ chmod 0770 .hg/store
43
43
44 before commit
44 before commit
45 store can be written by the group, other files cannot
45 store can be written by the group, other files cannot
46 store is setgid
46 store is setgid
47
47
48 $ python ../printmodes.py .
48 $ python ../printmodes.py .
49 00700 ./.hg/
49 00700 ./.hg/
50 00600 ./.hg/00changelog.i
50 00600 ./.hg/00changelog.i
51 00600 ./.hg/requires
51 00600 ./.hg/requires
52 00770 ./.hg/store/
52 00770 ./.hg/store/
53
53
54 $ mkdir dir
54 $ mkdir dir
55 $ touch foo dir/bar
55 $ touch foo dir/bar
56 $ hg ci -qAm 'add files'
56 $ hg ci -qAm 'add files'
57
57
58 after commit
58 after commit
59 working dir files can only be written by the owner
59 working dir files can only be written by the owner
60 files created in .hg can be written by the group
60 files created in .hg can be written by the group
61 (in particular, store/**, dirstate, branch cache file, undo files)
61 (in particular, store/**, dirstate, branch cache file, undo files)
62 new directories are setgid
62 new directories are setgid
63
63
64 $ python ../printmodes.py .
64 $ python ../printmodes.py .
65 00700 ./.hg/
65 00700 ./.hg/
66 00600 ./.hg/00changelog.i
66 00600 ./.hg/00changelog.i
67 00770 ./.hg/cache/
67 00770 ./.hg/cache/
68 00660 ./.hg/cache/branch2-served
68 00660 ./.hg/cache/branch2-served
69 00660 ./.hg/cache/rbc-names-v1
69 00660 ./.hg/cache/rbc-names-v1
70 00660 ./.hg/cache/rbc-revs-v1
70 00660 ./.hg/cache/rbc-revs-v1
71 00660 ./.hg/dirstate
71 00660 ./.hg/dirstate
72 00660 ./.hg/last-message.txt
72 00660 ./.hg/last-message.txt
73 00600 ./.hg/requires
73 00600 ./.hg/requires
74 00770 ./.hg/store/
74 00770 ./.hg/store/
75 00660 ./.hg/store/00changelog.i
75 00660 ./.hg/store/00changelog.i
76 00660 ./.hg/store/00manifest.i
76 00660 ./.hg/store/00manifest.i
77 00770 ./.hg/store/data/
77 00770 ./.hg/store/data/
78 00770 ./.hg/store/data/dir/
78 00770 ./.hg/store/data/dir/
79 00660 ./.hg/store/data/dir/bar.i
79 00660 ./.hg/store/data/dir/bar.i
80 00660 ./.hg/store/data/foo.i
80 00660 ./.hg/store/data/foo.i
81 00660 ./.hg/store/fncache
81 00660 ./.hg/store/fncache
82 00660 ./.hg/store/phaseroots
82 00660 ./.hg/store/phaseroots
83 00660 ./.hg/store/undo
83 00660 ./.hg/store/undo
84 00660 ./.hg/store/undo.backupfiles
84 00660 ./.hg/store/undo.backupfiles
85 00660 ./.hg/store/undo.phaseroots
85 00660 ./.hg/store/undo.phaseroots
86 00660 ./.hg/undo.backup.dirstate
86 00660 ./.hg/undo.backup.dirstate
87 00660 ./.hg/undo.bookmarks
87 00660 ./.hg/undo.bookmarks
88 00660 ./.hg/undo.branch
88 00660 ./.hg/undo.branch
89 00660 ./.hg/undo.desc
89 00660 ./.hg/undo.desc
90 00660 ./.hg/undo.dirstate
90 00660 ./.hg/undo.dirstate
91 00700 ./dir/
91 00700 ./dir/
92 00600 ./dir/bar
92 00600 ./dir/bar
93 00600 ./foo
93 00600 ./foo
94
94
95 $ umask 007
95 $ umask 007
96 $ hg init ../push
96 $ hg init ../push
97
97
98 before push
98 before push
99 group can write everything
99 group can write everything
100
100
101 $ python ../printmodes.py ../push
101 $ python ../printmodes.py ../push
102 00770 ../push/.hg/
102 00770 ../push/.hg/
103 00660 ../push/.hg/00changelog.i
103 00660 ../push/.hg/00changelog.i
104 00660 ../push/.hg/requires
104 00660 ../push/.hg/requires
105 00770 ../push/.hg/store/
105 00770 ../push/.hg/store/
106
106
107 $ umask 077
107 $ umask 077
108 $ hg -q push ../push
108 $ hg -q push ../push
109
109
110 after push
110 after push
111 group can still write everything
111 group can still write everything
112
112
113 $ python ../printmodes.py ../push
113 $ python ../printmodes.py ../push
114 00770 ../push/.hg/
114 00770 ../push/.hg/
115 00660 ../push/.hg/00changelog.i
115 00660 ../push/.hg/00changelog.i
116 00770 ../push/.hg/cache/
116 00770 ../push/.hg/cache/
117 00660 ../push/.hg/cache/branch2-base
117 00660 ../push/.hg/cache/branch2-base
118 00660 ../push/.hg/cache/rbc-names-v1
119 00660 ../push/.hg/cache/rbc-revs-v1
120 00660 ../push/.hg/dirstate
118 00660 ../push/.hg/dirstate
121 00660 ../push/.hg/requires
119 00660 ../push/.hg/requires
122 00770 ../push/.hg/store/
120 00770 ../push/.hg/store/
123 00660 ../push/.hg/store/00changelog.i
121 00660 ../push/.hg/store/00changelog.i
124 00660 ../push/.hg/store/00manifest.i
122 00660 ../push/.hg/store/00manifest.i
125 00770 ../push/.hg/store/data/
123 00770 ../push/.hg/store/data/
126 00770 ../push/.hg/store/data/dir/
124 00770 ../push/.hg/store/data/dir/
127 00660 ../push/.hg/store/data/dir/bar.i
125 00660 ../push/.hg/store/data/dir/bar.i
128 00660 ../push/.hg/store/data/foo.i
126 00660 ../push/.hg/store/data/foo.i
129 00660 ../push/.hg/store/fncache
127 00660 ../push/.hg/store/fncache
130 00660 ../push/.hg/store/undo
128 00660 ../push/.hg/store/undo
131 00660 ../push/.hg/store/undo.backupfiles
129 00660 ../push/.hg/store/undo.backupfiles
132 00660 ../push/.hg/store/undo.phaseroots
130 00660 ../push/.hg/store/undo.phaseroots
133 00660 ../push/.hg/undo.bookmarks
131 00660 ../push/.hg/undo.bookmarks
134 00660 ../push/.hg/undo.branch
132 00660 ../push/.hg/undo.branch
135 00660 ../push/.hg/undo.desc
133 00660 ../push/.hg/undo.desc
136 00660 ../push/.hg/undo.dirstate
134 00660 ../push/.hg/undo.dirstate
137
135
138
136
139 Test that we don't lose the setgid bit when we call chmod.
137 Test that we don't lose the setgid bit when we call chmod.
140 Not all systems support setgid directories (e.g. HFS+), so
138 Not all systems support setgid directories (e.g. HFS+), so
141 just check that directories have the same mode.
139 just check that directories have the same mode.
142
140
143 $ cd ..
141 $ cd ..
144 $ hg init setgid
142 $ hg init setgid
145 $ cd setgid
143 $ cd setgid
146 $ chmod g+rwx .hg/store
144 $ chmod g+rwx .hg/store
147 $ chmod g+s .hg/store 2> /dev/null || true
145 $ chmod g+s .hg/store 2> /dev/null || true
148 $ mkdir dir
146 $ mkdir dir
149 $ touch dir/file
147 $ touch dir/file
150 $ hg ci -qAm 'add dir/file'
148 $ hg ci -qAm 'add dir/file'
151 $ storemode=`python ../mode.py .hg/store`
149 $ storemode=`python ../mode.py .hg/store`
152 $ dirmode=`python ../mode.py .hg/store/data/dir`
150 $ dirmode=`python ../mode.py .hg/store/data/dir`
153 $ if [ "$storemode" != "$dirmode" ]; then
151 $ if [ "$storemode" != "$dirmode" ]; then
154 > echo "$storemode != $dirmode"
152 > echo "$storemode != $dirmode"
155 > fi
153 > fi
156 $ cd ..
154 $ cd ..
157
155
158 $ cd .. # g-s dir
156 $ cd .. # g-s dir
@@ -1,628 +1,630 b''
1 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
1 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
2 $ mkcommit() {
2 $ mkcommit() {
3 > echo "$1" > "$1"
3 > echo "$1" > "$1"
4 > hg add "$1"
4 > hg add "$1"
5 > message="$1"
5 > message="$1"
6 > shift
6 > shift
7 > hg ci -m "$message" $*
7 > hg ci -m "$message" $*
8 > }
8 > }
9
9
10 $ hg init initialrepo
10 $ hg init initialrepo
11 $ cd initialrepo
11 $ cd initialrepo
12
12
13 Cannot change null revision phase
13 Cannot change null revision phase
14
14
15 $ hg phase --force --secret null
15 $ hg phase --force --secret null
16 abort: cannot change null revision phase
16 abort: cannot change null revision phase
17 [255]
17 [255]
18 $ hg phase null
18 $ hg phase null
19 -1: public
19 -1: public
20
20
21 $ mkcommit A
21 $ mkcommit A
22
22
23 New commit are draft by default
23 New commit are draft by default
24
24
25 $ hglog
25 $ hglog
26 0 1 A
26 0 1 A
27
27
28 Following commit are draft too
28 Following commit are draft too
29
29
30 $ mkcommit B
30 $ mkcommit B
31
31
32 $ hglog
32 $ hglog
33 1 1 B
33 1 1 B
34 0 1 A
34 0 1 A
35
35
36 Draft commit are properly created over public one:
36 Draft commit are properly created over public one:
37
37
38 $ hg phase --public .
38 $ hg phase --public .
39 $ hg phase
39 $ hg phase
40 1: public
40 1: public
41 $ hglog
41 $ hglog
42 1 0 B
42 1 0 B
43 0 0 A
43 0 0 A
44
44
45 $ mkcommit C
45 $ mkcommit C
46 $ mkcommit D
46 $ mkcommit D
47
47
48 $ hglog
48 $ hglog
49 3 1 D
49 3 1 D
50 2 1 C
50 2 1 C
51 1 0 B
51 1 0 B
52 0 0 A
52 0 0 A
53
53
54 Test creating changeset as secret
54 Test creating changeset as secret
55
55
56 $ mkcommit E --config phases.new-commit='secret'
56 $ mkcommit E --config phases.new-commit='secret'
57 $ hglog
57 $ hglog
58 4 2 E
58 4 2 E
59 3 1 D
59 3 1 D
60 2 1 C
60 2 1 C
61 1 0 B
61 1 0 B
62 0 0 A
62 0 0 A
63
63
64 Test the secret property is inherited
64 Test the secret property is inherited
65
65
66 $ mkcommit H
66 $ mkcommit H
67 $ hglog
67 $ hglog
68 5 2 H
68 5 2 H
69 4 2 E
69 4 2 E
70 3 1 D
70 3 1 D
71 2 1 C
71 2 1 C
72 1 0 B
72 1 0 B
73 0 0 A
73 0 0 A
74
74
75 Even on merge
75 Even on merge
76
76
77 $ hg up -q 1
77 $ hg up -q 1
78 $ mkcommit "B'"
78 $ mkcommit "B'"
79 created new head
79 created new head
80 $ hglog
80 $ hglog
81 6 1 B'
81 6 1 B'
82 5 2 H
82 5 2 H
83 4 2 E
83 4 2 E
84 3 1 D
84 3 1 D
85 2 1 C
85 2 1 C
86 1 0 B
86 1 0 B
87 0 0 A
87 0 0 A
88 $ hg merge 4 # E
88 $ hg merge 4 # E
89 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 (branch merge, don't forget to commit)
90 (branch merge, don't forget to commit)
91 $ hg phase
91 $ hg phase
92 6: draft
92 6: draft
93 4: secret
93 4: secret
94 $ hg ci -m "merge B' and E"
94 $ hg ci -m "merge B' and E"
95 $ hglog
95 $ hglog
96 7 2 merge B' and E
96 7 2 merge B' and E
97 6 1 B'
97 6 1 B'
98 5 2 H
98 5 2 H
99 4 2 E
99 4 2 E
100 3 1 D
100 3 1 D
101 2 1 C
101 2 1 C
102 1 0 B
102 1 0 B
103 0 0 A
103 0 0 A
104
104
105 Test secret changeset are not pushed
105 Test secret changeset are not pushed
106
106
107 $ hg init ../push-dest
107 $ hg init ../push-dest
108 $ cat > ../push-dest/.hg/hgrc << EOF
108 $ cat > ../push-dest/.hg/hgrc << EOF
109 > [phases]
109 > [phases]
110 > publish=False
110 > publish=False
111 > EOF
111 > EOF
112 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
112 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
113 comparing with ../push-dest
113 comparing with ../push-dest
114 searching for changes
114 searching for changes
115 0 public A
115 0 public A
116 1 public B
116 1 public B
117 2 draft C
117 2 draft C
118 3 draft D
118 3 draft D
119 6 draft B'
119 6 draft B'
120 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
120 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
121 comparing with ../push-dest
121 comparing with ../push-dest
122 searching for changes
122 searching for changes
123 0 public A
123 0 public A
124 1 public B
124 1 public B
125 2 draft C
125 2 draft C
126 3 draft D
126 3 draft D
127 6 draft B'
127 6 draft B'
128
128
129 $ hg push ../push-dest -f # force because we push multiple heads
129 $ hg push ../push-dest -f # force because we push multiple heads
130 pushing to ../push-dest
130 pushing to ../push-dest
131 searching for changes
131 searching for changes
132 adding changesets
132 adding changesets
133 adding manifests
133 adding manifests
134 adding file changes
134 adding file changes
135 added 5 changesets with 5 changes to 5 files (+1 heads)
135 added 5 changesets with 5 changes to 5 files (+1 heads)
136 $ hglog
136 $ hglog
137 7 2 merge B' and E
137 7 2 merge B' and E
138 6 1 B'
138 6 1 B'
139 5 2 H
139 5 2 H
140 4 2 E
140 4 2 E
141 3 1 D
141 3 1 D
142 2 1 C
142 2 1 C
143 1 0 B
143 1 0 B
144 0 0 A
144 0 0 A
145 $ cd ../push-dest
145 $ cd ../push-dest
146 $ hglog
146 $ hglog
147 4 1 B'
147 4 1 B'
148 3 1 D
148 3 1 D
149 2 1 C
149 2 1 C
150 1 0 B
150 1 0 B
151 0 0 A
151 0 0 A
152
152
153 (Issue3303)
153 (Issue3303)
154 Check that remote secret changeset are ignore when checking creation of remote heads
154 Check that remote secret changeset are ignore when checking creation of remote heads
155
155
156 We add a secret head into the push destination. This secret head shadows a
156 We add a secret head into the push destination. This secret head shadows a
157 visible shared between the initial repo and the push destination.
157 visible shared between the initial repo and the push destination.
158
158
159 $ hg up -q 4 # B'
159 $ hg up -q 4 # B'
160 $ mkcommit Z --config phases.new-commit=secret
160 $ mkcommit Z --config phases.new-commit=secret
161 $ hg phase .
161 $ hg phase .
162 5: secret
162 5: secret
163
163
164 We now try to push a new public changeset that descend from the common public
164 We now try to push a new public changeset that descend from the common public
165 head shadowed by the remote secret head.
165 head shadowed by the remote secret head.
166
166
167 $ cd ../initialrepo
167 $ cd ../initialrepo
168 $ hg up -q 6 #B'
168 $ hg up -q 6 #B'
169 $ mkcommit I
169 $ mkcommit I
170 created new head
170 created new head
171 $ hg push ../push-dest
171 $ hg push ../push-dest
172 pushing to ../push-dest
172 pushing to ../push-dest
173 searching for changes
173 searching for changes
174 adding changesets
174 adding changesets
175 adding manifests
175 adding manifests
176 adding file changes
176 adding file changes
177 added 1 changesets with 1 changes to 1 files (+1 heads)
177 added 1 changesets with 1 changes to 1 files (+1 heads)
178
178
179 :note: The "(+1 heads)" is wrong as we do not had any visible head
179 :note: The "(+1 heads)" is wrong as we do not had any visible head
180
180
181 check that branch cache with "served" filter are properly computed and stored
181 check that branch cache with "served" filter are properly computed and stored
182
182
183 $ ls ../push-dest/.hg/cache/branch2*
183 $ ls ../push-dest/.hg/cache/branch2*
184 ../push-dest/.hg/cache/branch2-base
184 ../push-dest/.hg/cache/branch2-served
185 ../push-dest/.hg/cache/branch2-served
185 $ cat ../push-dest/.hg/cache/branch2-served
186 $ cat ../push-dest/.hg/cache/branch2-served
186 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
187 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
187 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
188 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
188 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
189 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
189 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
190 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
190 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
191 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
191 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
192 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
192 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
193 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
193 $ ls ../push-dest/.hg/cache/branch2*
194 $ ls ../push-dest/.hg/cache/branch2*
195 ../push-dest/.hg/cache/branch2-base
194 ../push-dest/.hg/cache/branch2-served
196 ../push-dest/.hg/cache/branch2-served
195 ../push-dest/.hg/cache/branch2-visible
197 ../push-dest/.hg/cache/branch2-visible
196 $ cat ../push-dest/.hg/cache/branch2-served
198 $ cat ../push-dest/.hg/cache/branch2-served
197 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
199 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
198 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
200 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
199 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
201 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
200 $ cat ../push-dest/.hg/cache/branch2-visible
202 $ cat ../push-dest/.hg/cache/branch2-visible
201 6d6770faffce199f1fddd1cf87f6f026138cf061 6
203 6d6770faffce199f1fddd1cf87f6f026138cf061 6
202 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
204 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e o default
203 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default
205 2713879da13d6eea1ff22b442a5a87cb31a7ce6a o default
204 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
206 6d6770faffce199f1fddd1cf87f6f026138cf061 o default
205
207
206
208
207 Restore condition prior extra insertion.
209 Restore condition prior extra insertion.
208 $ hg -q --config extensions.mq= strip .
210 $ hg -q --config extensions.mq= strip .
209 $ hg up -q 7
211 $ hg up -q 7
210 $ cd ..
212 $ cd ..
211
213
212 Test secret changeset are not pull
214 Test secret changeset are not pull
213
215
214 $ hg init pull-dest
216 $ hg init pull-dest
215 $ cd pull-dest
217 $ cd pull-dest
216 $ hg pull ../initialrepo
218 $ hg pull ../initialrepo
217 pulling from ../initialrepo
219 pulling from ../initialrepo
218 requesting all changes
220 requesting all changes
219 adding changesets
221 adding changesets
220 adding manifests
222 adding manifests
221 adding file changes
223 adding file changes
222 added 5 changesets with 5 changes to 5 files (+1 heads)
224 added 5 changesets with 5 changes to 5 files (+1 heads)
223 (run 'hg heads' to see heads, 'hg merge' to merge)
225 (run 'hg heads' to see heads, 'hg merge' to merge)
224 $ hglog
226 $ hglog
225 4 0 B'
227 4 0 B'
226 3 0 D
228 3 0 D
227 2 0 C
229 2 0 C
228 1 0 B
230 1 0 B
229 0 0 A
231 0 0 A
230 $ cd ..
232 $ cd ..
231
233
232 But secret can still be bundled explicitly
234 But secret can still be bundled explicitly
233
235
234 $ cd initialrepo
236 $ cd initialrepo
235 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
237 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
236 4 changesets found
238 4 changesets found
237 $ cd ..
239 $ cd ..
238
240
239 Test secret changeset are not cloned
241 Test secret changeset are not cloned
240 (during local clone)
242 (during local clone)
241
243
242 $ hg clone -qU initialrepo clone-dest
244 $ hg clone -qU initialrepo clone-dest
243 $ hglog -R clone-dest
245 $ hglog -R clone-dest
244 4 0 B'
246 4 0 B'
245 3 0 D
247 3 0 D
246 2 0 C
248 2 0 C
247 1 0 B
249 1 0 B
248 0 0 A
250 0 0 A
249
251
250 Test summary
252 Test summary
251
253
252 $ hg summary -R clone-dest --verbose
254 $ hg summary -R clone-dest --verbose
253 parent: -1:000000000000 (no revision checked out)
255 parent: -1:000000000000 (no revision checked out)
254 branch: default
256 branch: default
255 commit: (clean)
257 commit: (clean)
256 update: 5 new changesets (update)
258 update: 5 new changesets (update)
257 $ hg summary -R initialrepo
259 $ hg summary -R initialrepo
258 parent: 7:17a481b3bccb tip
260 parent: 7:17a481b3bccb tip
259 merge B' and E
261 merge B' and E
260 branch: default
262 branch: default
261 commit: (clean) (secret)
263 commit: (clean) (secret)
262 update: 1 new changesets, 2 branch heads (merge)
264 update: 1 new changesets, 2 branch heads (merge)
263 phases: 3 draft, 3 secret
265 phases: 3 draft, 3 secret
264 $ hg summary -R initialrepo --quiet
266 $ hg summary -R initialrepo --quiet
265 parent: 7:17a481b3bccb tip
267 parent: 7:17a481b3bccb tip
266 update: 1 new changesets, 2 branch heads (merge)
268 update: 1 new changesets, 2 branch heads (merge)
267
269
268 Test revset
270 Test revset
269
271
270 $ cd initialrepo
272 $ cd initialrepo
271 $ hglog -r 'public()'
273 $ hglog -r 'public()'
272 0 0 A
274 0 0 A
273 1 0 B
275 1 0 B
274 $ hglog -r 'draft()'
276 $ hglog -r 'draft()'
275 2 1 C
277 2 1 C
276 3 1 D
278 3 1 D
277 6 1 B'
279 6 1 B'
278 $ hglog -r 'secret()'
280 $ hglog -r 'secret()'
279 4 2 E
281 4 2 E
280 5 2 H
282 5 2 H
281 7 2 merge B' and E
283 7 2 merge B' and E
282
284
283 test that phase are displayed in log at debug level
285 test that phase are displayed in log at debug level
284
286
285 $ hg log --debug
287 $ hg log --debug
286 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
288 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
287 tag: tip
289 tag: tip
288 phase: secret
290 phase: secret
289 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
291 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
290 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
292 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
291 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
293 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
292 user: test
294 user: test
293 date: Thu Jan 01 00:00:00 1970 +0000
295 date: Thu Jan 01 00:00:00 1970 +0000
294 files+: C D E
296 files+: C D E
295 extra: branch=default
297 extra: branch=default
296 description:
298 description:
297 merge B' and E
299 merge B' and E
298
300
299
301
300 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
302 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
301 phase: draft
303 phase: draft
302 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
304 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
303 parent: -1:0000000000000000000000000000000000000000
305 parent: -1:0000000000000000000000000000000000000000
304 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
306 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
305 user: test
307 user: test
306 date: Thu Jan 01 00:00:00 1970 +0000
308 date: Thu Jan 01 00:00:00 1970 +0000
307 files+: B'
309 files+: B'
308 extra: branch=default
310 extra: branch=default
309 description:
311 description:
310 B'
312 B'
311
313
312
314
313 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
315 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
314 phase: secret
316 phase: secret
315 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
317 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
316 parent: -1:0000000000000000000000000000000000000000
318 parent: -1:0000000000000000000000000000000000000000
317 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
319 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
318 user: test
320 user: test
319 date: Thu Jan 01 00:00:00 1970 +0000
321 date: Thu Jan 01 00:00:00 1970 +0000
320 files+: H
322 files+: H
321 extra: branch=default
323 extra: branch=default
322 description:
324 description:
323 H
325 H
324
326
325
327
326 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
328 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
327 phase: secret
329 phase: secret
328 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
330 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
329 parent: -1:0000000000000000000000000000000000000000
331 parent: -1:0000000000000000000000000000000000000000
330 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
332 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
331 user: test
333 user: test
332 date: Thu Jan 01 00:00:00 1970 +0000
334 date: Thu Jan 01 00:00:00 1970 +0000
333 files+: E
335 files+: E
334 extra: branch=default
336 extra: branch=default
335 description:
337 description:
336 E
338 E
337
339
338
340
339 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
341 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
340 phase: draft
342 phase: draft
341 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
343 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
342 parent: -1:0000000000000000000000000000000000000000
344 parent: -1:0000000000000000000000000000000000000000
343 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
345 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
344 user: test
346 user: test
345 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
346 files+: D
348 files+: D
347 extra: branch=default
349 extra: branch=default
348 description:
350 description:
349 D
351 D
350
352
351
353
352 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
354 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
353 phase: draft
355 phase: draft
354 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
356 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
355 parent: -1:0000000000000000000000000000000000000000
357 parent: -1:0000000000000000000000000000000000000000
356 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
358 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
357 user: test
359 user: test
358 date: Thu Jan 01 00:00:00 1970 +0000
360 date: Thu Jan 01 00:00:00 1970 +0000
359 files+: C
361 files+: C
360 extra: branch=default
362 extra: branch=default
361 description:
363 description:
362 C
364 C
363
365
364
366
365 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
367 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
366 phase: public
368 phase: public
367 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
369 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
368 parent: -1:0000000000000000000000000000000000000000
370 parent: -1:0000000000000000000000000000000000000000
369 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
371 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
370 user: test
372 user: test
371 date: Thu Jan 01 00:00:00 1970 +0000
373 date: Thu Jan 01 00:00:00 1970 +0000
372 files+: B
374 files+: B
373 extra: branch=default
375 extra: branch=default
374 description:
376 description:
375 B
377 B
376
378
377
379
378 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
380 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
379 phase: public
381 phase: public
380 parent: -1:0000000000000000000000000000000000000000
382 parent: -1:0000000000000000000000000000000000000000
381 parent: -1:0000000000000000000000000000000000000000
383 parent: -1:0000000000000000000000000000000000000000
382 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
384 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
383 user: test
385 user: test
384 date: Thu Jan 01 00:00:00 1970 +0000
386 date: Thu Jan 01 00:00:00 1970 +0000
385 files+: A
387 files+: A
386 extra: branch=default
388 extra: branch=default
387 description:
389 description:
388 A
390 A
389
391
390
392
391
393
392
394
393 (Issue3707)
395 (Issue3707)
394 test invalid phase name
396 test invalid phase name
395
397
396 $ mkcommit I --config phases.new-commit='babar'
398 $ mkcommit I --config phases.new-commit='babar'
397 transaction abort!
399 transaction abort!
398 rollback completed
400 rollback completed
399 abort: phases.new-commit: not a valid phase name ('babar')
401 abort: phases.new-commit: not a valid phase name ('babar')
400 [255]
402 [255]
401 Test phase command
403 Test phase command
402 ===================
404 ===================
403
405
404 initial picture
406 initial picture
405
407
406 $ hg log -G --template "{rev} {phase} {desc}\n"
408 $ hg log -G --template "{rev} {phase} {desc}\n"
407 @ 7 secret merge B' and E
409 @ 7 secret merge B' and E
408 |\
410 |\
409 | o 6 draft B'
411 | o 6 draft B'
410 | |
412 | |
411 +---o 5 secret H
413 +---o 5 secret H
412 | |
414 | |
413 o | 4 secret E
415 o | 4 secret E
414 | |
416 | |
415 o | 3 draft D
417 o | 3 draft D
416 | |
418 | |
417 o | 2 draft C
419 o | 2 draft C
418 |/
420 |/
419 o 1 public B
421 o 1 public B
420 |
422 |
421 o 0 public A
423 o 0 public A
422
424
423
425
424 display changesets phase
426 display changesets phase
425
427
426 (mixing -r and plain rev specification)
428 (mixing -r and plain rev specification)
427
429
428 $ hg phase 1::4 -r 7
430 $ hg phase 1::4 -r 7
429 1: public
431 1: public
430 2: draft
432 2: draft
431 3: draft
433 3: draft
432 4: secret
434 4: secret
433 7: secret
435 7: secret
434
436
435
437
436 move changeset forward
438 move changeset forward
437
439
438 (with -r option)
440 (with -r option)
439
441
440 $ hg phase --public -r 2
442 $ hg phase --public -r 2
441 $ hg log -G --template "{rev} {phase} {desc}\n"
443 $ hg log -G --template "{rev} {phase} {desc}\n"
442 @ 7 secret merge B' and E
444 @ 7 secret merge B' and E
443 |\
445 |\
444 | o 6 draft B'
446 | o 6 draft B'
445 | |
447 | |
446 +---o 5 secret H
448 +---o 5 secret H
447 | |
449 | |
448 o | 4 secret E
450 o | 4 secret E
449 | |
451 | |
450 o | 3 draft D
452 o | 3 draft D
451 | |
453 | |
452 o | 2 public C
454 o | 2 public C
453 |/
455 |/
454 o 1 public B
456 o 1 public B
455 |
457 |
456 o 0 public A
458 o 0 public A
457
459
458
460
459 move changeset backward
461 move changeset backward
460
462
461 (without -r option)
463 (without -r option)
462
464
463 $ hg phase --draft --force 2
465 $ hg phase --draft --force 2
464 $ hg log -G --template "{rev} {phase} {desc}\n"
466 $ hg log -G --template "{rev} {phase} {desc}\n"
465 @ 7 secret merge B' and E
467 @ 7 secret merge B' and E
466 |\
468 |\
467 | o 6 draft B'
469 | o 6 draft B'
468 | |
470 | |
469 +---o 5 secret H
471 +---o 5 secret H
470 | |
472 | |
471 o | 4 secret E
473 o | 4 secret E
472 | |
474 | |
473 o | 3 draft D
475 o | 3 draft D
474 | |
476 | |
475 o | 2 draft C
477 o | 2 draft C
476 |/
478 |/
477 o 1 public B
479 o 1 public B
478 |
480 |
479 o 0 public A
481 o 0 public A
480
482
481
483
482 move changeset forward and backward
484 move changeset forward and backward
483
485
484 $ hg phase --draft --force 1::4
486 $ hg phase --draft --force 1::4
485 $ hg log -G --template "{rev} {phase} {desc}\n"
487 $ hg log -G --template "{rev} {phase} {desc}\n"
486 @ 7 secret merge B' and E
488 @ 7 secret merge B' and E
487 |\
489 |\
488 | o 6 draft B'
490 | o 6 draft B'
489 | |
491 | |
490 +---o 5 secret H
492 +---o 5 secret H
491 | |
493 | |
492 o | 4 draft E
494 o | 4 draft E
493 | |
495 | |
494 o | 3 draft D
496 o | 3 draft D
495 | |
497 | |
496 o | 2 draft C
498 o | 2 draft C
497 |/
499 |/
498 o 1 draft B
500 o 1 draft B
499 |
501 |
500 o 0 public A
502 o 0 public A
501
503
502 test partial failure
504 test partial failure
503
505
504 $ hg phase --public 7
506 $ hg phase --public 7
505 $ hg phase --draft '5 or 7'
507 $ hg phase --draft '5 or 7'
506 cannot move 1 changesets to a higher phase, use --force
508 cannot move 1 changesets to a higher phase, use --force
507 phase changed for 1 changesets
509 phase changed for 1 changesets
508 [1]
510 [1]
509 $ hg log -G --template "{rev} {phase} {desc}\n"
511 $ hg log -G --template "{rev} {phase} {desc}\n"
510 @ 7 public merge B' and E
512 @ 7 public merge B' and E
511 |\
513 |\
512 | o 6 public B'
514 | o 6 public B'
513 | |
515 | |
514 +---o 5 draft H
516 +---o 5 draft H
515 | |
517 | |
516 o | 4 public E
518 o | 4 public E
517 | |
519 | |
518 o | 3 public D
520 o | 3 public D
519 | |
521 | |
520 o | 2 public C
522 o | 2 public C
521 |/
523 |/
522 o 1 public B
524 o 1 public B
523 |
525 |
524 o 0 public A
526 o 0 public A
525
527
526
528
527 test complete failure
529 test complete failure
528
530
529 $ hg phase --draft 7
531 $ hg phase --draft 7
530 cannot move 1 changesets to a higher phase, use --force
532 cannot move 1 changesets to a higher phase, use --force
531 no phases changed
533 no phases changed
532 [1]
534 [1]
533
535
534 $ cd ..
536 $ cd ..
535
537
536 test hidden changeset are not cloned as public (issue3935)
538 test hidden changeset are not cloned as public (issue3935)
537
539
538 $ cd initialrepo
540 $ cd initialrepo
539
541
540 (enabling evolution)
542 (enabling evolution)
541 $ cat >> $HGRCPATH << EOF
543 $ cat >> $HGRCPATH << EOF
542 > [experimental]
544 > [experimental]
543 > evolution=createmarkers
545 > evolution=createmarkers
544 > EOF
546 > EOF
545
547
546 (making a changeset hidden; H in that case)
548 (making a changeset hidden; H in that case)
547 $ hg debugobsolete `hg id --debug -r 5`
549 $ hg debugobsolete `hg id --debug -r 5`
548
550
549 $ cd ..
551 $ cd ..
550 $ hg clone initialrepo clonewithobs
552 $ hg clone initialrepo clonewithobs
551 requesting all changes
553 requesting all changes
552 adding changesets
554 adding changesets
553 adding manifests
555 adding manifests
554 adding file changes
556 adding file changes
555 added 7 changesets with 6 changes to 6 files
557 added 7 changesets with 6 changes to 6 files
556 updating to branch default
558 updating to branch default
557 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
559 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
558 $ cd clonewithobs
560 $ cd clonewithobs
559 $ hg log -G --template "{rev} {phase} {desc}\n"
561 $ hg log -G --template "{rev} {phase} {desc}\n"
560 @ 6 public merge B' and E
562 @ 6 public merge B' and E
561 |\
563 |\
562 | o 5 public B'
564 | o 5 public B'
563 | |
565 | |
564 o | 4 public E
566 o | 4 public E
565 | |
567 | |
566 o | 3 public D
568 o | 3 public D
567 | |
569 | |
568 o | 2 public C
570 o | 2 public C
569 |/
571 |/
570 o 1 public B
572 o 1 public B
571 |
573 |
572 o 0 public A
574 o 0 public A
573
575
574
576
575 test verify repo containing hidden changesets, which should not abort just
577 test verify repo containing hidden changesets, which should not abort just
576 because repo.cancopy() is False
578 because repo.cancopy() is False
577
579
578 $ cd ../initialrepo
580 $ cd ../initialrepo
579 $ hg verify
581 $ hg verify
580 checking changesets
582 checking changesets
581 checking manifests
583 checking manifests
582 crosschecking files in changesets and manifests
584 crosschecking files in changesets and manifests
583 checking files
585 checking files
584 7 files, 8 changesets, 7 total revisions
586 7 files, 8 changesets, 7 total revisions
585
587
586 $ cd ..
588 $ cd ..
587
589
588 check whether HG_PENDING makes pending changes only in related
590 check whether HG_PENDING makes pending changes only in related
589 repositories visible to an external hook.
591 repositories visible to an external hook.
590
592
591 (emulate a transaction running concurrently by copied
593 (emulate a transaction running concurrently by copied
592 .hg/phaseroots.pending in subsequent test)
594 .hg/phaseroots.pending in subsequent test)
593
595
594 $ cat > $TESTTMP/savepending.sh <<EOF
596 $ cat > $TESTTMP/savepending.sh <<EOF
595 > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved
597 > cp .hg/store/phaseroots.pending .hg/store/phaseroots.pending.saved
596 > exit 1 # to avoid changing phase for subsequent tests
598 > exit 1 # to avoid changing phase for subsequent tests
597 > EOF
599 > EOF
598 $ cd push-dest
600 $ cd push-dest
599 $ hg phase 6
601 $ hg phase 6
600 6: draft
602 6: draft
601 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6
603 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" phase -f -s 6
602 transaction abort!
604 transaction abort!
603 rollback completed
605 rollback completed
604 abort: pretxnclose hook exited with status 1
606 abort: pretxnclose hook exited with status 1
605 [255]
607 [255]
606 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending
608 $ cp .hg/store/phaseroots.pending.saved .hg/store/phaseroots.pending
607
609
608 (check (in)visibility of phaseroot while transaction running in repo)
610 (check (in)visibility of phaseroot while transaction running in repo)
609
611
610 $ cat > $TESTTMP/checkpending.sh <<EOF
612 $ cat > $TESTTMP/checkpending.sh <<EOF
611 > echo '@initialrepo'
613 > echo '@initialrepo'
612 > hg -R "$TESTTMP/initialrepo" phase 7
614 > hg -R "$TESTTMP/initialrepo" phase 7
613 > echo '@push-dest'
615 > echo '@push-dest'
614 > hg -R "$TESTTMP/push-dest" phase 6
616 > hg -R "$TESTTMP/push-dest" phase 6
615 > exit 1 # to avoid changing phase for subsequent tests
617 > exit 1 # to avoid changing phase for subsequent tests
616 > EOF
618 > EOF
617 $ cd ../initialrepo
619 $ cd ../initialrepo
618 $ hg phase 7
620 $ hg phase 7
619 7: public
621 7: public
620 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7
622 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" phase -f -s 7
621 @initialrepo
623 @initialrepo
622 7: secret
624 7: secret
623 @push-dest
625 @push-dest
624 6: draft
626 6: draft
625 transaction abort!
627 transaction abort!
626 rollback completed
628 rollback completed
627 abort: pretxnclose hook exited with status 1
629 abort: pretxnclose hook exited with status 1
628 [255]
630 [255]
@@ -1,363 +1,361 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [format]
2 > [format]
3 > usegeneraldelta=yes
3 > usegeneraldelta=yes
4 > [extensions]
4 > [extensions]
5 > rebase=
5 > rebase=
6 >
6 >
7 > [phases]
7 > [phases]
8 > publish=False
8 > publish=False
9 >
9 >
10 > [alias]
10 > [alias]
11 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
11 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
12 > EOF
12 > EOF
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16 $ echo c1 >common
16 $ echo c1 >common
17 $ hg add common
17 $ hg add common
18 $ hg ci -m C1
18 $ hg ci -m C1
19
19
20 $ echo c2 >>common
20 $ echo c2 >>common
21 $ hg ci -m C2
21 $ hg ci -m C2
22
22
23 $ echo c3 >>common
23 $ echo c3 >>common
24 $ hg ci -m C3
24 $ hg ci -m C3
25
25
26 $ hg up -q -C 1
26 $ hg up -q -C 1
27
27
28 $ echo l1 >>extra
28 $ echo l1 >>extra
29 $ hg add extra
29 $ hg add extra
30 $ hg ci -m L1
30 $ hg ci -m L1
31 created new head
31 created new head
32
32
33 $ sed -e 's/c2/l2/' common > common.new
33 $ sed -e 's/c2/l2/' common > common.new
34 $ mv common.new common
34 $ mv common.new common
35 $ hg ci -m L2
35 $ hg ci -m L2
36
36
37 $ echo l3 >> extra2
37 $ echo l3 >> extra2
38 $ hg add extra2
38 $ hg add extra2
39 $ hg ci -m L3
39 $ hg ci -m L3
40 $ hg bookmark mybook
40 $ hg bookmark mybook
41
41
42 $ hg phase --force --secret 4
42 $ hg phase --force --secret 4
43
43
44 $ hg tglog
44 $ hg tglog
45 @ 5:secret 'L3' mybook
45 @ 5:secret 'L3' mybook
46 |
46 |
47 o 4:secret 'L2'
47 o 4:secret 'L2'
48 |
48 |
49 o 3:draft 'L1'
49 o 3:draft 'L1'
50 |
50 |
51 | o 2:draft 'C3'
51 | o 2:draft 'C3'
52 |/
52 |/
53 o 1:draft 'C2'
53 o 1:draft 'C2'
54 |
54 |
55 o 0:draft 'C1'
55 o 0:draft 'C1'
56
56
57 Try to call --continue:
57 Try to call --continue:
58
58
59 $ hg rebase --continue
59 $ hg rebase --continue
60 abort: no rebase in progress
60 abort: no rebase in progress
61 [255]
61 [255]
62
62
63 Conflicting rebase:
63 Conflicting rebase:
64
64
65 $ hg rebase -s 3 -d 2
65 $ hg rebase -s 3 -d 2
66 rebasing 3:3163e20567cc "L1"
66 rebasing 3:3163e20567cc "L1"
67 rebasing 4:46f0b057b5c0 "L2"
67 rebasing 4:46f0b057b5c0 "L2"
68 merging common
68 merging common
69 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
69 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
70 unresolved conflicts (see hg resolve, then hg rebase --continue)
70 unresolved conflicts (see hg resolve, then hg rebase --continue)
71 [1]
71 [1]
72
72
73 Try to continue without solving the conflict:
73 Try to continue without solving the conflict:
74
74
75 $ hg rebase --continue
75 $ hg rebase --continue
76 abort: unresolved merge conflicts (see 'hg help resolve')
76 abort: unresolved merge conflicts (see 'hg help resolve')
77 [255]
77 [255]
78
78
79 Conclude rebase:
79 Conclude rebase:
80
80
81 $ echo 'resolved merge' >common
81 $ echo 'resolved merge' >common
82 $ hg resolve -m common
82 $ hg resolve -m common
83 (no more unresolved files)
83 (no more unresolved files)
84 continue: hg rebase --continue
84 continue: hg rebase --continue
85 $ hg rebase --continue
85 $ hg rebase --continue
86 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
86 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
87 rebasing 4:46f0b057b5c0 "L2"
87 rebasing 4:46f0b057b5c0 "L2"
88 rebasing 5:8029388f38dc "L3" (mybook)
88 rebasing 5:8029388f38dc "L3" (mybook)
89 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-backup.hg (glob)
89 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-backup.hg (glob)
90
90
91 $ hg tglog
91 $ hg tglog
92 @ 5:secret 'L3' mybook
92 @ 5:secret 'L3' mybook
93 |
93 |
94 o 4:secret 'L2'
94 o 4:secret 'L2'
95 |
95 |
96 o 3:draft 'L1'
96 o 3:draft 'L1'
97 |
97 |
98 o 2:draft 'C3'
98 o 2:draft 'C3'
99 |
99 |
100 o 1:draft 'C2'
100 o 1:draft 'C2'
101 |
101 |
102 o 0:draft 'C1'
102 o 0:draft 'C1'
103
103
104 Check correctness:
104 Check correctness:
105
105
106 $ hg cat -r 0 common
106 $ hg cat -r 0 common
107 c1
107 c1
108
108
109 $ hg cat -r 1 common
109 $ hg cat -r 1 common
110 c1
110 c1
111 c2
111 c2
112
112
113 $ hg cat -r 2 common
113 $ hg cat -r 2 common
114 c1
114 c1
115 c2
115 c2
116 c3
116 c3
117
117
118 $ hg cat -r 3 common
118 $ hg cat -r 3 common
119 c1
119 c1
120 c2
120 c2
121 c3
121 c3
122
122
123 $ hg cat -r 4 common
123 $ hg cat -r 4 common
124 resolved merge
124 resolved merge
125
125
126 $ hg cat -r 5 common
126 $ hg cat -r 5 common
127 resolved merge
127 resolved merge
128
128
129 Bookmark stays active after --continue
129 Bookmark stays active after --continue
130 $ hg bookmarks
130 $ hg bookmarks
131 * mybook 5:d67b21408fc0
131 * mybook 5:d67b21408fc0
132
132
133 $ cd ..
133 $ cd ..
134
134
135 Check that the right ancestors is used while rebasing a merge (issue4041)
135 Check that the right ancestors is used while rebasing a merge (issue4041)
136
136
137 $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041
137 $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041
138 requesting all changes
138 requesting all changes
139 adding changesets
139 adding changesets
140 adding manifests
140 adding manifests
141 adding file changes
141 adding file changes
142 added 11 changesets with 8 changes to 3 files (+1 heads)
142 added 11 changesets with 8 changes to 3 files (+1 heads)
143 updating to branch default
143 updating to branch default
144 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 $ cd issue4041
145 $ cd issue4041
146 $ hg log -G
146 $ hg log -G
147 o changeset: 10:2f2496ddf49d
147 o changeset: 10:2f2496ddf49d
148 |\ branch: f1
148 |\ branch: f1
149 | | tag: tip
149 | | tag: tip
150 | | parent: 7:4c9fbe56a16f
150 | | parent: 7:4c9fbe56a16f
151 | | parent: 9:e31216eec445
151 | | parent: 9:e31216eec445
152 | | user: szhang
152 | | user: szhang
153 | | date: Thu Sep 05 12:59:39 2013 -0400
153 | | date: Thu Sep 05 12:59:39 2013 -0400
154 | | summary: merge
154 | | summary: merge
155 | |
155 | |
156 | o changeset: 9:e31216eec445
156 | o changeset: 9:e31216eec445
157 | | branch: f1
157 | | branch: f1
158 | | user: szhang
158 | | user: szhang
159 | | date: Thu Sep 05 12:59:10 2013 -0400
159 | | date: Thu Sep 05 12:59:10 2013 -0400
160 | | summary: more changes to f1
160 | | summary: more changes to f1
161 | |
161 | |
162 | o changeset: 8:8e4e2c1a07ae
162 | o changeset: 8:8e4e2c1a07ae
163 | |\ branch: f1
163 | |\ branch: f1
164 | | | parent: 2:4bc80088dc6b
164 | | | parent: 2:4bc80088dc6b
165 | | | parent: 6:400110238667
165 | | | parent: 6:400110238667
166 | | | user: szhang
166 | | | user: szhang
167 | | | date: Thu Sep 05 12:57:59 2013 -0400
167 | | | date: Thu Sep 05 12:57:59 2013 -0400
168 | | | summary: bad merge
168 | | | summary: bad merge
169 | | |
169 | | |
170 o | | changeset: 7:4c9fbe56a16f
170 o | | changeset: 7:4c9fbe56a16f
171 |/ / branch: f1
171 |/ / branch: f1
172 | | parent: 2:4bc80088dc6b
172 | | parent: 2:4bc80088dc6b
173 | | user: szhang
173 | | user: szhang
174 | | date: Thu Sep 05 12:54:00 2013 -0400
174 | | date: Thu Sep 05 12:54:00 2013 -0400
175 | | summary: changed f1
175 | | summary: changed f1
176 | |
176 | |
177 | o changeset: 6:400110238667
177 | o changeset: 6:400110238667
178 | | branch: f2
178 | | branch: f2
179 | | parent: 4:12e8ec6bb010
179 | | parent: 4:12e8ec6bb010
180 | | user: szhang
180 | | user: szhang
181 | | date: Tue Sep 03 13:58:02 2013 -0400
181 | | date: Tue Sep 03 13:58:02 2013 -0400
182 | | summary: changed f2 on f2
182 | | summary: changed f2 on f2
183 | |
183 | |
184 | | @ changeset: 5:d79e2059b5c0
184 | | @ changeset: 5:d79e2059b5c0
185 | | | parent: 3:8a951942e016
185 | | | parent: 3:8a951942e016
186 | | | user: szhang
186 | | | user: szhang
187 | | | date: Tue Sep 03 13:57:39 2013 -0400
187 | | | date: Tue Sep 03 13:57:39 2013 -0400
188 | | | summary: changed f2 on default
188 | | | summary: changed f2 on default
189 | | |
189 | | |
190 | o | changeset: 4:12e8ec6bb010
190 | o | changeset: 4:12e8ec6bb010
191 | |/ branch: f2
191 | |/ branch: f2
192 | | user: szhang
192 | | user: szhang
193 | | date: Tue Sep 03 13:57:18 2013 -0400
193 | | date: Tue Sep 03 13:57:18 2013 -0400
194 | | summary: created f2 branch
194 | | summary: created f2 branch
195 | |
195 | |
196 | o changeset: 3:8a951942e016
196 | o changeset: 3:8a951942e016
197 | | parent: 0:24797d4f68de
197 | | parent: 0:24797d4f68de
198 | | user: szhang
198 | | user: szhang
199 | | date: Tue Sep 03 13:57:11 2013 -0400
199 | | date: Tue Sep 03 13:57:11 2013 -0400
200 | | summary: added f2.txt
200 | | summary: added f2.txt
201 | |
201 | |
202 o | changeset: 2:4bc80088dc6b
202 o | changeset: 2:4bc80088dc6b
203 | | branch: f1
203 | | branch: f1
204 | | user: szhang
204 | | user: szhang
205 | | date: Tue Sep 03 13:56:20 2013 -0400
205 | | date: Tue Sep 03 13:56:20 2013 -0400
206 | | summary: added f1.txt
206 | | summary: added f1.txt
207 | |
207 | |
208 o | changeset: 1:ef53c9e6b608
208 o | changeset: 1:ef53c9e6b608
209 |/ branch: f1
209 |/ branch: f1
210 | user: szhang
210 | user: szhang
211 | date: Tue Sep 03 13:55:26 2013 -0400
211 | date: Tue Sep 03 13:55:26 2013 -0400
212 | summary: created f1 branch
212 | summary: created f1 branch
213 |
213 |
214 o changeset: 0:24797d4f68de
214 o changeset: 0:24797d4f68de
215 user: szhang
215 user: szhang
216 date: Tue Sep 03 13:55:08 2013 -0400
216 date: Tue Sep 03 13:55:08 2013 -0400
217 summary: added default.txt
217 summary: added default.txt
218
218
219 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
219 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
220 rebase onto 4bc80088dc6b starting from e31216eec445
220 rebase onto 4bc80088dc6b starting from e31216eec445
221 rebase status stored
221 rebase status stored
222 ignoring null merge rebase of 3
222 ignoring null merge rebase of 3
223 ignoring null merge rebase of 4
223 ignoring null merge rebase of 4
224 ignoring null merge rebase of 6
224 ignoring null merge rebase of 6
225 ignoring null merge rebase of 8
225 ignoring null merge rebase of 8
226 rebasing 9:e31216eec445 "more changes to f1"
226 rebasing 9:e31216eec445 "more changes to f1"
227 future parents are 2 and -1
227 future parents are 2 and -1
228 update to 2:4bc80088dc6b
228 update to 2:4bc80088dc6b
229 resolving manifests
229 resolving manifests
230 branchmerge: False, force: True, partial: False
230 branchmerge: False, force: True, partial: False
231 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
231 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
232 f2.txt: other deleted -> r
232 f2.txt: other deleted -> r
233 removing f2.txt
233 removing f2.txt
234 f1.txt: remote created -> g
234 f1.txt: remote created -> g
235 getting f1.txt
235 getting f1.txt
236 merge against 9:e31216eec445
236 merge against 9:e31216eec445
237 detach base 8:8e4e2c1a07ae
237 detach base 8:8e4e2c1a07ae
238 searching for copies back to rev 3
238 searching for copies back to rev 3
239 unmatched files in other (from topological common ancestor):
239 unmatched files in other (from topological common ancestor):
240 f2.txt
240 f2.txt
241 resolving manifests
241 resolving manifests
242 branchmerge: True, force: True, partial: False
242 branchmerge: True, force: True, partial: False
243 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
243 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
244 f1.txt: remote is newer -> g
244 f1.txt: remote is newer -> g
245 getting f1.txt
245 getting f1.txt
246 committing files:
246 committing files:
247 f1.txt
247 f1.txt
248 committing manifest
248 committing manifest
249 committing changelog
249 committing changelog
250 rebased as 19c888675e13
250 rebased as 19c888675e13
251 rebasing 10:2f2496ddf49d "merge" (tip)
251 rebasing 10:2f2496ddf49d "merge" (tip)
252 future parents are 11 and 7
252 future parents are 11 and 7
253 already in destination
253 already in destination
254 merge against 10:2f2496ddf49d
254 merge against 10:2f2496ddf49d
255 detach base 9:e31216eec445
255 detach base 9:e31216eec445
256 searching for copies back to rev 3
256 searching for copies back to rev 3
257 unmatched files in other (from topological common ancestor):
257 unmatched files in other (from topological common ancestor):
258 f2.txt
258 f2.txt
259 resolving manifests
259 resolving manifests
260 branchmerge: True, force: True, partial: False
260 branchmerge: True, force: True, partial: False
261 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
261 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
262 f1.txt: remote is newer -> g
262 f1.txt: remote is newer -> g
263 getting f1.txt
263 getting f1.txt
264 committing files:
264 committing files:
265 f1.txt
265 f1.txt
266 committing manifest
266 committing manifest
267 committing changelog
267 committing changelog
268 rebased as 2a7f09cac94c
268 rebased as 2a7f09cac94c
269 rebase merging completed
269 rebase merging completed
270 rebase status stored
270 rebase status stored
271 updating the branch cache
271 updating the branch cache
272 update back to initial working directory parent
272 update back to initial working directory parent
273 resolving manifests
273 resolving manifests
274 branchmerge: False, force: False, partial: False
274 branchmerge: False, force: False, partial: False
275 ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0
275 ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0
276 f1.txt: other deleted -> r
276 f1.txt: other deleted -> r
277 removing f1.txt
277 removing f1.txt
278 f2.txt: remote created -> g
278 f2.txt: remote created -> g
279 getting f2.txt
279 getting f2.txt
280 2 changesets found
280 2 changesets found
281 list of changesets:
281 list of changesets:
282 e31216eec445e44352c5f01588856059466a24c9
282 e31216eec445e44352c5f01588856059466a24c9
283 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
283 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
284 bundle2-output-bundle: "HG20", (1 params) 1 parts total
284 bundle2-output-bundle: "HG20", (1 params) 1 parts total
285 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
285 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
286 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-backup.hg (glob)
286 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-backup.hg (glob)
287 3 changesets found
287 3 changesets found
288 list of changesets:
288 list of changesets:
289 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
289 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
290 19c888675e133ab5dff84516926a65672eaf04d9
290 19c888675e133ab5dff84516926a65672eaf04d9
291 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
291 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
292 bundle2-output-bundle: "HG20", 1 parts total
292 bundle2-output-bundle: "HG20", 1 parts total
293 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
293 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
294 adding branch
294 adding branch
295 bundle2-input-bundle: with-transaction
295 bundle2-input-bundle: with-transaction
296 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
296 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
297 adding changesets
297 adding changesets
298 add changeset 4c9fbe56a16f
298 add changeset 4c9fbe56a16f
299 add changeset 19c888675e13
299 add changeset 19c888675e13
300 add changeset 2a7f09cac94c
300 add changeset 2a7f09cac94c
301 adding manifests
301 adding manifests
302 adding file changes
302 adding file changes
303 adding f1.txt revisions
303 adding f1.txt revisions
304 added 2 changesets with 2 changes to 1 files
304 added 2 changesets with 2 changes to 1 files
305 bundle2-input-part: total payload size 1686
305 bundle2-input-part: total payload size 1686
306 bundle2-input-bundle: 0 parts total
306 bundle2-input-bundle: 0 parts total
307 updating the branch cache
307 updating the branch cache
308 invalid branchheads cache (served): tip differs
308 invalid branchheads cache (served): tip differs
309 history modification detected - truncating revision branch cache to revision 9
310 rebase completed
309 rebase completed
311 truncating cache/rbc-revs-v1 to 72
312
310
313 Test minimization of merge conflicts
311 Test minimization of merge conflicts
314 $ hg up -q null
312 $ hg up -q null
315 $ echo a > a
313 $ echo a > a
316 $ hg add a
314 $ hg add a
317 $ hg commit -q -m 'a'
315 $ hg commit -q -m 'a'
318 $ echo b >> a
316 $ echo b >> a
319 $ hg commit -q -m 'ab'
317 $ hg commit -q -m 'ab'
320 $ hg bookmark ab
318 $ hg bookmark ab
321 $ hg up -q '.^'
319 $ hg up -q '.^'
322 $ echo b >> a
320 $ echo b >> a
323 $ echo c >> a
321 $ echo c >> a
324 $ hg commit -q -m 'abc'
322 $ hg commit -q -m 'abc'
325 $ hg rebase -s 7bc217434fc1 -d ab --keep
323 $ hg rebase -s 7bc217434fc1 -d ab --keep
326 rebasing 13:7bc217434fc1 "abc" (tip)
324 rebasing 13:7bc217434fc1 "abc" (tip)
327 merging a
325 merging a
328 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
326 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
329 unresolved conflicts (see hg resolve, then hg rebase --continue)
327 unresolved conflicts (see hg resolve, then hg rebase --continue)
330 [1]
328 [1]
331 $ hg diff
329 $ hg diff
332 diff -r 328e4ab1f7cc a
330 diff -r 328e4ab1f7cc a
333 --- a/a Thu Jan 01 00:00:00 1970 +0000
331 --- a/a Thu Jan 01 00:00:00 1970 +0000
334 +++ b/a * (glob)
332 +++ b/a * (glob)
335 @@ -1,2 +1,6 @@
333 @@ -1,2 +1,6 @@
336 a
334 a
337 b
335 b
338 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
336 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
339 +=======
337 +=======
340 +c
338 +c
341 +>>>>>>> source: 7bc217434fc1 - test: abc
339 +>>>>>>> source: 7bc217434fc1 - test: abc
342 $ hg rebase --abort
340 $ hg rebase --abort
343 rebase aborted
341 rebase aborted
344 $ hg up -q -C 7bc217434fc1
342 $ hg up -q -C 7bc217434fc1
345 $ hg rebase -s . -d ab --keep -t internal:merge3
343 $ hg rebase -s . -d ab --keep -t internal:merge3
346 rebasing 13:7bc217434fc1 "abc" (tip)
344 rebasing 13:7bc217434fc1 "abc" (tip)
347 merging a
345 merging a
348 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
346 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
349 unresolved conflicts (see hg resolve, then hg rebase --continue)
347 unresolved conflicts (see hg resolve, then hg rebase --continue)
350 [1]
348 [1]
351 $ hg diff
349 $ hg diff
352 diff -r 328e4ab1f7cc a
350 diff -r 328e4ab1f7cc a
353 --- a/a Thu Jan 01 00:00:00 1970 +0000
351 --- a/a Thu Jan 01 00:00:00 1970 +0000
354 +++ b/a * (glob)
352 +++ b/a * (glob)
355 @@ -1,2 +1,8 @@
353 @@ -1,2 +1,8 @@
356 a
354 a
357 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
355 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
358 b
356 b
359 +||||||| base
357 +||||||| base
360 +=======
358 +=======
361 +b
359 +b
362 +c
360 +c
363 +>>>>>>> source: 7bc217434fc1 - test: abc
361 +>>>>>>> source: 7bc217434fc1 - test: abc
@@ -1,730 +1,732 b''
1 setup
1 setup
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > blackbox=
5 > blackbox=
6 > mock=$TESTDIR/mockblackbox.py
6 > mock=$TESTDIR/mockblackbox.py
7 > EOF
7 > EOF
8
8
9 Helper functions:
9 Helper functions:
10
10
11 $ cacheexists() {
11 $ cacheexists() {
12 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
12 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
13 > }
13 > }
14
14
15 $ fnodescacheexists() {
15 $ fnodescacheexists() {
16 > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache"
16 > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache"
17 > }
17 > }
18
18
19 $ dumptags() {
19 $ dumptags() {
20 > rev=$1
20 > rev=$1
21 > echo "rev $rev: .hgtags:"
21 > echo "rev $rev: .hgtags:"
22 > hg cat -r$rev .hgtags
22 > hg cat -r$rev .hgtags
23 > }
23 > }
24
24
25 # XXX need to test that the tag cache works when we strip an old head
25 # XXX need to test that the tag cache works when we strip an old head
26 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
26 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
27 # same, but stuff has changed behind tip.
27 # same, but stuff has changed behind tip.
28
28
29 Setup:
29 Setup:
30
30
31 $ hg init t
31 $ hg init t
32 $ cd t
32 $ cd t
33 $ cacheexists
33 $ cacheexists
34 no tag cache
34 no tag cache
35 $ fnodescacheexists
35 $ fnodescacheexists
36 no fnodes cache
36 no fnodes cache
37 $ hg id
37 $ hg id
38 000000000000 tip
38 000000000000 tip
39 $ cacheexists
39 $ cacheexists
40 no tag cache
40 no tag cache
41 $ fnodescacheexists
41 $ fnodescacheexists
42 no fnodes cache
42 no fnodes cache
43 $ echo a > a
43 $ echo a > a
44 $ hg add a
44 $ hg add a
45 $ hg commit -m "test"
45 $ hg commit -m "test"
46 $ hg co
46 $ hg co
47 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ hg identify
48 $ hg identify
49 acb14030fe0a tip
49 acb14030fe0a tip
50 $ hg identify -r 'wdir()'
50 $ hg identify -r 'wdir()'
51 acb14030fe0a tip
51 acb14030fe0a tip
52 $ cacheexists
52 $ cacheexists
53 tag cache exists
53 tag cache exists
54 No fnodes cache because .hgtags file doesn't exist
54 No fnodes cache because .hgtags file doesn't exist
55 (this is an implementation detail)
55 (this is an implementation detail)
56 $ fnodescacheexists
56 $ fnodescacheexists
57 no fnodes cache
57 no fnodes cache
58
58
59 Try corrupting the cache
59 Try corrupting the cache
60
60
61 $ printf 'a b' > .hg/cache/tags2-visible
61 $ printf 'a b' > .hg/cache/tags2-visible
62 $ hg identify
62 $ hg identify
63 acb14030fe0a tip
63 acb14030fe0a tip
64 $ cacheexists
64 $ cacheexists
65 tag cache exists
65 tag cache exists
66 $ fnodescacheexists
66 $ fnodescacheexists
67 no fnodes cache
67 no fnodes cache
68 $ hg identify
68 $ hg identify
69 acb14030fe0a tip
69 acb14030fe0a tip
70
70
71 Create local tag with long name:
71 Create local tag with long name:
72
72
73 $ T=`hg identify --debug --id`
73 $ T=`hg identify --debug --id`
74 $ hg tag -l "This is a local tag with a really long name!"
74 $ hg tag -l "This is a local tag with a really long name!"
75 $ hg tags
75 $ hg tags
76 tip 0:acb14030fe0a
76 tip 0:acb14030fe0a
77 This is a local tag with a really long name! 0:acb14030fe0a
77 This is a local tag with a really long name! 0:acb14030fe0a
78 $ rm .hg/localtags
78 $ rm .hg/localtags
79
79
80 Create a tag behind hg's back:
80 Create a tag behind hg's back:
81
81
82 $ echo "$T first" > .hgtags
82 $ echo "$T first" > .hgtags
83 $ cat .hgtags
83 $ cat .hgtags
84 acb14030fe0a21b60322c440ad2d20cf7685a376 first
84 acb14030fe0a21b60322c440ad2d20cf7685a376 first
85 $ hg add .hgtags
85 $ hg add .hgtags
86 $ hg commit -m "add tags"
86 $ hg commit -m "add tags"
87 $ hg tags
87 $ hg tags
88 tip 1:b9154636be93
88 tip 1:b9154636be93
89 first 0:acb14030fe0a
89 first 0:acb14030fe0a
90 $ hg identify
90 $ hg identify
91 b9154636be93 tip
91 b9154636be93 tip
92
92
93 We should have a fnodes cache now that we have a real tag
93 We should have a fnodes cache now that we have a real tag
94 The cache should have an empty entry for rev 0 and a valid entry for rev 1.
94 The cache should have an empty entry for rev 0 and a valid entry for rev 1.
95
95
96
96
97 $ fnodescacheexists
97 $ fnodescacheexists
98 fnodes cache exists
98 fnodes cache exists
99 $ f --size --hexdump .hg/cache/hgtagsfnodes1
99 $ f --size --hexdump .hg/cache/hgtagsfnodes1
100 .hg/cache/hgtagsfnodes1: size=48
100 .hg/cache/hgtagsfnodes1: size=48
101 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
101 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
102 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
102 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
103 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
103 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
104
104
105 Repeat with cold tag cache:
105 Repeat with cold tag cache:
106
106
107 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
107 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
108 $ hg identify
108 $ hg identify
109 b9154636be93 tip
109 b9154636be93 tip
110
110
111 $ fnodescacheexists
111 $ fnodescacheexists
112 fnodes cache exists
112 fnodes cache exists
113 $ f --size --hexdump .hg/cache/hgtagsfnodes1
113 $ f --size --hexdump .hg/cache/hgtagsfnodes1
114 .hg/cache/hgtagsfnodes1: size=48
114 .hg/cache/hgtagsfnodes1: size=48
115 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
115 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
116 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
116 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
117 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
117 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
118
118
119 And again, but now unable to write tag cache or lock file:
119 And again, but now unable to write tag cache or lock file:
120
120
121 #if unix-permissions
121 #if unix-permissions
122 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
122 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
123 $ chmod 555 .hg/cache
123 $ chmod 555 .hg/cache
124 $ hg identify
124 $ hg identify
125 b9154636be93 tip
125 b9154636be93 tip
126 $ chmod 755 .hg/cache
126 $ chmod 755 .hg/cache
127
127
128 $ chmod 555 .hg
128 $ chmod 555 .hg
129 $ hg identify
129 $ hg identify
130 b9154636be93 tip
130 b9154636be93 tip
131 $ chmod 755 .hg
131 $ chmod 755 .hg
132 #endif
132 #endif
133
133
134 Tag cache debug info written to blackbox log
134 Tag cache debug info written to blackbox log
135
135
136 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
136 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
137 $ hg identify
137 $ hg identify
138 b9154636be93 tip
138 b9154636be93 tip
139 $ hg blackbox -l 6
139 $ hg blackbox -l 6
140 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
140 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
141 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing 48 bytes to cache/hgtagsfnodes1
141 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing 48 bytes to cache/hgtagsfnodes1
142 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob)
142 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob)
143 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
143 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
144 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
144 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
145 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
145 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
146
146
147 Failure to acquire lock results in no write
147 Failure to acquire lock results in no write
148
148
149 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
149 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
150 $ echo 'foo:1' > .hg/wlock
150 $ echo 'foo:1' > .hg/wlock
151 $ hg identify
151 $ hg identify
152 b9154636be93 tip
152 b9154636be93 tip
153 $ hg blackbox -l 6
153 $ hg blackbox -l 6
154 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
154 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
155 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired
155 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired
156 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob)
156 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/1 cache hits/lookups in * seconds (glob)
157 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
157 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
158 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
158 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
159 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
159 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
160
160
161 $ fnodescacheexists
161 $ fnodescacheexists
162 no fnodes cache
162 no fnodes cache
163
163
164 $ rm .hg/wlock
164 $ rm .hg/wlock
165
165
166 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
166 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
167 $ hg identify
167 $ hg identify
168 b9154636be93 tip
168 b9154636be93 tip
169
169
170 Create a branch:
170 Create a branch:
171
171
172 $ echo bb > a
172 $ echo bb > a
173 $ hg status
173 $ hg status
174 M a
174 M a
175 $ hg identify
175 $ hg identify
176 b9154636be93+ tip
176 b9154636be93+ tip
177 $ hg co first
177 $ hg co first
178 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
178 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
179 $ hg id
179 $ hg id
180 acb14030fe0a+ first
180 acb14030fe0a+ first
181 $ hg id -r 'wdir()'
181 $ hg id -r 'wdir()'
182 acb14030fe0a+ first
182 acb14030fe0a+ first
183 $ hg -v id
183 $ hg -v id
184 acb14030fe0a+ first
184 acb14030fe0a+ first
185 $ hg status
185 $ hg status
186 M a
186 M a
187 $ echo 1 > b
187 $ echo 1 > b
188 $ hg add b
188 $ hg add b
189 $ hg commit -m "branch"
189 $ hg commit -m "branch"
190 created new head
190 created new head
191
191
192 Creating a new commit shouldn't append the .hgtags fnodes cache until
192 Creating a new commit shouldn't append the .hgtags fnodes cache until
193 tags info is accessed
193 tags info is accessed
194
194
195 $ f --size --hexdump .hg/cache/hgtagsfnodes1
195 $ f --size --hexdump .hg/cache/hgtagsfnodes1
196 .hg/cache/hgtagsfnodes1: size=48
196 .hg/cache/hgtagsfnodes1: size=48
197 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
197 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
198 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
198 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
199 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
199 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
200
200
201 $ hg id
201 $ hg id
202 c8edf04160c7 tip
202 c8edf04160c7 tip
203
203
204 First 4 bytes of record 3 are changeset fragment
204 First 4 bytes of record 3 are changeset fragment
205
205
206 $ f --size --hexdump .hg/cache/hgtagsfnodes1
206 $ f --size --hexdump .hg/cache/hgtagsfnodes1
207 .hg/cache/hgtagsfnodes1: size=72
207 .hg/cache/hgtagsfnodes1: size=72
208 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
208 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
209 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
209 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
210 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
210 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
211 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............|
211 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............|
212 0040: 00 00 00 00 00 00 00 00 |........|
212 0040: 00 00 00 00 00 00 00 00 |........|
213
213
214 Merge the two heads:
214 Merge the two heads:
215
215
216 $ hg merge 1
216 $ hg merge 1
217 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
217 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 (branch merge, don't forget to commit)
218 (branch merge, don't forget to commit)
219 $ hg blackbox -l3
219 $ hg blackbox -l3
220 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28 (5000)> merge 1
220 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28 (5000)> merge 1
221 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> merge 1 exited 0 after * seconds (glob)
221 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> merge 1 exited 0 after * seconds (glob)
222 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l3
222 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l3
223 $ hg id
223 $ hg id
224 c8edf04160c7+b9154636be93+ tip
224 c8edf04160c7+b9154636be93+ tip
225 $ hg status
225 $ hg status
226 M .hgtags
226 M .hgtags
227 $ hg commit -m "merge"
227 $ hg commit -m "merge"
228
228
229 Create a fake head, make sure tag not visible afterwards:
229 Create a fake head, make sure tag not visible afterwards:
230
230
231 $ cp .hgtags tags
231 $ cp .hgtags tags
232 $ hg tag last
232 $ hg tag last
233 $ hg rm .hgtags
233 $ hg rm .hgtags
234 $ hg commit -m "remove"
234 $ hg commit -m "remove"
235
235
236 $ mv tags .hgtags
236 $ mv tags .hgtags
237 $ hg add .hgtags
237 $ hg add .hgtags
238 $ hg commit -m "readd"
238 $ hg commit -m "readd"
239 $
239 $
240 $ hg tags
240 $ hg tags
241 tip 6:35ff301afafe
241 tip 6:35ff301afafe
242 first 0:acb14030fe0a
242 first 0:acb14030fe0a
243
243
244 Add invalid tags:
244 Add invalid tags:
245
245
246 $ echo "spam" >> .hgtags
246 $ echo "spam" >> .hgtags
247 $ echo >> .hgtags
247 $ echo >> .hgtags
248 $ echo "foo bar" >> .hgtags
248 $ echo "foo bar" >> .hgtags
249 $ echo "a5a5 invalid" >> .hg/localtags
249 $ echo "a5a5 invalid" >> .hg/localtags
250 $ cat .hgtags
250 $ cat .hgtags
251 acb14030fe0a21b60322c440ad2d20cf7685a376 first
251 acb14030fe0a21b60322c440ad2d20cf7685a376 first
252 spam
252 spam
253
253
254 foo bar
254 foo bar
255 $ hg commit -m "tags"
255 $ hg commit -m "tags"
256
256
257 Report tag parse error on other head:
257 Report tag parse error on other head:
258
258
259 $ hg up 3
259 $ hg up 3
260 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
261 $ echo 'x y' >> .hgtags
261 $ echo 'x y' >> .hgtags
262 $ hg commit -m "head"
262 $ hg commit -m "head"
263 created new head
263 created new head
264
264
265 $ hg tags --debug
265 $ hg tags --debug
266 .hgtags@75d9f02dfe28, line 2: cannot parse entry
266 .hgtags@75d9f02dfe28, line 2: cannot parse entry
267 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
267 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
268 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
268 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
269 tip 8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663
269 tip 8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663
270 first 0:acb14030fe0a21b60322c440ad2d20cf7685a376
270 first 0:acb14030fe0a21b60322c440ad2d20cf7685a376
271 $ hg tip
271 $ hg tip
272 changeset: 8:c4be69a18c11
272 changeset: 8:c4be69a18c11
273 tag: tip
273 tag: tip
274 parent: 3:ac5e980c4dc0
274 parent: 3:ac5e980c4dc0
275 user: test
275 user: test
276 date: Thu Jan 01 00:00:00 1970 +0000
276 date: Thu Jan 01 00:00:00 1970 +0000
277 summary: head
277 summary: head
278
278
279
279
280 Test tag precedence rules:
280 Test tag precedence rules:
281
281
282 $ cd ..
282 $ cd ..
283 $ hg init t2
283 $ hg init t2
284 $ cd t2
284 $ cd t2
285 $ echo foo > foo
285 $ echo foo > foo
286 $ hg add foo
286 $ hg add foo
287 $ hg ci -m 'add foo' # rev 0
287 $ hg ci -m 'add foo' # rev 0
288 $ hg tag bar # rev 1
288 $ hg tag bar # rev 1
289 $ echo >> foo
289 $ echo >> foo
290 $ hg ci -m 'change foo 1' # rev 2
290 $ hg ci -m 'change foo 1' # rev 2
291 $ hg up -C 1
291 $ hg up -C 1
292 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 $ hg tag -r 1 -f bar # rev 3
293 $ hg tag -r 1 -f bar # rev 3
294 $ hg up -C 1
294 $ hg up -C 1
295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 $ echo >> foo
296 $ echo >> foo
297 $ hg ci -m 'change foo 2' # rev 4
297 $ hg ci -m 'change foo 2' # rev 4
298 created new head
298 created new head
299 $ hg tags
299 $ hg tags
300 tip 4:0c192d7d5e6b
300 tip 4:0c192d7d5e6b
301 bar 1:78391a272241
301 bar 1:78391a272241
302
302
303 Repeat in case of cache effects:
303 Repeat in case of cache effects:
304
304
305 $ hg tags
305 $ hg tags
306 tip 4:0c192d7d5e6b
306 tip 4:0c192d7d5e6b
307 bar 1:78391a272241
307 bar 1:78391a272241
308
308
309 Detailed dump of tag info:
309 Detailed dump of tag info:
310
310
311 $ hg heads -q # expect 4, 3, 2
311 $ hg heads -q # expect 4, 3, 2
312 4:0c192d7d5e6b
312 4:0c192d7d5e6b
313 3:6fa450212aeb
313 3:6fa450212aeb
314 2:7a94127795a3
314 2:7a94127795a3
315 $ dumptags 2
315 $ dumptags 2
316 rev 2: .hgtags:
316 rev 2: .hgtags:
317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
317 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
318 $ dumptags 3
318 $ dumptags 3
319 rev 3: .hgtags:
319 rev 3: .hgtags:
320 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
320 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
321 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
321 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
322 78391a272241d70354aa14c874552cad6b51bb42 bar
322 78391a272241d70354aa14c874552cad6b51bb42 bar
323 $ dumptags 4
323 $ dumptags 4
324 rev 4: .hgtags:
324 rev 4: .hgtags:
325 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
325 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
326
326
327 Dump cache:
327 Dump cache:
328
328
329 $ cat .hg/cache/tags2-visible
329 $ cat .hg/cache/tags2-visible
330 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
330 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
331 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
331 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
332 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
332 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
333 78391a272241d70354aa14c874552cad6b51bb42 bar
333 78391a272241d70354aa14c874552cad6b51bb42 bar
334
334
335 $ f --size --hexdump .hg/cache/hgtagsfnodes1
335 $ f --size --hexdump .hg/cache/hgtagsfnodes1
336 .hg/cache/hgtagsfnodes1: size=120
336 .hg/cache/hgtagsfnodes1: size=120
337 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
337 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
338 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
338 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
339 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
339 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
340 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
340 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
341 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
341 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
342 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
342 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
343 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
343 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
344 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=|
344 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=|
345
345
346 Corrupt the .hgtags fnodes cache
346 Corrupt the .hgtags fnodes cache
347 Extra junk data at the end should get overwritten on next cache update
347 Extra junk data at the end should get overwritten on next cache update
348
348
349 $ echo extra >> .hg/cache/hgtagsfnodes1
349 $ echo extra >> .hg/cache/hgtagsfnodes1
350 $ echo dummy1 > foo
350 $ echo dummy1 > foo
351 $ hg commit -m throwaway1
351 $ hg commit -m throwaway1
352
352
353 $ hg tags
353 $ hg tags
354 tip 5:8dbfe60eff30
354 tip 5:8dbfe60eff30
355 bar 1:78391a272241
355 bar 1:78391a272241
356
356
357 $ hg blackbox -l 6
357 $ hg blackbox -l 6
358 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags
358 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags
359 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing 24 bytes to cache/hgtagsfnodes1
359 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing 24 bytes to cache/hgtagsfnodes1
360 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> 2/3 cache hits/lookups in * seconds (glob)
360 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> 2/3 cache hits/lookups in * seconds (glob)
361 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing .hg/cache/tags2-visible with 1 tags
361 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing .hg/cache/tags2-visible with 1 tags
362 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob)
362 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob)
363 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6
363 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6
364
364
365 #if unix-permissions no-root
365 #if unix-permissions no-root
366 Errors writing to .hgtags fnodes cache are silently ignored
366 Errors writing to .hgtags fnodes cache are silently ignored
367
367
368 $ echo dummy2 > foo
368 $ echo dummy2 > foo
369 $ hg commit -m throwaway2
369 $ hg commit -m throwaway2
370
370
371 $ chmod a-w .hg/cache/hgtagsfnodes1
371 $ chmod a-w .hg/cache/hgtagsfnodes1
372 $ rm -f .hg/cache/tags2-visible
372 $ rm -f .hg/cache/tags2-visible
373
373
374 $ hg tags
374 $ hg tags
375 tip 6:b968051b5cf3
375 tip 6:b968051b5cf3
376 bar 1:78391a272241
376 bar 1:78391a272241
377
377
378 $ hg blackbox -l 6
378 $ hg blackbox -l 6
379 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
379 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
380 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1'
380 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1'
381 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob)
381 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob)
382 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
382 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
383 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
383 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
384 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
384 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
385
385
386 $ chmod a+w .hg/cache/hgtagsfnodes1
386 $ chmod a+w .hg/cache/hgtagsfnodes1
387
387
388 $ rm -f .hg/cache/tags2-visible
388 $ rm -f .hg/cache/tags2-visible
389 $ hg tags
389 $ hg tags
390 tip 6:b968051b5cf3
390 tip 6:b968051b5cf3
391 bar 1:78391a272241
391 bar 1:78391a272241
392
392
393 $ hg blackbox -l 6
393 $ hg blackbox -l 6
394 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
394 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
395 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing 24 bytes to cache/hgtagsfnodes1
395 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing 24 bytes to cache/hgtagsfnodes1
396 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob)
396 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/3 cache hits/lookups in * seconds (glob)
397 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
397 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
398 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
398 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
399 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
399 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
400
400
401 $ f --size .hg/cache/hgtagsfnodes1
401 $ f --size .hg/cache/hgtagsfnodes1
402 .hg/cache/hgtagsfnodes1: size=168
402 .hg/cache/hgtagsfnodes1: size=168
403
403
404 $ hg -q --config extensions.strip= strip -r 6 --no-backup
404 $ hg -q --config extensions.strip= strip -r 6 --no-backup
405 #endif
405 #endif
406
406
407 Stripping doesn't truncate the tags cache until new data is available
407 Stripping doesn't truncate the tags cache until new data is available
408
408
409 $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible
409 $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible
410 $ hg tags
410 $ hg tags
411 tip 5:8dbfe60eff30
411 tip 5:8dbfe60eff30
412 bar 1:78391a272241
412 bar 1:78391a272241
413
413
414 $ f --size .hg/cache/hgtagsfnodes1
414 $ f --size .hg/cache/hgtagsfnodes1
415 .hg/cache/hgtagsfnodes1: size=144
415 .hg/cache/hgtagsfnodes1: size=144
416
416
417 $ hg -q --config extensions.strip= strip -r 5 --no-backup
417 $ hg -q --config extensions.strip= strip -r 5 --no-backup
418 $ hg tags
418 $ hg tags
419 tip 4:0c192d7d5e6b
419 tip 4:0c192d7d5e6b
420 bar 1:78391a272241
420 bar 1:78391a272241
421
421
422 $ hg blackbox -l 5
422 $ hg blackbox -l 5
423 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing 24 bytes to cache/hgtagsfnodes1
423 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing 24 bytes to cache/hgtagsfnodes1
424 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> 2/3 cache hits/lookups in * seconds (glob)
424 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> 2/3 cache hits/lookups in * seconds (glob)
425 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing .hg/cache/tags2-visible with 1 tags
425 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing .hg/cache/tags2-visible with 1 tags
426 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> tags exited 0 after * seconds (glob)
426 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> tags exited 0 after * seconds (glob)
427 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> blackbox -l 5
427 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> blackbox -l 5
428
428
429 $ f --size .hg/cache/hgtagsfnodes1
429 $ f --size .hg/cache/hgtagsfnodes1
430 .hg/cache/hgtagsfnodes1: size=120
430 .hg/cache/hgtagsfnodes1: size=120
431
431
432 $ echo dummy > foo
432 $ echo dummy > foo
433 $ hg commit -m throwaway3
433 $ hg commit -m throwaway3
434
434
435 $ hg tags
435 $ hg tags
436 tip 5:035f65efb448
436 tip 5:035f65efb448
437 bar 1:78391a272241
437 bar 1:78391a272241
438
438
439 $ hg blackbox -l 6
439 $ hg blackbox -l 6
440 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags
440 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags
441 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing 24 bytes to cache/hgtagsfnodes1
441 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing 24 bytes to cache/hgtagsfnodes1
442 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> 2/3 cache hits/lookups in * seconds (glob)
442 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> 2/3 cache hits/lookups in * seconds (glob)
443 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing .hg/cache/tags2-visible with 1 tags
443 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing .hg/cache/tags2-visible with 1 tags
444 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags exited 0 after * seconds (glob)
444 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags exited 0 after * seconds (glob)
445 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> blackbox -l 6
445 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> blackbox -l 6
446 $ f --size .hg/cache/hgtagsfnodes1
446 $ f --size .hg/cache/hgtagsfnodes1
447 .hg/cache/hgtagsfnodes1: size=144
447 .hg/cache/hgtagsfnodes1: size=144
448
448
449 $ hg -q --config extensions.strip= strip -r 5 --no-backup
449 $ hg -q --config extensions.strip= strip -r 5 --no-backup
450
450
451 Test tag removal:
451 Test tag removal:
452
452
453 $ hg tag --remove bar # rev 5
453 $ hg tag --remove bar # rev 5
454 $ hg tip -vp
454 $ hg tip -vp
455 changeset: 5:5f6e8655b1c7
455 changeset: 5:5f6e8655b1c7
456 tag: tip
456 tag: tip
457 user: test
457 user: test
458 date: Thu Jan 01 00:00:00 1970 +0000
458 date: Thu Jan 01 00:00:00 1970 +0000
459 files: .hgtags
459 files: .hgtags
460 description:
460 description:
461 Removed tag bar
461 Removed tag bar
462
462
463
463
464 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
464 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
465 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
465 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
466 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
466 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
467 @@ -1,1 +1,3 @@
467 @@ -1,1 +1,3 @@
468 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
468 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
469 +78391a272241d70354aa14c874552cad6b51bb42 bar
469 +78391a272241d70354aa14c874552cad6b51bb42 bar
470 +0000000000000000000000000000000000000000 bar
470 +0000000000000000000000000000000000000000 bar
471
471
472 $ hg tags
472 $ hg tags
473 tip 5:5f6e8655b1c7
473 tip 5:5f6e8655b1c7
474 $ hg tags # again, try to expose cache bugs
474 $ hg tags # again, try to expose cache bugs
475 tip 5:5f6e8655b1c7
475 tip 5:5f6e8655b1c7
476
476
477 Remove nonexistent tag:
477 Remove nonexistent tag:
478
478
479 $ hg tag --remove foobar
479 $ hg tag --remove foobar
480 abort: tag 'foobar' does not exist
480 abort: tag 'foobar' does not exist
481 [255]
481 [255]
482 $ hg tip
482 $ hg tip
483 changeset: 5:5f6e8655b1c7
483 changeset: 5:5f6e8655b1c7
484 tag: tip
484 tag: tip
485 user: test
485 user: test
486 date: Thu Jan 01 00:00:00 1970 +0000
486 date: Thu Jan 01 00:00:00 1970 +0000
487 summary: Removed tag bar
487 summary: Removed tag bar
488
488
489
489
490 Undo a tag with rollback:
490 Undo a tag with rollback:
491
491
492 $ hg rollback # destroy rev 5 (restore bar)
492 $ hg rollback # destroy rev 5 (restore bar)
493 repository tip rolled back to revision 4 (undo commit)
493 repository tip rolled back to revision 4 (undo commit)
494 working directory now based on revision 4
494 working directory now based on revision 4
495 $ hg tags
495 $ hg tags
496 tip 4:0c192d7d5e6b
496 tip 4:0c192d7d5e6b
497 bar 1:78391a272241
497 bar 1:78391a272241
498 $ hg tags
498 $ hg tags
499 tip 4:0c192d7d5e6b
499 tip 4:0c192d7d5e6b
500 bar 1:78391a272241
500 bar 1:78391a272241
501
501
502 Test tag rank:
502 Test tag rank:
503
503
504 $ cd ..
504 $ cd ..
505 $ hg init t3
505 $ hg init t3
506 $ cd t3
506 $ cd t3
507 $ echo foo > foo
507 $ echo foo > foo
508 $ hg add foo
508 $ hg add foo
509 $ hg ci -m 'add foo' # rev 0
509 $ hg ci -m 'add foo' # rev 0
510 $ hg tag -f bar # rev 1 bar -> 0
510 $ hg tag -f bar # rev 1 bar -> 0
511 $ hg tag -f bar # rev 2 bar -> 1
511 $ hg tag -f bar # rev 2 bar -> 1
512 $ hg tag -fr 0 bar # rev 3 bar -> 0
512 $ hg tag -fr 0 bar # rev 3 bar -> 0
513 $ hg tag -fr 1 bar # rev 4 bar -> 1
513 $ hg tag -fr 1 bar # rev 4 bar -> 1
514 $ hg tag -fr 0 bar # rev 5 bar -> 0
514 $ hg tag -fr 0 bar # rev 5 bar -> 0
515 $ hg tags
515 $ hg tags
516 tip 5:85f05169d91d
516 tip 5:85f05169d91d
517 bar 0:bbd179dfa0a7
517 bar 0:bbd179dfa0a7
518 $ hg co 3
518 $ hg co 3
519 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
519 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
520 $ echo barbar > foo
520 $ echo barbar > foo
521 $ hg ci -m 'change foo' # rev 6
521 $ hg ci -m 'change foo' # rev 6
522 created new head
522 created new head
523 $ hg tags
523 $ hg tags
524 tip 6:735c3ca72986
524 tip 6:735c3ca72986
525 bar 0:bbd179dfa0a7
525 bar 0:bbd179dfa0a7
526
526
527 Don't allow moving tag without -f:
527 Don't allow moving tag without -f:
528
528
529 $ hg tag -r 3 bar
529 $ hg tag -r 3 bar
530 abort: tag 'bar' already exists (use -f to force)
530 abort: tag 'bar' already exists (use -f to force)
531 [255]
531 [255]
532 $ hg tags
532 $ hg tags
533 tip 6:735c3ca72986
533 tip 6:735c3ca72986
534 bar 0:bbd179dfa0a7
534 bar 0:bbd179dfa0a7
535
535
536 Strip 1: expose an old head:
536 Strip 1: expose an old head:
537
537
538 $ hg --config extensions.mq= strip 5
538 $ hg --config extensions.mq= strip 5
539 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
539 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
540 $ hg tags # partly stale cache
540 $ hg tags # partly stale cache
541 tip 5:735c3ca72986
541 tip 5:735c3ca72986
542 bar 1:78391a272241
542 bar 1:78391a272241
543 $ hg tags # up-to-date cache
543 $ hg tags # up-to-date cache
544 tip 5:735c3ca72986
544 tip 5:735c3ca72986
545 bar 1:78391a272241
545 bar 1:78391a272241
546
546
547 Strip 2: destroy whole branch, no old head exposed
547 Strip 2: destroy whole branch, no old head exposed
548
548
549 $ hg --config extensions.mq= strip 4
549 $ hg --config extensions.mq= strip 4
550 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
550 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
551 $ hg tags # partly stale
551 $ hg tags # partly stale
552 tip 4:735c3ca72986
552 tip 4:735c3ca72986
553 bar 0:bbd179dfa0a7
553 bar 0:bbd179dfa0a7
554 $ rm -f .hg/cache/tags2-visible
554 $ rm -f .hg/cache/tags2-visible
555 $ hg tags # cold cache
555 $ hg tags # cold cache
556 tip 4:735c3ca72986
556 tip 4:735c3ca72986
557 bar 0:bbd179dfa0a7
557 bar 0:bbd179dfa0a7
558
558
559 Test tag rank with 3 heads:
559 Test tag rank with 3 heads:
560
560
561 $ cd ..
561 $ cd ..
562 $ hg init t4
562 $ hg init t4
563 $ cd t4
563 $ cd t4
564 $ echo foo > foo
564 $ echo foo > foo
565 $ hg add
565 $ hg add
566 adding foo
566 adding foo
567 $ hg ci -m 'add foo' # rev 0
567 $ hg ci -m 'add foo' # rev 0
568 $ hg tag bar # rev 1 bar -> 0
568 $ hg tag bar # rev 1 bar -> 0
569 $ hg tag -f bar # rev 2 bar -> 1
569 $ hg tag -f bar # rev 2 bar -> 1
570 $ hg up -qC 0
570 $ hg up -qC 0
571 $ hg tag -fr 2 bar # rev 3 bar -> 2
571 $ hg tag -fr 2 bar # rev 3 bar -> 2
572 $ hg tags
572 $ hg tags
573 tip 3:197c21bbbf2c
573 tip 3:197c21bbbf2c
574 bar 2:6fa450212aeb
574 bar 2:6fa450212aeb
575 $ hg up -qC 0
575 $ hg up -qC 0
576 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
576 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
577
577
578 Bar should still point to rev 2:
578 Bar should still point to rev 2:
579
579
580 $ hg tags
580 $ hg tags
581 tip 4:3b4b14ed0202
581 tip 4:3b4b14ed0202
582 bar 2:6fa450212aeb
582 bar 2:6fa450212aeb
583
583
584 Test that removing global/local tags does not get confused when trying
584 Test that removing global/local tags does not get confused when trying
585 to remove a tag of type X which actually only exists as a type Y:
585 to remove a tag of type X which actually only exists as a type Y:
586
586
587 $ cd ..
587 $ cd ..
588 $ hg init t5
588 $ hg init t5
589 $ cd t5
589 $ cd t5
590 $ echo foo > foo
590 $ echo foo > foo
591 $ hg add
591 $ hg add
592 adding foo
592 adding foo
593 $ hg ci -m 'add foo' # rev 0
593 $ hg ci -m 'add foo' # rev 0
594
594
595 $ hg tag -r 0 -l localtag
595 $ hg tag -r 0 -l localtag
596 $ hg tag --remove localtag
596 $ hg tag --remove localtag
597 abort: tag 'localtag' is not a global tag
597 abort: tag 'localtag' is not a global tag
598 [255]
598 [255]
599 $
599 $
600 $ hg tag -r 0 globaltag
600 $ hg tag -r 0 globaltag
601 $ hg tag --remove -l globaltag
601 $ hg tag --remove -l globaltag
602 abort: tag 'globaltag' is not a local tag
602 abort: tag 'globaltag' is not a local tag
603 [255]
603 [255]
604 $ hg tags -v
604 $ hg tags -v
605 tip 1:a0b6fe111088
605 tip 1:a0b6fe111088
606 localtag 0:bbd179dfa0a7 local
606 localtag 0:bbd179dfa0a7 local
607 globaltag 0:bbd179dfa0a7
607 globaltag 0:bbd179dfa0a7
608
608
609 Test for issue3911
609 Test for issue3911
610
610
611 $ hg tag -r 0 -l localtag2
611 $ hg tag -r 0 -l localtag2
612 $ hg tag -l --remove localtag2
612 $ hg tag -l --remove localtag2
613 $ hg tags -v
613 $ hg tags -v
614 tip 1:a0b6fe111088
614 tip 1:a0b6fe111088
615 localtag 0:bbd179dfa0a7 local
615 localtag 0:bbd179dfa0a7 local
616 globaltag 0:bbd179dfa0a7
616 globaltag 0:bbd179dfa0a7
617
617
618 $ hg tag -r 1 -f localtag
618 $ hg tag -r 1 -f localtag
619 $ hg tags -v
619 $ hg tags -v
620 tip 2:5c70a037bb37
620 tip 2:5c70a037bb37
621 localtag 1:a0b6fe111088
621 localtag 1:a0b6fe111088
622 globaltag 0:bbd179dfa0a7
622 globaltag 0:bbd179dfa0a7
623
623
624 $ hg tags -v
624 $ hg tags -v
625 tip 2:5c70a037bb37
625 tip 2:5c70a037bb37
626 localtag 1:a0b6fe111088
626 localtag 1:a0b6fe111088
627 globaltag 0:bbd179dfa0a7
627 globaltag 0:bbd179dfa0a7
628
628
629 $ hg tag -r 1 localtag2
629 $ hg tag -r 1 localtag2
630 $ hg tags -v
630 $ hg tags -v
631 tip 3:bbfb8cd42be2
631 tip 3:bbfb8cd42be2
632 localtag2 1:a0b6fe111088
632 localtag2 1:a0b6fe111088
633 localtag 1:a0b6fe111088
633 localtag 1:a0b6fe111088
634 globaltag 0:bbd179dfa0a7
634 globaltag 0:bbd179dfa0a7
635
635
636 $ hg tags -v
636 $ hg tags -v
637 tip 3:bbfb8cd42be2
637 tip 3:bbfb8cd42be2
638 localtag2 1:a0b6fe111088
638 localtag2 1:a0b6fe111088
639 localtag 1:a0b6fe111088
639 localtag 1:a0b6fe111088
640 globaltag 0:bbd179dfa0a7
640 globaltag 0:bbd179dfa0a7
641
641
642 $ cd ..
642 $ cd ..
643
643
644 Create a repository with tags data to test .hgtags fnodes transfer
644 Create a repository with tags data to test .hgtags fnodes transfer
645
645
646 $ hg init tagsserver
646 $ hg init tagsserver
647 $ cd tagsserver
647 $ cd tagsserver
648 $ touch foo
648 $ touch foo
649 $ hg -q commit -A -m initial
649 $ hg -q commit -A -m initial
650 $ hg tag -m 'tag 0.1' 0.1
650 $ hg tag -m 'tag 0.1' 0.1
651 $ echo second > foo
651 $ echo second > foo
652 $ hg commit -m second
652 $ hg commit -m second
653 $ hg tag -m 'tag 0.2' 0.2
653 $ hg tag -m 'tag 0.2' 0.2
654 $ hg tags
654 $ hg tags
655 tip 3:40f0358cb314
655 tip 3:40f0358cb314
656 0.2 2:f63cc8fe54e4
656 0.2 2:f63cc8fe54e4
657 0.1 0:96ee1d7354c4
657 0.1 0:96ee1d7354c4
658 $ cd ..
658 $ cd ..
659
659
660 Cloning should pull down hgtags fnodes mappings and write the cache file
660 Cloning should pull down hgtags fnodes mappings and write the cache file
661
661
662 $ hg clone --pull tagsserver tagsclient
662 $ hg clone --pull tagsserver tagsclient
663 requesting all changes
663 requesting all changes
664 adding changesets
664 adding changesets
665 adding manifests
665 adding manifests
666 adding file changes
666 adding file changes
667 added 4 changesets with 4 changes to 2 files
667 added 4 changesets with 4 changes to 2 files
668 updating to branch default
668 updating to branch default
669 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
669 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
670
670
671 Missing tags2* files means the cache wasn't written through the normal mechanism.
671 Missing tags2* files means the cache wasn't written through the normal mechanism.
672
672
673 $ ls tagsclient/.hg/cache
673 $ ls tagsclient/.hg/cache
674 branch2-served
675 checkisexec (execbit !)
674 checkisexec (execbit !)
676 checklink (symlink !)
675 checklink (symlink !)
677 checklink-target (symlink !)
676 checklink-target (symlink !)
677 branch2-base
678 checkisexec
679 checklink
680 checklink-target
678 hgtagsfnodes1
681 hgtagsfnodes1
679 rbc-names-v1
680 rbc-revs-v1
681
682
682 Cache should contain the head only, even though other nodes have tags data
683 Cache should contain the head only, even though other nodes have tags data
683
684
684 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
685 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
685 tagsclient/.hg/cache/hgtagsfnodes1: size=96
686 tagsclient/.hg/cache/hgtagsfnodes1: size=96
686 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
687 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
687 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
688 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
688 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
689 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
689 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
690 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
690 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
691 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
691 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
692 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
692
693
693 Running hg tags should produce tags2* file and not change cache
694 Running hg tags should produce tags2* file and not change cache
694
695
695 $ hg -R tagsclient tags
696 $ hg -R tagsclient tags
696 tip 3:40f0358cb314
697 tip 3:40f0358cb314
697 0.2 2:f63cc8fe54e4
698 0.2 2:f63cc8fe54e4
698 0.1 0:96ee1d7354c4
699 0.1 0:96ee1d7354c4
699
700
700 $ ls tagsclient/.hg/cache
701 $ ls tagsclient/.hg/cache
701 branch2-served
702 checkisexec (execbit !)
702 checkisexec (execbit !)
703 checklink (symlink !)
703 checklink (symlink !)
704 checklink-target (symlink !)
704 checklink-target (symlink !)
705 branch2-base
706 checkisexec
707 checklink
708 checklink-target
705 hgtagsfnodes1
709 hgtagsfnodes1
706 rbc-names-v1
707 rbc-revs-v1
708 tags2-visible
710 tags2-visible
709
711
710 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
712 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
711 tagsclient/.hg/cache/hgtagsfnodes1: size=96
713 tagsclient/.hg/cache/hgtagsfnodes1: size=96
712 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
714 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
713 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
715 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
714 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
716 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
715 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
717 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
716 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
718 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
717 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
719 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
718
720
719 Check that the bundle includes cache data
721 Check that the bundle includes cache data
720
722
721 $ hg -R tagsclient bundle --all ./test-cache-in-bundle-all-rev.hg
723 $ hg -R tagsclient bundle --all ./test-cache-in-bundle-all-rev.hg
722 4 changesets found
724 4 changesets found
723 $ hg debugbundle ./test-cache-in-bundle-all-rev.hg
725 $ hg debugbundle ./test-cache-in-bundle-all-rev.hg
724 Stream params: sortdict([('Compression', 'BZ')])
726 Stream params: sortdict([('Compression', 'BZ')])
725 changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])"
727 changegroup -- "sortdict([('version', '02'), ('nbchanges', '4')])"
726 96ee1d7354c4ad7372047672c36a1f561e3a6a4c
728 96ee1d7354c4ad7372047672c36a1f561e3a6a4c
727 c4dab0c2fd337eb9191f80c3024830a4889a8f34
729 c4dab0c2fd337eb9191f80c3024830a4889a8f34
728 f63cc8fe54e4d326f8d692805d70e092f851ddb1
730 f63cc8fe54e4d326f8d692805d70e092f851ddb1
729 40f0358cb314c824a5929ee527308d90e023bc10
731 40f0358cb314c824a5929ee527308d90e023bc10
730 hgtagsfnodes -- 'sortdict()'
732 hgtagsfnodes -- 'sortdict()'
General Comments 0
You need to be logged in to leave comments. Login now