##// END OF EJS Templates
verify: make output less confusing (issue5924)...
Meirambek Omyrzak -
r39525:f1186c29 default
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -1,489 +1,489 b''
1 # verify.py - repository integrity checking for Mercurial
1 # verify.py - repository integrity checking for Mercurial
2 #
2 #
3 # Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2006, 2007 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
11
12 from .i18n import _
12 from .i18n import _
13 from .node import (
13 from .node import (
14 nullid,
14 nullid,
15 short,
15 short,
16 )
16 )
17
17
18 from . import (
18 from . import (
19 error,
19 error,
20 pycompat,
20 pycompat,
21 revlog,
21 revlog,
22 scmutil,
22 scmutil,
23 util,
23 util,
24 )
24 )
25
25
26 def verify(repo):
26 def verify(repo):
27 with repo.lock():
27 with repo.lock():
28 return verifier(repo).verify()
28 return verifier(repo).verify()
29
29
30 def _normpath(f):
30 def _normpath(f):
31 # under hg < 2.4, convert didn't sanitize paths properly, so a
31 # under hg < 2.4, convert didn't sanitize paths properly, so a
32 # converted repo may contain repeated slashes
32 # converted repo may contain repeated slashes
33 while '//' in f:
33 while '//' in f:
34 f = f.replace('//', '/')
34 f = f.replace('//', '/')
35 return f
35 return f
36
36
37 class verifier(object):
37 class verifier(object):
38 # The match argument is always None in hg core, but e.g. the narrowhg
38 # The match argument is always None in hg core, but e.g. the narrowhg
39 # extension will pass in a matcher here.
39 # extension will pass in a matcher here.
40 def __init__(self, repo, match=None):
40 def __init__(self, repo, match=None):
41 self.repo = repo.unfiltered()
41 self.repo = repo.unfiltered()
42 self.ui = repo.ui
42 self.ui = repo.ui
43 self.match = match or scmutil.matchall(repo)
43 self.match = match or scmutil.matchall(repo)
44 self.badrevs = set()
44 self.badrevs = set()
45 self.errors = 0
45 self.errors = 0
46 self.warnings = 0
46 self.warnings = 0
47 self.havecl = len(repo.changelog) > 0
47 self.havecl = len(repo.changelog) > 0
48 self.havemf = len(repo.manifestlog.getstorage(b'')) > 0
48 self.havemf = len(repo.manifestlog.getstorage(b'')) > 0
49 self.revlogv1 = repo.changelog.version != revlog.REVLOGV0
49 self.revlogv1 = repo.changelog.version != revlog.REVLOGV0
50 self.lrugetctx = util.lrucachefunc(repo.__getitem__)
50 self.lrugetctx = util.lrucachefunc(repo.__getitem__)
51 self.refersmf = False
51 self.refersmf = False
52 self.fncachewarned = False
52 self.fncachewarned = False
53 # developer config: verify.skipflags
53 # developer config: verify.skipflags
54 self.skipflags = repo.ui.configint('verify', 'skipflags')
54 self.skipflags = repo.ui.configint('verify', 'skipflags')
55 self.warnorphanstorefiles = True
55 self.warnorphanstorefiles = True
56
56
57 def warn(self, msg):
57 def warn(self, msg):
58 self.ui.warn(msg + "\n")
58 self.ui.warn(msg + "\n")
59 self.warnings += 1
59 self.warnings += 1
60
60
61 def err(self, linkrev, msg, filename=None):
61 def err(self, linkrev, msg, filename=None):
62 if linkrev is not None:
62 if linkrev is not None:
63 self.badrevs.add(linkrev)
63 self.badrevs.add(linkrev)
64 linkrev = "%d" % linkrev
64 linkrev = "%d" % linkrev
65 else:
65 else:
66 linkrev = '?'
66 linkrev = '?'
67 msg = "%s: %s" % (linkrev, msg)
67 msg = "%s: %s" % (linkrev, msg)
68 if filename:
68 if filename:
69 msg = "%s@%s" % (filename, msg)
69 msg = "%s@%s" % (filename, msg)
70 self.ui.warn(" " + msg + "\n")
70 self.ui.warn(" " + msg + "\n")
71 self.errors += 1
71 self.errors += 1
72
72
73 def exc(self, linkrev, msg, inst, filename=None):
73 def exc(self, linkrev, msg, inst, filename=None):
74 fmsg = pycompat.bytestr(inst)
74 fmsg = pycompat.bytestr(inst)
75 if not fmsg:
75 if not fmsg:
76 fmsg = pycompat.byterepr(inst)
76 fmsg = pycompat.byterepr(inst)
77 self.err(linkrev, "%s: %s" % (msg, fmsg), filename)
77 self.err(linkrev, "%s: %s" % (msg, fmsg), filename)
78
78
79 def checklog(self, obj, name, linkrev):
79 def checklog(self, obj, name, linkrev):
80 if not len(obj) and (self.havecl or self.havemf):
80 if not len(obj) and (self.havecl or self.havemf):
81 self.err(linkrev, _("empty or missing %s") % name)
81 self.err(linkrev, _("empty or missing %s") % name)
82 return
82 return
83
83
84 d = obj.checksize()
84 d = obj.checksize()
85 if d[0]:
85 if d[0]:
86 self.err(None, _("data length off by %d bytes") % d[0], name)
86 self.err(None, _("data length off by %d bytes") % d[0], name)
87 if d[1]:
87 if d[1]:
88 self.err(None, _("index contains %d extra bytes") % d[1], name)
88 self.err(None, _("index contains %d extra bytes") % d[1], name)
89
89
90 if obj.version != revlog.REVLOGV0:
90 if obj.version != revlog.REVLOGV0:
91 if not self.revlogv1:
91 if not self.revlogv1:
92 self.warn(_("warning: `%s' uses revlog format 1") % name)
92 self.warn(_("warning: `%s' uses revlog format 1") % name)
93 elif self.revlogv1:
93 elif self.revlogv1:
94 self.warn(_("warning: `%s' uses revlog format 0") % name)
94 self.warn(_("warning: `%s' uses revlog format 0") % name)
95
95
96 def checkentry(self, obj, i, node, seen, linkrevs, f):
96 def checkentry(self, obj, i, node, seen, linkrevs, f):
97 lr = obj.linkrev(obj.rev(node))
97 lr = obj.linkrev(obj.rev(node))
98 if lr < 0 or (self.havecl and lr not in linkrevs):
98 if lr < 0 or (self.havecl and lr not in linkrevs):
99 if lr < 0 or lr >= len(self.repo.changelog):
99 if lr < 0 or lr >= len(self.repo.changelog):
100 msg = _("rev %d points to nonexistent changeset %d")
100 msg = _("rev %d points to nonexistent changeset %d")
101 else:
101 else:
102 msg = _("rev %d points to unexpected changeset %d")
102 msg = _("rev %d points to unexpected changeset %d")
103 self.err(None, msg % (i, lr), f)
103 self.err(None, msg % (i, lr), f)
104 if linkrevs:
104 if linkrevs:
105 if f and len(linkrevs) > 1:
105 if f and len(linkrevs) > 1:
106 try:
106 try:
107 # attempt to filter down to real linkrevs
107 # attempt to filter down to real linkrevs
108 linkrevs = [l for l in linkrevs
108 linkrevs = [l for l in linkrevs
109 if self.lrugetctx(l)[f].filenode() == node]
109 if self.lrugetctx(l)[f].filenode() == node]
110 except Exception:
110 except Exception:
111 pass
111 pass
112 self.warn(_(" (expected %s)") % " ".join
112 self.warn(_(" (expected %s)") % " ".join
113 (map(pycompat.bytestr, linkrevs)))
113 (map(pycompat.bytestr, linkrevs)))
114 lr = None # can't be trusted
114 lr = None # can't be trusted
115
115
116 try:
116 try:
117 p1, p2 = obj.parents(node)
117 p1, p2 = obj.parents(node)
118 if p1 not in seen and p1 != nullid:
118 if p1 not in seen and p1 != nullid:
119 self.err(lr, _("unknown parent 1 %s of %s") %
119 self.err(lr, _("unknown parent 1 %s of %s") %
120 (short(p1), short(node)), f)
120 (short(p1), short(node)), f)
121 if p2 not in seen and p2 != nullid:
121 if p2 not in seen and p2 != nullid:
122 self.err(lr, _("unknown parent 2 %s of %s") %
122 self.err(lr, _("unknown parent 2 %s of %s") %
123 (short(p2), short(node)), f)
123 (short(p2), short(node)), f)
124 except Exception as inst:
124 except Exception as inst:
125 self.exc(lr, _("checking parents of %s") % short(node), inst, f)
125 self.exc(lr, _("checking parents of %s") % short(node), inst, f)
126
126
127 if node in seen:
127 if node in seen:
128 self.err(lr, _("duplicate revision %d (%d)") % (i, seen[node]), f)
128 self.err(lr, _("duplicate revision %d (%d)") % (i, seen[node]), f)
129 seen[node] = i
129 seen[node] = i
130 return lr
130 return lr
131
131
132 def verify(self):
132 def verify(self):
133 repo = self.repo
133 repo = self.repo
134
134
135 ui = repo.ui
135 ui = repo.ui
136
136
137 if not repo.url().startswith('file:'):
137 if not repo.url().startswith('file:'):
138 raise error.Abort(_("cannot verify bundle or remote repos"))
138 raise error.Abort(_("cannot verify bundle or remote repos"))
139
139
140 if os.path.exists(repo.sjoin("journal")):
140 if os.path.exists(repo.sjoin("journal")):
141 ui.warn(_("abandoned transaction found - run hg recover\n"))
141 ui.warn(_("abandoned transaction found - run hg recover\n"))
142
142
143 if ui.verbose or not self.revlogv1:
143 if ui.verbose or not self.revlogv1:
144 ui.status(_("repository uses revlog format %d\n") %
144 ui.status(_("repository uses revlog format %d\n") %
145 (self.revlogv1 and 1 or 0))
145 (self.revlogv1 and 1 or 0))
146
146
147 mflinkrevs, filelinkrevs = self._verifychangelog()
147 mflinkrevs, filelinkrevs = self._verifychangelog()
148
148
149 filenodes = self._verifymanifest(mflinkrevs)
149 filenodes = self._verifymanifest(mflinkrevs)
150 del mflinkrevs
150 del mflinkrevs
151
151
152 self._crosscheckfiles(filelinkrevs, filenodes)
152 self._crosscheckfiles(filelinkrevs, filenodes)
153
153
154 totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs)
154 totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs)
155
155
156 ui.status(_("%d files, %d changesets, %d total revisions\n") %
156 ui.status(_("checked %d changesets with %d changes to %d files\n") %
157 (totalfiles, len(repo.changelog), filerevisions))
157 (len(repo.changelog), filerevisions, totalfiles))
158 if self.warnings:
158 if self.warnings:
159 ui.warn(_("%d warnings encountered!\n") % self.warnings)
159 ui.warn(_("%d warnings encountered!\n") % self.warnings)
160 if self.fncachewarned:
160 if self.fncachewarned:
161 ui.warn(_('hint: run "hg debugrebuildfncache" to recover from '
161 ui.warn(_('hint: run "hg debugrebuildfncache" to recover from '
162 'corrupt fncache\n'))
162 'corrupt fncache\n'))
163 if self.errors:
163 if self.errors:
164 ui.warn(_("%d integrity errors encountered!\n") % self.errors)
164 ui.warn(_("%d integrity errors encountered!\n") % self.errors)
165 if self.badrevs:
165 if self.badrevs:
166 ui.warn(_("(first damaged changeset appears to be %d)\n")
166 ui.warn(_("(first damaged changeset appears to be %d)\n")
167 % min(self.badrevs))
167 % min(self.badrevs))
168 return 1
168 return 1
169
169
170 def _verifychangelog(self):
170 def _verifychangelog(self):
171 ui = self.ui
171 ui = self.ui
172 repo = self.repo
172 repo = self.repo
173 match = self.match
173 match = self.match
174 cl = repo.changelog
174 cl = repo.changelog
175
175
176 ui.status(_("checking changesets\n"))
176 ui.status(_("checking changesets\n"))
177 mflinkrevs = {}
177 mflinkrevs = {}
178 filelinkrevs = {}
178 filelinkrevs = {}
179 seen = {}
179 seen = {}
180 self.checklog(cl, "changelog", 0)
180 self.checklog(cl, "changelog", 0)
181 progress = ui.makeprogress(_('checking'), unit=_('changesets'),
181 progress = ui.makeprogress(_('checking'), unit=_('changesets'),
182 total=len(repo))
182 total=len(repo))
183 for i in repo:
183 for i in repo:
184 progress.update(i)
184 progress.update(i)
185 n = cl.node(i)
185 n = cl.node(i)
186 self.checkentry(cl, i, n, seen, [i], "changelog")
186 self.checkentry(cl, i, n, seen, [i], "changelog")
187
187
188 try:
188 try:
189 changes = cl.read(n)
189 changes = cl.read(n)
190 if changes[0] != nullid:
190 if changes[0] != nullid:
191 mflinkrevs.setdefault(changes[0], []).append(i)
191 mflinkrevs.setdefault(changes[0], []).append(i)
192 self.refersmf = True
192 self.refersmf = True
193 for f in changes[3]:
193 for f in changes[3]:
194 if match(f):
194 if match(f):
195 filelinkrevs.setdefault(_normpath(f), []).append(i)
195 filelinkrevs.setdefault(_normpath(f), []).append(i)
196 except Exception as inst:
196 except Exception as inst:
197 self.refersmf = True
197 self.refersmf = True
198 self.exc(i, _("unpacking changeset %s") % short(n), inst)
198 self.exc(i, _("unpacking changeset %s") % short(n), inst)
199 progress.complete()
199 progress.complete()
200 return mflinkrevs, filelinkrevs
200 return mflinkrevs, filelinkrevs
201
201
202 def _verifymanifest(self, mflinkrevs, dir="", storefiles=None,
202 def _verifymanifest(self, mflinkrevs, dir="", storefiles=None,
203 subdirprogress=None):
203 subdirprogress=None):
204 repo = self.repo
204 repo = self.repo
205 ui = self.ui
205 ui = self.ui
206 match = self.match
206 match = self.match
207 mfl = self.repo.manifestlog
207 mfl = self.repo.manifestlog
208 mf = mfl.getstorage(dir)
208 mf = mfl.getstorage(dir)
209
209
210 if not dir:
210 if not dir:
211 self.ui.status(_("checking manifests\n"))
211 self.ui.status(_("checking manifests\n"))
212
212
213 filenodes = {}
213 filenodes = {}
214 subdirnodes = {}
214 subdirnodes = {}
215 seen = {}
215 seen = {}
216 label = "manifest"
216 label = "manifest"
217 if dir:
217 if dir:
218 label = dir
218 label = dir
219 revlogfiles = mf.files()
219 revlogfiles = mf.files()
220 storefiles.difference_update(revlogfiles)
220 storefiles.difference_update(revlogfiles)
221 if subdirprogress: # should be true since we're in a subdirectory
221 if subdirprogress: # should be true since we're in a subdirectory
222 subdirprogress.increment()
222 subdirprogress.increment()
223 if self.refersmf:
223 if self.refersmf:
224 # Do not check manifest if there are only changelog entries with
224 # Do not check manifest if there are only changelog entries with
225 # null manifests.
225 # null manifests.
226 self.checklog(mf, label, 0)
226 self.checklog(mf, label, 0)
227 progress = ui.makeprogress(_('checking'), unit=_('manifests'),
227 progress = ui.makeprogress(_('checking'), unit=_('manifests'),
228 total=len(mf))
228 total=len(mf))
229 for i in mf:
229 for i in mf:
230 if not dir:
230 if not dir:
231 progress.update(i)
231 progress.update(i)
232 n = mf.node(i)
232 n = mf.node(i)
233 lr = self.checkentry(mf, i, n, seen, mflinkrevs.get(n, []), label)
233 lr = self.checkentry(mf, i, n, seen, mflinkrevs.get(n, []), label)
234 if n in mflinkrevs:
234 if n in mflinkrevs:
235 del mflinkrevs[n]
235 del mflinkrevs[n]
236 elif dir:
236 elif dir:
237 self.err(lr, _("%s not in parent-directory manifest") %
237 self.err(lr, _("%s not in parent-directory manifest") %
238 short(n), label)
238 short(n), label)
239 else:
239 else:
240 self.err(lr, _("%s not in changesets") % short(n), label)
240 self.err(lr, _("%s not in changesets") % short(n), label)
241
241
242 try:
242 try:
243 mfdelta = mfl.get(dir, n).readdelta(shallow=True)
243 mfdelta = mfl.get(dir, n).readdelta(shallow=True)
244 for f, fn, fl in mfdelta.iterentries():
244 for f, fn, fl in mfdelta.iterentries():
245 if not f:
245 if not f:
246 self.err(lr, _("entry without name in manifest"))
246 self.err(lr, _("entry without name in manifest"))
247 elif f == "/dev/null": # ignore this in very old repos
247 elif f == "/dev/null": # ignore this in very old repos
248 continue
248 continue
249 fullpath = dir + _normpath(f)
249 fullpath = dir + _normpath(f)
250 if fl == 't':
250 if fl == 't':
251 if not match.visitdir(fullpath):
251 if not match.visitdir(fullpath):
252 continue
252 continue
253 subdirnodes.setdefault(fullpath + '/', {}).setdefault(
253 subdirnodes.setdefault(fullpath + '/', {}).setdefault(
254 fn, []).append(lr)
254 fn, []).append(lr)
255 else:
255 else:
256 if not match(fullpath):
256 if not match(fullpath):
257 continue
257 continue
258 filenodes.setdefault(fullpath, {}).setdefault(fn, lr)
258 filenodes.setdefault(fullpath, {}).setdefault(fn, lr)
259 except Exception as inst:
259 except Exception as inst:
260 self.exc(lr, _("reading delta %s") % short(n), inst, label)
260 self.exc(lr, _("reading delta %s") % short(n), inst, label)
261 if not dir:
261 if not dir:
262 progress.complete()
262 progress.complete()
263
263
264 if self.havemf:
264 if self.havemf:
265 for c, m in sorted([(c, m) for m in mflinkrevs
265 for c, m in sorted([(c, m) for m in mflinkrevs
266 for c in mflinkrevs[m]]):
266 for c in mflinkrevs[m]]):
267 if dir:
267 if dir:
268 self.err(c, _("parent-directory manifest refers to unknown "
268 self.err(c, _("parent-directory manifest refers to unknown "
269 "revision %s") % short(m), label)
269 "revision %s") % short(m), label)
270 else:
270 else:
271 self.err(c, _("changeset refers to unknown revision %s") %
271 self.err(c, _("changeset refers to unknown revision %s") %
272 short(m), label)
272 short(m), label)
273
273
274 if not dir and subdirnodes:
274 if not dir and subdirnodes:
275 self.ui.status(_("checking directory manifests\n"))
275 self.ui.status(_("checking directory manifests\n"))
276 storefiles = set()
276 storefiles = set()
277 subdirs = set()
277 subdirs = set()
278 revlogv1 = self.revlogv1
278 revlogv1 = self.revlogv1
279 for f, f2, size in repo.store.datafiles():
279 for f, f2, size in repo.store.datafiles():
280 if not f:
280 if not f:
281 self.err(None, _("cannot decode filename '%s'") % f2)
281 self.err(None, _("cannot decode filename '%s'") % f2)
282 elif (size > 0 or not revlogv1) and f.startswith('meta/'):
282 elif (size > 0 or not revlogv1) and f.startswith('meta/'):
283 storefiles.add(_normpath(f))
283 storefiles.add(_normpath(f))
284 subdirs.add(os.path.dirname(f))
284 subdirs.add(os.path.dirname(f))
285 subdirprogress = ui.makeprogress(_('checking'), unit=_('manifests'),
285 subdirprogress = ui.makeprogress(_('checking'), unit=_('manifests'),
286 total=len(subdirs))
286 total=len(subdirs))
287
287
288 for subdir, linkrevs in subdirnodes.iteritems():
288 for subdir, linkrevs in subdirnodes.iteritems():
289 subdirfilenodes = self._verifymanifest(linkrevs, subdir, storefiles,
289 subdirfilenodes = self._verifymanifest(linkrevs, subdir, storefiles,
290 subdirprogress)
290 subdirprogress)
291 for f, onefilenodes in subdirfilenodes.iteritems():
291 for f, onefilenodes in subdirfilenodes.iteritems():
292 filenodes.setdefault(f, {}).update(onefilenodes)
292 filenodes.setdefault(f, {}).update(onefilenodes)
293
293
294 if not dir and subdirnodes:
294 if not dir and subdirnodes:
295 subdirprogress.complete()
295 subdirprogress.complete()
296 if self.warnorphanstorefiles:
296 if self.warnorphanstorefiles:
297 for f in sorted(storefiles):
297 for f in sorted(storefiles):
298 self.warn(_("warning: orphan data file '%s'") % f)
298 self.warn(_("warning: orphan data file '%s'") % f)
299
299
300 return filenodes
300 return filenodes
301
301
302 def _crosscheckfiles(self, filelinkrevs, filenodes):
302 def _crosscheckfiles(self, filelinkrevs, filenodes):
303 repo = self.repo
303 repo = self.repo
304 ui = self.ui
304 ui = self.ui
305 ui.status(_("crosschecking files in changesets and manifests\n"))
305 ui.status(_("crosschecking files in changesets and manifests\n"))
306
306
307 total = len(filelinkrevs) + len(filenodes)
307 total = len(filelinkrevs) + len(filenodes)
308 progress = ui.makeprogress(_('crosschecking'), total=total)
308 progress = ui.makeprogress(_('crosschecking'), total=total)
309 if self.havemf:
309 if self.havemf:
310 for f in sorted(filelinkrevs):
310 for f in sorted(filelinkrevs):
311 progress.increment()
311 progress.increment()
312 if f not in filenodes:
312 if f not in filenodes:
313 lr = filelinkrevs[f][0]
313 lr = filelinkrevs[f][0]
314 self.err(lr, _("in changeset but not in manifest"), f)
314 self.err(lr, _("in changeset but not in manifest"), f)
315
315
316 if self.havecl:
316 if self.havecl:
317 for f in sorted(filenodes):
317 for f in sorted(filenodes):
318 progress.increment()
318 progress.increment()
319 if f not in filelinkrevs:
319 if f not in filelinkrevs:
320 try:
320 try:
321 fl = repo.file(f)
321 fl = repo.file(f)
322 lr = min([fl.linkrev(fl.rev(n)) for n in filenodes[f]])
322 lr = min([fl.linkrev(fl.rev(n)) for n in filenodes[f]])
323 except Exception:
323 except Exception:
324 lr = None
324 lr = None
325 self.err(lr, _("in manifest but not in changeset"), f)
325 self.err(lr, _("in manifest but not in changeset"), f)
326
326
327 progress.complete()
327 progress.complete()
328
328
329 def _verifyfiles(self, filenodes, filelinkrevs):
329 def _verifyfiles(self, filenodes, filelinkrevs):
330 repo = self.repo
330 repo = self.repo
331 ui = self.ui
331 ui = self.ui
332 lrugetctx = self.lrugetctx
332 lrugetctx = self.lrugetctx
333 revlogv1 = self.revlogv1
333 revlogv1 = self.revlogv1
334 havemf = self.havemf
334 havemf = self.havemf
335 ui.status(_("checking files\n"))
335 ui.status(_("checking files\n"))
336
336
337 storefiles = set()
337 storefiles = set()
338 for f, f2, size in repo.store.datafiles():
338 for f, f2, size in repo.store.datafiles():
339 if not f:
339 if not f:
340 self.err(None, _("cannot decode filename '%s'") % f2)
340 self.err(None, _("cannot decode filename '%s'") % f2)
341 elif (size > 0 or not revlogv1) and f.startswith('data/'):
341 elif (size > 0 or not revlogv1) and f.startswith('data/'):
342 storefiles.add(_normpath(f))
342 storefiles.add(_normpath(f))
343
343
344 files = sorted(set(filenodes) | set(filelinkrevs))
344 files = sorted(set(filenodes) | set(filelinkrevs))
345 revisions = 0
345 revisions = 0
346 progress = ui.makeprogress(_('checking'), unit=_('files'),
346 progress = ui.makeprogress(_('checking'), unit=_('files'),
347 total=len(files))
347 total=len(files))
348 for i, f in enumerate(files):
348 for i, f in enumerate(files):
349 progress.update(i, item=f)
349 progress.update(i, item=f)
350 try:
350 try:
351 linkrevs = filelinkrevs[f]
351 linkrevs = filelinkrevs[f]
352 except KeyError:
352 except KeyError:
353 # in manifest but not in changelog
353 # in manifest but not in changelog
354 linkrevs = []
354 linkrevs = []
355
355
356 if linkrevs:
356 if linkrevs:
357 lr = linkrevs[0]
357 lr = linkrevs[0]
358 else:
358 else:
359 lr = None
359 lr = None
360
360
361 try:
361 try:
362 fl = repo.file(f)
362 fl = repo.file(f)
363 except error.RevlogError as e:
363 except error.RevlogError as e:
364 self.err(lr, _("broken revlog! (%s)") % e, f)
364 self.err(lr, _("broken revlog! (%s)") % e, f)
365 continue
365 continue
366
366
367 for ff in fl.files():
367 for ff in fl.files():
368 try:
368 try:
369 storefiles.remove(ff)
369 storefiles.remove(ff)
370 except KeyError:
370 except KeyError:
371 if self.warnorphanstorefiles:
371 if self.warnorphanstorefiles:
372 self.warn(_(" warning: revlog '%s' not in fncache!") %
372 self.warn(_(" warning: revlog '%s' not in fncache!") %
373 ff)
373 ff)
374 self.fncachewarned = True
374 self.fncachewarned = True
375
375
376 self.checklog(fl, f, lr)
376 self.checklog(fl, f, lr)
377 seen = {}
377 seen = {}
378 rp = None
378 rp = None
379 for i in fl:
379 for i in fl:
380 revisions += 1
380 revisions += 1
381 n = fl.node(i)
381 n = fl.node(i)
382 lr = self.checkentry(fl, i, n, seen, linkrevs, f)
382 lr = self.checkentry(fl, i, n, seen, linkrevs, f)
383 if f in filenodes:
383 if f in filenodes:
384 if havemf and n not in filenodes[f]:
384 if havemf and n not in filenodes[f]:
385 self.err(lr, _("%s not in manifests") % (short(n)), f)
385 self.err(lr, _("%s not in manifests") % (short(n)), f)
386 else:
386 else:
387 del filenodes[f][n]
387 del filenodes[f][n]
388
388
389 # Verify contents. 4 cases to care about:
389 # Verify contents. 4 cases to care about:
390 #
390 #
391 # common: the most common case
391 # common: the most common case
392 # rename: with a rename
392 # rename: with a rename
393 # meta: file content starts with b'\1\n', the metadata
393 # meta: file content starts with b'\1\n', the metadata
394 # header defined in filelog.py, but without a rename
394 # header defined in filelog.py, but without a rename
395 # ext: content stored externally
395 # ext: content stored externally
396 #
396 #
397 # More formally, their differences are shown below:
397 # More formally, their differences are shown below:
398 #
398 #
399 # | common | rename | meta | ext
399 # | common | rename | meta | ext
400 # -------------------------------------------------------
400 # -------------------------------------------------------
401 # flags() | 0 | 0 | 0 | not 0
401 # flags() | 0 | 0 | 0 | not 0
402 # renamed() | False | True | False | ?
402 # renamed() | False | True | False | ?
403 # rawtext[0:2]=='\1\n'| False | True | True | ?
403 # rawtext[0:2]=='\1\n'| False | True | True | ?
404 #
404 #
405 # "rawtext" means the raw text stored in revlog data, which
405 # "rawtext" means the raw text stored in revlog data, which
406 # could be retrieved by "revision(rev, raw=True)". "text"
406 # could be retrieved by "revision(rev, raw=True)". "text"
407 # mentioned below is "revision(rev, raw=False)".
407 # mentioned below is "revision(rev, raw=False)".
408 #
408 #
409 # There are 3 different lengths stored physically:
409 # There are 3 different lengths stored physically:
410 # 1. L1: rawsize, stored in revlog index
410 # 1. L1: rawsize, stored in revlog index
411 # 2. L2: len(rawtext), stored in revlog data
411 # 2. L2: len(rawtext), stored in revlog data
412 # 3. L3: len(text), stored in revlog data if flags==0, or
412 # 3. L3: len(text), stored in revlog data if flags==0, or
413 # possibly somewhere else if flags!=0
413 # possibly somewhere else if flags!=0
414 #
414 #
415 # L1 should be equal to L2. L3 could be different from them.
415 # L1 should be equal to L2. L3 could be different from them.
416 # "text" may or may not affect commit hash depending on flag
416 # "text" may or may not affect commit hash depending on flag
417 # processors (see revlog.addflagprocessor).
417 # processors (see revlog.addflagprocessor).
418 #
418 #
419 # | common | rename | meta | ext
419 # | common | rename | meta | ext
420 # -------------------------------------------------
420 # -------------------------------------------------
421 # rawsize() | L1 | L1 | L1 | L1
421 # rawsize() | L1 | L1 | L1 | L1
422 # size() | L1 | L2-LM | L1(*) | L1 (?)
422 # size() | L1 | L2-LM | L1(*) | L1 (?)
423 # len(rawtext) | L2 | L2 | L2 | L2
423 # len(rawtext) | L2 | L2 | L2 | L2
424 # len(text) | L2 | L2 | L2 | L3
424 # len(text) | L2 | L2 | L2 | L3
425 # len(read()) | L2 | L2-LM | L2-LM | L3 (?)
425 # len(read()) | L2 | L2-LM | L2-LM | L3 (?)
426 #
426 #
427 # LM: length of metadata, depending on rawtext
427 # LM: length of metadata, depending on rawtext
428 # (*): not ideal, see comment in filelog.size
428 # (*): not ideal, see comment in filelog.size
429 # (?): could be "- len(meta)" if the resolved content has
429 # (?): could be "- len(meta)" if the resolved content has
430 # rename metadata
430 # rename metadata
431 #
431 #
432 # Checks needed to be done:
432 # Checks needed to be done:
433 # 1. length check: L1 == L2, in all cases.
433 # 1. length check: L1 == L2, in all cases.
434 # 2. hash check: depending on flag processor, we may need to
434 # 2. hash check: depending on flag processor, we may need to
435 # use either "text" (external), or "rawtext" (in revlog).
435 # use either "text" (external), or "rawtext" (in revlog).
436 try:
436 try:
437 skipflags = self.skipflags
437 skipflags = self.skipflags
438 if skipflags:
438 if skipflags:
439 skipflags &= fl.flags(i)
439 skipflags &= fl.flags(i)
440 if not skipflags:
440 if not skipflags:
441 fl.read(n) # side effect: read content and do checkhash
441 fl.read(n) # side effect: read content and do checkhash
442 rp = fl.renamed(n)
442 rp = fl.renamed(n)
443 # the "L1 == L2" check
443 # the "L1 == L2" check
444 l1 = fl.rawsize(i)
444 l1 = fl.rawsize(i)
445 l2 = len(fl.revision(n, raw=True))
445 l2 = len(fl.revision(n, raw=True))
446 if l1 != l2:
446 if l1 != l2:
447 self.err(lr, _("unpacked size is %s, %s expected") %
447 self.err(lr, _("unpacked size is %s, %s expected") %
448 (l2, l1), f)
448 (l2, l1), f)
449 except error.CensoredNodeError:
449 except error.CensoredNodeError:
450 # experimental config: censor.policy
450 # experimental config: censor.policy
451 if ui.config("censor", "policy") == "abort":
451 if ui.config("censor", "policy") == "abort":
452 self.err(lr, _("censored file data"), f)
452 self.err(lr, _("censored file data"), f)
453 except Exception as inst:
453 except Exception as inst:
454 self.exc(lr, _("unpacking %s") % short(n), inst, f)
454 self.exc(lr, _("unpacking %s") % short(n), inst, f)
455
455
456 # check renames
456 # check renames
457 try:
457 try:
458 if rp:
458 if rp:
459 if lr is not None and ui.verbose:
459 if lr is not None and ui.verbose:
460 ctx = lrugetctx(lr)
460 ctx = lrugetctx(lr)
461 if not any(rp[0] in pctx for pctx in ctx.parents()):
461 if not any(rp[0] in pctx for pctx in ctx.parents()):
462 self.warn(_("warning: copy source of '%s' not"
462 self.warn(_("warning: copy source of '%s' not"
463 " in parents of %s") % (f, ctx))
463 " in parents of %s") % (f, ctx))
464 fl2 = repo.file(rp[0])
464 fl2 = repo.file(rp[0])
465 if not len(fl2):
465 if not len(fl2):
466 self.err(lr, _("empty or missing copy source "
466 self.err(lr, _("empty or missing copy source "
467 "revlog %s:%s") % (rp[0], short(rp[1])), f)
467 "revlog %s:%s") % (rp[0], short(rp[1])), f)
468 elif rp[1] == nullid:
468 elif rp[1] == nullid:
469 ui.note(_("warning: %s@%s: copy source"
469 ui.note(_("warning: %s@%s: copy source"
470 " revision is nullid %s:%s\n")
470 " revision is nullid %s:%s\n")
471 % (f, lr, rp[0], short(rp[1])))
471 % (f, lr, rp[0], short(rp[1])))
472 else:
472 else:
473 fl2.rev(rp[1])
473 fl2.rev(rp[1])
474 except Exception as inst:
474 except Exception as inst:
475 self.exc(lr, _("checking rename of %s") % short(n), inst, f)
475 self.exc(lr, _("checking rename of %s") % short(n), inst, f)
476
476
477 # cross-check
477 # cross-check
478 if f in filenodes:
478 if f in filenodes:
479 fns = [(v, k) for k, v in filenodes[f].iteritems()]
479 fns = [(v, k) for k, v in filenodes[f].iteritems()]
480 for lr, node in sorted(fns):
480 for lr, node in sorted(fns):
481 self.err(lr, _("manifest refers to unknown revision %s") %
481 self.err(lr, _("manifest refers to unknown revision %s") %
482 short(node), f)
482 short(node), f)
483 progress.complete()
483 progress.complete()
484
484
485 if self.warnorphanstorefiles:
485 if self.warnorphanstorefiles:
486 for f in sorted(storefiles):
486 for f in sorted(storefiles):
487 self.warn(_("warning: orphan data file '%s'") % f)
487 self.warn(_("warning: orphan data file '%s'") % f)
488
488
489 return len(files), revisions
489 return len(files), revisions
@@ -1,103 +1,103 b''
1 Create a repository:
1 Create a repository:
2
2
3 #if no-extraextensions
3 #if no-extraextensions
4 $ hg config
4 $ hg config
5 devel.all-warnings=true
5 devel.all-warnings=true
6 devel.default-date=0 0
6 devel.default-date=0 0
7 extensions.fsmonitor= (fsmonitor !)
7 extensions.fsmonitor= (fsmonitor !)
8 largefiles.usercache=$TESTTMP/.cache/largefiles
8 largefiles.usercache=$TESTTMP/.cache/largefiles
9 lfs.usercache=$TESTTMP/.cache/lfs
9 lfs.usercache=$TESTTMP/.cache/lfs
10 ui.slash=True
10 ui.slash=True
11 ui.interactive=False
11 ui.interactive=False
12 ui.mergemarkers=detailed
12 ui.mergemarkers=detailed
13 ui.promptecho=True
13 ui.promptecho=True
14 web.address=localhost
14 web.address=localhost
15 web\.ipv6=(?:True|False) (re)
15 web\.ipv6=(?:True|False) (re)
16 web.server-header=testing stub value
16 web.server-header=testing stub value
17 #endif
17 #endif
18
18
19 $ hg init t
19 $ hg init t
20 $ cd t
20 $ cd t
21
21
22 Prepare a changeset:
22 Prepare a changeset:
23
23
24 $ echo a > a
24 $ echo a > a
25 $ hg add a
25 $ hg add a
26
26
27 $ hg status
27 $ hg status
28 A a
28 A a
29
29
30 Writes to stdio succeed and fail appropriately
30 Writes to stdio succeed and fail appropriately
31
31
32 #if devfull
32 #if devfull
33 $ hg status 2>/dev/full
33 $ hg status 2>/dev/full
34 A a
34 A a
35
35
36 $ hg status >/dev/full
36 $ hg status >/dev/full
37 abort: No space left on device
37 abort: No space left on device
38 [255]
38 [255]
39 #endif
39 #endif
40
40
41 #if devfull
41 #if devfull
42 $ hg status >/dev/full 2>&1
42 $ hg status >/dev/full 2>&1
43 [255]
43 [255]
44
44
45 $ hg status ENOENT 2>/dev/full
45 $ hg status ENOENT 2>/dev/full
46 [255]
46 [255]
47 #endif
47 #endif
48
48
49 $ hg commit -m test
49 $ hg commit -m test
50
50
51 This command is ancient:
51 This command is ancient:
52
52
53 $ hg history
53 $ hg history
54 changeset: 0:acb14030fe0a
54 changeset: 0:acb14030fe0a
55 tag: tip
55 tag: tip
56 user: test
56 user: test
57 date: Thu Jan 01 00:00:00 1970 +0000
57 date: Thu Jan 01 00:00:00 1970 +0000
58 summary: test
58 summary: test
59
59
60
60
61 Verify that updating to revision 0 via commands.update() works properly
61 Verify that updating to revision 0 via commands.update() works properly
62
62
63 $ cat <<EOF > update_to_rev0.py
63 $ cat <<EOF > update_to_rev0.py
64 > from mercurial import ui, hg, commands
64 > from mercurial import ui, hg, commands
65 > myui = ui.ui.load()
65 > myui = ui.ui.load()
66 > repo = hg.repository(myui, path=b'.')
66 > repo = hg.repository(myui, path=b'.')
67 > commands.update(myui, repo, rev=b"0")
67 > commands.update(myui, repo, rev=b"0")
68 > EOF
68 > EOF
69 $ hg up null
69 $ hg up null
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
71 $ $PYTHON ./update_to_rev0.py
71 $ $PYTHON ./update_to_rev0.py
72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 $ hg identify -n
73 $ hg identify -n
74 0
74 0
75
75
76
76
77 Poke around at hashes:
77 Poke around at hashes:
78
78
79 $ hg manifest --debug
79 $ hg manifest --debug
80 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
80 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
81
81
82 $ hg cat a
82 $ hg cat a
83 a
83 a
84
84
85 Verify should succeed:
85 Verify should succeed:
86
86
87 $ hg verify
87 $ hg verify
88 checking changesets
88 checking changesets
89 checking manifests
89 checking manifests
90 crosschecking files in changesets and manifests
90 crosschecking files in changesets and manifests
91 checking files
91 checking files
92 1 files, 1 changesets, 1 total revisions
92 checked 1 changesets with 1 changes to 1 files
93
93
94 Repository root:
94 Repository root:
95
95
96 $ hg root
96 $ hg root
97 $TESTTMP/t
97 $TESTTMP/t
98 $ hg log -l1 -T '{reporoot}\n'
98 $ hg log -l1 -T '{reporoot}\n'
99 $TESTTMP/t
99 $TESTTMP/t
100
100
101 At the end...
101 At the end...
102
102
103 $ cd ..
103 $ cd ..
@@ -1,351 +1,351 b''
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3 $ hg unbundle "$TESTDIR/bundles/remote.hg"
3 $ hg unbundle "$TESTDIR/bundles/remote.hg"
4 adding changesets
4 adding changesets
5 adding manifests
5 adding manifests
6 adding file changes
6 adding file changes
7 added 9 changesets with 7 changes to 4 files (+1 heads)
7 added 9 changesets with 7 changes to 4 files (+1 heads)
8 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
8 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
9 (run 'hg heads' to see heads, 'hg merge' to merge)
9 (run 'hg heads' to see heads, 'hg merge' to merge)
10 $ hg up tip
10 $ hg up tip
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 $ cd ..
12 $ cd ..
13
13
14 $ for i in 0 1 2 3 4 5 6 7 8; do
14 $ for i in 0 1 2 3 4 5 6 7 8; do
15 > mkdir test-"$i"
15 > mkdir test-"$i"
16 > hg --cwd test-"$i" init
16 > hg --cwd test-"$i" init
17 > hg -R test bundle -r "$i" test-"$i".hg test-"$i"
17 > hg -R test bundle -r "$i" test-"$i".hg test-"$i"
18 > cd test-"$i"
18 > cd test-"$i"
19 > hg unbundle ../test-"$i".hg
19 > hg unbundle ../test-"$i".hg
20 > hg verify
20 > hg verify
21 > hg tip -q
21 > hg tip -q
22 > cd ..
22 > cd ..
23 > done
23 > done
24 searching for changes
24 searching for changes
25 1 changesets found
25 1 changesets found
26 adding changesets
26 adding changesets
27 adding manifests
27 adding manifests
28 adding file changes
28 adding file changes
29 added 1 changesets with 1 changes to 1 files
29 added 1 changesets with 1 changes to 1 files
30 new changesets bfaf4b5cbf01 (1 drafts)
30 new changesets bfaf4b5cbf01 (1 drafts)
31 (run 'hg update' to get a working copy)
31 (run 'hg update' to get a working copy)
32 checking changesets
32 checking changesets
33 checking manifests
33 checking manifests
34 crosschecking files in changesets and manifests
34 crosschecking files in changesets and manifests
35 checking files
35 checking files
36 1 files, 1 changesets, 1 total revisions
36 checked 1 changesets with 1 changes to 1 files
37 0:bfaf4b5cbf01
37 0:bfaf4b5cbf01
38 searching for changes
38 searching for changes
39 2 changesets found
39 2 changesets found
40 adding changesets
40 adding changesets
41 adding manifests
41 adding manifests
42 adding file changes
42 adding file changes
43 added 2 changesets with 2 changes to 1 files
43 added 2 changesets with 2 changes to 1 files
44 new changesets bfaf4b5cbf01:21f32785131f (2 drafts)
44 new changesets bfaf4b5cbf01:21f32785131f (2 drafts)
45 (run 'hg update' to get a working copy)
45 (run 'hg update' to get a working copy)
46 checking changesets
46 checking changesets
47 checking manifests
47 checking manifests
48 crosschecking files in changesets and manifests
48 crosschecking files in changesets and manifests
49 checking files
49 checking files
50 1 files, 2 changesets, 2 total revisions
50 checked 2 changesets with 2 changes to 1 files
51 1:21f32785131f
51 1:21f32785131f
52 searching for changes
52 searching for changes
53 3 changesets found
53 3 changesets found
54 adding changesets
54 adding changesets
55 adding manifests
55 adding manifests
56 adding file changes
56 adding file changes
57 added 3 changesets with 3 changes to 1 files
57 added 3 changesets with 3 changes to 1 files
58 new changesets bfaf4b5cbf01:4ce51a113780 (3 drafts)
58 new changesets bfaf4b5cbf01:4ce51a113780 (3 drafts)
59 (run 'hg update' to get a working copy)
59 (run 'hg update' to get a working copy)
60 checking changesets
60 checking changesets
61 checking manifests
61 checking manifests
62 crosschecking files in changesets and manifests
62 crosschecking files in changesets and manifests
63 checking files
63 checking files
64 1 files, 3 changesets, 3 total revisions
64 checked 3 changesets with 3 changes to 1 files
65 2:4ce51a113780
65 2:4ce51a113780
66 searching for changes
66 searching for changes
67 4 changesets found
67 4 changesets found
68 adding changesets
68 adding changesets
69 adding manifests
69 adding manifests
70 adding file changes
70 adding file changes
71 added 4 changesets with 4 changes to 1 files
71 added 4 changesets with 4 changes to 1 files
72 new changesets bfaf4b5cbf01:93ee6ab32777 (4 drafts)
72 new changesets bfaf4b5cbf01:93ee6ab32777 (4 drafts)
73 (run 'hg update' to get a working copy)
73 (run 'hg update' to get a working copy)
74 checking changesets
74 checking changesets
75 checking manifests
75 checking manifests
76 crosschecking files in changesets and manifests
76 crosschecking files in changesets and manifests
77 checking files
77 checking files
78 1 files, 4 changesets, 4 total revisions
78 checked 4 changesets with 4 changes to 1 files
79 3:93ee6ab32777
79 3:93ee6ab32777
80 searching for changes
80 searching for changes
81 2 changesets found
81 2 changesets found
82 adding changesets
82 adding changesets
83 adding manifests
83 adding manifests
84 adding file changes
84 adding file changes
85 added 2 changesets with 2 changes to 1 files
85 added 2 changesets with 2 changes to 1 files
86 new changesets bfaf4b5cbf01:c70afb1ee985 (2 drafts)
86 new changesets bfaf4b5cbf01:c70afb1ee985 (2 drafts)
87 (run 'hg update' to get a working copy)
87 (run 'hg update' to get a working copy)
88 checking changesets
88 checking changesets
89 checking manifests
89 checking manifests
90 crosschecking files in changesets and manifests
90 crosschecking files in changesets and manifests
91 checking files
91 checking files
92 1 files, 2 changesets, 2 total revisions
92 checked 2 changesets with 2 changes to 1 files
93 1:c70afb1ee985
93 1:c70afb1ee985
94 searching for changes
94 searching for changes
95 3 changesets found
95 3 changesets found
96 adding changesets
96 adding changesets
97 adding manifests
97 adding manifests
98 adding file changes
98 adding file changes
99 added 3 changesets with 3 changes to 1 files
99 added 3 changesets with 3 changes to 1 files
100 new changesets bfaf4b5cbf01:f03ae5a9b979 (3 drafts)
100 new changesets bfaf4b5cbf01:f03ae5a9b979 (3 drafts)
101 (run 'hg update' to get a working copy)
101 (run 'hg update' to get a working copy)
102 checking changesets
102 checking changesets
103 checking manifests
103 checking manifests
104 crosschecking files in changesets and manifests
104 crosschecking files in changesets and manifests
105 checking files
105 checking files
106 1 files, 3 changesets, 3 total revisions
106 checked 3 changesets with 3 changes to 1 files
107 2:f03ae5a9b979
107 2:f03ae5a9b979
108 searching for changes
108 searching for changes
109 4 changesets found
109 4 changesets found
110 adding changesets
110 adding changesets
111 adding manifests
111 adding manifests
112 adding file changes
112 adding file changes
113 added 4 changesets with 5 changes to 2 files
113 added 4 changesets with 5 changes to 2 files
114 new changesets bfaf4b5cbf01:095cb14b1b4d (4 drafts)
114 new changesets bfaf4b5cbf01:095cb14b1b4d (4 drafts)
115 (run 'hg update' to get a working copy)
115 (run 'hg update' to get a working copy)
116 checking changesets
116 checking changesets
117 checking manifests
117 checking manifests
118 crosschecking files in changesets and manifests
118 crosschecking files in changesets and manifests
119 checking files
119 checking files
120 2 files, 4 changesets, 5 total revisions
120 checked 4 changesets with 5 changes to 2 files
121 3:095cb14b1b4d
121 3:095cb14b1b4d
122 searching for changes
122 searching for changes
123 5 changesets found
123 5 changesets found
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 5 changesets with 6 changes to 3 files
127 added 5 changesets with 6 changes to 3 files
128 new changesets bfaf4b5cbf01:faa2e4234c7a (5 drafts)
128 new changesets bfaf4b5cbf01:faa2e4234c7a (5 drafts)
129 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
130 checking changesets
130 checking changesets
131 checking manifests
131 checking manifests
132 crosschecking files in changesets and manifests
132 crosschecking files in changesets and manifests
133 checking files
133 checking files
134 3 files, 5 changesets, 6 total revisions
134 checked 5 changesets with 6 changes to 3 files
135 4:faa2e4234c7a
135 4:faa2e4234c7a
136 searching for changes
136 searching for changes
137 5 changesets found
137 5 changesets found
138 adding changesets
138 adding changesets
139 adding manifests
139 adding manifests
140 adding file changes
140 adding file changes
141 added 5 changesets with 5 changes to 2 files
141 added 5 changesets with 5 changes to 2 files
142 new changesets bfaf4b5cbf01:916f1afdef90 (5 drafts)
142 new changesets bfaf4b5cbf01:916f1afdef90 (5 drafts)
143 (run 'hg update' to get a working copy)
143 (run 'hg update' to get a working copy)
144 checking changesets
144 checking changesets
145 checking manifests
145 checking manifests
146 crosschecking files in changesets and manifests
146 crosschecking files in changesets and manifests
147 checking files
147 checking files
148 2 files, 5 changesets, 5 total revisions
148 checked 5 changesets with 5 changes to 2 files
149 4:916f1afdef90
149 4:916f1afdef90
150 $ cd test-8
150 $ cd test-8
151 $ hg pull ../test-7
151 $ hg pull ../test-7
152 pulling from ../test-7
152 pulling from ../test-7
153 searching for changes
153 searching for changes
154 adding changesets
154 adding changesets
155 adding manifests
155 adding manifests
156 adding file changes
156 adding file changes
157 added 4 changesets with 2 changes to 3 files (+1 heads)
157 added 4 changesets with 2 changes to 3 files (+1 heads)
158 new changesets c70afb1ee985:faa2e4234c7a
158 new changesets c70afb1ee985:faa2e4234c7a
159 1 local changesets published
159 1 local changesets published
160 (run 'hg heads' to see heads, 'hg merge' to merge)
160 (run 'hg heads' to see heads, 'hg merge' to merge)
161 $ hg verify
161 $ hg verify
162 checking changesets
162 checking changesets
163 checking manifests
163 checking manifests
164 crosschecking files in changesets and manifests
164 crosschecking files in changesets and manifests
165 checking files
165 checking files
166 4 files, 9 changesets, 7 total revisions
166 checked 9 changesets with 7 changes to 4 files
167 $ hg rollback
167 $ hg rollback
168 repository tip rolled back to revision 4 (undo pull)
168 repository tip rolled back to revision 4 (undo pull)
169 $ cd ..
169 $ cd ..
170
170
171 should fail
171 should fail
172
172
173 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
173 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg test-3
174 abort: --base is incompatible with specifying a destination
174 abort: --base is incompatible with specifying a destination
175 [255]
175 [255]
176 $ hg -R test bundle -a -r tip test-bundle-branch1.hg test-3
176 $ hg -R test bundle -a -r tip test-bundle-branch1.hg test-3
177 abort: --all is incompatible with specifying a destination
177 abort: --all is incompatible with specifying a destination
178 [255]
178 [255]
179 $ hg -R test bundle -r tip test-bundle-branch1.hg
179 $ hg -R test bundle -r tip test-bundle-branch1.hg
180 abort: repository default-push not found!
180 abort: repository default-push not found!
181 [255]
181 [255]
182
182
183 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
183 $ hg -R test bundle --base 2 -r tip test-bundle-branch1.hg
184 2 changesets found
184 2 changesets found
185 $ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
185 $ hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
186 4 changesets found
186 4 changesets found
187 $ hg -R test bundle --base 2 test-bundle-all.hg
187 $ hg -R test bundle --base 2 test-bundle-all.hg
188 6 changesets found
188 6 changesets found
189 $ hg -R test bundle --base 2 --all test-bundle-all-2.hg
189 $ hg -R test bundle --base 2 --all test-bundle-all-2.hg
190 ignoring --base because --all was specified
190 ignoring --base because --all was specified
191 9 changesets found
191 9 changesets found
192 $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
192 $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
193 1 changesets found
193 1 changesets found
194
194
195 empty bundle
195 empty bundle
196
196
197 $ hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
197 $ hg -R test bundle --base 7 --base 8 test-bundle-empty.hg
198 no changes found
198 no changes found
199 [1]
199 [1]
200
200
201 issue76 msg2163
201 issue76 msg2163
202
202
203 $ hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
203 $ hg -R test bundle --base 3 -r 3 -r 3 test-bundle-cset-3.hg
204 no changes found
204 no changes found
205 [1]
205 [1]
206
206
207 Issue1910: 'hg bundle --base $head' does not exclude $head from
207 Issue1910: 'hg bundle --base $head' does not exclude $head from
208 result
208 result
209
209
210 $ hg -R test bundle --base 7 test-bundle-cset-7.hg
210 $ hg -R test bundle --base 7 test-bundle-cset-7.hg
211 4 changesets found
211 4 changesets found
212
212
213 $ hg clone test-2 test-9
213 $ hg clone test-2 test-9
214 updating to branch default
214 updating to branch default
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 $ cd test-9
216 $ cd test-9
217
217
218 revision 2
218 revision 2
219
219
220 $ hg tip -q
220 $ hg tip -q
221 2:4ce51a113780
221 2:4ce51a113780
222 $ hg unbundle ../test-bundle-should-fail.hg
222 $ hg unbundle ../test-bundle-should-fail.hg
223 adding changesets
223 adding changesets
224 transaction abort!
224 transaction abort!
225 rollback completed
225 rollback completed
226 abort: 00changelog.i@93ee6ab32777: unknown parent!
226 abort: 00changelog.i@93ee6ab32777: unknown parent!
227 [255]
227 [255]
228
228
229 revision 2
229 revision 2
230
230
231 $ hg tip -q
231 $ hg tip -q
232 2:4ce51a113780
232 2:4ce51a113780
233 $ hg unbundle ../test-bundle-all.hg
233 $ hg unbundle ../test-bundle-all.hg
234 adding changesets
234 adding changesets
235 adding manifests
235 adding manifests
236 adding file changes
236 adding file changes
237 added 6 changesets with 4 changes to 4 files (+1 heads)
237 added 6 changesets with 4 changes to 4 files (+1 heads)
238 new changesets 93ee6ab32777:916f1afdef90 (6 drafts)
238 new changesets 93ee6ab32777:916f1afdef90 (6 drafts)
239 (run 'hg heads' to see heads, 'hg merge' to merge)
239 (run 'hg heads' to see heads, 'hg merge' to merge)
240
240
241 revision 8
241 revision 8
242
242
243 $ hg tip -q
243 $ hg tip -q
244 8:916f1afdef90
244 8:916f1afdef90
245 $ hg verify
245 $ hg verify
246 checking changesets
246 checking changesets
247 checking manifests
247 checking manifests
248 crosschecking files in changesets and manifests
248 crosschecking files in changesets and manifests
249 checking files
249 checking files
250 4 files, 9 changesets, 7 total revisions
250 checked 9 changesets with 7 changes to 4 files
251 $ hg rollback
251 $ hg rollback
252 repository tip rolled back to revision 2 (undo unbundle)
252 repository tip rolled back to revision 2 (undo unbundle)
253
253
254 revision 2
254 revision 2
255
255
256 $ hg tip -q
256 $ hg tip -q
257 2:4ce51a113780
257 2:4ce51a113780
258 $ hg unbundle ../test-bundle-branch1.hg
258 $ hg unbundle ../test-bundle-branch1.hg
259 adding changesets
259 adding changesets
260 adding manifests
260 adding manifests
261 adding file changes
261 adding file changes
262 added 2 changesets with 2 changes to 2 files
262 added 2 changesets with 2 changes to 2 files
263 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
263 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
264 (run 'hg update' to get a working copy)
264 (run 'hg update' to get a working copy)
265
265
266 revision 4
266 revision 4
267
267
268 $ hg tip -q
268 $ hg tip -q
269 4:916f1afdef90
269 4:916f1afdef90
270 $ hg verify
270 $ hg verify
271 checking changesets
271 checking changesets
272 checking manifests
272 checking manifests
273 crosschecking files in changesets and manifests
273 crosschecking files in changesets and manifests
274 checking files
274 checking files
275 2 files, 5 changesets, 5 total revisions
275 checked 5 changesets with 5 changes to 2 files
276 $ hg rollback
276 $ hg rollback
277 repository tip rolled back to revision 2 (undo unbundle)
277 repository tip rolled back to revision 2 (undo unbundle)
278 $ hg unbundle ../test-bundle-branch2.hg
278 $ hg unbundle ../test-bundle-branch2.hg
279 adding changesets
279 adding changesets
280 adding manifests
280 adding manifests
281 adding file changes
281 adding file changes
282 added 4 changesets with 3 changes to 3 files (+1 heads)
282 added 4 changesets with 3 changes to 3 files (+1 heads)
283 new changesets c70afb1ee985:faa2e4234c7a (4 drafts)
283 new changesets c70afb1ee985:faa2e4234c7a (4 drafts)
284 (run 'hg heads' to see heads, 'hg merge' to merge)
284 (run 'hg heads' to see heads, 'hg merge' to merge)
285
285
286 revision 6
286 revision 6
287
287
288 $ hg tip -q
288 $ hg tip -q
289 6:faa2e4234c7a
289 6:faa2e4234c7a
290 $ hg verify
290 $ hg verify
291 checking changesets
291 checking changesets
292 checking manifests
292 checking manifests
293 crosschecking files in changesets and manifests
293 crosschecking files in changesets and manifests
294 checking files
294 checking files
295 3 files, 7 changesets, 6 total revisions
295 checked 7 changesets with 6 changes to 3 files
296 $ hg rollback
296 $ hg rollback
297 repository tip rolled back to revision 2 (undo unbundle)
297 repository tip rolled back to revision 2 (undo unbundle)
298 $ hg unbundle ../test-bundle-cset-7.hg
298 $ hg unbundle ../test-bundle-cset-7.hg
299 adding changesets
299 adding changesets
300 adding manifests
300 adding manifests
301 adding file changes
301 adding file changes
302 added 2 changesets with 2 changes to 2 files
302 added 2 changesets with 2 changes to 2 files
303 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
303 new changesets 93ee6ab32777:916f1afdef90 (2 drafts)
304 (run 'hg update' to get a working copy)
304 (run 'hg update' to get a working copy)
305
305
306 revision 4
306 revision 4
307
307
308 $ hg tip -q
308 $ hg tip -q
309 4:916f1afdef90
309 4:916f1afdef90
310 $ hg verify
310 $ hg verify
311 checking changesets
311 checking changesets
312 checking manifests
312 checking manifests
313 crosschecking files in changesets and manifests
313 crosschecking files in changesets and manifests
314 checking files
314 checking files
315 2 files, 5 changesets, 5 total revisions
315 checked 5 changesets with 5 changes to 2 files
316
316
317 $ cd ../test
317 $ cd ../test
318 $ hg merge 7
318 $ hg merge 7
319 note: possible conflict - afile was renamed multiple times to:
319 note: possible conflict - afile was renamed multiple times to:
320 anotherfile
320 anotherfile
321 adifferentfile
321 adifferentfile
322 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 (branch merge, don't forget to commit)
323 (branch merge, don't forget to commit)
324 $ hg ci -m merge
324 $ hg ci -m merge
325 $ cd ..
325 $ cd ..
326 $ hg -R test bundle --base 2 test-bundle-head.hg
326 $ hg -R test bundle --base 2 test-bundle-head.hg
327 7 changesets found
327 7 changesets found
328 $ hg clone test-2 test-10
328 $ hg clone test-2 test-10
329 updating to branch default
329 updating to branch default
330 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 $ cd test-10
331 $ cd test-10
332 $ hg unbundle ../test-bundle-head.hg
332 $ hg unbundle ../test-bundle-head.hg
333 adding changesets
333 adding changesets
334 adding manifests
334 adding manifests
335 adding file changes
335 adding file changes
336 added 7 changesets with 4 changes to 4 files
336 added 7 changesets with 4 changes to 4 files
337 new changesets 93ee6ab32777:03fc0b0e347c (7 drafts)
337 new changesets 93ee6ab32777:03fc0b0e347c (7 drafts)
338 (run 'hg update' to get a working copy)
338 (run 'hg update' to get a working copy)
339
339
340 revision 9
340 revision 9
341
341
342 $ hg tip -q
342 $ hg tip -q
343 9:03fc0b0e347c
343 9:03fc0b0e347c
344 $ hg verify
344 $ hg verify
345 checking changesets
345 checking changesets
346 checking manifests
346 checking manifests
347 crosschecking files in changesets and manifests
347 crosschecking files in changesets and manifests
348 checking files
348 checking files
349 4 files, 10 changesets, 7 total revisions
349 checked 10 changesets with 7 changes to 4 files
350
350
351 $ cd ..
351 $ cd ..
@@ -1,902 +1,902 b''
1 Setting up test
1 Setting up test
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo 0 > afile
5 $ echo 0 > afile
6 $ hg add afile
6 $ hg add afile
7 $ hg commit -m "0.0"
7 $ hg commit -m "0.0"
8 $ echo 1 >> afile
8 $ echo 1 >> afile
9 $ hg commit -m "0.1"
9 $ hg commit -m "0.1"
10 $ echo 2 >> afile
10 $ echo 2 >> afile
11 $ hg commit -m "0.2"
11 $ hg commit -m "0.2"
12 $ echo 3 >> afile
12 $ echo 3 >> afile
13 $ hg commit -m "0.3"
13 $ hg commit -m "0.3"
14 $ hg update -C 0
14 $ hg update -C 0
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo 1 >> afile
16 $ echo 1 >> afile
17 $ hg commit -m "1.1"
17 $ hg commit -m "1.1"
18 created new head
18 created new head
19 $ echo 2 >> afile
19 $ echo 2 >> afile
20 $ hg commit -m "1.2"
20 $ hg commit -m "1.2"
21 $ echo "a line" > fred
21 $ echo "a line" > fred
22 $ echo 3 >> afile
22 $ echo 3 >> afile
23 $ hg add fred
23 $ hg add fred
24 $ hg commit -m "1.3"
24 $ hg commit -m "1.3"
25 $ hg mv afile adifferentfile
25 $ hg mv afile adifferentfile
26 $ hg commit -m "1.3m"
26 $ hg commit -m "1.3m"
27 $ hg update -C 3
27 $ hg update -C 3
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 $ hg mv afile anotherfile
29 $ hg mv afile anotherfile
30 $ hg commit -m "0.3m"
30 $ hg commit -m "0.3m"
31 $ hg verify
31 $ hg verify
32 checking changesets
32 checking changesets
33 checking manifests
33 checking manifests
34 crosschecking files in changesets and manifests
34 crosschecking files in changesets and manifests
35 checking files
35 checking files
36 4 files, 9 changesets, 7 total revisions
36 checked 9 changesets with 7 changes to 4 files
37 $ cd ..
37 $ cd ..
38 $ hg init empty
38 $ hg init empty
39
39
40 Bundle and phase
40 Bundle and phase
41
41
42 $ hg -R test phase --force --secret 0
42 $ hg -R test phase --force --secret 0
43 $ hg -R test bundle phase.hg empty
43 $ hg -R test bundle phase.hg empty
44 searching for changes
44 searching for changes
45 no changes found (ignored 9 secret changesets)
45 no changes found (ignored 9 secret changesets)
46 [1]
46 [1]
47 $ hg -R test phase --draft -r 'head()'
47 $ hg -R test phase --draft -r 'head()'
48
48
49 Bundle --all
49 Bundle --all
50
50
51 $ hg -R test bundle --all all.hg
51 $ hg -R test bundle --all all.hg
52 9 changesets found
52 9 changesets found
53
53
54 Bundle test to full.hg
54 Bundle test to full.hg
55
55
56 $ hg -R test bundle full.hg empty
56 $ hg -R test bundle full.hg empty
57 searching for changes
57 searching for changes
58 9 changesets found
58 9 changesets found
59
59
60 Unbundle full.hg in test
60 Unbundle full.hg in test
61
61
62 $ hg -R test unbundle full.hg
62 $ hg -R test unbundle full.hg
63 adding changesets
63 adding changesets
64 adding manifests
64 adding manifests
65 adding file changes
65 adding file changes
66 added 0 changesets with 0 changes to 4 files
66 added 0 changesets with 0 changes to 4 files
67 (run 'hg update' to get a working copy)
67 (run 'hg update' to get a working copy)
68
68
69 Verify empty
69 Verify empty
70
70
71 $ hg -R empty heads
71 $ hg -R empty heads
72 [1]
72 [1]
73 $ hg -R empty verify
73 $ hg -R empty verify
74 checking changesets
74 checking changesets
75 checking manifests
75 checking manifests
76 crosschecking files in changesets and manifests
76 crosschecking files in changesets and manifests
77 checking files
77 checking files
78 0 files, 0 changesets, 0 total revisions
78 checked 0 changesets with 0 changes to 0 files
79
79
80 #if repobundlerepo
80 #if repobundlerepo
81
81
82 Pull full.hg into test (using --cwd)
82 Pull full.hg into test (using --cwd)
83
83
84 $ hg --cwd test pull ../full.hg
84 $ hg --cwd test pull ../full.hg
85 pulling from ../full.hg
85 pulling from ../full.hg
86 searching for changes
86 searching for changes
87 no changes found
87 no changes found
88
88
89 Verify that there are no leaked temporary files after pull (issue2797)
89 Verify that there are no leaked temporary files after pull (issue2797)
90
90
91 $ ls test/.hg | grep .hg10un
91 $ ls test/.hg | grep .hg10un
92 [1]
92 [1]
93
93
94 Pull full.hg into empty (using --cwd)
94 Pull full.hg into empty (using --cwd)
95
95
96 $ hg --cwd empty pull ../full.hg
96 $ hg --cwd empty pull ../full.hg
97 pulling from ../full.hg
97 pulling from ../full.hg
98 requesting all changes
98 requesting all changes
99 adding changesets
99 adding changesets
100 adding manifests
100 adding manifests
101 adding file changes
101 adding file changes
102 added 9 changesets with 7 changes to 4 files (+1 heads)
102 added 9 changesets with 7 changes to 4 files (+1 heads)
103 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
103 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
104 (run 'hg heads' to see heads, 'hg merge' to merge)
104 (run 'hg heads' to see heads, 'hg merge' to merge)
105
105
106 Rollback empty
106 Rollback empty
107
107
108 $ hg -R empty rollback
108 $ hg -R empty rollback
109 repository tip rolled back to revision -1 (undo pull)
109 repository tip rolled back to revision -1 (undo pull)
110
110
111 Pull full.hg into empty again (using --cwd)
111 Pull full.hg into empty again (using --cwd)
112
112
113 $ hg --cwd empty pull ../full.hg
113 $ hg --cwd empty pull ../full.hg
114 pulling from ../full.hg
114 pulling from ../full.hg
115 requesting all changes
115 requesting all changes
116 adding changesets
116 adding changesets
117 adding manifests
117 adding manifests
118 adding file changes
118 adding file changes
119 added 9 changesets with 7 changes to 4 files (+1 heads)
119 added 9 changesets with 7 changes to 4 files (+1 heads)
120 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
120 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
121 (run 'hg heads' to see heads, 'hg merge' to merge)
121 (run 'hg heads' to see heads, 'hg merge' to merge)
122
122
123 Pull full.hg into test (using -R)
123 Pull full.hg into test (using -R)
124
124
125 $ hg -R test pull full.hg
125 $ hg -R test pull full.hg
126 pulling from full.hg
126 pulling from full.hg
127 searching for changes
127 searching for changes
128 no changes found
128 no changes found
129
129
130 Pull full.hg into empty (using -R)
130 Pull full.hg into empty (using -R)
131
131
132 $ hg -R empty pull full.hg
132 $ hg -R empty pull full.hg
133 pulling from full.hg
133 pulling from full.hg
134 searching for changes
134 searching for changes
135 no changes found
135 no changes found
136
136
137 Rollback empty
137 Rollback empty
138
138
139 $ hg -R empty rollback
139 $ hg -R empty rollback
140 repository tip rolled back to revision -1 (undo pull)
140 repository tip rolled back to revision -1 (undo pull)
141
141
142 Pull full.hg into empty again (using -R)
142 Pull full.hg into empty again (using -R)
143
143
144 $ hg -R empty pull full.hg
144 $ hg -R empty pull full.hg
145 pulling from full.hg
145 pulling from full.hg
146 requesting all changes
146 requesting all changes
147 adding changesets
147 adding changesets
148 adding manifests
148 adding manifests
149 adding file changes
149 adding file changes
150 added 9 changesets with 7 changes to 4 files (+1 heads)
150 added 9 changesets with 7 changes to 4 files (+1 heads)
151 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
151 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
153
153
154 Log -R full.hg in fresh empty
154 Log -R full.hg in fresh empty
155
155
156 $ rm -r empty
156 $ rm -r empty
157 $ hg init empty
157 $ hg init empty
158 $ cd empty
158 $ cd empty
159 $ hg -R bundle://../full.hg log
159 $ hg -R bundle://../full.hg log
160 changeset: 8:aa35859c02ea
160 changeset: 8:aa35859c02ea
161 tag: tip
161 tag: tip
162 parent: 3:eebf5a27f8ca
162 parent: 3:eebf5a27f8ca
163 user: test
163 user: test
164 date: Thu Jan 01 00:00:00 1970 +0000
164 date: Thu Jan 01 00:00:00 1970 +0000
165 summary: 0.3m
165 summary: 0.3m
166
166
167 changeset: 7:a6a34bfa0076
167 changeset: 7:a6a34bfa0076
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: 1.3m
170 summary: 1.3m
171
171
172 changeset: 6:7373c1169842
172 changeset: 6:7373c1169842
173 user: test
173 user: test
174 date: Thu Jan 01 00:00:00 1970 +0000
174 date: Thu Jan 01 00:00:00 1970 +0000
175 summary: 1.3
175 summary: 1.3
176
176
177 changeset: 5:1bb50a9436a7
177 changeset: 5:1bb50a9436a7
178 user: test
178 user: test
179 date: Thu Jan 01 00:00:00 1970 +0000
179 date: Thu Jan 01 00:00:00 1970 +0000
180 summary: 1.2
180 summary: 1.2
181
181
182 changeset: 4:095197eb4973
182 changeset: 4:095197eb4973
183 parent: 0:f9ee2f85a263
183 parent: 0:f9ee2f85a263
184 user: test
184 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: 1.1
186 summary: 1.1
187
187
188 changeset: 3:eebf5a27f8ca
188 changeset: 3:eebf5a27f8ca
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: 0.3
191 summary: 0.3
192
192
193 changeset: 2:e38ba6f5b7e0
193 changeset: 2:e38ba6f5b7e0
194 user: test
194 user: test
195 date: Thu Jan 01 00:00:00 1970 +0000
195 date: Thu Jan 01 00:00:00 1970 +0000
196 summary: 0.2
196 summary: 0.2
197
197
198 changeset: 1:34c2bf6b0626
198 changeset: 1:34c2bf6b0626
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: 0.1
201 summary: 0.1
202
202
203 changeset: 0:f9ee2f85a263
203 changeset: 0:f9ee2f85a263
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: 0.0
206 summary: 0.0
207
207
208 Make sure bundlerepo doesn't leak tempfiles (issue2491)
208 Make sure bundlerepo doesn't leak tempfiles (issue2491)
209
209
210 $ ls .hg
210 $ ls .hg
211 00changelog.i
211 00changelog.i
212 cache
212 cache
213 requires
213 requires
214 store
214 store
215
215
216 Pull ../full.hg into empty (with hook)
216 Pull ../full.hg into empty (with hook)
217
217
218 $ cat >> .hg/hgrc <<EOF
218 $ cat >> .hg/hgrc <<EOF
219 > [hooks]
219 > [hooks]
220 > changegroup = sh -c "printenv.py changegroup"
220 > changegroup = sh -c "printenv.py changegroup"
221 > EOF
221 > EOF
222
222
223 doesn't work (yet ?)
223 doesn't work (yet ?)
224
224
225 hg -R bundle://../full.hg verify
225 hg -R bundle://../full.hg verify
226
226
227 $ hg pull bundle://../full.hg
227 $ hg pull bundle://../full.hg
228 pulling from bundle:../full.hg
228 pulling from bundle:../full.hg
229 requesting all changes
229 requesting all changes
230 adding changesets
230 adding changesets
231 adding manifests
231 adding manifests
232 adding file changes
232 adding file changes
233 added 9 changesets with 7 changes to 4 files (+1 heads)
233 added 9 changesets with 7 changes to 4 files (+1 heads)
234 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
234 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
235 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle*../full.hg (glob)
235 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle*../full.hg (glob)
236 (run 'hg heads' to see heads, 'hg merge' to merge)
236 (run 'hg heads' to see heads, 'hg merge' to merge)
237
237
238 Rollback empty
238 Rollback empty
239
239
240 $ hg rollback
240 $ hg rollback
241 repository tip rolled back to revision -1 (undo pull)
241 repository tip rolled back to revision -1 (undo pull)
242 $ cd ..
242 $ cd ..
243
243
244 Log -R bundle:empty+full.hg
244 Log -R bundle:empty+full.hg
245
245
246 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
246 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
247 8 7 6 5 4 3 2 1 0
247 8 7 6 5 4 3 2 1 0
248
248
249 Pull full.hg into empty again (using -R; with hook)
249 Pull full.hg into empty again (using -R; with hook)
250
250
251 $ hg -R empty pull full.hg
251 $ hg -R empty pull full.hg
252 pulling from full.hg
252 pulling from full.hg
253 requesting all changes
253 requesting all changes
254 adding changesets
254 adding changesets
255 adding manifests
255 adding manifests
256 adding file changes
256 adding file changes
257 added 9 changesets with 7 changes to 4 files (+1 heads)
257 added 9 changesets with 7 changes to 4 files (+1 heads)
258 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
258 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
259 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:empty+full.hg
259 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:empty+full.hg
260 (run 'hg heads' to see heads, 'hg merge' to merge)
260 (run 'hg heads' to see heads, 'hg merge' to merge)
261
261
262 #endif
262 #endif
263
263
264 Cannot produce streaming clone bundles with "hg bundle"
264 Cannot produce streaming clone bundles with "hg bundle"
265
265
266 $ hg -R test bundle -t packed1 packed.hg
266 $ hg -R test bundle -t packed1 packed.hg
267 abort: packed bundles cannot be produced by "hg bundle"
267 abort: packed bundles cannot be produced by "hg bundle"
268 (use 'hg debugcreatestreamclonebundle')
268 (use 'hg debugcreatestreamclonebundle')
269 [255]
269 [255]
270
270
271 packed1 is produced properly
271 packed1 is produced properly
272
272
273 #if reporevlogstore
273 #if reporevlogstore
274
274
275 $ hg -R test debugcreatestreamclonebundle packed.hg
275 $ hg -R test debugcreatestreamclonebundle packed.hg
276 writing 2664 bytes for 6 files
276 writing 2664 bytes for 6 files
277 bundle requirements: generaldelta, revlogv1
277 bundle requirements: generaldelta, revlogv1
278
278
279 $ f -B 64 --size --sha1 --hexdump packed.hg
279 $ f -B 64 --size --sha1 --hexdump packed.hg
280 packed.hg: size=2827, sha1=9d14cb90c66a21462d915ab33656f38b9deed686
280 packed.hg: size=2827, sha1=9d14cb90c66a21462d915ab33656f38b9deed686
281 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
281 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
282 0010: 00 00 00 00 0a 68 00 16 67 65 6e 65 72 61 6c 64 |.....h..generald|
282 0010: 00 00 00 00 0a 68 00 16 67 65 6e 65 72 61 6c 64 |.....h..generald|
283 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
283 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 00 64 61 |elta,revlogv1.da|
284 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil|
284 0030: 74 61 2f 61 64 69 66 66 65 72 65 6e 74 66 69 6c |ta/adifferentfil|
285
285
286 $ hg debugbundle --spec packed.hg
286 $ hg debugbundle --spec packed.hg
287 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1
287 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1
288
288
289 generaldelta requirement is not listed in stream clone bundles unless used
289 generaldelta requirement is not listed in stream clone bundles unless used
290
290
291 $ hg --config format.usegeneraldelta=false init testnongd
291 $ hg --config format.usegeneraldelta=false init testnongd
292 $ cd testnongd
292 $ cd testnongd
293 $ touch foo
293 $ touch foo
294 $ hg -q commit -A -m initial
294 $ hg -q commit -A -m initial
295 $ cd ..
295 $ cd ..
296 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
296 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
297 writing 301 bytes for 3 files
297 writing 301 bytes for 3 files
298 bundle requirements: revlogv1
298 bundle requirements: revlogv1
299
299
300 $ f -B 64 --size --sha1 --hexdump packednongd.hg
300 $ f -B 64 --size --sha1 --hexdump packednongd.hg
301 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
301 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
302 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
302 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
303 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
303 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
304 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
304 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
305 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
305 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
306
306
307 $ hg debugbundle --spec packednongd.hg
307 $ hg debugbundle --spec packednongd.hg
308 none-packed1;requirements%3Drevlogv1
308 none-packed1;requirements%3Drevlogv1
309
309
310 Warning emitted when packed bundles contain secret changesets
310 Warning emitted when packed bundles contain secret changesets
311
311
312 $ hg init testsecret
312 $ hg init testsecret
313 $ cd testsecret
313 $ cd testsecret
314 $ touch foo
314 $ touch foo
315 $ hg -q commit -A -m initial
315 $ hg -q commit -A -m initial
316 $ hg phase --force --secret -r .
316 $ hg phase --force --secret -r .
317 $ cd ..
317 $ cd ..
318
318
319 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
319 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
320 (warning: stream clone bundle will contain secret revisions)
320 (warning: stream clone bundle will contain secret revisions)
321 writing 301 bytes for 3 files
321 writing 301 bytes for 3 files
322 bundle requirements: generaldelta, revlogv1
322 bundle requirements: generaldelta, revlogv1
323
323
324 Unpacking packed1 bundles with "hg unbundle" isn't allowed
324 Unpacking packed1 bundles with "hg unbundle" isn't allowed
325
325
326 $ hg init packed
326 $ hg init packed
327 $ hg -R packed unbundle packed.hg
327 $ hg -R packed unbundle packed.hg
328 abort: packed bundles cannot be applied with "hg unbundle"
328 abort: packed bundles cannot be applied with "hg unbundle"
329 (use "hg debugapplystreamclonebundle")
329 (use "hg debugapplystreamclonebundle")
330 [255]
330 [255]
331
331
332 packed1 can be consumed from debug command
332 packed1 can be consumed from debug command
333
333
334 (this also confirms that streamclone-ed changes are visible via
334 (this also confirms that streamclone-ed changes are visible via
335 @filecache properties to in-process procedures before closing
335 @filecache properties to in-process procedures before closing
336 transaction)
336 transaction)
337
337
338 $ cat > $TESTTMP/showtip.py <<EOF
338 $ cat > $TESTTMP/showtip.py <<EOF
339 > from __future__ import absolute_import
339 > from __future__ import absolute_import
340 >
340 >
341 > def showtip(ui, repo, hooktype, **kwargs):
341 > def showtip(ui, repo, hooktype, **kwargs):
342 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
342 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
343 >
343 >
344 > def reposetup(ui, repo):
344 > def reposetup(ui, repo):
345 > # this confirms (and ensures) that (empty) 00changelog.i
345 > # this confirms (and ensures) that (empty) 00changelog.i
346 > # before streamclone is already cached as repo.changelog
346 > # before streamclone is already cached as repo.changelog
347 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
347 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
348 >
348 >
349 > # this confirms that streamclone-ed changes are visible to
349 > # this confirms that streamclone-ed changes are visible to
350 > # in-process procedures before closing transaction
350 > # in-process procedures before closing transaction
351 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
351 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
352 >
352 >
353 > # this confirms that streamclone-ed changes are still visible
353 > # this confirms that streamclone-ed changes are still visible
354 > # after closing transaction
354 > # after closing transaction
355 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
355 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
356 > EOF
356 > EOF
357 $ cat >> $HGRCPATH <<EOF
357 $ cat >> $HGRCPATH <<EOF
358 > [extensions]
358 > [extensions]
359 > showtip = $TESTTMP/showtip.py
359 > showtip = $TESTTMP/showtip.py
360 > EOF
360 > EOF
361
361
362 $ hg -R packed debugapplystreamclonebundle packed.hg
362 $ hg -R packed debugapplystreamclonebundle packed.hg
363 6 files to transfer, 2.60 KB of data
363 6 files to transfer, 2.60 KB of data
364 pretxnopen: 000000000000
364 pretxnopen: 000000000000
365 pretxnclose: aa35859c02ea
365 pretxnclose: aa35859c02ea
366 transferred 2.60 KB in *.* seconds (* */sec) (glob)
366 transferred 2.60 KB in *.* seconds (* */sec) (glob)
367 txnclose: aa35859c02ea
367 txnclose: aa35859c02ea
368
368
369 (for safety, confirm visibility of streamclone-ed changes by another
369 (for safety, confirm visibility of streamclone-ed changes by another
370 process, too)
370 process, too)
371
371
372 $ hg -R packed tip -T "{node|short}\n"
372 $ hg -R packed tip -T "{node|short}\n"
373 aa35859c02ea
373 aa35859c02ea
374
374
375 $ cat >> $HGRCPATH <<EOF
375 $ cat >> $HGRCPATH <<EOF
376 > [extensions]
376 > [extensions]
377 > showtip = !
377 > showtip = !
378 > EOF
378 > EOF
379
379
380 Does not work on non-empty repo
380 Does not work on non-empty repo
381
381
382 $ hg -R packed debugapplystreamclonebundle packed.hg
382 $ hg -R packed debugapplystreamclonebundle packed.hg
383 abort: cannot apply stream clone bundle on non-empty repo
383 abort: cannot apply stream clone bundle on non-empty repo
384 [255]
384 [255]
385
385
386 #endif
386 #endif
387
387
388 Create partial clones
388 Create partial clones
389
389
390 $ rm -r empty
390 $ rm -r empty
391 $ hg init empty
391 $ hg init empty
392 $ hg clone -r 3 test partial
392 $ hg clone -r 3 test partial
393 adding changesets
393 adding changesets
394 adding manifests
394 adding manifests
395 adding file changes
395 adding file changes
396 added 4 changesets with 4 changes to 1 files
396 added 4 changesets with 4 changes to 1 files
397 new changesets f9ee2f85a263:eebf5a27f8ca
397 new changesets f9ee2f85a263:eebf5a27f8ca
398 updating to branch default
398 updating to branch default
399 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
399 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
400 $ hg clone partial partial2
400 $ hg clone partial partial2
401 updating to branch default
401 updating to branch default
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
403 $ cd partial
403 $ cd partial
404
404
405 #if repobundlerepo
405 #if repobundlerepo
406
406
407 Log -R full.hg in partial
407 Log -R full.hg in partial
408
408
409 $ hg -R bundle://../full.hg log -T phases
409 $ hg -R bundle://../full.hg log -T phases
410 changeset: 8:aa35859c02ea
410 changeset: 8:aa35859c02ea
411 tag: tip
411 tag: tip
412 phase: draft
412 phase: draft
413 parent: 3:eebf5a27f8ca
413 parent: 3:eebf5a27f8ca
414 user: test
414 user: test
415 date: Thu Jan 01 00:00:00 1970 +0000
415 date: Thu Jan 01 00:00:00 1970 +0000
416 summary: 0.3m
416 summary: 0.3m
417
417
418 changeset: 7:a6a34bfa0076
418 changeset: 7:a6a34bfa0076
419 phase: draft
419 phase: draft
420 user: test
420 user: test
421 date: Thu Jan 01 00:00:00 1970 +0000
421 date: Thu Jan 01 00:00:00 1970 +0000
422 summary: 1.3m
422 summary: 1.3m
423
423
424 changeset: 6:7373c1169842
424 changeset: 6:7373c1169842
425 phase: draft
425 phase: draft
426 user: test
426 user: test
427 date: Thu Jan 01 00:00:00 1970 +0000
427 date: Thu Jan 01 00:00:00 1970 +0000
428 summary: 1.3
428 summary: 1.3
429
429
430 changeset: 5:1bb50a9436a7
430 changeset: 5:1bb50a9436a7
431 phase: draft
431 phase: draft
432 user: test
432 user: test
433 date: Thu Jan 01 00:00:00 1970 +0000
433 date: Thu Jan 01 00:00:00 1970 +0000
434 summary: 1.2
434 summary: 1.2
435
435
436 changeset: 4:095197eb4973
436 changeset: 4:095197eb4973
437 phase: draft
437 phase: draft
438 parent: 0:f9ee2f85a263
438 parent: 0:f9ee2f85a263
439 user: test
439 user: test
440 date: Thu Jan 01 00:00:00 1970 +0000
440 date: Thu Jan 01 00:00:00 1970 +0000
441 summary: 1.1
441 summary: 1.1
442
442
443 changeset: 3:eebf5a27f8ca
443 changeset: 3:eebf5a27f8ca
444 phase: public
444 phase: public
445 user: test
445 user: test
446 date: Thu Jan 01 00:00:00 1970 +0000
446 date: Thu Jan 01 00:00:00 1970 +0000
447 summary: 0.3
447 summary: 0.3
448
448
449 changeset: 2:e38ba6f5b7e0
449 changeset: 2:e38ba6f5b7e0
450 phase: public
450 phase: public
451 user: test
451 user: test
452 date: Thu Jan 01 00:00:00 1970 +0000
452 date: Thu Jan 01 00:00:00 1970 +0000
453 summary: 0.2
453 summary: 0.2
454
454
455 changeset: 1:34c2bf6b0626
455 changeset: 1:34c2bf6b0626
456 phase: public
456 phase: public
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 summary: 0.1
459 summary: 0.1
460
460
461 changeset: 0:f9ee2f85a263
461 changeset: 0:f9ee2f85a263
462 phase: public
462 phase: public
463 user: test
463 user: test
464 date: Thu Jan 01 00:00:00 1970 +0000
464 date: Thu Jan 01 00:00:00 1970 +0000
465 summary: 0.0
465 summary: 0.0
466
466
467
467
468 Incoming full.hg in partial
468 Incoming full.hg in partial
469
469
470 $ hg incoming bundle://../full.hg
470 $ hg incoming bundle://../full.hg
471 comparing with bundle:../full.hg
471 comparing with bundle:../full.hg
472 searching for changes
472 searching for changes
473 changeset: 4:095197eb4973
473 changeset: 4:095197eb4973
474 parent: 0:f9ee2f85a263
474 parent: 0:f9ee2f85a263
475 user: test
475 user: test
476 date: Thu Jan 01 00:00:00 1970 +0000
476 date: Thu Jan 01 00:00:00 1970 +0000
477 summary: 1.1
477 summary: 1.1
478
478
479 changeset: 5:1bb50a9436a7
479 changeset: 5:1bb50a9436a7
480 user: test
480 user: test
481 date: Thu Jan 01 00:00:00 1970 +0000
481 date: Thu Jan 01 00:00:00 1970 +0000
482 summary: 1.2
482 summary: 1.2
483
483
484 changeset: 6:7373c1169842
484 changeset: 6:7373c1169842
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: 1.3
487 summary: 1.3
488
488
489 changeset: 7:a6a34bfa0076
489 changeset: 7:a6a34bfa0076
490 user: test
490 user: test
491 date: Thu Jan 01 00:00:00 1970 +0000
491 date: Thu Jan 01 00:00:00 1970 +0000
492 summary: 1.3m
492 summary: 1.3m
493
493
494 changeset: 8:aa35859c02ea
494 changeset: 8:aa35859c02ea
495 tag: tip
495 tag: tip
496 parent: 3:eebf5a27f8ca
496 parent: 3:eebf5a27f8ca
497 user: test
497 user: test
498 date: Thu Jan 01 00:00:00 1970 +0000
498 date: Thu Jan 01 00:00:00 1970 +0000
499 summary: 0.3m
499 summary: 0.3m
500
500
501
501
502 Outgoing -R full.hg vs partial2 in partial
502 Outgoing -R full.hg vs partial2 in partial
503
503
504 $ hg -R bundle://../full.hg outgoing ../partial2
504 $ hg -R bundle://../full.hg outgoing ../partial2
505 comparing with ../partial2
505 comparing with ../partial2
506 searching for changes
506 searching for changes
507 changeset: 4:095197eb4973
507 changeset: 4:095197eb4973
508 parent: 0:f9ee2f85a263
508 parent: 0:f9ee2f85a263
509 user: test
509 user: test
510 date: Thu Jan 01 00:00:00 1970 +0000
510 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: 1.1
511 summary: 1.1
512
512
513 changeset: 5:1bb50a9436a7
513 changeset: 5:1bb50a9436a7
514 user: test
514 user: test
515 date: Thu Jan 01 00:00:00 1970 +0000
515 date: Thu Jan 01 00:00:00 1970 +0000
516 summary: 1.2
516 summary: 1.2
517
517
518 changeset: 6:7373c1169842
518 changeset: 6:7373c1169842
519 user: test
519 user: test
520 date: Thu Jan 01 00:00:00 1970 +0000
520 date: Thu Jan 01 00:00:00 1970 +0000
521 summary: 1.3
521 summary: 1.3
522
522
523 changeset: 7:a6a34bfa0076
523 changeset: 7:a6a34bfa0076
524 user: test
524 user: test
525 date: Thu Jan 01 00:00:00 1970 +0000
525 date: Thu Jan 01 00:00:00 1970 +0000
526 summary: 1.3m
526 summary: 1.3m
527
527
528 changeset: 8:aa35859c02ea
528 changeset: 8:aa35859c02ea
529 tag: tip
529 tag: tip
530 parent: 3:eebf5a27f8ca
530 parent: 3:eebf5a27f8ca
531 user: test
531 user: test
532 date: Thu Jan 01 00:00:00 1970 +0000
532 date: Thu Jan 01 00:00:00 1970 +0000
533 summary: 0.3m
533 summary: 0.3m
534
534
535
535
536 Outgoing -R does-not-exist.hg vs partial2 in partial
536 Outgoing -R does-not-exist.hg vs partial2 in partial
537
537
538 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
538 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
539 abort: *../does-not-exist.hg* (glob)
539 abort: *../does-not-exist.hg* (glob)
540 [255]
540 [255]
541
541
542 #endif
542 #endif
543
543
544 $ cd ..
544 $ cd ..
545
545
546 hide outer repo
546 hide outer repo
547 $ hg init
547 $ hg init
548
548
549 Direct clone from bundle (all-history)
549 Direct clone from bundle (all-history)
550
550
551 #if repobundlerepo
551 #if repobundlerepo
552
552
553 $ hg clone full.hg full-clone
553 $ hg clone full.hg full-clone
554 requesting all changes
554 requesting all changes
555 adding changesets
555 adding changesets
556 adding manifests
556 adding manifests
557 adding file changes
557 adding file changes
558 added 9 changesets with 7 changes to 4 files (+1 heads)
558 added 9 changesets with 7 changes to 4 files (+1 heads)
559 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
559 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
560 updating to branch default
560 updating to branch default
561 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
561 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
562 $ hg -R full-clone heads
562 $ hg -R full-clone heads
563 changeset: 8:aa35859c02ea
563 changeset: 8:aa35859c02ea
564 tag: tip
564 tag: tip
565 parent: 3:eebf5a27f8ca
565 parent: 3:eebf5a27f8ca
566 user: test
566 user: test
567 date: Thu Jan 01 00:00:00 1970 +0000
567 date: Thu Jan 01 00:00:00 1970 +0000
568 summary: 0.3m
568 summary: 0.3m
569
569
570 changeset: 7:a6a34bfa0076
570 changeset: 7:a6a34bfa0076
571 user: test
571 user: test
572 date: Thu Jan 01 00:00:00 1970 +0000
572 date: Thu Jan 01 00:00:00 1970 +0000
573 summary: 1.3m
573 summary: 1.3m
574
574
575 $ rm -r full-clone
575 $ rm -r full-clone
576
576
577 When cloning from a non-copiable repository into '', do not
577 When cloning from a non-copiable repository into '', do not
578 recurse infinitely (issue2528)
578 recurse infinitely (issue2528)
579
579
580 $ hg clone full.hg ''
580 $ hg clone full.hg ''
581 abort: empty destination path is not valid
581 abort: empty destination path is not valid
582 [255]
582 [255]
583
583
584 test for https://bz.mercurial-scm.org/216
584 test for https://bz.mercurial-scm.org/216
585
585
586 Unbundle incremental bundles into fresh empty in one go
586 Unbundle incremental bundles into fresh empty in one go
587
587
588 $ rm -r empty
588 $ rm -r empty
589 $ hg init empty
589 $ hg init empty
590 $ hg -R test bundle --base null -r 0 ../0.hg
590 $ hg -R test bundle --base null -r 0 ../0.hg
591 1 changesets found
591 1 changesets found
592 $ hg -R test bundle --base 0 -r 1 ../1.hg
592 $ hg -R test bundle --base 0 -r 1 ../1.hg
593 1 changesets found
593 1 changesets found
594 $ hg -R empty unbundle -u ../0.hg ../1.hg
594 $ hg -R empty unbundle -u ../0.hg ../1.hg
595 adding changesets
595 adding changesets
596 adding manifests
596 adding manifests
597 adding file changes
597 adding file changes
598 added 1 changesets with 1 changes to 1 files
598 added 1 changesets with 1 changes to 1 files
599 new changesets f9ee2f85a263 (1 drafts)
599 new changesets f9ee2f85a263 (1 drafts)
600 adding changesets
600 adding changesets
601 adding manifests
601 adding manifests
602 adding file changes
602 adding file changes
603 added 1 changesets with 1 changes to 1 files
603 added 1 changesets with 1 changes to 1 files
604 new changesets 34c2bf6b0626 (1 drafts)
604 new changesets 34c2bf6b0626 (1 drafts)
605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
606
606
607 View full contents of the bundle
607 View full contents of the bundle
608 $ hg -R test bundle --base null -r 3 ../partial.hg
608 $ hg -R test bundle --base null -r 3 ../partial.hg
609 4 changesets found
609 4 changesets found
610 $ cd test
610 $ cd test
611 $ hg -R ../../partial.hg log -r "bundle()"
611 $ hg -R ../../partial.hg log -r "bundle()"
612 changeset: 0:f9ee2f85a263
612 changeset: 0:f9ee2f85a263
613 user: test
613 user: test
614 date: Thu Jan 01 00:00:00 1970 +0000
614 date: Thu Jan 01 00:00:00 1970 +0000
615 summary: 0.0
615 summary: 0.0
616
616
617 changeset: 1:34c2bf6b0626
617 changeset: 1:34c2bf6b0626
618 user: test
618 user: test
619 date: Thu Jan 01 00:00:00 1970 +0000
619 date: Thu Jan 01 00:00:00 1970 +0000
620 summary: 0.1
620 summary: 0.1
621
621
622 changeset: 2:e38ba6f5b7e0
622 changeset: 2:e38ba6f5b7e0
623 user: test
623 user: test
624 date: Thu Jan 01 00:00:00 1970 +0000
624 date: Thu Jan 01 00:00:00 1970 +0000
625 summary: 0.2
625 summary: 0.2
626
626
627 changeset: 3:eebf5a27f8ca
627 changeset: 3:eebf5a27f8ca
628 user: test
628 user: test
629 date: Thu Jan 01 00:00:00 1970 +0000
629 date: Thu Jan 01 00:00:00 1970 +0000
630 summary: 0.3
630 summary: 0.3
631
631
632 $ cd ..
632 $ cd ..
633
633
634 #endif
634 #endif
635
635
636 test for 540d1059c802
636 test for 540d1059c802
637
637
638 $ hg init orig
638 $ hg init orig
639 $ cd orig
639 $ cd orig
640 $ echo foo > foo
640 $ echo foo > foo
641 $ hg add foo
641 $ hg add foo
642 $ hg ci -m 'add foo'
642 $ hg ci -m 'add foo'
643
643
644 $ hg clone . ../copy
644 $ hg clone . ../copy
645 updating to branch default
645 updating to branch default
646 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
646 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
647 $ hg tag foo
647 $ hg tag foo
648
648
649 $ cd ../copy
649 $ cd ../copy
650 $ echo >> foo
650 $ echo >> foo
651 $ hg ci -m 'change foo'
651 $ hg ci -m 'change foo'
652 $ hg bundle ../bundle.hg ../orig
652 $ hg bundle ../bundle.hg ../orig
653 searching for changes
653 searching for changes
654 1 changesets found
654 1 changesets found
655
655
656 $ cd ..
656 $ cd ..
657
657
658 #if repobundlerepo
658 #if repobundlerepo
659 $ cd orig
659 $ cd orig
660 $ hg incoming ../bundle.hg
660 $ hg incoming ../bundle.hg
661 comparing with ../bundle.hg
661 comparing with ../bundle.hg
662 searching for changes
662 searching for changes
663 changeset: 2:ed1b79f46b9a
663 changeset: 2:ed1b79f46b9a
664 tag: tip
664 tag: tip
665 parent: 0:bbd179dfa0a7
665 parent: 0:bbd179dfa0a7
666 user: test
666 user: test
667 date: Thu Jan 01 00:00:00 1970 +0000
667 date: Thu Jan 01 00:00:00 1970 +0000
668 summary: change foo
668 summary: change foo
669
669
670 $ cd ..
670 $ cd ..
671
671
672 test bundle with # in the filename (issue2154):
672 test bundle with # in the filename (issue2154):
673
673
674 $ cp bundle.hg 'test#bundle.hg'
674 $ cp bundle.hg 'test#bundle.hg'
675 $ cd orig
675 $ cd orig
676 $ hg incoming '../test#bundle.hg'
676 $ hg incoming '../test#bundle.hg'
677 comparing with ../test
677 comparing with ../test
678 abort: unknown revision 'bundle.hg'!
678 abort: unknown revision 'bundle.hg'!
679 [255]
679 [255]
680
680
681 note that percent encoding is not handled:
681 note that percent encoding is not handled:
682
682
683 $ hg incoming ../test%23bundle.hg
683 $ hg incoming ../test%23bundle.hg
684 abort: repository ../test%23bundle.hg not found!
684 abort: repository ../test%23bundle.hg not found!
685 [255]
685 [255]
686 $ cd ..
686 $ cd ..
687
687
688 #endif
688 #endif
689
689
690 test to bundle revisions on the newly created branch (issue3828):
690 test to bundle revisions on the newly created branch (issue3828):
691
691
692 $ hg -q clone -U test test-clone
692 $ hg -q clone -U test test-clone
693 $ cd test
693 $ cd test
694
694
695 $ hg -q branch foo
695 $ hg -q branch foo
696 $ hg commit -m "create foo branch"
696 $ hg commit -m "create foo branch"
697 $ hg -q outgoing ../test-clone
697 $ hg -q outgoing ../test-clone
698 9:b4f5acb1ee27
698 9:b4f5acb1ee27
699 $ hg -q bundle --branch foo foo.hg ../test-clone
699 $ hg -q bundle --branch foo foo.hg ../test-clone
700 #if repobundlerepo
700 #if repobundlerepo
701 $ hg -R foo.hg -q log -r "bundle()"
701 $ hg -R foo.hg -q log -r "bundle()"
702 9:b4f5acb1ee27
702 9:b4f5acb1ee27
703 #endif
703 #endif
704
704
705 $ cd ..
705 $ cd ..
706
706
707 test for https://bz.mercurial-scm.org/1144
707 test for https://bz.mercurial-scm.org/1144
708
708
709 test that verify bundle does not traceback
709 test that verify bundle does not traceback
710
710
711 partial history bundle, fails w/ unknown parent
711 partial history bundle, fails w/ unknown parent
712
712
713 $ hg -R bundle.hg verify
713 $ hg -R bundle.hg verify
714 abort: 00changelog.i@bbd179dfa0a7: unknown parent!
714 abort: 00changelog.i@bbd179dfa0a7: unknown parent!
715 [255]
715 [255]
716
716
717 full history bundle, refuses to verify non-local repo
717 full history bundle, refuses to verify non-local repo
718
718
719 #if repobundlerepo
719 #if repobundlerepo
720 $ hg -R all.hg verify
720 $ hg -R all.hg verify
721 abort: cannot verify bundle or remote repos
721 abort: cannot verify bundle or remote repos
722 [255]
722 [255]
723 #endif
723 #endif
724
724
725 but, regular verify must continue to work
725 but, regular verify must continue to work
726
726
727 $ hg -R orig verify
727 $ hg -R orig verify
728 checking changesets
728 checking changesets
729 checking manifests
729 checking manifests
730 crosschecking files in changesets and manifests
730 crosschecking files in changesets and manifests
731 checking files
731 checking files
732 2 files, 2 changesets, 2 total revisions
732 checked 2 changesets with 2 changes to 2 files
733
733
734 #if repobundlerepo
734 #if repobundlerepo
735 diff against bundle
735 diff against bundle
736
736
737 $ hg init b
737 $ hg init b
738 $ cd b
738 $ cd b
739 $ hg -R ../all.hg diff -r tip
739 $ hg -R ../all.hg diff -r tip
740 diff -r aa35859c02ea anotherfile
740 diff -r aa35859c02ea anotherfile
741 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
741 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
742 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
742 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
743 @@ -1,4 +0,0 @@
743 @@ -1,4 +0,0 @@
744 -0
744 -0
745 -1
745 -1
746 -2
746 -2
747 -3
747 -3
748 $ cd ..
748 $ cd ..
749 #endif
749 #endif
750
750
751 bundle single branch
751 bundle single branch
752
752
753 $ hg init branchy
753 $ hg init branchy
754 $ cd branchy
754 $ cd branchy
755 $ echo a >a
755 $ echo a >a
756 $ echo x >x
756 $ echo x >x
757 $ hg ci -Ama
757 $ hg ci -Ama
758 adding a
758 adding a
759 adding x
759 adding x
760 $ echo c >c
760 $ echo c >c
761 $ echo xx >x
761 $ echo xx >x
762 $ hg ci -Amc
762 $ hg ci -Amc
763 adding c
763 adding c
764 $ echo c1 >c1
764 $ echo c1 >c1
765 $ hg ci -Amc1
765 $ hg ci -Amc1
766 adding c1
766 adding c1
767 $ hg up 0
767 $ hg up 0
768 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
768 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
769 $ echo b >b
769 $ echo b >b
770 $ hg ci -Amb
770 $ hg ci -Amb
771 adding b
771 adding b
772 created new head
772 created new head
773 $ echo b1 >b1
773 $ echo b1 >b1
774 $ echo xx >x
774 $ echo xx >x
775 $ hg ci -Amb1
775 $ hg ci -Amb1
776 adding b1
776 adding b1
777 $ hg clone -q -r2 . part
777 $ hg clone -q -r2 . part
778
778
779 == bundling via incoming
779 == bundling via incoming
780
780
781 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
781 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
782 comparing with .
782 comparing with .
783 searching for changes
783 searching for changes
784 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
784 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
785 057f4db07f61970e1c11e83be79e9d08adc4dc31
785 057f4db07f61970e1c11e83be79e9d08adc4dc31
786
786
787 == bundling
787 == bundling
788
788
789 $ hg bundle bundle.hg part --debug --config progress.debug=true
789 $ hg bundle bundle.hg part --debug --config progress.debug=true
790 query 1; heads
790 query 1; heads
791 searching for changes
791 searching for changes
792 all remote heads known locally
792 all remote heads known locally
793 2 changesets found
793 2 changesets found
794 list of changesets:
794 list of changesets:
795 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
795 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
796 057f4db07f61970e1c11e83be79e9d08adc4dc31
796 057f4db07f61970e1c11e83be79e9d08adc4dc31
797 bundle2-output-bundle: "HG20", (1 params) 2 parts total
797 bundle2-output-bundle: "HG20", (1 params) 2 parts total
798 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
798 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
799 changesets: 1/2 chunks (50.00%)
799 changesets: 1/2 chunks (50.00%)
800 changesets: 2/2 chunks (100.00%)
800 changesets: 2/2 chunks (100.00%)
801 manifests: 1/2 chunks (50.00%)
801 manifests: 1/2 chunks (50.00%)
802 manifests: 2/2 chunks (100.00%)
802 manifests: 2/2 chunks (100.00%)
803 files: b 1/3 files (33.33%)
803 files: b 1/3 files (33.33%)
804 files: b1 2/3 files (66.67%)
804 files: b1 2/3 files (66.67%)
805 files: x 3/3 files (100.00%)
805 files: x 3/3 files (100.00%)
806 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
806 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
807
807
808 #if repobundlerepo
808 #if repobundlerepo
809 == Test for issue3441
809 == Test for issue3441
810
810
811 $ hg clone -q -r0 . part2
811 $ hg clone -q -r0 . part2
812 $ hg -q -R part2 pull bundle.hg
812 $ hg -q -R part2 pull bundle.hg
813 $ hg -R part2 verify
813 $ hg -R part2 verify
814 checking changesets
814 checking changesets
815 checking manifests
815 checking manifests
816 crosschecking files in changesets and manifests
816 crosschecking files in changesets and manifests
817 checking files
817 checking files
818 4 files, 3 changesets, 5 total revisions
818 checked 3 changesets with 5 changes to 4 files
819 #endif
819 #endif
820
820
821 == Test bundling no commits
821 == Test bundling no commits
822
822
823 $ hg bundle -r 'public()' no-output.hg
823 $ hg bundle -r 'public()' no-output.hg
824 abort: no commits to bundle
824 abort: no commits to bundle
825 [255]
825 [255]
826
826
827 $ cd ..
827 $ cd ..
828
828
829 When user merges to the revision existing only in the bundle,
829 When user merges to the revision existing only in the bundle,
830 it should show warning that second parent of the working
830 it should show warning that second parent of the working
831 directory does not exist
831 directory does not exist
832
832
833 $ hg init update2bundled
833 $ hg init update2bundled
834 $ cd update2bundled
834 $ cd update2bundled
835 $ cat <<EOF >> .hg/hgrc
835 $ cat <<EOF >> .hg/hgrc
836 > [extensions]
836 > [extensions]
837 > strip =
837 > strip =
838 > EOF
838 > EOF
839 $ echo "aaa" >> a
839 $ echo "aaa" >> a
840 $ hg commit -A -m 0
840 $ hg commit -A -m 0
841 adding a
841 adding a
842 $ echo "bbb" >> b
842 $ echo "bbb" >> b
843 $ hg commit -A -m 1
843 $ hg commit -A -m 1
844 adding b
844 adding b
845 $ echo "ccc" >> c
845 $ echo "ccc" >> c
846 $ hg commit -A -m 2
846 $ hg commit -A -m 2
847 adding c
847 adding c
848 $ hg update -r 1
848 $ hg update -r 1
849 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
849 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
850 $ echo "ddd" >> d
850 $ echo "ddd" >> d
851 $ hg commit -A -m 3
851 $ hg commit -A -m 3
852 adding d
852 adding d
853 created new head
853 created new head
854 $ hg update -r 2
854 $ hg update -r 2
855 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
855 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
856 $ hg log -G
856 $ hg log -G
857 o changeset: 3:8bd3e1f196af
857 o changeset: 3:8bd3e1f196af
858 | tag: tip
858 | tag: tip
859 | parent: 1:a01eca7af26d
859 | parent: 1:a01eca7af26d
860 | user: test
860 | user: test
861 | date: Thu Jan 01 00:00:00 1970 +0000
861 | date: Thu Jan 01 00:00:00 1970 +0000
862 | summary: 3
862 | summary: 3
863 |
863 |
864 | @ changeset: 2:4652c276ac4f
864 | @ changeset: 2:4652c276ac4f
865 |/ user: test
865 |/ user: test
866 | date: Thu Jan 01 00:00:00 1970 +0000
866 | date: Thu Jan 01 00:00:00 1970 +0000
867 | summary: 2
867 | summary: 2
868 |
868 |
869 o changeset: 1:a01eca7af26d
869 o changeset: 1:a01eca7af26d
870 | user: test
870 | user: test
871 | date: Thu Jan 01 00:00:00 1970 +0000
871 | date: Thu Jan 01 00:00:00 1970 +0000
872 | summary: 1
872 | summary: 1
873 |
873 |
874 o changeset: 0:4fe08cd4693e
874 o changeset: 0:4fe08cd4693e
875 user: test
875 user: test
876 date: Thu Jan 01 00:00:00 1970 +0000
876 date: Thu Jan 01 00:00:00 1970 +0000
877 summary: 0
877 summary: 0
878
878
879
879
880 #if repobundlerepo
880 #if repobundlerepo
881 $ hg bundle --base 1 -r 3 ../update2bundled.hg
881 $ hg bundle --base 1 -r 3 ../update2bundled.hg
882 1 changesets found
882 1 changesets found
883 $ hg strip -r 3
883 $ hg strip -r 3
884 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
884 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
885 $ hg merge -R ../update2bundled.hg -r 3
885 $ hg merge -R ../update2bundled.hg -r 3
886 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
886 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
887 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
887 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
888 (branch merge, don't forget to commit)
888 (branch merge, don't forget to commit)
889
889
890 When user updates to the revision existing only in the bundle,
890 When user updates to the revision existing only in the bundle,
891 it should show warning
891 it should show warning
892
892
893 $ hg update -R ../update2bundled.hg --clean -r 3
893 $ hg update -R ../update2bundled.hg --clean -r 3
894 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
894 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
895 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
895 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
896
896
897 When user updates to the revision existing in the local repository
897 When user updates to the revision existing in the local repository
898 the warning shouldn't be emitted
898 the warning shouldn't be emitted
899
899
900 $ hg update -R ../update2bundled.hg -r 0
900 $ hg update -R ../update2bundled.hg -r 0
901 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
901 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
902 #endif
902 #endif
@@ -1,492 +1,492 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > censor=
5 > censor=
6 > EOF
6 > EOF
7 $ cp $HGRCPATH $HGRCPATH.orig
7 $ cp $HGRCPATH $HGRCPATH.orig
8
8
9 Create repo with unimpeachable content
9 Create repo with unimpeachable content
10
10
11 $ hg init r
11 $ hg init r
12 $ cd r
12 $ cd r
13 $ echo 'Initially untainted file' > target
13 $ echo 'Initially untainted file' > target
14 $ echo 'Normal file here' > bystander
14 $ echo 'Normal file here' > bystander
15 $ hg add target bystander
15 $ hg add target bystander
16 $ hg ci -m init
16 $ hg ci -m init
17
17
18 Clone repo so we can test pull later
18 Clone repo so we can test pull later
19
19
20 $ cd ..
20 $ cd ..
21 $ hg clone r rpull
21 $ hg clone r rpull
22 updating to branch default
22 updating to branch default
23 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ cd r
24 $ cd r
25
25
26 Introduce content which will ultimately require censorship. Name the first
26 Introduce content which will ultimately require censorship. Name the first
27 censored node C1, second C2, and so on
27 censored node C1, second C2, and so on
28
28
29 $ echo 'Tainted file' > target
29 $ echo 'Tainted file' > target
30 $ echo 'Passwords: hunter2' >> target
30 $ echo 'Passwords: hunter2' >> target
31 $ hg ci -m taint target
31 $ hg ci -m taint target
32 $ C1=`hg id --debug -i`
32 $ C1=`hg id --debug -i`
33
33
34 $ echo 'hunter3' >> target
34 $ echo 'hunter3' >> target
35 $ echo 'Normal file v2' > bystander
35 $ echo 'Normal file v2' > bystander
36 $ hg ci -m moretaint target bystander
36 $ hg ci -m moretaint target bystander
37 $ C2=`hg id --debug -i`
37 $ C2=`hg id --debug -i`
38
38
39 Add a new sanitized versions to correct our mistake. Name the first head H1,
39 Add a new sanitized versions to correct our mistake. Name the first head H1,
40 the second head H2, and so on
40 the second head H2, and so on
41
41
42 $ echo 'Tainted file is now sanitized' > target
42 $ echo 'Tainted file is now sanitized' > target
43 $ hg ci -m sanitized target
43 $ hg ci -m sanitized target
44 $ H1=`hg id --debug -i`
44 $ H1=`hg id --debug -i`
45
45
46 $ hg update -r $C2
46 $ hg update -r $C2
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ echo 'Tainted file now super sanitized' > target
48 $ echo 'Tainted file now super sanitized' > target
49 $ hg ci -m 'super sanitized' target
49 $ hg ci -m 'super sanitized' target
50 created new head
50 created new head
51 $ H2=`hg id --debug -i`
51 $ H2=`hg id --debug -i`
52
52
53 Verify target contents before censorship at each revision
53 Verify target contents before censorship at each revision
54
54
55 $ hg cat -r $H1 target
55 $ hg cat -r $H1 target
56 Tainted file is now sanitized
56 Tainted file is now sanitized
57 $ hg cat -r $H2 target
57 $ hg cat -r $H2 target
58 Tainted file now super sanitized
58 Tainted file now super sanitized
59 $ hg cat -r $C2 target
59 $ hg cat -r $C2 target
60 Tainted file
60 Tainted file
61 Passwords: hunter2
61 Passwords: hunter2
62 hunter3
62 hunter3
63 $ hg cat -r $C1 target
63 $ hg cat -r $C1 target
64 Tainted file
64 Tainted file
65 Passwords: hunter2
65 Passwords: hunter2
66 $ hg cat -r 0 target
66 $ hg cat -r 0 target
67 Initially untainted file
67 Initially untainted file
68
68
69 Try to censor revision with too large of a tombstone message
69 Try to censor revision with too large of a tombstone message
70
70
71 $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
71 $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
72 abort: censor tombstone must be no longer than censored data
72 abort: censor tombstone must be no longer than censored data
73 [255]
73 [255]
74
74
75 Censor revision with 2 offenses
75 Censor revision with 2 offenses
76
76
77 (this also tests file pattern matching: path relative to cwd case)
77 (this also tests file pattern matching: path relative to cwd case)
78
78
79 $ mkdir -p foo/bar/baz
79 $ mkdir -p foo/bar/baz
80 $ hg --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
80 $ hg --cwd foo/bar/baz censor -r $C2 -t "remove password" ../../../target
81 $ hg cat -r $H1 target
81 $ hg cat -r $H1 target
82 Tainted file is now sanitized
82 Tainted file is now sanitized
83 $ hg cat -r $H2 target
83 $ hg cat -r $H2 target
84 Tainted file now super sanitized
84 Tainted file now super sanitized
85 $ hg cat -r $C2 target
85 $ hg cat -r $C2 target
86 abort: censored node: 1e0247a9a4b7
86 abort: censored node: 1e0247a9a4b7
87 (set censor.policy to ignore errors)
87 (set censor.policy to ignore errors)
88 [255]
88 [255]
89 $ hg cat -r $C1 target
89 $ hg cat -r $C1 target
90 Tainted file
90 Tainted file
91 Passwords: hunter2
91 Passwords: hunter2
92 $ hg cat -r 0 target
92 $ hg cat -r 0 target
93 Initially untainted file
93 Initially untainted file
94
94
95 Censor revision with 1 offense
95 Censor revision with 1 offense
96
96
97 (this also tests file pattern matching: with 'path:' scheme)
97 (this also tests file pattern matching: with 'path:' scheme)
98
98
99 $ hg --cwd foo/bar/baz censor -r $C1 path:target
99 $ hg --cwd foo/bar/baz censor -r $C1 path:target
100 $ hg cat -r $H1 target
100 $ hg cat -r $H1 target
101 Tainted file is now sanitized
101 Tainted file is now sanitized
102 $ hg cat -r $H2 target
102 $ hg cat -r $H2 target
103 Tainted file now super sanitized
103 Tainted file now super sanitized
104 $ hg cat -r $C2 target
104 $ hg cat -r $C2 target
105 abort: censored node: 1e0247a9a4b7
105 abort: censored node: 1e0247a9a4b7
106 (set censor.policy to ignore errors)
106 (set censor.policy to ignore errors)
107 [255]
107 [255]
108 $ hg cat -r $C1 target
108 $ hg cat -r $C1 target
109 abort: censored node: 613bc869fceb
109 abort: censored node: 613bc869fceb
110 (set censor.policy to ignore errors)
110 (set censor.policy to ignore errors)
111 [255]
111 [255]
112 $ hg cat -r 0 target
112 $ hg cat -r 0 target
113 Initially untainted file
113 Initially untainted file
114
114
115 Can only checkout target at uncensored revisions, -X is workaround for --all
115 Can only checkout target at uncensored revisions, -X is workaround for --all
116
116
117 $ hg revert -r $C2 target
117 $ hg revert -r $C2 target
118 abort: censored node: 1e0247a9a4b7
118 abort: censored node: 1e0247a9a4b7
119 (set censor.policy to ignore errors)
119 (set censor.policy to ignore errors)
120 [255]
120 [255]
121 $ hg revert -r $C1 target
121 $ hg revert -r $C1 target
122 abort: censored node: 613bc869fceb
122 abort: censored node: 613bc869fceb
123 (set censor.policy to ignore errors)
123 (set censor.policy to ignore errors)
124 [255]
124 [255]
125 $ hg revert -r $C1 --all
125 $ hg revert -r $C1 --all
126 reverting bystander
126 reverting bystander
127 reverting target
127 reverting target
128 abort: censored node: 613bc869fceb
128 abort: censored node: 613bc869fceb
129 (set censor.policy to ignore errors)
129 (set censor.policy to ignore errors)
130 [255]
130 [255]
131 $ hg revert -r $C1 --all -X target
131 $ hg revert -r $C1 --all -X target
132 $ cat target
132 $ cat target
133 Tainted file now super sanitized
133 Tainted file now super sanitized
134 $ hg revert -r 0 --all
134 $ hg revert -r 0 --all
135 reverting target
135 reverting target
136 $ cat target
136 $ cat target
137 Initially untainted file
137 Initially untainted file
138 $ hg revert -r $H2 --all
138 $ hg revert -r $H2 --all
139 reverting bystander
139 reverting bystander
140 reverting target
140 reverting target
141 $ cat target
141 $ cat target
142 Tainted file now super sanitized
142 Tainted file now super sanitized
143
143
144 Uncensored file can be viewed at any revision
144 Uncensored file can be viewed at any revision
145
145
146 $ hg cat -r $H1 bystander
146 $ hg cat -r $H1 bystander
147 Normal file v2
147 Normal file v2
148 $ hg cat -r $C2 bystander
148 $ hg cat -r $C2 bystander
149 Normal file v2
149 Normal file v2
150 $ hg cat -r $C1 bystander
150 $ hg cat -r $C1 bystander
151 Normal file here
151 Normal file here
152 $ hg cat -r 0 bystander
152 $ hg cat -r 0 bystander
153 Normal file here
153 Normal file here
154
154
155 Can update to children of censored revision
155 Can update to children of censored revision
156
156
157 $ hg update -r $H1
157 $ hg update -r $H1
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 $ cat target
159 $ cat target
160 Tainted file is now sanitized
160 Tainted file is now sanitized
161 $ hg update -r $H2
161 $ hg update -r $H2
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 $ cat target
163 $ cat target
164 Tainted file now super sanitized
164 Tainted file now super sanitized
165
165
166 Set censor policy to abort in trusted $HGRC so hg verify fails
166 Set censor policy to abort in trusted $HGRC so hg verify fails
167
167
168 $ cp $HGRCPATH.orig $HGRCPATH
168 $ cp $HGRCPATH.orig $HGRCPATH
169 $ cat >> $HGRCPATH <<EOF
169 $ cat >> $HGRCPATH <<EOF
170 > [censor]
170 > [censor]
171 > policy = abort
171 > policy = abort
172 > EOF
172 > EOF
173
173
174 Repo fails verification due to censorship
174 Repo fails verification due to censorship
175
175
176 $ hg verify
176 $ hg verify
177 checking changesets
177 checking changesets
178 checking manifests
178 checking manifests
179 crosschecking files in changesets and manifests
179 crosschecking files in changesets and manifests
180 checking files
180 checking files
181 target@1: censored file data
181 target@1: censored file data
182 target@2: censored file data
182 target@2: censored file data
183 2 files, 5 changesets, 7 total revisions
183 checked 5 changesets with 7 changes to 2 files
184 2 integrity errors encountered!
184 2 integrity errors encountered!
185 (first damaged changeset appears to be 1)
185 (first damaged changeset appears to be 1)
186 [1]
186 [1]
187
187
188 Cannot update to revision with censored data
188 Cannot update to revision with censored data
189
189
190 $ hg update -r $C2
190 $ hg update -r $C2
191 abort: censored node: 1e0247a9a4b7
191 abort: censored node: 1e0247a9a4b7
192 (set censor.policy to ignore errors)
192 (set censor.policy to ignore errors)
193 [255]
193 [255]
194 $ hg update -r $C1
194 $ hg update -r $C1
195 abort: censored node: 613bc869fceb
195 abort: censored node: 613bc869fceb
196 (set censor.policy to ignore errors)
196 (set censor.policy to ignore errors)
197 [255]
197 [255]
198 $ hg update -r 0
198 $ hg update -r 0
199 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
199 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
200 $ hg update -r $H2
200 $ hg update -r $H2
201 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
202
202
203 Set censor policy to ignore in trusted $HGRC so hg verify passes
203 Set censor policy to ignore in trusted $HGRC so hg verify passes
204
204
205 $ cp $HGRCPATH.orig $HGRCPATH
205 $ cp $HGRCPATH.orig $HGRCPATH
206 $ cat >> $HGRCPATH <<EOF
206 $ cat >> $HGRCPATH <<EOF
207 > [censor]
207 > [censor]
208 > policy = ignore
208 > policy = ignore
209 > EOF
209 > EOF
210
210
211 Repo passes verification with warnings with explicit config
211 Repo passes verification with warnings with explicit config
212
212
213 $ hg verify
213 $ hg verify
214 checking changesets
214 checking changesets
215 checking manifests
215 checking manifests
216 crosschecking files in changesets and manifests
216 crosschecking files in changesets and manifests
217 checking files
217 checking files
218 2 files, 5 changesets, 7 total revisions
218 checked 5 changesets with 7 changes to 2 files
219
219
220 May update to revision with censored data with explicit config
220 May update to revision with censored data with explicit config
221
221
222 $ hg update -r $C2
222 $ hg update -r $C2
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 $ cat target
224 $ cat target
225 $ hg update -r $C1
225 $ hg update -r $C1
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 $ cat target
227 $ cat target
228 $ hg update -r 0
228 $ hg update -r 0
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 $ cat target
230 $ cat target
231 Initially untainted file
231 Initially untainted file
232 $ hg update -r $H2
232 $ hg update -r $H2
233 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ cat target
234 $ cat target
235 Tainted file now super sanitized
235 Tainted file now super sanitized
236
236
237 Can merge in revision with censored data. Test requires one branch of history
237 Can merge in revision with censored data. Test requires one branch of history
238 with the file censored, but we can't censor at a head, so advance H1.
238 with the file censored, but we can't censor at a head, so advance H1.
239
239
240 $ hg update -r $H1
240 $ hg update -r $H1
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 $ C3=$H1
242 $ C3=$H1
243 $ echo 'advanced head H1' > target
243 $ echo 'advanced head H1' > target
244 $ hg ci -m 'advance head H1' target
244 $ hg ci -m 'advance head H1' target
245 $ H1=`hg id --debug -i`
245 $ H1=`hg id --debug -i`
246 $ hg censor -r $C3 target
246 $ hg censor -r $C3 target
247 $ hg update -r $H2
247 $ hg update -r $H2
248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
249 $ hg merge -r $C3
249 $ hg merge -r $C3
250 merging target
250 merging target
251 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
251 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
252 (branch merge, don't forget to commit)
252 (branch merge, don't forget to commit)
253
253
254 Revisions present in repository heads may not be censored
254 Revisions present in repository heads may not be censored
255
255
256 $ hg update -C -r $H2
256 $ hg update -C -r $H2
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 $ hg censor -r $H2 target
258 $ hg censor -r $H2 target
259 abort: cannot censor file in heads (78a8fc215e79)
259 abort: cannot censor file in heads (78a8fc215e79)
260 (clean/delete and commit first)
260 (clean/delete and commit first)
261 [255]
261 [255]
262 $ echo 'twiddling thumbs' > bystander
262 $ echo 'twiddling thumbs' > bystander
263 $ hg ci -m 'bystander commit'
263 $ hg ci -m 'bystander commit'
264 $ H2=`hg id --debug -i`
264 $ H2=`hg id --debug -i`
265 $ hg censor -r "$H2^" target
265 $ hg censor -r "$H2^" target
266 abort: cannot censor file in heads (efbe78065929)
266 abort: cannot censor file in heads (efbe78065929)
267 (clean/delete and commit first)
267 (clean/delete and commit first)
268 [255]
268 [255]
269
269
270 Cannot censor working directory
270 Cannot censor working directory
271
271
272 $ echo 'seriously no passwords' > target
272 $ echo 'seriously no passwords' > target
273 $ hg ci -m 'extend second head arbitrarily' target
273 $ hg ci -m 'extend second head arbitrarily' target
274 $ H2=`hg id --debug -i`
274 $ H2=`hg id --debug -i`
275 $ hg update -r "$H2^"
275 $ hg update -r "$H2^"
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 $ hg censor -r . target
277 $ hg censor -r . target
278 abort: cannot censor working directory
278 abort: cannot censor working directory
279 (clean/delete/update first)
279 (clean/delete/update first)
280 [255]
280 [255]
281 $ hg update -r $H2
281 $ hg update -r $H2
282 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
282 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
283
283
284 Can re-add file after being deleted + censored
284 Can re-add file after being deleted + censored
285
285
286 $ C4=$H2
286 $ C4=$H2
287 $ hg rm target
287 $ hg rm target
288 $ hg ci -m 'delete target so it may be censored'
288 $ hg ci -m 'delete target so it may be censored'
289 $ H2=`hg id --debug -i`
289 $ H2=`hg id --debug -i`
290 $ hg censor -r $C4 target
290 $ hg censor -r $C4 target
291 $ hg cat -r $C4 target
291 $ hg cat -r $C4 target
292 $ hg cat -r "$H2^^" target
292 $ hg cat -r "$H2^^" target
293 Tainted file now super sanitized
293 Tainted file now super sanitized
294 $ echo 'fresh start' > target
294 $ echo 'fresh start' > target
295 $ hg add target
295 $ hg add target
296 $ hg ci -m reincarnated target
296 $ hg ci -m reincarnated target
297 $ H2=`hg id --debug -i`
297 $ H2=`hg id --debug -i`
298 $ hg cat -r $H2 target
298 $ hg cat -r $H2 target
299 fresh start
299 fresh start
300 $ hg cat -r "$H2^" target
300 $ hg cat -r "$H2^" target
301 target: no such file in rev 452ec1762369
301 target: no such file in rev 452ec1762369
302 [1]
302 [1]
303 $ hg cat -r $C4 target
303 $ hg cat -r $C4 target
304 $ hg cat -r "$H2^^^" target
304 $ hg cat -r "$H2^^^" target
305 Tainted file now super sanitized
305 Tainted file now super sanitized
306
306
307 Can censor after revlog has expanded to no longer permit inline storage
307 Can censor after revlog has expanded to no longer permit inline storage
308
308
309 $ for x in `$PYTHON $TESTDIR/seq.py 0 50000`
309 $ for x in `$PYTHON $TESTDIR/seq.py 0 50000`
310 > do
310 > do
311 > echo "Password: hunter$x" >> target
311 > echo "Password: hunter$x" >> target
312 > done
312 > done
313 $ hg ci -m 'add 100k passwords'
313 $ hg ci -m 'add 100k passwords'
314 $ H2=`hg id --debug -i`
314 $ H2=`hg id --debug -i`
315 $ C5=$H2
315 $ C5=$H2
316 $ hg revert -r "$H2^" target
316 $ hg revert -r "$H2^" target
317 $ hg ci -m 'cleaned 100k passwords'
317 $ hg ci -m 'cleaned 100k passwords'
318 $ H2=`hg id --debug -i`
318 $ H2=`hg id --debug -i`
319 $ hg censor -r $C5 target
319 $ hg censor -r $C5 target
320 $ hg cat -r $C5 target
320 $ hg cat -r $C5 target
321 $ hg cat -r $H2 target
321 $ hg cat -r $H2 target
322 fresh start
322 fresh start
323
323
324 Repo with censored nodes can be cloned and cloned nodes are censored
324 Repo with censored nodes can be cloned and cloned nodes are censored
325
325
326 $ cd ..
326 $ cd ..
327 $ hg clone r rclone
327 $ hg clone r rclone
328 updating to branch default
328 updating to branch default
329 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 $ cd rclone
330 $ cd rclone
331 $ hg cat -r $H1 target
331 $ hg cat -r $H1 target
332 advanced head H1
332 advanced head H1
333 $ hg cat -r $H2~5 target
333 $ hg cat -r $H2~5 target
334 Tainted file now super sanitized
334 Tainted file now super sanitized
335 $ hg cat -r $C2 target
335 $ hg cat -r $C2 target
336 $ hg cat -r $C1 target
336 $ hg cat -r $C1 target
337 $ hg cat -r 0 target
337 $ hg cat -r 0 target
338 Initially untainted file
338 Initially untainted file
339 $ hg verify
339 $ hg verify
340 checking changesets
340 checking changesets
341 checking manifests
341 checking manifests
342 crosschecking files in changesets and manifests
342 crosschecking files in changesets and manifests
343 checking files
343 checking files
344 2 files, 12 changesets, 13 total revisions
344 checked 12 changesets with 13 changes to 2 files
345
345
346 Repo cloned before tainted content introduced can pull censored nodes
346 Repo cloned before tainted content introduced can pull censored nodes
347
347
348 $ cd ../rpull
348 $ cd ../rpull
349 $ hg cat -r tip target
349 $ hg cat -r tip target
350 Initially untainted file
350 Initially untainted file
351 $ hg verify
351 $ hg verify
352 checking changesets
352 checking changesets
353 checking manifests
353 checking manifests
354 crosschecking files in changesets and manifests
354 crosschecking files in changesets and manifests
355 checking files
355 checking files
356 2 files, 1 changesets, 2 total revisions
356 checked 1 changesets with 2 changes to 2 files
357 $ hg pull -r $H1 -r $H2
357 $ hg pull -r $H1 -r $H2
358 pulling from $TESTTMP/r
358 pulling from $TESTTMP/r
359 searching for changes
359 searching for changes
360 adding changesets
360 adding changesets
361 adding manifests
361 adding manifests
362 adding file changes
362 adding file changes
363 added 11 changesets with 11 changes to 2 files (+1 heads)
363 added 11 changesets with 11 changes to 2 files (+1 heads)
364 new changesets 186fb27560c3:683e4645fded
364 new changesets 186fb27560c3:683e4645fded
365 (run 'hg heads' to see heads, 'hg merge' to merge)
365 (run 'hg heads' to see heads, 'hg merge' to merge)
366 $ hg update 4
366 $ hg update 4
367 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 $ cat target
368 $ cat target
369 Tainted file now super sanitized
369 Tainted file now super sanitized
370 $ hg cat -r $H1 target
370 $ hg cat -r $H1 target
371 advanced head H1
371 advanced head H1
372 $ hg cat -r $H2~5 target
372 $ hg cat -r $H2~5 target
373 Tainted file now super sanitized
373 Tainted file now super sanitized
374 $ hg cat -r $C2 target
374 $ hg cat -r $C2 target
375 $ hg cat -r $C1 target
375 $ hg cat -r $C1 target
376 $ hg cat -r 0 target
376 $ hg cat -r 0 target
377 Initially untainted file
377 Initially untainted file
378 $ hg verify
378 $ hg verify
379 checking changesets
379 checking changesets
380 checking manifests
380 checking manifests
381 crosschecking files in changesets and manifests
381 crosschecking files in changesets and manifests
382 checking files
382 checking files
383 2 files, 12 changesets, 13 total revisions
383 checked 12 changesets with 13 changes to 2 files
384
384
385 Censored nodes can be pushed if they censor previously unexchanged nodes
385 Censored nodes can be pushed if they censor previously unexchanged nodes
386
386
387 $ echo 'Passwords: hunter2hunter2' > target
387 $ echo 'Passwords: hunter2hunter2' > target
388 $ hg ci -m 're-add password from clone' target
388 $ hg ci -m 're-add password from clone' target
389 created new head
389 created new head
390 $ H3=`hg id --debug -i`
390 $ H3=`hg id --debug -i`
391 $ REV=$H3
391 $ REV=$H3
392 $ echo 'Re-sanitized; nothing to see here' > target
392 $ echo 'Re-sanitized; nothing to see here' > target
393 $ hg ci -m 're-sanitized' target
393 $ hg ci -m 're-sanitized' target
394 $ H2=`hg id --debug -i`
394 $ H2=`hg id --debug -i`
395 $ CLEANREV=$H2
395 $ CLEANREV=$H2
396 $ hg cat -r $REV target
396 $ hg cat -r $REV target
397 Passwords: hunter2hunter2
397 Passwords: hunter2hunter2
398 $ hg censor -r $REV target
398 $ hg censor -r $REV target
399 $ hg cat -r $REV target
399 $ hg cat -r $REV target
400 $ hg cat -r $CLEANREV target
400 $ hg cat -r $CLEANREV target
401 Re-sanitized; nothing to see here
401 Re-sanitized; nothing to see here
402 $ hg push -f -r $H2
402 $ hg push -f -r $H2
403 pushing to $TESTTMP/r
403 pushing to $TESTTMP/r
404 searching for changes
404 searching for changes
405 adding changesets
405 adding changesets
406 adding manifests
406 adding manifests
407 adding file changes
407 adding file changes
408 added 2 changesets with 2 changes to 1 files (+1 heads)
408 added 2 changesets with 2 changes to 1 files (+1 heads)
409
409
410 $ cd ../r
410 $ cd ../r
411 $ hg cat -r $REV target
411 $ hg cat -r $REV target
412 $ hg cat -r $CLEANREV target
412 $ hg cat -r $CLEANREV target
413 Re-sanitized; nothing to see here
413 Re-sanitized; nothing to see here
414 $ hg update $CLEANREV
414 $ hg update $CLEANREV
415 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 $ cat target
416 $ cat target
417 Re-sanitized; nothing to see here
417 Re-sanitized; nothing to see here
418
418
419 Censored nodes can be bundled up and unbundled in another repo
419 Censored nodes can be bundled up and unbundled in another repo
420
420
421 $ hg bundle --base 0 ../pwbundle
421 $ hg bundle --base 0 ../pwbundle
422 13 changesets found
422 13 changesets found
423 $ cd ../rclone
423 $ cd ../rclone
424 $ hg unbundle ../pwbundle
424 $ hg unbundle ../pwbundle
425 adding changesets
425 adding changesets
426 adding manifests
426 adding manifests
427 adding file changes
427 adding file changes
428 added 2 changesets with 2 changes to 2 files (+1 heads)
428 added 2 changesets with 2 changes to 2 files (+1 heads)
429 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
429 new changesets 075be80ac777:dcbaf17bf3a1 (2 drafts)
430 (run 'hg heads .' to see heads, 'hg merge' to merge)
430 (run 'hg heads .' to see heads, 'hg merge' to merge)
431 $ hg cat -r $REV target
431 $ hg cat -r $REV target
432 $ hg cat -r $CLEANREV target
432 $ hg cat -r $CLEANREV target
433 Re-sanitized; nothing to see here
433 Re-sanitized; nothing to see here
434 $ hg update $CLEANREV
434 $ hg update $CLEANREV
435 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 $ cat target
436 $ cat target
437 Re-sanitized; nothing to see here
437 Re-sanitized; nothing to see here
438 $ hg verify
438 $ hg verify
439 checking changesets
439 checking changesets
440 checking manifests
440 checking manifests
441 crosschecking files in changesets and manifests
441 crosschecking files in changesets and manifests
442 checking files
442 checking files
443 2 files, 14 changesets, 15 total revisions
443 checked 14 changesets with 15 changes to 2 files
444
444
445 Censored nodes can be imported on top of censored nodes, consecutively
445 Censored nodes can be imported on top of censored nodes, consecutively
446
446
447 $ hg init ../rimport
447 $ hg init ../rimport
448 $ hg bundle --base 1 ../rimport/splitbundle
448 $ hg bundle --base 1 ../rimport/splitbundle
449 12 changesets found
449 12 changesets found
450 $ cd ../rimport
450 $ cd ../rimport
451 $ hg pull -r $H1 -r $H2 ../r
451 $ hg pull -r $H1 -r $H2 ../r
452 pulling from ../r
452 pulling from ../r
453 adding changesets
453 adding changesets
454 adding manifests
454 adding manifests
455 adding file changes
455 adding file changes
456 added 8 changesets with 10 changes to 2 files (+1 heads)
456 added 8 changesets with 10 changes to 2 files (+1 heads)
457 new changesets e97f55b2665a:dcbaf17bf3a1
457 new changesets e97f55b2665a:dcbaf17bf3a1
458 (run 'hg heads' to see heads, 'hg merge' to merge)
458 (run 'hg heads' to see heads, 'hg merge' to merge)
459 $ hg unbundle splitbundle
459 $ hg unbundle splitbundle
460 adding changesets
460 adding changesets
461 adding manifests
461 adding manifests
462 adding file changes
462 adding file changes
463 added 6 changesets with 5 changes to 2 files (+1 heads)
463 added 6 changesets with 5 changes to 2 files (+1 heads)
464 new changesets efbe78065929:683e4645fded (6 drafts)
464 new changesets efbe78065929:683e4645fded (6 drafts)
465 (run 'hg heads .' to see heads, 'hg merge' to merge)
465 (run 'hg heads .' to see heads, 'hg merge' to merge)
466 $ hg update $H2
466 $ hg update $H2
467 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
468 $ cat target
468 $ cat target
469 Re-sanitized; nothing to see here
469 Re-sanitized; nothing to see here
470 $ hg verify
470 $ hg verify
471 checking changesets
471 checking changesets
472 checking manifests
472 checking manifests
473 crosschecking files in changesets and manifests
473 crosschecking files in changesets and manifests
474 checking files
474 checking files
475 2 files, 14 changesets, 15 total revisions
475 checked 14 changesets with 15 changes to 2 files
476 $ cd ../r
476 $ cd ../r
477
477
478 Can import bundle where first revision of a file is censored
478 Can import bundle where first revision of a file is censored
479
479
480 $ hg init ../rinit
480 $ hg init ../rinit
481 $ hg censor -r 0 target
481 $ hg censor -r 0 target
482 $ hg bundle -r 0 --base null ../rinit/initbundle
482 $ hg bundle -r 0 --base null ../rinit/initbundle
483 1 changesets found
483 1 changesets found
484 $ cd ../rinit
484 $ cd ../rinit
485 $ hg unbundle initbundle
485 $ hg unbundle initbundle
486 adding changesets
486 adding changesets
487 adding manifests
487 adding manifests
488 adding file changes
488 adding file changes
489 added 1 changesets with 2 changes to 2 files
489 added 1 changesets with 2 changes to 2 files
490 new changesets e97f55b2665a (1 drafts)
490 new changesets e97f55b2665a (1 drafts)
491 (run 'hg update' to get a working copy)
491 (run 'hg update' to get a working copy)
492 $ hg cat -r 0 target
492 $ hg cat -r 0 target
@@ -1,53 +1,53 b''
1 Corrupt an hg repo with a pull started during an aborted commit
1 Corrupt an hg repo with a pull started during an aborted commit
2 Create two repos, so that one of them can pull from the other one.
2 Create two repos, so that one of them can pull from the other one.
3
3
4 $ hg init source
4 $ hg init source
5 $ cd source
5 $ cd source
6 $ touch foo
6 $ touch foo
7 $ hg add foo
7 $ hg add foo
8 $ hg ci -m 'add foo'
8 $ hg ci -m 'add foo'
9 $ hg clone . ../corrupted
9 $ hg clone . ../corrupted
10 updating to branch default
10 updating to branch default
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 $ echo >> foo
12 $ echo >> foo
13 $ hg ci -m 'change foo'
13 $ hg ci -m 'change foo'
14
14
15 Add a hook to wait 5 seconds and then abort the commit
15 Add a hook to wait 5 seconds and then abort the commit
16
16
17 $ cd ../corrupted
17 $ cd ../corrupted
18 $ echo "[hooks]" >> .hg/hgrc
18 $ echo "[hooks]" >> .hg/hgrc
19 $ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc
19 $ echo 'pretxncommit = sh -c "sleep 5; exit 1"' >> .hg/hgrc
20
20
21 start a commit...
21 start a commit...
22
22
23 $ touch bar
23 $ touch bar
24 $ hg add bar
24 $ hg add bar
25 $ hg ci -m 'add bar' &
25 $ hg ci -m 'add bar' &
26
26
27 ... and start a pull while the commit is still running
27 ... and start a pull while the commit is still running
28
28
29 $ sleep 1
29 $ sleep 1
30 $ hg pull ../source 2>/dev/null
30 $ hg pull ../source 2>/dev/null
31 pulling from ../source
31 pulling from ../source
32 transaction abort!
32 transaction abort!
33 rollback completed
33 rollback completed
34 abort: pretxncommit hook exited with status 1
34 abort: pretxncommit hook exited with status 1
35 searching for changes
35 searching for changes
36 adding changesets
36 adding changesets
37 adding manifests
37 adding manifests
38 adding file changes
38 adding file changes
39 added 1 changesets with 1 changes to 1 files
39 added 1 changesets with 1 changes to 1 files
40 new changesets 52998019f625
40 new changesets 52998019f625
41 (run 'hg update' to get a working copy)
41 (run 'hg update' to get a working copy)
42
42
43 see what happened
43 see what happened
44
44
45 $ wait
45 $ wait
46 $ hg verify
46 $ hg verify
47 checking changesets
47 checking changesets
48 checking manifests
48 checking manifests
49 crosschecking files in changesets and manifests
49 crosschecking files in changesets and manifests
50 checking files
50 checking files
51 1 files, 2 changesets, 2 total revisions
51 checked 2 changesets with 2 changes to 1 files
52
52
53 $ cd ..
53 $ cd ..
@@ -1,254 +1,254 b''
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3
3
4 $ echo 0 >> afile
4 $ echo 0 >> afile
5 $ hg add afile
5 $ hg add afile
6 $ hg commit -m "0.0"
6 $ hg commit -m "0.0"
7
7
8 $ echo 1 >> afile
8 $ echo 1 >> afile
9 $ hg commit -m "0.1"
9 $ hg commit -m "0.1"
10
10
11 $ echo 2 >> afile
11 $ echo 2 >> afile
12 $ hg commit -m "0.2"
12 $ hg commit -m "0.2"
13
13
14 $ echo 3 >> afile
14 $ echo 3 >> afile
15 $ hg commit -m "0.3"
15 $ hg commit -m "0.3"
16
16
17 $ hg update -C 0
17 $ hg update -C 0
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19
19
20 $ echo 1 >> afile
20 $ echo 1 >> afile
21 $ hg commit -m "1.1"
21 $ hg commit -m "1.1"
22 created new head
22 created new head
23
23
24 $ echo 2 >> afile
24 $ echo 2 >> afile
25 $ hg commit -m "1.2"
25 $ hg commit -m "1.2"
26
26
27 $ echo a line > fred
27 $ echo a line > fred
28 $ echo 3 >> afile
28 $ echo 3 >> afile
29 $ hg add fred
29 $ hg add fred
30 $ hg commit -m "1.3"
30 $ hg commit -m "1.3"
31 $ hg mv afile adifferentfile
31 $ hg mv afile adifferentfile
32 $ hg commit -m "1.3m"
32 $ hg commit -m "1.3m"
33
33
34 $ hg update -C 3
34 $ hg update -C 3
35 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
35 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
36
36
37 $ hg mv afile anotherfile
37 $ hg mv afile anotherfile
38 $ hg commit -m "0.3m"
38 $ hg commit -m "0.3m"
39
39
40 $ hg debugrevlogindex -f 1 afile
40 $ hg debugrevlogindex -f 1 afile
41 rev flag size link p1 p2 nodeid
41 rev flag size link p1 p2 nodeid
42 0 0000 2 0 -1 -1 362fef284ce2
42 0 0000 2 0 -1 -1 362fef284ce2
43 1 0000 4 1 0 -1 125144f7e028
43 1 0000 4 1 0 -1 125144f7e028
44 2 0000 6 2 1 -1 4c982badb186
44 2 0000 6 2 1 -1 4c982badb186
45 3 0000 8 3 2 -1 19b1fc555737
45 3 0000 8 3 2 -1 19b1fc555737
46
46
47 $ hg debugindex adifferentfile
47 $ hg debugindex adifferentfile
48 rev linkrev nodeid p1 p2
48 rev linkrev nodeid p1 p2
49 0 7 2565f3199a74 000000000000 000000000000
49 0 7 2565f3199a74 000000000000 000000000000
50
50
51 $ hg debugindex anotherfile
51 $ hg debugindex anotherfile
52 rev linkrev nodeid p1 p2
52 rev linkrev nodeid p1 p2
53 0 8 2565f3199a74 000000000000 000000000000
53 0 8 2565f3199a74 000000000000 000000000000
54
54
55 $ hg debugindex fred
55 $ hg debugindex fred
56 rev linkrev nodeid p1 p2
56 rev linkrev nodeid p1 p2
57 0 6 12ab3bcc5ea4 000000000000 000000000000
57 0 6 12ab3bcc5ea4 000000000000 000000000000
58
58
59 $ hg debugindex --manifest
59 $ hg debugindex --manifest
60 rev linkrev nodeid p1 p2
60 rev linkrev nodeid p1 p2
61 0 0 43eadb1d2d06 000000000000 000000000000
61 0 0 43eadb1d2d06 000000000000 000000000000
62 1 1 8b89697eba2c 43eadb1d2d06 000000000000
62 1 1 8b89697eba2c 43eadb1d2d06 000000000000
63 2 2 626a32663c2f 8b89697eba2c 000000000000
63 2 2 626a32663c2f 8b89697eba2c 000000000000
64 3 3 f54c32f13478 626a32663c2f 000000000000
64 3 3 f54c32f13478 626a32663c2f 000000000000
65 4 6 de68e904d169 626a32663c2f 000000000000
65 4 6 de68e904d169 626a32663c2f 000000000000
66 5 7 09bb521d218d de68e904d169 000000000000
66 5 7 09bb521d218d de68e904d169 000000000000
67 6 8 1fde233dfb0f f54c32f13478 000000000000
67 6 8 1fde233dfb0f f54c32f13478 000000000000
68
68
69 $ hg verify
69 $ hg verify
70 checking changesets
70 checking changesets
71 checking manifests
71 checking manifests
72 crosschecking files in changesets and manifests
72 crosschecking files in changesets and manifests
73 checking files
73 checking files
74 4 files, 9 changesets, 7 total revisions
74 checked 9 changesets with 7 changes to 4 files
75
75
76 $ cd ..
76 $ cd ..
77
77
78 $ for i in 0 1 2 3 4 5 6 7 8; do
78 $ for i in 0 1 2 3 4 5 6 7 8; do
79 > echo
79 > echo
80 > echo ---- hg clone -r "$i" test test-"$i"
80 > echo ---- hg clone -r "$i" test test-"$i"
81 > hg clone -r "$i" test test-"$i"
81 > hg clone -r "$i" test test-"$i"
82 > cd test-"$i"
82 > cd test-"$i"
83 > hg verify
83 > hg verify
84 > cd ..
84 > cd ..
85 > done
85 > done
86
86
87 ---- hg clone -r 0 test test-0
87 ---- hg clone -r 0 test test-0
88 adding changesets
88 adding changesets
89 adding manifests
89 adding manifests
90 adding file changes
90 adding file changes
91 added 1 changesets with 1 changes to 1 files
91 added 1 changesets with 1 changes to 1 files
92 new changesets f9ee2f85a263
92 new changesets f9ee2f85a263
93 updating to branch default
93 updating to branch default
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 checking changesets
95 checking changesets
96 checking manifests
96 checking manifests
97 crosschecking files in changesets and manifests
97 crosschecking files in changesets and manifests
98 checking files
98 checking files
99 1 files, 1 changesets, 1 total revisions
99 checked 1 changesets with 1 changes to 1 files
100
100
101 ---- hg clone -r 1 test test-1
101 ---- hg clone -r 1 test test-1
102 adding changesets
102 adding changesets
103 adding manifests
103 adding manifests
104 adding file changes
104 adding file changes
105 added 2 changesets with 2 changes to 1 files
105 added 2 changesets with 2 changes to 1 files
106 new changesets f9ee2f85a263:34c2bf6b0626
106 new changesets f9ee2f85a263:34c2bf6b0626
107 updating to branch default
107 updating to branch default
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 checking changesets
109 checking changesets
110 checking manifests
110 checking manifests
111 crosschecking files in changesets and manifests
111 crosschecking files in changesets and manifests
112 checking files
112 checking files
113 1 files, 2 changesets, 2 total revisions
113 checked 2 changesets with 2 changes to 1 files
114
114
115 ---- hg clone -r 2 test test-2
115 ---- hg clone -r 2 test test-2
116 adding changesets
116 adding changesets
117 adding manifests
117 adding manifests
118 adding file changes
118 adding file changes
119 added 3 changesets with 3 changes to 1 files
119 added 3 changesets with 3 changes to 1 files
120 new changesets f9ee2f85a263:e38ba6f5b7e0
120 new changesets f9ee2f85a263:e38ba6f5b7e0
121 updating to branch default
121 updating to branch default
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 checking changesets
123 checking changesets
124 checking manifests
124 checking manifests
125 crosschecking files in changesets and manifests
125 crosschecking files in changesets and manifests
126 checking files
126 checking files
127 1 files, 3 changesets, 3 total revisions
127 checked 3 changesets with 3 changes to 1 files
128
128
129 ---- hg clone -r 3 test test-3
129 ---- hg clone -r 3 test test-3
130 adding changesets
130 adding changesets
131 adding manifests
131 adding manifests
132 adding file changes
132 adding file changes
133 added 4 changesets with 4 changes to 1 files
133 added 4 changesets with 4 changes to 1 files
134 new changesets f9ee2f85a263:eebf5a27f8ca
134 new changesets f9ee2f85a263:eebf5a27f8ca
135 updating to branch default
135 updating to branch default
136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 checking changesets
137 checking changesets
138 checking manifests
138 checking manifests
139 crosschecking files in changesets and manifests
139 crosschecking files in changesets and manifests
140 checking files
140 checking files
141 1 files, 4 changesets, 4 total revisions
141 checked 4 changesets with 4 changes to 1 files
142
142
143 ---- hg clone -r 4 test test-4
143 ---- hg clone -r 4 test test-4
144 adding changesets
144 adding changesets
145 adding manifests
145 adding manifests
146 adding file changes
146 adding file changes
147 added 2 changesets with 2 changes to 1 files
147 added 2 changesets with 2 changes to 1 files
148 new changesets f9ee2f85a263:095197eb4973
148 new changesets f9ee2f85a263:095197eb4973
149 updating to branch default
149 updating to branch default
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 checking changesets
151 checking changesets
152 checking manifests
152 checking manifests
153 crosschecking files in changesets and manifests
153 crosschecking files in changesets and manifests
154 checking files
154 checking files
155 1 files, 2 changesets, 2 total revisions
155 checked 2 changesets with 2 changes to 1 files
156
156
157 ---- hg clone -r 5 test test-5
157 ---- hg clone -r 5 test test-5
158 adding changesets
158 adding changesets
159 adding manifests
159 adding manifests
160 adding file changes
160 adding file changes
161 added 3 changesets with 3 changes to 1 files
161 added 3 changesets with 3 changes to 1 files
162 new changesets f9ee2f85a263:1bb50a9436a7
162 new changesets f9ee2f85a263:1bb50a9436a7
163 updating to branch default
163 updating to branch default
164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 checking changesets
165 checking changesets
166 checking manifests
166 checking manifests
167 crosschecking files in changesets and manifests
167 crosschecking files in changesets and manifests
168 checking files
168 checking files
169 1 files, 3 changesets, 3 total revisions
169 checked 3 changesets with 3 changes to 1 files
170
170
171 ---- hg clone -r 6 test test-6
171 ---- hg clone -r 6 test test-6
172 adding changesets
172 adding changesets
173 adding manifests
173 adding manifests
174 adding file changes
174 adding file changes
175 added 4 changesets with 5 changes to 2 files
175 added 4 changesets with 5 changes to 2 files
176 new changesets f9ee2f85a263:7373c1169842
176 new changesets f9ee2f85a263:7373c1169842
177 updating to branch default
177 updating to branch default
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 checking changesets
179 checking changesets
180 checking manifests
180 checking manifests
181 crosschecking files in changesets and manifests
181 crosschecking files in changesets and manifests
182 checking files
182 checking files
183 2 files, 4 changesets, 5 total revisions
183 checked 4 changesets with 5 changes to 2 files
184
184
185 ---- hg clone -r 7 test test-7
185 ---- hg clone -r 7 test test-7
186 adding changesets
186 adding changesets
187 adding manifests
187 adding manifests
188 adding file changes
188 adding file changes
189 added 5 changesets with 6 changes to 3 files
189 added 5 changesets with 6 changes to 3 files
190 new changesets f9ee2f85a263:a6a34bfa0076
190 new changesets f9ee2f85a263:a6a34bfa0076
191 updating to branch default
191 updating to branch default
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 checking changesets
193 checking changesets
194 checking manifests
194 checking manifests
195 crosschecking files in changesets and manifests
195 crosschecking files in changesets and manifests
196 checking files
196 checking files
197 3 files, 5 changesets, 6 total revisions
197 checked 5 changesets with 6 changes to 3 files
198
198
199 ---- hg clone -r 8 test test-8
199 ---- hg clone -r 8 test test-8
200 adding changesets
200 adding changesets
201 adding manifests
201 adding manifests
202 adding file changes
202 adding file changes
203 added 5 changesets with 5 changes to 2 files
203 added 5 changesets with 5 changes to 2 files
204 new changesets f9ee2f85a263:aa35859c02ea
204 new changesets f9ee2f85a263:aa35859c02ea
205 updating to branch default
205 updating to branch default
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 checking changesets
207 checking changesets
208 checking manifests
208 checking manifests
209 crosschecking files in changesets and manifests
209 crosschecking files in changesets and manifests
210 checking files
210 checking files
211 2 files, 5 changesets, 5 total revisions
211 checked 5 changesets with 5 changes to 2 files
212
212
213 $ cd test-8
213 $ cd test-8
214 $ hg pull ../test-7
214 $ hg pull ../test-7
215 pulling from ../test-7
215 pulling from ../test-7
216 searching for changes
216 searching for changes
217 adding changesets
217 adding changesets
218 adding manifests
218 adding manifests
219 adding file changes
219 adding file changes
220 added 4 changesets with 2 changes to 3 files (+1 heads)
220 added 4 changesets with 2 changes to 3 files (+1 heads)
221 new changesets 095197eb4973:a6a34bfa0076
221 new changesets 095197eb4973:a6a34bfa0076
222 (run 'hg heads' to see heads, 'hg merge' to merge)
222 (run 'hg heads' to see heads, 'hg merge' to merge)
223 $ hg verify
223 $ hg verify
224 checking changesets
224 checking changesets
225 checking manifests
225 checking manifests
226 crosschecking files in changesets and manifests
226 crosschecking files in changesets and manifests
227 checking files
227 checking files
228 4 files, 9 changesets, 7 total revisions
228 checked 9 changesets with 7 changes to 4 files
229 $ cd ..
229 $ cd ..
230
230
231 $ hg clone test test-9
231 $ hg clone test test-9
232 updating to branch default
232 updating to branch default
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ cd test-9
234 $ cd test-9
235 $ hg branch foobar
235 $ hg branch foobar
236 marked working directory as branch foobar
236 marked working directory as branch foobar
237 (branches are permanent and global, did you want a bookmark?)
237 (branches are permanent and global, did you want a bookmark?)
238 $ echo file2 >> file2
238 $ echo file2 >> file2
239 $ hg add file2
239 $ hg add file2
240 $ hg commit -m "changeset9"
240 $ hg commit -m "changeset9"
241 $ echo file3 >> file3
241 $ echo file3 >> file3
242 $ hg add file3
242 $ hg add file3
243 $ hg commit -m "changeset10"
243 $ hg commit -m "changeset10"
244 $ cd ..
244 $ cd ..
245 $ hg clone -r 9 -u foobar test-9 test-10
245 $ hg clone -r 9 -u foobar test-9 test-10
246 adding changesets
246 adding changesets
247 adding manifests
247 adding manifests
248 adding file changes
248 adding file changes
249 added 6 changesets with 6 changes to 3 files
249 added 6 changesets with 6 changes to 3 files
250 new changesets f9ee2f85a263:7100abb79635
250 new changesets f9ee2f85a263:7100abb79635
251 updating to branch foobar
251 updating to branch foobar
252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
253
253
254
254
@@ -1,1296 +1,1296 b''
1 #testcases sshv1 sshv2
1 #testcases sshv1 sshv2
2
2
3 #if sshv2
3 #if sshv2
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [experimental]
5 > [experimental]
6 > sshpeer.advertise-v2 = true
6 > sshpeer.advertise-v2 = true
7 > sshserver.support-v2 = true
7 > sshserver.support-v2 = true
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 Prepare repo a:
11 Prepare repo a:
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ echo a > a
15 $ echo a > a
16 $ hg add a
16 $ hg add a
17 $ hg commit -m test
17 $ hg commit -m test
18 $ echo first line > b
18 $ echo first line > b
19 $ hg add b
19 $ hg add b
20
20
21 Create a non-inlined filelog:
21 Create a non-inlined filelog:
22
22
23 $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
23 $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
24 $ for j in 0 1 2 3 4 5 6 7 8 9; do
24 $ for j in 0 1 2 3 4 5 6 7 8 9; do
25 > cat data1 >> b
25 > cat data1 >> b
26 > hg commit -m test
26 > hg commit -m test
27 > done
27 > done
28
28
29 List files in store/data (should show a 'b.d'):
29 List files in store/data (should show a 'b.d'):
30
30
31 #if reporevlogstore
31 #if reporevlogstore
32 $ for i in .hg/store/data/*; do
32 $ for i in .hg/store/data/*; do
33 > echo $i
33 > echo $i
34 > done
34 > done
35 .hg/store/data/a.i
35 .hg/store/data/a.i
36 .hg/store/data/b.d
36 .hg/store/data/b.d
37 .hg/store/data/b.i
37 .hg/store/data/b.i
38 #endif
38 #endif
39
39
40 Trigger branchcache creation:
40 Trigger branchcache creation:
41
41
42 $ hg branches
42 $ hg branches
43 default 10:a7949464abda
43 default 10:a7949464abda
44 $ ls .hg/cache
44 $ ls .hg/cache
45 branch2-served
45 branch2-served
46 checkisexec (execbit !)
46 checkisexec (execbit !)
47 checklink (symlink !)
47 checklink (symlink !)
48 checklink-target (symlink !)
48 checklink-target (symlink !)
49 checknoexec (execbit !)
49 checknoexec (execbit !)
50 manifestfulltextcache (reporevlogstore !)
50 manifestfulltextcache (reporevlogstore !)
51 rbc-names-v1
51 rbc-names-v1
52 rbc-revs-v1
52 rbc-revs-v1
53
53
54 Default operation:
54 Default operation:
55
55
56 $ hg clone . ../b
56 $ hg clone . ../b
57 updating to branch default
57 updating to branch default
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ cd ../b
59 $ cd ../b
60
60
61 Ensure branchcache got copied over:
61 Ensure branchcache got copied over:
62
62
63 $ ls .hg/cache
63 $ ls .hg/cache
64 branch2-served
64 branch2-served
65 checkisexec (execbit !)
65 checkisexec (execbit !)
66 checklink (symlink !)
66 checklink (symlink !)
67 checklink-target (symlink !)
67 checklink-target (symlink !)
68 rbc-names-v1
68 rbc-names-v1
69 rbc-revs-v1
69 rbc-revs-v1
70
70
71 $ cat a
71 $ cat a
72 a
72 a
73 $ hg verify
73 $ hg verify
74 checking changesets
74 checking changesets
75 checking manifests
75 checking manifests
76 crosschecking files in changesets and manifests
76 crosschecking files in changesets and manifests
77 checking files
77 checking files
78 2 files, 11 changesets, 11 total revisions
78 checked 11 changesets with 11 changes to 2 files
79
79
80 Invalid dest '' must abort:
80 Invalid dest '' must abort:
81
81
82 $ hg clone . ''
82 $ hg clone . ''
83 abort: empty destination path is not valid
83 abort: empty destination path is not valid
84 [255]
84 [255]
85
85
86 No update, with debug option:
86 No update, with debug option:
87
87
88 #if hardlink
88 #if hardlink
89 $ hg --debug clone -U . ../c --config progress.debug=true
89 $ hg --debug clone -U . ../c --config progress.debug=true
90 linking: 1
90 linking: 1
91 linking: 2
91 linking: 2
92 linking: 3
92 linking: 3
93 linking: 4
93 linking: 4
94 linking: 5
94 linking: 5
95 linking: 6
95 linking: 6
96 linking: 7
96 linking: 7
97 linking: 8
97 linking: 8
98 linked 8 files (reporevlogstore !)
98 linked 8 files (reporevlogstore !)
99 linking: 9 (reposimplestore !)
99 linking: 9 (reposimplestore !)
100 linking: 10 (reposimplestore !)
100 linking: 10 (reposimplestore !)
101 linking: 11 (reposimplestore !)
101 linking: 11 (reposimplestore !)
102 linking: 12 (reposimplestore !)
102 linking: 12 (reposimplestore !)
103 linking: 13 (reposimplestore !)
103 linking: 13 (reposimplestore !)
104 linking: 14 (reposimplestore !)
104 linking: 14 (reposimplestore !)
105 linking: 15 (reposimplestore !)
105 linking: 15 (reposimplestore !)
106 linking: 16 (reposimplestore !)
106 linking: 16 (reposimplestore !)
107 linking: 17 (reposimplestore !)
107 linking: 17 (reposimplestore !)
108 linking: 18 (reposimplestore !)
108 linking: 18 (reposimplestore !)
109 linked 18 files (reposimplestore !)
109 linked 18 files (reposimplestore !)
110 #else
110 #else
111 $ hg --debug clone -U . ../c --config progress.debug=true
111 $ hg --debug clone -U . ../c --config progress.debug=true
112 linking: 1
112 linking: 1
113 copying: 2
113 copying: 2
114 copying: 3
114 copying: 3
115 copying: 4
115 copying: 4
116 copying: 5
116 copying: 5
117 copying: 6
117 copying: 6
118 copying: 7
118 copying: 7
119 copying: 8
119 copying: 8
120 copied 8 files (reporevlogstore !)
120 copied 8 files (reporevlogstore !)
121 copying: 9 (reposimplestore !)
121 copying: 9 (reposimplestore !)
122 copying: 10 (reposimplestore !)
122 copying: 10 (reposimplestore !)
123 copying: 11 (reposimplestore !)
123 copying: 11 (reposimplestore !)
124 copying: 12 (reposimplestore !)
124 copying: 12 (reposimplestore !)
125 copying: 13 (reposimplestore !)
125 copying: 13 (reposimplestore !)
126 copying: 14 (reposimplestore !)
126 copying: 14 (reposimplestore !)
127 copying: 15 (reposimplestore !)
127 copying: 15 (reposimplestore !)
128 copying: 16 (reposimplestore !)
128 copying: 16 (reposimplestore !)
129 copying: 17 (reposimplestore !)
129 copying: 17 (reposimplestore !)
130 copying: 18 (reposimplestore !)
130 copying: 18 (reposimplestore !)
131 copied 18 files (reposimplestore !)
131 copied 18 files (reposimplestore !)
132 #endif
132 #endif
133 $ cd ../c
133 $ cd ../c
134
134
135 Ensure branchcache got copied over:
135 Ensure branchcache got copied over:
136
136
137 $ ls .hg/cache
137 $ ls .hg/cache
138 branch2-served
138 branch2-served
139 rbc-names-v1
139 rbc-names-v1
140 rbc-revs-v1
140 rbc-revs-v1
141
141
142 $ cat a 2>/dev/null || echo "a not present"
142 $ cat a 2>/dev/null || echo "a not present"
143 a not present
143 a not present
144 $ hg verify
144 $ hg verify
145 checking changesets
145 checking changesets
146 checking manifests
146 checking manifests
147 crosschecking files in changesets and manifests
147 crosschecking files in changesets and manifests
148 checking files
148 checking files
149 2 files, 11 changesets, 11 total revisions
149 checked 11 changesets with 11 changes to 2 files
150
150
151 Default destination:
151 Default destination:
152
152
153 $ mkdir ../d
153 $ mkdir ../d
154 $ cd ../d
154 $ cd ../d
155 $ hg clone ../a
155 $ hg clone ../a
156 destination directory: a
156 destination directory: a
157 updating to branch default
157 updating to branch default
158 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 $ cd a
159 $ cd a
160 $ hg cat a
160 $ hg cat a
161 a
161 a
162 $ cd ../..
162 $ cd ../..
163
163
164 Check that we drop the 'file:' from the path before writing the .hgrc:
164 Check that we drop the 'file:' from the path before writing the .hgrc:
165
165
166 $ hg clone file:a e
166 $ hg clone file:a e
167 updating to branch default
167 updating to branch default
168 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 $ grep 'file:' e/.hg/hgrc
169 $ grep 'file:' e/.hg/hgrc
170 [1]
170 [1]
171
171
172 Check that path aliases are expanded:
172 Check that path aliases are expanded:
173
173
174 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
174 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
175 $ hg -R f showconfig paths.default
175 $ hg -R f showconfig paths.default
176 $TESTTMP/a#0
176 $TESTTMP/a#0
177
177
178 Use --pull:
178 Use --pull:
179
179
180 $ hg clone --pull a g
180 $ hg clone --pull a g
181 requesting all changes
181 requesting all changes
182 adding changesets
182 adding changesets
183 adding manifests
183 adding manifests
184 adding file changes
184 adding file changes
185 added 11 changesets with 11 changes to 2 files
185 added 11 changesets with 11 changes to 2 files
186 new changesets acb14030fe0a:a7949464abda
186 new changesets acb14030fe0a:a7949464abda
187 updating to branch default
187 updating to branch default
188 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 $ hg -R g verify
189 $ hg -R g verify
190 checking changesets
190 checking changesets
191 checking manifests
191 checking manifests
192 crosschecking files in changesets and manifests
192 crosschecking files in changesets and manifests
193 checking files
193 checking files
194 2 files, 11 changesets, 11 total revisions
194 checked 11 changesets with 11 changes to 2 files
195
195
196 Invalid dest '' with --pull must abort (issue2528):
196 Invalid dest '' with --pull must abort (issue2528):
197
197
198 $ hg clone --pull a ''
198 $ hg clone --pull a ''
199 abort: empty destination path is not valid
199 abort: empty destination path is not valid
200 [255]
200 [255]
201
201
202 Clone to '.':
202 Clone to '.':
203
203
204 $ mkdir h
204 $ mkdir h
205 $ cd h
205 $ cd h
206 $ hg clone ../a .
206 $ hg clone ../a .
207 updating to branch default
207 updating to branch default
208 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 $ cd ..
209 $ cd ..
210
210
211
211
212 *** Tests for option -u ***
212 *** Tests for option -u ***
213
213
214 Adding some more history to repo a:
214 Adding some more history to repo a:
215
215
216 $ cd a
216 $ cd a
217 $ hg tag ref1
217 $ hg tag ref1
218 $ echo the quick brown fox >a
218 $ echo the quick brown fox >a
219 $ hg ci -m "hacked default"
219 $ hg ci -m "hacked default"
220 $ hg up ref1
220 $ hg up ref1
221 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
221 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
222 $ hg branch stable
222 $ hg branch stable
223 marked working directory as branch stable
223 marked working directory as branch stable
224 (branches are permanent and global, did you want a bookmark?)
224 (branches are permanent and global, did you want a bookmark?)
225 $ echo some text >a
225 $ echo some text >a
226 $ hg ci -m "starting branch stable"
226 $ hg ci -m "starting branch stable"
227 $ hg tag ref2
227 $ hg tag ref2
228 $ echo some more text >a
228 $ echo some more text >a
229 $ hg ci -m "another change for branch stable"
229 $ hg ci -m "another change for branch stable"
230 $ hg up ref2
230 $ hg up ref2
231 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
231 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
232 $ hg parents
232 $ hg parents
233 changeset: 13:e8ece76546a6
233 changeset: 13:e8ece76546a6
234 branch: stable
234 branch: stable
235 tag: ref2
235 tag: ref2
236 parent: 10:a7949464abda
236 parent: 10:a7949464abda
237 user: test
237 user: test
238 date: Thu Jan 01 00:00:00 1970 +0000
238 date: Thu Jan 01 00:00:00 1970 +0000
239 summary: starting branch stable
239 summary: starting branch stable
240
240
241
241
242 Repo a has two heads:
242 Repo a has two heads:
243
243
244 $ hg heads
244 $ hg heads
245 changeset: 15:0aae7cf88f0d
245 changeset: 15:0aae7cf88f0d
246 branch: stable
246 branch: stable
247 tag: tip
247 tag: tip
248 user: test
248 user: test
249 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
250 summary: another change for branch stable
250 summary: another change for branch stable
251
251
252 changeset: 12:f21241060d6a
252 changeset: 12:f21241060d6a
253 user: test
253 user: test
254 date: Thu Jan 01 00:00:00 1970 +0000
254 date: Thu Jan 01 00:00:00 1970 +0000
255 summary: hacked default
255 summary: hacked default
256
256
257
257
258 $ cd ..
258 $ cd ..
259
259
260
260
261 Testing --noupdate with --updaterev (must abort):
261 Testing --noupdate with --updaterev (must abort):
262
262
263 $ hg clone --noupdate --updaterev 1 a ua
263 $ hg clone --noupdate --updaterev 1 a ua
264 abort: cannot specify both --noupdate and --updaterev
264 abort: cannot specify both --noupdate and --updaterev
265 [255]
265 [255]
266
266
267
267
268 Testing clone -u:
268 Testing clone -u:
269
269
270 $ hg clone -u . a ua
270 $ hg clone -u . a ua
271 updating to branch stable
271 updating to branch stable
272 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
273
273
274 Repo ua has both heads:
274 Repo ua has both heads:
275
275
276 $ hg -R ua heads
276 $ hg -R ua heads
277 changeset: 15:0aae7cf88f0d
277 changeset: 15:0aae7cf88f0d
278 branch: stable
278 branch: stable
279 tag: tip
279 tag: tip
280 user: test
280 user: test
281 date: Thu Jan 01 00:00:00 1970 +0000
281 date: Thu Jan 01 00:00:00 1970 +0000
282 summary: another change for branch stable
282 summary: another change for branch stable
283
283
284 changeset: 12:f21241060d6a
284 changeset: 12:f21241060d6a
285 user: test
285 user: test
286 date: Thu Jan 01 00:00:00 1970 +0000
286 date: Thu Jan 01 00:00:00 1970 +0000
287 summary: hacked default
287 summary: hacked default
288
288
289
289
290 Same revision checked out in repo a and ua:
290 Same revision checked out in repo a and ua:
291
291
292 $ hg -R a parents --template "{node|short}\n"
292 $ hg -R a parents --template "{node|short}\n"
293 e8ece76546a6
293 e8ece76546a6
294 $ hg -R ua parents --template "{node|short}\n"
294 $ hg -R ua parents --template "{node|short}\n"
295 e8ece76546a6
295 e8ece76546a6
296
296
297 $ rm -r ua
297 $ rm -r ua
298
298
299
299
300 Testing clone --pull -u:
300 Testing clone --pull -u:
301
301
302 $ hg clone --pull -u . a ua
302 $ hg clone --pull -u . a ua
303 requesting all changes
303 requesting all changes
304 adding changesets
304 adding changesets
305 adding manifests
305 adding manifests
306 adding file changes
306 adding file changes
307 added 16 changesets with 16 changes to 3 files (+1 heads)
307 added 16 changesets with 16 changes to 3 files (+1 heads)
308 new changesets acb14030fe0a:0aae7cf88f0d
308 new changesets acb14030fe0a:0aae7cf88f0d
309 updating to branch stable
309 updating to branch stable
310 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
311
311
312 Repo ua has both heads:
312 Repo ua has both heads:
313
313
314 $ hg -R ua heads
314 $ hg -R ua heads
315 changeset: 15:0aae7cf88f0d
315 changeset: 15:0aae7cf88f0d
316 branch: stable
316 branch: stable
317 tag: tip
317 tag: tip
318 user: test
318 user: test
319 date: Thu Jan 01 00:00:00 1970 +0000
319 date: Thu Jan 01 00:00:00 1970 +0000
320 summary: another change for branch stable
320 summary: another change for branch stable
321
321
322 changeset: 12:f21241060d6a
322 changeset: 12:f21241060d6a
323 user: test
323 user: test
324 date: Thu Jan 01 00:00:00 1970 +0000
324 date: Thu Jan 01 00:00:00 1970 +0000
325 summary: hacked default
325 summary: hacked default
326
326
327
327
328 Same revision checked out in repo a and ua:
328 Same revision checked out in repo a and ua:
329
329
330 $ hg -R a parents --template "{node|short}\n"
330 $ hg -R a parents --template "{node|short}\n"
331 e8ece76546a6
331 e8ece76546a6
332 $ hg -R ua parents --template "{node|short}\n"
332 $ hg -R ua parents --template "{node|short}\n"
333 e8ece76546a6
333 e8ece76546a6
334
334
335 $ rm -r ua
335 $ rm -r ua
336
336
337
337
338 Testing clone -u <branch>:
338 Testing clone -u <branch>:
339
339
340 $ hg clone -u stable a ua
340 $ hg clone -u stable a ua
341 updating to branch stable
341 updating to branch stable
342 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
343
343
344 Repo ua has both heads:
344 Repo ua has both heads:
345
345
346 $ hg -R ua heads
346 $ hg -R ua heads
347 changeset: 15:0aae7cf88f0d
347 changeset: 15:0aae7cf88f0d
348 branch: stable
348 branch: stable
349 tag: tip
349 tag: tip
350 user: test
350 user: test
351 date: Thu Jan 01 00:00:00 1970 +0000
351 date: Thu Jan 01 00:00:00 1970 +0000
352 summary: another change for branch stable
352 summary: another change for branch stable
353
353
354 changeset: 12:f21241060d6a
354 changeset: 12:f21241060d6a
355 user: test
355 user: test
356 date: Thu Jan 01 00:00:00 1970 +0000
356 date: Thu Jan 01 00:00:00 1970 +0000
357 summary: hacked default
357 summary: hacked default
358
358
359
359
360 Branch 'stable' is checked out:
360 Branch 'stable' is checked out:
361
361
362 $ hg -R ua parents
362 $ hg -R ua parents
363 changeset: 15:0aae7cf88f0d
363 changeset: 15:0aae7cf88f0d
364 branch: stable
364 branch: stable
365 tag: tip
365 tag: tip
366 user: test
366 user: test
367 date: Thu Jan 01 00:00:00 1970 +0000
367 date: Thu Jan 01 00:00:00 1970 +0000
368 summary: another change for branch stable
368 summary: another change for branch stable
369
369
370
370
371 $ rm -r ua
371 $ rm -r ua
372
372
373
373
374 Testing default checkout:
374 Testing default checkout:
375
375
376 $ hg clone a ua
376 $ hg clone a ua
377 updating to branch default
377 updating to branch default
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379
379
380 Repo ua has both heads:
380 Repo ua has both heads:
381
381
382 $ hg -R ua heads
382 $ hg -R ua heads
383 changeset: 15:0aae7cf88f0d
383 changeset: 15:0aae7cf88f0d
384 branch: stable
384 branch: stable
385 tag: tip
385 tag: tip
386 user: test
386 user: test
387 date: Thu Jan 01 00:00:00 1970 +0000
387 date: Thu Jan 01 00:00:00 1970 +0000
388 summary: another change for branch stable
388 summary: another change for branch stable
389
389
390 changeset: 12:f21241060d6a
390 changeset: 12:f21241060d6a
391 user: test
391 user: test
392 date: Thu Jan 01 00:00:00 1970 +0000
392 date: Thu Jan 01 00:00:00 1970 +0000
393 summary: hacked default
393 summary: hacked default
394
394
395
395
396 Branch 'default' is checked out:
396 Branch 'default' is checked out:
397
397
398 $ hg -R ua parents
398 $ hg -R ua parents
399 changeset: 12:f21241060d6a
399 changeset: 12:f21241060d6a
400 user: test
400 user: test
401 date: Thu Jan 01 00:00:00 1970 +0000
401 date: Thu Jan 01 00:00:00 1970 +0000
402 summary: hacked default
402 summary: hacked default
403
403
404 Test clone with a branch named "@" (issue3677)
404 Test clone with a branch named "@" (issue3677)
405
405
406 $ hg -R ua branch @
406 $ hg -R ua branch @
407 marked working directory as branch @
407 marked working directory as branch @
408 $ hg -R ua commit -m 'created branch @'
408 $ hg -R ua commit -m 'created branch @'
409 $ hg clone ua atbranch
409 $ hg clone ua atbranch
410 updating to branch default
410 updating to branch default
411 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 $ hg -R atbranch heads
412 $ hg -R atbranch heads
413 changeset: 16:798b6d97153e
413 changeset: 16:798b6d97153e
414 branch: @
414 branch: @
415 tag: tip
415 tag: tip
416 parent: 12:f21241060d6a
416 parent: 12:f21241060d6a
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:00 1970 +0000
418 date: Thu Jan 01 00:00:00 1970 +0000
419 summary: created branch @
419 summary: created branch @
420
420
421 changeset: 15:0aae7cf88f0d
421 changeset: 15:0aae7cf88f0d
422 branch: stable
422 branch: stable
423 user: test
423 user: test
424 date: Thu Jan 01 00:00:00 1970 +0000
424 date: Thu Jan 01 00:00:00 1970 +0000
425 summary: another change for branch stable
425 summary: another change for branch stable
426
426
427 changeset: 12:f21241060d6a
427 changeset: 12:f21241060d6a
428 user: test
428 user: test
429 date: Thu Jan 01 00:00:00 1970 +0000
429 date: Thu Jan 01 00:00:00 1970 +0000
430 summary: hacked default
430 summary: hacked default
431
431
432 $ hg -R atbranch parents
432 $ hg -R atbranch parents
433 changeset: 12:f21241060d6a
433 changeset: 12:f21241060d6a
434 user: test
434 user: test
435 date: Thu Jan 01 00:00:00 1970 +0000
435 date: Thu Jan 01 00:00:00 1970 +0000
436 summary: hacked default
436 summary: hacked default
437
437
438
438
439 $ rm -r ua atbranch
439 $ rm -r ua atbranch
440
440
441
441
442 Testing #<branch>:
442 Testing #<branch>:
443
443
444 $ hg clone -u . a#stable ua
444 $ hg clone -u . a#stable ua
445 adding changesets
445 adding changesets
446 adding manifests
446 adding manifests
447 adding file changes
447 adding file changes
448 added 14 changesets with 14 changes to 3 files
448 added 14 changesets with 14 changes to 3 files
449 new changesets acb14030fe0a:0aae7cf88f0d
449 new changesets acb14030fe0a:0aae7cf88f0d
450 updating to branch stable
450 updating to branch stable
451 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
451 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
452
452
453 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
453 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
454
454
455 $ hg -R ua heads
455 $ hg -R ua heads
456 changeset: 13:0aae7cf88f0d
456 changeset: 13:0aae7cf88f0d
457 branch: stable
457 branch: stable
458 tag: tip
458 tag: tip
459 user: test
459 user: test
460 date: Thu Jan 01 00:00:00 1970 +0000
460 date: Thu Jan 01 00:00:00 1970 +0000
461 summary: another change for branch stable
461 summary: another change for branch stable
462
462
463 changeset: 10:a7949464abda
463 changeset: 10:a7949464abda
464 user: test
464 user: test
465 date: Thu Jan 01 00:00:00 1970 +0000
465 date: Thu Jan 01 00:00:00 1970 +0000
466 summary: test
466 summary: test
467
467
468
468
469 Same revision checked out in repo a and ua:
469 Same revision checked out in repo a and ua:
470
470
471 $ hg -R a parents --template "{node|short}\n"
471 $ hg -R a parents --template "{node|short}\n"
472 e8ece76546a6
472 e8ece76546a6
473 $ hg -R ua parents --template "{node|short}\n"
473 $ hg -R ua parents --template "{node|short}\n"
474 e8ece76546a6
474 e8ece76546a6
475
475
476 $ rm -r ua
476 $ rm -r ua
477
477
478
478
479 Testing -u -r <branch>:
479 Testing -u -r <branch>:
480
480
481 $ hg clone -u . -r stable a ua
481 $ hg clone -u . -r stable a ua
482 adding changesets
482 adding changesets
483 adding manifests
483 adding manifests
484 adding file changes
484 adding file changes
485 added 14 changesets with 14 changes to 3 files
485 added 14 changesets with 14 changes to 3 files
486 new changesets acb14030fe0a:0aae7cf88f0d
486 new changesets acb14030fe0a:0aae7cf88f0d
487 updating to branch stable
487 updating to branch stable
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
489
489
490 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
490 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
491
491
492 $ hg -R ua heads
492 $ hg -R ua heads
493 changeset: 13:0aae7cf88f0d
493 changeset: 13:0aae7cf88f0d
494 branch: stable
494 branch: stable
495 tag: tip
495 tag: tip
496 user: test
496 user: test
497 date: Thu Jan 01 00:00:00 1970 +0000
497 date: Thu Jan 01 00:00:00 1970 +0000
498 summary: another change for branch stable
498 summary: another change for branch stable
499
499
500 changeset: 10:a7949464abda
500 changeset: 10:a7949464abda
501 user: test
501 user: test
502 date: Thu Jan 01 00:00:00 1970 +0000
502 date: Thu Jan 01 00:00:00 1970 +0000
503 summary: test
503 summary: test
504
504
505
505
506 Same revision checked out in repo a and ua:
506 Same revision checked out in repo a and ua:
507
507
508 $ hg -R a parents --template "{node|short}\n"
508 $ hg -R a parents --template "{node|short}\n"
509 e8ece76546a6
509 e8ece76546a6
510 $ hg -R ua parents --template "{node|short}\n"
510 $ hg -R ua parents --template "{node|short}\n"
511 e8ece76546a6
511 e8ece76546a6
512
512
513 $ rm -r ua
513 $ rm -r ua
514
514
515
515
516 Testing -r <branch>:
516 Testing -r <branch>:
517
517
518 $ hg clone -r stable a ua
518 $ hg clone -r stable a ua
519 adding changesets
519 adding changesets
520 adding manifests
520 adding manifests
521 adding file changes
521 adding file changes
522 added 14 changesets with 14 changes to 3 files
522 added 14 changesets with 14 changes to 3 files
523 new changesets acb14030fe0a:0aae7cf88f0d
523 new changesets acb14030fe0a:0aae7cf88f0d
524 updating to branch stable
524 updating to branch stable
525 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
526
526
527 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
527 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
528
528
529 $ hg -R ua heads
529 $ hg -R ua heads
530 changeset: 13:0aae7cf88f0d
530 changeset: 13:0aae7cf88f0d
531 branch: stable
531 branch: stable
532 tag: tip
532 tag: tip
533 user: test
533 user: test
534 date: Thu Jan 01 00:00:00 1970 +0000
534 date: Thu Jan 01 00:00:00 1970 +0000
535 summary: another change for branch stable
535 summary: another change for branch stable
536
536
537 changeset: 10:a7949464abda
537 changeset: 10:a7949464abda
538 user: test
538 user: test
539 date: Thu Jan 01 00:00:00 1970 +0000
539 date: Thu Jan 01 00:00:00 1970 +0000
540 summary: test
540 summary: test
541
541
542
542
543 Branch 'stable' is checked out:
543 Branch 'stable' is checked out:
544
544
545 $ hg -R ua parents
545 $ hg -R ua parents
546 changeset: 13:0aae7cf88f0d
546 changeset: 13:0aae7cf88f0d
547 branch: stable
547 branch: stable
548 tag: tip
548 tag: tip
549 user: test
549 user: test
550 date: Thu Jan 01 00:00:00 1970 +0000
550 date: Thu Jan 01 00:00:00 1970 +0000
551 summary: another change for branch stable
551 summary: another change for branch stable
552
552
553
553
554 $ rm -r ua
554 $ rm -r ua
555
555
556
556
557 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
557 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
558 iterable in addbranchrevs()
558 iterable in addbranchrevs()
559
559
560 $ cat <<EOF > simpleclone.py
560 $ cat <<EOF > simpleclone.py
561 > from mercurial import ui, hg
561 > from mercurial import ui, hg
562 > myui = ui.ui.load()
562 > myui = ui.ui.load()
563 > repo = hg.repository(myui, b'a')
563 > repo = hg.repository(myui, b'a')
564 > hg.clone(myui, {}, repo, dest=b"ua")
564 > hg.clone(myui, {}, repo, dest=b"ua")
565 > EOF
565 > EOF
566
566
567 $ $PYTHON simpleclone.py
567 $ $PYTHON simpleclone.py
568 updating to branch default
568 updating to branch default
569 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
569 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
570
570
571 $ rm -r ua
571 $ rm -r ua
572
572
573 $ cat <<EOF > branchclone.py
573 $ cat <<EOF > branchclone.py
574 > from mercurial import ui, hg, extensions
574 > from mercurial import ui, hg, extensions
575 > myui = ui.ui.load()
575 > myui = ui.ui.load()
576 > extensions.loadall(myui)
576 > extensions.loadall(myui)
577 > repo = hg.repository(myui, b'a')
577 > repo = hg.repository(myui, b'a')
578 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable",])
578 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable",])
579 > EOF
579 > EOF
580
580
581 $ $PYTHON branchclone.py
581 $ $PYTHON branchclone.py
582 adding changesets
582 adding changesets
583 adding manifests
583 adding manifests
584 adding file changes
584 adding file changes
585 added 14 changesets with 14 changes to 3 files
585 added 14 changesets with 14 changes to 3 files
586 new changesets acb14030fe0a:0aae7cf88f0d
586 new changesets acb14030fe0a:0aae7cf88f0d
587 updating to branch stable
587 updating to branch stable
588 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
589 $ rm -r ua
589 $ rm -r ua
590
590
591
591
592 Test clone with special '@' bookmark:
592 Test clone with special '@' bookmark:
593 $ cd a
593 $ cd a
594 $ hg bookmark -r a7949464abda @ # branch point of stable from default
594 $ hg bookmark -r a7949464abda @ # branch point of stable from default
595 $ hg clone . ../i
595 $ hg clone . ../i
596 updating to bookmark @
596 updating to bookmark @
597 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 $ hg id -i ../i
598 $ hg id -i ../i
599 a7949464abda
599 a7949464abda
600 $ rm -r ../i
600 $ rm -r ../i
601
601
602 $ hg bookmark -f -r stable @
602 $ hg bookmark -f -r stable @
603 $ hg bookmarks
603 $ hg bookmarks
604 @ 15:0aae7cf88f0d
604 @ 15:0aae7cf88f0d
605 $ hg clone . ../i
605 $ hg clone . ../i
606 updating to bookmark @ on branch stable
606 updating to bookmark @ on branch stable
607 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 $ hg id -i ../i
608 $ hg id -i ../i
609 0aae7cf88f0d
609 0aae7cf88f0d
610 $ cd "$TESTTMP"
610 $ cd "$TESTTMP"
611
611
612
612
613 Testing failures:
613 Testing failures:
614
614
615 $ mkdir fail
615 $ mkdir fail
616 $ cd fail
616 $ cd fail
617
617
618 No local source
618 No local source
619
619
620 $ hg clone a b
620 $ hg clone a b
621 abort: repository a not found!
621 abort: repository a not found!
622 [255]
622 [255]
623
623
624 No remote source
624 No remote source
625
625
626 #if windows
626 #if windows
627 $ hg clone http://$LOCALIP:3121/a b
627 $ hg clone http://$LOCALIP:3121/a b
628 abort: error: * (glob)
628 abort: error: * (glob)
629 [255]
629 [255]
630 #else
630 #else
631 $ hg clone http://$LOCALIP:3121/a b
631 $ hg clone http://$LOCALIP:3121/a b
632 abort: error: *refused* (glob)
632 abort: error: *refused* (glob)
633 [255]
633 [255]
634 #endif
634 #endif
635 $ rm -rf b # work around bug with http clone
635 $ rm -rf b # work around bug with http clone
636
636
637
637
638 #if unix-permissions no-root
638 #if unix-permissions no-root
639
639
640 Inaccessible source
640 Inaccessible source
641
641
642 $ mkdir a
642 $ mkdir a
643 $ chmod 000 a
643 $ chmod 000 a
644 $ hg clone a b
644 $ hg clone a b
645 abort: Permission denied: '$TESTTMP/fail/a/.hg'
645 abort: Permission denied: '$TESTTMP/fail/a/.hg'
646 [255]
646 [255]
647
647
648 Inaccessible destination
648 Inaccessible destination
649
649
650 $ hg init b
650 $ hg init b
651 $ cd b
651 $ cd b
652 $ hg clone . ../a
652 $ hg clone . ../a
653 abort: Permission denied: '../a'
653 abort: Permission denied: '../a'
654 [255]
654 [255]
655 $ cd ..
655 $ cd ..
656 $ chmod 700 a
656 $ chmod 700 a
657 $ rm -r a b
657 $ rm -r a b
658
658
659 #endif
659 #endif
660
660
661
661
662 #if fifo
662 #if fifo
663
663
664 Source of wrong type
664 Source of wrong type
665
665
666 $ mkfifo a
666 $ mkfifo a
667 $ hg clone a b
667 $ hg clone a b
668 abort: $ENOTDIR$: '$TESTTMP/fail/a/.hg'
668 abort: $ENOTDIR$: '$TESTTMP/fail/a/.hg'
669 [255]
669 [255]
670 $ rm a
670 $ rm a
671
671
672 #endif
672 #endif
673
673
674 Default destination, same directory
674 Default destination, same directory
675
675
676 $ hg init q
676 $ hg init q
677 $ hg clone q
677 $ hg clone q
678 destination directory: q
678 destination directory: q
679 abort: destination 'q' is not empty
679 abort: destination 'q' is not empty
680 [255]
680 [255]
681
681
682 destination directory not empty
682 destination directory not empty
683
683
684 $ mkdir a
684 $ mkdir a
685 $ echo stuff > a/a
685 $ echo stuff > a/a
686 $ hg clone q a
686 $ hg clone q a
687 abort: destination 'a' is not empty
687 abort: destination 'a' is not empty
688 [255]
688 [255]
689
689
690
690
691 #if unix-permissions no-root
691 #if unix-permissions no-root
692
692
693 leave existing directory in place after clone failure
693 leave existing directory in place after clone failure
694
694
695 $ hg init c
695 $ hg init c
696 $ cd c
696 $ cd c
697 $ echo c > c
697 $ echo c > c
698 $ hg commit -A -m test
698 $ hg commit -A -m test
699 adding c
699 adding c
700 $ chmod -rx .hg/store/data
700 $ chmod -rx .hg/store/data
701 $ cd ..
701 $ cd ..
702 $ mkdir d
702 $ mkdir d
703 $ hg clone c d 2> err
703 $ hg clone c d 2> err
704 [255]
704 [255]
705 $ test -d d
705 $ test -d d
706 $ test -d d/.hg
706 $ test -d d/.hg
707 [1]
707 [1]
708
708
709 re-enable perm to allow deletion
709 re-enable perm to allow deletion
710
710
711 $ chmod +rx c/.hg/store/data
711 $ chmod +rx c/.hg/store/data
712
712
713 #endif
713 #endif
714
714
715 $ cd ..
715 $ cd ..
716
716
717 Test clone from the repository in (emulated) revlog format 0 (issue4203):
717 Test clone from the repository in (emulated) revlog format 0 (issue4203):
718
718
719 $ mkdir issue4203
719 $ mkdir issue4203
720 $ mkdir -p src/.hg
720 $ mkdir -p src/.hg
721 $ echo foo > src/foo
721 $ echo foo > src/foo
722 $ hg -R src add src/foo
722 $ hg -R src add src/foo
723 $ hg -R src commit -m '#0'
723 $ hg -R src commit -m '#0'
724 $ hg -R src log -q
724 $ hg -R src log -q
725 0:e1bab28bca43
725 0:e1bab28bca43
726 $ hg clone -U -q src dst
726 $ hg clone -U -q src dst
727 $ hg -R dst log -q
727 $ hg -R dst log -q
728 0:e1bab28bca43
728 0:e1bab28bca43
729
729
730 Create repositories to test auto sharing functionality
730 Create repositories to test auto sharing functionality
731
731
732 $ cat >> $HGRCPATH << EOF
732 $ cat >> $HGRCPATH << EOF
733 > [extensions]
733 > [extensions]
734 > share=
734 > share=
735 > EOF
735 > EOF
736
736
737 $ hg init empty
737 $ hg init empty
738 $ hg init source1a
738 $ hg init source1a
739 $ cd source1a
739 $ cd source1a
740 $ echo initial1 > foo
740 $ echo initial1 > foo
741 $ hg -q commit -A -m initial
741 $ hg -q commit -A -m initial
742 $ echo second > foo
742 $ echo second > foo
743 $ hg commit -m second
743 $ hg commit -m second
744 $ cd ..
744 $ cd ..
745
745
746 $ hg init filteredrev0
746 $ hg init filteredrev0
747 $ cd filteredrev0
747 $ cd filteredrev0
748 $ cat >> .hg/hgrc << EOF
748 $ cat >> .hg/hgrc << EOF
749 > [experimental]
749 > [experimental]
750 > evolution.createmarkers=True
750 > evolution.createmarkers=True
751 > EOF
751 > EOF
752 $ echo initial1 > foo
752 $ echo initial1 > foo
753 $ hg -q commit -A -m initial0
753 $ hg -q commit -A -m initial0
754 $ hg -q up -r null
754 $ hg -q up -r null
755 $ echo initial2 > foo
755 $ echo initial2 > foo
756 $ hg -q commit -A -m initial1
756 $ hg -q commit -A -m initial1
757 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
757 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
758 obsoleted 1 changesets
758 obsoleted 1 changesets
759 $ cd ..
759 $ cd ..
760
760
761 $ hg -q clone --pull source1a source1b
761 $ hg -q clone --pull source1a source1b
762 $ cd source1a
762 $ cd source1a
763 $ hg bookmark bookA
763 $ hg bookmark bookA
764 $ echo 1a > foo
764 $ echo 1a > foo
765 $ hg commit -m 1a
765 $ hg commit -m 1a
766 $ cd ../source1b
766 $ cd ../source1b
767 $ hg -q up -r 0
767 $ hg -q up -r 0
768 $ echo head1 > foo
768 $ echo head1 > foo
769 $ hg commit -m head1
769 $ hg commit -m head1
770 created new head
770 created new head
771 $ hg bookmark head1
771 $ hg bookmark head1
772 $ hg -q up -r 0
772 $ hg -q up -r 0
773 $ echo head2 > foo
773 $ echo head2 > foo
774 $ hg commit -m head2
774 $ hg commit -m head2
775 created new head
775 created new head
776 $ hg bookmark head2
776 $ hg bookmark head2
777 $ hg -q up -r 0
777 $ hg -q up -r 0
778 $ hg branch branch1
778 $ hg branch branch1
779 marked working directory as branch branch1
779 marked working directory as branch branch1
780 (branches are permanent and global, did you want a bookmark?)
780 (branches are permanent and global, did you want a bookmark?)
781 $ echo branch1 > foo
781 $ echo branch1 > foo
782 $ hg commit -m branch1
782 $ hg commit -m branch1
783 $ hg -q up -r 0
783 $ hg -q up -r 0
784 $ hg branch branch2
784 $ hg branch branch2
785 marked working directory as branch branch2
785 marked working directory as branch branch2
786 $ echo branch2 > foo
786 $ echo branch2 > foo
787 $ hg commit -m branch2
787 $ hg commit -m branch2
788 $ cd ..
788 $ cd ..
789 $ hg init source2
789 $ hg init source2
790 $ cd source2
790 $ cd source2
791 $ echo initial2 > foo
791 $ echo initial2 > foo
792 $ hg -q commit -A -m initial2
792 $ hg -q commit -A -m initial2
793 $ echo second > foo
793 $ echo second > foo
794 $ hg commit -m second
794 $ hg commit -m second
795 $ cd ..
795 $ cd ..
796
796
797 Clone with auto share from an empty repo should not result in share
797 Clone with auto share from an empty repo should not result in share
798
798
799 $ mkdir share
799 $ mkdir share
800 $ hg --config share.pool=share clone empty share-empty
800 $ hg --config share.pool=share clone empty share-empty
801 (not using pooled storage: remote appears to be empty)
801 (not using pooled storage: remote appears to be empty)
802 updating to branch default
802 updating to branch default
803 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
803 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
804 $ ls share
804 $ ls share
805 $ test -d share-empty/.hg/store
805 $ test -d share-empty/.hg/store
806 $ test -f share-empty/.hg/sharedpath
806 $ test -f share-empty/.hg/sharedpath
807 [1]
807 [1]
808
808
809 Clone with auto share from a repo with filtered revision 0 should not result in share
809 Clone with auto share from a repo with filtered revision 0 should not result in share
810
810
811 $ hg --config share.pool=share clone filteredrev0 share-filtered
811 $ hg --config share.pool=share clone filteredrev0 share-filtered
812 (not using pooled storage: unable to resolve identity of remote)
812 (not using pooled storage: unable to resolve identity of remote)
813 requesting all changes
813 requesting all changes
814 adding changesets
814 adding changesets
815 adding manifests
815 adding manifests
816 adding file changes
816 adding file changes
817 added 1 changesets with 1 changes to 1 files
817 added 1 changesets with 1 changes to 1 files
818 new changesets e082c1832e09
818 new changesets e082c1832e09
819 updating to branch default
819 updating to branch default
820 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
820 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
821
821
822 Clone from repo with content should result in shared store being created
822 Clone from repo with content should result in shared store being created
823
823
824 $ hg --config share.pool=share clone source1a share-dest1a
824 $ hg --config share.pool=share clone source1a share-dest1a
825 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
825 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
826 requesting all changes
826 requesting all changes
827 adding changesets
827 adding changesets
828 adding manifests
828 adding manifests
829 adding file changes
829 adding file changes
830 added 3 changesets with 3 changes to 1 files
830 added 3 changesets with 3 changes to 1 files
831 new changesets b5f04eac9d8f:e5bfe23c0b47
831 new changesets b5f04eac9d8f:e5bfe23c0b47
832 searching for changes
832 searching for changes
833 no changes found
833 no changes found
834 adding remote bookmark bookA
834 adding remote bookmark bookA
835 updating working directory
835 updating working directory
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
837
837
838 The shared repo should have been created
838 The shared repo should have been created
839
839
840 $ ls share
840 $ ls share
841 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
841 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
842
842
843 The destination should point to it
843 The destination should point to it
844
844
845 $ cat share-dest1a/.hg/sharedpath; echo
845 $ cat share-dest1a/.hg/sharedpath; echo
846 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
846 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
847
847
848 The destination should have bookmarks
848 The destination should have bookmarks
849
849
850 $ hg -R share-dest1a bookmarks
850 $ hg -R share-dest1a bookmarks
851 bookA 2:e5bfe23c0b47
851 bookA 2:e5bfe23c0b47
852
852
853 The default path should be the remote, not the share
853 The default path should be the remote, not the share
854
854
855 $ hg -R share-dest1a config paths.default
855 $ hg -R share-dest1a config paths.default
856 $TESTTMP/source1a
856 $TESTTMP/source1a
857
857
858 Clone with existing share dir should result in pull + share
858 Clone with existing share dir should result in pull + share
859
859
860 $ hg --config share.pool=share clone source1b share-dest1b
860 $ hg --config share.pool=share clone source1b share-dest1b
861 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
861 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
862 searching for changes
862 searching for changes
863 adding changesets
863 adding changesets
864 adding manifests
864 adding manifests
865 adding file changes
865 adding file changes
866 added 4 changesets with 4 changes to 1 files (+4 heads)
866 added 4 changesets with 4 changes to 1 files (+4 heads)
867 adding remote bookmark head1
867 adding remote bookmark head1
868 adding remote bookmark head2
868 adding remote bookmark head2
869 new changesets 4a8dc1ab4c13:6bacf4683960
869 new changesets 4a8dc1ab4c13:6bacf4683960
870 updating working directory
870 updating working directory
871 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
871 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
872
872
873 $ ls share
873 $ ls share
874 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
874 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
875
875
876 $ cat share-dest1b/.hg/sharedpath; echo
876 $ cat share-dest1b/.hg/sharedpath; echo
877 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
877 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
878
878
879 We only get bookmarks from the remote, not everything in the share
879 We only get bookmarks from the remote, not everything in the share
880
880
881 $ hg -R share-dest1b bookmarks
881 $ hg -R share-dest1b bookmarks
882 head1 3:4a8dc1ab4c13
882 head1 3:4a8dc1ab4c13
883 head2 4:99f71071f117
883 head2 4:99f71071f117
884
884
885 Default path should be source, not share.
885 Default path should be source, not share.
886
886
887 $ hg -R share-dest1b config paths.default
887 $ hg -R share-dest1b config paths.default
888 $TESTTMP/source1b
888 $TESTTMP/source1b
889
889
890 Checked out revision should be head of default branch
890 Checked out revision should be head of default branch
891
891
892 $ hg -R share-dest1b log -r .
892 $ hg -R share-dest1b log -r .
893 changeset: 4:99f71071f117
893 changeset: 4:99f71071f117
894 bookmark: head2
894 bookmark: head2
895 parent: 0:b5f04eac9d8f
895 parent: 0:b5f04eac9d8f
896 user: test
896 user: test
897 date: Thu Jan 01 00:00:00 1970 +0000
897 date: Thu Jan 01 00:00:00 1970 +0000
898 summary: head2
898 summary: head2
899
899
900
900
901 Clone from unrelated repo should result in new share
901 Clone from unrelated repo should result in new share
902
902
903 $ hg --config share.pool=share clone source2 share-dest2
903 $ hg --config share.pool=share clone source2 share-dest2
904 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
904 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
905 requesting all changes
905 requesting all changes
906 adding changesets
906 adding changesets
907 adding manifests
907 adding manifests
908 adding file changes
908 adding file changes
909 added 2 changesets with 2 changes to 1 files
909 added 2 changesets with 2 changes to 1 files
910 new changesets 22aeff664783:63cf6c3dba4a
910 new changesets 22aeff664783:63cf6c3dba4a
911 searching for changes
911 searching for changes
912 no changes found
912 no changes found
913 updating working directory
913 updating working directory
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
915
915
916 $ ls share
916 $ ls share
917 22aeff664783fd44c6d9b435618173c118c3448e
917 22aeff664783fd44c6d9b435618173c118c3448e
918 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
918 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
919
919
920 remote naming mode works as advertised
920 remote naming mode works as advertised
921
921
922 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
922 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
923 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
923 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
924 requesting all changes
924 requesting all changes
925 adding changesets
925 adding changesets
926 adding manifests
926 adding manifests
927 adding file changes
927 adding file changes
928 added 3 changesets with 3 changes to 1 files
928 added 3 changesets with 3 changes to 1 files
929 new changesets b5f04eac9d8f:e5bfe23c0b47
929 new changesets b5f04eac9d8f:e5bfe23c0b47
930 searching for changes
930 searching for changes
931 no changes found
931 no changes found
932 adding remote bookmark bookA
932 adding remote bookmark bookA
933 updating working directory
933 updating working directory
934 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
934 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
935
935
936 $ ls shareremote
936 $ ls shareremote
937 195bb1fcdb595c14a6c13e0269129ed78f6debde
937 195bb1fcdb595c14a6c13e0269129ed78f6debde
938
938
939 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
939 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
940 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
940 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
941 requesting all changes
941 requesting all changes
942 adding changesets
942 adding changesets
943 adding manifests
943 adding manifests
944 adding file changes
944 adding file changes
945 added 6 changesets with 6 changes to 1 files (+4 heads)
945 added 6 changesets with 6 changes to 1 files (+4 heads)
946 new changesets b5f04eac9d8f:6bacf4683960
946 new changesets b5f04eac9d8f:6bacf4683960
947 searching for changes
947 searching for changes
948 no changes found
948 no changes found
949 adding remote bookmark head1
949 adding remote bookmark head1
950 adding remote bookmark head2
950 adding remote bookmark head2
951 updating working directory
951 updating working directory
952 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
952 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
953
953
954 $ ls shareremote
954 $ ls shareremote
955 195bb1fcdb595c14a6c13e0269129ed78f6debde
955 195bb1fcdb595c14a6c13e0269129ed78f6debde
956 c0d4f83847ca2a873741feb7048a45085fd47c46
956 c0d4f83847ca2a873741feb7048a45085fd47c46
957
957
958 request to clone a single revision is respected in sharing mode
958 request to clone a single revision is respected in sharing mode
959
959
960 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
960 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
961 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
961 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
962 adding changesets
962 adding changesets
963 adding manifests
963 adding manifests
964 adding file changes
964 adding file changes
965 added 2 changesets with 2 changes to 1 files
965 added 2 changesets with 2 changes to 1 files
966 new changesets b5f04eac9d8f:4a8dc1ab4c13
966 new changesets b5f04eac9d8f:4a8dc1ab4c13
967 no changes found
967 no changes found
968 adding remote bookmark head1
968 adding remote bookmark head1
969 updating working directory
969 updating working directory
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971
971
972 $ hg -R share-1arev log -G
972 $ hg -R share-1arev log -G
973 @ changeset: 1:4a8dc1ab4c13
973 @ changeset: 1:4a8dc1ab4c13
974 | bookmark: head1
974 | bookmark: head1
975 | tag: tip
975 | tag: tip
976 | user: test
976 | user: test
977 | date: Thu Jan 01 00:00:00 1970 +0000
977 | date: Thu Jan 01 00:00:00 1970 +0000
978 | summary: head1
978 | summary: head1
979 |
979 |
980 o changeset: 0:b5f04eac9d8f
980 o changeset: 0:b5f04eac9d8f
981 user: test
981 user: test
982 date: Thu Jan 01 00:00:00 1970 +0000
982 date: Thu Jan 01 00:00:00 1970 +0000
983 summary: initial
983 summary: initial
984
984
985
985
986 making another clone should only pull down requested rev
986 making another clone should only pull down requested rev
987
987
988 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
988 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
989 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
989 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
990 searching for changes
990 searching for changes
991 adding changesets
991 adding changesets
992 adding manifests
992 adding manifests
993 adding file changes
993 adding file changes
994 added 1 changesets with 1 changes to 1 files (+1 heads)
994 added 1 changesets with 1 changes to 1 files (+1 heads)
995 adding remote bookmark head1
995 adding remote bookmark head1
996 adding remote bookmark head2
996 adding remote bookmark head2
997 new changesets 99f71071f117
997 new changesets 99f71071f117
998 updating working directory
998 updating working directory
999 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
999 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1000
1000
1001 $ hg -R share-1brev log -G
1001 $ hg -R share-1brev log -G
1002 @ changeset: 2:99f71071f117
1002 @ changeset: 2:99f71071f117
1003 | bookmark: head2
1003 | bookmark: head2
1004 | tag: tip
1004 | tag: tip
1005 | parent: 0:b5f04eac9d8f
1005 | parent: 0:b5f04eac9d8f
1006 | user: test
1006 | user: test
1007 | date: Thu Jan 01 00:00:00 1970 +0000
1007 | date: Thu Jan 01 00:00:00 1970 +0000
1008 | summary: head2
1008 | summary: head2
1009 |
1009 |
1010 | o changeset: 1:4a8dc1ab4c13
1010 | o changeset: 1:4a8dc1ab4c13
1011 |/ bookmark: head1
1011 |/ bookmark: head1
1012 | user: test
1012 | user: test
1013 | date: Thu Jan 01 00:00:00 1970 +0000
1013 | date: Thu Jan 01 00:00:00 1970 +0000
1014 | summary: head1
1014 | summary: head1
1015 |
1015 |
1016 o changeset: 0:b5f04eac9d8f
1016 o changeset: 0:b5f04eac9d8f
1017 user: test
1017 user: test
1018 date: Thu Jan 01 00:00:00 1970 +0000
1018 date: Thu Jan 01 00:00:00 1970 +0000
1019 summary: initial
1019 summary: initial
1020
1020
1021
1021
1022 Request to clone a single branch is respected in sharing mode
1022 Request to clone a single branch is respected in sharing mode
1023
1023
1024 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1024 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1025 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1025 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1026 adding changesets
1026 adding changesets
1027 adding manifests
1027 adding manifests
1028 adding file changes
1028 adding file changes
1029 added 2 changesets with 2 changes to 1 files
1029 added 2 changesets with 2 changes to 1 files
1030 new changesets b5f04eac9d8f:5f92a6c1a1b1
1030 new changesets b5f04eac9d8f:5f92a6c1a1b1
1031 no changes found
1031 no changes found
1032 updating working directory
1032 updating working directory
1033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1034
1034
1035 $ hg -R share-1bbranch1 log -G
1035 $ hg -R share-1bbranch1 log -G
1036 o changeset: 1:5f92a6c1a1b1
1036 o changeset: 1:5f92a6c1a1b1
1037 | branch: branch1
1037 | branch: branch1
1038 | tag: tip
1038 | tag: tip
1039 | user: test
1039 | user: test
1040 | date: Thu Jan 01 00:00:00 1970 +0000
1040 | date: Thu Jan 01 00:00:00 1970 +0000
1041 | summary: branch1
1041 | summary: branch1
1042 |
1042 |
1043 @ changeset: 0:b5f04eac9d8f
1043 @ changeset: 0:b5f04eac9d8f
1044 user: test
1044 user: test
1045 date: Thu Jan 01 00:00:00 1970 +0000
1045 date: Thu Jan 01 00:00:00 1970 +0000
1046 summary: initial
1046 summary: initial
1047
1047
1048
1048
1049 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1049 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1050 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1050 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1051 searching for changes
1051 searching for changes
1052 adding changesets
1052 adding changesets
1053 adding manifests
1053 adding manifests
1054 adding file changes
1054 adding file changes
1055 added 1 changesets with 1 changes to 1 files (+1 heads)
1055 added 1 changesets with 1 changes to 1 files (+1 heads)
1056 new changesets 6bacf4683960
1056 new changesets 6bacf4683960
1057 updating working directory
1057 updating working directory
1058 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1058 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1059
1059
1060 $ hg -R share-1bbranch2 log -G
1060 $ hg -R share-1bbranch2 log -G
1061 o changeset: 2:6bacf4683960
1061 o changeset: 2:6bacf4683960
1062 | branch: branch2
1062 | branch: branch2
1063 | tag: tip
1063 | tag: tip
1064 | parent: 0:b5f04eac9d8f
1064 | parent: 0:b5f04eac9d8f
1065 | user: test
1065 | user: test
1066 | date: Thu Jan 01 00:00:00 1970 +0000
1066 | date: Thu Jan 01 00:00:00 1970 +0000
1067 | summary: branch2
1067 | summary: branch2
1068 |
1068 |
1069 | o changeset: 1:5f92a6c1a1b1
1069 | o changeset: 1:5f92a6c1a1b1
1070 |/ branch: branch1
1070 |/ branch: branch1
1071 | user: test
1071 | user: test
1072 | date: Thu Jan 01 00:00:00 1970 +0000
1072 | date: Thu Jan 01 00:00:00 1970 +0000
1073 | summary: branch1
1073 | summary: branch1
1074 |
1074 |
1075 @ changeset: 0:b5f04eac9d8f
1075 @ changeset: 0:b5f04eac9d8f
1076 user: test
1076 user: test
1077 date: Thu Jan 01 00:00:00 1970 +0000
1077 date: Thu Jan 01 00:00:00 1970 +0000
1078 summary: initial
1078 summary: initial
1079
1079
1080
1080
1081 -U is respected in share clone mode
1081 -U is respected in share clone mode
1082
1082
1083 $ hg --config share.pool=share clone -U source1a share-1anowc
1083 $ hg --config share.pool=share clone -U source1a share-1anowc
1084 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1084 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1085 searching for changes
1085 searching for changes
1086 no changes found
1086 no changes found
1087 adding remote bookmark bookA
1087 adding remote bookmark bookA
1088
1088
1089 $ ls share-1anowc
1089 $ ls share-1anowc
1090
1090
1091 Test that auto sharing doesn't cause failure of "hg clone local remote"
1091 Test that auto sharing doesn't cause failure of "hg clone local remote"
1092
1092
1093 $ cd $TESTTMP
1093 $ cd $TESTTMP
1094 $ hg -R a id -r 0
1094 $ hg -R a id -r 0
1095 acb14030fe0a
1095 acb14030fe0a
1096 $ hg id -R remote -r 0
1096 $ hg id -R remote -r 0
1097 abort: repository remote not found!
1097 abort: repository remote not found!
1098 [255]
1098 [255]
1099 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1099 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1100 $ hg -R remote id -r 0
1100 $ hg -R remote id -r 0
1101 acb14030fe0a
1101 acb14030fe0a
1102
1102
1103 Cloning into pooled storage doesn't race (issue5104)
1103 Cloning into pooled storage doesn't race (issue5104)
1104
1104
1105 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1105 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1106 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1106 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1107 $ wait
1107 $ wait
1108
1108
1109 $ hg -R share-destrace1 log -r tip
1109 $ hg -R share-destrace1 log -r tip
1110 changeset: 2:e5bfe23c0b47
1110 changeset: 2:e5bfe23c0b47
1111 bookmark: bookA
1111 bookmark: bookA
1112 tag: tip
1112 tag: tip
1113 user: test
1113 user: test
1114 date: Thu Jan 01 00:00:00 1970 +0000
1114 date: Thu Jan 01 00:00:00 1970 +0000
1115 summary: 1a
1115 summary: 1a
1116
1116
1117
1117
1118 $ hg -R share-destrace2 log -r tip
1118 $ hg -R share-destrace2 log -r tip
1119 changeset: 2:e5bfe23c0b47
1119 changeset: 2:e5bfe23c0b47
1120 bookmark: bookA
1120 bookmark: bookA
1121 tag: tip
1121 tag: tip
1122 user: test
1122 user: test
1123 date: Thu Jan 01 00:00:00 1970 +0000
1123 date: Thu Jan 01 00:00:00 1970 +0000
1124 summary: 1a
1124 summary: 1a
1125
1125
1126 One repo should be new, the other should be shared from the pool. We
1126 One repo should be new, the other should be shared from the pool. We
1127 don't care which is which, so we just make sure we always print the
1127 don't care which is which, so we just make sure we always print the
1128 one containing "new pooled" first, then one one containing "existing
1128 one containing "new pooled" first, then one one containing "existing
1129 pooled".
1129 pooled".
1130
1130
1131 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1131 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1132 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1132 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1133 requesting all changes
1133 requesting all changes
1134 adding changesets
1134 adding changesets
1135 adding manifests
1135 adding manifests
1136 adding file changes
1136 adding file changes
1137 added 3 changesets with 3 changes to 1 files
1137 added 3 changesets with 3 changes to 1 files
1138 new changesets b5f04eac9d8f:e5bfe23c0b47
1138 new changesets b5f04eac9d8f:e5bfe23c0b47
1139 searching for changes
1139 searching for changes
1140 no changes found
1140 no changes found
1141 adding remote bookmark bookA
1141 adding remote bookmark bookA
1142 updating working directory
1142 updating working directory
1143 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1144
1144
1145 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1145 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1146 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1146 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1147 searching for changes
1147 searching for changes
1148 no changes found
1148 no changes found
1149 adding remote bookmark bookA
1149 adding remote bookmark bookA
1150 updating working directory
1150 updating working directory
1151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1152
1152
1153 SEC: check for unsafe ssh url
1153 SEC: check for unsafe ssh url
1154
1154
1155 $ cat >> $HGRCPATH << EOF
1155 $ cat >> $HGRCPATH << EOF
1156 > [ui]
1156 > [ui]
1157 > ssh = sh -c "read l; read l; read l"
1157 > ssh = sh -c "read l; read l; read l"
1158 > EOF
1158 > EOF
1159
1159
1160 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1160 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1161 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1161 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1162 [255]
1162 [255]
1163 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1163 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1164 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1164 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1165 [255]
1165 [255]
1166 $ hg clone 'ssh://fakehost|touch%20owned/path'
1166 $ hg clone 'ssh://fakehost|touch%20owned/path'
1167 abort: no suitable response from remote hg!
1167 abort: no suitable response from remote hg!
1168 [255]
1168 [255]
1169 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1169 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1170 abort: no suitable response from remote hg!
1170 abort: no suitable response from remote hg!
1171 [255]
1171 [255]
1172
1172
1173 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1173 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1174 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1174 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1175 [255]
1175 [255]
1176
1176
1177 #if windows
1177 #if windows
1178 $ hg clone "ssh://%26touch%20owned%20/" --debug
1178 $ hg clone "ssh://%26touch%20owned%20/" --debug
1179 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1179 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1180 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1180 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1181 sending hello command
1181 sending hello command
1182 sending between command
1182 sending between command
1183 abort: no suitable response from remote hg!
1183 abort: no suitable response from remote hg!
1184 [255]
1184 [255]
1185 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1185 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1186 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1186 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1187 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1187 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1188 sending hello command
1188 sending hello command
1189 sending between command
1189 sending between command
1190 abort: no suitable response from remote hg!
1190 abort: no suitable response from remote hg!
1191 [255]
1191 [255]
1192 #else
1192 #else
1193 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1193 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1194 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1194 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1195 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1195 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1196 sending hello command
1196 sending hello command
1197 sending between command
1197 sending between command
1198 abort: no suitable response from remote hg!
1198 abort: no suitable response from remote hg!
1199 [255]
1199 [255]
1200 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1200 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1201 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1201 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1202 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1202 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1203 sending hello command
1203 sending hello command
1204 sending between command
1204 sending between command
1205 abort: no suitable response from remote hg!
1205 abort: no suitable response from remote hg!
1206 [255]
1206 [255]
1207 #endif
1207 #endif
1208
1208
1209 $ hg clone "ssh://v-alid.example.com/" --debug
1209 $ hg clone "ssh://v-alid.example.com/" --debug
1210 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1210 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1211 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1211 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1212 sending hello command
1212 sending hello command
1213 sending between command
1213 sending between command
1214 abort: no suitable response from remote hg!
1214 abort: no suitable response from remote hg!
1215 [255]
1215 [255]
1216
1216
1217 We should not have created a file named owned - if it exists, the
1217 We should not have created a file named owned - if it exists, the
1218 attack succeeded.
1218 attack succeeded.
1219 $ if test -f owned; then echo 'you got owned'; fi
1219 $ if test -f owned; then echo 'you got owned'; fi
1220
1220
1221 Cloning without fsmonitor enabled does not print a warning for small repos
1221 Cloning without fsmonitor enabled does not print a warning for small repos
1222
1222
1223 $ hg clone a fsmonitor-default
1223 $ hg clone a fsmonitor-default
1224 updating to bookmark @ on branch stable
1224 updating to bookmark @ on branch stable
1225 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1225 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1226
1226
1227 Lower the warning threshold to simulate a large repo
1227 Lower the warning threshold to simulate a large repo
1228
1228
1229 $ cat >> $HGRCPATH << EOF
1229 $ cat >> $HGRCPATH << EOF
1230 > [fsmonitor]
1230 > [fsmonitor]
1231 > warn_update_file_count = 2
1231 > warn_update_file_count = 2
1232 > EOF
1232 > EOF
1233
1233
1234 We should see a warning about no fsmonitor on supported platforms
1234 We should see a warning about no fsmonitor on supported platforms
1235
1235
1236 #if linuxormacos no-fsmonitor
1236 #if linuxormacos no-fsmonitor
1237 $ hg clone a nofsmonitor
1237 $ hg clone a nofsmonitor
1238 updating to bookmark @ on branch stable
1238 updating to bookmark @ on branch stable
1239 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1239 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1240 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1241 #else
1241 #else
1242 $ hg clone a nofsmonitor
1242 $ hg clone a nofsmonitor
1243 updating to bookmark @ on branch stable
1243 updating to bookmark @ on branch stable
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1245 #endif
1245 #endif
1246
1246
1247 We should not see warning about fsmonitor when it is enabled
1247 We should not see warning about fsmonitor when it is enabled
1248
1248
1249 #if fsmonitor
1249 #if fsmonitor
1250 $ hg clone a fsmonitor-enabled
1250 $ hg clone a fsmonitor-enabled
1251 updating to bookmark @ on branch stable
1251 updating to bookmark @ on branch stable
1252 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1252 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1253 #endif
1253 #endif
1254
1254
1255 We can disable the fsmonitor warning
1255 We can disable the fsmonitor warning
1256
1256
1257 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1257 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1258 updating to bookmark @ on branch stable
1258 updating to bookmark @ on branch stable
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1260
1260
1261 Loaded fsmonitor but disabled in config should still print warning
1261 Loaded fsmonitor but disabled in config should still print warning
1262
1262
1263 #if linuxormacos fsmonitor
1263 #if linuxormacos fsmonitor
1264 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1264 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1265 updating to bookmark @ on branch stable
1265 updating to bookmark @ on branch stable
1266 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1266 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1268 #endif
1268 #endif
1269
1269
1270 Warning not printed if working directory isn't empty
1270 Warning not printed if working directory isn't empty
1271
1271
1272 $ hg -q clone a fsmonitor-update
1272 $ hg -q clone a fsmonitor-update
1273 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1273 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1274 $ cd fsmonitor-update
1274 $ cd fsmonitor-update
1275 $ hg up acb14030fe0a
1275 $ hg up acb14030fe0a
1276 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1276 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1277 (leaving bookmark @)
1277 (leaving bookmark @)
1278 $ hg up cf0fe1914066
1278 $ hg up cf0fe1914066
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1280
1280
1281 `hg update` from null revision also prints
1281 `hg update` from null revision also prints
1282
1282
1283 $ hg up null
1283 $ hg up null
1284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285
1285
1286 #if linuxormacos no-fsmonitor
1286 #if linuxormacos no-fsmonitor
1287 $ hg up cf0fe1914066
1287 $ hg up cf0fe1914066
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1290 #else
1290 #else
1291 $ hg up cf0fe1914066
1291 $ hg up cf0fe1914066
1292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1293 #endif
1293 #endif
1294
1294
1295 $ cd ..
1295 $ cd ..
1296
1296
@@ -1,1030 +1,1030 b''
1 #if windows
1 #if windows
2 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
2 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
3 #else
3 #else
4 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
4 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
5 #endif
5 #endif
6 $ export PYTHONPATH
6 $ export PYTHONPATH
7
7
8 typical client does not want echo-back messages, so test without it:
8 typical client does not want echo-back messages, so test without it:
9
9
10 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
10 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
11 $ mv $HGRCPATH.new $HGRCPATH
11 $ mv $HGRCPATH.new $HGRCPATH
12
12
13 $ hg init repo
13 $ hg init repo
14 $ cd repo
14 $ cd repo
15
15
16 >>> from __future__ import absolute_import, print_function
16 >>> from __future__ import absolute_import, print_function
17 >>> import os
17 >>> import os
18 >>> import sys
18 >>> import sys
19 >>> from hgclient import check, readchannel, runcommand
19 >>> from hgclient import check, readchannel, runcommand
20 >>> @check
20 >>> @check
21 ... def hellomessage(server):
21 ... def hellomessage(server):
22 ... ch, data = readchannel(server)
22 ... ch, data = readchannel(server)
23 ... print('%c, %r' % (ch, data))
23 ... print('%c, %r' % (ch, data))
24 ... # run an arbitrary command to make sure the next thing the server
24 ... # run an arbitrary command to make sure the next thing the server
25 ... # sends isn't part of the hello message
25 ... # sends isn't part of the hello message
26 ... runcommand(server, ['id'])
26 ... runcommand(server, ['id'])
27 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
27 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
28 *** runcommand id
28 *** runcommand id
29 000000000000 tip
29 000000000000 tip
30
30
31 >>> from hgclient import check
31 >>> from hgclient import check
32 >>> @check
32 >>> @check
33 ... def unknowncommand(server):
33 ... def unknowncommand(server):
34 ... server.stdin.write('unknowncommand\n')
34 ... server.stdin.write('unknowncommand\n')
35 abort: unknown command unknowncommand
35 abort: unknown command unknowncommand
36
36
37 >>> from hgclient import check, readchannel, runcommand
37 >>> from hgclient import check, readchannel, runcommand
38 >>> @check
38 >>> @check
39 ... def checkruncommand(server):
39 ... def checkruncommand(server):
40 ... # hello block
40 ... # hello block
41 ... readchannel(server)
41 ... readchannel(server)
42 ...
42 ...
43 ... # no args
43 ... # no args
44 ... runcommand(server, [])
44 ... runcommand(server, [])
45 ...
45 ...
46 ... # global options
46 ... # global options
47 ... runcommand(server, ['id', '--quiet'])
47 ... runcommand(server, ['id', '--quiet'])
48 ...
48 ...
49 ... # make sure global options don't stick through requests
49 ... # make sure global options don't stick through requests
50 ... runcommand(server, ['id'])
50 ... runcommand(server, ['id'])
51 ...
51 ...
52 ... # --config
52 ... # --config
53 ... runcommand(server, ['id', '--config', 'ui.quiet=True'])
53 ... runcommand(server, ['id', '--config', 'ui.quiet=True'])
54 ...
54 ...
55 ... # make sure --config doesn't stick
55 ... # make sure --config doesn't stick
56 ... runcommand(server, ['id'])
56 ... runcommand(server, ['id'])
57 ...
57 ...
58 ... # negative return code should be masked
58 ... # negative return code should be masked
59 ... runcommand(server, ['id', '-runknown'])
59 ... runcommand(server, ['id', '-runknown'])
60 *** runcommand
60 *** runcommand
61 Mercurial Distributed SCM
61 Mercurial Distributed SCM
62
62
63 basic commands:
63 basic commands:
64
64
65 add add the specified files on the next commit
65 add add the specified files on the next commit
66 annotate show changeset information by line for each file
66 annotate show changeset information by line for each file
67 clone make a copy of an existing repository
67 clone make a copy of an existing repository
68 commit commit the specified files or all outstanding changes
68 commit commit the specified files or all outstanding changes
69 diff diff repository (or selected files)
69 diff diff repository (or selected files)
70 export dump the header and diffs for one or more changesets
70 export dump the header and diffs for one or more changesets
71 forget forget the specified files on the next commit
71 forget forget the specified files on the next commit
72 init create a new repository in the given directory
72 init create a new repository in the given directory
73 log show revision history of entire repository or files
73 log show revision history of entire repository or files
74 merge merge another revision into working directory
74 merge merge another revision into working directory
75 pull pull changes from the specified source
75 pull pull changes from the specified source
76 push push changes to the specified destination
76 push push changes to the specified destination
77 remove remove the specified files on the next commit
77 remove remove the specified files on the next commit
78 serve start stand-alone webserver
78 serve start stand-alone webserver
79 status show changed files in the working directory
79 status show changed files in the working directory
80 summary summarize working directory state
80 summary summarize working directory state
81 update update working directory (or switch revisions)
81 update update working directory (or switch revisions)
82
82
83 (use 'hg help' for the full list of commands or 'hg -v' for details)
83 (use 'hg help' for the full list of commands or 'hg -v' for details)
84 *** runcommand id --quiet
84 *** runcommand id --quiet
85 000000000000
85 000000000000
86 *** runcommand id
86 *** runcommand id
87 000000000000 tip
87 000000000000 tip
88 *** runcommand id --config ui.quiet=True
88 *** runcommand id --config ui.quiet=True
89 000000000000
89 000000000000
90 *** runcommand id
90 *** runcommand id
91 000000000000 tip
91 000000000000 tip
92 *** runcommand id -runknown
92 *** runcommand id -runknown
93 abort: unknown revision 'unknown'!
93 abort: unknown revision 'unknown'!
94 [255]
94 [255]
95
95
96 >>> from hgclient import check, readchannel
96 >>> from hgclient import check, readchannel
97 >>> @check
97 >>> @check
98 ... def inputeof(server):
98 ... def inputeof(server):
99 ... readchannel(server)
99 ... readchannel(server)
100 ... server.stdin.write('runcommand\n')
100 ... server.stdin.write('runcommand\n')
101 ... # close stdin while server is waiting for input
101 ... # close stdin while server is waiting for input
102 ... server.stdin.close()
102 ... server.stdin.close()
103 ...
103 ...
104 ... # server exits with 1 if the pipe closed while reading the command
104 ... # server exits with 1 if the pipe closed while reading the command
105 ... print('server exit code =', server.wait())
105 ... print('server exit code =', server.wait())
106 server exit code = 1
106 server exit code = 1
107
107
108 >>> from hgclient import check, readchannel, runcommand, stringio
108 >>> from hgclient import check, readchannel, runcommand, stringio
109 >>> @check
109 >>> @check
110 ... def serverinput(server):
110 ... def serverinput(server):
111 ... readchannel(server)
111 ... readchannel(server)
112 ...
112 ...
113 ... patch = """
113 ... patch = """
114 ... # HG changeset patch
114 ... # HG changeset patch
115 ... # User test
115 ... # User test
116 ... # Date 0 0
116 ... # Date 0 0
117 ... # Node ID c103a3dec114d882c98382d684d8af798d09d857
117 ... # Node ID c103a3dec114d882c98382d684d8af798d09d857
118 ... # Parent 0000000000000000000000000000000000000000
118 ... # Parent 0000000000000000000000000000000000000000
119 ... 1
119 ... 1
120 ...
120 ...
121 ... diff -r 000000000000 -r c103a3dec114 a
121 ... diff -r 000000000000 -r c103a3dec114 a
122 ... --- /dev/null Thu Jan 01 00:00:00 1970 +0000
122 ... --- /dev/null Thu Jan 01 00:00:00 1970 +0000
123 ... +++ b/a Thu Jan 01 00:00:00 1970 +0000
123 ... +++ b/a Thu Jan 01 00:00:00 1970 +0000
124 ... @@ -0,0 +1,1 @@
124 ... @@ -0,0 +1,1 @@
125 ... +1
125 ... +1
126 ... """
126 ... """
127 ...
127 ...
128 ... runcommand(server, ['import', '-'], input=stringio(patch))
128 ... runcommand(server, ['import', '-'], input=stringio(patch))
129 ... runcommand(server, ['log'])
129 ... runcommand(server, ['log'])
130 *** runcommand import -
130 *** runcommand import -
131 applying patch from stdin
131 applying patch from stdin
132 *** runcommand log
132 *** runcommand log
133 changeset: 0:eff892de26ec
133 changeset: 0:eff892de26ec
134 tag: tip
134 tag: tip
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: 1
137 summary: 1
138
138
139
139
140 check strict parsing of early options:
140 check strict parsing of early options:
141
141
142 >>> import os
142 >>> import os
143 >>> from hgclient import check, readchannel, runcommand
143 >>> from hgclient import check, readchannel, runcommand
144 >>> os.environ['HGPLAIN'] = '+strictflags'
144 >>> os.environ['HGPLAIN'] = '+strictflags'
145 >>> @check
145 >>> @check
146 ... def cwd(server):
146 ... def cwd(server):
147 ... readchannel(server)
147 ... readchannel(server)
148 ... runcommand(server, ['log', '-b', '--config=alias.log=!echo pwned',
148 ... runcommand(server, ['log', '-b', '--config=alias.log=!echo pwned',
149 ... 'default'])
149 ... 'default'])
150 *** runcommand log -b --config=alias.log=!echo pwned default
150 *** runcommand log -b --config=alias.log=!echo pwned default
151 abort: unknown revision '--config=alias.log=!echo pwned'!
151 abort: unknown revision '--config=alias.log=!echo pwned'!
152 [255]
152 [255]
153
153
154 check that "histedit --commands=-" can read rules from the input channel:
154 check that "histedit --commands=-" can read rules from the input channel:
155
155
156 >>> import cStringIO
156 >>> import cStringIO
157 >>> from hgclient import check, readchannel, runcommand
157 >>> from hgclient import check, readchannel, runcommand
158 >>> @check
158 >>> @check
159 ... def serverinput(server):
159 ... def serverinput(server):
160 ... readchannel(server)
160 ... readchannel(server)
161 ... rules = 'pick eff892de26ec\n'
161 ... rules = 'pick eff892de26ec\n'
162 ... runcommand(server, ['histedit', '0', '--commands=-',
162 ... runcommand(server, ['histedit', '0', '--commands=-',
163 ... '--config', 'extensions.histedit='],
163 ... '--config', 'extensions.histedit='],
164 ... input=cStringIO.StringIO(rules))
164 ... input=cStringIO.StringIO(rules))
165 *** runcommand histedit 0 --commands=- --config extensions.histedit=
165 *** runcommand histedit 0 --commands=- --config extensions.histedit=
166
166
167 check that --cwd doesn't persist between requests:
167 check that --cwd doesn't persist between requests:
168
168
169 $ mkdir foo
169 $ mkdir foo
170 $ touch foo/bar
170 $ touch foo/bar
171 >>> from hgclient import check, readchannel, runcommand
171 >>> from hgclient import check, readchannel, runcommand
172 >>> @check
172 >>> @check
173 ... def cwd(server):
173 ... def cwd(server):
174 ... readchannel(server)
174 ... readchannel(server)
175 ... runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
175 ... runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
176 ... runcommand(server, ['st', 'foo/bar'])
176 ... runcommand(server, ['st', 'foo/bar'])
177 *** runcommand --cwd foo st bar
177 *** runcommand --cwd foo st bar
178 ? bar
178 ? bar
179 *** runcommand st foo/bar
179 *** runcommand st foo/bar
180 ? foo/bar
180 ? foo/bar
181
181
182 $ rm foo/bar
182 $ rm foo/bar
183
183
184
184
185 check that local configs for the cached repo aren't inherited when -R is used:
185 check that local configs for the cached repo aren't inherited when -R is used:
186
186
187 $ cat <<EOF >> .hg/hgrc
187 $ cat <<EOF >> .hg/hgrc
188 > [ui]
188 > [ui]
189 > foo = bar
189 > foo = bar
190 > EOF
190 > EOF
191
191
192 #if no-extraextensions
192 #if no-extraextensions
193
193
194 >>> from hgclient import check, readchannel, runcommand, sep
194 >>> from hgclient import check, readchannel, runcommand, sep
195 >>> @check
195 >>> @check
196 ... def localhgrc(server):
196 ... def localhgrc(server):
197 ... readchannel(server)
197 ... readchannel(server)
198 ...
198 ...
199 ... # the cached repo local hgrc contains ui.foo=bar, so showconfig should
199 ... # the cached repo local hgrc contains ui.foo=bar, so showconfig should
200 ... # show it
200 ... # show it
201 ... runcommand(server, ['showconfig'], outfilter=sep)
201 ... runcommand(server, ['showconfig'], outfilter=sep)
202 ...
202 ...
203 ... # but not for this repo
203 ... # but not for this repo
204 ... runcommand(server, ['init', 'foo'])
204 ... runcommand(server, ['init', 'foo'])
205 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
205 ... runcommand(server, ['-R', 'foo', 'showconfig', 'ui', 'defaults'])
206 *** runcommand showconfig
206 *** runcommand showconfig
207 bundle.mainreporoot=$TESTTMP/repo
207 bundle.mainreporoot=$TESTTMP/repo
208 devel.all-warnings=true
208 devel.all-warnings=true
209 devel.default-date=0 0
209 devel.default-date=0 0
210 extensions.fsmonitor= (fsmonitor !)
210 extensions.fsmonitor= (fsmonitor !)
211 largefiles.usercache=$TESTTMP/.cache/largefiles
211 largefiles.usercache=$TESTTMP/.cache/largefiles
212 lfs.usercache=$TESTTMP/.cache/lfs
212 lfs.usercache=$TESTTMP/.cache/lfs
213 ui.slash=True
213 ui.slash=True
214 ui.interactive=False
214 ui.interactive=False
215 ui.mergemarkers=detailed
215 ui.mergemarkers=detailed
216 ui.foo=bar
216 ui.foo=bar
217 ui.nontty=true
217 ui.nontty=true
218 web.address=localhost
218 web.address=localhost
219 web\.ipv6=(?:True|False) (re)
219 web\.ipv6=(?:True|False) (re)
220 web.server-header=testing stub value
220 web.server-header=testing stub value
221 *** runcommand init foo
221 *** runcommand init foo
222 *** runcommand -R foo showconfig ui defaults
222 *** runcommand -R foo showconfig ui defaults
223 ui.slash=True
223 ui.slash=True
224 ui.interactive=False
224 ui.interactive=False
225 ui.mergemarkers=detailed
225 ui.mergemarkers=detailed
226 ui.nontty=true
226 ui.nontty=true
227 #endif
227 #endif
228
228
229 $ rm -R foo
229 $ rm -R foo
230
230
231 #if windows
231 #if windows
232 $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH"
232 $ PYTHONPATH="$TESTTMP/repo;$PYTHONPATH"
233 #else
233 #else
234 $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH"
234 $ PYTHONPATH="$TESTTMP/repo:$PYTHONPATH"
235 #endif
235 #endif
236
236
237 $ cat <<EOF > hook.py
237 $ cat <<EOF > hook.py
238 > from __future__ import print_function
238 > from __future__ import print_function
239 > import sys
239 > import sys
240 > def hook(**args):
240 > def hook(**args):
241 > print('hook talking')
241 > print('hook talking')
242 > print('now try to read something: %r' % sys.stdin.read())
242 > print('now try to read something: %r' % sys.stdin.read())
243 > EOF
243 > EOF
244
244
245 >>> from hgclient import check, readchannel, runcommand, stringio
245 >>> from hgclient import check, readchannel, runcommand, stringio
246 >>> @check
246 >>> @check
247 ... def hookoutput(server):
247 ... def hookoutput(server):
248 ... readchannel(server)
248 ... readchannel(server)
249 ... runcommand(server, ['--config',
249 ... runcommand(server, ['--config',
250 ... 'hooks.pre-identify=python:hook.hook',
250 ... 'hooks.pre-identify=python:hook.hook',
251 ... 'id'],
251 ... 'id'],
252 ... input=stringio('some input'))
252 ... input=stringio('some input'))
253 *** runcommand --config hooks.pre-identify=python:hook.hook id
253 *** runcommand --config hooks.pre-identify=python:hook.hook id
254 eff892de26ec tip
254 eff892de26ec tip
255 hook talking
255 hook talking
256 now try to read something: ''
256 now try to read something: ''
257
257
258 Clean hook cached version
258 Clean hook cached version
259 $ rm hook.py*
259 $ rm hook.py*
260 $ rm -Rf __pycache__
260 $ rm -Rf __pycache__
261
261
262 $ echo a >> a
262 $ echo a >> a
263 >>> import os
263 >>> import os
264 >>> from hgclient import check, readchannel, runcommand
264 >>> from hgclient import check, readchannel, runcommand
265 >>> @check
265 >>> @check
266 ... def outsidechanges(server):
266 ... def outsidechanges(server):
267 ... readchannel(server)
267 ... readchannel(server)
268 ... runcommand(server, ['status'])
268 ... runcommand(server, ['status'])
269 ... os.system('hg ci -Am2')
269 ... os.system('hg ci -Am2')
270 ... runcommand(server, ['tip'])
270 ... runcommand(server, ['tip'])
271 ... runcommand(server, ['status'])
271 ... runcommand(server, ['status'])
272 *** runcommand status
272 *** runcommand status
273 M a
273 M a
274 *** runcommand tip
274 *** runcommand tip
275 changeset: 1:d3a0a68be6de
275 changeset: 1:d3a0a68be6de
276 tag: tip
276 tag: tip
277 user: test
277 user: test
278 date: Thu Jan 01 00:00:00 1970 +0000
278 date: Thu Jan 01 00:00:00 1970 +0000
279 summary: 2
279 summary: 2
280
280
281 *** runcommand status
281 *** runcommand status
282
282
283 >>> import os
283 >>> import os
284 >>> from hgclient import check, readchannel, runcommand
284 >>> from hgclient import check, readchannel, runcommand
285 >>> @check
285 >>> @check
286 ... def bookmarks(server):
286 ... def bookmarks(server):
287 ... readchannel(server)
287 ... readchannel(server)
288 ... runcommand(server, ['bookmarks'])
288 ... runcommand(server, ['bookmarks'])
289 ...
289 ...
290 ... # changes .hg/bookmarks
290 ... # changes .hg/bookmarks
291 ... os.system('hg bookmark -i bm1')
291 ... os.system('hg bookmark -i bm1')
292 ... os.system('hg bookmark -i bm2')
292 ... os.system('hg bookmark -i bm2')
293 ... runcommand(server, ['bookmarks'])
293 ... runcommand(server, ['bookmarks'])
294 ...
294 ...
295 ... # changes .hg/bookmarks.current
295 ... # changes .hg/bookmarks.current
296 ... os.system('hg upd bm1 -q')
296 ... os.system('hg upd bm1 -q')
297 ... runcommand(server, ['bookmarks'])
297 ... runcommand(server, ['bookmarks'])
298 ...
298 ...
299 ... runcommand(server, ['bookmarks', 'bm3'])
299 ... runcommand(server, ['bookmarks', 'bm3'])
300 ... f = open('a', 'ab')
300 ... f = open('a', 'ab')
301 ... f.write('a\n')
301 ... f.write('a\n')
302 ... f.close()
302 ... f.close()
303 ... runcommand(server, ['commit', '-Amm'])
303 ... runcommand(server, ['commit', '-Amm'])
304 ... runcommand(server, ['bookmarks'])
304 ... runcommand(server, ['bookmarks'])
305 ... print('')
305 ... print('')
306 *** runcommand bookmarks
306 *** runcommand bookmarks
307 no bookmarks set
307 no bookmarks set
308 *** runcommand bookmarks
308 *** runcommand bookmarks
309 bm1 1:d3a0a68be6de
309 bm1 1:d3a0a68be6de
310 bm2 1:d3a0a68be6de
310 bm2 1:d3a0a68be6de
311 *** runcommand bookmarks
311 *** runcommand bookmarks
312 * bm1 1:d3a0a68be6de
312 * bm1 1:d3a0a68be6de
313 bm2 1:d3a0a68be6de
313 bm2 1:d3a0a68be6de
314 *** runcommand bookmarks bm3
314 *** runcommand bookmarks bm3
315 *** runcommand commit -Amm
315 *** runcommand commit -Amm
316 *** runcommand bookmarks
316 *** runcommand bookmarks
317 bm1 1:d3a0a68be6de
317 bm1 1:d3a0a68be6de
318 bm2 1:d3a0a68be6de
318 bm2 1:d3a0a68be6de
319 * bm3 2:aef17e88f5f0
319 * bm3 2:aef17e88f5f0
320
320
321
321
322 >>> import os
322 >>> import os
323 >>> from hgclient import check, readchannel, runcommand
323 >>> from hgclient import check, readchannel, runcommand
324 >>> @check
324 >>> @check
325 ... def tagscache(server):
325 ... def tagscache(server):
326 ... readchannel(server)
326 ... readchannel(server)
327 ... runcommand(server, ['id', '-t', '-r', '0'])
327 ... runcommand(server, ['id', '-t', '-r', '0'])
328 ... os.system('hg tag -r 0 foo')
328 ... os.system('hg tag -r 0 foo')
329 ... runcommand(server, ['id', '-t', '-r', '0'])
329 ... runcommand(server, ['id', '-t', '-r', '0'])
330 *** runcommand id -t -r 0
330 *** runcommand id -t -r 0
331
331
332 *** runcommand id -t -r 0
332 *** runcommand id -t -r 0
333 foo
333 foo
334
334
335 >>> import os
335 >>> import os
336 >>> from hgclient import check, readchannel, runcommand
336 >>> from hgclient import check, readchannel, runcommand
337 >>> @check
337 >>> @check
338 ... def setphase(server):
338 ... def setphase(server):
339 ... readchannel(server)
339 ... readchannel(server)
340 ... runcommand(server, ['phase', '-r', '.'])
340 ... runcommand(server, ['phase', '-r', '.'])
341 ... os.system('hg phase -r . -p')
341 ... os.system('hg phase -r . -p')
342 ... runcommand(server, ['phase', '-r', '.'])
342 ... runcommand(server, ['phase', '-r', '.'])
343 *** runcommand phase -r .
343 *** runcommand phase -r .
344 3: draft
344 3: draft
345 *** runcommand phase -r .
345 *** runcommand phase -r .
346 3: public
346 3: public
347
347
348 $ echo a >> a
348 $ echo a >> a
349 >>> from hgclient import check, readchannel, runcommand
349 >>> from hgclient import check, readchannel, runcommand
350 >>> @check
350 >>> @check
351 ... def rollback(server):
351 ... def rollback(server):
352 ... readchannel(server)
352 ... readchannel(server)
353 ... runcommand(server, ['phase', '-r', '.', '-p'])
353 ... runcommand(server, ['phase', '-r', '.', '-p'])
354 ... runcommand(server, ['commit', '-Am.'])
354 ... runcommand(server, ['commit', '-Am.'])
355 ... runcommand(server, ['rollback'])
355 ... runcommand(server, ['rollback'])
356 ... runcommand(server, ['phase', '-r', '.'])
356 ... runcommand(server, ['phase', '-r', '.'])
357 ... print('')
357 ... print('')
358 *** runcommand phase -r . -p
358 *** runcommand phase -r . -p
359 no phases changed
359 no phases changed
360 *** runcommand commit -Am.
360 *** runcommand commit -Am.
361 *** runcommand rollback
361 *** runcommand rollback
362 repository tip rolled back to revision 3 (undo commit)
362 repository tip rolled back to revision 3 (undo commit)
363 working directory now based on revision 3
363 working directory now based on revision 3
364 *** runcommand phase -r .
364 *** runcommand phase -r .
365 3: public
365 3: public
366
366
367
367
368 >>> import os
368 >>> import os
369 >>> from hgclient import check, readchannel, runcommand
369 >>> from hgclient import check, readchannel, runcommand
370 >>> @check
370 >>> @check
371 ... def branch(server):
371 ... def branch(server):
372 ... readchannel(server)
372 ... readchannel(server)
373 ... runcommand(server, ['branch'])
373 ... runcommand(server, ['branch'])
374 ... os.system('hg branch foo')
374 ... os.system('hg branch foo')
375 ... runcommand(server, ['branch'])
375 ... runcommand(server, ['branch'])
376 ... os.system('hg branch default')
376 ... os.system('hg branch default')
377 *** runcommand branch
377 *** runcommand branch
378 default
378 default
379 marked working directory as branch foo
379 marked working directory as branch foo
380 (branches are permanent and global, did you want a bookmark?)
380 (branches are permanent and global, did you want a bookmark?)
381 *** runcommand branch
381 *** runcommand branch
382 foo
382 foo
383 marked working directory as branch default
383 marked working directory as branch default
384 (branches are permanent and global, did you want a bookmark?)
384 (branches are permanent and global, did you want a bookmark?)
385
385
386 $ touch .hgignore
386 $ touch .hgignore
387 >>> import os
387 >>> import os
388 >>> from hgclient import check, readchannel, runcommand
388 >>> from hgclient import check, readchannel, runcommand
389 >>> @check
389 >>> @check
390 ... def hgignore(server):
390 ... def hgignore(server):
391 ... readchannel(server)
391 ... readchannel(server)
392 ... runcommand(server, ['commit', '-Am.'])
392 ... runcommand(server, ['commit', '-Am.'])
393 ... f = open('ignored-file', 'ab')
393 ... f = open('ignored-file', 'ab')
394 ... f.write('')
394 ... f.write('')
395 ... f.close()
395 ... f.close()
396 ... f = open('.hgignore', 'ab')
396 ... f = open('.hgignore', 'ab')
397 ... f.write('ignored-file')
397 ... f.write('ignored-file')
398 ... f.close()
398 ... f.close()
399 ... runcommand(server, ['status', '-i', '-u'])
399 ... runcommand(server, ['status', '-i', '-u'])
400 ... print('')
400 ... print('')
401 *** runcommand commit -Am.
401 *** runcommand commit -Am.
402 adding .hgignore
402 adding .hgignore
403 *** runcommand status -i -u
403 *** runcommand status -i -u
404 I ignored-file
404 I ignored-file
405
405
406
406
407 cache of non-public revisions should be invalidated on repository change
407 cache of non-public revisions should be invalidated on repository change
408 (issue4855):
408 (issue4855):
409
409
410 >>> import os
410 >>> import os
411 >>> from hgclient import check, readchannel, runcommand
411 >>> from hgclient import check, readchannel, runcommand
412 >>> @check
412 >>> @check
413 ... def phasesetscacheaftercommit(server):
413 ... def phasesetscacheaftercommit(server):
414 ... readchannel(server)
414 ... readchannel(server)
415 ... # load _phasecache._phaserevs and _phasesets
415 ... # load _phasecache._phaserevs and _phasesets
416 ... runcommand(server, ['log', '-qr', 'draft()'])
416 ... runcommand(server, ['log', '-qr', 'draft()'])
417 ... # create draft commits by another process
417 ... # create draft commits by another process
418 ... for i in range(5, 7):
418 ... for i in range(5, 7):
419 ... f = open('a', 'ab')
419 ... f = open('a', 'ab')
420 ... f.seek(0, os.SEEK_END)
420 ... f.seek(0, os.SEEK_END)
421 ... f.write('a\n')
421 ... f.write('a\n')
422 ... f.close()
422 ... f.close()
423 ... os.system('hg commit -Aqm%d' % i)
423 ... os.system('hg commit -Aqm%d' % i)
424 ... # new commits should be listed as draft revisions
424 ... # new commits should be listed as draft revisions
425 ... runcommand(server, ['log', '-qr', 'draft()'])
425 ... runcommand(server, ['log', '-qr', 'draft()'])
426 ... print('')
426 ... print('')
427 *** runcommand log -qr draft()
427 *** runcommand log -qr draft()
428 4:7966c8e3734d
428 4:7966c8e3734d
429 *** runcommand log -qr draft()
429 *** runcommand log -qr draft()
430 4:7966c8e3734d
430 4:7966c8e3734d
431 5:41f6602d1c4f
431 5:41f6602d1c4f
432 6:10501e202c35
432 6:10501e202c35
433
433
434
434
435 >>> import os
435 >>> import os
436 >>> from hgclient import check, readchannel, runcommand
436 >>> from hgclient import check, readchannel, runcommand
437 >>> @check
437 >>> @check
438 ... def phasesetscacheafterstrip(server):
438 ... def phasesetscacheafterstrip(server):
439 ... readchannel(server)
439 ... readchannel(server)
440 ... # load _phasecache._phaserevs and _phasesets
440 ... # load _phasecache._phaserevs and _phasesets
441 ... runcommand(server, ['log', '-qr', 'draft()'])
441 ... runcommand(server, ['log', '-qr', 'draft()'])
442 ... # strip cached revisions by another process
442 ... # strip cached revisions by another process
443 ... os.system('hg --config extensions.strip= strip -q 5')
443 ... os.system('hg --config extensions.strip= strip -q 5')
444 ... # shouldn't abort by "unknown revision '6'"
444 ... # shouldn't abort by "unknown revision '6'"
445 ... runcommand(server, ['log', '-qr', 'draft()'])
445 ... runcommand(server, ['log', '-qr', 'draft()'])
446 ... print('')
446 ... print('')
447 *** runcommand log -qr draft()
447 *** runcommand log -qr draft()
448 4:7966c8e3734d
448 4:7966c8e3734d
449 5:41f6602d1c4f
449 5:41f6602d1c4f
450 6:10501e202c35
450 6:10501e202c35
451 *** runcommand log -qr draft()
451 *** runcommand log -qr draft()
452 4:7966c8e3734d
452 4:7966c8e3734d
453
453
454
454
455 cache of phase roots should be invalidated on strip (issue3827):
455 cache of phase roots should be invalidated on strip (issue3827):
456
456
457 >>> import os
457 >>> import os
458 >>> from hgclient import check, readchannel, runcommand, sep
458 >>> from hgclient import check, readchannel, runcommand, sep
459 >>> @check
459 >>> @check
460 ... def phasecacheafterstrip(server):
460 ... def phasecacheafterstrip(server):
461 ... readchannel(server)
461 ... readchannel(server)
462 ...
462 ...
463 ... # create new head, 5:731265503d86
463 ... # create new head, 5:731265503d86
464 ... runcommand(server, ['update', '-C', '0'])
464 ... runcommand(server, ['update', '-C', '0'])
465 ... f = open('a', 'ab')
465 ... f = open('a', 'ab')
466 ... f.write('a\n')
466 ... f.write('a\n')
467 ... f.close()
467 ... f.close()
468 ... runcommand(server, ['commit', '-Am.', 'a'])
468 ... runcommand(server, ['commit', '-Am.', 'a'])
469 ... runcommand(server, ['log', '-Gq'])
469 ... runcommand(server, ['log', '-Gq'])
470 ...
470 ...
471 ... # make it public; draft marker moves to 4:7966c8e3734d
471 ... # make it public; draft marker moves to 4:7966c8e3734d
472 ... runcommand(server, ['phase', '-p', '.'])
472 ... runcommand(server, ['phase', '-p', '.'])
473 ... # load _phasecache.phaseroots
473 ... # load _phasecache.phaseroots
474 ... runcommand(server, ['phase', '.'], outfilter=sep)
474 ... runcommand(server, ['phase', '.'], outfilter=sep)
475 ...
475 ...
476 ... # strip 1::4 outside server
476 ... # strip 1::4 outside server
477 ... os.system('hg -q --config extensions.mq= strip 1')
477 ... os.system('hg -q --config extensions.mq= strip 1')
478 ...
478 ...
479 ... # shouldn't raise "7966c8e3734d: no node!"
479 ... # shouldn't raise "7966c8e3734d: no node!"
480 ... runcommand(server, ['branches'])
480 ... runcommand(server, ['branches'])
481 *** runcommand update -C 0
481 *** runcommand update -C 0
482 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
482 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
483 (leaving bookmark bm3)
483 (leaving bookmark bm3)
484 *** runcommand commit -Am. a
484 *** runcommand commit -Am. a
485 created new head
485 created new head
486 *** runcommand log -Gq
486 *** runcommand log -Gq
487 @ 5:731265503d86
487 @ 5:731265503d86
488 |
488 |
489 | o 4:7966c8e3734d
489 | o 4:7966c8e3734d
490 | |
490 | |
491 | o 3:b9b85890c400
491 | o 3:b9b85890c400
492 | |
492 | |
493 | o 2:aef17e88f5f0
493 | o 2:aef17e88f5f0
494 | |
494 | |
495 | o 1:d3a0a68be6de
495 | o 1:d3a0a68be6de
496 |/
496 |/
497 o 0:eff892de26ec
497 o 0:eff892de26ec
498
498
499 *** runcommand phase -p .
499 *** runcommand phase -p .
500 *** runcommand phase .
500 *** runcommand phase .
501 5: public
501 5: public
502 *** runcommand branches
502 *** runcommand branches
503 default 1:731265503d86
503 default 1:731265503d86
504
504
505 in-memory cache must be reloaded if transaction is aborted. otherwise
505 in-memory cache must be reloaded if transaction is aborted. otherwise
506 changelog and manifest would have invalid node:
506 changelog and manifest would have invalid node:
507
507
508 $ echo a >> a
508 $ echo a >> a
509 >>> from hgclient import check, readchannel, runcommand
509 >>> from hgclient import check, readchannel, runcommand
510 >>> @check
510 >>> @check
511 ... def txabort(server):
511 ... def txabort(server):
512 ... readchannel(server)
512 ... readchannel(server)
513 ... runcommand(server, ['commit', '--config', 'hooks.pretxncommit=false',
513 ... runcommand(server, ['commit', '--config', 'hooks.pretxncommit=false',
514 ... '-mfoo'])
514 ... '-mfoo'])
515 ... runcommand(server, ['verify'])
515 ... runcommand(server, ['verify'])
516 *** runcommand commit --config hooks.pretxncommit=false -mfoo
516 *** runcommand commit --config hooks.pretxncommit=false -mfoo
517 transaction abort!
517 transaction abort!
518 rollback completed
518 rollback completed
519 abort: pretxncommit hook exited with status 1
519 abort: pretxncommit hook exited with status 1
520 [255]
520 [255]
521 *** runcommand verify
521 *** runcommand verify
522 checking changesets
522 checking changesets
523 checking manifests
523 checking manifests
524 crosschecking files in changesets and manifests
524 crosschecking files in changesets and manifests
525 checking files
525 checking files
526 1 files, 2 changesets, 2 total revisions
526 checked 2 changesets with 2 changes to 1 files
527 $ hg revert --no-backup -aq
527 $ hg revert --no-backup -aq
528
528
529 $ cat >> .hg/hgrc << EOF
529 $ cat >> .hg/hgrc << EOF
530 > [experimental]
530 > [experimental]
531 > evolution.createmarkers=True
531 > evolution.createmarkers=True
532 > EOF
532 > EOF
533
533
534 >>> import os
534 >>> import os
535 >>> from hgclient import check, readchannel, runcommand
535 >>> from hgclient import check, readchannel, runcommand
536 >>> @check
536 >>> @check
537 ... def obsolete(server):
537 ... def obsolete(server):
538 ... readchannel(server)
538 ... readchannel(server)
539 ...
539 ...
540 ... runcommand(server, ['up', 'null'])
540 ... runcommand(server, ['up', 'null'])
541 ... runcommand(server, ['phase', '-df', 'tip'])
541 ... runcommand(server, ['phase', '-df', 'tip'])
542 ... cmd = 'hg debugobsolete `hg log -r tip --template {node}`'
542 ... cmd = 'hg debugobsolete `hg log -r tip --template {node}`'
543 ... if os.name == 'nt':
543 ... if os.name == 'nt':
544 ... cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe
544 ... cmd = 'sh -c "%s"' % cmd # run in sh, not cmd.exe
545 ... os.system(cmd)
545 ... os.system(cmd)
546 ... runcommand(server, ['log', '--hidden'])
546 ... runcommand(server, ['log', '--hidden'])
547 ... runcommand(server, ['log'])
547 ... runcommand(server, ['log'])
548 *** runcommand up null
548 *** runcommand up null
549 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
549 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
550 *** runcommand phase -df tip
550 *** runcommand phase -df tip
551 obsoleted 1 changesets
551 obsoleted 1 changesets
552 *** runcommand log --hidden
552 *** runcommand log --hidden
553 changeset: 1:731265503d86
553 changeset: 1:731265503d86
554 tag: tip
554 tag: tip
555 user: test
555 user: test
556 date: Thu Jan 01 00:00:00 1970 +0000
556 date: Thu Jan 01 00:00:00 1970 +0000
557 obsolete: pruned
557 obsolete: pruned
558 summary: .
558 summary: .
559
559
560 changeset: 0:eff892de26ec
560 changeset: 0:eff892de26ec
561 bookmark: bm1
561 bookmark: bm1
562 bookmark: bm2
562 bookmark: bm2
563 bookmark: bm3
563 bookmark: bm3
564 user: test
564 user: test
565 date: Thu Jan 01 00:00:00 1970 +0000
565 date: Thu Jan 01 00:00:00 1970 +0000
566 summary: 1
566 summary: 1
567
567
568 *** runcommand log
568 *** runcommand log
569 changeset: 0:eff892de26ec
569 changeset: 0:eff892de26ec
570 bookmark: bm1
570 bookmark: bm1
571 bookmark: bm2
571 bookmark: bm2
572 bookmark: bm3
572 bookmark: bm3
573 tag: tip
573 tag: tip
574 user: test
574 user: test
575 date: Thu Jan 01 00:00:00 1970 +0000
575 date: Thu Jan 01 00:00:00 1970 +0000
576 summary: 1
576 summary: 1
577
577
578
578
579 $ cat <<EOF >> .hg/hgrc
579 $ cat <<EOF >> .hg/hgrc
580 > [extensions]
580 > [extensions]
581 > mq =
581 > mq =
582 > EOF
582 > EOF
583
583
584 >>> import os
584 >>> import os
585 >>> from hgclient import check, readchannel, runcommand
585 >>> from hgclient import check, readchannel, runcommand
586 >>> @check
586 >>> @check
587 ... def mqoutsidechanges(server):
587 ... def mqoutsidechanges(server):
588 ... readchannel(server)
588 ... readchannel(server)
589 ...
589 ...
590 ... # load repo.mq
590 ... # load repo.mq
591 ... runcommand(server, ['qapplied'])
591 ... runcommand(server, ['qapplied'])
592 ... os.system('hg qnew 0.diff')
592 ... os.system('hg qnew 0.diff')
593 ... # repo.mq should be invalidated
593 ... # repo.mq should be invalidated
594 ... runcommand(server, ['qapplied'])
594 ... runcommand(server, ['qapplied'])
595 ...
595 ...
596 ... runcommand(server, ['qpop', '--all'])
596 ... runcommand(server, ['qpop', '--all'])
597 ... os.system('hg qqueue --create foo')
597 ... os.system('hg qqueue --create foo')
598 ... # repo.mq should be recreated to point to new queue
598 ... # repo.mq should be recreated to point to new queue
599 ... runcommand(server, ['qqueue', '--active'])
599 ... runcommand(server, ['qqueue', '--active'])
600 *** runcommand qapplied
600 *** runcommand qapplied
601 *** runcommand qapplied
601 *** runcommand qapplied
602 0.diff
602 0.diff
603 *** runcommand qpop --all
603 *** runcommand qpop --all
604 popping 0.diff
604 popping 0.diff
605 patch queue now empty
605 patch queue now empty
606 *** runcommand qqueue --active
606 *** runcommand qqueue --active
607 foo
607 foo
608
608
609 $ cat <<EOF > dbgui.py
609 $ cat <<EOF > dbgui.py
610 > import os
610 > import os
611 > import sys
611 > import sys
612 > from mercurial import commands, registrar
612 > from mercurial import commands, registrar
613 > cmdtable = {}
613 > cmdtable = {}
614 > command = registrar.command(cmdtable)
614 > command = registrar.command(cmdtable)
615 > @command(b"debuggetpass", norepo=True)
615 > @command(b"debuggetpass", norepo=True)
616 > def debuggetpass(ui):
616 > def debuggetpass(ui):
617 > ui.write("%s\\n" % ui.getpass())
617 > ui.write("%s\\n" % ui.getpass())
618 > @command(b"debugprompt", norepo=True)
618 > @command(b"debugprompt", norepo=True)
619 > def debugprompt(ui):
619 > def debugprompt(ui):
620 > ui.write("%s\\n" % ui.prompt("prompt:"))
620 > ui.write("%s\\n" % ui.prompt("prompt:"))
621 > @command(b"debugreadstdin", norepo=True)
621 > @command(b"debugreadstdin", norepo=True)
622 > def debugreadstdin(ui):
622 > def debugreadstdin(ui):
623 > ui.write("read: %r\n" % sys.stdin.read(1))
623 > ui.write("read: %r\n" % sys.stdin.read(1))
624 > @command(b"debugwritestdout", norepo=True)
624 > @command(b"debugwritestdout", norepo=True)
625 > def debugwritestdout(ui):
625 > def debugwritestdout(ui):
626 > os.write(1, "low-level stdout fd and\n")
626 > os.write(1, "low-level stdout fd and\n")
627 > sys.stdout.write("stdout should be redirected to stderr\n")
627 > sys.stdout.write("stdout should be redirected to stderr\n")
628 > sys.stdout.flush()
628 > sys.stdout.flush()
629 > EOF
629 > EOF
630 $ cat <<EOF >> .hg/hgrc
630 $ cat <<EOF >> .hg/hgrc
631 > [extensions]
631 > [extensions]
632 > dbgui = dbgui.py
632 > dbgui = dbgui.py
633 > EOF
633 > EOF
634
634
635 >>> from hgclient import check, readchannel, runcommand, stringio
635 >>> from hgclient import check, readchannel, runcommand, stringio
636 >>> @check
636 >>> @check
637 ... def getpass(server):
637 ... def getpass(server):
638 ... readchannel(server)
638 ... readchannel(server)
639 ... runcommand(server, ['debuggetpass', '--config',
639 ... runcommand(server, ['debuggetpass', '--config',
640 ... 'ui.interactive=True'],
640 ... 'ui.interactive=True'],
641 ... input=stringio('1234\n'))
641 ... input=stringio('1234\n'))
642 ... runcommand(server, ['debuggetpass', '--config',
642 ... runcommand(server, ['debuggetpass', '--config',
643 ... 'ui.interactive=True'],
643 ... 'ui.interactive=True'],
644 ... input=stringio('\n'))
644 ... input=stringio('\n'))
645 ... runcommand(server, ['debuggetpass', '--config',
645 ... runcommand(server, ['debuggetpass', '--config',
646 ... 'ui.interactive=True'],
646 ... 'ui.interactive=True'],
647 ... input=stringio(''))
647 ... input=stringio(''))
648 ... runcommand(server, ['debugprompt', '--config',
648 ... runcommand(server, ['debugprompt', '--config',
649 ... 'ui.interactive=True'],
649 ... 'ui.interactive=True'],
650 ... input=stringio('5678\n'))
650 ... input=stringio('5678\n'))
651 ... runcommand(server, ['debugreadstdin'])
651 ... runcommand(server, ['debugreadstdin'])
652 ... runcommand(server, ['debugwritestdout'])
652 ... runcommand(server, ['debugwritestdout'])
653 *** runcommand debuggetpass --config ui.interactive=True
653 *** runcommand debuggetpass --config ui.interactive=True
654 password: 1234
654 password: 1234
655 *** runcommand debuggetpass --config ui.interactive=True
655 *** runcommand debuggetpass --config ui.interactive=True
656 password:
656 password:
657 *** runcommand debuggetpass --config ui.interactive=True
657 *** runcommand debuggetpass --config ui.interactive=True
658 password: abort: response expected
658 password: abort: response expected
659 [255]
659 [255]
660 *** runcommand debugprompt --config ui.interactive=True
660 *** runcommand debugprompt --config ui.interactive=True
661 prompt: 5678
661 prompt: 5678
662 *** runcommand debugreadstdin
662 *** runcommand debugreadstdin
663 read: ''
663 read: ''
664 *** runcommand debugwritestdout
664 *** runcommand debugwritestdout
665 low-level stdout fd and
665 low-level stdout fd and
666 stdout should be redirected to stderr
666 stdout should be redirected to stderr
667
667
668
668
669 run commandserver in commandserver, which is silly but should work:
669 run commandserver in commandserver, which is silly but should work:
670
670
671 >>> from __future__ import print_function
671 >>> from __future__ import print_function
672 >>> from hgclient import check, readchannel, runcommand, stringio
672 >>> from hgclient import check, readchannel, runcommand, stringio
673 >>> @check
673 >>> @check
674 ... def nested(server):
674 ... def nested(server):
675 ... print('%c, %r' % readchannel(server))
675 ... print('%c, %r' % readchannel(server))
676 ... class nestedserver(object):
676 ... class nestedserver(object):
677 ... stdin = stringio('getencoding\n')
677 ... stdin = stringio('getencoding\n')
678 ... stdout = stringio()
678 ... stdout = stringio()
679 ... runcommand(server, ['serve', '--cmdserver', 'pipe'],
679 ... runcommand(server, ['serve', '--cmdserver', 'pipe'],
680 ... output=nestedserver.stdout, input=nestedserver.stdin)
680 ... output=nestedserver.stdout, input=nestedserver.stdin)
681 ... nestedserver.stdout.seek(0)
681 ... nestedserver.stdout.seek(0)
682 ... print('%c, %r' % readchannel(nestedserver)) # hello
682 ... print('%c, %r' % readchannel(nestedserver)) # hello
683 ... print('%c, %r' % readchannel(nestedserver)) # getencoding
683 ... print('%c, %r' % readchannel(nestedserver)) # getencoding
684 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
684 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
685 *** runcommand serve --cmdserver pipe
685 *** runcommand serve --cmdserver pipe
686 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
686 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
687 r, '*' (glob)
687 r, '*' (glob)
688
688
689
689
690 start without repository:
690 start without repository:
691
691
692 $ cd ..
692 $ cd ..
693
693
694 >>> from __future__ import print_function
694 >>> from __future__ import print_function
695 >>> from hgclient import check, readchannel, runcommand
695 >>> from hgclient import check, readchannel, runcommand
696 >>> @check
696 >>> @check
697 ... def hellomessage(server):
697 ... def hellomessage(server):
698 ... ch, data = readchannel(server)
698 ... ch, data = readchannel(server)
699 ... print('%c, %r' % (ch, data))
699 ... print('%c, %r' % (ch, data))
700 ... # run an arbitrary command to make sure the next thing the server
700 ... # run an arbitrary command to make sure the next thing the server
701 ... # sends isn't part of the hello message
701 ... # sends isn't part of the hello message
702 ... runcommand(server, ['id'])
702 ... runcommand(server, ['id'])
703 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
703 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
704 *** runcommand id
704 *** runcommand id
705 abort: there is no Mercurial repository here (.hg not found)
705 abort: there is no Mercurial repository here (.hg not found)
706 [255]
706 [255]
707
707
708 >>> from hgclient import check, readchannel, runcommand
708 >>> from hgclient import check, readchannel, runcommand
709 >>> @check
709 >>> @check
710 ... def startwithoutrepo(server):
710 ... def startwithoutrepo(server):
711 ... readchannel(server)
711 ... readchannel(server)
712 ... runcommand(server, ['init', 'repo2'])
712 ... runcommand(server, ['init', 'repo2'])
713 ... runcommand(server, ['id', '-R', 'repo2'])
713 ... runcommand(server, ['id', '-R', 'repo2'])
714 *** runcommand init repo2
714 *** runcommand init repo2
715 *** runcommand id -R repo2
715 *** runcommand id -R repo2
716 000000000000 tip
716 000000000000 tip
717
717
718
718
719 don't fall back to cwd if invalid -R path is specified (issue4805):
719 don't fall back to cwd if invalid -R path is specified (issue4805):
720
720
721 $ cd repo
721 $ cd repo
722 $ hg serve --cmdserver pipe -R ../nonexistent
722 $ hg serve --cmdserver pipe -R ../nonexistent
723 abort: repository ../nonexistent not found!
723 abort: repository ../nonexistent not found!
724 [255]
724 [255]
725 $ cd ..
725 $ cd ..
726
726
727
727
728 unix domain socket:
728 unix domain socket:
729
729
730 $ cd repo
730 $ cd repo
731 $ hg update -q
731 $ hg update -q
732
732
733 #if unix-socket unix-permissions
733 #if unix-socket unix-permissions
734
734
735 >>> from __future__ import print_function
735 >>> from __future__ import print_function
736 >>> from hgclient import check, readchannel, runcommand, stringio, unixserver
736 >>> from hgclient import check, readchannel, runcommand, stringio, unixserver
737 >>> server = unixserver('.hg/server.sock', '.hg/server.log')
737 >>> server = unixserver('.hg/server.sock', '.hg/server.log')
738 >>> def hellomessage(conn):
738 >>> def hellomessage(conn):
739 ... ch, data = readchannel(conn)
739 ... ch, data = readchannel(conn)
740 ... print('%c, %r' % (ch, data))
740 ... print('%c, %r' % (ch, data))
741 ... runcommand(conn, ['id'])
741 ... runcommand(conn, ['id'])
742 >>> check(hellomessage, server.connect)
742 >>> check(hellomessage, server.connect)
743 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
743 o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
744 *** runcommand id
744 *** runcommand id
745 eff892de26ec tip bm1/bm2/bm3
745 eff892de26ec tip bm1/bm2/bm3
746 >>> def unknowncommand(conn):
746 >>> def unknowncommand(conn):
747 ... readchannel(conn)
747 ... readchannel(conn)
748 ... conn.stdin.write('unknowncommand\n')
748 ... conn.stdin.write('unknowncommand\n')
749 >>> check(unknowncommand, server.connect) # error sent to server.log
749 >>> check(unknowncommand, server.connect) # error sent to server.log
750 >>> def serverinput(conn):
750 >>> def serverinput(conn):
751 ... readchannel(conn)
751 ... readchannel(conn)
752 ... patch = """
752 ... patch = """
753 ... # HG changeset patch
753 ... # HG changeset patch
754 ... # User test
754 ... # User test
755 ... # Date 0 0
755 ... # Date 0 0
756 ... 2
756 ... 2
757 ...
757 ...
758 ... diff -r eff892de26ec -r 1ed24be7e7a0 a
758 ... diff -r eff892de26ec -r 1ed24be7e7a0 a
759 ... --- a/a
759 ... --- a/a
760 ... +++ b/a
760 ... +++ b/a
761 ... @@ -1,1 +1,2 @@
761 ... @@ -1,1 +1,2 @@
762 ... 1
762 ... 1
763 ... +2
763 ... +2
764 ... """
764 ... """
765 ... runcommand(conn, ['import', '-'], input=stringio(patch))
765 ... runcommand(conn, ['import', '-'], input=stringio(patch))
766 ... runcommand(conn, ['log', '-rtip', '-q'])
766 ... runcommand(conn, ['log', '-rtip', '-q'])
767 >>> check(serverinput, server.connect)
767 >>> check(serverinput, server.connect)
768 *** runcommand import -
768 *** runcommand import -
769 applying patch from stdin
769 applying patch from stdin
770 *** runcommand log -rtip -q
770 *** runcommand log -rtip -q
771 2:1ed24be7e7a0
771 2:1ed24be7e7a0
772 >>> server.shutdown()
772 >>> server.shutdown()
773
773
774 $ cat .hg/server.log
774 $ cat .hg/server.log
775 listening at .hg/server.sock
775 listening at .hg/server.sock
776 abort: unknown command unknowncommand
776 abort: unknown command unknowncommand
777 killed!
777 killed!
778 $ rm .hg/server.log
778 $ rm .hg/server.log
779
779
780 if server crashed before hello, traceback will be sent to 'e' channel as
780 if server crashed before hello, traceback will be sent to 'e' channel as
781 last ditch:
781 last ditch:
782
782
783 $ cat <<EOF >> .hg/hgrc
783 $ cat <<EOF >> .hg/hgrc
784 > [cmdserver]
784 > [cmdserver]
785 > log = inexistent/path.log
785 > log = inexistent/path.log
786 > EOF
786 > EOF
787 >>> from __future__ import print_function
787 >>> from __future__ import print_function
788 >>> from hgclient import check, readchannel, unixserver
788 >>> from hgclient import check, readchannel, unixserver
789 >>> server = unixserver('.hg/server.sock', '.hg/server.log')
789 >>> server = unixserver('.hg/server.sock', '.hg/server.log')
790 >>> def earlycrash(conn):
790 >>> def earlycrash(conn):
791 ... while True:
791 ... while True:
792 ... try:
792 ... try:
793 ... ch, data = readchannel(conn)
793 ... ch, data = readchannel(conn)
794 ... if not data.startswith(' '):
794 ... if not data.startswith(' '):
795 ... print('%c, %r' % (ch, data))
795 ... print('%c, %r' % (ch, data))
796 ... except EOFError:
796 ... except EOFError:
797 ... break
797 ... break
798 >>> check(earlycrash, server.connect)
798 >>> check(earlycrash, server.connect)
799 e, 'Traceback (most recent call last):\n'
799 e, 'Traceback (most recent call last):\n'
800 e, "IOError: *" (glob)
800 e, "IOError: *" (glob)
801 >>> server.shutdown()
801 >>> server.shutdown()
802
802
803 $ cat .hg/server.log | grep -v '^ '
803 $ cat .hg/server.log | grep -v '^ '
804 listening at .hg/server.sock
804 listening at .hg/server.sock
805 Traceback (most recent call last):
805 Traceback (most recent call last):
806 IOError: * (glob)
806 IOError: * (glob)
807 killed!
807 killed!
808 #endif
808 #endif
809 #if no-unix-socket
809 #if no-unix-socket
810
810
811 $ hg serve --cmdserver unix -a .hg/server.sock
811 $ hg serve --cmdserver unix -a .hg/server.sock
812 abort: unsupported platform
812 abort: unsupported platform
813 [255]
813 [255]
814
814
815 #endif
815 #endif
816
816
817 $ cd ..
817 $ cd ..
818
818
819 Test that accessing to invalid changelog cache is avoided at
819 Test that accessing to invalid changelog cache is avoided at
820 subsequent operations even if repo object is reused even after failure
820 subsequent operations even if repo object is reused even after failure
821 of transaction (see 0a7610758c42 also)
821 of transaction (see 0a7610758c42 also)
822
822
823 "hg log" after failure of transaction is needed to detect invalid
823 "hg log" after failure of transaction is needed to detect invalid
824 cache in repoview: this can't detect by "hg verify" only.
824 cache in repoview: this can't detect by "hg verify" only.
825
825
826 Combination of "finalization" and "empty-ness of changelog" (2 x 2 =
826 Combination of "finalization" and "empty-ness of changelog" (2 x 2 =
827 4) are tested, because '00changelog.i' are differently changed in each
827 4) are tested, because '00changelog.i' are differently changed in each
828 cases.
828 cases.
829
829
830 $ cat > $TESTTMP/failafterfinalize.py <<EOF
830 $ cat > $TESTTMP/failafterfinalize.py <<EOF
831 > # extension to abort transaction after finalization forcibly
831 > # extension to abort transaction after finalization forcibly
832 > from mercurial import commands, error, extensions, lock as lockmod
832 > from mercurial import commands, error, extensions, lock as lockmod
833 > from mercurial import registrar
833 > from mercurial import registrar
834 > cmdtable = {}
834 > cmdtable = {}
835 > command = registrar.command(cmdtable)
835 > command = registrar.command(cmdtable)
836 > configtable = {}
836 > configtable = {}
837 > configitem = registrar.configitem(configtable)
837 > configitem = registrar.configitem(configtable)
838 > configitem('failafterfinalize', 'fail',
838 > configitem('failafterfinalize', 'fail',
839 > default=None,
839 > default=None,
840 > )
840 > )
841 > def fail(tr):
841 > def fail(tr):
842 > raise error.Abort('fail after finalization')
842 > raise error.Abort('fail after finalization')
843 > def reposetup(ui, repo):
843 > def reposetup(ui, repo):
844 > class failrepo(repo.__class__):
844 > class failrepo(repo.__class__):
845 > def commitctx(self, ctx, error=False):
845 > def commitctx(self, ctx, error=False):
846 > if self.ui.configbool('failafterfinalize', 'fail'):
846 > if self.ui.configbool('failafterfinalize', 'fail'):
847 > # 'sorted()' by ASCII code on category names causes
847 > # 'sorted()' by ASCII code on category names causes
848 > # invoking 'fail' after finalization of changelog
848 > # invoking 'fail' after finalization of changelog
849 > # using "'cl-%i' % id(self)" as category name
849 > # using "'cl-%i' % id(self)" as category name
850 > self.currenttransaction().addfinalize('zzzzzzzz', fail)
850 > self.currenttransaction().addfinalize('zzzzzzzz', fail)
851 > return super(failrepo, self).commitctx(ctx, error)
851 > return super(failrepo, self).commitctx(ctx, error)
852 > repo.__class__ = failrepo
852 > repo.__class__ = failrepo
853 > EOF
853 > EOF
854
854
855 $ hg init repo3
855 $ hg init repo3
856 $ cd repo3
856 $ cd repo3
857
857
858 $ cat <<EOF >> $HGRCPATH
858 $ cat <<EOF >> $HGRCPATH
859 > [ui]
859 > [ui]
860 > logtemplate = {rev} {desc|firstline} ({files})\n
860 > logtemplate = {rev} {desc|firstline} ({files})\n
861 >
861 >
862 > [extensions]
862 > [extensions]
863 > failafterfinalize = $TESTTMP/failafterfinalize.py
863 > failafterfinalize = $TESTTMP/failafterfinalize.py
864 > EOF
864 > EOF
865
865
866 - test failure with "empty changelog"
866 - test failure with "empty changelog"
867
867
868 $ echo foo > foo
868 $ echo foo > foo
869 $ hg add foo
869 $ hg add foo
870
870
871 (failure before finalization)
871 (failure before finalization)
872
872
873 >>> from hgclient import check, readchannel, runcommand
873 >>> from hgclient import check, readchannel, runcommand
874 >>> @check
874 >>> @check
875 ... def abort(server):
875 ... def abort(server):
876 ... readchannel(server)
876 ... readchannel(server)
877 ... runcommand(server, ['commit',
877 ... runcommand(server, ['commit',
878 ... '--config', 'hooks.pretxncommit=false',
878 ... '--config', 'hooks.pretxncommit=false',
879 ... '-mfoo'])
879 ... '-mfoo'])
880 ... runcommand(server, ['log'])
880 ... runcommand(server, ['log'])
881 ... runcommand(server, ['verify', '-q'])
881 ... runcommand(server, ['verify', '-q'])
882 *** runcommand commit --config hooks.pretxncommit=false -mfoo
882 *** runcommand commit --config hooks.pretxncommit=false -mfoo
883 transaction abort!
883 transaction abort!
884 rollback completed
884 rollback completed
885 abort: pretxncommit hook exited with status 1
885 abort: pretxncommit hook exited with status 1
886 [255]
886 [255]
887 *** runcommand log
887 *** runcommand log
888 *** runcommand verify -q
888 *** runcommand verify -q
889
889
890 (failure after finalization)
890 (failure after finalization)
891
891
892 >>> from hgclient import check, readchannel, runcommand
892 >>> from hgclient import check, readchannel, runcommand
893 >>> @check
893 >>> @check
894 ... def abort(server):
894 ... def abort(server):
895 ... readchannel(server)
895 ... readchannel(server)
896 ... runcommand(server, ['commit',
896 ... runcommand(server, ['commit',
897 ... '--config', 'failafterfinalize.fail=true',
897 ... '--config', 'failafterfinalize.fail=true',
898 ... '-mfoo'])
898 ... '-mfoo'])
899 ... runcommand(server, ['log'])
899 ... runcommand(server, ['log'])
900 ... runcommand(server, ['verify', '-q'])
900 ... runcommand(server, ['verify', '-q'])
901 *** runcommand commit --config failafterfinalize.fail=true -mfoo
901 *** runcommand commit --config failafterfinalize.fail=true -mfoo
902 transaction abort!
902 transaction abort!
903 rollback completed
903 rollback completed
904 abort: fail after finalization
904 abort: fail after finalization
905 [255]
905 [255]
906 *** runcommand log
906 *** runcommand log
907 *** runcommand verify -q
907 *** runcommand verify -q
908
908
909 - test failure with "not-empty changelog"
909 - test failure with "not-empty changelog"
910
910
911 $ echo bar > bar
911 $ echo bar > bar
912 $ hg add bar
912 $ hg add bar
913 $ hg commit -mbar bar
913 $ hg commit -mbar bar
914
914
915 (failure before finalization)
915 (failure before finalization)
916
916
917 >>> from hgclient import check, readchannel, runcommand
917 >>> from hgclient import check, readchannel, runcommand
918 >>> @check
918 >>> @check
919 ... def abort(server):
919 ... def abort(server):
920 ... readchannel(server)
920 ... readchannel(server)
921 ... runcommand(server, ['commit',
921 ... runcommand(server, ['commit',
922 ... '--config', 'hooks.pretxncommit=false',
922 ... '--config', 'hooks.pretxncommit=false',
923 ... '-mfoo', 'foo'])
923 ... '-mfoo', 'foo'])
924 ... runcommand(server, ['log'])
924 ... runcommand(server, ['log'])
925 ... runcommand(server, ['verify', '-q'])
925 ... runcommand(server, ['verify', '-q'])
926 *** runcommand commit --config hooks.pretxncommit=false -mfoo foo
926 *** runcommand commit --config hooks.pretxncommit=false -mfoo foo
927 transaction abort!
927 transaction abort!
928 rollback completed
928 rollback completed
929 abort: pretxncommit hook exited with status 1
929 abort: pretxncommit hook exited with status 1
930 [255]
930 [255]
931 *** runcommand log
931 *** runcommand log
932 0 bar (bar)
932 0 bar (bar)
933 *** runcommand verify -q
933 *** runcommand verify -q
934
934
935 (failure after finalization)
935 (failure after finalization)
936
936
937 >>> from hgclient import check, readchannel, runcommand
937 >>> from hgclient import check, readchannel, runcommand
938 >>> @check
938 >>> @check
939 ... def abort(server):
939 ... def abort(server):
940 ... readchannel(server)
940 ... readchannel(server)
941 ... runcommand(server, ['commit',
941 ... runcommand(server, ['commit',
942 ... '--config', 'failafterfinalize.fail=true',
942 ... '--config', 'failafterfinalize.fail=true',
943 ... '-mfoo', 'foo'])
943 ... '-mfoo', 'foo'])
944 ... runcommand(server, ['log'])
944 ... runcommand(server, ['log'])
945 ... runcommand(server, ['verify', '-q'])
945 ... runcommand(server, ['verify', '-q'])
946 *** runcommand commit --config failafterfinalize.fail=true -mfoo foo
946 *** runcommand commit --config failafterfinalize.fail=true -mfoo foo
947 transaction abort!
947 transaction abort!
948 rollback completed
948 rollback completed
949 abort: fail after finalization
949 abort: fail after finalization
950 [255]
950 [255]
951 *** runcommand log
951 *** runcommand log
952 0 bar (bar)
952 0 bar (bar)
953 *** runcommand verify -q
953 *** runcommand verify -q
954
954
955 $ cd ..
955 $ cd ..
956
956
957 Test symlink traversal over cached audited paths:
957 Test symlink traversal over cached audited paths:
958 -------------------------------------------------
958 -------------------------------------------------
959
959
960 #if symlink
960 #if symlink
961
961
962 set up symlink hell
962 set up symlink hell
963
963
964 $ mkdir merge-symlink-out
964 $ mkdir merge-symlink-out
965 $ hg init merge-symlink
965 $ hg init merge-symlink
966 $ cd merge-symlink
966 $ cd merge-symlink
967 $ touch base
967 $ touch base
968 $ hg commit -qAm base
968 $ hg commit -qAm base
969 $ ln -s ../merge-symlink-out a
969 $ ln -s ../merge-symlink-out a
970 $ hg commit -qAm 'symlink a -> ../merge-symlink-out'
970 $ hg commit -qAm 'symlink a -> ../merge-symlink-out'
971 $ hg up -q 0
971 $ hg up -q 0
972 $ mkdir a
972 $ mkdir a
973 $ touch a/poisoned
973 $ touch a/poisoned
974 $ hg commit -qAm 'file a/poisoned'
974 $ hg commit -qAm 'file a/poisoned'
975 $ hg log -G -T '{rev}: {desc}\n'
975 $ hg log -G -T '{rev}: {desc}\n'
976 @ 2: file a/poisoned
976 @ 2: file a/poisoned
977 |
977 |
978 | o 1: symlink a -> ../merge-symlink-out
978 | o 1: symlink a -> ../merge-symlink-out
979 |/
979 |/
980 o 0: base
980 o 0: base
981
981
982
982
983 try trivial merge after update: cache of audited paths should be discarded,
983 try trivial merge after update: cache of audited paths should be discarded,
984 and the merge should fail (issue5628)
984 and the merge should fail (issue5628)
985
985
986 $ hg up -q null
986 $ hg up -q null
987 >>> from hgclient import check, readchannel, runcommand
987 >>> from hgclient import check, readchannel, runcommand
988 >>> @check
988 >>> @check
989 ... def merge(server):
989 ... def merge(server):
990 ... readchannel(server)
990 ... readchannel(server)
991 ... # audit a/poisoned as a good path
991 ... # audit a/poisoned as a good path
992 ... runcommand(server, ['up', '-qC', '2'])
992 ... runcommand(server, ['up', '-qC', '2'])
993 ... runcommand(server, ['up', '-qC', '1'])
993 ... runcommand(server, ['up', '-qC', '1'])
994 ... # here a is a symlink, so a/poisoned is bad
994 ... # here a is a symlink, so a/poisoned is bad
995 ... runcommand(server, ['merge', '2'])
995 ... runcommand(server, ['merge', '2'])
996 *** runcommand up -qC 2
996 *** runcommand up -qC 2
997 *** runcommand up -qC 1
997 *** runcommand up -qC 1
998 *** runcommand merge 2
998 *** runcommand merge 2
999 abort: path 'a/poisoned' traverses symbolic link 'a'
999 abort: path 'a/poisoned' traverses symbolic link 'a'
1000 [255]
1000 [255]
1001 $ ls ../merge-symlink-out
1001 $ ls ../merge-symlink-out
1002
1002
1003 cache of repo.auditor should be discarded, so matcher would never traverse
1003 cache of repo.auditor should be discarded, so matcher would never traverse
1004 symlinks:
1004 symlinks:
1005
1005
1006 $ hg up -qC 0
1006 $ hg up -qC 0
1007 $ touch ../merge-symlink-out/poisoned
1007 $ touch ../merge-symlink-out/poisoned
1008 >>> from hgclient import check, readchannel, runcommand
1008 >>> from hgclient import check, readchannel, runcommand
1009 >>> @check
1009 >>> @check
1010 ... def files(server):
1010 ... def files(server):
1011 ... readchannel(server)
1011 ... readchannel(server)
1012 ... runcommand(server, ['up', '-qC', '2'])
1012 ... runcommand(server, ['up', '-qC', '2'])
1013 ... # audit a/poisoned as a good path
1013 ... # audit a/poisoned as a good path
1014 ... runcommand(server, ['files', 'a/poisoned'])
1014 ... runcommand(server, ['files', 'a/poisoned'])
1015 ... runcommand(server, ['up', '-qC', '0'])
1015 ... runcommand(server, ['up', '-qC', '0'])
1016 ... runcommand(server, ['up', '-qC', '1'])
1016 ... runcommand(server, ['up', '-qC', '1'])
1017 ... # here 'a' is a symlink, so a/poisoned should be warned
1017 ... # here 'a' is a symlink, so a/poisoned should be warned
1018 ... runcommand(server, ['files', 'a/poisoned'])
1018 ... runcommand(server, ['files', 'a/poisoned'])
1019 *** runcommand up -qC 2
1019 *** runcommand up -qC 2
1020 *** runcommand files a/poisoned
1020 *** runcommand files a/poisoned
1021 a/poisoned
1021 a/poisoned
1022 *** runcommand up -qC 0
1022 *** runcommand up -qC 0
1023 *** runcommand up -qC 1
1023 *** runcommand up -qC 1
1024 *** runcommand files a/poisoned
1024 *** runcommand files a/poisoned
1025 abort: path 'a/poisoned' traverses symbolic link 'a'
1025 abort: path 'a/poisoned' traverses symbolic link 'a'
1026 [255]
1026 [255]
1027
1027
1028 $ cd ..
1028 $ cd ..
1029
1029
1030 #endif
1030 #endif
@@ -1,101 +1,101 b''
1 #require reporevlogstore
1 #require reporevlogstore
2
2
3 $ CONTRIBDIR="$TESTDIR/../contrib"
3 $ CONTRIBDIR="$TESTDIR/../contrib"
4
4
5 $ hg init repo-a
5 $ hg init repo-a
6 $ cd repo-a
6 $ cd repo-a
7
7
8 $ echo this is file a > a
8 $ echo this is file a > a
9 $ hg add a
9 $ hg add a
10 $ hg commit -m first
10 $ hg commit -m first
11
11
12 $ echo adding to file a >> a
12 $ echo adding to file a >> a
13 $ hg commit -m second
13 $ hg commit -m second
14
14
15 $ echo adding more to file a >> a
15 $ echo adding more to file a >> a
16 $ hg commit -m third
16 $ hg commit -m third
17 $ hg verify
17 $ hg verify
18 checking changesets
18 checking changesets
19 checking manifests
19 checking manifests
20 crosschecking files in changesets and manifests
20 crosschecking files in changesets and manifests
21 checking files
21 checking files
22 1 files, 3 changesets, 3 total revisions
22 checked 3 changesets with 3 changes to 1 files
23
23
24 Dumping revlog of file a to stdout:
24 Dumping revlog of file a to stdout:
25 $ $PYTHON "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i
25 $ $PYTHON "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i
26 file: .hg/store/data/a.i
26 file: .hg/store/data/a.i
27 node: 183d2312b35066fb6b3b449b84efc370d50993d0
27 node: 183d2312b35066fb6b3b449b84efc370d50993d0
28 linkrev: 0
28 linkrev: 0
29 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
29 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
30 length: 15
30 length: 15
31 -start-
31 -start-
32 this is file a
32 this is file a
33
33
34 -end-
34 -end-
35 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
35 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
36 linkrev: 1
36 linkrev: 1
37 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
37 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
38 length: 32
38 length: 32
39 -start-
39 -start-
40 this is file a
40 this is file a
41 adding to file a
41 adding to file a
42
42
43 -end-
43 -end-
44 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
44 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
45 linkrev: 2
45 linkrev: 2
46 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
46 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
47 length: 54
47 length: 54
48 -start-
48 -start-
49 this is file a
49 this is file a
50 adding to file a
50 adding to file a
51 adding more to file a
51 adding more to file a
52
52
53 -end-
53 -end-
54
54
55 Dump all revlogs to file repo.dump:
55 Dump all revlogs to file repo.dump:
56
56
57 $ find .hg/store -name "*.i" | sort | xargs $PYTHON "$CONTRIBDIR/dumprevlog" > ../repo.dump
57 $ find .hg/store -name "*.i" | sort | xargs $PYTHON "$CONTRIBDIR/dumprevlog" > ../repo.dump
58 $ cd ..
58 $ cd ..
59
59
60 Undumping into repo-b:
60 Undumping into repo-b:
61
61
62 $ hg init repo-b
62 $ hg init repo-b
63 $ cd repo-b
63 $ cd repo-b
64 $ $PYTHON "$CONTRIBDIR/undumprevlog" < ../repo.dump
64 $ $PYTHON "$CONTRIBDIR/undumprevlog" < ../repo.dump
65 .hg/store/00changelog.i
65 .hg/store/00changelog.i
66 .hg/store/00manifest.i
66 .hg/store/00manifest.i
67 .hg/store/data/a.i
67 .hg/store/data/a.i
68 $ cd ..
68 $ cd ..
69
69
70 Rebuild fncache with clone --pull:
70 Rebuild fncache with clone --pull:
71
71
72 $ hg clone --pull -U repo-b repo-c
72 $ hg clone --pull -U repo-b repo-c
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 3 changesets with 3 changes to 1 files
77 added 3 changesets with 3 changes to 1 files
78 new changesets de1da620e7d8:46946d278c50
78 new changesets de1da620e7d8:46946d278c50
79
79
80 Verify:
80 Verify:
81
81
82 $ hg -R repo-c verify
82 $ hg -R repo-c verify
83 checking changesets
83 checking changesets
84 checking manifests
84 checking manifests
85 crosschecking files in changesets and manifests
85 crosschecking files in changesets and manifests
86 checking files
86 checking files
87 1 files, 3 changesets, 3 total revisions
87 checked 3 changesets with 3 changes to 1 files
88
88
89 Compare repos:
89 Compare repos:
90
90
91 $ hg -R repo-c incoming repo-a
91 $ hg -R repo-c incoming repo-a
92 comparing with repo-a
92 comparing with repo-a
93 searching for changes
93 searching for changes
94 no changes found
94 no changes found
95 [1]
95 [1]
96
96
97 $ hg -R repo-a incoming repo-c
97 $ hg -R repo-a incoming repo-c
98 comparing with repo-c
98 comparing with repo-c
99 searching for changes
99 searching for changes
100 no changes found
100 no changes found
101 [1]
101 [1]
@@ -1,796 +1,796 b''
1
1
2 $ HGMERGE=true; export HGMERGE
2 $ HGMERGE=true; export HGMERGE
3 $ echo '[extensions]' >> $HGRCPATH
3 $ echo '[extensions]' >> $HGRCPATH
4 $ echo 'convert =' >> $HGRCPATH
4 $ echo 'convert =' >> $HGRCPATH
5 $ glog()
5 $ glog()
6 > {
6 > {
7 > hg log -G --template '{rev} "{desc}" files: {files}\n' "$@"
7 > hg log -G --template '{rev} "{desc}" files: {files}\n' "$@"
8 > }
8 > }
9 $ hg init source
9 $ hg init source
10 $ cd source
10 $ cd source
11 $ echo foo > foo
11 $ echo foo > foo
12 $ echo baz > baz
12 $ echo baz > baz
13 $ mkdir -p dir/subdir
13 $ mkdir -p dir/subdir
14 $ echo dir/file >> dir/file
14 $ echo dir/file >> dir/file
15 $ echo dir/file2 >> dir/file2
15 $ echo dir/file2 >> dir/file2
16 $ echo dir/file3 >> dir/file3 # to be corrupted in rev 0
16 $ echo dir/file3 >> dir/file3 # to be corrupted in rev 0
17 $ echo dir/subdir/file3 >> dir/subdir/file3
17 $ echo dir/subdir/file3 >> dir/subdir/file3
18 $ echo dir/subdir/file4 >> dir/subdir/file4
18 $ echo dir/subdir/file4 >> dir/subdir/file4
19 $ hg ci -d '0 0' -qAm '0: add foo baz dir/'
19 $ hg ci -d '0 0' -qAm '0: add foo baz dir/'
20 $ echo bar > bar
20 $ echo bar > bar
21 $ echo quux > quux
21 $ echo quux > quux
22 $ echo dir/file4 >> dir/file4 # to be corrupted in rev 1
22 $ echo dir/file4 >> dir/file4 # to be corrupted in rev 1
23 $ hg copy foo copied
23 $ hg copy foo copied
24 $ hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
24 $ hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
25 $ echo >> foo
25 $ echo >> foo
26 $ hg ci -d '2 0' -m '2: change foo'
26 $ hg ci -d '2 0' -m '2: change foo'
27 $ hg up -qC 1
27 $ hg up -qC 1
28 $ echo >> bar
28 $ echo >> bar
29 $ echo >> quux
29 $ echo >> quux
30 $ hg ci -d '3 0' -m '3: change bar quux'
30 $ hg ci -d '3 0' -m '3: change bar quux'
31 created new head
31 created new head
32 $ hg up -qC 2
32 $ hg up -qC 2
33 $ hg merge -qr 3
33 $ hg merge -qr 3
34 $ echo >> bar
34 $ echo >> bar
35 $ echo >> baz
35 $ echo >> baz
36 $ hg ci -d '4 0' -m '4: first merge; change bar baz'
36 $ hg ci -d '4 0' -m '4: first merge; change bar baz'
37 $ echo >> bar
37 $ echo >> bar
38 $ echo 1 >> baz
38 $ echo 1 >> baz
39 $ echo >> quux
39 $ echo >> quux
40 $ hg ci -d '5 0' -m '5: change bar baz quux'
40 $ hg ci -d '5 0' -m '5: change bar baz quux'
41 $ hg up -qC 4
41 $ hg up -qC 4
42 $ echo >> foo
42 $ echo >> foo
43 $ echo 2 >> baz
43 $ echo 2 >> baz
44 $ hg ci -d '6 0' -m '6: change foo baz'
44 $ hg ci -d '6 0' -m '6: change foo baz'
45 created new head
45 created new head
46 $ hg up -qC 5
46 $ hg up -qC 5
47 $ hg merge -qr 6
47 $ hg merge -qr 6
48 $ echo >> bar
48 $ echo >> bar
49 $ hg ci -d '7 0' -m '7: second merge; change bar'
49 $ hg ci -d '7 0' -m '7: second merge; change bar'
50 $ echo >> foo
50 $ echo >> foo
51 $ hg ci -m '8: change foo'
51 $ hg ci -m '8: change foo'
52 $ glog
52 $ glog
53 @ 8 "8: change foo" files: foo
53 @ 8 "8: change foo" files: foo
54 |
54 |
55 o 7 "7: second merge; change bar" files: bar baz
55 o 7 "7: second merge; change bar" files: bar baz
56 |\
56 |\
57 | o 6 "6: change foo baz" files: baz foo
57 | o 6 "6: change foo baz" files: baz foo
58 | |
58 | |
59 o | 5 "5: change bar baz quux" files: bar baz quux
59 o | 5 "5: change bar baz quux" files: bar baz quux
60 |/
60 |/
61 o 4 "4: first merge; change bar baz" files: bar baz
61 o 4 "4: first merge; change bar baz" files: bar baz
62 |\
62 |\
63 | o 3 "3: change bar quux" files: bar quux
63 | o 3 "3: change bar quux" files: bar quux
64 | |
64 | |
65 o | 2 "2: change foo" files: foo
65 o | 2 "2: change foo" files: foo
66 |/
66 |/
67 o 1 "1: add bar quux; copy foo to copied" files: bar copied dir/file4 quux
67 o 1 "1: add bar quux; copy foo to copied" files: bar copied dir/file4 quux
68 |
68 |
69 o 0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/file3 dir/subdir/file3 dir/subdir/file4 foo
69 o 0 "0: add foo baz dir/" files: baz dir/file dir/file2 dir/file3 dir/subdir/file3 dir/subdir/file4 foo
70
70
71
71
72 final file versions in this repo:
72 final file versions in this repo:
73
73
74 $ hg manifest --debug
74 $ hg manifest --debug
75 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
75 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
76 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
76 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
77 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
77 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
78 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir/file
78 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir/file
79 75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 dir/file2
79 75e6d3f8328f5f6ace6bf10b98df793416a09dca 644 dir/file2
80 e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c 644 dir/file3
80 e96dce0bc6a217656a3a410e5e6bec2c4f42bf7c 644 dir/file3
81 6edd55f559cdce67132b12ca09e09cee08b60442 644 dir/file4
81 6edd55f559cdce67132b12ca09e09cee08b60442 644 dir/file4
82 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir/subdir/file3
82 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir/subdir/file3
83 57a1c1511590f3de52874adfa04effe8a77d64af 644 dir/subdir/file4
83 57a1c1511590f3de52874adfa04effe8a77d64af 644 dir/subdir/file4
84 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
84 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
85 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
85 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
86 $ hg debugrename copied
86 $ hg debugrename copied
87 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
87 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
88
88
89 $ cd ..
89 $ cd ..
90
90
91
91
92 Test interaction with startrev and verify that changing it is handled properly:
92 Test interaction with startrev and verify that changing it is handled properly:
93
93
94 $ > empty
94 $ > empty
95 $ hg convert --filemap empty source movingstart --config convert.hg.startrev=3 -r4
95 $ hg convert --filemap empty source movingstart --config convert.hg.startrev=3 -r4
96 initializing destination movingstart repository
96 initializing destination movingstart repository
97 scanning source...
97 scanning source...
98 sorting...
98 sorting...
99 converting...
99 converting...
100 1 3: change bar quux
100 1 3: change bar quux
101 0 4: first merge; change bar baz
101 0 4: first merge; change bar baz
102 $ hg convert --filemap empty source movingstart
102 $ hg convert --filemap empty source movingstart
103 scanning source...
103 scanning source...
104 sorting...
104 sorting...
105 converting...
105 converting...
106 3 5: change bar baz quux
106 3 5: change bar baz quux
107 2 6: change foo baz
107 2 6: change foo baz
108 1 7: second merge; change bar
108 1 7: second merge; change bar
109 warning: af455ce4166b3c9c88e6309c2b9332171dcea595 parent 61e22ca76c3b3e93df20338c4e02ce286898e825 is missing
109 warning: af455ce4166b3c9c88e6309c2b9332171dcea595 parent 61e22ca76c3b3e93df20338c4e02ce286898e825 is missing
110 warning: cf908b3eeedc301c9272ebae931da966d5b326c7 parent 59e1ab45c888289513b7354484dac8a88217beab is missing
110 warning: cf908b3eeedc301c9272ebae931da966d5b326c7 parent 59e1ab45c888289513b7354484dac8a88217beab is missing
111 0 8: change foo
111 0 8: change foo
112
112
113
113
114 splitrepo tests
114 splitrepo tests
115
115
116 $ splitrepo()
116 $ splitrepo()
117 > {
117 > {
118 > msg="$1"
118 > msg="$1"
119 > files="$2"
119 > files="$2"
120 > opts=$3
120 > opts=$3
121 > echo "% $files: $msg"
121 > echo "% $files: $msg"
122 > prefix=`echo "$files" | sed -e 's/ /-/g'`
122 > prefix=`echo "$files" | sed -e 's/ /-/g'`
123 > fmap="$prefix.fmap"
123 > fmap="$prefix.fmap"
124 > repo="$prefix.repo"
124 > repo="$prefix.repo"
125 > for i in $files; do
125 > for i in $files; do
126 > echo "include $i" >> "$fmap"
126 > echo "include $i" >> "$fmap"
127 > done
127 > done
128 > hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
128 > hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
129 > hg up -q -R "$repo"
129 > hg up -q -R "$repo"
130 > glog -R "$repo"
130 > glog -R "$repo"
131 > hg -R "$repo" manifest --debug
131 > hg -R "$repo" manifest --debug
132 > }
132 > }
133 $ splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
133 $ splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
134 % foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
134 % foo: skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd
135 @ 3 "8: change foo" files: foo
135 @ 3 "8: change foo" files: foo
136 |
136 |
137 o 2 "6: change foo baz" files: foo
137 o 2 "6: change foo baz" files: foo
138 |
138 |
139 o 1 "2: change foo" files: foo
139 o 1 "2: change foo" files: foo
140 |
140 |
141 o 0 "0: add foo baz dir/" files: foo
141 o 0 "0: add foo baz dir/" files: foo
142
142
143 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
143 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
144 $ splitrepo 'merges are not merges anymore' bar
144 $ splitrepo 'merges are not merges anymore' bar
145 % bar: merges are not merges anymore
145 % bar: merges are not merges anymore
146 @ 4 "7: second merge; change bar" files: bar
146 @ 4 "7: second merge; change bar" files: bar
147 |
147 |
148 o 3 "5: change bar baz quux" files: bar
148 o 3 "5: change bar baz quux" files: bar
149 |
149 |
150 o 2 "4: first merge; change bar baz" files: bar
150 o 2 "4: first merge; change bar baz" files: bar
151 |
151 |
152 o 1 "3: change bar quux" files: bar
152 o 1 "3: change bar quux" files: bar
153 |
153 |
154 o 0 "1: add bar quux; copy foo to copied" files: bar
154 o 0 "1: add bar quux; copy foo to copied" files: bar
155
155
156 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
156 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
157 $ splitrepo '1st merge is not a merge anymore; 2nd still is' baz
157 $ splitrepo '1st merge is not a merge anymore; 2nd still is' baz
158 % baz: 1st merge is not a merge anymore; 2nd still is
158 % baz: 1st merge is not a merge anymore; 2nd still is
159 @ 4 "7: second merge; change bar" files: baz
159 @ 4 "7: second merge; change bar" files: baz
160 |\
160 |\
161 | o 3 "6: change foo baz" files: baz
161 | o 3 "6: change foo baz" files: baz
162 | |
162 | |
163 o | 2 "5: change bar baz quux" files: baz
163 o | 2 "5: change bar baz quux" files: baz
164 |/
164 |/
165 o 1 "4: first merge; change bar baz" files: baz
165 o 1 "4: first merge; change bar baz" files: baz
166 |
166 |
167 o 0 "0: add foo baz dir/" files: baz
167 o 0 "0: add foo baz dir/" files: baz
168
168
169 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
169 94c1be4dfde2ee8d78db8bbfcf81210813307c3d 644 baz
170 $ splitrepo 'we add additional merges when they are interesting' 'foo quux'
170 $ splitrepo 'we add additional merges when they are interesting' 'foo quux'
171 % foo quux: we add additional merges when they are interesting
171 % foo quux: we add additional merges when they are interesting
172 @ 8 "8: change foo" files: foo
172 @ 8 "8: change foo" files: foo
173 |
173 |
174 o 7 "7: second merge; change bar" files:
174 o 7 "7: second merge; change bar" files:
175 |\
175 |\
176 | o 6 "6: change foo baz" files: foo
176 | o 6 "6: change foo baz" files: foo
177 | |
177 | |
178 o | 5 "5: change bar baz quux" files: quux
178 o | 5 "5: change bar baz quux" files: quux
179 |/
179 |/
180 o 4 "4: first merge; change bar baz" files:
180 o 4 "4: first merge; change bar baz" files:
181 |\
181 |\
182 | o 3 "3: change bar quux" files: quux
182 | o 3 "3: change bar quux" files: quux
183 | |
183 | |
184 o | 2 "2: change foo" files: foo
184 o | 2 "2: change foo" files: foo
185 |/
185 |/
186 o 1 "1: add bar quux; copy foo to copied" files: quux
186 o 1 "1: add bar quux; copy foo to copied" files: quux
187 |
187 |
188 o 0 "0: add foo baz dir/" files: foo
188 o 0 "0: add foo baz dir/" files: foo
189
189
190 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
190 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
191 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
191 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
192 $ splitrepo 'partial conversion' 'bar quux' '-r 3'
192 $ splitrepo 'partial conversion' 'bar quux' '-r 3'
193 % bar quux: partial conversion
193 % bar quux: partial conversion
194 @ 1 "3: change bar quux" files: bar quux
194 @ 1 "3: change bar quux" files: bar quux
195 |
195 |
196 o 0 "1: add bar quux; copy foo to copied" files: bar quux
196 o 0 "1: add bar quux; copy foo to copied" files: bar quux
197
197
198 b79105bedc55102f394e90a789c9c380117c1b4a 644 bar
198 b79105bedc55102f394e90a789c9c380117c1b4a 644 bar
199 db0421cc6b685a458c8d86c7d5c004f94429ea23 644 quux
199 db0421cc6b685a458c8d86c7d5c004f94429ea23 644 quux
200 $ splitrepo 'complete the partial conversion' 'bar quux'
200 $ splitrepo 'complete the partial conversion' 'bar quux'
201 % bar quux: complete the partial conversion
201 % bar quux: complete the partial conversion
202 @ 4 "7: second merge; change bar" files: bar
202 @ 4 "7: second merge; change bar" files: bar
203 |
203 |
204 o 3 "5: change bar baz quux" files: bar quux
204 o 3 "5: change bar baz quux" files: bar quux
205 |
205 |
206 o 2 "4: first merge; change bar baz" files: bar
206 o 2 "4: first merge; change bar baz" files: bar
207 |
207 |
208 o 1 "3: change bar quux" files: bar quux
208 o 1 "3: change bar quux" files: bar quux
209 |
209 |
210 o 0 "1: add bar quux; copy foo to copied" files: bar quux
210 o 0 "1: add bar quux; copy foo to copied" files: bar quux
211
211
212 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
212 9463f52fe115e377cf2878d4fc548117211063f2 644 bar
213 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
213 bc3eca3f47023a3e70ca0d8cc95a22a6827db19d 644 quux
214 $ rm -r foo.repo
214 $ rm -r foo.repo
215 $ splitrepo 'partial conversion' 'foo' '-r 3'
215 $ splitrepo 'partial conversion' 'foo' '-r 3'
216 % foo: partial conversion
216 % foo: partial conversion
217 @ 0 "0: add foo baz dir/" files: foo
217 @ 0 "0: add foo baz dir/" files: foo
218
218
219 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
219 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
220 $ splitrepo 'complete the partial conversion' 'foo'
220 $ splitrepo 'complete the partial conversion' 'foo'
221 % foo: complete the partial conversion
221 % foo: complete the partial conversion
222 @ 3 "8: change foo" files: foo
222 @ 3 "8: change foo" files: foo
223 |
223 |
224 o 2 "6: change foo baz" files: foo
224 o 2 "6: change foo baz" files: foo
225 |
225 |
226 o 1 "2: change foo" files: foo
226 o 1 "2: change foo" files: foo
227 |
227 |
228 o 0 "0: add foo baz dir/" files: foo
228 o 0 "0: add foo baz dir/" files: foo
229
229
230 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
230 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
231 $ splitrepo 'copied file; source not included in new repo' copied
231 $ splitrepo 'copied file; source not included in new repo' copied
232 % copied: copied file; source not included in new repo
232 % copied: copied file; source not included in new repo
233 @ 0 "1: add bar quux; copy foo to copied" files: copied
233 @ 0 "1: add bar quux; copy foo to copied" files: copied
234
234
235 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 copied
235 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 copied
236 $ hg --cwd copied.repo debugrename copied
236 $ hg --cwd copied.repo debugrename copied
237 copied not renamed
237 copied not renamed
238 $ splitrepo 'copied file; source included in new repo' 'foo copied'
238 $ splitrepo 'copied file; source included in new repo' 'foo copied'
239 % foo copied: copied file; source included in new repo
239 % foo copied: copied file; source included in new repo
240 @ 4 "8: change foo" files: foo
240 @ 4 "8: change foo" files: foo
241 |
241 |
242 o 3 "6: change foo baz" files: foo
242 o 3 "6: change foo baz" files: foo
243 |
243 |
244 o 2 "2: change foo" files: foo
244 o 2 "2: change foo" files: foo
245 |
245 |
246 o 1 "1: add bar quux; copy foo to copied" files: copied
246 o 1 "1: add bar quux; copy foo to copied" files: copied
247 |
247 |
248 o 0 "0: add foo baz dir/" files: foo
248 o 0 "0: add foo baz dir/" files: foo
249
249
250 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
250 7711d36246cc83e61fb29cd6d4ef394c63f1ceaf 644 copied
251 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
251 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo
252 $ hg --cwd foo-copied.repo debugrename copied
252 $ hg --cwd foo-copied.repo debugrename copied
253 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
253 copied renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
254
254
255 verify the top level 'include .' if there is no other includes:
255 verify the top level 'include .' if there is no other includes:
256
256
257 $ echo "exclude something" > default.fmap
257 $ echo "exclude something" > default.fmap
258 $ hg convert -q --filemap default.fmap -r1 source dummydest2
258 $ hg convert -q --filemap default.fmap -r1 source dummydest2
259 $ hg -R dummydest2 log --template '{rev} {node|short} {desc|firstline}\n'
259 $ hg -R dummydest2 log --template '{rev} {node|short} {desc|firstline}\n'
260 1 61e22ca76c3b 1: add bar quux; copy foo to copied
260 1 61e22ca76c3b 1: add bar quux; copy foo to copied
261 0 c085cf2ee7fe 0: add foo baz dir/
261 0 c085cf2ee7fe 0: add foo baz dir/
262
262
263 $ echo "include somethingelse" >> default.fmap
263 $ echo "include somethingelse" >> default.fmap
264 $ hg convert -q --filemap default.fmap -r1 source dummydest3
264 $ hg convert -q --filemap default.fmap -r1 source dummydest3
265 $ hg -R dummydest3 log --template '{rev} {node|short} {desc|firstline}\n'
265 $ hg -R dummydest3 log --template '{rev} {node|short} {desc|firstline}\n'
266
266
267 $ echo "include ." >> default.fmap
267 $ echo "include ." >> default.fmap
268 $ hg convert -q --filemap default.fmap -r1 source dummydest4
268 $ hg convert -q --filemap default.fmap -r1 source dummydest4
269 $ hg -R dummydest4 log --template '{rev} {node|short} {desc|firstline}\n'
269 $ hg -R dummydest4 log --template '{rev} {node|short} {desc|firstline}\n'
270 1 61e22ca76c3b 1: add bar quux; copy foo to copied
270 1 61e22ca76c3b 1: add bar quux; copy foo to copied
271 0 c085cf2ee7fe 0: add foo baz dir/
271 0 c085cf2ee7fe 0: add foo baz dir/
272
272
273 ensure that the filemap contains duplicated slashes (issue3612)
273 ensure that the filemap contains duplicated slashes (issue3612)
274
274
275 $ cat > renames.fmap <<EOF
275 $ cat > renames.fmap <<EOF
276 > include dir
276 > include dir
277 > exclude dir/file2
277 > exclude dir/file2
278 > rename dir dir2//dir3
278 > rename dir dir2//dir3
279 > include foo
279 > include foo
280 > include copied
280 > include copied
281 > rename foo foo2/
281 > rename foo foo2/
282 > rename copied ./copied2
282 > rename copied ./copied2
283 > exclude dir/subdir
283 > exclude dir/subdir
284 > include dir/subdir/file3
284 > include dir/subdir/file3
285 > EOF
285 > EOF
286 #if reporevlogstore
286 #if reporevlogstore
287 $ rm source/.hg/store/data/dir/file3.i
287 $ rm source/.hg/store/data/dir/file3.i
288 $ rm source/.hg/store/data/dir/file4.i
288 $ rm source/.hg/store/data/dir/file4.i
289 #endif
289 #endif
290 #if reposimplestore
290 #if reposimplestore
291 $ rm -rf source/.hg/store/data/dir/file3
291 $ rm -rf source/.hg/store/data/dir/file3
292 $ rm -rf source/.hg/store/data/dir/file4
292 $ rm -rf source/.hg/store/data/dir/file4
293 #endif
293 #endif
294 $ hg -q convert --filemap renames.fmap --datesort source dummydest
294 $ hg -q convert --filemap renames.fmap --datesort source dummydest
295 abort: data/dir/file3.i@e96dce0bc6a2: no match found! (reporevlogstore !)
295 abort: data/dir/file3.i@e96dce0bc6a2: no match found! (reporevlogstore !)
296 abort: data/dir/file3/index@e96dce0bc6a2: no node! (reposimplestore !)
296 abort: data/dir/file3/index@e96dce0bc6a2: no node! (reposimplestore !)
297 [255]
297 [255]
298 $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo
298 $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo
299 ignoring: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !)
299 ignoring: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !)
300 ignoring: data/dir/file4.i@6edd55f559cd: no match found (reporevlogstore !)
300 ignoring: data/dir/file4.i@6edd55f559cd: no match found (reporevlogstore !)
301 ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
301 ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !)
302 ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !)
302 ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !)
303 $ hg up -q -R renames.repo
303 $ hg up -q -R renames.repo
304 $ glog -R renames.repo
304 $ glog -R renames.repo
305 @ 4 "8: change foo" files: foo2
305 @ 4 "8: change foo" files: foo2
306 |
306 |
307 o 3 "6: change foo baz" files: foo2
307 o 3 "6: change foo baz" files: foo2
308 |
308 |
309 o 2 "2: change foo" files: foo2
309 o 2 "2: change foo" files: foo2
310 |
310 |
311 o 1 "1: add bar quux; copy foo to copied" files: copied2
311 o 1 "1: add bar quux; copy foo to copied" files: copied2
312 |
312 |
313 o 0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2
313 o 0 "0: add foo baz dir/" files: dir2/dir3/file dir2/dir3/subdir/file3 foo2
314
314
315 $ hg -R renames.repo verify
315 $ hg -R renames.repo verify
316 checking changesets
316 checking changesets
317 checking manifests
317 checking manifests
318 crosschecking files in changesets and manifests
318 crosschecking files in changesets and manifests
319 checking files
319 checking files
320 4 files, 5 changesets, 7 total revisions
320 checked 5 changesets with 7 changes to 4 files
321
321
322 $ hg -R renames.repo manifest --debug
322 $ hg -R renames.repo manifest --debug
323 d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644 copied2
323 d43feacba7a4f1f2080dde4a4b985bd8a0236d46 644 copied2
324 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir2/dir3/file
324 3e20847584beff41d7cd16136b7331ab3d754be0 644 dir2/dir3/file
325 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir2/dir3/subdir/file3
325 5fe139720576e18e34bcc9f79174db8897c8afe9 644 dir2/dir3/subdir/file3
326 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo2
326 9a7b52012991e4873687192c3e17e61ba3e837a3 644 foo2
327 $ hg --cwd renames.repo debugrename copied2
327 $ hg --cwd renames.repo debugrename copied2
328 copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
328 copied2 renamed from foo2:2ed2a3912a0b24502043eae84ee4b279c18b90dd
329
329
330 copied:
330 copied:
331
331
332 $ hg --cwd source cat copied
332 $ hg --cwd source cat copied
333 foo
333 foo
334
334
335 copied2:
335 copied2:
336
336
337 $ hg --cwd renames.repo cat copied2
337 $ hg --cwd renames.repo cat copied2
338 foo
338 foo
339
339
340 filemap errors
340 filemap errors
341
341
342 $ cat > errors.fmap <<EOF
342 $ cat > errors.fmap <<EOF
343 > include dir/ # beware that comments changes error line numbers!
343 > include dir/ # beware that comments changes error line numbers!
344 > exclude /dir
344 > exclude /dir
345 > rename dir//dir /dir//dir/ "out of sync"
345 > rename dir//dir /dir//dir/ "out of sync"
346 > include
346 > include
347 > EOF
347 > EOF
348 $ hg -q convert --filemap errors.fmap source errors.repo
348 $ hg -q convert --filemap errors.fmap source errors.repo
349 errors.fmap:3: superfluous / in include '/dir'
349 errors.fmap:3: superfluous / in include '/dir'
350 errors.fmap:3: superfluous / in rename '/dir'
350 errors.fmap:3: superfluous / in rename '/dir'
351 errors.fmap:4: unknown directive 'out of sync'
351 errors.fmap:4: unknown directive 'out of sync'
352 errors.fmap:5: path to exclude is missing
352 errors.fmap:5: path to exclude is missing
353 abort: errors in filemap
353 abort: errors in filemap
354 [255]
354 [255]
355
355
356 test branch closing revision pruning if branch is pruned
356 test branch closing revision pruning if branch is pruned
357
357
358 $ hg init branchpruning
358 $ hg init branchpruning
359 $ cd branchpruning
359 $ cd branchpruning
360 $ hg branch foo
360 $ hg branch foo
361 marked working directory as branch foo
361 marked working directory as branch foo
362 (branches are permanent and global, did you want a bookmark?)
362 (branches are permanent and global, did you want a bookmark?)
363 $ echo a > a
363 $ echo a > a
364 $ hg ci -Am adda
364 $ hg ci -Am adda
365 adding a
365 adding a
366 $ hg ci --close-branch -m closefoo
366 $ hg ci --close-branch -m closefoo
367 $ hg up 0
367 $ hg up 0
368 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
368 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 $ hg branch empty
369 $ hg branch empty
370 marked working directory as branch empty
370 marked working directory as branch empty
371 (branches are permanent and global, did you want a bookmark?)
371 (branches are permanent and global, did you want a bookmark?)
372 $ hg ci -m emptybranch
372 $ hg ci -m emptybranch
373 $ hg ci --close-branch -m closeempty
373 $ hg ci --close-branch -m closeempty
374 $ hg up 0
374 $ hg up 0
375 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 $ hg branch default
376 $ hg branch default
377 marked working directory as branch default
377 marked working directory as branch default
378 (branches are permanent and global, did you want a bookmark?)
378 (branches are permanent and global, did you want a bookmark?)
379 $ echo b > b
379 $ echo b > b
380 $ hg ci -Am addb
380 $ hg ci -Am addb
381 adding b
381 adding b
382 $ hg ci --close-branch -m closedefault
382 $ hg ci --close-branch -m closedefault
383 $ cat > filemap <<EOF
383 $ cat > filemap <<EOF
384 > include b
384 > include b
385 > EOF
385 > EOF
386 $ cd ..
386 $ cd ..
387 $ hg convert branchpruning branchpruning-hg1
387 $ hg convert branchpruning branchpruning-hg1
388 initializing destination branchpruning-hg1 repository
388 initializing destination branchpruning-hg1 repository
389 scanning source...
389 scanning source...
390 sorting...
390 sorting...
391 converting...
391 converting...
392 5 adda
392 5 adda
393 4 closefoo
393 4 closefoo
394 3 emptybranch
394 3 emptybranch
395 2 closeempty
395 2 closeempty
396 1 addb
396 1 addb
397 0 closedefault
397 0 closedefault
398 $ glog -R branchpruning-hg1
398 $ glog -R branchpruning-hg1
399 _ 5 "closedefault" files:
399 _ 5 "closedefault" files:
400 |
400 |
401 o 4 "addb" files: b
401 o 4 "addb" files: b
402 |
402 |
403 | _ 3 "closeempty" files:
403 | _ 3 "closeempty" files:
404 | |
404 | |
405 | o 2 "emptybranch" files:
405 | o 2 "emptybranch" files:
406 |/
406 |/
407 | _ 1 "closefoo" files:
407 | _ 1 "closefoo" files:
408 |/
408 |/
409 o 0 "adda" files: a
409 o 0 "adda" files: a
410
410
411
411
412 exercise incremental conversion at the same time
412 exercise incremental conversion at the same time
413
413
414 $ hg convert -r0 --filemap branchpruning/filemap branchpruning branchpruning-hg2
414 $ hg convert -r0 --filemap branchpruning/filemap branchpruning branchpruning-hg2
415 initializing destination branchpruning-hg2 repository
415 initializing destination branchpruning-hg2 repository
416 scanning source...
416 scanning source...
417 sorting...
417 sorting...
418 converting...
418 converting...
419 0 adda
419 0 adda
420 $ hg convert -r4 --filemap branchpruning/filemap branchpruning branchpruning-hg2
420 $ hg convert -r4 --filemap branchpruning/filemap branchpruning branchpruning-hg2
421 scanning source...
421 scanning source...
422 sorting...
422 sorting...
423 converting...
423 converting...
424 0 addb
424 0 addb
425 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2
425 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2
426 scanning source...
426 scanning source...
427 sorting...
427 sorting...
428 converting...
428 converting...
429 3 closefoo
429 3 closefoo
430 2 emptybranch
430 2 emptybranch
431 1 closeempty
431 1 closeempty
432 0 closedefault
432 0 closedefault
433 $ glog -R branchpruning-hg2
433 $ glog -R branchpruning-hg2
434 _ 1 "closedefault" files:
434 _ 1 "closedefault" files:
435 |
435 |
436 o 0 "addb" files: b
436 o 0 "addb" files: b
437
437
438
438
439 Test rebuilding of map with unknown revisions in shamap - it used to crash
439 Test rebuilding of map with unknown revisions in shamap - it used to crash
440
440
441 $ cd branchpruning
441 $ cd branchpruning
442 $ hg up -r 2
442 $ hg up -r 2
443 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
443 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
444 $ hg merge 4
444 $ hg merge 4
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
446 (branch merge, don't forget to commit)
446 (branch merge, don't forget to commit)
447 $ hg ci -m 'merging something'
447 $ hg ci -m 'merging something'
448 $ cd ..
448 $ cd ..
449 $ echo "53792d18237d2b64971fa571936869156655338d 6d955580116e82c4b029bd30f321323bae71a7f0" >> branchpruning-hg2/.hg/shamap
449 $ echo "53792d18237d2b64971fa571936869156655338d 6d955580116e82c4b029bd30f321323bae71a7f0" >> branchpruning-hg2/.hg/shamap
450 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 --debug --config progress.debug=true
450 $ hg convert --filemap branchpruning/filemap branchpruning branchpruning-hg2 --debug --config progress.debug=true
451 run hg source pre-conversion action
451 run hg source pre-conversion action
452 run hg sink pre-conversion action
452 run hg sink pre-conversion action
453 scanning source...
453 scanning source...
454 scanning: 1 revisions
454 scanning: 1 revisions
455 sorting...
455 sorting...
456 converting...
456 converting...
457 0 merging something
457 0 merging something
458 source: 2503605b178fe50e8fbbb0e77b97939540aa8c87
458 source: 2503605b178fe50e8fbbb0e77b97939540aa8c87
459 converting: 0/1 revisions (0.00%)
459 converting: 0/1 revisions (0.00%)
460 unknown revmap source: 53792d18237d2b64971fa571936869156655338d
460 unknown revmap source: 53792d18237d2b64971fa571936869156655338d
461 run hg sink post-conversion action
461 run hg sink post-conversion action
462 run hg source post-conversion action
462 run hg source post-conversion action
463
463
464
464
465 filemap rename undoing revision rename
465 filemap rename undoing revision rename
466
466
467 $ hg init renameundo
467 $ hg init renameundo
468 $ cd renameundo
468 $ cd renameundo
469 $ echo 1 > a
469 $ echo 1 > a
470 $ echo 1 > c
470 $ echo 1 > c
471 $ hg ci -qAm add
471 $ hg ci -qAm add
472 $ hg mv -q a b/a
472 $ hg mv -q a b/a
473 $ hg mv -q c b/c
473 $ hg mv -q c b/c
474 $ hg ci -qm rename
474 $ hg ci -qm rename
475 $ echo 2 > b/a
475 $ echo 2 > b/a
476 $ echo 2 > b/c
476 $ echo 2 > b/c
477 $ hg ci -qm modify
477 $ hg ci -qm modify
478 $ cd ..
478 $ cd ..
479
479
480 $ echo "rename b ." > renameundo.fmap
480 $ echo "rename b ." > renameundo.fmap
481 $ hg convert --filemap renameundo.fmap renameundo renameundo2
481 $ hg convert --filemap renameundo.fmap renameundo renameundo2
482 initializing destination renameundo2 repository
482 initializing destination renameundo2 repository
483 scanning source...
483 scanning source...
484 sorting...
484 sorting...
485 converting...
485 converting...
486 2 add
486 2 add
487 1 rename
487 1 rename
488 filtering out empty revision
488 filtering out empty revision
489 repository tip rolled back to revision 0 (undo convert)
489 repository tip rolled back to revision 0 (undo convert)
490 0 modify
490 0 modify
491 $ glog -R renameundo2
491 $ glog -R renameundo2
492 o 1 "modify" files: a c
492 o 1 "modify" files: a c
493 |
493 |
494 o 0 "add" files: a c
494 o 0 "add" files: a c
495
495
496
496
497
497
498 test merge parents/empty merges pruning
498 test merge parents/empty merges pruning
499
499
500 $ glog()
500 $ glog()
501 > {
501 > {
502 > hg log -G --template '{rev}:{node|short}@{branch} "{desc}" files: {files}\n' "$@"
502 > hg log -G --template '{rev}:{node|short}@{branch} "{desc}" files: {files}\n' "$@"
503 > }
503 > }
504
504
505 test anonymous branch pruning
505 test anonymous branch pruning
506
506
507 $ hg init anonymousbranch
507 $ hg init anonymousbranch
508 $ cd anonymousbranch
508 $ cd anonymousbranch
509 $ echo a > a
509 $ echo a > a
510 $ echo b > b
510 $ echo b > b
511 $ hg ci -Am add
511 $ hg ci -Am add
512 adding a
512 adding a
513 adding b
513 adding b
514 $ echo a >> a
514 $ echo a >> a
515 $ hg ci -m changea
515 $ hg ci -m changea
516 $ hg up 0
516 $ hg up 0
517 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
517 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 $ echo b >> b
518 $ echo b >> b
519 $ hg ci -m changeb
519 $ hg ci -m changeb
520 created new head
520 created new head
521 $ hg up 1
521 $ hg up 1
522 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
523 $ hg merge
523 $ hg merge
524 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
524 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 (branch merge, don't forget to commit)
525 (branch merge, don't forget to commit)
526 $ hg ci -m merge
526 $ hg ci -m merge
527 $ cd ..
527 $ cd ..
528
528
529 $ cat > filemap <<EOF
529 $ cat > filemap <<EOF
530 > include a
530 > include a
531 > EOF
531 > EOF
532 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg
532 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg
533 initializing destination anonymousbranch-hg repository
533 initializing destination anonymousbranch-hg repository
534 scanning source...
534 scanning source...
535 sorting...
535 sorting...
536 converting...
536 converting...
537 3 add
537 3 add
538 2 changea
538 2 changea
539 1 changeb
539 1 changeb
540 0 merge
540 0 merge
541 $ glog -R anonymousbranch
541 $ glog -R anonymousbranch
542 @ 3:c71d5201a498@default "merge" files:
542 @ 3:c71d5201a498@default "merge" files:
543 |\
543 |\
544 | o 2:607eb44b17f9@default "changeb" files: b
544 | o 2:607eb44b17f9@default "changeb" files: b
545 | |
545 | |
546 o | 1:1f60ea617824@default "changea" files: a
546 o | 1:1f60ea617824@default "changea" files: a
547 |/
547 |/
548 o 0:0146e6129113@default "add" files: a b
548 o 0:0146e6129113@default "add" files: a b
549
549
550 $ glog -R anonymousbranch-hg
550 $ glog -R anonymousbranch-hg
551 o 1:cda818e7219b@default "changea" files: a
551 o 1:cda818e7219b@default "changea" files: a
552 |
552 |
553 o 0:c334dc3be0da@default "add" files: a
553 o 0:c334dc3be0da@default "add" files: a
554
554
555 $ cat anonymousbranch-hg/.hg/shamap
555 $ cat anonymousbranch-hg/.hg/shamap
556 0146e6129113dba9ac90207cfdf2d7ed35257ae5 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
556 0146e6129113dba9ac90207cfdf2d7ed35257ae5 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
557 1f60ea61782421edf8d051ff4fcb61b330f26a4a cda818e7219b5f7f3fb9f49780054ed6a1905ec3
557 1f60ea61782421edf8d051ff4fcb61b330f26a4a cda818e7219b5f7f3fb9f49780054ed6a1905ec3
558 607eb44b17f9348cd5cbd26e16af87ba77b0b037 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
558 607eb44b17f9348cd5cbd26e16af87ba77b0b037 c334dc3be0daa2a4e9ce4d2e2bdcba40c09d4916
559 c71d5201a498b2658d105a6bf69d7a0df2649aea cda818e7219b5f7f3fb9f49780054ed6a1905ec3
559 c71d5201a498b2658d105a6bf69d7a0df2649aea cda818e7219b5f7f3fb9f49780054ed6a1905ec3
560
560
561 $ cat > filemap <<EOF
561 $ cat > filemap <<EOF
562 > include b
562 > include b
563 > EOF
563 > EOF
564 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg2
564 $ hg convert --filemap filemap anonymousbranch anonymousbranch-hg2
565 initializing destination anonymousbranch-hg2 repository
565 initializing destination anonymousbranch-hg2 repository
566 scanning source...
566 scanning source...
567 sorting...
567 sorting...
568 converting...
568 converting...
569 3 add
569 3 add
570 2 changea
570 2 changea
571 1 changeb
571 1 changeb
572 0 merge
572 0 merge
573 $ glog -R anonymousbranch
573 $ glog -R anonymousbranch
574 @ 3:c71d5201a498@default "merge" files:
574 @ 3:c71d5201a498@default "merge" files:
575 |\
575 |\
576 | o 2:607eb44b17f9@default "changeb" files: b
576 | o 2:607eb44b17f9@default "changeb" files: b
577 | |
577 | |
578 o | 1:1f60ea617824@default "changea" files: a
578 o | 1:1f60ea617824@default "changea" files: a
579 |/
579 |/
580 o 0:0146e6129113@default "add" files: a b
580 o 0:0146e6129113@default "add" files: a b
581
581
582 $ glog -R anonymousbranch-hg2
582 $ glog -R anonymousbranch-hg2
583 o 1:62dd350b0df6@default "changeb" files: b
583 o 1:62dd350b0df6@default "changeb" files: b
584 |
584 |
585 o 0:4b9ced861657@default "add" files: b
585 o 0:4b9ced861657@default "add" files: b
586
586
587 $ cat anonymousbranch-hg2/.hg/shamap
587 $ cat anonymousbranch-hg2/.hg/shamap
588 0146e6129113dba9ac90207cfdf2d7ed35257ae5 4b9ced86165703791653059a1db6ed864630a523
588 0146e6129113dba9ac90207cfdf2d7ed35257ae5 4b9ced86165703791653059a1db6ed864630a523
589 1f60ea61782421edf8d051ff4fcb61b330f26a4a 4b9ced86165703791653059a1db6ed864630a523
589 1f60ea61782421edf8d051ff4fcb61b330f26a4a 4b9ced86165703791653059a1db6ed864630a523
590 607eb44b17f9348cd5cbd26e16af87ba77b0b037 62dd350b0df695f7d2c82a02e0499b16fd790f22
590 607eb44b17f9348cd5cbd26e16af87ba77b0b037 62dd350b0df695f7d2c82a02e0499b16fd790f22
591 c71d5201a498b2658d105a6bf69d7a0df2649aea 62dd350b0df695f7d2c82a02e0499b16fd790f22
591 c71d5201a498b2658d105a6bf69d7a0df2649aea 62dd350b0df695f7d2c82a02e0499b16fd790f22
592
592
593 test named branch pruning
593 test named branch pruning
594
594
595 $ hg init namedbranch
595 $ hg init namedbranch
596 $ cd namedbranch
596 $ cd namedbranch
597 $ echo a > a
597 $ echo a > a
598 $ echo b > b
598 $ echo b > b
599 $ hg ci -Am add
599 $ hg ci -Am add
600 adding a
600 adding a
601 adding b
601 adding b
602 $ echo a >> a
602 $ echo a >> a
603 $ hg ci -m changea
603 $ hg ci -m changea
604 $ hg up 0
604 $ hg up 0
605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
606 $ hg branch foo
606 $ hg branch foo
607 marked working directory as branch foo
607 marked working directory as branch foo
608 (branches are permanent and global, did you want a bookmark?)
608 (branches are permanent and global, did you want a bookmark?)
609 $ echo b >> b
609 $ echo b >> b
610 $ hg ci -m changeb
610 $ hg ci -m changeb
611 $ hg up default
611 $ hg up default
612 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
612 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
613 $ hg merge foo
613 $ hg merge foo
614 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
614 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
615 (branch merge, don't forget to commit)
615 (branch merge, don't forget to commit)
616 $ hg ci -m merge
616 $ hg ci -m merge
617 $ cd ..
617 $ cd ..
618
618
619 $ cat > filemap <<EOF
619 $ cat > filemap <<EOF
620 > include a
620 > include a
621 > EOF
621 > EOF
622 $ hg convert --filemap filemap namedbranch namedbranch-hg
622 $ hg convert --filemap filemap namedbranch namedbranch-hg
623 initializing destination namedbranch-hg repository
623 initializing destination namedbranch-hg repository
624 scanning source...
624 scanning source...
625 sorting...
625 sorting...
626 converting...
626 converting...
627 3 add
627 3 add
628 2 changea
628 2 changea
629 1 changeb
629 1 changeb
630 0 merge
630 0 merge
631 $ glog -R namedbranch
631 $ glog -R namedbranch
632 @ 3:73899bcbe45c@default "merge" files:
632 @ 3:73899bcbe45c@default "merge" files:
633 |\
633 |\
634 | o 2:8097982d19fc@foo "changeb" files: b
634 | o 2:8097982d19fc@foo "changeb" files: b
635 | |
635 | |
636 o | 1:1f60ea617824@default "changea" files: a
636 o | 1:1f60ea617824@default "changea" files: a
637 |/
637 |/
638 o 0:0146e6129113@default "add" files: a b
638 o 0:0146e6129113@default "add" files: a b
639
639
640 $ glog -R namedbranch-hg
640 $ glog -R namedbranch-hg
641 o 1:cda818e7219b@default "changea" files: a
641 o 1:cda818e7219b@default "changea" files: a
642 |
642 |
643 o 0:c334dc3be0da@default "add" files: a
643 o 0:c334dc3be0da@default "add" files: a
644
644
645
645
646 $ cd namedbranch
646 $ cd namedbranch
647 $ hg --config extensions.mq= strip tip
647 $ hg --config extensions.mq= strip tip
648 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
648 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
649 saved backup bundle to $TESTTMP/namedbranch/.hg/strip-backup/73899bcbe45c-92adf160-backup.hg
649 saved backup bundle to $TESTTMP/namedbranch/.hg/strip-backup/73899bcbe45c-92adf160-backup.hg
650 $ hg up foo
650 $ hg up foo
651 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
651 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
652 $ hg merge default
652 $ hg merge default
653 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
653 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
654 (branch merge, don't forget to commit)
654 (branch merge, don't forget to commit)
655 $ hg ci -m merge
655 $ hg ci -m merge
656 $ cd ..
656 $ cd ..
657
657
658 $ hg convert --filemap filemap namedbranch namedbranch-hg2
658 $ hg convert --filemap filemap namedbranch namedbranch-hg2
659 initializing destination namedbranch-hg2 repository
659 initializing destination namedbranch-hg2 repository
660 scanning source...
660 scanning source...
661 sorting...
661 sorting...
662 converting...
662 converting...
663 3 add
663 3 add
664 2 changea
664 2 changea
665 1 changeb
665 1 changeb
666 0 merge
666 0 merge
667 $ glog -R namedbranch
667 $ glog -R namedbranch
668 @ 3:e1959de76e1b@foo "merge" files:
668 @ 3:e1959de76e1b@foo "merge" files:
669 |\
669 |\
670 | o 2:8097982d19fc@foo "changeb" files: b
670 | o 2:8097982d19fc@foo "changeb" files: b
671 | |
671 | |
672 o | 1:1f60ea617824@default "changea" files: a
672 o | 1:1f60ea617824@default "changea" files: a
673 |/
673 |/
674 o 0:0146e6129113@default "add" files: a b
674 o 0:0146e6129113@default "add" files: a b
675
675
676 $ glog -R namedbranch-hg2
676 $ glog -R namedbranch-hg2
677 o 2:dcf314454667@foo "merge" files:
677 o 2:dcf314454667@foo "merge" files:
678 |\
678 |\
679 | o 1:cda818e7219b@default "changea" files: a
679 | o 1:cda818e7219b@default "changea" files: a
680 |/
680 |/
681 o 0:c334dc3be0da@default "add" files: a
681 o 0:c334dc3be0da@default "add" files: a
682
682
683 $ cd ..
683 $ cd ..
684
684
685 test converting merges into a repo that contains other files
685 test converting merges into a repo that contains other files
686
686
687 $ hg init merge-test1
687 $ hg init merge-test1
688 $ cd merge-test1
688 $ cd merge-test1
689 $ touch a && hg commit -Aqm 'add a'
689 $ touch a && hg commit -Aqm 'add a'
690 $ echo a > a && hg commit -Aqm 'edit a'
690 $ echo a > a && hg commit -Aqm 'edit a'
691 $ hg up -q 0
691 $ hg up -q 0
692 $ touch b && hg commit -Aqm 'add b'
692 $ touch b && hg commit -Aqm 'add b'
693 $ hg merge -q 1 && hg commit -qm 'merge a & b'
693 $ hg merge -q 1 && hg commit -qm 'merge a & b'
694
694
695 $ cd ..
695 $ cd ..
696 $ hg init merge-test2
696 $ hg init merge-test2
697 $ cd merge-test2
697 $ cd merge-test2
698 $ mkdir converted
698 $ mkdir converted
699 $ touch converted/a toberemoved && hg commit -Aqm 'add converted/a & toberemoved'
699 $ touch converted/a toberemoved && hg commit -Aqm 'add converted/a & toberemoved'
700 $ touch x && rm toberemoved && hg commit -Aqm 'add x & remove tobremoved'
700 $ touch x && rm toberemoved && hg commit -Aqm 'add x & remove tobremoved'
701 $ cd ..
701 $ cd ..
702 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test1
702 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test1
703 @ 1191 merge a & b
703 @ 1191 merge a & b
704 |\
704 |\
705 | o 9077 add b
705 | o 9077 add b
706 | |
706 | |
707 o | d19f edit a
707 o | d19f edit a
708 |/
708 |/
709 o ac82 add a
709 o ac82 add a
710
710
711 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test2
711 $ hg log -G -T '{shortest(node)} {desc}' -R merge-test2
712 @ 150e add x & remove tobremoved
712 @ 150e add x & remove tobremoved
713 |
713 |
714 o bbac add converted/a & toberemoved
714 o bbac add converted/a & toberemoved
715
715
716 - Build a shamap where the target converted/a is in on top of an unrelated
716 - Build a shamap where the target converted/a is in on top of an unrelated
717 - change to 'x'. This simulates using convert to merge several repositories
717 - change to 'x'. This simulates using convert to merge several repositories
718 - together.
718 - together.
719 $ cat >> merge-test2/.hg/shamap <<EOF
719 $ cat >> merge-test2/.hg/shamap <<EOF
720 > $(hg -R merge-test1 log -r 0 -T '{node}') $(hg -R merge-test2 log -r 0 -T '{node}')
720 > $(hg -R merge-test1 log -r 0 -T '{node}') $(hg -R merge-test2 log -r 0 -T '{node}')
721 > $(hg -R merge-test1 log -r 1 -T '{node}') $(hg -R merge-test2 log -r 1 -T '{node}')
721 > $(hg -R merge-test1 log -r 1 -T '{node}') $(hg -R merge-test2 log -r 1 -T '{node}')
722 > EOF
722 > EOF
723 $ cat >> merge-test-filemap <<EOF
723 $ cat >> merge-test-filemap <<EOF
724 > rename . converted/
724 > rename . converted/
725 > EOF
725 > EOF
726 $ hg convert --filemap merge-test-filemap merge-test1 merge-test2 --traceback
726 $ hg convert --filemap merge-test-filemap merge-test1 merge-test2 --traceback
727 scanning source...
727 scanning source...
728 sorting...
728 sorting...
729 converting...
729 converting...
730 1 add b
730 1 add b
731 0 merge a & b
731 0 merge a & b
732 $ hg -R merge-test2 manifest -r tip
732 $ hg -R merge-test2 manifest -r tip
733 converted/a
733 converted/a
734 converted/b
734 converted/b
735 x
735 x
736 $ hg -R merge-test2 log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
736 $ hg -R merge-test2 log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
737 o 6eaa merge a & b
737 o 6eaa merge a & b
738 |\ - converted/a
738 |\ - converted/a
739 | | - toberemoved
739 | | - toberemoved
740 | |
740 | |
741 | o 2995 add b
741 | o 2995 add b
742 | | - converted/b
742 | | - converted/b
743 | |
743 | |
744 @ | 150e add x & remove tobremoved
744 @ | 150e add x & remove tobremoved
745 |/ - toberemoved
745 |/ - toberemoved
746 | - x
746 | - x
747 |
747 |
748 o bbac add converted/a & toberemoved
748 o bbac add converted/a & toberemoved
749 - converted/a
749 - converted/a
750 - toberemoved
750 - toberemoved
751
751
752 $ cd ..
752 $ cd ..
753
753
754 Test case where cleanp2 contains a file that doesn't exist in p2 - for
754 Test case where cleanp2 contains a file that doesn't exist in p2 - for
755 example because filemap changed.
755 example because filemap changed.
756
756
757 $ hg init cleanp2
757 $ hg init cleanp2
758 $ cd cleanp2
758 $ cd cleanp2
759 $ touch f f1 f2 && hg ci -Aqm '0'
759 $ touch f f1 f2 && hg ci -Aqm '0'
760 $ echo f1 > f1 && echo >> f && hg ci -m '1'
760 $ echo f1 > f1 && echo >> f && hg ci -m '1'
761 $ hg up -qr0 && echo f2 > f2 && echo >> f && hg ci -qm '2'
761 $ hg up -qr0 && echo f2 > f2 && echo >> f && hg ci -qm '2'
762 $ echo "include f" > filemap
762 $ echo "include f" > filemap
763 $ hg convert --filemap filemap .
763 $ hg convert --filemap filemap .
764 assuming destination .-hg
764 assuming destination .-hg
765 initializing destination .-hg repository
765 initializing destination .-hg repository
766 scanning source...
766 scanning source...
767 sorting...
767 sorting...
768 converting...
768 converting...
769 2 0
769 2 0
770 1 1
770 1 1
771 0 2
771 0 2
772 $ hg merge && hg ci -qm '3'
772 $ hg merge && hg ci -qm '3'
773 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 (branch merge, don't forget to commit)
774 (branch merge, don't forget to commit)
775 $ echo "include ." > filemap
775 $ echo "include ." > filemap
776 $ hg convert --filemap filemap .
776 $ hg convert --filemap filemap .
777 assuming destination .-hg
777 assuming destination .-hg
778 scanning source...
778 scanning source...
779 sorting...
779 sorting...
780 converting...
780 converting...
781 0 3
781 0 3
782 $ hg -R .-hg log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
782 $ hg -R .-hg log -G -T '{shortest(node)} {desc}\n{files % "- {file}\n"}\n'
783 o bbfe 3
783 o bbfe 3
784 |\
784 |\
785 | o 33a0 2
785 | o 33a0 2
786 | | - f
786 | | - f
787 | |
787 | |
788 o | f73e 1
788 o | f73e 1
789 |/ - f
789 |/ - f
790 |
790 |
791 o d681 0
791 o d681 0
792 - f
792 - f
793
793
794 $ hg -R .-hg mani -r tip
794 $ hg -R .-hg mani -r tip
795 f
795 f
796 $ cd ..
796 $ cd ..
@@ -1,208 +1,208 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > convert=
3 > convert=
4 > [convert]
4 > [convert]
5 > hg.saverev=False
5 > hg.saverev=False
6 > EOF
6 > EOF
7 $ hg init orig
7 $ hg init orig
8 $ cd orig
8 $ cd orig
9 $ echo foo > foo
9 $ echo foo > foo
10 $ echo bar > bar
10 $ echo bar > bar
11 $ hg ci -qAm 'add foo bar' -d '0 0'
11 $ hg ci -qAm 'add foo bar' -d '0 0'
12 $ echo >> foo
12 $ echo >> foo
13 $ hg ci -m 'change foo' -d '1 0'
13 $ hg ci -m 'change foo' -d '1 0'
14 $ hg up -qC 0
14 $ hg up -qC 0
15 $ hg copy --after --force foo bar
15 $ hg copy --after --force foo bar
16 $ hg copy foo baz
16 $ hg copy foo baz
17 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
17 $ hg ci -m 'make bar and baz copies of foo' -d '2 0'
18 created new head
18 created new head
19
19
20 Test that template can print all file copies (issue4362)
20 Test that template can print all file copies (issue4362)
21 $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}"
21 $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}"
22 File: bar (foo)
22 File: bar (foo)
23 File: baz (foo)
23 File: baz (foo)
24
24
25 $ hg bookmark premerge1
25 $ hg bookmark premerge1
26 $ hg merge -r 1
26 $ hg merge -r 1
27 merging baz and foo to baz
27 merging baz and foo to baz
28 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
28 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
29 (branch merge, don't forget to commit)
29 (branch merge, don't forget to commit)
30 $ hg ci -m 'merge local copy' -d '3 0'
30 $ hg ci -m 'merge local copy' -d '3 0'
31 $ hg up -C 1
31 $ hg up -C 1
32 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
32 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
33 (leaving bookmark premerge1)
33 (leaving bookmark premerge1)
34 $ hg bookmark premerge2
34 $ hg bookmark premerge2
35 $ hg merge 2
35 $ hg merge 2
36 merging foo and baz to baz
36 merging foo and baz to baz
37 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39 $ hg ci -m 'merge remote copy' -d '4 0'
39 $ hg ci -m 'merge remote copy' -d '4 0'
40 created new head
40 created new head
41
41
42 Make and delete some tags
42 Make and delete some tags
43
43
44 $ hg tag that
44 $ hg tag that
45 $ hg tag --remove that
45 $ hg tag --remove that
46 $ hg tag this
46 $ hg tag this
47
47
48 #if execbit
48 #if execbit
49 $ chmod +x baz
49 $ chmod +x baz
50 #else
50 #else
51 $ echo some other change to make sure we get a rev 5 > baz
51 $ echo some other change to make sure we get a rev 5 > baz
52 #endif
52 #endif
53 $ hg ci -m 'mark baz executable' -d '5 0'
53 $ hg ci -m 'mark baz executable' -d '5 0'
54 $ cd ..
54 $ cd ..
55 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
55 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
56 initializing destination new repository
56 initializing destination new repository
57 scanning source...
57 scanning source...
58 sorting...
58 sorting...
59 converting...
59 converting...
60 8 add foo bar
60 8 add foo bar
61 7 change foo
61 7 change foo
62 6 make bar and baz copies of foo
62 6 make bar and baz copies of foo
63 5 merge local copy
63 5 merge local copy
64 4 merge remote copy
64 4 merge remote copy
65 3 Added tag that for changeset 88586c4e9f02
65 3 Added tag that for changeset 88586c4e9f02
66 2 Removed tag that
66 2 Removed tag that
67 1 Added tag this for changeset c56a7f387039
67 1 Added tag this for changeset c56a7f387039
68 0 mark baz executable
68 0 mark baz executable
69 updating bookmarks
69 updating bookmarks
70 $ cd new
70 $ cd new
71 $ hg out ../orig
71 $ hg out ../orig
72 comparing with ../orig
72 comparing with ../orig
73 searching for changes
73 searching for changes
74 no changes found
74 no changes found
75 [1]
75 [1]
76 #if execbit
76 #if execbit
77 $ hg bookmarks
77 $ hg bookmarks
78 premerge1 3:973ef48a98a4
78 premerge1 3:973ef48a98a4
79 premerge2 8:91d107c423ba
79 premerge2 8:91d107c423ba
80 #else
80 #else
81 Different hash because no x bit
81 Different hash because no x bit
82 $ hg bookmarks
82 $ hg bookmarks
83 premerge1 3:973ef48a98a4
83 premerge1 3:973ef48a98a4
84 premerge2 8:3537b15eaaca
84 premerge2 8:3537b15eaaca
85 #endif
85 #endif
86
86
87 Test that redoing a convert results in an identical graph
87 Test that redoing a convert results in an identical graph
88 $ cd ../
88 $ cd ../
89 $ rm new/.hg/shamap
89 $ rm new/.hg/shamap
90 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
90 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
91 scanning source...
91 scanning source...
92 sorting...
92 sorting...
93 converting...
93 converting...
94 8 add foo bar
94 8 add foo bar
95 7 change foo
95 7 change foo
96 6 make bar and baz copies of foo
96 6 make bar and baz copies of foo
97 5 merge local copy
97 5 merge local copy
98 4 merge remote copy
98 4 merge remote copy
99 3 Added tag that for changeset 88586c4e9f02
99 3 Added tag that for changeset 88586c4e9f02
100 2 Removed tag that
100 2 Removed tag that
101 1 Added tag this for changeset c56a7f387039
101 1 Added tag this for changeset c56a7f387039
102 0 mark baz executable
102 0 mark baz executable
103 updating bookmarks
103 updating bookmarks
104 $ hg -R new log -G -T '{rev} {desc}'
104 $ hg -R new log -G -T '{rev} {desc}'
105 o 8 mark baz executable
105 o 8 mark baz executable
106 |
106 |
107 o 7 Added tag this for changeset c56a7f387039
107 o 7 Added tag this for changeset c56a7f387039
108 |
108 |
109 o 6 Removed tag that
109 o 6 Removed tag that
110 |
110 |
111 o 5 Added tag that for changeset 88586c4e9f02
111 o 5 Added tag that for changeset 88586c4e9f02
112 |
112 |
113 o 4 merge remote copy
113 o 4 merge remote copy
114 |\
114 |\
115 +---o 3 merge local copy
115 +---o 3 merge local copy
116 | |/
116 | |/
117 | o 2 make bar and baz copies of foo
117 | o 2 make bar and baz copies of foo
118 | |
118 | |
119 o | 1 change foo
119 o | 1 change foo
120 |/
120 |/
121 o 0 add foo bar
121 o 0 add foo bar
122
122
123
123
124 check shamap LF and CRLF handling
124 check shamap LF and CRLF handling
125
125
126 $ cat > rewrite.py <<EOF
126 $ cat > rewrite.py <<EOF
127 > import sys
127 > import sys
128 > # Interlace LF and CRLF
128 > # Interlace LF and CRLF
129 > lines = [(l.rstrip() + ((i % 2) and b'\n' or b'\r\n'))
129 > lines = [(l.rstrip() + ((i % 2) and b'\n' or b'\r\n'))
130 > for i, l in enumerate(open(sys.argv[1], 'rb'))]
130 > for i, l in enumerate(open(sys.argv[1], 'rb'))]
131 > open(sys.argv[1], 'wb').write(b''.join(lines))
131 > open(sys.argv[1], 'wb').write(b''.join(lines))
132 > EOF
132 > EOF
133 $ $PYTHON rewrite.py new/.hg/shamap
133 $ $PYTHON rewrite.py new/.hg/shamap
134 $ cd orig
134 $ cd orig
135 $ hg up -qC 1
135 $ hg up -qC 1
136 $ echo foo >> foo
136 $ echo foo >> foo
137 $ hg ci -qm 'change foo again'
137 $ hg ci -qm 'change foo again'
138 $ hg up -qC 2
138 $ hg up -qC 2
139 $ echo foo >> foo
139 $ echo foo >> foo
140 $ hg ci -qm 'change foo again again'
140 $ hg ci -qm 'change foo again again'
141 $ cd ..
141 $ cd ..
142 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
142 $ hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
143 scanning source...
143 scanning source...
144 sorting...
144 sorting...
145 converting...
145 converting...
146 1 change foo again again
146 1 change foo again again
147 0 change foo again
147 0 change foo again
148 updating bookmarks
148 updating bookmarks
149
149
150 init broken repository
150 init broken repository
151
151
152 $ hg init broken
152 $ hg init broken
153 $ cd broken
153 $ cd broken
154 $ echo a >> a
154 $ echo a >> a
155 $ echo b >> b
155 $ echo b >> b
156 $ hg ci -qAm init
156 $ hg ci -qAm init
157 $ echo a >> a
157 $ echo a >> a
158 $ echo b >> b
158 $ echo b >> b
159 $ hg copy b c
159 $ hg copy b c
160 $ hg ci -qAm changeall
160 $ hg ci -qAm changeall
161 $ hg up -qC 0
161 $ hg up -qC 0
162 $ echo bc >> b
162 $ echo bc >> b
163 $ hg ci -m changebagain
163 $ hg ci -m changebagain
164 created new head
164 created new head
165 $ HGMERGE=internal:local hg -q merge
165 $ HGMERGE=internal:local hg -q merge
166 $ hg ci -m merge
166 $ hg ci -m merge
167 $ hg mv b d
167 $ hg mv b d
168 $ hg ci -m moveb
168 $ hg ci -m moveb
169
169
170 break it
170 break it
171
171
172 #if reporevlogstore
172 #if reporevlogstore
173 $ rm .hg/store/data/b.*
173 $ rm .hg/store/data/b.*
174 #endif
174 #endif
175 #if reposimplestore
175 #if reposimplestore
176 $ rm .hg/store/data/b/*
176 $ rm .hg/store/data/b/*
177 #endif
177 #endif
178 $ cd ..
178 $ cd ..
179 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
179 $ hg --config convert.hg.ignoreerrors=True convert broken fixed
180 initializing destination fixed repository
180 initializing destination fixed repository
181 scanning source...
181 scanning source...
182 sorting...
182 sorting...
183 converting...
183 converting...
184 4 init
184 4 init
185 ignoring: data/b.i@1e88685f5dde: no match found (reporevlogstore !)
185 ignoring: data/b.i@1e88685f5dde: no match found (reporevlogstore !)
186 ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !)
186 ignoring: data/b/index@1e88685f5dde: no node (reposimplestore !)
187 3 changeall
187 3 changeall
188 2 changebagain
188 2 changebagain
189 1 merge
189 1 merge
190 0 moveb
190 0 moveb
191 $ hg -R fixed verify
191 $ hg -R fixed verify
192 checking changesets
192 checking changesets
193 checking manifests
193 checking manifests
194 crosschecking files in changesets and manifests
194 crosschecking files in changesets and manifests
195 checking files
195 checking files
196 3 files, 5 changesets, 5 total revisions
196 checked 5 changesets with 5 changes to 3 files
197
197
198 manifest -r 0
198 manifest -r 0
199
199
200 $ hg -R fixed manifest -r 0
200 $ hg -R fixed manifest -r 0
201 a
201 a
202
202
203 manifest -r tip
203 manifest -r tip
204
204
205 $ hg -R fixed manifest -r tip
205 $ hg -R fixed manifest -r tip
206 a
206 a
207 c
207 c
208 d
208 d
@@ -1,249 +1,249 b''
1 $ mkdir part1
1 $ mkdir part1
2 $ cd part1
2 $ cd part1
3
3
4 $ hg init
4 $ hg init
5 $ echo a > a
5 $ echo a > a
6 $ hg add a
6 $ hg add a
7 $ hg commit -m "1"
7 $ hg commit -m "1"
8 $ hg status
8 $ hg status
9 $ hg copy a b
9 $ hg copy a b
10 $ hg --config ui.portablefilenames=abort copy a con.xml
10 $ hg --config ui.portablefilenames=abort copy a con.xml
11 abort: filename contains 'con', which is reserved on Windows: con.xml
11 abort: filename contains 'con', which is reserved on Windows: con.xml
12 [255]
12 [255]
13 $ hg status
13 $ hg status
14 A b
14 A b
15 $ hg sum
15 $ hg sum
16 parent: 0:c19d34741b0a tip
16 parent: 0:c19d34741b0a tip
17 1
17 1
18 branch: default
18 branch: default
19 commit: 1 copied
19 commit: 1 copied
20 update: (current)
20 update: (current)
21 phases: 1 draft
21 phases: 1 draft
22 $ hg --debug commit -m "2"
22 $ hg --debug commit -m "2"
23 committing files:
23 committing files:
24 b
24 b
25 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
25 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
26 committing manifest
26 committing manifest
27 committing changelog
27 committing changelog
28 updating the branch cache
28 updating the branch cache
29 committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
29 committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4
30
30
31 we should see two history entries
31 we should see two history entries
32
32
33 $ hg history -v
33 $ hg history -v
34 changeset: 1:93580a2c28a5
34 changeset: 1:93580a2c28a5
35 tag: tip
35 tag: tip
36 user: test
36 user: test
37 date: Thu Jan 01 00:00:00 1970 +0000
37 date: Thu Jan 01 00:00:00 1970 +0000
38 files: b
38 files: b
39 description:
39 description:
40 2
40 2
41
41
42
42
43 changeset: 0:c19d34741b0a
43 changeset: 0:c19d34741b0a
44 user: test
44 user: test
45 date: Thu Jan 01 00:00:00 1970 +0000
45 date: Thu Jan 01 00:00:00 1970 +0000
46 files: a
46 files: a
47 description:
47 description:
48 1
48 1
49
49
50
50
51
51
52 we should see one log entry for a
52 we should see one log entry for a
53
53
54 $ hg log a
54 $ hg log a
55 changeset: 0:c19d34741b0a
55 changeset: 0:c19d34741b0a
56 user: test
56 user: test
57 date: Thu Jan 01 00:00:00 1970 +0000
57 date: Thu Jan 01 00:00:00 1970 +0000
58 summary: 1
58 summary: 1
59
59
60
60
61 this should show a revision linked to changeset 0
61 this should show a revision linked to changeset 0
62
62
63 $ hg debugindex a
63 $ hg debugindex a
64 rev linkrev nodeid p1 p2
64 rev linkrev nodeid p1 p2
65 0 0 b789fdd96dc2 000000000000 000000000000
65 0 0 b789fdd96dc2 000000000000 000000000000
66
66
67 we should see one log entry for b
67 we should see one log entry for b
68
68
69 $ hg log b
69 $ hg log b
70 changeset: 1:93580a2c28a5
70 changeset: 1:93580a2c28a5
71 tag: tip
71 tag: tip
72 user: test
72 user: test
73 date: Thu Jan 01 00:00:00 1970 +0000
73 date: Thu Jan 01 00:00:00 1970 +0000
74 summary: 2
74 summary: 2
75
75
76
76
77 this should show a revision linked to changeset 1
77 this should show a revision linked to changeset 1
78
78
79 $ hg debugindex b
79 $ hg debugindex b
80 rev linkrev nodeid p1 p2
80 rev linkrev nodeid p1 p2
81 0 1 37d9b5d994ea 000000000000 000000000000
81 0 1 37d9b5d994ea 000000000000 000000000000
82
82
83 this should show the rename information in the metadata
83 this should show the rename information in the metadata
84
84
85 $ hg debugdata b 0 | head -3 | tail -2
85 $ hg debugdata b 0 | head -3 | tail -2
86 copy: a
86 copy: a
87 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
87 copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
88
88
89 #if reporevlogstore
89 #if reporevlogstore
90 $ md5sum.py .hg/store/data/b.i
90 $ md5sum.py .hg/store/data/b.i
91 44913824c8f5890ae218f9829535922e .hg/store/data/b.i
91 44913824c8f5890ae218f9829535922e .hg/store/data/b.i
92 #endif
92 #endif
93 $ hg cat b > bsum
93 $ hg cat b > bsum
94 $ md5sum.py bsum
94 $ md5sum.py bsum
95 60b725f10c9c85c70d97880dfe8191b3 bsum
95 60b725f10c9c85c70d97880dfe8191b3 bsum
96 $ hg cat a > asum
96 $ hg cat a > asum
97 $ md5sum.py asum
97 $ md5sum.py asum
98 60b725f10c9c85c70d97880dfe8191b3 asum
98 60b725f10c9c85c70d97880dfe8191b3 asum
99 $ hg verify
99 $ hg verify
100 checking changesets
100 checking changesets
101 checking manifests
101 checking manifests
102 crosschecking files in changesets and manifests
102 crosschecking files in changesets and manifests
103 checking files
103 checking files
104 2 files, 2 changesets, 2 total revisions
104 checked 2 changesets with 2 changes to 2 files
105
105
106 $ cd ..
106 $ cd ..
107
107
108
108
109 $ mkdir part2
109 $ mkdir part2
110 $ cd part2
110 $ cd part2
111
111
112 $ hg init
112 $ hg init
113 $ echo foo > foo
113 $ echo foo > foo
114 should fail - foo is not managed
114 should fail - foo is not managed
115 $ hg mv foo bar
115 $ hg mv foo bar
116 foo: not copying - file is not managed
116 foo: not copying - file is not managed
117 abort: no files to copy
117 abort: no files to copy
118 [255]
118 [255]
119 $ hg st -A
119 $ hg st -A
120 ? foo
120 ? foo
121 $ hg add foo
121 $ hg add foo
122 dry-run; print a warning that this is not a real copy; foo is added
122 dry-run; print a warning that this is not a real copy; foo is added
123 $ hg mv --dry-run foo bar
123 $ hg mv --dry-run foo bar
124 foo has not been committed yet, so no copy data will be stored for bar.
124 foo has not been committed yet, so no copy data will be stored for bar.
125 $ hg st -A
125 $ hg st -A
126 A foo
126 A foo
127 should print a warning that this is not a real copy; bar is added
127 should print a warning that this is not a real copy; bar is added
128 $ hg mv foo bar
128 $ hg mv foo bar
129 foo has not been committed yet, so no copy data will be stored for bar.
129 foo has not been committed yet, so no copy data will be stored for bar.
130 $ hg st -A
130 $ hg st -A
131 A bar
131 A bar
132 should print a warning that this is not a real copy; foo is added
132 should print a warning that this is not a real copy; foo is added
133 $ hg cp bar foo
133 $ hg cp bar foo
134 bar has not been committed yet, so no copy data will be stored for foo.
134 bar has not been committed yet, so no copy data will be stored for foo.
135 $ hg rm -f bar
135 $ hg rm -f bar
136 $ rm bar
136 $ rm bar
137 $ hg st -A
137 $ hg st -A
138 A foo
138 A foo
139 $ hg commit -m1
139 $ hg commit -m1
140
140
141 moving a missing file
141 moving a missing file
142 $ rm foo
142 $ rm foo
143 $ hg mv foo foo3
143 $ hg mv foo foo3
144 foo: deleted in working directory
144 foo: deleted in working directory
145 foo3 does not exist!
145 foo3 does not exist!
146 $ hg up -qC .
146 $ hg up -qC .
147
147
148 copy --after to a nonexistent target filename
148 copy --after to a nonexistent target filename
149 $ hg cp -A foo dummy
149 $ hg cp -A foo dummy
150 foo: not recording copy - dummy does not exist
150 foo: not recording copy - dummy does not exist
151 [1]
151 [1]
152
152
153 dry-run; should show that foo is clean
153 dry-run; should show that foo is clean
154 $ hg copy --dry-run foo bar
154 $ hg copy --dry-run foo bar
155 $ hg st -A
155 $ hg st -A
156 C foo
156 C foo
157 should show copy
157 should show copy
158 $ hg copy foo bar
158 $ hg copy foo bar
159 $ hg st -C
159 $ hg st -C
160 A bar
160 A bar
161 foo
161 foo
162
162
163 shouldn't show copy
163 shouldn't show copy
164 $ hg commit -m2
164 $ hg commit -m2
165 $ hg st -C
165 $ hg st -C
166
166
167 should match
167 should match
168 $ hg debugindex foo
168 $ hg debugindex foo
169 rev linkrev nodeid p1 p2
169 rev linkrev nodeid p1 p2
170 0 0 2ed2a3912a0b 000000000000 000000000000
170 0 0 2ed2a3912a0b 000000000000 000000000000
171 $ hg debugrename bar
171 $ hg debugrename bar
172 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
172 bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
173
173
174 $ echo bleah > foo
174 $ echo bleah > foo
175 $ echo quux > bar
175 $ echo quux > bar
176 $ hg commit -m3
176 $ hg commit -m3
177
177
178 should not be renamed
178 should not be renamed
179 $ hg debugrename bar
179 $ hg debugrename bar
180 bar not renamed
180 bar not renamed
181
181
182 $ hg copy -f foo bar
182 $ hg copy -f foo bar
183 should show copy
183 should show copy
184 $ hg st -C
184 $ hg st -C
185 M bar
185 M bar
186 foo
186 foo
187
187
188 XXX: filtering lfilesrepo.status() in 3.3-rc causes the copy source to not be
188 XXX: filtering lfilesrepo.status() in 3.3-rc causes the copy source to not be
189 displayed.
189 displayed.
190 $ hg st -C --config extensions.largefiles=
190 $ hg st -C --config extensions.largefiles=
191 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
191 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
192 M bar
192 M bar
193 foo
193 foo
194
194
195 $ hg commit -m3
195 $ hg commit -m3
196
196
197 should show no parents for tip
197 should show no parents for tip
198 $ hg debugindex bar
198 $ hg debugindex bar
199 rev linkrev nodeid p1 p2
199 rev linkrev nodeid p1 p2
200 0 1 7711d36246cc 000000000000 000000000000
200 0 1 7711d36246cc 000000000000 000000000000
201 1 2 bdf70a2b8d03 7711d36246cc 000000000000
201 1 2 bdf70a2b8d03 7711d36246cc 000000000000
202 2 3 b2558327ea8d 000000000000 000000000000
202 2 3 b2558327ea8d 000000000000 000000000000
203 should match
203 should match
204 $ hg debugindex foo
204 $ hg debugindex foo
205 rev linkrev nodeid p1 p2
205 rev linkrev nodeid p1 p2
206 0 0 2ed2a3912a0b 000000000000 000000000000
206 0 0 2ed2a3912a0b 000000000000 000000000000
207 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
207 1 2 dd12c926cf16 2ed2a3912a0b 000000000000
208 $ hg debugrename bar
208 $ hg debugrename bar
209 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
209 bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
210
210
211 should show no copies
211 should show no copies
212 $ hg st -C
212 $ hg st -C
213
213
214 copy --after on an added file
214 copy --after on an added file
215 $ cp bar baz
215 $ cp bar baz
216 $ hg add baz
216 $ hg add baz
217 $ hg cp -A bar baz
217 $ hg cp -A bar baz
218 $ hg st -C
218 $ hg st -C
219 A baz
219 A baz
220 bar
220 bar
221
221
222 foo was clean:
222 foo was clean:
223 $ hg st -AC foo
223 $ hg st -AC foo
224 C foo
224 C foo
225 Trying to copy on top of an existing file fails,
225 Trying to copy on top of an existing file fails,
226 $ hg copy -A bar foo
226 $ hg copy -A bar foo
227 foo: not overwriting - file already committed
227 foo: not overwriting - file already committed
228 ('hg copy --after --force' to replace the file by recording a copy)
228 ('hg copy --after --force' to replace the file by recording a copy)
229 [1]
229 [1]
230 same error without the --after, so the user doesn't have to go through
230 same error without the --after, so the user doesn't have to go through
231 two hints:
231 two hints:
232 $ hg copy bar foo
232 $ hg copy bar foo
233 foo: not overwriting - file already committed
233 foo: not overwriting - file already committed
234 ('hg copy --force' to replace the file by recording a copy)
234 ('hg copy --force' to replace the file by recording a copy)
235 [1]
235 [1]
236 but it's considered modified after a copy --after --force
236 but it's considered modified after a copy --after --force
237 $ hg copy -Af bar foo
237 $ hg copy -Af bar foo
238 $ hg st -AC foo
238 $ hg st -AC foo
239 M foo
239 M foo
240 bar
240 bar
241 The hint for a file that exists but is not in file history doesn't
241 The hint for a file that exists but is not in file history doesn't
242 mention --force:
242 mention --force:
243 $ touch xyzzy
243 $ touch xyzzy
244 $ hg cp bar xyzzy
244 $ hg cp bar xyzzy
245 xyzzy: not overwriting - file exists
245 xyzzy: not overwriting - file exists
246 ('hg copy --after' to record the copy)
246 ('hg copy --after' to record the copy)
247 [1]
247 [1]
248
248
249 $ cd ..
249 $ cd ..
@@ -1,53 +1,53 b''
1 Create an empty repo:
1 Create an empty repo:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5
5
6 Try some commands:
6 Try some commands:
7
7
8 $ hg log
8 $ hg log
9 $ hg grep wah
9 $ hg grep wah
10 [1]
10 [1]
11 $ hg manifest
11 $ hg manifest
12 $ hg verify
12 $ hg verify
13 checking changesets
13 checking changesets
14 checking manifests
14 checking manifests
15 crosschecking files in changesets and manifests
15 crosschecking files in changesets and manifests
16 checking files
16 checking files
17 0 files, 0 changesets, 0 total revisions
17 checked 0 changesets with 0 changes to 0 files
18
18
19 Check the basic files created:
19 Check the basic files created:
20
20
21 $ ls .hg
21 $ ls .hg
22 00changelog.i
22 00changelog.i
23 requires
23 requires
24 store
24 store
25
25
26 Should be empty:
26 Should be empty:
27
27
28 $ ls .hg/store
28 $ ls .hg/store
29
29
30 Poke at a clone:
30 Poke at a clone:
31
31
32 $ cd ..
32 $ cd ..
33 $ hg clone a b
33 $ hg clone a b
34 updating to branch default
34 updating to branch default
35 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 $ cd b
36 $ cd b
37 $ hg verify
37 $ hg verify
38 checking changesets
38 checking changesets
39 checking manifests
39 checking manifests
40 crosschecking files in changesets and manifests
40 crosschecking files in changesets and manifests
41 checking files
41 checking files
42 0 files, 0 changesets, 0 total revisions
42 checked 0 changesets with 0 changes to 0 files
43 $ ls .hg
43 $ ls .hg
44 00changelog.i
44 00changelog.i
45 hgrc
45 hgrc
46 requires
46 requires
47 store
47 store
48
48
49 Should be empty:
49 Should be empty:
50
50
51 $ ls .hg/store
51 $ ls .hg/store
52
52
53 $ cd ..
53 $ cd ..
@@ -1,101 +1,101 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo foo > a
3 $ echo foo > a
4 $ echo foo > b
4 $ echo foo > b
5 $ hg add a b
5 $ hg add a b
6
6
7 $ hg ci -m "test"
7 $ hg ci -m "test"
8
8
9 $ echo blah > a
9 $ echo blah > a
10
10
11 $ hg ci -m "branch a"
11 $ hg ci -m "branch a"
12
12
13 $ hg co 0
13 $ hg co 0
14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15
15
16 $ echo blah > b
16 $ echo blah > b
17
17
18 $ hg ci -m "branch b"
18 $ hg ci -m "branch b"
19 created new head
19 created new head
20 $ HGMERGE=true hg merge 1
20 $ HGMERGE=true hg merge 1
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 (branch merge, don't forget to commit)
22 (branch merge, don't forget to commit)
23
23
24 $ hg ci -m "merge b/a -> blah"
24 $ hg ci -m "merge b/a -> blah"
25
25
26 $ hg co 1
26 $ hg co 1
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ HGMERGE=true hg merge 2
28 $ HGMERGE=true hg merge 2
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 (branch merge, don't forget to commit)
30 (branch merge, don't forget to commit)
31 $ hg ci -m "merge a/b -> blah"
31 $ hg ci -m "merge a/b -> blah"
32 created new head
32 created new head
33
33
34 $ hg log
34 $ hg log
35 changeset: 4:2ee31f665a86
35 changeset: 4:2ee31f665a86
36 tag: tip
36 tag: tip
37 parent: 1:96155394af80
37 parent: 1:96155394af80
38 parent: 2:92cc4c306b19
38 parent: 2:92cc4c306b19
39 user: test
39 user: test
40 date: Thu Jan 01 00:00:00 1970 +0000
40 date: Thu Jan 01 00:00:00 1970 +0000
41 summary: merge a/b -> blah
41 summary: merge a/b -> blah
42
42
43 changeset: 3:e16a66a37edd
43 changeset: 3:e16a66a37edd
44 parent: 2:92cc4c306b19
44 parent: 2:92cc4c306b19
45 parent: 1:96155394af80
45 parent: 1:96155394af80
46 user: test
46 user: test
47 date: Thu Jan 01 00:00:00 1970 +0000
47 date: Thu Jan 01 00:00:00 1970 +0000
48 summary: merge b/a -> blah
48 summary: merge b/a -> blah
49
49
50 changeset: 2:92cc4c306b19
50 changeset: 2:92cc4c306b19
51 parent: 0:5e0375449e74
51 parent: 0:5e0375449e74
52 user: test
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: branch b
54 summary: branch b
55
55
56 changeset: 1:96155394af80
56 changeset: 1:96155394af80
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59 summary: branch a
59 summary: branch a
60
60
61 changeset: 0:5e0375449e74
61 changeset: 0:5e0375449e74
62 user: test
62 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
63 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: test
64 summary: test
65
65
66 $ hg debugindex --changelog
66 $ hg debugindex --changelog
67 rev linkrev nodeid p1 p2
67 rev linkrev nodeid p1 p2
68 0 0 5e0375449e74 000000000000 000000000000
68 0 0 5e0375449e74 000000000000 000000000000
69 1 1 96155394af80 5e0375449e74 000000000000
69 1 1 96155394af80 5e0375449e74 000000000000
70 2 2 92cc4c306b19 5e0375449e74 000000000000
70 2 2 92cc4c306b19 5e0375449e74 000000000000
71 3 3 e16a66a37edd 92cc4c306b19 96155394af80
71 3 3 e16a66a37edd 92cc4c306b19 96155394af80
72 4 4 2ee31f665a86 96155394af80 92cc4c306b19
72 4 4 2ee31f665a86 96155394af80 92cc4c306b19
73
73
74 revision 1
74 revision 1
75 $ hg manifest --debug 1
75 $ hg manifest --debug 1
76 79d7492df40aa0fa093ec4209be78043c181f094 644 a
76 79d7492df40aa0fa093ec4209be78043c181f094 644 a
77 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 b
77 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 b
78 revision 2
78 revision 2
79 $ hg manifest --debug 2
79 $ hg manifest --debug 2
80 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 a
80 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 a
81 79d7492df40aa0fa093ec4209be78043c181f094 644 b
81 79d7492df40aa0fa093ec4209be78043c181f094 644 b
82 revision 3
82 revision 3
83 $ hg manifest --debug 3
83 $ hg manifest --debug 3
84 79d7492df40aa0fa093ec4209be78043c181f094 644 a
84 79d7492df40aa0fa093ec4209be78043c181f094 644 a
85 79d7492df40aa0fa093ec4209be78043c181f094 644 b
85 79d7492df40aa0fa093ec4209be78043c181f094 644 b
86 revision 4
86 revision 4
87 $ hg manifest --debug 4
87 $ hg manifest --debug 4
88 79d7492df40aa0fa093ec4209be78043c181f094 644 a
88 79d7492df40aa0fa093ec4209be78043c181f094 644 a
89 79d7492df40aa0fa093ec4209be78043c181f094 644 b
89 79d7492df40aa0fa093ec4209be78043c181f094 644 b
90
90
91 $ hg debugindex a
91 $ hg debugindex a
92 rev linkrev nodeid p1 p2
92 rev linkrev nodeid p1 p2
93 0 0 2ed2a3912a0b 000000000000 000000000000
93 0 0 2ed2a3912a0b 000000000000 000000000000
94 1 1 79d7492df40a 2ed2a3912a0b 000000000000
94 1 1 79d7492df40a 2ed2a3912a0b 000000000000
95
95
96 $ hg verify
96 $ hg verify
97 checking changesets
97 checking changesets
98 checking manifests
98 checking manifests
99 crosschecking files in changesets and manifests
99 crosschecking files in changesets and manifests
100 checking files
100 checking files
101 2 files, 5 changesets, 4 total revisions
101 checked 5 changesets with 4 changes to 2 files
@@ -1,146 +1,146 b''
1 This test makes sure that we don't mark a file as merged with its ancestor
1 This test makes sure that we don't mark a file as merged with its ancestor
2 when we do a merge.
2 when we do a merge.
3
3
4 $ cat <<EOF > merge
4 $ cat <<EOF > merge
5 > from __future__ import print_function
5 > from __future__ import print_function
6 > import sys, os
6 > import sys, os
7 > print("merging for", os.path.basename(sys.argv[1]))
7 > print("merging for", os.path.basename(sys.argv[1]))
8 > EOF
8 > EOF
9 $ HGMERGE="$PYTHON ../merge"; export HGMERGE
9 $ HGMERGE="$PYTHON ../merge"; export HGMERGE
10
10
11 Creating base:
11 Creating base:
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ echo 1 > foo
15 $ echo 1 > foo
16 $ echo 1 > bar
16 $ echo 1 > bar
17 $ echo 1 > baz
17 $ echo 1 > baz
18 $ echo 1 > quux
18 $ echo 1 > quux
19 $ hg add foo bar baz quux
19 $ hg add foo bar baz quux
20 $ hg commit -m "base"
20 $ hg commit -m "base"
21
21
22 $ cd ..
22 $ cd ..
23 $ hg clone a b
23 $ hg clone a b
24 updating to branch default
24 updating to branch default
25 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
26
26
27 Creating branch a:
27 Creating branch a:
28
28
29 $ cd a
29 $ cd a
30 $ echo 2a > foo
30 $ echo 2a > foo
31 $ echo 2a > bar
31 $ echo 2a > bar
32 $ hg commit -m "branch a"
32 $ hg commit -m "branch a"
33
33
34 Creating branch b:
34 Creating branch b:
35
35
36 $ cd ..
36 $ cd ..
37 $ cd b
37 $ cd b
38 $ echo 2b > foo
38 $ echo 2b > foo
39 $ echo 2b > baz
39 $ echo 2b > baz
40 $ hg commit -m "branch b"
40 $ hg commit -m "branch b"
41
41
42 We shouldn't have anything but n state here:
42 We shouldn't have anything but n state here:
43
43
44 $ hg debugstate --nodates | grep -v "^n"
44 $ hg debugstate --nodates | grep -v "^n"
45 [1]
45 [1]
46
46
47 Merging:
47 Merging:
48
48
49 $ hg pull ../a
49 $ hg pull ../a
50 pulling from ../a
50 pulling from ../a
51 searching for changes
51 searching for changes
52 adding changesets
52 adding changesets
53 adding manifests
53 adding manifests
54 adding file changes
54 adding file changes
55 added 1 changesets with 2 changes to 2 files (+1 heads)
55 added 1 changesets with 2 changes to 2 files (+1 heads)
56 new changesets bdd988058d16
56 new changesets bdd988058d16
57 (run 'hg heads' to see heads, 'hg merge' to merge)
57 (run 'hg heads' to see heads, 'hg merge' to merge)
58
58
59 $ hg merge -v
59 $ hg merge -v
60 resolving manifests
60 resolving manifests
61 getting bar
61 getting bar
62 merging foo
62 merging foo
63 merging for foo
63 merging for foo
64 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
65 (branch merge, don't forget to commit)
65 (branch merge, don't forget to commit)
66
66
67 $ echo 2m > foo
67 $ echo 2m > foo
68 $ echo 2b > baz
68 $ echo 2b > baz
69 $ echo new > quux
69 $ echo new > quux
70
70
71 $ hg ci -m "merge"
71 $ hg ci -m "merge"
72
72
73 main: we should have a merge here:
73 main: we should have a merge here:
74
74
75 $ hg debugindex --changelog
75 $ hg debugindex --changelog
76 rev linkrev nodeid p1 p2
76 rev linkrev nodeid p1 p2
77 0 0 cdca01651b96 000000000000 000000000000
77 0 0 cdca01651b96 000000000000 000000000000
78 1 1 f6718a9cb7f3 cdca01651b96 000000000000
78 1 1 f6718a9cb7f3 cdca01651b96 000000000000
79 2 2 bdd988058d16 cdca01651b96 000000000000
79 2 2 bdd988058d16 cdca01651b96 000000000000
80 3 3 d8a521142a3c f6718a9cb7f3 bdd988058d16
80 3 3 d8a521142a3c f6718a9cb7f3 bdd988058d16
81
81
82 log should show foo and quux changed:
82 log should show foo and quux changed:
83
83
84 $ hg log -v -r tip
84 $ hg log -v -r tip
85 changeset: 3:d8a521142a3c
85 changeset: 3:d8a521142a3c
86 tag: tip
86 tag: tip
87 parent: 1:f6718a9cb7f3
87 parent: 1:f6718a9cb7f3
88 parent: 2:bdd988058d16
88 parent: 2:bdd988058d16
89 user: test
89 user: test
90 date: Thu Jan 01 00:00:00 1970 +0000
90 date: Thu Jan 01 00:00:00 1970 +0000
91 files: foo quux
91 files: foo quux
92 description:
92 description:
93 merge
93 merge
94
94
95
95
96
96
97 foo: we should have a merge here:
97 foo: we should have a merge here:
98
98
99 $ hg debugindex foo
99 $ hg debugindex foo
100 rev linkrev nodeid p1 p2
100 rev linkrev nodeid p1 p2
101 0 0 b8e02f643373 000000000000 000000000000
101 0 0 b8e02f643373 000000000000 000000000000
102 1 1 2ffeddde1b65 b8e02f643373 000000000000
102 1 1 2ffeddde1b65 b8e02f643373 000000000000
103 2 2 33d1fb69067a b8e02f643373 000000000000
103 2 2 33d1fb69067a b8e02f643373 000000000000
104 3 3 aa27919ee430 2ffeddde1b65 33d1fb69067a
104 3 3 aa27919ee430 2ffeddde1b65 33d1fb69067a
105
105
106 bar: we should not have a merge here:
106 bar: we should not have a merge here:
107
107
108 $ hg debugindex bar
108 $ hg debugindex bar
109 rev linkrev nodeid p1 p2
109 rev linkrev nodeid p1 p2
110 0 0 b8e02f643373 000000000000 000000000000
110 0 0 b8e02f643373 000000000000 000000000000
111 1 2 33d1fb69067a b8e02f643373 000000000000
111 1 2 33d1fb69067a b8e02f643373 000000000000
112
112
113 baz: we should not have a merge here:
113 baz: we should not have a merge here:
114
114
115 $ hg debugindex baz
115 $ hg debugindex baz
116 rev linkrev nodeid p1 p2
116 rev linkrev nodeid p1 p2
117 0 0 b8e02f643373 000000000000 000000000000
117 0 0 b8e02f643373 000000000000 000000000000
118 1 1 2ffeddde1b65 b8e02f643373 000000000000
118 1 1 2ffeddde1b65 b8e02f643373 000000000000
119
119
120 quux: we should not have a merge here:
120 quux: we should not have a merge here:
121
121
122 $ hg debugindex quux
122 $ hg debugindex quux
123 rev linkrev nodeid p1 p2
123 rev linkrev nodeid p1 p2
124 0 0 b8e02f643373 000000000000 000000000000
124 0 0 b8e02f643373 000000000000 000000000000
125 1 3 6128c0f33108 b8e02f643373 000000000000
125 1 3 6128c0f33108 b8e02f643373 000000000000
126
126
127 Manifest entries should match tips of all files:
127 Manifest entries should match tips of all files:
128
128
129 $ hg manifest --debug
129 $ hg manifest --debug
130 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
130 33d1fb69067a0139622a3fa3b7ba1cdb1367972e 644 bar
131 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
131 2ffeddde1b65b4827f6746174a145474129fa2ce 644 baz
132 aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
132 aa27919ee4303cfd575e1fb932dd64d75aa08be4 644 foo
133 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
133 6128c0f33108e8cfbb4e0824d13ae48b466d7280 644 quux
134
134
135 Everything should be clean now:
135 Everything should be clean now:
136
136
137 $ hg status
137 $ hg status
138
138
139 $ hg verify
139 $ hg verify
140 checking changesets
140 checking changesets
141 checking manifests
141 checking manifests
142 crosschecking files in changesets and manifests
142 crosschecking files in changesets and manifests
143 checking files
143 checking files
144 4 files, 4 changesets, 10 total revisions
144 checked 4 changesets with 10 changes to 4 files
145
145
146 $ cd ..
146 $ cd ..
@@ -1,510 +1,510 b''
1 #require repofncache
1 #require repofncache
2
2
3 Init repo1:
3 Init repo1:
4
4
5 $ hg init repo1
5 $ hg init repo1
6 $ cd repo1
6 $ cd repo1
7 $ echo "some text" > a
7 $ echo "some text" > a
8 $ hg add
8 $ hg add
9 adding a
9 adding a
10 $ hg ci -m first
10 $ hg ci -m first
11 $ cat .hg/store/fncache | sort
11 $ cat .hg/store/fncache | sort
12 data/a.i
12 data/a.i
13
13
14 Testing a.i/b:
14 Testing a.i/b:
15
15
16 $ mkdir a.i
16 $ mkdir a.i
17 $ echo "some other text" > a.i/b
17 $ echo "some other text" > a.i/b
18 $ hg add
18 $ hg add
19 adding a.i/b
19 adding a.i/b
20 $ hg ci -m second
20 $ hg ci -m second
21 $ cat .hg/store/fncache | sort
21 $ cat .hg/store/fncache | sort
22 data/a.i
22 data/a.i
23 data/a.i.hg/b.i
23 data/a.i.hg/b.i
24
24
25 Testing a.i.hg/c:
25 Testing a.i.hg/c:
26
26
27 $ mkdir a.i.hg
27 $ mkdir a.i.hg
28 $ echo "yet another text" > a.i.hg/c
28 $ echo "yet another text" > a.i.hg/c
29 $ hg add
29 $ hg add
30 adding a.i.hg/c
30 adding a.i.hg/c
31 $ hg ci -m third
31 $ hg ci -m third
32 $ cat .hg/store/fncache | sort
32 $ cat .hg/store/fncache | sort
33 data/a.i
33 data/a.i
34 data/a.i.hg.hg/c.i
34 data/a.i.hg.hg/c.i
35 data/a.i.hg/b.i
35 data/a.i.hg/b.i
36
36
37 Testing verify:
37 Testing verify:
38
38
39 $ hg verify
39 $ hg verify
40 checking changesets
40 checking changesets
41 checking manifests
41 checking manifests
42 crosschecking files in changesets and manifests
42 crosschecking files in changesets and manifests
43 checking files
43 checking files
44 3 files, 3 changesets, 3 total revisions
44 checked 3 changesets with 3 changes to 3 files
45
45
46 $ rm .hg/store/fncache
46 $ rm .hg/store/fncache
47
47
48 $ hg verify
48 $ hg verify
49 checking changesets
49 checking changesets
50 checking manifests
50 checking manifests
51 crosschecking files in changesets and manifests
51 crosschecking files in changesets and manifests
52 checking files
52 checking files
53 warning: revlog 'data/a.i' not in fncache!
53 warning: revlog 'data/a.i' not in fncache!
54 warning: revlog 'data/a.i.hg/c.i' not in fncache!
54 warning: revlog 'data/a.i.hg/c.i' not in fncache!
55 warning: revlog 'data/a.i/b.i' not in fncache!
55 warning: revlog 'data/a.i/b.i' not in fncache!
56 3 files, 3 changesets, 3 total revisions
56 checked 3 changesets with 3 changes to 3 files
57 3 warnings encountered!
57 3 warnings encountered!
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
59
59
60 Follow the hint to make sure it works
60 Follow the hint to make sure it works
61
61
62 $ hg debugrebuildfncache
62 $ hg debugrebuildfncache
63 adding data/a.i
63 adding data/a.i
64 adding data/a.i.hg/c.i
64 adding data/a.i.hg/c.i
65 adding data/a.i/b.i
65 adding data/a.i/b.i
66 3 items added, 0 removed from fncache
66 3 items added, 0 removed from fncache
67
67
68 $ hg verify
68 $ hg verify
69 checking changesets
69 checking changesets
70 checking manifests
70 checking manifests
71 crosschecking files in changesets and manifests
71 crosschecking files in changesets and manifests
72 checking files
72 checking files
73 3 files, 3 changesets, 3 total revisions
73 checked 3 changesets with 3 changes to 3 files
74
74
75 $ cd ..
75 $ cd ..
76
76
77 Non store repo:
77 Non store repo:
78
78
79 $ hg --config format.usestore=False init foo
79 $ hg --config format.usestore=False init foo
80 $ cd foo
80 $ cd foo
81 $ mkdir tst.d
81 $ mkdir tst.d
82 $ echo foo > tst.d/foo
82 $ echo foo > tst.d/foo
83 $ hg ci -Amfoo
83 $ hg ci -Amfoo
84 adding tst.d/foo
84 adding tst.d/foo
85 $ find .hg | sort
85 $ find .hg | sort
86 .hg
86 .hg
87 .hg/00changelog.i
87 .hg/00changelog.i
88 .hg/00manifest.i
88 .hg/00manifest.i
89 .hg/cache
89 .hg/cache
90 .hg/cache/branch2-served
90 .hg/cache/branch2-served
91 .hg/cache/manifestfulltextcache (reporevlogstore !)
91 .hg/cache/manifestfulltextcache (reporevlogstore !)
92 .hg/cache/rbc-names-v1
92 .hg/cache/rbc-names-v1
93 .hg/cache/rbc-revs-v1
93 .hg/cache/rbc-revs-v1
94 .hg/data
94 .hg/data
95 .hg/data/tst.d.hg
95 .hg/data/tst.d.hg
96 .hg/data/tst.d.hg/foo.i
96 .hg/data/tst.d.hg/foo.i
97 .hg/dirstate
97 .hg/dirstate
98 .hg/fsmonitor.state (fsmonitor !)
98 .hg/fsmonitor.state (fsmonitor !)
99 .hg/last-message.txt
99 .hg/last-message.txt
100 .hg/phaseroots
100 .hg/phaseroots
101 .hg/requires
101 .hg/requires
102 .hg/undo
102 .hg/undo
103 .hg/undo.backup.dirstate
103 .hg/undo.backup.dirstate
104 .hg/undo.backupfiles
104 .hg/undo.backupfiles
105 .hg/undo.bookmarks
105 .hg/undo.bookmarks
106 .hg/undo.branch
106 .hg/undo.branch
107 .hg/undo.desc
107 .hg/undo.desc
108 .hg/undo.dirstate
108 .hg/undo.dirstate
109 .hg/undo.phaseroots
109 .hg/undo.phaseroots
110 $ cd ..
110 $ cd ..
111
111
112 Non fncache repo:
112 Non fncache repo:
113
113
114 $ hg --config format.usefncache=False init bar
114 $ hg --config format.usefncache=False init bar
115 $ cd bar
115 $ cd bar
116 $ mkdir tst.d
116 $ mkdir tst.d
117 $ echo foo > tst.d/Foo
117 $ echo foo > tst.d/Foo
118 $ hg ci -Amfoo
118 $ hg ci -Amfoo
119 adding tst.d/Foo
119 adding tst.d/Foo
120 $ find .hg | sort
120 $ find .hg | sort
121 .hg
121 .hg
122 .hg/00changelog.i
122 .hg/00changelog.i
123 .hg/cache
123 .hg/cache
124 .hg/cache/branch2-served
124 .hg/cache/branch2-served
125 .hg/cache/manifestfulltextcache (reporevlogstore !)
125 .hg/cache/manifestfulltextcache (reporevlogstore !)
126 .hg/cache/rbc-names-v1
126 .hg/cache/rbc-names-v1
127 .hg/cache/rbc-revs-v1
127 .hg/cache/rbc-revs-v1
128 .hg/dirstate
128 .hg/dirstate
129 .hg/fsmonitor.state (fsmonitor !)
129 .hg/fsmonitor.state (fsmonitor !)
130 .hg/last-message.txt
130 .hg/last-message.txt
131 .hg/requires
131 .hg/requires
132 .hg/store
132 .hg/store
133 .hg/store/00changelog.i
133 .hg/store/00changelog.i
134 .hg/store/00manifest.i
134 .hg/store/00manifest.i
135 .hg/store/data
135 .hg/store/data
136 .hg/store/data/tst.d.hg
136 .hg/store/data/tst.d.hg
137 .hg/store/data/tst.d.hg/_foo.i
137 .hg/store/data/tst.d.hg/_foo.i
138 .hg/store/phaseroots
138 .hg/store/phaseroots
139 .hg/store/undo
139 .hg/store/undo
140 .hg/store/undo.backupfiles
140 .hg/store/undo.backupfiles
141 .hg/store/undo.phaseroots
141 .hg/store/undo.phaseroots
142 .hg/undo.backup.dirstate
142 .hg/undo.backup.dirstate
143 .hg/undo.bookmarks
143 .hg/undo.bookmarks
144 .hg/undo.branch
144 .hg/undo.branch
145 .hg/undo.desc
145 .hg/undo.desc
146 .hg/undo.dirstate
146 .hg/undo.dirstate
147 $ cd ..
147 $ cd ..
148
148
149 Encoding of reserved / long paths in the store
149 Encoding of reserved / long paths in the store
150
150
151 $ hg init r2
151 $ hg init r2
152 $ cd r2
152 $ cd r2
153 $ cat <<EOF > .hg/hgrc
153 $ cat <<EOF > .hg/hgrc
154 > [ui]
154 > [ui]
155 > portablefilenames = ignore
155 > portablefilenames = ignore
156 > EOF
156 > EOF
157
157
158 $ hg import -q --bypass - <<EOF
158 $ hg import -q --bypass - <<EOF
159 > # HG changeset patch
159 > # HG changeset patch
160 > # User test
160 > # User test
161 > # Date 0 0
161 > # Date 0 0
162 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
162 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
163 > # Parent 0000000000000000000000000000000000000000
163 > # Parent 0000000000000000000000000000000000000000
164 > 1
164 > 1
165 >
165 >
166 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
166 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
167 > new file mode 100644
167 > new file mode 100644
168 > --- /dev/null
168 > --- /dev/null
169 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
169 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
170 > @@ -0,0 +1,1 @@
170 > @@ -0,0 +1,1 @@
171 > +foo
171 > +foo
172 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
172 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
173 > new file mode 100644
173 > new file mode 100644
174 > --- /dev/null
174 > --- /dev/null
175 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
175 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
176 > @@ -0,0 +1,1 @@
176 > @@ -0,0 +1,1 @@
177 > +foo
177 > +foo
178 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
178 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
179 > new file mode 100644
179 > new file mode 100644
180 > --- /dev/null
180 > --- /dev/null
181 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
181 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
182 > @@ -0,0 +1,1 @@
182 > @@ -0,0 +1,1 @@
183 > +foo
183 > +foo
184 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
184 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
185 > new file mode 100644
185 > new file mode 100644
186 > --- /dev/null
186 > --- /dev/null
187 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
187 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
188 > @@ -0,0 +1,1 @@
188 > @@ -0,0 +1,1 @@
189 > +foo
189 > +foo
190 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
190 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
191 > new file mode 100644
191 > new file mode 100644
192 > --- /dev/null
192 > --- /dev/null
193 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
193 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
194 > @@ -0,0 +1,1 @@
194 > @@ -0,0 +1,1 @@
195 > +foo
195 > +foo
196 > EOF
196 > EOF
197
197
198 $ find .hg/store -name *.i | sort
198 $ find .hg/store -name *.i | sort
199 .hg/store/00changelog.i
199 .hg/store/00changelog.i
200 .hg/store/00manifest.i
200 .hg/store/00manifest.i
201 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
201 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
202 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
202 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
203 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
203 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
204 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
204 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
205 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
205 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
206
206
207 $ cd ..
207 $ cd ..
208
208
209 Aborting lock does not prevent fncache writes
209 Aborting lock does not prevent fncache writes
210
210
211 $ cat > exceptionext.py <<EOF
211 $ cat > exceptionext.py <<EOF
212 > from __future__ import absolute_import
212 > from __future__ import absolute_import
213 > import os
213 > import os
214 > from mercurial import commands, error, extensions
214 > from mercurial import commands, error, extensions
215 >
215 >
216 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
216 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
217 > def releasewrap():
217 > def releasewrap():
218 > l.held = False # ensure __del__ is a noop
218 > l.held = False # ensure __del__ is a noop
219 > raise error.Abort("forced lock failure")
219 > raise error.Abort("forced lock failure")
220 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
220 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
221 > return l
221 > return l
222 >
222 >
223 > def reposetup(ui, repo):
223 > def reposetup(ui, repo):
224 > extensions.wrapfunction(repo, '_lock', lockexception)
224 > extensions.wrapfunction(repo, '_lock', lockexception)
225 >
225 >
226 > cmdtable = {}
226 > cmdtable = {}
227 >
227 >
228 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
228 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
229 > # at the end of dispatching (for intentional "forced lcok failure")
229 > # at the end of dispatching (for intentional "forced lcok failure")
230 > def commitwrap(orig, ui, repo, *pats, **opts):
230 > def commitwrap(orig, ui, repo, *pats, **opts):
231 > repo = repo.unfiltered() # to use replaced repo._lock certainly
231 > repo = repo.unfiltered() # to use replaced repo._lock certainly
232 > wlock = repo.wlock()
232 > wlock = repo.wlock()
233 > try:
233 > try:
234 > return orig(ui, repo, *pats, **opts)
234 > return orig(ui, repo, *pats, **opts)
235 > finally:
235 > finally:
236 > # multiple 'relase()' is needed for complete releasing wlock,
236 > # multiple 'relase()' is needed for complete releasing wlock,
237 > # because "forced" abort at last releasing store lock
237 > # because "forced" abort at last releasing store lock
238 > # prevents wlock from being released at same 'lockmod.release()'
238 > # prevents wlock from being released at same 'lockmod.release()'
239 > for i in range(wlock.held):
239 > for i in range(wlock.held):
240 > wlock.release()
240 > wlock.release()
241 >
241 >
242 > def extsetup(ui):
242 > def extsetup(ui):
243 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
243 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
244 > EOF
244 > EOF
245 $ extpath=`pwd`/exceptionext.py
245 $ extpath=`pwd`/exceptionext.py
246 $ hg init fncachetxn
246 $ hg init fncachetxn
247 $ cd fncachetxn
247 $ cd fncachetxn
248 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
248 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
249 $ touch y
249 $ touch y
250 $ hg ci -qAm y
250 $ hg ci -qAm y
251 abort: forced lock failure
251 abort: forced lock failure
252 [255]
252 [255]
253 $ cat .hg/store/fncache
253 $ cat .hg/store/fncache
254 data/y.i
254 data/y.i
255
255
256 Aborting transaction prevents fncache change
256 Aborting transaction prevents fncache change
257
257
258 $ cat > ../exceptionext.py <<EOF
258 $ cat > ../exceptionext.py <<EOF
259 > from __future__ import absolute_import
259 > from __future__ import absolute_import
260 > import os
260 > import os
261 > from mercurial import commands, error, extensions, localrepo
261 > from mercurial import commands, error, extensions, localrepo
262 >
262 >
263 > def wrapper(orig, self, *args, **kwargs):
263 > def wrapper(orig, self, *args, **kwargs):
264 > tr = orig(self, *args, **kwargs)
264 > tr = orig(self, *args, **kwargs)
265 > def fail(tr):
265 > def fail(tr):
266 > raise error.Abort(b"forced transaction failure")
266 > raise error.Abort(b"forced transaction failure")
267 > # zzz prefix to ensure it sorted after store.write
267 > # zzz prefix to ensure it sorted after store.write
268 > tr.addfinalize(b'zzz-forcefails', fail)
268 > tr.addfinalize(b'zzz-forcefails', fail)
269 > return tr
269 > return tr
270 >
270 >
271 > def uisetup(ui):
271 > def uisetup(ui):
272 > extensions.wrapfunction(
272 > extensions.wrapfunction(
273 > localrepo.localrepository, b'transaction', wrapper)
273 > localrepo.localrepository, b'transaction', wrapper)
274 >
274 >
275 > cmdtable = {}
275 > cmdtable = {}
276 >
276 >
277 > EOF
277 > EOF
278
278
279 Clean cached version
279 Clean cached version
280 $ rm -f "${extpath}c"
280 $ rm -f "${extpath}c"
281 $ rm -Rf "`dirname $extpath`/__pycache__"
281 $ rm -Rf "`dirname $extpath`/__pycache__"
282
282
283 $ touch z
283 $ touch z
284 $ hg ci -qAm z
284 $ hg ci -qAm z
285 transaction abort!
285 transaction abort!
286 rollback completed
286 rollback completed
287 abort: forced transaction failure
287 abort: forced transaction failure
288 [255]
288 [255]
289 $ cat .hg/store/fncache
289 $ cat .hg/store/fncache
290 data/y.i
290 data/y.i
291
291
292 Aborted transactions can be recovered later
292 Aborted transactions can be recovered later
293
293
294 $ cat > ../exceptionext.py <<EOF
294 $ cat > ../exceptionext.py <<EOF
295 > from __future__ import absolute_import
295 > from __future__ import absolute_import
296 > import os
296 > import os
297 > from mercurial import (
297 > from mercurial import (
298 > commands,
298 > commands,
299 > error,
299 > error,
300 > extensions,
300 > extensions,
301 > localrepo,
301 > localrepo,
302 > transaction,
302 > transaction,
303 > )
303 > )
304 >
304 >
305 > def trwrapper(orig, self, *args, **kwargs):
305 > def trwrapper(orig, self, *args, **kwargs):
306 > tr = orig(self, *args, **kwargs)
306 > tr = orig(self, *args, **kwargs)
307 > def fail(tr):
307 > def fail(tr):
308 > raise error.Abort("forced transaction failure")
308 > raise error.Abort("forced transaction failure")
309 > # zzz prefix to ensure it sorted after store.write
309 > # zzz prefix to ensure it sorted after store.write
310 > tr.addfinalize('zzz-forcefails', fail)
310 > tr.addfinalize('zzz-forcefails', fail)
311 > return tr
311 > return tr
312 >
312 >
313 > def abortwrapper(orig, self, *args, **kwargs):
313 > def abortwrapper(orig, self, *args, **kwargs):
314 > raise error.Abort("forced transaction failure")
314 > raise error.Abort("forced transaction failure")
315 >
315 >
316 > def uisetup(ui):
316 > def uisetup(ui):
317 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
317 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
318 > trwrapper)
318 > trwrapper)
319 > extensions.wrapfunction(transaction.transaction, '_abort',
319 > extensions.wrapfunction(transaction.transaction, '_abort',
320 > abortwrapper)
320 > abortwrapper)
321 >
321 >
322 > cmdtable = {}
322 > cmdtable = {}
323 >
323 >
324 > EOF
324 > EOF
325
325
326 Clean cached versions
326 Clean cached versions
327 $ rm -f "${extpath}c"
327 $ rm -f "${extpath}c"
328 $ rm -Rf "`dirname $extpath`/__pycache__"
328 $ rm -Rf "`dirname $extpath`/__pycache__"
329
329
330 $ hg up -q 1
330 $ hg up -q 1
331 $ touch z
331 $ touch z
332 $ hg ci -qAm z 2>/dev/null
332 $ hg ci -qAm z 2>/dev/null
333 [255]
333 [255]
334 $ cat .hg/store/fncache | sort
334 $ cat .hg/store/fncache | sort
335 data/y.i
335 data/y.i
336 data/z.i
336 data/z.i
337 $ hg recover
337 $ hg recover
338 rolling back interrupted transaction
338 rolling back interrupted transaction
339 checking changesets
339 checking changesets
340 checking manifests
340 checking manifests
341 crosschecking files in changesets and manifests
341 crosschecking files in changesets and manifests
342 checking files
342 checking files
343 1 files, 1 changesets, 1 total revisions
343 checked 1 changesets with 1 changes to 1 files
344 $ cat .hg/store/fncache
344 $ cat .hg/store/fncache
345 data/y.i
345 data/y.i
346
346
347 $ cd ..
347 $ cd ..
348
348
349 debugrebuildfncache does nothing unless repo has fncache requirement
349 debugrebuildfncache does nothing unless repo has fncache requirement
350
350
351 $ hg --config format.usefncache=false init nofncache
351 $ hg --config format.usefncache=false init nofncache
352 $ cd nofncache
352 $ cd nofncache
353 $ hg debugrebuildfncache
353 $ hg debugrebuildfncache
354 (not rebuilding fncache because repository does not support fncache)
354 (not rebuilding fncache because repository does not support fncache)
355
355
356 $ cd ..
356 $ cd ..
357
357
358 debugrebuildfncache works on empty repository
358 debugrebuildfncache works on empty repository
359
359
360 $ hg init empty
360 $ hg init empty
361 $ cd empty
361 $ cd empty
362 $ hg debugrebuildfncache
362 $ hg debugrebuildfncache
363 fncache already up to date
363 fncache already up to date
364 $ cd ..
364 $ cd ..
365
365
366 debugrebuildfncache on an up to date repository no-ops
366 debugrebuildfncache on an up to date repository no-ops
367
367
368 $ hg init repo
368 $ hg init repo
369 $ cd repo
369 $ cd repo
370 $ echo initial > foo
370 $ echo initial > foo
371 $ echo initial > .bar
371 $ echo initial > .bar
372 $ hg commit -A -m initial
372 $ hg commit -A -m initial
373 adding .bar
373 adding .bar
374 adding foo
374 adding foo
375
375
376 $ cat .hg/store/fncache | sort
376 $ cat .hg/store/fncache | sort
377 data/.bar.i
377 data/.bar.i
378 data/foo.i
378 data/foo.i
379
379
380 $ hg debugrebuildfncache
380 $ hg debugrebuildfncache
381 fncache already up to date
381 fncache already up to date
382
382
383 debugrebuildfncache restores deleted fncache file
383 debugrebuildfncache restores deleted fncache file
384
384
385 $ rm -f .hg/store/fncache
385 $ rm -f .hg/store/fncache
386 $ hg debugrebuildfncache
386 $ hg debugrebuildfncache
387 adding data/.bar.i
387 adding data/.bar.i
388 adding data/foo.i
388 adding data/foo.i
389 2 items added, 0 removed from fncache
389 2 items added, 0 removed from fncache
390
390
391 $ cat .hg/store/fncache | sort
391 $ cat .hg/store/fncache | sort
392 data/.bar.i
392 data/.bar.i
393 data/foo.i
393 data/foo.i
394
394
395 Rebuild after rebuild should no-op
395 Rebuild after rebuild should no-op
396
396
397 $ hg debugrebuildfncache
397 $ hg debugrebuildfncache
398 fncache already up to date
398 fncache already up to date
399
399
400 A single missing file should get restored, an extra file should be removed
400 A single missing file should get restored, an extra file should be removed
401
401
402 $ cat > .hg/store/fncache << EOF
402 $ cat > .hg/store/fncache << EOF
403 > data/foo.i
403 > data/foo.i
404 > data/bad-entry.i
404 > data/bad-entry.i
405 > EOF
405 > EOF
406
406
407 $ hg debugrebuildfncache
407 $ hg debugrebuildfncache
408 removing data/bad-entry.i
408 removing data/bad-entry.i
409 adding data/.bar.i
409 adding data/.bar.i
410 1 items added, 1 removed from fncache
410 1 items added, 1 removed from fncache
411
411
412 $ cat .hg/store/fncache | sort
412 $ cat .hg/store/fncache | sort
413 data/.bar.i
413 data/.bar.i
414 data/foo.i
414 data/foo.i
415
415
416 $ cd ..
416 $ cd ..
417
417
418 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
418 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
419
419
420 $ hg --config format.dotencode=false init nodotencode
420 $ hg --config format.dotencode=false init nodotencode
421 $ cd nodotencode
421 $ cd nodotencode
422 $ echo initial > foo
422 $ echo initial > foo
423 $ echo initial > .bar
423 $ echo initial > .bar
424 $ hg commit -A -m initial
424 $ hg commit -A -m initial
425 adding .bar
425 adding .bar
426 adding foo
426 adding foo
427
427
428 $ cat .hg/store/fncache | sort
428 $ cat .hg/store/fncache | sort
429 data/.bar.i
429 data/.bar.i
430 data/foo.i
430 data/foo.i
431
431
432 $ rm .hg/store/fncache
432 $ rm .hg/store/fncache
433 $ hg debugrebuildfncache
433 $ hg debugrebuildfncache
434 adding data/.bar.i
434 adding data/.bar.i
435 adding data/foo.i
435 adding data/foo.i
436 2 items added, 0 removed from fncache
436 2 items added, 0 removed from fncache
437
437
438 $ cat .hg/store/fncache | sort
438 $ cat .hg/store/fncache | sort
439 data/.bar.i
439 data/.bar.i
440 data/foo.i
440 data/foo.i
441
441
442 $ cd ..
442 $ cd ..
443
443
444 In repositories that have accumulated a large number of files over time, the
444 In repositories that have accumulated a large number of files over time, the
445 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
445 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
446 The cache should not loaded when committing changes to existing files, or when unbundling
446 The cache should not loaded when committing changes to existing files, or when unbundling
447 changesets that only contain changes to existing files:
447 changesets that only contain changes to existing files:
448
448
449 $ cat > fncacheloadwarn.py << EOF
449 $ cat > fncacheloadwarn.py << EOF
450 > from __future__ import absolute_import
450 > from __future__ import absolute_import
451 > from mercurial import extensions, store
451 > from mercurial import extensions, store
452 >
452 >
453 > def extsetup(ui):
453 > def extsetup(ui):
454 > def wrapstore(orig, requirements, *args):
454 > def wrapstore(orig, requirements, *args):
455 > store = orig(requirements, *args)
455 > store = orig(requirements, *args)
456 > if 'store' in requirements and 'fncache' in requirements:
456 > if 'store' in requirements and 'fncache' in requirements:
457 > instrumentfncachestore(store, ui)
457 > instrumentfncachestore(store, ui)
458 > return store
458 > return store
459 > extensions.wrapfunction(store, 'store', wrapstore)
459 > extensions.wrapfunction(store, 'store', wrapstore)
460 >
460 >
461 > def instrumentfncachestore(fncachestore, ui):
461 > def instrumentfncachestore(fncachestore, ui):
462 > class instrumentedfncache(type(fncachestore.fncache)):
462 > class instrumentedfncache(type(fncachestore.fncache)):
463 > def _load(self):
463 > def _load(self):
464 > ui.warn('fncache load triggered!\n')
464 > ui.warn('fncache load triggered!\n')
465 > super(instrumentedfncache, self)._load()
465 > super(instrumentedfncache, self)._load()
466 > fncachestore.fncache.__class__ = instrumentedfncache
466 > fncachestore.fncache.__class__ = instrumentedfncache
467 > EOF
467 > EOF
468
468
469 $ fncachextpath=`pwd`/fncacheloadwarn.py
469 $ fncachextpath=`pwd`/fncacheloadwarn.py
470 $ hg init nofncacheload
470 $ hg init nofncacheload
471 $ cd nofncacheload
471 $ cd nofncacheload
472 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
472 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
473
473
474 A new file should trigger a load, as we'd want to update the fncache set in that case:
474 A new file should trigger a load, as we'd want to update the fncache set in that case:
475
475
476 $ touch foo
476 $ touch foo
477 $ hg ci -qAm foo
477 $ hg ci -qAm foo
478 fncache load triggered!
478 fncache load triggered!
479
479
480 But modifying that file should not:
480 But modifying that file should not:
481
481
482 $ echo bar >> foo
482 $ echo bar >> foo
483 $ hg ci -qm foo
483 $ hg ci -qm foo
484
484
485 If a transaction has been aborted, the zero-size truncated index file will
485 If a transaction has been aborted, the zero-size truncated index file will
486 not prevent the fncache from being loaded; rather than actually abort
486 not prevent the fncache from being loaded; rather than actually abort
487 a transaction, we simulate the situation by creating a zero-size index file:
487 a transaction, we simulate the situation by creating a zero-size index file:
488
488
489 $ touch .hg/store/data/bar.i
489 $ touch .hg/store/data/bar.i
490 $ touch bar
490 $ touch bar
491 $ hg ci -qAm bar
491 $ hg ci -qAm bar
492 fncache load triggered!
492 fncache load triggered!
493
493
494 Unbundling should follow the same rules; existing files should not cause a load:
494 Unbundling should follow the same rules; existing files should not cause a load:
495
495
496 $ hg clone -q . tobundle
496 $ hg clone -q . tobundle
497 $ echo 'new line' > tobundle/bar
497 $ echo 'new line' > tobundle/bar
498 $ hg -R tobundle ci -qm bar
498 $ hg -R tobundle ci -qm bar
499 $ hg -R tobundle bundle -q barupdated.hg
499 $ hg -R tobundle bundle -q barupdated.hg
500 $ hg unbundle -q barupdated.hg
500 $ hg unbundle -q barupdated.hg
501
501
502 but adding new files should:
502 but adding new files should:
503
503
504 $ touch tobundle/newfile
504 $ touch tobundle/newfile
505 $ hg -R tobundle ci -qAm newfile
505 $ hg -R tobundle ci -qAm newfile
506 $ hg -R tobundle bundle -q newfile.hg
506 $ hg -R tobundle bundle -q newfile.hg
507 $ hg unbundle -q newfile.hg
507 $ hg unbundle -q newfile.hg
508 fncache load triggered!
508 fncache load triggered!
509
509
510 $ cd ..
510 $ cd ..
@@ -1,431 +1,431 b''
1 #require hardlink reporevlogstore
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > from __future__ import print_function
4 > from __future__ import print_function
5 > import sys
5 > import sys
6 > from mercurial import util
6 > from mercurial import util
7 > for f in sorted(sys.stdin.readlines()):
7 > for f in sorted(sys.stdin.readlines()):
8 > f = f[:-1]
8 > f = f[:-1]
9 > print(util.nlinks(f), f)
9 > print(util.nlinks(f), f)
10 > EOF
10 > EOF
11
11
12 $ nlinksdir()
12 $ nlinksdir()
13 > {
13 > {
14 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
14 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
15 > }
15 > }
16
16
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
18
18
19 $ cat > linkcp.py <<EOF
19 $ cat > linkcp.py <<EOF
20 > from __future__ import absolute_import
20 > from __future__ import absolute_import
21 > import sys
21 > import sys
22 > from mercurial import util
22 > from mercurial import util
23 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
23 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
24 > EOF
24 > EOF
25
25
26 $ linkcp()
26 $ linkcp()
27 > {
27 > {
28 > $PYTHON $TESTTMP/linkcp.py $1 $2
28 > $PYTHON $TESTTMP/linkcp.py $1 $2
29 > }
29 > }
30
30
31 Prepare repo r1:
31 Prepare repo r1:
32
32
33 $ hg init r1
33 $ hg init r1
34 $ cd r1
34 $ cd r1
35
35
36 $ echo c1 > f1
36 $ echo c1 > f1
37 $ hg add f1
37 $ hg add f1
38 $ hg ci -m0
38 $ hg ci -m0
39
39
40 $ mkdir d1
40 $ mkdir d1
41 $ cd d1
41 $ cd d1
42 $ echo c2 > f2
42 $ echo c2 > f2
43 $ hg add f2
43 $ hg add f2
44 $ hg ci -m1
44 $ hg ci -m1
45 $ cd ../..
45 $ cd ../..
46
46
47 $ nlinksdir r1/.hg/store
47 $ nlinksdir r1/.hg/store
48 1 r1/.hg/store/00changelog.i
48 1 r1/.hg/store/00changelog.i
49 1 r1/.hg/store/00manifest.i
49 1 r1/.hg/store/00manifest.i
50 1 r1/.hg/store/data/d1/f2.i
50 1 r1/.hg/store/data/d1/f2.i
51 1 r1/.hg/store/data/f1.i
51 1 r1/.hg/store/data/f1.i
52 1 r1/.hg/store/fncache (repofncache !)
52 1 r1/.hg/store/fncache (repofncache !)
53 1 r1/.hg/store/phaseroots
53 1 r1/.hg/store/phaseroots
54 1 r1/.hg/store/undo
54 1 r1/.hg/store/undo
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
56 1 r1/.hg/store/undo.backupfiles
56 1 r1/.hg/store/undo.backupfiles
57 1 r1/.hg/store/undo.phaseroots
57 1 r1/.hg/store/undo.phaseroots
58
58
59
59
60 Create hardlinked clone r2:
60 Create hardlinked clone r2:
61
61
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
63 linking: 1
63 linking: 1
64 linking: 2
64 linking: 2
65 linking: 3
65 linking: 3
66 linking: 4
66 linking: 4
67 linking: 5
67 linking: 5
68 linking: 6
68 linking: 6
69 linking: 7
69 linking: 7
70 linked 7 files
70 linked 7 files
71
71
72 Create non-hardlinked clone r3:
72 Create non-hardlinked clone r3:
73
73
74 $ hg clone --pull r1 r3
74 $ hg clone --pull r1 r3
75 requesting all changes
75 requesting all changes
76 adding changesets
76 adding changesets
77 adding manifests
77 adding manifests
78 adding file changes
78 adding file changes
79 added 2 changesets with 2 changes to 2 files
79 added 2 changesets with 2 changes to 2 files
80 new changesets 40d85e9847f2:7069c422939c
80 new changesets 40d85e9847f2:7069c422939c
81 updating to branch default
81 updating to branch default
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83
83
84
84
85 Repos r1 and r2 should now contain hardlinked files:
85 Repos r1 and r2 should now contain hardlinked files:
86
86
87 $ nlinksdir r1/.hg/store
87 $ nlinksdir r1/.hg/store
88 2 r1/.hg/store/00changelog.i
88 2 r1/.hg/store/00changelog.i
89 2 r1/.hg/store/00manifest.i
89 2 r1/.hg/store/00manifest.i
90 2 r1/.hg/store/data/d1/f2.i
90 2 r1/.hg/store/data/d1/f2.i
91 2 r1/.hg/store/data/f1.i
91 2 r1/.hg/store/data/f1.i
92 2 r1/.hg/store/fncache (repofncache !)
92 2 r1/.hg/store/fncache (repofncache !)
93 1 r1/.hg/store/phaseroots
93 1 r1/.hg/store/phaseroots
94 1 r1/.hg/store/undo
94 1 r1/.hg/store/undo
95 1 r1/.hg/store/undo.backup.fncache (repofncache !)
95 1 r1/.hg/store/undo.backup.fncache (repofncache !)
96 1 r1/.hg/store/undo.backupfiles
96 1 r1/.hg/store/undo.backupfiles
97 1 r1/.hg/store/undo.phaseroots
97 1 r1/.hg/store/undo.phaseroots
98
98
99 $ nlinksdir r2/.hg/store
99 $ nlinksdir r2/.hg/store
100 2 r2/.hg/store/00changelog.i
100 2 r2/.hg/store/00changelog.i
101 2 r2/.hg/store/00manifest.i
101 2 r2/.hg/store/00manifest.i
102 2 r2/.hg/store/data/d1/f2.i
102 2 r2/.hg/store/data/d1/f2.i
103 2 r2/.hg/store/data/f1.i
103 2 r2/.hg/store/data/f1.i
104 2 r2/.hg/store/fncache (repofncache !)
104 2 r2/.hg/store/fncache (repofncache !)
105
105
106 Repo r3 should not be hardlinked:
106 Repo r3 should not be hardlinked:
107
107
108 $ nlinksdir r3/.hg/store
108 $ nlinksdir r3/.hg/store
109 1 r3/.hg/store/00changelog.i
109 1 r3/.hg/store/00changelog.i
110 1 r3/.hg/store/00manifest.i
110 1 r3/.hg/store/00manifest.i
111 1 r3/.hg/store/data/d1/f2.i
111 1 r3/.hg/store/data/d1/f2.i
112 1 r3/.hg/store/data/f1.i
112 1 r3/.hg/store/data/f1.i
113 1 r3/.hg/store/fncache (repofncache !)
113 1 r3/.hg/store/fncache (repofncache !)
114 1 r3/.hg/store/phaseroots
114 1 r3/.hg/store/phaseroots
115 1 r3/.hg/store/undo
115 1 r3/.hg/store/undo
116 1 r3/.hg/store/undo.backupfiles
116 1 r3/.hg/store/undo.backupfiles
117 1 r3/.hg/store/undo.phaseroots
117 1 r3/.hg/store/undo.phaseroots
118
118
119
119
120 Create a non-inlined filelog in r3:
120 Create a non-inlined filelog in r3:
121
121
122 $ cd r3/d1
122 $ cd r3/d1
123 >>> f = open('data1', 'wb')
123 >>> f = open('data1', 'wb')
124 >>> for x in range(10000):
124 >>> for x in range(10000):
125 ... f.write(b"%d\n" % x) and None
125 ... f.write(b"%d\n" % x) and None
126 >>> f.close()
126 >>> f.close()
127 $ for j in 0 1 2 3 4 5 6 7 8 9; do
127 $ for j in 0 1 2 3 4 5 6 7 8 9; do
128 > cat data1 >> f2
128 > cat data1 >> f2
129 > hg commit -m$j
129 > hg commit -m$j
130 > done
130 > done
131 $ cd ../..
131 $ cd ../..
132
132
133 $ nlinksdir r3/.hg/store
133 $ nlinksdir r3/.hg/store
134 1 r3/.hg/store/00changelog.i
134 1 r3/.hg/store/00changelog.i
135 1 r3/.hg/store/00manifest.i
135 1 r3/.hg/store/00manifest.i
136 1 r3/.hg/store/data/d1/f2.d
136 1 r3/.hg/store/data/d1/f2.d
137 1 r3/.hg/store/data/d1/f2.i
137 1 r3/.hg/store/data/d1/f2.i
138 1 r3/.hg/store/data/f1.i
138 1 r3/.hg/store/data/f1.i
139 1 r3/.hg/store/fncache (repofncache !)
139 1 r3/.hg/store/fncache (repofncache !)
140 1 r3/.hg/store/phaseroots
140 1 r3/.hg/store/phaseroots
141 1 r3/.hg/store/undo
141 1 r3/.hg/store/undo
142 1 r3/.hg/store/undo.backup.fncache (repofncache !)
142 1 r3/.hg/store/undo.backup.fncache (repofncache !)
143 1 r3/.hg/store/undo.backup.phaseroots
143 1 r3/.hg/store/undo.backup.phaseroots
144 1 r3/.hg/store/undo.backupfiles
144 1 r3/.hg/store/undo.backupfiles
145 1 r3/.hg/store/undo.phaseroots
145 1 r3/.hg/store/undo.phaseroots
146
146
147 Push to repo r1 should break up most hardlinks in r2:
147 Push to repo r1 should break up most hardlinks in r2:
148
148
149 $ hg -R r2 verify
149 $ hg -R r2 verify
150 checking changesets
150 checking changesets
151 checking manifests
151 checking manifests
152 crosschecking files in changesets and manifests
152 crosschecking files in changesets and manifests
153 checking files
153 checking files
154 2 files, 2 changesets, 2 total revisions
154 checked 2 changesets with 2 changes to 2 files
155
155
156 $ cd r3
156 $ cd r3
157 $ hg push
157 $ hg push
158 pushing to $TESTTMP/r1
158 pushing to $TESTTMP/r1
159 searching for changes
159 searching for changes
160 adding changesets
160 adding changesets
161 adding manifests
161 adding manifests
162 adding file changes
162 adding file changes
163 added 10 changesets with 10 changes to 1 files
163 added 10 changesets with 10 changes to 1 files
164
164
165 $ cd ..
165 $ cd ..
166
166
167 $ nlinksdir r2/.hg/store
167 $ nlinksdir r2/.hg/store
168 1 r2/.hg/store/00changelog.i
168 1 r2/.hg/store/00changelog.i
169 1 r2/.hg/store/00manifest.i
169 1 r2/.hg/store/00manifest.i
170 1 r2/.hg/store/data/d1/f2.i
170 1 r2/.hg/store/data/d1/f2.i
171 2 r2/.hg/store/data/f1.i
171 2 r2/.hg/store/data/f1.i
172 [12] r2/\.hg/store/fncache (re) (repofncache !)
172 [12] r2/\.hg/store/fncache (re) (repofncache !)
173
173
174 #if hardlink-whitelisted repofncache
174 #if hardlink-whitelisted repofncache
175 $ nlinksdir r2/.hg/store/fncache
175 $ nlinksdir r2/.hg/store/fncache
176 2 r2/.hg/store/fncache
176 2 r2/.hg/store/fncache
177 #endif
177 #endif
178
178
179 $ hg -R r2 verify
179 $ hg -R r2 verify
180 checking changesets
180 checking changesets
181 checking manifests
181 checking manifests
182 crosschecking files in changesets and manifests
182 crosschecking files in changesets and manifests
183 checking files
183 checking files
184 2 files, 2 changesets, 2 total revisions
184 checked 2 changesets with 2 changes to 2 files
185
185
186
186
187 $ cd r1
187 $ cd r1
188 $ hg up
188 $ hg up
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
190
190
191 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
191 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
192
192
193 $ echo c1c1 >> f1
193 $ echo c1c1 >> f1
194 $ hg ci -m00
194 $ hg ci -m00
195 $ cd ..
195 $ cd ..
196
196
197 $ nlinksdir r2/.hg/store
197 $ nlinksdir r2/.hg/store
198 1 r2/.hg/store/00changelog.i
198 1 r2/.hg/store/00changelog.i
199 1 r2/.hg/store/00manifest.i
199 1 r2/.hg/store/00manifest.i
200 1 r2/.hg/store/data/d1/f2.i
200 1 r2/.hg/store/data/d1/f2.i
201 1 r2/.hg/store/data/f1.i
201 1 r2/.hg/store/data/f1.i
202 [12] r2/\.hg/store/fncache (re) (repofncache !)
202 [12] r2/\.hg/store/fncache (re) (repofncache !)
203
203
204 #if hardlink-whitelisted repofncache
204 #if hardlink-whitelisted repofncache
205 $ nlinksdir r2/.hg/store/fncache
205 $ nlinksdir r2/.hg/store/fncache
206 2 r2/.hg/store/fncache
206 2 r2/.hg/store/fncache
207 #endif
207 #endif
208
208
209 Create a file which exec permissions we will change
209 Create a file which exec permissions we will change
210 $ cd r3
210 $ cd r3
211 $ echo "echo hello world" > f3
211 $ echo "echo hello world" > f3
212 $ hg add f3
212 $ hg add f3
213 $ hg ci -mf3
213 $ hg ci -mf3
214 $ cd ..
214 $ cd ..
215
215
216 $ cd r3
216 $ cd r3
217 $ hg tip --template '{rev}:{node|short}\n'
217 $ hg tip --template '{rev}:{node|short}\n'
218 12:d3b77733a28a
218 12:d3b77733a28a
219 $ echo bla > f1
219 $ echo bla > f1
220 $ chmod +x f3
220 $ chmod +x f3
221 $ hg ci -m1
221 $ hg ci -m1
222 $ cd ..
222 $ cd ..
223
223
224 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
224 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
225
225
226 $ linkcp r3 r4
226 $ linkcp r3 r4
227
227
228 'checklink' is produced by hardlinking a symlink, which is undefined whether
228 'checklink' is produced by hardlinking a symlink, which is undefined whether
229 the symlink should be followed or not. It does behave differently on Linux and
229 the symlink should be followed or not. It does behave differently on Linux and
230 BSD. Just remove it so the test pass on both platforms.
230 BSD. Just remove it so the test pass on both platforms.
231
231
232 $ rm -f r4/.hg/cache/checklink
232 $ rm -f r4/.hg/cache/checklink
233
233
234 r4 has hardlinks in the working dir (not just inside .hg):
234 r4 has hardlinks in the working dir (not just inside .hg):
235
235
236 $ nlinksdir r4
236 $ nlinksdir r4
237 2 r4/.hg/00changelog.i
237 2 r4/.hg/00changelog.i
238 2 r4/.hg/branch
238 2 r4/.hg/branch
239 2 r4/.hg/cache/branch2-base
239 2 r4/.hg/cache/branch2-base
240 2 r4/.hg/cache/branch2-served
240 2 r4/.hg/cache/branch2-served
241 2 r4/.hg/cache/checkisexec (execbit !)
241 2 r4/.hg/cache/checkisexec (execbit !)
242 ? r4/.hg/cache/checklink-target (glob) (symlink !)
242 ? r4/.hg/cache/checklink-target (glob) (symlink !)
243 2 r4/.hg/cache/checknoexec (execbit !)
243 2 r4/.hg/cache/checknoexec (execbit !)
244 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
244 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
245 2 r4/.hg/cache/rbc-names-v1
245 2 r4/.hg/cache/rbc-names-v1
246 2 r4/.hg/cache/rbc-revs-v1
246 2 r4/.hg/cache/rbc-revs-v1
247 2 r4/.hg/dirstate
247 2 r4/.hg/dirstate
248 2 r4/.hg/fsmonitor.state (fsmonitor !)
248 2 r4/.hg/fsmonitor.state (fsmonitor !)
249 2 r4/.hg/hgrc
249 2 r4/.hg/hgrc
250 2 r4/.hg/last-message.txt
250 2 r4/.hg/last-message.txt
251 2 r4/.hg/requires
251 2 r4/.hg/requires
252 2 r4/.hg/store/00changelog.i
252 2 r4/.hg/store/00changelog.i
253 2 r4/.hg/store/00manifest.i
253 2 r4/.hg/store/00manifest.i
254 2 r4/.hg/store/data/d1/f2.d
254 2 r4/.hg/store/data/d1/f2.d
255 2 r4/.hg/store/data/d1/f2.i
255 2 r4/.hg/store/data/d1/f2.i
256 2 r4/.hg/store/data/f1.i
256 2 r4/.hg/store/data/f1.i
257 2 r4/.hg/store/data/f3.i
257 2 r4/.hg/store/data/f3.i
258 2 r4/.hg/store/fncache (repofncache !)
258 2 r4/.hg/store/fncache (repofncache !)
259 2 r4/.hg/store/phaseroots
259 2 r4/.hg/store/phaseroots
260 2 r4/.hg/store/undo
260 2 r4/.hg/store/undo
261 2 r4/.hg/store/undo.backup.fncache (repofncache !)
261 2 r4/.hg/store/undo.backup.fncache (repofncache !)
262 2 r4/.hg/store/undo.backup.phaseroots
262 2 r4/.hg/store/undo.backup.phaseroots
263 2 r4/.hg/store/undo.backupfiles
263 2 r4/.hg/store/undo.backupfiles
264 2 r4/.hg/store/undo.phaseroots
264 2 r4/.hg/store/undo.phaseroots
265 [24] r4/\.hg/undo\.backup\.dirstate (re)
265 [24] r4/\.hg/undo\.backup\.dirstate (re)
266 2 r4/.hg/undo.bookmarks
266 2 r4/.hg/undo.bookmarks
267 2 r4/.hg/undo.branch
267 2 r4/.hg/undo.branch
268 2 r4/.hg/undo.desc
268 2 r4/.hg/undo.desc
269 [24] r4/\.hg/undo\.dirstate (re)
269 [24] r4/\.hg/undo\.dirstate (re)
270 2 r4/d1/data1
270 2 r4/d1/data1
271 2 r4/d1/f2
271 2 r4/d1/f2
272 2 r4/f1
272 2 r4/f1
273 2 r4/f3
273 2 r4/f3
274
274
275 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
275 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
276 #if hardlink-whitelisted
276 #if hardlink-whitelisted
277 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
277 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
278 4 r4/.hg/undo.backup.dirstate
278 4 r4/.hg/undo.backup.dirstate
279 4 r4/.hg/undo.dirstate
279 4 r4/.hg/undo.dirstate
280 #endif
280 #endif
281
281
282
282
283 $ hg -R r4 up 12
283 $ hg -R r4 up 12
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
285 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
285 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
286
286
287 $ nlinksdir r4
287 $ nlinksdir r4
288 2 r4/.hg/00changelog.i
288 2 r4/.hg/00changelog.i
289 1 r4/.hg/branch
289 1 r4/.hg/branch
290 2 r4/.hg/cache/branch2-base
290 2 r4/.hg/cache/branch2-base
291 2 r4/.hg/cache/branch2-served
291 2 r4/.hg/cache/branch2-served
292 2 r4/.hg/cache/checkisexec (execbit !)
292 2 r4/.hg/cache/checkisexec (execbit !)
293 2 r4/.hg/cache/checklink-target (symlink !)
293 2 r4/.hg/cache/checklink-target (symlink !)
294 2 r4/.hg/cache/checknoexec (execbit !)
294 2 r4/.hg/cache/checknoexec (execbit !)
295 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
295 2 r4/.hg/cache/manifestfulltextcache (reporevlogstore !)
296 2 r4/.hg/cache/rbc-names-v1
296 2 r4/.hg/cache/rbc-names-v1
297 2 r4/.hg/cache/rbc-revs-v1
297 2 r4/.hg/cache/rbc-revs-v1
298 1 r4/.hg/dirstate
298 1 r4/.hg/dirstate
299 1 r4/.hg/fsmonitor.state (fsmonitor !)
299 1 r4/.hg/fsmonitor.state (fsmonitor !)
300 2 r4/.hg/hgrc
300 2 r4/.hg/hgrc
301 2 r4/.hg/last-message.txt
301 2 r4/.hg/last-message.txt
302 2 r4/.hg/requires
302 2 r4/.hg/requires
303 2 r4/.hg/store/00changelog.i
303 2 r4/.hg/store/00changelog.i
304 2 r4/.hg/store/00manifest.i
304 2 r4/.hg/store/00manifest.i
305 2 r4/.hg/store/data/d1/f2.d
305 2 r4/.hg/store/data/d1/f2.d
306 2 r4/.hg/store/data/d1/f2.i
306 2 r4/.hg/store/data/d1/f2.i
307 2 r4/.hg/store/data/f1.i
307 2 r4/.hg/store/data/f1.i
308 2 r4/.hg/store/data/f3.i
308 2 r4/.hg/store/data/f3.i
309 2 r4/.hg/store/fncache
309 2 r4/.hg/store/fncache
310 2 r4/.hg/store/phaseroots
310 2 r4/.hg/store/phaseroots
311 2 r4/.hg/store/undo
311 2 r4/.hg/store/undo
312 2 r4/.hg/store/undo.backup.fncache (repofncache !)
312 2 r4/.hg/store/undo.backup.fncache (repofncache !)
313 2 r4/.hg/store/undo.backup.phaseroots
313 2 r4/.hg/store/undo.backup.phaseroots
314 2 r4/.hg/store/undo.backupfiles
314 2 r4/.hg/store/undo.backupfiles
315 2 r4/.hg/store/undo.phaseroots
315 2 r4/.hg/store/undo.phaseroots
316 [24] r4/\.hg/undo\.backup\.dirstate (re)
316 [24] r4/\.hg/undo\.backup\.dirstate (re)
317 2 r4/.hg/undo.bookmarks
317 2 r4/.hg/undo.bookmarks
318 2 r4/.hg/undo.branch
318 2 r4/.hg/undo.branch
319 2 r4/.hg/undo.desc
319 2 r4/.hg/undo.desc
320 [24] r4/\.hg/undo\.dirstate (re)
320 [24] r4/\.hg/undo\.dirstate (re)
321 2 r4/d1/data1
321 2 r4/d1/data1
322 2 r4/d1/f2
322 2 r4/d1/f2
323 1 r4/f1
323 1 r4/f1
324 1 r4/f3 (execbit !)
324 1 r4/f3 (execbit !)
325 2 r4/f3 (no-execbit !)
325 2 r4/f3 (no-execbit !)
326
326
327 #if hardlink-whitelisted
327 #if hardlink-whitelisted
328 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
328 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
329 4 r4/.hg/undo.backup.dirstate
329 4 r4/.hg/undo.backup.dirstate
330 4 r4/.hg/undo.dirstate
330 4 r4/.hg/undo.dirstate
331 #endif
331 #endif
332
332
333 Test hardlinking outside hg:
333 Test hardlinking outside hg:
334
334
335 $ mkdir x
335 $ mkdir x
336 $ echo foo > x/a
336 $ echo foo > x/a
337
337
338 $ linkcp x y
338 $ linkcp x y
339 $ echo bar >> y/a
339 $ echo bar >> y/a
340
340
341 No diff if hardlink:
341 No diff if hardlink:
342
342
343 $ diff x/a y/a
343 $ diff x/a y/a
344
344
345 Test mq hardlinking:
345 Test mq hardlinking:
346
346
347 $ echo "[extensions]" >> $HGRCPATH
347 $ echo "[extensions]" >> $HGRCPATH
348 $ echo "mq=" >> $HGRCPATH
348 $ echo "mq=" >> $HGRCPATH
349
349
350 $ hg init a
350 $ hg init a
351 $ cd a
351 $ cd a
352
352
353 $ hg qimport -n foo - << EOF
353 $ hg qimport -n foo - << EOF
354 > # HG changeset patch
354 > # HG changeset patch
355 > # Date 1 0
355 > # Date 1 0
356 > diff -r 2588a8b53d66 a
356 > diff -r 2588a8b53d66 a
357 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
357 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
358 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
358 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
359 > @@ -0,0 +1,1 @@
359 > @@ -0,0 +1,1 @@
360 > +a
360 > +a
361 > EOF
361 > EOF
362 adding foo to series file
362 adding foo to series file
363
363
364 $ hg qpush
364 $ hg qpush
365 applying foo
365 applying foo
366 now at: foo
366 now at: foo
367
367
368 $ cd ..
368 $ cd ..
369 $ linkcp a b
369 $ linkcp a b
370 $ cd b
370 $ cd b
371
371
372 $ hg qimport -n bar - << EOF
372 $ hg qimport -n bar - << EOF
373 > # HG changeset patch
373 > # HG changeset patch
374 > # Date 2 0
374 > # Date 2 0
375 > diff -r 2588a8b53d66 a
375 > diff -r 2588a8b53d66 a
376 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
376 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
377 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
377 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
378 > @@ -0,0 +1,1 @@
378 > @@ -0,0 +1,1 @@
379 > +b
379 > +b
380 > EOF
380 > EOF
381 adding bar to series file
381 adding bar to series file
382
382
383 $ hg qpush
383 $ hg qpush
384 applying bar
384 applying bar
385 now at: bar
385 now at: bar
386
386
387 $ cat .hg/patches/status
387 $ cat .hg/patches/status
388 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
388 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
389 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
389 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
390
390
391 $ cat .hg/patches/series
391 $ cat .hg/patches/series
392 foo
392 foo
393 bar
393 bar
394
394
395 $ cat ../a/.hg/patches/status
395 $ cat ../a/.hg/patches/status
396 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
396 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
397
397
398 $ cat ../a/.hg/patches/series
398 $ cat ../a/.hg/patches/series
399 foo
399 foo
400
400
401 Test tags hardlinking:
401 Test tags hardlinking:
402
402
403 $ hg qdel -r qbase:qtip
403 $ hg qdel -r qbase:qtip
404 patch foo finalized without changeset message
404 patch foo finalized without changeset message
405 patch bar finalized without changeset message
405 patch bar finalized without changeset message
406
406
407 $ hg tag -l lfoo
407 $ hg tag -l lfoo
408 $ hg tag foo
408 $ hg tag foo
409
409
410 $ cd ..
410 $ cd ..
411 $ linkcp b c
411 $ linkcp b c
412 $ cd c
412 $ cd c
413
413
414 $ hg tag -l -r 0 lbar
414 $ hg tag -l -r 0 lbar
415 $ hg tag -r 0 bar
415 $ hg tag -r 0 bar
416
416
417 $ cat .hgtags
417 $ cat .hgtags
418 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
418 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
419 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
419 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
420
420
421 $ cat .hg/localtags
421 $ cat .hg/localtags
422 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
422 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
423 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
423 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
424
424
425 $ cat ../b/.hgtags
425 $ cat ../b/.hgtags
426 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
426 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
427
427
428 $ cat ../b/.hg/localtags
428 $ cat ../b/.hg/localtags
429 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
429 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
430
430
431 $ cd ..
431 $ cd ..
@@ -1,412 +1,412 b''
1 #require serve
1 #require serve
2
2
3 This test is a duplicate of 'test-http.t', feel free to factor out
3 This test is a duplicate of 'test-http.t', feel free to factor out
4 parts that are not bundle1/bundle2 specific.
4 parts that are not bundle1/bundle2 specific.
5
5
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [devel]
7 > [devel]
8 > # This test is dedicated to interaction through old bundle
8 > # This test is dedicated to interaction through old bundle
9 > legacy.exchange = bundle1
9 > legacy.exchange = bundle1
10 > EOF
10 > EOF
11
11
12 $ hg init test
12 $ hg init test
13 $ cd test
13 $ cd test
14 $ echo foo>foo
14 $ echo foo>foo
15 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
15 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
16 $ echo foo>foo.d/foo
16 $ echo foo>foo.d/foo
17 $ echo bar>foo.d/bAr.hg.d/BaR
17 $ echo bar>foo.d/bAr.hg.d/BaR
18 $ echo bar>foo.d/baR.d.hg/bAR
18 $ echo bar>foo.d/baR.d.hg/bAR
19 $ hg commit -A -m 1
19 $ hg commit -A -m 1
20 adding foo
20 adding foo
21 adding foo.d/bAr.hg.d/BaR
21 adding foo.d/bAr.hg.d/BaR
22 adding foo.d/baR.d.hg/bAR
22 adding foo.d/baR.d.hg/bAR
23 adding foo.d/foo
23 adding foo.d/foo
24 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
24 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
25 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
25 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
26
26
27 Test server address cannot be reused
27 Test server address cannot be reused
28
28
29 $ hg serve -p $HGPORT1 2>&1
29 $ hg serve -p $HGPORT1 2>&1
30 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
30 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
31 [255]
31 [255]
32
32
33 $ cd ..
33 $ cd ..
34 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
34 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
35
35
36 clone via stream
36 clone via stream
37
37
38 #if no-reposimplestore
38 #if no-reposimplestore
39 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
39 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
40 streaming all changes
40 streaming all changes
41 6 files to transfer, 606 bytes of data
41 6 files to transfer, 606 bytes of data
42 transferred * bytes in * seconds (*/sec) (glob)
42 transferred * bytes in * seconds (*/sec) (glob)
43 searching for changes
43 searching for changes
44 no changes found
44 no changes found
45 updating to branch default
45 updating to branch default
46 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 $ hg verify -R copy
47 $ hg verify -R copy
48 checking changesets
48 checking changesets
49 checking manifests
49 checking manifests
50 crosschecking files in changesets and manifests
50 crosschecking files in changesets and manifests
51 checking files
51 checking files
52 4 files, 1 changesets, 4 total revisions
52 checked 1 changesets with 4 changes to 4 files
53 #endif
53 #endif
54
54
55 try to clone via stream, should use pull instead
55 try to clone via stream, should use pull instead
56
56
57 $ hg clone --stream http://localhost:$HGPORT1/ copy2
57 $ hg clone --stream http://localhost:$HGPORT1/ copy2
58 warning: stream clone requested but server has them disabled
58 warning: stream clone requested but server has them disabled
59 requesting all changes
59 requesting all changes
60 adding changesets
60 adding changesets
61 adding manifests
61 adding manifests
62 adding file changes
62 adding file changes
63 added 1 changesets with 4 changes to 4 files
63 added 1 changesets with 4 changes to 4 files
64 new changesets 8b6053c928fe
64 new changesets 8b6053c928fe
65 updating to branch default
65 updating to branch default
66 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
67
67
68 try to clone via stream but missing requirements, so should use pull instead
68 try to clone via stream but missing requirements, so should use pull instead
69
69
70 $ cat > $TESTTMP/removesupportedformat.py << EOF
70 $ cat > $TESTTMP/removesupportedformat.py << EOF
71 > from mercurial import localrepo
71 > from mercurial import localrepo
72 > def extsetup(ui):
72 > def extsetup(ui):
73 > localrepo.localrepository.supportedformats.remove(b'generaldelta')
73 > localrepo.localrepository.supportedformats.remove(b'generaldelta')
74 > EOF
74 > EOF
75
75
76 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
76 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
77 warning: stream clone requested but client is missing requirements: generaldelta
77 warning: stream clone requested but client is missing requirements: generaldelta
78 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
78 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
79 requesting all changes
79 requesting all changes
80 adding changesets
80 adding changesets
81 adding manifests
81 adding manifests
82 adding file changes
82 adding file changes
83 added 1 changesets with 4 changes to 4 files
83 added 1 changesets with 4 changes to 4 files
84 new changesets 8b6053c928fe
84 new changesets 8b6053c928fe
85 updating to branch default
85 updating to branch default
86 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
87
87
88 clone via pull
88 clone via pull
89
89
90 $ hg clone http://localhost:$HGPORT1/ copy-pull
90 $ hg clone http://localhost:$HGPORT1/ copy-pull
91 requesting all changes
91 requesting all changes
92 adding changesets
92 adding changesets
93 adding manifests
93 adding manifests
94 adding file changes
94 adding file changes
95 added 1 changesets with 4 changes to 4 files
95 added 1 changesets with 4 changes to 4 files
96 new changesets 8b6053c928fe
96 new changesets 8b6053c928fe
97 updating to branch default
97 updating to branch default
98 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 $ hg verify -R copy-pull
99 $ hg verify -R copy-pull
100 checking changesets
100 checking changesets
101 checking manifests
101 checking manifests
102 crosschecking files in changesets and manifests
102 crosschecking files in changesets and manifests
103 checking files
103 checking files
104 4 files, 1 changesets, 4 total revisions
104 checked 1 changesets with 4 changes to 4 files
105 $ cd test
105 $ cd test
106 $ echo bar > bar
106 $ echo bar > bar
107 $ hg commit -A -d '1 0' -m 2
107 $ hg commit -A -d '1 0' -m 2
108 adding bar
108 adding bar
109 $ cd ..
109 $ cd ..
110
110
111 clone over http with --update
111 clone over http with --update
112
112
113 $ hg clone http://localhost:$HGPORT1/ updated --update 0
113 $ hg clone http://localhost:$HGPORT1/ updated --update 0
114 requesting all changes
114 requesting all changes
115 adding changesets
115 adding changesets
116 adding manifests
116 adding manifests
117 adding file changes
117 adding file changes
118 added 2 changesets with 5 changes to 5 files
118 added 2 changesets with 5 changes to 5 files
119 new changesets 8b6053c928fe:5fed3813f7f5
119 new changesets 8b6053c928fe:5fed3813f7f5
120 updating to branch default
120 updating to branch default
121 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 $ hg log -r . -R updated
122 $ hg log -r . -R updated
123 changeset: 0:8b6053c928fe
123 changeset: 0:8b6053c928fe
124 user: test
124 user: test
125 date: Thu Jan 01 00:00:00 1970 +0000
125 date: Thu Jan 01 00:00:00 1970 +0000
126 summary: 1
126 summary: 1
127
127
128 $ rm -rf updated
128 $ rm -rf updated
129
129
130 incoming via HTTP
130 incoming via HTTP
131
131
132 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
132 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
133 adding changesets
133 adding changesets
134 adding manifests
134 adding manifests
135 adding file changes
135 adding file changes
136 added 1 changesets with 4 changes to 4 files
136 added 1 changesets with 4 changes to 4 files
137 new changesets 8b6053c928fe
137 new changesets 8b6053c928fe
138 updating to branch default
138 updating to branch default
139 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 $ cd partial
140 $ cd partial
141 $ touch LOCAL
141 $ touch LOCAL
142 $ hg ci -qAm LOCAL
142 $ hg ci -qAm LOCAL
143 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
143 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
144 comparing with http://localhost:$HGPORT1/
144 comparing with http://localhost:$HGPORT1/
145 searching for changes
145 searching for changes
146 2
146 2
147 $ cd ..
147 $ cd ..
148
148
149 pull
149 pull
150
150
151 $ cd copy-pull
151 $ cd copy-pull
152 $ cat >> .hg/hgrc <<EOF
152 $ cat >> .hg/hgrc <<EOF
153 > [hooks]
153 > [hooks]
154 > changegroup = sh -c "printenv.py changegroup"
154 > changegroup = sh -c "printenv.py changegroup"
155 > EOF
155 > EOF
156 $ hg pull
156 $ hg pull
157 pulling from http://localhost:$HGPORT1/
157 pulling from http://localhost:$HGPORT1/
158 searching for changes
158 searching for changes
159 adding changesets
159 adding changesets
160 adding manifests
160 adding manifests
161 adding file changes
161 adding file changes
162 added 1 changesets with 1 changes to 1 files
162 added 1 changesets with 1 changes to 1 files
163 new changesets 5fed3813f7f5
163 new changesets 5fed3813f7f5
164 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/
164 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/
165 (run 'hg update' to get a working copy)
165 (run 'hg update' to get a working copy)
166 $ cd ..
166 $ cd ..
167
167
168 clone from invalid URL
168 clone from invalid URL
169
169
170 $ hg clone http://localhost:$HGPORT/bad
170 $ hg clone http://localhost:$HGPORT/bad
171 abort: HTTP Error 404: Not Found
171 abort: HTTP Error 404: Not Found
172 [255]
172 [255]
173
173
174 test http authentication
174 test http authentication
175 + use the same server to test server side streaming preference
175 + use the same server to test server side streaming preference
176
176
177 $ cd test
177 $ cd test
178 $ cat << EOT > userpass.py
178 $ cat << EOT > userpass.py
179 > import base64
179 > import base64
180 > from mercurial.hgweb import common
180 > from mercurial.hgweb import common
181 > def perform_authentication(hgweb, req, op):
181 > def perform_authentication(hgweb, req, op):
182 > auth = req.headers.get(b'Authorization')
182 > auth = req.headers.get(b'Authorization')
183 > if not auth:
183 > if not auth:
184 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
184 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
185 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
185 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
186 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user',
186 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user',
187 > b'pass']:
187 > b'pass']:
188 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
188 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
189 > def extsetup():
189 > def extsetup():
190 > common.permhooks.insert(0, perform_authentication)
190 > common.permhooks.insert(0, perform_authentication)
191 > EOT
191 > EOT
192 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
192 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
193 > --config server.preferuncompressed=True \
193 > --config server.preferuncompressed=True \
194 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
194 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
195 $ cat pid >> $DAEMON_PIDS
195 $ cat pid >> $DAEMON_PIDS
196
196
197 $ cat << EOF > get_pass.py
197 $ cat << EOF > get_pass.py
198 > import getpass
198 > import getpass
199 > def newgetpass(arg):
199 > def newgetpass(arg):
200 > return "pass"
200 > return "pass"
201 > getpass.getpass = newgetpass
201 > getpass.getpass = newgetpass
202 > EOF
202 > EOF
203
203
204 $ hg id http://localhost:$HGPORT2/
204 $ hg id http://localhost:$HGPORT2/
205 abort: http authorization required for http://localhost:$HGPORT2/
205 abort: http authorization required for http://localhost:$HGPORT2/
206 [255]
206 [255]
207 $ hg id http://localhost:$HGPORT2/
207 $ hg id http://localhost:$HGPORT2/
208 abort: http authorization required for http://localhost:$HGPORT2/
208 abort: http authorization required for http://localhost:$HGPORT2/
209 [255]
209 [255]
210 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
210 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
211 http authorization required for http://localhost:$HGPORT2/
211 http authorization required for http://localhost:$HGPORT2/
212 realm: mercurial
212 realm: mercurial
213 user: user
213 user: user
214 password: 5fed3813f7f5
214 password: 5fed3813f7f5
215 $ hg id http://user:pass@localhost:$HGPORT2/
215 $ hg id http://user:pass@localhost:$HGPORT2/
216 5fed3813f7f5
216 5fed3813f7f5
217 $ echo '[auth]' >> .hg/hgrc
217 $ echo '[auth]' >> .hg/hgrc
218 $ echo 'l.schemes=http' >> .hg/hgrc
218 $ echo 'l.schemes=http' >> .hg/hgrc
219 $ echo 'l.prefix=lo' >> .hg/hgrc
219 $ echo 'l.prefix=lo' >> .hg/hgrc
220 $ echo 'l.username=user' >> .hg/hgrc
220 $ echo 'l.username=user' >> .hg/hgrc
221 $ echo 'l.password=pass' >> .hg/hgrc
221 $ echo 'l.password=pass' >> .hg/hgrc
222 $ hg id http://localhost:$HGPORT2/
222 $ hg id http://localhost:$HGPORT2/
223 5fed3813f7f5
223 5fed3813f7f5
224 $ hg id http://localhost:$HGPORT2/
224 $ hg id http://localhost:$HGPORT2/
225 5fed3813f7f5
225 5fed3813f7f5
226 $ hg id http://user@localhost:$HGPORT2/
226 $ hg id http://user@localhost:$HGPORT2/
227 5fed3813f7f5
227 5fed3813f7f5
228
228
229 #if no-reposimplestore
229 #if no-reposimplestore
230 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
230 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
231 streaming all changes
231 streaming all changes
232 7 files to transfer, 916 bytes of data
232 7 files to transfer, 916 bytes of data
233 transferred * bytes in * seconds (*/sec) (glob)
233 transferred * bytes in * seconds (*/sec) (glob)
234 searching for changes
234 searching for changes
235 no changes found
235 no changes found
236 updating to branch default
236 updating to branch default
237 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 #endif
238 #endif
239
239
240 --pull should override server's preferuncompressed
240 --pull should override server's preferuncompressed
241
241
242 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
242 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
243 requesting all changes
243 requesting all changes
244 adding changesets
244 adding changesets
245 adding manifests
245 adding manifests
246 adding file changes
246 adding file changes
247 added 2 changesets with 5 changes to 5 files
247 added 2 changesets with 5 changes to 5 files
248 new changesets 8b6053c928fe:5fed3813f7f5
248 new changesets 8b6053c928fe:5fed3813f7f5
249 updating to branch default
249 updating to branch default
250 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
251
251
252 $ hg id http://user2@localhost:$HGPORT2/
252 $ hg id http://user2@localhost:$HGPORT2/
253 abort: http authorization required for http://localhost:$HGPORT2/
253 abort: http authorization required for http://localhost:$HGPORT2/
254 [255]
254 [255]
255 $ hg id http://user:pass2@localhost:$HGPORT2/
255 $ hg id http://user:pass2@localhost:$HGPORT2/
256 abort: HTTP Error 403: no
256 abort: HTTP Error 403: no
257 [255]
257 [255]
258
258
259 $ hg -R dest-pull tag -r tip top
259 $ hg -R dest-pull tag -r tip top
260 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
260 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
261 pushing to http://user:***@localhost:$HGPORT2/
261 pushing to http://user:***@localhost:$HGPORT2/
262 searching for changes
262 searching for changes
263 remote: adding changesets
263 remote: adding changesets
264 remote: adding manifests
264 remote: adding manifests
265 remote: adding file changes
265 remote: adding file changes
266 remote: added 1 changesets with 1 changes to 1 files
266 remote: added 1 changesets with 1 changes to 1 files
267 $ hg rollback -q
267 $ hg rollback -q
268
268
269 $ sed 's/.*] "/"/' < ../access.log
269 $ sed 's/.*] "/"/' < ../access.log
270 "GET /?cmd=capabilities HTTP/1.1" 401 -
270 "GET /?cmd=capabilities HTTP/1.1" 401 -
271 "GET /?cmd=capabilities HTTP/1.1" 401 -
271 "GET /?cmd=capabilities HTTP/1.1" 401 -
272 "GET /?cmd=capabilities HTTP/1.1" 401 -
272 "GET /?cmd=capabilities HTTP/1.1" 401 -
273 "GET /?cmd=capabilities HTTP/1.1" 200 -
273 "GET /?cmd=capabilities HTTP/1.1" 200 -
274 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
274 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
275 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
275 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
276 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
276 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
277 "GET /?cmd=capabilities HTTP/1.1" 401 -
277 "GET /?cmd=capabilities HTTP/1.1" 401 -
278 "GET /?cmd=capabilities HTTP/1.1" 200 -
278 "GET /?cmd=capabilities HTTP/1.1" 200 -
279 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
279 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
280 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
280 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
282 "GET /?cmd=capabilities HTTP/1.1" 401 -
282 "GET /?cmd=capabilities HTTP/1.1" 401 -
283 "GET /?cmd=capabilities HTTP/1.1" 200 -
283 "GET /?cmd=capabilities HTTP/1.1" 200 -
284 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
284 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
285 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
285 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
287 "GET /?cmd=capabilities HTTP/1.1" 401 -
287 "GET /?cmd=capabilities HTTP/1.1" 401 -
288 "GET /?cmd=capabilities HTTP/1.1" 200 -
288 "GET /?cmd=capabilities HTTP/1.1" 200 -
289 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
289 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
290 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
290 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
291 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
291 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
292 "GET /?cmd=capabilities HTTP/1.1" 401 -
292 "GET /?cmd=capabilities HTTP/1.1" 401 -
293 "GET /?cmd=capabilities HTTP/1.1" 200 -
293 "GET /?cmd=capabilities HTTP/1.1" 200 -
294 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
294 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
295 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
295 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
296 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
296 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
297 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
297 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
298 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
298 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
299 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
299 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
300 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
300 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
301 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
301 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
302 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
302 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
303 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
303 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
304 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
304 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
305 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
305 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
306 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
306 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
307 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
307 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
308 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
308 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
310 "GET /?cmd=capabilities HTTP/1.1" 401 -
310 "GET /?cmd=capabilities HTTP/1.1" 401 -
311 "GET /?cmd=capabilities HTTP/1.1" 401 -
311 "GET /?cmd=capabilities HTTP/1.1" 401 -
312 "GET /?cmd=capabilities HTTP/1.1" 403 -
312 "GET /?cmd=capabilities HTTP/1.1" 403 -
313 "GET /?cmd=capabilities HTTP/1.1" 401 -
313 "GET /?cmd=capabilities HTTP/1.1" 401 -
314 "GET /?cmd=capabilities HTTP/1.1" 200 -
314 "GET /?cmd=capabilities HTTP/1.1" 200 -
315 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
315 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
316 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
316 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
317 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
317 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
318 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
318 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
319 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
319 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
320 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob)
320 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob)
321 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
321 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
322
322
323 $ cd ..
323 $ cd ..
324
324
325 clone of serve with repo in root and unserved subrepo (issue2970)
325 clone of serve with repo in root and unserved subrepo (issue2970)
326
326
327 $ hg --cwd test init sub
327 $ hg --cwd test init sub
328 $ echo empty > test/sub/empty
328 $ echo empty > test/sub/empty
329 $ hg --cwd test/sub add empty
329 $ hg --cwd test/sub add empty
330 $ hg --cwd test/sub commit -qm 'add empty'
330 $ hg --cwd test/sub commit -qm 'add empty'
331 $ hg --cwd test/sub tag -r 0 something
331 $ hg --cwd test/sub tag -r 0 something
332 $ echo sub = sub > test/.hgsub
332 $ echo sub = sub > test/.hgsub
333 $ hg --cwd test add .hgsub
333 $ hg --cwd test add .hgsub
334 $ hg --cwd test commit -qm 'add subrepo'
334 $ hg --cwd test commit -qm 'add subrepo'
335 $ hg clone http://localhost:$HGPORT noslash-clone
335 $ hg clone http://localhost:$HGPORT noslash-clone
336 requesting all changes
336 requesting all changes
337 adding changesets
337 adding changesets
338 adding manifests
338 adding manifests
339 adding file changes
339 adding file changes
340 added 3 changesets with 7 changes to 7 files
340 added 3 changesets with 7 changes to 7 files
341 new changesets 8b6053c928fe:56f9bc90cce6
341 new changesets 8b6053c928fe:56f9bc90cce6
342 updating to branch default
342 updating to branch default
343 abort: HTTP Error 404: Not Found
343 abort: HTTP Error 404: Not Found
344 [255]
344 [255]
345 $ hg clone http://localhost:$HGPORT/ slash-clone
345 $ hg clone http://localhost:$HGPORT/ slash-clone
346 requesting all changes
346 requesting all changes
347 adding changesets
347 adding changesets
348 adding manifests
348 adding manifests
349 adding file changes
349 adding file changes
350 added 3 changesets with 7 changes to 7 files
350 added 3 changesets with 7 changes to 7 files
351 new changesets 8b6053c928fe:56f9bc90cce6
351 new changesets 8b6053c928fe:56f9bc90cce6
352 updating to branch default
352 updating to branch default
353 abort: HTTP Error 404: Not Found
353 abort: HTTP Error 404: Not Found
354 [255]
354 [255]
355
355
356 check error log
356 check error log
357
357
358 $ cat error.log
358 $ cat error.log
359
359
360 Check error reporting while pulling/cloning
360 Check error reporting while pulling/cloning
361
361
362 $ $RUNTESTDIR/killdaemons.py
362 $ $RUNTESTDIR/killdaemons.py
363 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
363 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
364 $ cat hg3.pid >> $DAEMON_PIDS
364 $ cat hg3.pid >> $DAEMON_PIDS
365 $ hg clone http://localhost:$HGPORT/ abort-clone
365 $ hg clone http://localhost:$HGPORT/ abort-clone
366 requesting all changes
366 requesting all changes
367 abort: remote error:
367 abort: remote error:
368 this is an exercise
368 this is an exercise
369 [255]
369 [255]
370 $ cat error.log
370 $ cat error.log
371
371
372 disable pull-based clones
372 disable pull-based clones
373
373
374 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
374 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
375 $ cat hg4.pid >> $DAEMON_PIDS
375 $ cat hg4.pid >> $DAEMON_PIDS
376 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
376 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
377 requesting all changes
377 requesting all changes
378 abort: remote error:
378 abort: remote error:
379 server has pull-based clones disabled
379 server has pull-based clones disabled
380 [255]
380 [255]
381
381
382 #if no-reposimplestore
382 #if no-reposimplestore
383 ... but keep stream clones working
383 ... but keep stream clones working
384
384
385 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
385 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
386 streaming all changes
386 streaming all changes
387 * files to transfer, * of data (glob)
387 * files to transfer, * of data (glob)
388 transferred * in * seconds (* KB/sec) (glob)
388 transferred * in * seconds (* KB/sec) (glob)
389 searching for changes
389 searching for changes
390 no changes found
390 no changes found
391 #endif
391 #endif
392
392
393 ... and also keep partial clones and pulls working
393 ... and also keep partial clones and pulls working
394 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
394 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
395 adding changesets
395 adding changesets
396 adding manifests
396 adding manifests
397 adding file changes
397 adding file changes
398 added 1 changesets with 4 changes to 4 files
398 added 1 changesets with 4 changes to 4 files
399 new changesets 8b6053c928fe
399 new changesets 8b6053c928fe
400 updating to branch default
400 updating to branch default
401 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
401 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 $ hg pull -R test-partial-clone
402 $ hg pull -R test-partial-clone
403 pulling from http://localhost:$HGPORT1/
403 pulling from http://localhost:$HGPORT1/
404 searching for changes
404 searching for changes
405 adding changesets
405 adding changesets
406 adding manifests
406 adding manifests
407 adding file changes
407 adding file changes
408 added 2 changesets with 3 changes to 3 files
408 added 2 changesets with 3 changes to 3 files
409 new changesets 5fed3813f7f5:56f9bc90cce6
409 new changesets 5fed3813f7f5:56f9bc90cce6
410 (run 'hg update' to get a working copy)
410 (run 'hg update' to get a working copy)
411
411
412 $ cat error.log
412 $ cat error.log
@@ -1,222 +1,222 b''
1 #require serve
1 #require serve
2
2
3 creating 'remote
3 creating 'remote
4
4
5 $ hg init remote
5 $ hg init remote
6 $ cd remote
6 $ cd remote
7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
7 $ hg unbundle "$TESTDIR/bundles/remote.hg"
8 adding changesets
8 adding changesets
9 adding manifests
9 adding manifests
10 adding file changes
10 adding file changes
11 added 9 changesets with 7 changes to 4 files (+1 heads)
11 added 9 changesets with 7 changes to 4 files (+1 heads)
12 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
12 new changesets bfaf4b5cbf01:916f1afdef90 (9 drafts)
13 (run 'hg heads' to see heads, 'hg merge' to merge)
13 (run 'hg heads' to see heads, 'hg merge' to merge)
14 $ hg up tip
14 $ hg up tip
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16
16
17 Starting server
17 Starting server
18
18
19 $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
19 $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
20 $ cd ..
20 $ cd ..
21 $ cat hg1.pid >> $DAEMON_PIDS
21 $ cat hg1.pid >> $DAEMON_PIDS
22
22
23 clone remote via stream
23 clone remote via stream
24
24
25 $ for i in 0 1 2 3 4 5 6 7 8; do
25 $ for i in 0 1 2 3 4 5 6 7 8; do
26 > hg clone -r "$i" http://localhost:$HGPORT/ test-"$i"
26 > hg clone -r "$i" http://localhost:$HGPORT/ test-"$i"
27 > if cd test-"$i"; then
27 > if cd test-"$i"; then
28 > hg verify
28 > hg verify
29 > cd ..
29 > cd ..
30 > fi
30 > fi
31 > done
31 > done
32 adding changesets
32 adding changesets
33 adding manifests
33 adding manifests
34 adding file changes
34 adding file changes
35 added 1 changesets with 1 changes to 1 files
35 added 1 changesets with 1 changes to 1 files
36 new changesets bfaf4b5cbf01
36 new changesets bfaf4b5cbf01
37 updating to branch default
37 updating to branch default
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 checking changesets
39 checking changesets
40 checking manifests
40 checking manifests
41 crosschecking files in changesets and manifests
41 crosschecking files in changesets and manifests
42 checking files
42 checking files
43 1 files, 1 changesets, 1 total revisions
43 checked 1 changesets with 1 changes to 1 files
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 2 changes to 1 files
47 added 2 changesets with 2 changes to 1 files
48 new changesets bfaf4b5cbf01:21f32785131f
48 new changesets bfaf4b5cbf01:21f32785131f
49 updating to branch default
49 updating to branch default
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 checking changesets
51 checking changesets
52 checking manifests
52 checking manifests
53 crosschecking files in changesets and manifests
53 crosschecking files in changesets and manifests
54 checking files
54 checking files
55 1 files, 2 changesets, 2 total revisions
55 checked 2 changesets with 2 changes to 1 files
56 adding changesets
56 adding changesets
57 adding manifests
57 adding manifests
58 adding file changes
58 adding file changes
59 added 3 changesets with 3 changes to 1 files
59 added 3 changesets with 3 changes to 1 files
60 new changesets bfaf4b5cbf01:4ce51a113780
60 new changesets bfaf4b5cbf01:4ce51a113780
61 updating to branch default
61 updating to branch default
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 checking changesets
63 checking changesets
64 checking manifests
64 checking manifests
65 crosschecking files in changesets and manifests
65 crosschecking files in changesets and manifests
66 checking files
66 checking files
67 1 files, 3 changesets, 3 total revisions
67 checked 3 changesets with 3 changes to 1 files
68 adding changesets
68 adding changesets
69 adding manifests
69 adding manifests
70 adding file changes
70 adding file changes
71 added 4 changesets with 4 changes to 1 files
71 added 4 changesets with 4 changes to 1 files
72 new changesets bfaf4b5cbf01:93ee6ab32777
72 new changesets bfaf4b5cbf01:93ee6ab32777
73 updating to branch default
73 updating to branch default
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 checking changesets
75 checking changesets
76 checking manifests
76 checking manifests
77 crosschecking files in changesets and manifests
77 crosschecking files in changesets and manifests
78 checking files
78 checking files
79 1 files, 4 changesets, 4 total revisions
79 checked 4 changesets with 4 changes to 1 files
80 adding changesets
80 adding changesets
81 adding manifests
81 adding manifests
82 adding file changes
82 adding file changes
83 added 2 changesets with 2 changes to 1 files
83 added 2 changesets with 2 changes to 1 files
84 new changesets bfaf4b5cbf01:c70afb1ee985
84 new changesets bfaf4b5cbf01:c70afb1ee985
85 updating to branch default
85 updating to branch default
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 checking changesets
87 checking changesets
88 checking manifests
88 checking manifests
89 crosschecking files in changesets and manifests
89 crosschecking files in changesets and manifests
90 checking files
90 checking files
91 1 files, 2 changesets, 2 total revisions
91 checked 2 changesets with 2 changes to 1 files
92 adding changesets
92 adding changesets
93 adding manifests
93 adding manifests
94 adding file changes
94 adding file changes
95 added 3 changesets with 3 changes to 1 files
95 added 3 changesets with 3 changes to 1 files
96 new changesets bfaf4b5cbf01:f03ae5a9b979
96 new changesets bfaf4b5cbf01:f03ae5a9b979
97 updating to branch default
97 updating to branch default
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 checking changesets
99 checking changesets
100 checking manifests
100 checking manifests
101 crosschecking files in changesets and manifests
101 crosschecking files in changesets and manifests
102 checking files
102 checking files
103 1 files, 3 changesets, 3 total revisions
103 checked 3 changesets with 3 changes to 1 files
104 adding changesets
104 adding changesets
105 adding manifests
105 adding manifests
106 adding file changes
106 adding file changes
107 added 4 changesets with 5 changes to 2 files
107 added 4 changesets with 5 changes to 2 files
108 new changesets bfaf4b5cbf01:095cb14b1b4d
108 new changesets bfaf4b5cbf01:095cb14b1b4d
109 updating to branch default
109 updating to branch default
110 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 checking changesets
111 checking changesets
112 checking manifests
112 checking manifests
113 crosschecking files in changesets and manifests
113 crosschecking files in changesets and manifests
114 checking files
114 checking files
115 2 files, 4 changesets, 5 total revisions
115 checked 4 changesets with 5 changes to 2 files
116 adding changesets
116 adding changesets
117 adding manifests
117 adding manifests
118 adding file changes
118 adding file changes
119 added 5 changesets with 6 changes to 3 files
119 added 5 changesets with 6 changes to 3 files
120 new changesets bfaf4b5cbf01:faa2e4234c7a
120 new changesets bfaf4b5cbf01:faa2e4234c7a
121 updating to branch default
121 updating to branch default
122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 checking changesets
123 checking changesets
124 checking manifests
124 checking manifests
125 crosschecking files in changesets and manifests
125 crosschecking files in changesets and manifests
126 checking files
126 checking files
127 3 files, 5 changesets, 6 total revisions
127 checked 5 changesets with 6 changes to 3 files
128 adding changesets
128 adding changesets
129 adding manifests
129 adding manifests
130 adding file changes
130 adding file changes
131 added 5 changesets with 5 changes to 2 files
131 added 5 changesets with 5 changes to 2 files
132 new changesets bfaf4b5cbf01:916f1afdef90
132 new changesets bfaf4b5cbf01:916f1afdef90
133 updating to branch default
133 updating to branch default
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
135 checking changesets
135 checking changesets
136 checking manifests
136 checking manifests
137 crosschecking files in changesets and manifests
137 crosschecking files in changesets and manifests
138 checking files
138 checking files
139 2 files, 5 changesets, 5 total revisions
139 checked 5 changesets with 5 changes to 2 files
140 $ cd test-8
140 $ cd test-8
141 $ hg pull ../test-7
141 $ hg pull ../test-7
142 pulling from ../test-7
142 pulling from ../test-7
143 searching for changes
143 searching for changes
144 adding changesets
144 adding changesets
145 adding manifests
145 adding manifests
146 adding file changes
146 adding file changes
147 added 4 changesets with 2 changes to 3 files (+1 heads)
147 added 4 changesets with 2 changes to 3 files (+1 heads)
148 new changesets c70afb1ee985:faa2e4234c7a
148 new changesets c70afb1ee985:faa2e4234c7a
149 (run 'hg heads' to see heads, 'hg merge' to merge)
149 (run 'hg heads' to see heads, 'hg merge' to merge)
150 $ hg verify
150 $ hg verify
151 checking changesets
151 checking changesets
152 checking manifests
152 checking manifests
153 crosschecking files in changesets and manifests
153 crosschecking files in changesets and manifests
154 checking files
154 checking files
155 4 files, 9 changesets, 7 total revisions
155 checked 9 changesets with 7 changes to 4 files
156 $ cd ..
156 $ cd ..
157 $ cd test-1
157 $ cd test-1
158 $ hg pull -r 4 http://localhost:$HGPORT/
158 $ hg pull -r 4 http://localhost:$HGPORT/
159 pulling from http://localhost:$HGPORT/
159 pulling from http://localhost:$HGPORT/
160 searching for changes
160 searching for changes
161 adding changesets
161 adding changesets
162 adding manifests
162 adding manifests
163 adding file changes
163 adding file changes
164 added 1 changesets with 0 changes to 0 files (+1 heads)
164 added 1 changesets with 0 changes to 0 files (+1 heads)
165 new changesets c70afb1ee985
165 new changesets c70afb1ee985
166 (run 'hg heads' to see heads, 'hg merge' to merge)
166 (run 'hg heads' to see heads, 'hg merge' to merge)
167 $ hg verify
167 $ hg verify
168 checking changesets
168 checking changesets
169 checking manifests
169 checking manifests
170 crosschecking files in changesets and manifests
170 crosschecking files in changesets and manifests
171 checking files
171 checking files
172 1 files, 3 changesets, 2 total revisions
172 checked 3 changesets with 2 changes to 1 files
173 $ hg pull http://localhost:$HGPORT/
173 $ hg pull http://localhost:$HGPORT/
174 pulling from http://localhost:$HGPORT/
174 pulling from http://localhost:$HGPORT/
175 searching for changes
175 searching for changes
176 adding changesets
176 adding changesets
177 adding manifests
177 adding manifests
178 adding file changes
178 adding file changes
179 added 6 changesets with 5 changes to 4 files
179 added 6 changesets with 5 changes to 4 files
180 new changesets 4ce51a113780:916f1afdef90
180 new changesets 4ce51a113780:916f1afdef90
181 (run 'hg update' to get a working copy)
181 (run 'hg update' to get a working copy)
182 $ cd ..
182 $ cd ..
183 $ cd test-2
183 $ cd test-2
184 $ hg pull -r 5 http://localhost:$HGPORT/
184 $ hg pull -r 5 http://localhost:$HGPORT/
185 pulling from http://localhost:$HGPORT/
185 pulling from http://localhost:$HGPORT/
186 searching for changes
186 searching for changes
187 adding changesets
187 adding changesets
188 adding manifests
188 adding manifests
189 adding file changes
189 adding file changes
190 added 2 changesets with 0 changes to 0 files (+1 heads)
190 added 2 changesets with 0 changes to 0 files (+1 heads)
191 new changesets c70afb1ee985:f03ae5a9b979
191 new changesets c70afb1ee985:f03ae5a9b979
192 (run 'hg heads' to see heads, 'hg merge' to merge)
192 (run 'hg heads' to see heads, 'hg merge' to merge)
193 $ hg verify
193 $ hg verify
194 checking changesets
194 checking changesets
195 checking manifests
195 checking manifests
196 crosschecking files in changesets and manifests
196 crosschecking files in changesets and manifests
197 checking files
197 checking files
198 1 files, 5 changesets, 3 total revisions
198 checked 5 changesets with 3 changes to 1 files
199 $ hg pull http://localhost:$HGPORT/
199 $ hg pull http://localhost:$HGPORT/
200 pulling from http://localhost:$HGPORT/
200 pulling from http://localhost:$HGPORT/
201 searching for changes
201 searching for changes
202 adding changesets
202 adding changesets
203 adding manifests
203 adding manifests
204 adding file changes
204 adding file changes
205 added 4 changesets with 4 changes to 4 files
205 added 4 changesets with 4 changes to 4 files
206 new changesets 93ee6ab32777:916f1afdef90
206 new changesets 93ee6ab32777:916f1afdef90
207 (run 'hg update' to get a working copy)
207 (run 'hg update' to get a working copy)
208 $ hg verify
208 $ hg verify
209 checking changesets
209 checking changesets
210 checking manifests
210 checking manifests
211 crosschecking files in changesets and manifests
211 crosschecking files in changesets and manifests
212 checking files
212 checking files
213 4 files, 9 changesets, 7 total revisions
213 checked 9 changesets with 7 changes to 4 files
214 $ cd ..
214 $ cd ..
215
215
216 no default destination if url has no path:
216 no default destination if url has no path:
217
217
218 $ hg clone http://localhost:$HGPORT/
218 $ hg clone http://localhost:$HGPORT/
219 abort: empty destination path is not valid
219 abort: empty destination path is not valid
220 [255]
220 [255]
221
221
222 $ cat error.log
222 $ cat error.log
@@ -1,126 +1,126 b''
1 #require serve
1 #require serve
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg ci -Ama -d '1123456789 0'
6 $ hg ci -Ama -d '1123456789 0'
7 adding a
7 adding a
8 $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
8 $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
9 $ cat hg.pid >> $DAEMON_PIDS
9 $ cat hg.pid >> $DAEMON_PIDS
10 $ cd ..
10 $ cd ..
11 $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
11 $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
12 $ while [ ! -f proxy.pid ]; do sleep 0; done
12 $ while [ ! -f proxy.pid ]; do sleep 0; done
13 $ cat proxy.pid >> $DAEMON_PIDS
13 $ cat proxy.pid >> $DAEMON_PIDS
14
14
15 url for proxy, stream
15 url for proxy, stream
16
16
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
18 streaming all changes
18 streaming all changes
19 3 files to transfer, 303 bytes of data (reporevlogstore !)
19 3 files to transfer, 303 bytes of data (reporevlogstore !)
20 4 files to transfer, 330 bytes of data (reposimplestore !)
20 4 files to transfer, 330 bytes of data (reposimplestore !)
21 transferred * bytes in * seconds (*/sec) (glob)
21 transferred * bytes in * seconds (*/sec) (glob)
22 searching for changes
22 searching for changes
23 no changes found
23 no changes found
24 updating to branch default
24 updating to branch default
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 $ cd b
26 $ cd b
27 $ hg verify
27 $ hg verify
28 checking changesets
28 checking changesets
29 checking manifests
29 checking manifests
30 crosschecking files in changesets and manifests
30 crosschecking files in changesets and manifests
31 checking files
31 checking files
32 1 files, 1 changesets, 1 total revisions
32 checked 1 changesets with 1 changes to 1 files
33 $ cd ..
33 $ cd ..
34
34
35 url for proxy, pull
35 url for proxy, pull
36
36
37 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
37 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
38 requesting all changes
38 requesting all changes
39 adding changesets
39 adding changesets
40 adding manifests
40 adding manifests
41 adding file changes
41 adding file changes
42 added 1 changesets with 1 changes to 1 files
42 added 1 changesets with 1 changes to 1 files
43 new changesets 83180e7845de
43 new changesets 83180e7845de
44 updating to branch default
44 updating to branch default
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd b-pull
46 $ cd b-pull
47 $ hg verify
47 $ hg verify
48 checking changesets
48 checking changesets
49 checking manifests
49 checking manifests
50 crosschecking files in changesets and manifests
50 crosschecking files in changesets and manifests
51 checking files
51 checking files
52 1 files, 1 changesets, 1 total revisions
52 checked 1 changesets with 1 changes to 1 files
53 $ cd ..
53 $ cd ..
54
54
55 host:port for proxy
55 host:port for proxy
56
56
57 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
57 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
58 requesting all changes
58 requesting all changes
59 adding changesets
59 adding changesets
60 adding manifests
60 adding manifests
61 adding file changes
61 adding file changes
62 added 1 changesets with 1 changes to 1 files
62 added 1 changesets with 1 changes to 1 files
63 new changesets 83180e7845de
63 new changesets 83180e7845de
64 updating to branch default
64 updating to branch default
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66
66
67 proxy url with user name and password
67 proxy url with user name and password
68
68
69 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
69 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
70 requesting all changes
70 requesting all changes
71 adding changesets
71 adding changesets
72 adding manifests
72 adding manifests
73 adding file changes
73 adding file changes
74 added 1 changesets with 1 changes to 1 files
74 added 1 changesets with 1 changes to 1 files
75 new changesets 83180e7845de
75 new changesets 83180e7845de
76 updating to branch default
76 updating to branch default
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78
78
79 url with user name and password
79 url with user name and password
80
80
81 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
81 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
82 requesting all changes
82 requesting all changes
83 adding changesets
83 adding changesets
84 adding manifests
84 adding manifests
85 adding file changes
85 adding file changes
86 added 1 changesets with 1 changes to 1 files
86 added 1 changesets with 1 changes to 1 files
87 new changesets 83180e7845de
87 new changesets 83180e7845de
88 updating to branch default
88 updating to branch default
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90
90
91 bad host:port for proxy ("Protocol not supported" can happen on
91 bad host:port for proxy ("Protocol not supported" can happen on
92 misconfigured hosts)
92 misconfigured hosts)
93
93
94 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
94 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
95 abort: error: (Connection refused|Protocol not supported|.* actively refused it|Cannot assign requested address) (re)
95 abort: error: (Connection refused|Protocol not supported|.* actively refused it|Cannot assign requested address) (re)
96 [255]
96 [255]
97
97
98 do not use the proxy if it is in the no list
98 do not use the proxy if it is in the no list
99
99
100 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
100 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
101 requesting all changes
101 requesting all changes
102 adding changesets
102 adding changesets
103 adding manifests
103 adding manifests
104 adding file changes
104 adding file changes
105 added 1 changesets with 1 changes to 1 files
105 added 1 changesets with 1 changes to 1 files
106 new changesets 83180e7845de
106 new changesets 83180e7845de
107 updating to branch default
107 updating to branch default
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 $ cat proxy.log
109 $ cat proxy.log
110 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
110 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
111 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
111 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
112 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
112 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
113 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D83180e7845de420a1bb46896fd5fe05294f8d629 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
113 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D83180e7845de420a1bb46896fd5fe05294f8d629 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
114 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=83180e7845de420a1bb46896fd5fe05294f8d629&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
114 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=83180e7845de420a1bb46896fd5fe05294f8d629&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
115 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
115 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
116 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
116 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
117 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
117 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
118 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
118 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
119 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
119 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
120 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
120 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
121 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
121 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
122 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
122 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
123 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
123 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
124 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
124 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
125 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
125 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
126 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
126 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
@@ -1,563 +1,563 b''
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo foo>foo
5 $ echo foo>foo
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
7 $ echo foo>foo.d/foo
7 $ echo foo>foo.d/foo
8 $ echo bar>foo.d/bAr.hg.d/BaR
8 $ echo bar>foo.d/bAr.hg.d/BaR
9 $ echo bar>foo.d/baR.d.hg/bAR
9 $ echo bar>foo.d/baR.d.hg/bAR
10 $ hg commit -A -m 1
10 $ hg commit -A -m 1
11 adding foo
11 adding foo
12 adding foo.d/bAr.hg.d/BaR
12 adding foo.d/bAr.hg.d/BaR
13 adding foo.d/baR.d.hg/bAR
13 adding foo.d/baR.d.hg/bAR
14 adding foo.d/foo
14 adding foo.d/foo
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
17
17
18 Test server address cannot be reused
18 Test server address cannot be reused
19
19
20 $ hg serve -p $HGPORT1 2>&1
20 $ hg serve -p $HGPORT1 2>&1
21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
22 [255]
22 [255]
23
23
24 $ cd ..
24 $ cd ..
25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
26
26
27 clone via stream
27 clone via stream
28
28
29 #if no-reposimplestore
29 #if no-reposimplestore
30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
31 streaming all changes
31 streaming all changes
32 6 files to transfer, 606 bytes of data
32 6 files to transfer, 606 bytes of data
33 transferred * bytes in * seconds (*/sec) (glob)
33 transferred * bytes in * seconds (*/sec) (glob)
34 searching for changes
34 searching for changes
35 no changes found
35 no changes found
36 updating to branch default
36 updating to branch default
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ hg verify -R copy
38 $ hg verify -R copy
39 checking changesets
39 checking changesets
40 checking manifests
40 checking manifests
41 crosschecking files in changesets and manifests
41 crosschecking files in changesets and manifests
42 checking files
42 checking files
43 4 files, 1 changesets, 4 total revisions
43 checked 1 changesets with 4 changes to 4 files
44 #endif
44 #endif
45
45
46 try to clone via stream, should use pull instead
46 try to clone via stream, should use pull instead
47
47
48 $ hg clone --stream http://localhost:$HGPORT1/ copy2
48 $ hg clone --stream http://localhost:$HGPORT1/ copy2
49 warning: stream clone requested but server has them disabled
49 warning: stream clone requested but server has them disabled
50 requesting all changes
50 requesting all changes
51 adding changesets
51 adding changesets
52 adding manifests
52 adding manifests
53 adding file changes
53 adding file changes
54 added 1 changesets with 4 changes to 4 files
54 added 1 changesets with 4 changes to 4 files
55 new changesets 8b6053c928fe
55 new changesets 8b6053c928fe
56 updating to branch default
56 updating to branch default
57 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
58
58
59 try to clone via stream but missing requirements, so should use pull instead
59 try to clone via stream but missing requirements, so should use pull instead
60
60
61 $ cat > $TESTTMP/removesupportedformat.py << EOF
61 $ cat > $TESTTMP/removesupportedformat.py << EOF
62 > from mercurial import localrepo
62 > from mercurial import localrepo
63 > def extsetup(ui):
63 > def extsetup(ui):
64 > localrepo.localrepository.supportedformats.remove(b'generaldelta')
64 > localrepo.localrepository.supportedformats.remove(b'generaldelta')
65 > EOF
65 > EOF
66
66
67 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
67 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
68 warning: stream clone requested but client is missing requirements: generaldelta
68 warning: stream clone requested but client is missing requirements: generaldelta
69 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
69 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
70 requesting all changes
70 requesting all changes
71 adding changesets
71 adding changesets
72 adding manifests
72 adding manifests
73 adding file changes
73 adding file changes
74 added 1 changesets with 4 changes to 4 files
74 added 1 changesets with 4 changes to 4 files
75 new changesets 8b6053c928fe
75 new changesets 8b6053c928fe
76 updating to branch default
76 updating to branch default
77 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
78
78
79 clone via pull
79 clone via pull
80
80
81 $ hg clone http://localhost:$HGPORT1/ copy-pull
81 $ hg clone http://localhost:$HGPORT1/ copy-pull
82 requesting all changes
82 requesting all changes
83 adding changesets
83 adding changesets
84 adding manifests
84 adding manifests
85 adding file changes
85 adding file changes
86 added 1 changesets with 4 changes to 4 files
86 added 1 changesets with 4 changes to 4 files
87 new changesets 8b6053c928fe
87 new changesets 8b6053c928fe
88 updating to branch default
88 updating to branch default
89 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 $ hg verify -R copy-pull
90 $ hg verify -R copy-pull
91 checking changesets
91 checking changesets
92 checking manifests
92 checking manifests
93 crosschecking files in changesets and manifests
93 crosschecking files in changesets and manifests
94 checking files
94 checking files
95 4 files, 1 changesets, 4 total revisions
95 checked 1 changesets with 4 changes to 4 files
96 $ cd test
96 $ cd test
97 $ echo bar > bar
97 $ echo bar > bar
98 $ hg commit -A -d '1 0' -m 2
98 $ hg commit -A -d '1 0' -m 2
99 adding bar
99 adding bar
100 $ cd ..
100 $ cd ..
101
101
102 clone over http with --update
102 clone over http with --update
103
103
104 $ hg clone http://localhost:$HGPORT1/ updated --update 0
104 $ hg clone http://localhost:$HGPORT1/ updated --update 0
105 requesting all changes
105 requesting all changes
106 adding changesets
106 adding changesets
107 adding manifests
107 adding manifests
108 adding file changes
108 adding file changes
109 added 2 changesets with 5 changes to 5 files
109 added 2 changesets with 5 changes to 5 files
110 new changesets 8b6053c928fe:5fed3813f7f5
110 new changesets 8b6053c928fe:5fed3813f7f5
111 updating to branch default
111 updating to branch default
112 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
112 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 $ hg log -r . -R updated
113 $ hg log -r . -R updated
114 changeset: 0:8b6053c928fe
114 changeset: 0:8b6053c928fe
115 user: test
115 user: test
116 date: Thu Jan 01 00:00:00 1970 +0000
116 date: Thu Jan 01 00:00:00 1970 +0000
117 summary: 1
117 summary: 1
118
118
119 $ rm -rf updated
119 $ rm -rf updated
120
120
121 incoming via HTTP
121 incoming via HTTP
122
122
123 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
123 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 1 changesets with 4 changes to 4 files
127 added 1 changesets with 4 changes to 4 files
128 new changesets 8b6053c928fe
128 new changesets 8b6053c928fe
129 updating to branch default
129 updating to branch default
130 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 $ cd partial
131 $ cd partial
132 $ touch LOCAL
132 $ touch LOCAL
133 $ hg ci -qAm LOCAL
133 $ hg ci -qAm LOCAL
134 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
134 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
135 comparing with http://localhost:$HGPORT1/
135 comparing with http://localhost:$HGPORT1/
136 searching for changes
136 searching for changes
137 2
137 2
138 $ cd ..
138 $ cd ..
139
139
140 pull
140 pull
141
141
142 $ cd copy-pull
142 $ cd copy-pull
143 $ cat >> .hg/hgrc <<EOF
143 $ cat >> .hg/hgrc <<EOF
144 > [hooks]
144 > [hooks]
145 > changegroup = sh -c "printenv.py changegroup"
145 > changegroup = sh -c "printenv.py changegroup"
146 > EOF
146 > EOF
147 $ hg pull
147 $ hg pull
148 pulling from http://localhost:$HGPORT1/
148 pulling from http://localhost:$HGPORT1/
149 searching for changes
149 searching for changes
150 adding changesets
150 adding changesets
151 adding manifests
151 adding manifests
152 adding file changes
152 adding file changes
153 added 1 changesets with 1 changes to 1 files
153 added 1 changesets with 1 changes to 1 files
154 new changesets 5fed3813f7f5
154 new changesets 5fed3813f7f5
155 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/
155 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=http://localhost:$HGPORT1/
156 (run 'hg update' to get a working copy)
156 (run 'hg update' to get a working copy)
157 $ cd ..
157 $ cd ..
158
158
159 clone from invalid URL
159 clone from invalid URL
160
160
161 $ hg clone http://localhost:$HGPORT/bad
161 $ hg clone http://localhost:$HGPORT/bad
162 abort: HTTP Error 404: Not Found
162 abort: HTTP Error 404: Not Found
163 [255]
163 [255]
164
164
165 test http authentication
165 test http authentication
166 + use the same server to test server side streaming preference
166 + use the same server to test server side streaming preference
167
167
168 $ cd test
168 $ cd test
169 $ cat << EOT > userpass.py
169 $ cat << EOT > userpass.py
170 > import base64
170 > import base64
171 > from mercurial.hgweb import common
171 > from mercurial.hgweb import common
172 > def perform_authentication(hgweb, req, op):
172 > def perform_authentication(hgweb, req, op):
173 > auth = req.headers.get(b'Authorization')
173 > auth = req.headers.get(b'Authorization')
174 > if not auth:
174 > if not auth:
175 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
175 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
176 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
176 > [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
177 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
177 > if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
178 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
178 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
179 > def extsetup():
179 > def extsetup():
180 > common.permhooks.insert(0, perform_authentication)
180 > common.permhooks.insert(0, perform_authentication)
181 > EOT
181 > EOT
182 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
182 $ hg serve --config extensions.x=userpass.py -p $HGPORT2 -d --pid-file=pid \
183 > --config server.preferuncompressed=True \
183 > --config server.preferuncompressed=True \
184 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
184 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
185 $ cat pid >> $DAEMON_PIDS
185 $ cat pid >> $DAEMON_PIDS
186
186
187 $ cat << EOF > get_pass.py
187 $ cat << EOF > get_pass.py
188 > import getpass
188 > import getpass
189 > def newgetpass(arg):
189 > def newgetpass(arg):
190 > return "pass"
190 > return "pass"
191 > getpass.getpass = newgetpass
191 > getpass.getpass = newgetpass
192 > EOF
192 > EOF
193
193
194 $ hg id http://localhost:$HGPORT2/
194 $ hg id http://localhost:$HGPORT2/
195 abort: http authorization required for http://localhost:$HGPORT2/
195 abort: http authorization required for http://localhost:$HGPORT2/
196 [255]
196 [255]
197 $ hg id http://localhost:$HGPORT2/
197 $ hg id http://localhost:$HGPORT2/
198 abort: http authorization required for http://localhost:$HGPORT2/
198 abort: http authorization required for http://localhost:$HGPORT2/
199 [255]
199 [255]
200 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
200 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
201 http authorization required for http://localhost:$HGPORT2/
201 http authorization required for http://localhost:$HGPORT2/
202 realm: mercurial
202 realm: mercurial
203 user: user
203 user: user
204 password: 5fed3813f7f5
204 password: 5fed3813f7f5
205 $ hg id http://user:pass@localhost:$HGPORT2/
205 $ hg id http://user:pass@localhost:$HGPORT2/
206 5fed3813f7f5
206 5fed3813f7f5
207 $ echo '[auth]' >> .hg/hgrc
207 $ echo '[auth]' >> .hg/hgrc
208 $ echo 'l.schemes=http' >> .hg/hgrc
208 $ echo 'l.schemes=http' >> .hg/hgrc
209 $ echo 'l.prefix=lo' >> .hg/hgrc
209 $ echo 'l.prefix=lo' >> .hg/hgrc
210 $ echo 'l.username=user' >> .hg/hgrc
210 $ echo 'l.username=user' >> .hg/hgrc
211 $ echo 'l.password=pass' >> .hg/hgrc
211 $ echo 'l.password=pass' >> .hg/hgrc
212 $ hg id http://localhost:$HGPORT2/
212 $ hg id http://localhost:$HGPORT2/
213 5fed3813f7f5
213 5fed3813f7f5
214 $ hg id http://localhost:$HGPORT2/
214 $ hg id http://localhost:$HGPORT2/
215 5fed3813f7f5
215 5fed3813f7f5
216 $ hg id http://user@localhost:$HGPORT2/
216 $ hg id http://user@localhost:$HGPORT2/
217 5fed3813f7f5
217 5fed3813f7f5
218
218
219 #if no-reposimplestore
219 #if no-reposimplestore
220 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
220 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
221 streaming all changes
221 streaming all changes
222 7 files to transfer, 916 bytes of data
222 7 files to transfer, 916 bytes of data
223 transferred * bytes in * seconds (*/sec) (glob)
223 transferred * bytes in * seconds (*/sec) (glob)
224 searching for changes
224 searching for changes
225 no changes found
225 no changes found
226 updating to branch default
226 updating to branch default
227 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 #endif
228 #endif
229
229
230 --pull should override server's preferuncompressed
230 --pull should override server's preferuncompressed
231 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
231 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
232 requesting all changes
232 requesting all changes
233 adding changesets
233 adding changesets
234 adding manifests
234 adding manifests
235 adding file changes
235 adding file changes
236 added 2 changesets with 5 changes to 5 files
236 added 2 changesets with 5 changes to 5 files
237 new changesets 8b6053c928fe:5fed3813f7f5
237 new changesets 8b6053c928fe:5fed3813f7f5
238 updating to branch default
238 updating to branch default
239 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
240
240
241 $ hg id http://user2@localhost:$HGPORT2/
241 $ hg id http://user2@localhost:$HGPORT2/
242 abort: http authorization required for http://localhost:$HGPORT2/
242 abort: http authorization required for http://localhost:$HGPORT2/
243 [255]
243 [255]
244 $ hg id http://user:pass2@localhost:$HGPORT2/
244 $ hg id http://user:pass2@localhost:$HGPORT2/
245 abort: HTTP Error 403: no
245 abort: HTTP Error 403: no
246 [255]
246 [255]
247
247
248 $ hg -R dest-pull tag -r tip top
248 $ hg -R dest-pull tag -r tip top
249 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
249 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
250 pushing to http://user:***@localhost:$HGPORT2/
250 pushing to http://user:***@localhost:$HGPORT2/
251 searching for changes
251 searching for changes
252 remote: adding changesets
252 remote: adding changesets
253 remote: adding manifests
253 remote: adding manifests
254 remote: adding file changes
254 remote: adding file changes
255 remote: added 1 changesets with 1 changes to 1 files
255 remote: added 1 changesets with 1 changes to 1 files
256 $ hg rollback -q
256 $ hg rollback -q
257 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
257 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
258 pushing to http://user:***@localhost:$HGPORT2/
258 pushing to http://user:***@localhost:$HGPORT2/
259 using http://localhost:$HGPORT2/
259 using http://localhost:$HGPORT2/
260 http auth: user user, password ****
260 http auth: user user, password ****
261 sending capabilities command
261 sending capabilities command
262 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
262 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
263 http auth: user user, password ****
263 http auth: user user, password ****
264 devel-peer-request: finished in *.???? seconds (200) (glob)
264 devel-peer-request: finished in *.???? seconds (200) (glob)
265 query 1; heads
265 query 1; heads
266 devel-peer-request: batched-content
266 devel-peer-request: batched-content
267 devel-peer-request: - heads (0 arguments)
267 devel-peer-request: - heads (0 arguments)
268 devel-peer-request: - known (1 arguments)
268 devel-peer-request: - known (1 arguments)
269 sending batch command
269 sending batch command
270 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
270 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
271 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
271 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
272 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
272 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
273 devel-peer-request: 68 bytes of commands arguments in headers
273 devel-peer-request: 68 bytes of commands arguments in headers
274 devel-peer-request: finished in *.???? seconds (200) (glob)
274 devel-peer-request: finished in *.???? seconds (200) (glob)
275 searching for changes
275 searching for changes
276 all remote heads known locally
276 all remote heads known locally
277 preparing listkeys for "phases"
277 preparing listkeys for "phases"
278 sending listkeys command
278 sending listkeys command
279 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
279 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
280 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
280 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
281 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
282 devel-peer-request: 16 bytes of commands arguments in headers
282 devel-peer-request: 16 bytes of commands arguments in headers
283 devel-peer-request: finished in *.???? seconds (200) (glob)
283 devel-peer-request: finished in *.???? seconds (200) (glob)
284 received listkey for "phases": 58 bytes
284 received listkey for "phases": 58 bytes
285 checking for updated bookmarks
285 checking for updated bookmarks
286 preparing listkeys for "bookmarks"
286 preparing listkeys for "bookmarks"
287 sending listkeys command
287 sending listkeys command
288 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
288 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
289 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
289 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
290 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
290 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
291 devel-peer-request: 19 bytes of commands arguments in headers
291 devel-peer-request: 19 bytes of commands arguments in headers
292 devel-peer-request: finished in *.???? seconds (200) (glob)
292 devel-peer-request: finished in *.???? seconds (200) (glob)
293 received listkey for "bookmarks": 0 bytes
293 received listkey for "bookmarks": 0 bytes
294 sending branchmap command
294 sending branchmap command
295 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
295 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
296 devel-peer-request: Vary X-HgProto-1
296 devel-peer-request: Vary X-HgProto-1
297 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
297 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
298 devel-peer-request: finished in *.???? seconds (200) (glob)
298 devel-peer-request: finished in *.???? seconds (200) (glob)
299 preparing listkeys for "bookmarks"
299 preparing listkeys for "bookmarks"
300 sending listkeys command
300 sending listkeys command
301 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
301 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
302 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
302 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
303 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
303 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
304 devel-peer-request: 19 bytes of commands arguments in headers
304 devel-peer-request: 19 bytes of commands arguments in headers
305 devel-peer-request: finished in *.???? seconds (200) (glob)
305 devel-peer-request: finished in *.???? seconds (200) (glob)
306 received listkey for "bookmarks": 0 bytes
306 received listkey for "bookmarks": 0 bytes
307 1 changesets found
307 1 changesets found
308 list of changesets:
308 list of changesets:
309 7f4e523d01f2cc3765ac8934da3d14db775ff872
309 7f4e523d01f2cc3765ac8934da3d14db775ff872
310 bundle2-output-bundle: "HG20", 5 parts total
310 bundle2-output-bundle: "HG20", 5 parts total
311 bundle2-output-part: "replycaps" 205 bytes payload
311 bundle2-output-part: "replycaps" 205 bytes payload
312 bundle2-output-part: "check:phases" 24 bytes payload
312 bundle2-output-part: "check:phases" 24 bytes payload
313 bundle2-output-part: "check:heads" streamed payload
313 bundle2-output-part: "check:heads" streamed payload
314 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
314 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
315 bundle2-output-part: "phase-heads" 24 bytes payload
315 bundle2-output-part: "phase-heads" 24 bytes payload
316 sending unbundle command
316 sending unbundle command
317 sending 1013 bytes
317 sending 1013 bytes
318 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
318 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
319 devel-peer-request: Content-length 1013
319 devel-peer-request: Content-length 1013
320 devel-peer-request: Content-type application/mercurial-0.1
320 devel-peer-request: Content-type application/mercurial-0.1
321 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
321 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
322 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
322 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
323 devel-peer-request: 16 bytes of commands arguments in headers
323 devel-peer-request: 16 bytes of commands arguments in headers
324 devel-peer-request: 1013 bytes of data
324 devel-peer-request: 1013 bytes of data
325 devel-peer-request: finished in *.???? seconds (200) (glob)
325 devel-peer-request: finished in *.???? seconds (200) (glob)
326 bundle2-input-bundle: no-transaction
326 bundle2-input-bundle: no-transaction
327 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
327 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
328 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
328 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
329 bundle2-input-part: total payload size 100
329 bundle2-input-part: total payload size 100
330 remote: adding changesets
330 remote: adding changesets
331 remote: adding manifests
331 remote: adding manifests
332 remote: adding file changes
332 remote: adding file changes
333 remote: added 1 changesets with 1 changes to 1 files
333 remote: added 1 changesets with 1 changes to 1 files
334 bundle2-input-part: "output" (advisory) supported
334 bundle2-input-part: "output" (advisory) supported
335 bundle2-input-bundle: 2 parts total
335 bundle2-input-bundle: 2 parts total
336 preparing listkeys for "phases"
336 preparing listkeys for "phases"
337 sending listkeys command
337 sending listkeys command
338 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
338 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
339 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
339 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
340 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
340 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
341 devel-peer-request: 16 bytes of commands arguments in headers
341 devel-peer-request: 16 bytes of commands arguments in headers
342 devel-peer-request: finished in *.???? seconds (200) (glob)
342 devel-peer-request: finished in *.???? seconds (200) (glob)
343 received listkey for "phases": 15 bytes
343 received listkey for "phases": 15 bytes
344 $ hg rollback -q
344 $ hg rollback -q
345
345
346 $ sed 's/.*] "/"/' < ../access.log
346 $ sed 's/.*] "/"/' < ../access.log
347 "GET /?cmd=capabilities HTTP/1.1" 401 -
347 "GET /?cmd=capabilities HTTP/1.1" 401 -
348 "GET /?cmd=capabilities HTTP/1.1" 401 -
348 "GET /?cmd=capabilities HTTP/1.1" 401 -
349 "GET /?cmd=capabilities HTTP/1.1" 401 -
349 "GET /?cmd=capabilities HTTP/1.1" 401 -
350 "GET /?cmd=capabilities HTTP/1.1" 200 -
350 "GET /?cmd=capabilities HTTP/1.1" 200 -
351 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
351 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
352 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
352 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
353 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
353 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
354 "GET /?cmd=capabilities HTTP/1.1" 401 -
354 "GET /?cmd=capabilities HTTP/1.1" 401 -
355 "GET /?cmd=capabilities HTTP/1.1" 200 -
355 "GET /?cmd=capabilities HTTP/1.1" 200 -
356 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
356 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
357 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
357 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
358 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
358 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
359 "GET /?cmd=capabilities HTTP/1.1" 401 -
359 "GET /?cmd=capabilities HTTP/1.1" 401 -
360 "GET /?cmd=capabilities HTTP/1.1" 200 -
360 "GET /?cmd=capabilities HTTP/1.1" 200 -
361 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
361 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
362 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
362 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
363 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
363 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
364 "GET /?cmd=capabilities HTTP/1.1" 401 -
364 "GET /?cmd=capabilities HTTP/1.1" 401 -
365 "GET /?cmd=capabilities HTTP/1.1" 200 -
365 "GET /?cmd=capabilities HTTP/1.1" 200 -
366 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
366 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
367 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
367 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
368 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
368 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
369 "GET /?cmd=capabilities HTTP/1.1" 401 -
369 "GET /?cmd=capabilities HTTP/1.1" 401 -
370 "GET /?cmd=capabilities HTTP/1.1" 200 -
370 "GET /?cmd=capabilities HTTP/1.1" 200 -
371 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
371 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
372 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
372 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
373 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
373 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
374 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
374 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
375 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
375 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
376 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
376 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
377 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
377 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
378 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
378 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
379 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
379 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
380 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
380 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
381 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
381 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
382 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
382 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
383 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
383 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
384 "GET /?cmd=capabilities HTTP/1.1" 401 -
384 "GET /?cmd=capabilities HTTP/1.1" 401 -
385 "GET /?cmd=capabilities HTTP/1.1" 401 -
385 "GET /?cmd=capabilities HTTP/1.1" 401 -
386 "GET /?cmd=capabilities HTTP/1.1" 403 -
386 "GET /?cmd=capabilities HTTP/1.1" 403 -
387 "GET /?cmd=capabilities HTTP/1.1" 401 -
387 "GET /?cmd=capabilities HTTP/1.1" 401 -
388 "GET /?cmd=capabilities HTTP/1.1" 200 -
388 "GET /?cmd=capabilities HTTP/1.1" 200 -
389 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
389 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
390 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
390 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
392 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
392 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
393 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
393 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
394 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
394 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
395 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
395 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
396 "GET /?cmd=capabilities HTTP/1.1" 401 -
396 "GET /?cmd=capabilities HTTP/1.1" 401 -
397 "GET /?cmd=capabilities HTTP/1.1" 200 -
397 "GET /?cmd=capabilities HTTP/1.1" 200 -
398 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
398 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
399 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
399 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
400 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
400 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
401 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
401 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
402 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
402 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
403 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
403 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
404 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
404 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
405
405
406 $ cd ..
406 $ cd ..
407
407
408 clone of serve with repo in root and unserved subrepo (issue2970)
408 clone of serve with repo in root and unserved subrepo (issue2970)
409
409
410 $ hg --cwd test init sub
410 $ hg --cwd test init sub
411 $ echo empty > test/sub/empty
411 $ echo empty > test/sub/empty
412 $ hg --cwd test/sub add empty
412 $ hg --cwd test/sub add empty
413 $ hg --cwd test/sub commit -qm 'add empty'
413 $ hg --cwd test/sub commit -qm 'add empty'
414 $ hg --cwd test/sub tag -r 0 something
414 $ hg --cwd test/sub tag -r 0 something
415 $ echo sub = sub > test/.hgsub
415 $ echo sub = sub > test/.hgsub
416 $ hg --cwd test add .hgsub
416 $ hg --cwd test add .hgsub
417 $ hg --cwd test commit -qm 'add subrepo'
417 $ hg --cwd test commit -qm 'add subrepo'
418 $ hg clone http://localhost:$HGPORT noslash-clone
418 $ hg clone http://localhost:$HGPORT noslash-clone
419 requesting all changes
419 requesting all changes
420 adding changesets
420 adding changesets
421 adding manifests
421 adding manifests
422 adding file changes
422 adding file changes
423 added 3 changesets with 7 changes to 7 files
423 added 3 changesets with 7 changes to 7 files
424 new changesets 8b6053c928fe:56f9bc90cce6
424 new changesets 8b6053c928fe:56f9bc90cce6
425 updating to branch default
425 updating to branch default
426 abort: HTTP Error 404: Not Found
426 abort: HTTP Error 404: Not Found
427 [255]
427 [255]
428 $ hg clone http://localhost:$HGPORT/ slash-clone
428 $ hg clone http://localhost:$HGPORT/ slash-clone
429 requesting all changes
429 requesting all changes
430 adding changesets
430 adding changesets
431 adding manifests
431 adding manifests
432 adding file changes
432 adding file changes
433 added 3 changesets with 7 changes to 7 files
433 added 3 changesets with 7 changes to 7 files
434 new changesets 8b6053c928fe:56f9bc90cce6
434 new changesets 8b6053c928fe:56f9bc90cce6
435 updating to branch default
435 updating to branch default
436 abort: HTTP Error 404: Not Found
436 abort: HTTP Error 404: Not Found
437 [255]
437 [255]
438
438
439 check error log
439 check error log
440
440
441 $ cat error.log
441 $ cat error.log
442
442
443 check abort error reporting while pulling/cloning
443 check abort error reporting while pulling/cloning
444
444
445 $ $RUNTESTDIR/killdaemons.py
445 $ $RUNTESTDIR/killdaemons.py
446 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
446 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
447 $ cat hg3.pid >> $DAEMON_PIDS
447 $ cat hg3.pid >> $DAEMON_PIDS
448 $ hg clone http://localhost:$HGPORT/ abort-clone
448 $ hg clone http://localhost:$HGPORT/ abort-clone
449 requesting all changes
449 requesting all changes
450 remote: abort: this is an exercise
450 remote: abort: this is an exercise
451 abort: pull failed on remote
451 abort: pull failed on remote
452 [255]
452 [255]
453 $ cat error.log
453 $ cat error.log
454
454
455 disable pull-based clones
455 disable pull-based clones
456
456
457 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
457 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
458 $ cat hg4.pid >> $DAEMON_PIDS
458 $ cat hg4.pid >> $DAEMON_PIDS
459 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
459 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
460 requesting all changes
460 requesting all changes
461 remote: abort: server has pull-based clones disabled
461 remote: abort: server has pull-based clones disabled
462 abort: pull failed on remote
462 abort: pull failed on remote
463 (remove --pull if specified or upgrade Mercurial)
463 (remove --pull if specified or upgrade Mercurial)
464 [255]
464 [255]
465
465
466 #if no-reposimplestore
466 #if no-reposimplestore
467 ... but keep stream clones working
467 ... but keep stream clones working
468
468
469 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
469 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
470 streaming all changes
470 streaming all changes
471 * files to transfer, * of data (glob)
471 * files to transfer, * of data (glob)
472 transferred * in * seconds (*/sec) (glob)
472 transferred * in * seconds (*/sec) (glob)
473 searching for changes
473 searching for changes
474 no changes found
474 no changes found
475 $ cat error.log
475 $ cat error.log
476 #endif
476 #endif
477
477
478 ... and also keep partial clones and pulls working
478 ... and also keep partial clones and pulls working
479 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
479 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
480 adding changesets
480 adding changesets
481 adding manifests
481 adding manifests
482 adding file changes
482 adding file changes
483 added 1 changesets with 4 changes to 4 files
483 added 1 changesets with 4 changes to 4 files
484 new changesets 8b6053c928fe
484 new changesets 8b6053c928fe
485 updating to branch default
485 updating to branch default
486 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 $ hg pull -R test/partial/clone
487 $ hg pull -R test/partial/clone
488 pulling from http://localhost:$HGPORT1/
488 pulling from http://localhost:$HGPORT1/
489 searching for changes
489 searching for changes
490 adding changesets
490 adding changesets
491 adding manifests
491 adding manifests
492 adding file changes
492 adding file changes
493 added 2 changesets with 3 changes to 3 files
493 added 2 changesets with 3 changes to 3 files
494 new changesets 5fed3813f7f5:56f9bc90cce6
494 new changesets 5fed3813f7f5:56f9bc90cce6
495 (run 'hg update' to get a working copy)
495 (run 'hg update' to get a working copy)
496
496
497 $ hg clone -U -r 0 test/partial/clone test/another/clone
497 $ hg clone -U -r 0 test/partial/clone test/another/clone
498 adding changesets
498 adding changesets
499 adding manifests
499 adding manifests
500 adding file changes
500 adding file changes
501 added 1 changesets with 4 changes to 4 files
501 added 1 changesets with 4 changes to 4 files
502 new changesets 8b6053c928fe
502 new changesets 8b6053c928fe
503
503
504 corrupt cookies file should yield a warning
504 corrupt cookies file should yield a warning
505
505
506 $ cat > $TESTTMP/cookies.txt << EOF
506 $ cat > $TESTTMP/cookies.txt << EOF
507 > bad format
507 > bad format
508 > EOF
508 > EOF
509
509
510 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
510 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
511 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
511 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
512 56f9bc90cce6
512 56f9bc90cce6
513
513
514 $ killdaemons.py
514 $ killdaemons.py
515
515
516 Create dummy authentication handler that looks for cookies. It doesn't do anything
516 Create dummy authentication handler that looks for cookies. It doesn't do anything
517 useful. It just raises an HTTP 500 with details about the Cookie request header.
517 useful. It just raises an HTTP 500 with details about the Cookie request header.
518 We raise HTTP 500 because its message is printed in the abort message.
518 We raise HTTP 500 because its message is printed in the abort message.
519
519
520 $ cat > cookieauth.py << EOF
520 $ cat > cookieauth.py << EOF
521 > from mercurial import util
521 > from mercurial import util
522 > from mercurial.hgweb import common
522 > from mercurial.hgweb import common
523 > def perform_authentication(hgweb, req, op):
523 > def perform_authentication(hgweb, req, op):
524 > cookie = req.headers.get(b'Cookie')
524 > cookie = req.headers.get(b'Cookie')
525 > if not cookie:
525 > if not cookie:
526 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
526 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
527 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
527 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
528 > def extsetup():
528 > def extsetup():
529 > common.permhooks.insert(0, perform_authentication)
529 > common.permhooks.insert(0, perform_authentication)
530 > EOF
530 > EOF
531
531
532 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
532 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
533 $ cat pid > $DAEMON_PIDS
533 $ cat pid > $DAEMON_PIDS
534
534
535 Request without cookie sent should fail due to lack of cookie
535 Request without cookie sent should fail due to lack of cookie
536
536
537 $ hg id http://localhost:$HGPORT
537 $ hg id http://localhost:$HGPORT
538 abort: HTTP Error 500: no-cookie
538 abort: HTTP Error 500: no-cookie
539 [255]
539 [255]
540
540
541 Populate a cookies file
541 Populate a cookies file
542
542
543 $ cat > cookies.txt << EOF
543 $ cat > cookies.txt << EOF
544 > # HTTP Cookie File
544 > # HTTP Cookie File
545 > # Expiration is 2030-01-01 at midnight
545 > # Expiration is 2030-01-01 at midnight
546 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
546 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
547 > EOF
547 > EOF
548
548
549 Should not send a cookie for another domain
549 Should not send a cookie for another domain
550
550
551 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
551 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
552 abort: HTTP Error 500: no-cookie
552 abort: HTTP Error 500: no-cookie
553 [255]
553 [255]
554
554
555 Add a cookie entry for our test server and verify it is sent
555 Add a cookie entry for our test server and verify it is sent
556
556
557 $ cat >> cookies.txt << EOF
557 $ cat >> cookies.txt << EOF
558 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
558 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
559 > EOF
559 > EOF
560
560
561 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
561 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
562 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
562 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
563 [255]
563 [255]
@@ -1,666 +1,666 b''
1 #require serve ssl
1 #require serve ssl
2
2
3 Proper https client requires the built-in ssl from Python 2.6.
3 Proper https client requires the built-in ssl from Python 2.6.
4
4
5 Make server certificates:
5 Make server certificates:
6
6
7 $ CERTSDIR="$TESTDIR/sslcerts"
7 $ CERTSDIR="$TESTDIR/sslcerts"
8 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem
8 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem
9 $ PRIV=`pwd`/server.pem
9 $ PRIV=`pwd`/server.pem
10 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem
10 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-not-yet.pem" > server-not-yet.pem
11 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem
11 $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub-expired.pem" > server-expired.pem
12
12
13 $ hg init test
13 $ hg init test
14 $ cd test
14 $ cd test
15 $ echo foo>foo
15 $ echo foo>foo
16 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
16 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
17 $ echo foo>foo.d/foo
17 $ echo foo>foo.d/foo
18 $ echo bar>foo.d/bAr.hg.d/BaR
18 $ echo bar>foo.d/bAr.hg.d/BaR
19 $ echo bar>foo.d/baR.d.hg/bAR
19 $ echo bar>foo.d/baR.d.hg/bAR
20 $ hg commit -A -m 1
20 $ hg commit -A -m 1
21 adding foo
21 adding foo
22 adding foo.d/bAr.hg.d/BaR
22 adding foo.d/bAr.hg.d/BaR
23 adding foo.d/baR.d.hg/bAR
23 adding foo.d/baR.d.hg/bAR
24 adding foo.d/foo
24 adding foo.d/foo
25 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV
25 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV
26 $ cat ../hg0.pid >> $DAEMON_PIDS
26 $ cat ../hg0.pid >> $DAEMON_PIDS
27
27
28 cacert not found
28 cacert not found
29
29
30 $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
30 $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
31 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
31 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
32 abort: could not find web.cacerts: no-such.pem
32 abort: could not find web.cacerts: no-such.pem
33 [255]
33 [255]
34
34
35 Test server address cannot be reused
35 Test server address cannot be reused
36
36
37 $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
37 $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
38 abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$
38 abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$
39 [255]
39 [255]
40
40
41 $ cd ..
41 $ cd ..
42
42
43 Our test cert is not signed by a trusted CA. It should fail to verify if
43 Our test cert is not signed by a trusted CA. It should fail to verify if
44 we are able to load CA certs.
44 we are able to load CA certs.
45
45
46 #if sslcontext defaultcacerts no-defaultcacertsloaded
46 #if sslcontext defaultcacerts no-defaultcacertsloaded
47 $ hg clone https://localhost:$HGPORT/ copy-pull
47 $ hg clone https://localhost:$HGPORT/ copy-pull
48 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
48 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
49 abort: error: *certificate verify failed* (glob)
49 abort: error: *certificate verify failed* (glob)
50 [255]
50 [255]
51 #endif
51 #endif
52
52
53 #if no-sslcontext defaultcacerts
53 #if no-sslcontext defaultcacerts
54 $ hg clone https://localhost:$HGPORT/ copy-pull
54 $ hg clone https://localhost:$HGPORT/ copy-pull
55 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
55 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
56 (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?)
56 (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?)
57 abort: error: *certificate verify failed* (glob)
57 abort: error: *certificate verify failed* (glob)
58 [255]
58 [255]
59 #endif
59 #endif
60
60
61 #if no-sslcontext windows
61 #if no-sslcontext windows
62 $ hg clone https://localhost:$HGPORT/ copy-pull
62 $ hg clone https://localhost:$HGPORT/ copy-pull
63 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
63 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
64 (unable to load Windows CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message)
64 (unable to load Windows CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message)
65 abort: error: *certificate verify failed* (glob)
65 abort: error: *certificate verify failed* (glob)
66 [255]
66 [255]
67 #endif
67 #endif
68
68
69 #if no-sslcontext osx
69 #if no-sslcontext osx
70 $ hg clone https://localhost:$HGPORT/ copy-pull
70 $ hg clone https://localhost:$HGPORT/ copy-pull
71 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
71 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
72 (unable to load CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message)
72 (unable to load CA certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message)
73 abort: localhost certificate error: no certificate received
73 abort: localhost certificate error: no certificate received
74 (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
74 (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
75 [255]
75 [255]
76 #endif
76 #endif
77
77
78 #if defaultcacertsloaded
78 #if defaultcacertsloaded
79 $ hg clone https://localhost:$HGPORT/ copy-pull
79 $ hg clone https://localhost:$HGPORT/ copy-pull
80 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
80 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
81 (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?)
81 (using CA certificates from *; if you see this message, your Mercurial install is not properly configured; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?)
82 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
82 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
83 abort: error: *certificate verify failed* (glob)
83 abort: error: *certificate verify failed* (glob)
84 [255]
84 [255]
85 #endif
85 #endif
86
86
87 #if no-defaultcacerts
87 #if no-defaultcacerts
88 $ hg clone https://localhost:$HGPORT/ copy-pull
88 $ hg clone https://localhost:$HGPORT/ copy-pull
89 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
89 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
90 (unable to load * certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?)
90 (unable to load * certificates; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this message) (glob) (?)
91 abort: localhost certificate error: no certificate received
91 abort: localhost certificate error: no certificate received
92 (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
92 (set hostsecurity.localhost:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
93 [255]
93 [255]
94 #endif
94 #endif
95
95
96 Specifying a per-host certificate file that doesn't exist will abort. The full
96 Specifying a per-host certificate file that doesn't exist will abort. The full
97 C:/path/to/msysroot will print on Windows.
97 C:/path/to/msysroot will print on Windows.
98
98
99 $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/
99 $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist clone https://localhost:$HGPORT/
100 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
100 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
101 abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: */does/not/exist (glob)
101 abort: path specified by hostsecurity.localhost:verifycertsfile does not exist: */does/not/exist (glob)
102 [255]
102 [255]
103
103
104 A malformed per-host certificate file will raise an error
104 A malformed per-host certificate file will raise an error
105
105
106 $ echo baddata > badca.pem
106 $ echo baddata > badca.pem
107 #if sslcontext
107 #if sslcontext
108 $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
108 $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
109 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
109 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
110 abort: error loading CA file badca.pem: * (glob)
110 abort: error loading CA file badca.pem: * (glob)
111 (file is empty or malformed?)
111 (file is empty or malformed?)
112 [255]
112 [255]
113 #else
113 #else
114 $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
114 $ hg --config hostsecurity.localhost:verifycertsfile=badca.pem clone https://localhost:$HGPORT/
115 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
115 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
116 abort: error: * (glob)
116 abort: error: * (glob)
117 [255]
117 [255]
118 #endif
118 #endif
119
119
120 A per-host certificate mismatching the server will fail verification
120 A per-host certificate mismatching the server will fail verification
121
121
122 (modern ssl is able to discern whether the loaded cert is a CA cert)
122 (modern ssl is able to discern whether the loaded cert is a CA cert)
123 #if sslcontext
123 #if sslcontext
124 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
124 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
125 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
125 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
126 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
126 (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error)
127 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
127 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
128 abort: error: *certificate verify failed* (glob)
128 abort: error: *certificate verify failed* (glob)
129 [255]
129 [255]
130 #else
130 #else
131 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
131 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/client-cert.pem" clone https://localhost:$HGPORT/
132 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
132 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
133 abort: error: *certificate verify failed* (glob)
133 abort: error: *certificate verify failed* (glob)
134 [255]
134 [255]
135 #endif
135 #endif
136
136
137 A per-host certificate matching the server's cert will be accepted
137 A per-host certificate matching the server's cert will be accepted
138
138
139 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1
139 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" clone -U https://localhost:$HGPORT/ perhostgood1
140 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
140 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
141 requesting all changes
141 requesting all changes
142 adding changesets
142 adding changesets
143 adding manifests
143 adding manifests
144 adding file changes
144 adding file changes
145 added 1 changesets with 4 changes to 4 files
145 added 1 changesets with 4 changes to 4 files
146 new changesets 8b6053c928fe
146 new changesets 8b6053c928fe
147
147
148 A per-host certificate with multiple certs and one matching will be accepted
148 A per-host certificate with multiple certs and one matching will be accepted
149
149
150 $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem
150 $ cat "$CERTSDIR/client-cert.pem" "$CERTSDIR/pub.pem" > perhost.pem
151 $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2
151 $ hg --config hostsecurity.localhost:verifycertsfile=perhost.pem clone -U https://localhost:$HGPORT/ perhostgood2
152 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
152 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
153 requesting all changes
153 requesting all changes
154 adding changesets
154 adding changesets
155 adding manifests
155 adding manifests
156 adding file changes
156 adding file changes
157 added 1 changesets with 4 changes to 4 files
157 added 1 changesets with 4 changes to 4 files
158 new changesets 8b6053c928fe
158 new changesets 8b6053c928fe
159
159
160 Defining both per-host certificate and a fingerprint will print a warning
160 Defining both per-host certificate and a fingerprint will print a warning
161
161
162 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning
162 $ hg --config hostsecurity.localhost:verifycertsfile="$CERTSDIR/pub.pem" --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 clone -U https://localhost:$HGPORT/ caandfingerwarning
163 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
163 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
164 (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification)
164 (hostsecurity.localhost:verifycertsfile ignored when host fingerprints defined; using host fingerprints for verification)
165 requesting all changes
165 requesting all changes
166 adding changesets
166 adding changesets
167 adding manifests
167 adding manifests
168 adding file changes
168 adding file changes
169 added 1 changesets with 4 changes to 4 files
169 added 1 changesets with 4 changes to 4 files
170 new changesets 8b6053c928fe
170 new changesets 8b6053c928fe
171
171
172 $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true"
172 $ DISABLECACERTS="--config devel.disableloaddefaultcerts=true"
173
173
174 Inability to verify peer certificate will result in abort
174 Inability to verify peer certificate will result in abort
175
175
176 $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS
176 $ hg clone https://localhost:$HGPORT/ copy-pull $DISABLECACERTS
177 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
177 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
178 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
178 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
179 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
179 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
180 [255]
180 [255]
181
181
182 $ hg clone --insecure https://localhost:$HGPORT/ copy-pull
182 $ hg clone --insecure https://localhost:$HGPORT/ copy-pull
183 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
183 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
184 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
184 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
185 requesting all changes
185 requesting all changes
186 adding changesets
186 adding changesets
187 adding manifests
187 adding manifests
188 adding file changes
188 adding file changes
189 added 1 changesets with 4 changes to 4 files
189 added 1 changesets with 4 changes to 4 files
190 new changesets 8b6053c928fe
190 new changesets 8b6053c928fe
191 updating to branch default
191 updating to branch default
192 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 $ hg verify -R copy-pull
193 $ hg verify -R copy-pull
194 checking changesets
194 checking changesets
195 checking manifests
195 checking manifests
196 crosschecking files in changesets and manifests
196 crosschecking files in changesets and manifests
197 checking files
197 checking files
198 4 files, 1 changesets, 4 total revisions
198 checked 1 changesets with 4 changes to 4 files
199 $ cd test
199 $ cd test
200 $ echo bar > bar
200 $ echo bar > bar
201 $ hg commit -A -d '1 0' -m 2
201 $ hg commit -A -d '1 0' -m 2
202 adding bar
202 adding bar
203 $ cd ..
203 $ cd ..
204
204
205 pull without cacert
205 pull without cacert
206
206
207 $ cd copy-pull
207 $ cd copy-pull
208 $ cat >> .hg/hgrc <<EOF
208 $ cat >> .hg/hgrc <<EOF
209 > [hooks]
209 > [hooks]
210 > changegroup = sh -c "printenv.py changegroup"
210 > changegroup = sh -c "printenv.py changegroup"
211 > EOF
211 > EOF
212 $ hg pull $DISABLECACERTS
212 $ hg pull $DISABLECACERTS
213 pulling from https://localhost:$HGPORT/
213 pulling from https://localhost:$HGPORT/
214 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
214 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
215 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
215 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
216 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
216 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)
217 [255]
217 [255]
218
218
219 $ hg pull --insecure
219 $ hg pull --insecure
220 pulling from https://localhost:$HGPORT/
220 pulling from https://localhost:$HGPORT/
221 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
221 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
222 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
222 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
223 searching for changes
223 searching for changes
224 adding changesets
224 adding changesets
225 adding manifests
225 adding manifests
226 adding file changes
226 adding file changes
227 added 1 changesets with 1 changes to 1 files
227 added 1 changesets with 1 changes to 1 files
228 new changesets 5fed3813f7f5
228 new changesets 5fed3813f7f5
229 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=https://localhost:$HGPORT/
229 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=https://localhost:$HGPORT/
230 (run 'hg update' to get a working copy)
230 (run 'hg update' to get a working copy)
231 $ cd ..
231 $ cd ..
232
232
233 cacert configured in local repo
233 cacert configured in local repo
234
234
235 $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu
235 $ cp copy-pull/.hg/hgrc copy-pull/.hg/hgrc.bu
236 $ echo "[web]" >> copy-pull/.hg/hgrc
236 $ echo "[web]" >> copy-pull/.hg/hgrc
237 $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc
237 $ echo "cacerts=$CERTSDIR/pub.pem" >> copy-pull/.hg/hgrc
238 $ hg -R copy-pull pull
238 $ hg -R copy-pull pull
239 pulling from https://localhost:$HGPORT/
239 pulling from https://localhost:$HGPORT/
240 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
240 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
241 searching for changes
241 searching for changes
242 no changes found
242 no changes found
243 $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc
243 $ mv copy-pull/.hg/hgrc.bu copy-pull/.hg/hgrc
244
244
245 cacert configured globally, also testing expansion of environment
245 cacert configured globally, also testing expansion of environment
246 variables in the filename
246 variables in the filename
247
247
248 $ echo "[web]" >> $HGRCPATH
248 $ echo "[web]" >> $HGRCPATH
249 $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH
249 $ echo 'cacerts=$P/pub.pem' >> $HGRCPATH
250 $ P="$CERTSDIR" hg -R copy-pull pull
250 $ P="$CERTSDIR" hg -R copy-pull pull
251 pulling from https://localhost:$HGPORT/
251 pulling from https://localhost:$HGPORT/
252 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
252 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
253 searching for changes
253 searching for changes
254 no changes found
254 no changes found
255 $ P="$CERTSDIR" hg -R copy-pull pull --insecure
255 $ P="$CERTSDIR" hg -R copy-pull pull --insecure
256 pulling from https://localhost:$HGPORT/
256 pulling from https://localhost:$HGPORT/
257 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
257 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
258 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
258 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
259 searching for changes
259 searching for changes
260 no changes found
260 no changes found
261
261
262 empty cacert file
262 empty cacert file
263
263
264 $ touch emptycafile
264 $ touch emptycafile
265
265
266 #if sslcontext
266 #if sslcontext
267 $ hg --config web.cacerts=emptycafile -R copy-pull pull
267 $ hg --config web.cacerts=emptycafile -R copy-pull pull
268 pulling from https://localhost:$HGPORT/
268 pulling from https://localhost:$HGPORT/
269 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
269 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
270 abort: error loading CA file emptycafile: * (glob)
270 abort: error loading CA file emptycafile: * (glob)
271 (file is empty or malformed?)
271 (file is empty or malformed?)
272 [255]
272 [255]
273 #else
273 #else
274 $ hg --config web.cacerts=emptycafile -R copy-pull pull
274 $ hg --config web.cacerts=emptycafile -R copy-pull pull
275 pulling from https://localhost:$HGPORT/
275 pulling from https://localhost:$HGPORT/
276 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
276 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
277 abort: error: * (glob)
277 abort: error: * (glob)
278 [255]
278 [255]
279 #endif
279 #endif
280
280
281 cacert mismatch
281 cacert mismatch
282
282
283 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
283 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
284 > https://$LOCALIP:$HGPORT/
284 > https://$LOCALIP:$HGPORT/
285 pulling from https://*:$HGPORT/ (glob)
285 pulling from https://*:$HGPORT/ (glob)
286 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
286 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
287 abort: $LOCALIP certificate error: certificate is for localhost (glob)
287 abort: $LOCALIP certificate error: certificate is for localhost (glob)
288 (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
288 (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
289 [255]
289 [255]
290 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
290 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
291 > https://$LOCALIP:$HGPORT/ --insecure
291 > https://$LOCALIP:$HGPORT/ --insecure
292 pulling from https://*:$HGPORT/ (glob)
292 pulling from https://*:$HGPORT/ (glob)
293 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
293 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
294 warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering (glob)
294 warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering (glob)
295 searching for changes
295 searching for changes
296 no changes found
296 no changes found
297 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem"
297 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem"
298 pulling from https://localhost:$HGPORT/
298 pulling from https://localhost:$HGPORT/
299 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
299 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
300 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
300 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
301 abort: error: *certificate verify failed* (glob)
301 abort: error: *certificate verify failed* (glob)
302 [255]
302 [255]
303 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \
303 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-other.pem" \
304 > --insecure
304 > --insecure
305 pulling from https://localhost:$HGPORT/
305 pulling from https://localhost:$HGPORT/
306 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
306 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
307 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
307 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
308 searching for changes
308 searching for changes
309 no changes found
309 no changes found
310
310
311 Test server cert which isn't valid yet
311 Test server cert which isn't valid yet
312
312
313 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem
313 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg1.pid --certificate=server-not-yet.pem
314 $ cat hg1.pid >> $DAEMON_PIDS
314 $ cat hg1.pid >> $DAEMON_PIDS
315 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \
315 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-not-yet.pem" \
316 > https://localhost:$HGPORT1/
316 > https://localhost:$HGPORT1/
317 pulling from https://localhost:$HGPORT1/
317 pulling from https://localhost:$HGPORT1/
318 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
318 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
319 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
319 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
320 abort: error: *certificate verify failed* (glob)
320 abort: error: *certificate verify failed* (glob)
321 [255]
321 [255]
322
322
323 Test server cert which no longer is valid
323 Test server cert which no longer is valid
324
324
325 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
325 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
326 $ cat hg2.pid >> $DAEMON_PIDS
326 $ cat hg2.pid >> $DAEMON_PIDS
327 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \
327 $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub-expired.pem" \
328 > https://localhost:$HGPORT2/
328 > https://localhost:$HGPORT2/
329 pulling from https://localhost:$HGPORT2/
329 pulling from https://localhost:$HGPORT2/
330 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
330 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
331 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
331 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
332 abort: error: *certificate verify failed* (glob)
332 abort: error: *certificate verify failed* (glob)
333 [255]
333 [255]
334
334
335 Disabling the TLS 1.0 warning works
335 Disabling the TLS 1.0 warning works
336 $ hg -R copy-pull id https://localhost:$HGPORT/ \
336 $ hg -R copy-pull id https://localhost:$HGPORT/ \
337 > --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 \
337 > --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 \
338 > --config hostsecurity.disabletls10warning=true
338 > --config hostsecurity.disabletls10warning=true
339 5fed3813f7f5
339 5fed3813f7f5
340
340
341 Error message for setting ciphers is different depending on SSLContext support
341 Error message for setting ciphers is different depending on SSLContext support
342
342
343 #if no-sslcontext
343 #if no-sslcontext
344 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
344 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
345 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
345 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
346 abort: *No cipher can be selected. (glob)
346 abort: *No cipher can be selected. (glob)
347 [255]
347 [255]
348
348
349 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/
349 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/
350 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
350 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info
351 5fed3813f7f5
351 5fed3813f7f5
352 #endif
352 #endif
353
353
354 #if sslcontext
354 #if sslcontext
355 Setting ciphers to an invalid value aborts
355 Setting ciphers to an invalid value aborts
356 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
356 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
357 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
357 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
358 abort: could not set ciphers: No cipher can be selected.
358 abort: could not set ciphers: No cipher can be selected.
359 (change cipher string (invalid) in config)
359 (change cipher string (invalid) in config)
360 [255]
360 [255]
361
361
362 $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
362 $ P="$CERTSDIR" hg --config hostsecurity.localhost:ciphers=invalid -R copy-pull id https://localhost:$HGPORT/
363 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
363 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
364 abort: could not set ciphers: No cipher can be selected.
364 abort: could not set ciphers: No cipher can be selected.
365 (change cipher string (invalid) in config)
365 (change cipher string (invalid) in config)
366 [255]
366 [255]
367
367
368 Changing the cipher string works
368 Changing the cipher string works
369
369
370 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/
370 $ P="$CERTSDIR" hg --config hostsecurity.ciphers=HIGH -R copy-pull id https://localhost:$HGPORT/
371 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
371 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
372 5fed3813f7f5
372 5fed3813f7f5
373 #endif
373 #endif
374
374
375 Fingerprints
375 Fingerprints
376
376
377 - works without cacerts (hostfingerprints)
377 - works without cacerts (hostfingerprints)
378 $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
378 $ hg -R copy-pull id https://localhost:$HGPORT/ --insecure --config hostfingerprints.localhost=ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
379 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
379 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
380 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
380 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
381 5fed3813f7f5
381 5fed3813f7f5
382
382
383 - works without cacerts (hostsecurity)
383 - works without cacerts (hostsecurity)
384 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
384 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
385 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
385 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
386 5fed3813f7f5
386 5fed3813f7f5
387
387
388 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e
388 $ hg -R copy-pull id https://localhost:$HGPORT/ --config hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e
389 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
389 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
390 5fed3813f7f5
390 5fed3813f7f5
391
391
392 - multiple fingerprints specified and first matches
392 - multiple fingerprints specified and first matches
393 $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
393 $ hg --config 'hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
394 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
394 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
395 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
395 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
396 5fed3813f7f5
396 5fed3813f7f5
397
397
398 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
398 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03, sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
399 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
399 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
400 5fed3813f7f5
400 5fed3813f7f5
401
401
402 - multiple fingerprints specified and last matches
402 - multiple fingerprints specified and last matches
403 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure
403 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/ --insecure
404 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
404 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
405 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
405 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
406 5fed3813f7f5
406 5fed3813f7f5
407
407
408 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/
408 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03' -R copy-pull id https://localhost:$HGPORT/
409 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
409 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
410 5fed3813f7f5
410 5fed3813f7f5
411
411
412 - multiple fingerprints specified and none match
412 - multiple fingerprints specified and none match
413
413
414 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
414 $ hg --config 'hostfingerprints.localhost=deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/ --insecure
415 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
415 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
416 abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
416 abort: certificate for localhost has unexpected fingerprint ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
417 (check hostfingerprint configuration)
417 (check hostfingerprint configuration)
418 [255]
418 [255]
419
419
420 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
420 $ hg --config 'hostsecurity.localhost:fingerprints=sha1:deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, sha1:aeadbeefdeadbeefdeadbeefdeadbeefdeadbeef' -R copy-pull id https://localhost:$HGPORT/
421 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
421 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
422 abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
422 abort: certificate for localhost has unexpected fingerprint sha1:ec:d8:7c:d6:b3:86:d0:4f:c1:b8:b4:1c:9d:8f:5e:16:8e:ef:1c:03
423 (check hostsecurity configuration)
423 (check hostsecurity configuration)
424 [255]
424 [255]
425
425
426 - fails when cert doesn't match hostname (port is ignored)
426 - fails when cert doesn't match hostname (port is ignored)
427 $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
427 $ hg -R copy-pull id https://localhost:$HGPORT1/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
428 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
428 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
429 abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84
429 abort: certificate for localhost has unexpected fingerprint f4:2f:5a:0c:3e:52:5b:db:e7:24:a8:32:1d:18:97:6d:69:b5:87:84
430 (check hostfingerprint configuration)
430 (check hostfingerprint configuration)
431 [255]
431 [255]
432
432
433
433
434 - ignores that certificate doesn't match hostname
434 - ignores that certificate doesn't match hostname
435 $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
435 $ hg -R copy-pull id https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
436 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
436 warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
437 (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: $LOCALIP:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
437 (SHA-1 fingerprint for $LOCALIP found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: $LOCALIP:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
438 5fed3813f7f5
438 5fed3813f7f5
439
439
440 Ports used by next test. Kill servers.
440 Ports used by next test. Kill servers.
441
441
442 $ killdaemons.py hg0.pid
442 $ killdaemons.py hg0.pid
443 $ killdaemons.py hg1.pid
443 $ killdaemons.py hg1.pid
444 $ killdaemons.py hg2.pid
444 $ killdaemons.py hg2.pid
445
445
446 #if sslcontext tls1.2
446 #if sslcontext tls1.2
447 Start servers running supported TLS versions
447 Start servers running supported TLS versions
448
448
449 $ cd test
449 $ cd test
450 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
450 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
451 > --config devel.serverexactprotocol=tls1.0
451 > --config devel.serverexactprotocol=tls1.0
452 $ cat ../hg0.pid >> $DAEMON_PIDS
452 $ cat ../hg0.pid >> $DAEMON_PIDS
453 $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \
453 $ hg serve -p $HGPORT1 -d --pid-file=../hg1.pid --certificate=$PRIV \
454 > --config devel.serverexactprotocol=tls1.1
454 > --config devel.serverexactprotocol=tls1.1
455 $ cat ../hg1.pid >> $DAEMON_PIDS
455 $ cat ../hg1.pid >> $DAEMON_PIDS
456 $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \
456 $ hg serve -p $HGPORT2 -d --pid-file=../hg2.pid --certificate=$PRIV \
457 > --config devel.serverexactprotocol=tls1.2
457 > --config devel.serverexactprotocol=tls1.2
458 $ cat ../hg2.pid >> $DAEMON_PIDS
458 $ cat ../hg2.pid >> $DAEMON_PIDS
459 $ cd ..
459 $ cd ..
460
460
461 Clients talking same TLS versions work
461 Clients talking same TLS versions work
462
462
463 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 id https://localhost:$HGPORT/
463 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.0 id https://localhost:$HGPORT/
464 5fed3813f7f5
464 5fed3813f7f5
465 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT1/
465 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT1/
466 5fed3813f7f5
466 5fed3813f7f5
467 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/
467 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT2/
468 5fed3813f7f5
468 5fed3813f7f5
469
469
470 Clients requiring newer TLS version than what server supports fail
470 Clients requiring newer TLS version than what server supports fail
471
471
472 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
472 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
473 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
473 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
474 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
474 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
475 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
475 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
476 abort: error: *unsupported protocol* (glob)
476 abort: error: *unsupported protocol* (glob)
477 [255]
477 [255]
478
478
479 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/
479 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.1 id https://localhost:$HGPORT/
480 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
480 (could not negotiate a common security protocol (tls1.1+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
481 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
481 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
482 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
482 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
483 abort: error: *unsupported protocol* (glob)
483 abort: error: *unsupported protocol* (glob)
484 [255]
484 [255]
485 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/
485 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT/
486 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
486 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
487 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
487 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
488 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
488 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
489 abort: error: *unsupported protocol* (glob)
489 abort: error: *unsupported protocol* (glob)
490 [255]
490 [255]
491 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/
491 $ P="$CERTSDIR" hg --config hostsecurity.minimumprotocol=tls1.2 id https://localhost:$HGPORT1/
492 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
492 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
493 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
493 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
494 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
494 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
495 abort: error: *unsupported protocol* (glob)
495 abort: error: *unsupported protocol* (glob)
496 [255]
496 [255]
497
497
498 --insecure will allow TLS 1.0 connections and override configs
498 --insecure will allow TLS 1.0 connections and override configs
499
499
500 $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/
500 $ hg --config hostsecurity.minimumprotocol=tls1.2 id --insecure https://localhost:$HGPORT1/
501 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
501 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
502 5fed3813f7f5
502 5fed3813f7f5
503
503
504 The per-host config option overrides the default
504 The per-host config option overrides the default
505
505
506 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
506 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
507 > --config hostsecurity.minimumprotocol=tls1.2 \
507 > --config hostsecurity.minimumprotocol=tls1.2 \
508 > --config hostsecurity.localhost:minimumprotocol=tls1.0
508 > --config hostsecurity.localhost:minimumprotocol=tls1.0
509 5fed3813f7f5
509 5fed3813f7f5
510
510
511 The per-host config option by itself works
511 The per-host config option by itself works
512
512
513 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
513 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
514 > --config hostsecurity.localhost:minimumprotocol=tls1.2
514 > --config hostsecurity.localhost:minimumprotocol=tls1.2
515 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
515 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
516 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
516 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
517 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
517 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
518 abort: error: *unsupported protocol* (glob)
518 abort: error: *unsupported protocol* (glob)
519 [255]
519 [255]
520
520
521 .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305)
521 .hg/hgrc file [hostsecurity] settings are applied to remote ui instances (issue5305)
522
522
523 $ cat >> copy-pull/.hg/hgrc << EOF
523 $ cat >> copy-pull/.hg/hgrc << EOF
524 > [hostsecurity]
524 > [hostsecurity]
525 > localhost:minimumprotocol=tls1.2
525 > localhost:minimumprotocol=tls1.2
526 > EOF
526 > EOF
527 $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/
527 $ P="$CERTSDIR" hg -R copy-pull id https://localhost:$HGPORT/
528 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
528 (could not negotiate a common security protocol (tls1.2+) with localhost; the likely cause is Mercurial is configured to be more secure than the server can support)
529 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
529 (consider contacting the operator of this server and ask them to support modern TLS protocol versions; or, set hostsecurity.localhost:minimumprotocol=tls1.0 to allow use of legacy, less secure protocols when communicating with this server)
530 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
530 (see https://mercurial-scm.org/wiki/SecureConnections for more info)
531 abort: error: *unsupported protocol* (glob)
531 abort: error: *unsupported protocol* (glob)
532 [255]
532 [255]
533
533
534 $ killdaemons.py hg0.pid
534 $ killdaemons.py hg0.pid
535 $ killdaemons.py hg1.pid
535 $ killdaemons.py hg1.pid
536 $ killdaemons.py hg2.pid
536 $ killdaemons.py hg2.pid
537 #endif
537 #endif
538
538
539 Prepare for connecting through proxy
539 Prepare for connecting through proxy
540
540
541 $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV
541 $ hg serve -R test -p $HGPORT -d --pid-file=hg0.pid --certificate=$PRIV
542 $ cat hg0.pid >> $DAEMON_PIDS
542 $ cat hg0.pid >> $DAEMON_PIDS
543 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
543 $ hg serve -R test -p $HGPORT2 -d --pid-file=hg2.pid --certificate=server-expired.pem
544 $ cat hg2.pid >> $DAEMON_PIDS
544 $ cat hg2.pid >> $DAEMON_PIDS
545 tinyproxy.py doesn't fully detach, so killing it may result in extra output
545 tinyproxy.py doesn't fully detach, so killing it may result in extra output
546 from the shell. So don't kill it.
546 from the shell. So don't kill it.
547 $ tinyproxy.py $HGPORT1 localhost >proxy.log </dev/null 2>&1 &
547 $ tinyproxy.py $HGPORT1 localhost >proxy.log </dev/null 2>&1 &
548 $ while [ ! -f proxy.pid ]; do sleep 0; done
548 $ while [ ! -f proxy.pid ]; do sleep 0; done
549 $ cat proxy.pid >> $DAEMON_PIDS
549 $ cat proxy.pid >> $DAEMON_PIDS
550
550
551 $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
551 $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
552 $ echo "always=True" >> copy-pull/.hg/hgrc
552 $ echo "always=True" >> copy-pull/.hg/hgrc
553 $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
553 $ echo "[hostfingerprints]" >> copy-pull/.hg/hgrc
554 $ echo "localhost =" >> copy-pull/.hg/hgrc
554 $ echo "localhost =" >> copy-pull/.hg/hgrc
555
555
556 Test unvalidated https through proxy
556 Test unvalidated https through proxy
557
557
558 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure
558 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull --insecure
559 pulling from https://localhost:$HGPORT/
559 pulling from https://localhost:$HGPORT/
560 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
560 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
561 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
561 warning: connection security to localhost is disabled per current settings; communication is susceptible to eavesdropping and tampering
562 searching for changes
562 searching for changes
563 no changes found
563 no changes found
564
564
565 Test https with cacert and fingerprint through proxy
565 Test https with cacert and fingerprint through proxy
566
566
567 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
567 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
568 > --config web.cacerts="$CERTSDIR/pub.pem"
568 > --config web.cacerts="$CERTSDIR/pub.pem"
569 pulling from https://localhost:$HGPORT/
569 pulling from https://localhost:$HGPORT/
570 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
570 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
571 searching for changes
571 searching for changes
572 no changes found
572 no changes found
573 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace
573 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace
574 pulling from https://*:$HGPORT/ (glob)
574 pulling from https://*:$HGPORT/ (glob)
575 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
575 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
576 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
576 (SHA-1 fingerprint for localhost found in legacy [hostfingerprints] section; if you trust this fingerprint, remove the old SHA-1 fingerprint from [hostfingerprints] and add the following entry to the new [hostsecurity] section: localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e)
577 searching for changes
577 searching for changes
578 no changes found
578 no changes found
579
579
580 Test https with cert problems through proxy
580 Test https with cert problems through proxy
581
581
582 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
582 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
583 > --config web.cacerts="$CERTSDIR/pub-other.pem"
583 > --config web.cacerts="$CERTSDIR/pub-other.pem"
584 pulling from https://localhost:$HGPORT/
584 pulling from https://localhost:$HGPORT/
585 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
585 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
586 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
586 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
587 abort: error: *certificate verify failed* (glob)
587 abort: error: *certificate verify failed* (glob)
588 [255]
588 [255]
589 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
589 $ http_proxy=http://localhost:$HGPORT1/ hg -R copy-pull pull \
590 > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/
590 > --config web.cacerts="$CERTSDIR/pub-expired.pem" https://localhost:$HGPORT2/
591 pulling from https://localhost:$HGPORT2/
591 pulling from https://localhost:$HGPORT2/
592 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
592 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
593 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
593 (the full certificate chain may not be available locally; see "hg help debugssl") (windows !)
594 abort: error: *certificate verify failed* (glob)
594 abort: error: *certificate verify failed* (glob)
595 [255]
595 [255]
596
596
597
597
598 $ killdaemons.py hg0.pid
598 $ killdaemons.py hg0.pid
599
599
600 #if sslcontext
600 #if sslcontext
601
601
602 $ cd test
602 $ cd test
603
603
604 Missing certificate file(s) are detected
604 Missing certificate file(s) are detected
605
605
606 $ hg serve -p $HGPORT --certificate=/missing/certificate \
606 $ hg serve -p $HGPORT --certificate=/missing/certificate \
607 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
607 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
608 abort: referenced certificate file (*/missing/certificate) does not exist (glob)
608 abort: referenced certificate file (*/missing/certificate) does not exist (glob)
609 [255]
609 [255]
610
610
611 $ hg serve -p $HGPORT --certificate=$PRIV \
611 $ hg serve -p $HGPORT --certificate=$PRIV \
612 > --config devel.servercafile=/missing/cafile --config devel.serverrequirecert=true
612 > --config devel.servercafile=/missing/cafile --config devel.serverrequirecert=true
613 abort: referenced certificate file (*/missing/cafile) does not exist (glob)
613 abort: referenced certificate file (*/missing/cafile) does not exist (glob)
614 [255]
614 [255]
615
615
616 Start hgweb that requires client certificates:
616 Start hgweb that requires client certificates:
617
617
618 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
618 $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV \
619 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
619 > --config devel.servercafile=$PRIV --config devel.serverrequirecert=true
620 $ cat ../hg0.pid >> $DAEMON_PIDS
620 $ cat ../hg0.pid >> $DAEMON_PIDS
621 $ cd ..
621 $ cd ..
622
622
623 without client certificate:
623 without client certificate:
624
624
625 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
625 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/
626 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
626 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
627 abort: error: *handshake failure* (glob)
627 abort: error: *handshake failure* (glob)
628 [255]
628 [255]
629
629
630 with client certificate:
630 with client certificate:
631
631
632 $ cat << EOT >> $HGRCPATH
632 $ cat << EOT >> $HGRCPATH
633 > [auth]
633 > [auth]
634 > l.prefix = localhost
634 > l.prefix = localhost
635 > l.cert = $CERTSDIR/client-cert.pem
635 > l.cert = $CERTSDIR/client-cert.pem
636 > l.key = $CERTSDIR/client-key.pem
636 > l.key = $CERTSDIR/client-key.pem
637 > EOT
637 > EOT
638
638
639 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
639 $ P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
640 > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem"
640 > --config auth.l.key="$CERTSDIR/client-key-decrypted.pem"
641 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
641 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
642 5fed3813f7f5
642 5fed3813f7f5
643
643
644 $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
644 $ printf '1234\n' | env P="$CERTSDIR" hg id https://localhost:$HGPORT/ \
645 > --config ui.interactive=True --config ui.nontty=True
645 > --config ui.interactive=True --config ui.nontty=True
646 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
646 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
647 passphrase for */client-key.pem: 5fed3813f7f5 (glob)
647 passphrase for */client-key.pem: 5fed3813f7f5 (glob)
648
648
649 $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/
649 $ env P="$CERTSDIR" hg id https://localhost:$HGPORT/
650 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
650 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
651 abort: error: * (glob)
651 abort: error: * (glob)
652 [255]
652 [255]
653
653
654 Missing certficate and key files result in error
654 Missing certficate and key files result in error
655
655
656 $ hg id https://localhost:$HGPORT/ --config auth.l.cert=/missing/cert
656 $ hg id https://localhost:$HGPORT/ --config auth.l.cert=/missing/cert
657 abort: certificate file (*/missing/cert) does not exist; cannot connect to localhost (glob)
657 abort: certificate file (*/missing/cert) does not exist; cannot connect to localhost (glob)
658 (restore missing file or fix references in Mercurial config)
658 (restore missing file or fix references in Mercurial config)
659 [255]
659 [255]
660
660
661 $ hg id https://localhost:$HGPORT/ --config auth.l.key=/missing/key
661 $ hg id https://localhost:$HGPORT/ --config auth.l.key=/missing/key
662 abort: certificate file (*/missing/key) does not exist; cannot connect to localhost (glob)
662 abort: certificate file (*/missing/key) does not exist; cannot connect to localhost (glob)
663 (restore missing file or fix references in Mercurial config)
663 (restore missing file or fix references in Mercurial config)
664 [255]
664 [255]
665
665
666 #endif
666 #endif
@@ -1,167 +1,167 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3
3
4 $ tipparents() {
4 $ tipparents() {
5 > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
5 > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
6 > }
6 > }
7
7
8 Test import and merge diffs
8 Test import and merge diffs
9
9
10 $ hg init repo
10 $ hg init repo
11 $ cd repo
11 $ cd repo
12 $ echo a > a
12 $ echo a > a
13 $ hg ci -Am adda
13 $ hg ci -Am adda
14 adding a
14 adding a
15 $ echo a >> a
15 $ echo a >> a
16 $ hg ci -m changea
16 $ hg ci -m changea
17 $ echo c > c
17 $ echo c > c
18 $ hg ci -Am addc
18 $ hg ci -Am addc
19 adding c
19 adding c
20 $ hg up 0
20 $ hg up 0
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
21 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 $ echo b > b
22 $ echo b > b
23 $ hg ci -Am addb
23 $ hg ci -Am addb
24 adding b
24 adding b
25 created new head
25 created new head
26 $ hg up 1
26 $ hg up 1
27 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 $ hg merge 3
28 $ hg merge 3
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 (branch merge, don't forget to commit)
30 (branch merge, don't forget to commit)
31 $ hg ci -m merge
31 $ hg ci -m merge
32 $ hg export . > ../merge.diff
32 $ hg export . > ../merge.diff
33 $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff
33 $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff
34 $ cd ..
34 $ cd ..
35 $ hg clone -r2 repo repo2
35 $ hg clone -r2 repo repo2
36 adding changesets
36 adding changesets
37 adding manifests
37 adding manifests
38 adding file changes
38 adding file changes
39 added 3 changesets with 3 changes to 2 files
39 added 3 changesets with 3 changes to 2 files
40 new changesets 07f494440405:890ecaa90481
40 new changesets 07f494440405:890ecaa90481
41 updating to branch default
41 updating to branch default
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ cd repo2
43 $ cd repo2
44 $ hg pull -r3 ../repo
44 $ hg pull -r3 ../repo
45 pulling from ../repo
45 pulling from ../repo
46 searching for changes
46 searching for changes
47 adding changesets
47 adding changesets
48 adding manifests
48 adding manifests
49 adding file changes
49 adding file changes
50 added 1 changesets with 1 changes to 1 files (+1 heads)
50 added 1 changesets with 1 changes to 1 files (+1 heads)
51 new changesets 102a90ea7b4a
51 new changesets 102a90ea7b4a
52 (run 'hg heads' to see heads, 'hg merge' to merge)
52 (run 'hg heads' to see heads, 'hg merge' to merge)
53
53
54 Test without --exact and diff.p1 == workingdir.p1
54 Test without --exact and diff.p1 == workingdir.p1
55
55
56 $ hg up 1
56 $ hg up 1
57 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
57 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
58 $ cat > $TESTTMP/editor.sh <<EOF
58 $ cat > $TESTTMP/editor.sh <<EOF
59 > env | grep HGEDITFORM
59 > env | grep HGEDITFORM
60 > echo merge > \$1
60 > echo merge > \$1
61 > EOF
61 > EOF
62 $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff
62 $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff
63 applying ../merge.nomsg.diff
63 applying ../merge.nomsg.diff
64 HGEDITFORM=import.normal.merge
64 HGEDITFORM=import.normal.merge
65 $ tipparents
65 $ tipparents
66 1:540395c44225 changea
66 1:540395c44225 changea
67 3:102a90ea7b4a addb
67 3:102a90ea7b4a addb
68 $ hg strip --no-backup tip
68 $ hg strip --no-backup tip
69 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
70
70
71 Test without --exact and diff.p1 != workingdir.p1
71 Test without --exact and diff.p1 != workingdir.p1
72
72
73 $ hg up 2
73 $ hg up 2
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 $ hg import ../merge.diff
75 $ hg import ../merge.diff
76 applying ../merge.diff
76 applying ../merge.diff
77 warning: import the patch as a normal revision
77 warning: import the patch as a normal revision
78 (use --exact to import the patch as a merge)
78 (use --exact to import the patch as a merge)
79 $ tipparents
79 $ tipparents
80 2:890ecaa90481 addc
80 2:890ecaa90481 addc
81 $ hg strip --no-backup tip
81 $ hg strip --no-backup tip
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
83
83
84 Test with --exact
84 Test with --exact
85
85
86 $ hg import --exact ../merge.diff
86 $ hg import --exact ../merge.diff
87 applying ../merge.diff
87 applying ../merge.diff
88 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
88 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
89 $ tipparents
89 $ tipparents
90 1:540395c44225 changea
90 1:540395c44225 changea
91 3:102a90ea7b4a addb
91 3:102a90ea7b4a addb
92 $ hg strip --no-backup tip
92 $ hg strip --no-backup tip
93 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
94
94
95 Test with --bypass and diff.p1 == workingdir.p1
95 Test with --bypass and diff.p1 == workingdir.p1
96
96
97 $ hg up 1
97 $ hg up 1
98 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 $ hg import --bypass ../merge.diff
99 $ hg import --bypass ../merge.diff
100 applying ../merge.diff
100 applying ../merge.diff
101 $ tipparents
101 $ tipparents
102 1:540395c44225 changea
102 1:540395c44225 changea
103 3:102a90ea7b4a addb
103 3:102a90ea7b4a addb
104 $ hg strip --no-backup tip
104 $ hg strip --no-backup tip
105
105
106 Test with --bypass and diff.p1 != workingdir.p1
106 Test with --bypass and diff.p1 != workingdir.p1
107
107
108 $ hg up 2
108 $ hg up 2
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 $ hg import --bypass ../merge.diff
110 $ hg import --bypass ../merge.diff
111 applying ../merge.diff
111 applying ../merge.diff
112 warning: import the patch as a normal revision
112 warning: import the patch as a normal revision
113 (use --exact to import the patch as a merge)
113 (use --exact to import the patch as a merge)
114 $ tipparents
114 $ tipparents
115 2:890ecaa90481 addc
115 2:890ecaa90481 addc
116 $ hg strip --no-backup tip
116 $ hg strip --no-backup tip
117
117
118 Test with --bypass and --exact
118 Test with --bypass and --exact
119
119
120 $ hg import --bypass --exact ../merge.diff
120 $ hg import --bypass --exact ../merge.diff
121 applying ../merge.diff
121 applying ../merge.diff
122 $ tipparents
122 $ tipparents
123 1:540395c44225 changea
123 1:540395c44225 changea
124 3:102a90ea7b4a addb
124 3:102a90ea7b4a addb
125 $ hg strip --no-backup tip
125 $ hg strip --no-backup tip
126
126
127 $ cd ..
127 $ cd ..
128
128
129 Test that --exact on a bad header doesn't corrupt the repo (issue3616)
129 Test that --exact on a bad header doesn't corrupt the repo (issue3616)
130
130
131 $ hg init repo3
131 $ hg init repo3
132 $ cd repo3
132 $ cd repo3
133 $ echo a>a
133 $ echo a>a
134 $ hg ci -Aqm0
134 $ hg ci -Aqm0
135 $ echo a>>a
135 $ echo a>>a
136 $ hg ci -m1
136 $ hg ci -m1
137 $ echo a>>a
137 $ echo a>>a
138 $ hg ci -m2
138 $ hg ci -m2
139 $ echo a>a
139 $ echo a>a
140 $ echo b>>a
140 $ echo b>>a
141 $ echo a>>a
141 $ echo a>>a
142 $ hg ci -m3
142 $ hg ci -m3
143 $ hg export 2 | head -7 > ../a.patch
143 $ hg export 2 | head -7 > ../a.patch
144 $ hg export tip > out
144 $ hg export tip > out
145 >>> apatch = open("../a.patch", "ab")
145 >>> apatch = open("../a.patch", "ab")
146 >>> apatch.write(b"".join(open("out", 'rb').readlines()[7:])) and None
146 >>> apatch.write(b"".join(open("out", 'rb').readlines()[7:])) and None
147
147
148 $ cd ..
148 $ cd ..
149 $ hg clone -qr0 repo3 repo3-clone
149 $ hg clone -qr0 repo3 repo3-clone
150 $ cd repo3-clone
150 $ cd repo3-clone
151 $ hg pull -qr1 ../repo3
151 $ hg pull -qr1 ../repo3
152
152
153 $ hg import --exact ../a.patch
153 $ hg import --exact ../a.patch
154 applying ../a.patch
154 applying ../a.patch
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 patching file a
156 patching file a
157 Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
157 Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
158 transaction abort!
158 transaction abort!
159 rollback completed
159 rollback completed
160 abort: patch is damaged or loses information
160 abort: patch is damaged or loses information
161 [255]
161 [255]
162 $ hg verify
162 $ hg verify
163 checking changesets
163 checking changesets
164 checking manifests
164 checking manifests
165 crosschecking files in changesets and manifests
165 crosschecking files in changesets and manifests
166 checking files
166 checking files
167 1 files, 2 changesets, 2 total revisions
167 checked 2 changesets with 2 changes to 1 files
@@ -1,553 +1,553 b''
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ for i in 0 1 2 3 4 5 6 7 8; do
5 $ for i in 0 1 2 3 4 5 6 7 8; do
6 > echo $i >> foo
6 > echo $i >> foo
7 > hg commit -A -m $i
7 > hg commit -A -m $i
8 > done
8 > done
9 adding foo
9 adding foo
10 $ hg verify
10 $ hg verify
11 checking changesets
11 checking changesets
12 checking manifests
12 checking manifests
13 crosschecking files in changesets and manifests
13 crosschecking files in changesets and manifests
14 checking files
14 checking files
15 1 files, 9 changesets, 9 total revisions
15 checked 9 changesets with 9 changes to 1 files
16 $ hg serve -p $HGPORT -d --pid-file=hg.pid
16 $ hg serve -p $HGPORT -d --pid-file=hg.pid
17 $ cat hg.pid >> $DAEMON_PIDS
17 $ cat hg.pid >> $DAEMON_PIDS
18 $ cd ..
18 $ cd ..
19
19
20 $ hg init new
20 $ hg init new
21
21
22 http incoming
22 http incoming
23
23
24 $ hg -R new incoming http://localhost:$HGPORT/
24 $ hg -R new incoming http://localhost:$HGPORT/
25 comparing with http://localhost:$HGPORT/
25 comparing with http://localhost:$HGPORT/
26 changeset: 0:00a43fa82f62
26 changeset: 0:00a43fa82f62
27 user: test
27 user: test
28 date: Thu Jan 01 00:00:00 1970 +0000
28 date: Thu Jan 01 00:00:00 1970 +0000
29 summary: 0
29 summary: 0
30
30
31 changeset: 1:5460a410df01
31 changeset: 1:5460a410df01
32 user: test
32 user: test
33 date: Thu Jan 01 00:00:00 1970 +0000
33 date: Thu Jan 01 00:00:00 1970 +0000
34 summary: 1
34 summary: 1
35
35
36 changeset: 2:d9f42cd1a1ec
36 changeset: 2:d9f42cd1a1ec
37 user: test
37 user: test
38 date: Thu Jan 01 00:00:00 1970 +0000
38 date: Thu Jan 01 00:00:00 1970 +0000
39 summary: 2
39 summary: 2
40
40
41 changeset: 3:376476025137
41 changeset: 3:376476025137
42 user: test
42 user: test
43 date: Thu Jan 01 00:00:00 1970 +0000
43 date: Thu Jan 01 00:00:00 1970 +0000
44 summary: 3
44 summary: 3
45
45
46 changeset: 4:70d7eb252d49
46 changeset: 4:70d7eb252d49
47 user: test
47 user: test
48 date: Thu Jan 01 00:00:00 1970 +0000
48 date: Thu Jan 01 00:00:00 1970 +0000
49 summary: 4
49 summary: 4
50
50
51 changeset: 5:ad284ee3b5ee
51 changeset: 5:ad284ee3b5ee
52 user: test
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: 5
54 summary: 5
55
55
56 changeset: 6:e9229f2de384
56 changeset: 6:e9229f2de384
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59 summary: 6
59 summary: 6
60
60
61 changeset: 7:d152815bb8db
61 changeset: 7:d152815bb8db
62 user: test
62 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
63 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: 7
64 summary: 7
65
65
66 changeset: 8:e4feb4ac9035
66 changeset: 8:e4feb4ac9035
67 tag: tip
67 tag: tip
68 user: test
68 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
69 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: 8
70 summary: 8
71
71
72 $ hg -R new incoming -r 4 http://localhost:$HGPORT/
72 $ hg -R new incoming -r 4 http://localhost:$HGPORT/
73 comparing with http://localhost:$HGPORT/
73 comparing with http://localhost:$HGPORT/
74 changeset: 0:00a43fa82f62
74 changeset: 0:00a43fa82f62
75 user: test
75 user: test
76 date: Thu Jan 01 00:00:00 1970 +0000
76 date: Thu Jan 01 00:00:00 1970 +0000
77 summary: 0
77 summary: 0
78
78
79 changeset: 1:5460a410df01
79 changeset: 1:5460a410df01
80 user: test
80 user: test
81 date: Thu Jan 01 00:00:00 1970 +0000
81 date: Thu Jan 01 00:00:00 1970 +0000
82 summary: 1
82 summary: 1
83
83
84 changeset: 2:d9f42cd1a1ec
84 changeset: 2:d9f42cd1a1ec
85 user: test
85 user: test
86 date: Thu Jan 01 00:00:00 1970 +0000
86 date: Thu Jan 01 00:00:00 1970 +0000
87 summary: 2
87 summary: 2
88
88
89 changeset: 3:376476025137
89 changeset: 3:376476025137
90 user: test
90 user: test
91 date: Thu Jan 01 00:00:00 1970 +0000
91 date: Thu Jan 01 00:00:00 1970 +0000
92 summary: 3
92 summary: 3
93
93
94 changeset: 4:70d7eb252d49
94 changeset: 4:70d7eb252d49
95 tag: tip
95 tag: tip
96 user: test
96 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
97 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: 4
98 summary: 4
99
99
100
100
101 local incoming
101 local incoming
102
102
103 $ hg -R new incoming test
103 $ hg -R new incoming test
104 comparing with test
104 comparing with test
105 changeset: 0:00a43fa82f62
105 changeset: 0:00a43fa82f62
106 user: test
106 user: test
107 date: Thu Jan 01 00:00:00 1970 +0000
107 date: Thu Jan 01 00:00:00 1970 +0000
108 summary: 0
108 summary: 0
109
109
110 changeset: 1:5460a410df01
110 changeset: 1:5460a410df01
111 user: test
111 user: test
112 date: Thu Jan 01 00:00:00 1970 +0000
112 date: Thu Jan 01 00:00:00 1970 +0000
113 summary: 1
113 summary: 1
114
114
115 changeset: 2:d9f42cd1a1ec
115 changeset: 2:d9f42cd1a1ec
116 user: test
116 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
117 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: 2
118 summary: 2
119
119
120 changeset: 3:376476025137
120 changeset: 3:376476025137
121 user: test
121 user: test
122 date: Thu Jan 01 00:00:00 1970 +0000
122 date: Thu Jan 01 00:00:00 1970 +0000
123 summary: 3
123 summary: 3
124
124
125 changeset: 4:70d7eb252d49
125 changeset: 4:70d7eb252d49
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: 4
128 summary: 4
129
129
130 changeset: 5:ad284ee3b5ee
130 changeset: 5:ad284ee3b5ee
131 user: test
131 user: test
132 date: Thu Jan 01 00:00:00 1970 +0000
132 date: Thu Jan 01 00:00:00 1970 +0000
133 summary: 5
133 summary: 5
134
134
135 changeset: 6:e9229f2de384
135 changeset: 6:e9229f2de384
136 user: test
136 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
137 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: 6
138 summary: 6
139
139
140 changeset: 7:d152815bb8db
140 changeset: 7:d152815bb8db
141 user: test
141 user: test
142 date: Thu Jan 01 00:00:00 1970 +0000
142 date: Thu Jan 01 00:00:00 1970 +0000
143 summary: 7
143 summary: 7
144
144
145 changeset: 8:e4feb4ac9035
145 changeset: 8:e4feb4ac9035
146 tag: tip
146 tag: tip
147 user: test
147 user: test
148 date: Thu Jan 01 00:00:00 1970 +0000
148 date: Thu Jan 01 00:00:00 1970 +0000
149 summary: 8
149 summary: 8
150
150
151 $ hg -R new incoming -r 4 test
151 $ hg -R new incoming -r 4 test
152 comparing with test
152 comparing with test
153 changeset: 0:00a43fa82f62
153 changeset: 0:00a43fa82f62
154 user: test
154 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
155 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: 0
156 summary: 0
157
157
158 changeset: 1:5460a410df01
158 changeset: 1:5460a410df01
159 user: test
159 user: test
160 date: Thu Jan 01 00:00:00 1970 +0000
160 date: Thu Jan 01 00:00:00 1970 +0000
161 summary: 1
161 summary: 1
162
162
163 changeset: 2:d9f42cd1a1ec
163 changeset: 2:d9f42cd1a1ec
164 user: test
164 user: test
165 date: Thu Jan 01 00:00:00 1970 +0000
165 date: Thu Jan 01 00:00:00 1970 +0000
166 summary: 2
166 summary: 2
167
167
168 changeset: 3:376476025137
168 changeset: 3:376476025137
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: 3
171 summary: 3
172
172
173 changeset: 4:70d7eb252d49
173 changeset: 4:70d7eb252d49
174 user: test
174 user: test
175 date: Thu Jan 01 00:00:00 1970 +0000
175 date: Thu Jan 01 00:00:00 1970 +0000
176 summary: 4
176 summary: 4
177
177
178
178
179 limit to 2 changesets
179 limit to 2 changesets
180
180
181 $ hg -R new incoming -l 2 test
181 $ hg -R new incoming -l 2 test
182 comparing with test
182 comparing with test
183 changeset: 0:00a43fa82f62
183 changeset: 0:00a43fa82f62
184 user: test
184 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: 0
186 summary: 0
187
187
188 changeset: 1:5460a410df01
188 changeset: 1:5460a410df01
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: 1
191 summary: 1
192
192
193
193
194 limit to 2 changesets, test with -p --git
194 limit to 2 changesets, test with -p --git
195
195
196 $ hg -R new incoming -l 2 -p --git test
196 $ hg -R new incoming -l 2 -p --git test
197 comparing with test
197 comparing with test
198 changeset: 0:00a43fa82f62
198 changeset: 0:00a43fa82f62
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: 0
201 summary: 0
202
202
203 diff --git a/foo b/foo
203 diff --git a/foo b/foo
204 new file mode 100644
204 new file mode 100644
205 --- /dev/null
205 --- /dev/null
206 +++ b/foo
206 +++ b/foo
207 @@ -0,0 +1,1 @@
207 @@ -0,0 +1,1 @@
208 +0
208 +0
209
209
210 changeset: 1:5460a410df01
210 changeset: 1:5460a410df01
211 user: test
211 user: test
212 date: Thu Jan 01 00:00:00 1970 +0000
212 date: Thu Jan 01 00:00:00 1970 +0000
213 summary: 1
213 summary: 1
214
214
215 diff --git a/foo b/foo
215 diff --git a/foo b/foo
216 --- a/foo
216 --- a/foo
217 +++ b/foo
217 +++ b/foo
218 @@ -1,1 +1,2 @@
218 @@ -1,1 +1,2 @@
219 0
219 0
220 +1
220 +1
221
221
222
222
223 test with --bundle
223 test with --bundle
224
224
225 $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/
225 $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/
226 comparing with http://localhost:$HGPORT/
226 comparing with http://localhost:$HGPORT/
227 changeset: 0:00a43fa82f62
227 changeset: 0:00a43fa82f62
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:00 1970 +0000
229 date: Thu Jan 01 00:00:00 1970 +0000
230 summary: 0
230 summary: 0
231
231
232 changeset: 1:5460a410df01
232 changeset: 1:5460a410df01
233 user: test
233 user: test
234 date: Thu Jan 01 00:00:00 1970 +0000
234 date: Thu Jan 01 00:00:00 1970 +0000
235 summary: 1
235 summary: 1
236
236
237 changeset: 2:d9f42cd1a1ec
237 changeset: 2:d9f42cd1a1ec
238 user: test
238 user: test
239 date: Thu Jan 01 00:00:00 1970 +0000
239 date: Thu Jan 01 00:00:00 1970 +0000
240 summary: 2
240 summary: 2
241
241
242 changeset: 3:376476025137
242 changeset: 3:376476025137
243 user: test
243 user: test
244 date: Thu Jan 01 00:00:00 1970 +0000
244 date: Thu Jan 01 00:00:00 1970 +0000
245 summary: 3
245 summary: 3
246
246
247 changeset: 4:70d7eb252d49
247 changeset: 4:70d7eb252d49
248 user: test
248 user: test
249 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
250 summary: 4
250 summary: 4
251
251
252 changeset: 5:ad284ee3b5ee
252 changeset: 5:ad284ee3b5ee
253 user: test
253 user: test
254 date: Thu Jan 01 00:00:00 1970 +0000
254 date: Thu Jan 01 00:00:00 1970 +0000
255 summary: 5
255 summary: 5
256
256
257 changeset: 6:e9229f2de384
257 changeset: 6:e9229f2de384
258 user: test
258 user: test
259 date: Thu Jan 01 00:00:00 1970 +0000
259 date: Thu Jan 01 00:00:00 1970 +0000
260 summary: 6
260 summary: 6
261
261
262 changeset: 7:d152815bb8db
262 changeset: 7:d152815bb8db
263 user: test
263 user: test
264 date: Thu Jan 01 00:00:00 1970 +0000
264 date: Thu Jan 01 00:00:00 1970 +0000
265 summary: 7
265 summary: 7
266
266
267 changeset: 8:e4feb4ac9035
267 changeset: 8:e4feb4ac9035
268 tag: tip
268 tag: tip
269 user: test
269 user: test
270 date: Thu Jan 01 00:00:00 1970 +0000
270 date: Thu Jan 01 00:00:00 1970 +0000
271 summary: 8
271 summary: 8
272
272
273 $ hg -R new incoming --bundle test2.hg test
273 $ hg -R new incoming --bundle test2.hg test
274 comparing with test
274 comparing with test
275 changeset: 0:00a43fa82f62
275 changeset: 0:00a43fa82f62
276 user: test
276 user: test
277 date: Thu Jan 01 00:00:00 1970 +0000
277 date: Thu Jan 01 00:00:00 1970 +0000
278 summary: 0
278 summary: 0
279
279
280 changeset: 1:5460a410df01
280 changeset: 1:5460a410df01
281 user: test
281 user: test
282 date: Thu Jan 01 00:00:00 1970 +0000
282 date: Thu Jan 01 00:00:00 1970 +0000
283 summary: 1
283 summary: 1
284
284
285 changeset: 2:d9f42cd1a1ec
285 changeset: 2:d9f42cd1a1ec
286 user: test
286 user: test
287 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
288 summary: 2
288 summary: 2
289
289
290 changeset: 3:376476025137
290 changeset: 3:376476025137
291 user: test
291 user: test
292 date: Thu Jan 01 00:00:00 1970 +0000
292 date: Thu Jan 01 00:00:00 1970 +0000
293 summary: 3
293 summary: 3
294
294
295 changeset: 4:70d7eb252d49
295 changeset: 4:70d7eb252d49
296 user: test
296 user: test
297 date: Thu Jan 01 00:00:00 1970 +0000
297 date: Thu Jan 01 00:00:00 1970 +0000
298 summary: 4
298 summary: 4
299
299
300 changeset: 5:ad284ee3b5ee
300 changeset: 5:ad284ee3b5ee
301 user: test
301 user: test
302 date: Thu Jan 01 00:00:00 1970 +0000
302 date: Thu Jan 01 00:00:00 1970 +0000
303 summary: 5
303 summary: 5
304
304
305 changeset: 6:e9229f2de384
305 changeset: 6:e9229f2de384
306 user: test
306 user: test
307 date: Thu Jan 01 00:00:00 1970 +0000
307 date: Thu Jan 01 00:00:00 1970 +0000
308 summary: 6
308 summary: 6
309
309
310 changeset: 7:d152815bb8db
310 changeset: 7:d152815bb8db
311 user: test
311 user: test
312 date: Thu Jan 01 00:00:00 1970 +0000
312 date: Thu Jan 01 00:00:00 1970 +0000
313 summary: 7
313 summary: 7
314
314
315 changeset: 8:e4feb4ac9035
315 changeset: 8:e4feb4ac9035
316 tag: tip
316 tag: tip
317 user: test
317 user: test
318 date: Thu Jan 01 00:00:00 1970 +0000
318 date: Thu Jan 01 00:00:00 1970 +0000
319 summary: 8
319 summary: 8
320
320
321
321
322
322
323 test the resulting bundles
323 test the resulting bundles
324
324
325 $ hg init temp
325 $ hg init temp
326 $ hg init temp2
326 $ hg init temp2
327 $ hg -R temp unbundle test.hg
327 $ hg -R temp unbundle test.hg
328 adding changesets
328 adding changesets
329 adding manifests
329 adding manifests
330 adding file changes
330 adding file changes
331 added 9 changesets with 9 changes to 1 files
331 added 9 changesets with 9 changes to 1 files
332 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
332 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
333 (run 'hg update' to get a working copy)
333 (run 'hg update' to get a working copy)
334 $ hg -R temp2 unbundle test2.hg
334 $ hg -R temp2 unbundle test2.hg
335 adding changesets
335 adding changesets
336 adding manifests
336 adding manifests
337 adding file changes
337 adding file changes
338 added 9 changesets with 9 changes to 1 files
338 added 9 changesets with 9 changes to 1 files
339 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
339 new changesets 00a43fa82f62:e4feb4ac9035 (9 drafts)
340 (run 'hg update' to get a working copy)
340 (run 'hg update' to get a working copy)
341 $ hg -R temp tip
341 $ hg -R temp tip
342 changeset: 8:e4feb4ac9035
342 changeset: 8:e4feb4ac9035
343 tag: tip
343 tag: tip
344 user: test
344 user: test
345 date: Thu Jan 01 00:00:00 1970 +0000
345 date: Thu Jan 01 00:00:00 1970 +0000
346 summary: 8
346 summary: 8
347
347
348 $ hg -R temp2 tip
348 $ hg -R temp2 tip
349 changeset: 8:e4feb4ac9035
349 changeset: 8:e4feb4ac9035
350 tag: tip
350 tag: tip
351 user: test
351 user: test
352 date: Thu Jan 01 00:00:00 1970 +0000
352 date: Thu Jan 01 00:00:00 1970 +0000
353 summary: 8
353 summary: 8
354
354
355
355
356 $ rm -r temp temp2 new
356 $ rm -r temp temp2 new
357
357
358 test outgoing
358 test outgoing
359
359
360 $ hg clone test test-dev
360 $ hg clone test test-dev
361 updating to branch default
361 updating to branch default
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 $ cd test-dev
363 $ cd test-dev
364 $ for i in 9 10 11 12 13; do
364 $ for i in 9 10 11 12 13; do
365 > echo $i >> foo
365 > echo $i >> foo
366 > hg commit -A -m $i
366 > hg commit -A -m $i
367 > done
367 > done
368 $ hg verify
368 $ hg verify
369 checking changesets
369 checking changesets
370 checking manifests
370 checking manifests
371 crosschecking files in changesets and manifests
371 crosschecking files in changesets and manifests
372 checking files
372 checking files
373 1 files, 14 changesets, 14 total revisions
373 checked 14 changesets with 14 changes to 1 files
374 $ cd ..
374 $ cd ..
375 $ hg -R test-dev outgoing test
375 $ hg -R test-dev outgoing test
376 comparing with test
376 comparing with test
377 searching for changes
377 searching for changes
378 changeset: 9:d89d4abea5bc
378 changeset: 9:d89d4abea5bc
379 user: test
379 user: test
380 date: Thu Jan 01 00:00:00 1970 +0000
380 date: Thu Jan 01 00:00:00 1970 +0000
381 summary: 9
381 summary: 9
382
382
383 changeset: 10:820095aa7158
383 changeset: 10:820095aa7158
384 user: test
384 user: test
385 date: Thu Jan 01 00:00:00 1970 +0000
385 date: Thu Jan 01 00:00:00 1970 +0000
386 summary: 10
386 summary: 10
387
387
388 changeset: 11:09ede2f3a638
388 changeset: 11:09ede2f3a638
389 user: test
389 user: test
390 date: Thu Jan 01 00:00:00 1970 +0000
390 date: Thu Jan 01 00:00:00 1970 +0000
391 summary: 11
391 summary: 11
392
392
393 changeset: 12:e576b1bed305
393 changeset: 12:e576b1bed305
394 user: test
394 user: test
395 date: Thu Jan 01 00:00:00 1970 +0000
395 date: Thu Jan 01 00:00:00 1970 +0000
396 summary: 12
396 summary: 12
397
397
398 changeset: 13:96bbff09a7cc
398 changeset: 13:96bbff09a7cc
399 tag: tip
399 tag: tip
400 user: test
400 user: test
401 date: Thu Jan 01 00:00:00 1970 +0000
401 date: Thu Jan 01 00:00:00 1970 +0000
402 summary: 13
402 summary: 13
403
403
404 test outgoing with secret changesets
404 test outgoing with secret changesets
405
405
406 $ hg -R test-dev phase --force --secret 9
406 $ hg -R test-dev phase --force --secret 9
407 $ hg -R test-dev outgoing test
407 $ hg -R test-dev outgoing test
408 comparing with test
408 comparing with test
409 searching for changes
409 searching for changes
410 no changes found (ignored 5 secret changesets)
410 no changes found (ignored 5 secret changesets)
411 [1]
411 [1]
412 $ hg -R test-dev phase --draft -r 'head()'
412 $ hg -R test-dev phase --draft -r 'head()'
413
413
414 limit to 3 changesets
414 limit to 3 changesets
415
415
416 $ hg -R test-dev outgoing -l 3 test
416 $ hg -R test-dev outgoing -l 3 test
417 comparing with test
417 comparing with test
418 searching for changes
418 searching for changes
419 changeset: 9:d89d4abea5bc
419 changeset: 9:d89d4abea5bc
420 user: test
420 user: test
421 date: Thu Jan 01 00:00:00 1970 +0000
421 date: Thu Jan 01 00:00:00 1970 +0000
422 summary: 9
422 summary: 9
423
423
424 changeset: 10:820095aa7158
424 changeset: 10:820095aa7158
425 user: test
425 user: test
426 date: Thu Jan 01 00:00:00 1970 +0000
426 date: Thu Jan 01 00:00:00 1970 +0000
427 summary: 10
427 summary: 10
428
428
429 changeset: 11:09ede2f3a638
429 changeset: 11:09ede2f3a638
430 user: test
430 user: test
431 date: Thu Jan 01 00:00:00 1970 +0000
431 date: Thu Jan 01 00:00:00 1970 +0000
432 summary: 11
432 summary: 11
433
433
434 $ hg -R test-dev outgoing http://localhost:$HGPORT/
434 $ hg -R test-dev outgoing http://localhost:$HGPORT/
435 comparing with http://localhost:$HGPORT/
435 comparing with http://localhost:$HGPORT/
436 searching for changes
436 searching for changes
437 changeset: 9:d89d4abea5bc
437 changeset: 9:d89d4abea5bc
438 user: test
438 user: test
439 date: Thu Jan 01 00:00:00 1970 +0000
439 date: Thu Jan 01 00:00:00 1970 +0000
440 summary: 9
440 summary: 9
441
441
442 changeset: 10:820095aa7158
442 changeset: 10:820095aa7158
443 user: test
443 user: test
444 date: Thu Jan 01 00:00:00 1970 +0000
444 date: Thu Jan 01 00:00:00 1970 +0000
445 summary: 10
445 summary: 10
446
446
447 changeset: 11:09ede2f3a638
447 changeset: 11:09ede2f3a638
448 user: test
448 user: test
449 date: Thu Jan 01 00:00:00 1970 +0000
449 date: Thu Jan 01 00:00:00 1970 +0000
450 summary: 11
450 summary: 11
451
451
452 changeset: 12:e576b1bed305
452 changeset: 12:e576b1bed305
453 user: test
453 user: test
454 date: Thu Jan 01 00:00:00 1970 +0000
454 date: Thu Jan 01 00:00:00 1970 +0000
455 summary: 12
455 summary: 12
456
456
457 changeset: 13:96bbff09a7cc
457 changeset: 13:96bbff09a7cc
458 tag: tip
458 tag: tip
459 user: test
459 user: test
460 date: Thu Jan 01 00:00:00 1970 +0000
460 date: Thu Jan 01 00:00:00 1970 +0000
461 summary: 13
461 summary: 13
462
462
463 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/
463 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/
464 comparing with http://localhost:$HGPORT/
464 comparing with http://localhost:$HGPORT/
465 searching for changes
465 searching for changes
466 changeset: 9:d89d4abea5bc
466 changeset: 9:d89d4abea5bc
467 user: test
467 user: test
468 date: Thu Jan 01 00:00:00 1970 +0000
468 date: Thu Jan 01 00:00:00 1970 +0000
469 summary: 9
469 summary: 9
470
470
471 changeset: 10:820095aa7158
471 changeset: 10:820095aa7158
472 user: test
472 user: test
473 date: Thu Jan 01 00:00:00 1970 +0000
473 date: Thu Jan 01 00:00:00 1970 +0000
474 summary: 10
474 summary: 10
475
475
476 changeset: 11:09ede2f3a638
476 changeset: 11:09ede2f3a638
477 user: test
477 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
478 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: 11
479 summary: 11
480
480
481
481
482 incoming from empty remote repository
482 incoming from empty remote repository
483
483
484 $ hg init r1
484 $ hg init r1
485 $ hg init r2
485 $ hg init r2
486 $ echo a > r1/foo
486 $ echo a > r1/foo
487 $ hg -R r1 ci -Ama
487 $ hg -R r1 ci -Ama
488 adding foo
488 adding foo
489 $ hg -R r1 incoming r2 --bundle x.hg
489 $ hg -R r1 incoming r2 --bundle x.hg
490 comparing with r2
490 comparing with r2
491 searching for changes
491 searching for changes
492 no changes found
492 no changes found
493 [1]
493 [1]
494
494
495 Create a "split" repo that pulls from r1 and pushes to r2, using default-push
495 Create a "split" repo that pulls from r1 and pushes to r2, using default-push
496
496
497 $ hg clone r1 split
497 $ hg clone r1 split
498 updating to branch default
498 updating to branch default
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
499 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 $ cat > split/.hg/hgrc << EOF
500 $ cat > split/.hg/hgrc << EOF
501 > [paths]
501 > [paths]
502 > default = $TESTTMP/r3
502 > default = $TESTTMP/r3
503 > default-push = $TESTTMP/r2
503 > default-push = $TESTTMP/r2
504 > EOF
504 > EOF
505 $ hg -R split outgoing
505 $ hg -R split outgoing
506 comparing with $TESTTMP/r2
506 comparing with $TESTTMP/r2
507 searching for changes
507 searching for changes
508 changeset: 0:3e92d79f743a
508 changeset: 0:3e92d79f743a
509 tag: tip
509 tag: tip
510 user: test
510 user: test
511 date: Thu Jan 01 00:00:00 1970 +0000
511 date: Thu Jan 01 00:00:00 1970 +0000
512 summary: a
512 summary: a
513
513
514
514
515 Use default:pushurl instead of default-push
515 Use default:pushurl instead of default-push
516
516
517 Windows needs a leading slash to make a URL that passes all of the checks
517 Windows needs a leading slash to make a URL that passes all of the checks
518 $ WD=`pwd`
518 $ WD=`pwd`
519 #if windows
519 #if windows
520 $ WD="/$WD"
520 $ WD="/$WD"
521 #endif
521 #endif
522 $ cat > split/.hg/hgrc << EOF
522 $ cat > split/.hg/hgrc << EOF
523 > [paths]
523 > [paths]
524 > default = $WD/r3
524 > default = $WD/r3
525 > default:pushurl = file://$WD/r2
525 > default:pushurl = file://$WD/r2
526 > EOF
526 > EOF
527 $ hg -R split outgoing
527 $ hg -R split outgoing
528 comparing with file:/*/$TESTTMP/r2 (glob)
528 comparing with file:/*/$TESTTMP/r2 (glob)
529 searching for changes
529 searching for changes
530 changeset: 0:3e92d79f743a
530 changeset: 0:3e92d79f743a
531 tag: tip
531 tag: tip
532 user: test
532 user: test
533 date: Thu Jan 01 00:00:00 1970 +0000
533 date: Thu Jan 01 00:00:00 1970 +0000
534 summary: a
534 summary: a
535
535
536
536
537 Push and then double-check outgoing
537 Push and then double-check outgoing
538
538
539 $ echo a >> split/foo
539 $ echo a >> split/foo
540 $ hg -R split commit -Ama
540 $ hg -R split commit -Ama
541 $ hg -R split push
541 $ hg -R split push
542 pushing to file:/*/$TESTTMP/r2 (glob)
542 pushing to file:/*/$TESTTMP/r2 (glob)
543 searching for changes
543 searching for changes
544 adding changesets
544 adding changesets
545 adding manifests
545 adding manifests
546 adding file changes
546 adding file changes
547 added 2 changesets with 2 changes to 1 files
547 added 2 changesets with 2 changes to 1 files
548 $ hg -R split outgoing
548 $ hg -R split outgoing
549 comparing with file:/*/$TESTTMP/r2 (glob)
549 comparing with file:/*/$TESTTMP/r2 (glob)
550 searching for changes
550 searching for changes
551 no changes found
551 no changes found
552 [1]
552 [1]
553
553
@@ -1,97 +1,97 b''
1 https://bz.mercurial-scm.org/1175
1 https://bz.mercurial-scm.org/1175
2
2
3 $ hg init
3 $ hg init
4 $ touch a
4 $ touch a
5 $ hg ci -Am0
5 $ hg ci -Am0
6 adding a
6 adding a
7
7
8 $ hg mv a a1
8 $ hg mv a a1
9 $ hg ci -m1
9 $ hg ci -m1
10
10
11 $ hg co 0
11 $ hg co 0
12 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
13
13
14 $ hg mv a a2
14 $ hg mv a a2
15 $ hg up
15 $ hg up
16 note: possible conflict - a was renamed multiple times to:
16 note: possible conflict - a was renamed multiple times to:
17 a2
17 a2
18 a1
18 a1
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20
20
21 $ hg ci -m2
21 $ hg ci -m2
22
22
23 $ touch a
23 $ touch a
24 $ hg ci -Am3
24 $ hg ci -Am3
25 adding a
25 adding a
26
26
27 $ hg mv a b
27 $ hg mv a b
28 $ hg ci -Am4 a
28 $ hg ci -Am4 a
29
29
30 $ hg ci --debug --traceback -Am5 b
30 $ hg ci --debug --traceback -Am5 b
31 committing files:
31 committing files:
32 b
32 b
33 warning: can't find ancestor for 'b' copied from 'a'!
33 warning: can't find ancestor for 'b' copied from 'a'!
34 committing manifest
34 committing manifest
35 committing changelog
35 committing changelog
36 updating the branch cache
36 updating the branch cache
37 committed changeset 5:83a687e8a97c80992ba385bbfd766be181bfb1d1
37 committed changeset 5:83a687e8a97c80992ba385bbfd766be181bfb1d1
38
38
39 $ hg verify
39 $ hg verify
40 checking changesets
40 checking changesets
41 checking manifests
41 checking manifests
42 crosschecking files in changesets and manifests
42 crosschecking files in changesets and manifests
43 checking files
43 checking files
44 4 files, 6 changesets, 4 total revisions
44 checked 6 changesets with 4 changes to 4 files
45
45
46 $ hg export --git tip
46 $ hg export --git tip
47 # HG changeset patch
47 # HG changeset patch
48 # User test
48 # User test
49 # Date 0 0
49 # Date 0 0
50 # Thu Jan 01 00:00:00 1970 +0000
50 # Thu Jan 01 00:00:00 1970 +0000
51 # Node ID 83a687e8a97c80992ba385bbfd766be181bfb1d1
51 # Node ID 83a687e8a97c80992ba385bbfd766be181bfb1d1
52 # Parent 1d1625283f71954f21d14c3d44d0ad3c019c597f
52 # Parent 1d1625283f71954f21d14c3d44d0ad3c019c597f
53 5
53 5
54
54
55 diff --git a/b b/b
55 diff --git a/b b/b
56 new file mode 100644
56 new file mode 100644
57
57
58 https://bz.mercurial-scm.org/show_bug.cgi?id=4476
58 https://bz.mercurial-scm.org/show_bug.cgi?id=4476
59
59
60 $ hg init foo
60 $ hg init foo
61 $ cd foo
61 $ cd foo
62 $ touch a && hg ci -Aqm a
62 $ touch a && hg ci -Aqm a
63 $ hg mv a b
63 $ hg mv a b
64 $ echo b1 >> b
64 $ echo b1 >> b
65 $ hg ci -Aqm b1
65 $ hg ci -Aqm b1
66 $ hg up 0
66 $ hg up 0
67 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
67 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
68 $ hg mv a b
68 $ hg mv a b
69 $ echo b2 >> b
69 $ echo b2 >> b
70 $ hg ci -Aqm b2
70 $ hg ci -Aqm b2
71 $ hg graft 1
71 $ hg graft 1
72 grafting 1:5974126fad84 "b1"
72 grafting 1:5974126fad84 "b1"
73 merging b
73 merging b
74 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
74 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
75 abort: unresolved conflicts, can't continue
75 abort: unresolved conflicts, can't continue
76 (use 'hg resolve' and 'hg graft --continue')
76 (use 'hg resolve' and 'hg graft --continue')
77 [255]
77 [255]
78 $ echo a > b
78 $ echo a > b
79 $ echo b3 >> b
79 $ echo b3 >> b
80 $ hg resolve --mark b
80 $ hg resolve --mark b
81 (no more unresolved files)
81 (no more unresolved files)
82 continue: hg graft --continue
82 continue: hg graft --continue
83 $ hg graft --continue
83 $ hg graft --continue
84 grafting 1:5974126fad84 "b1"
84 grafting 1:5974126fad84 "b1"
85 warning: can't find ancestor for 'b' copied from 'a'!
85 warning: can't find ancestor for 'b' copied from 'a'!
86 $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n'
86 $ hg log -f b -T 'changeset: {rev}:{node|short}\nsummary: {desc}\n\n'
87 changeset: 3:376d30ccffc0
87 changeset: 3:376d30ccffc0
88 summary: b1
88 summary: b1
89
89
90 changeset: 2:416baaa2e5e4
90 changeset: 2:416baaa2e5e4
91 summary: b2
91 summary: b2
92
92
93 changeset: 0:3903775176ed
93 changeset: 0:3903775176ed
94 summary: a
94 summary: a
95
95
96
96
97
97
@@ -1,37 +1,37 b''
1 $ hg init
1 $ hg init
2 $ echo a > a
2 $ echo a > a
3 $ hg ci -Am0
3 $ hg ci -Am0
4 adding a
4 adding a
5
5
6 $ hg -q clone . foo
6 $ hg -q clone . foo
7
7
8 $ touch .hg/store/journal
8 $ touch .hg/store/journal
9
9
10 $ echo foo > a
10 $ echo foo > a
11 $ hg ci -Am0
11 $ hg ci -Am0
12 abort: abandoned transaction found!
12 abort: abandoned transaction found!
13 (run 'hg recover' to clean up transaction)
13 (run 'hg recover' to clean up transaction)
14 [255]
14 [255]
15
15
16 $ hg recover
16 $ hg recover
17 rolling back interrupted transaction
17 rolling back interrupted transaction
18 checking changesets
18 checking changesets
19 checking manifests
19 checking manifests
20 crosschecking files in changesets and manifests
20 crosschecking files in changesets and manifests
21 checking files
21 checking files
22 1 files, 1 changesets, 1 total revisions
22 checked 1 changesets with 1 changes to 1 files
23
23
24 Check that zero-size journals are correctly aborted:
24 Check that zero-size journals are correctly aborted:
25
25
26 #if unix-permissions no-root
26 #if unix-permissions no-root
27 $ hg bundle -qa repo.hg
27 $ hg bundle -qa repo.hg
28 $ chmod -w foo/.hg/store/00changelog.i
28 $ chmod -w foo/.hg/store/00changelog.i
29
29
30 $ hg -R foo unbundle repo.hg
30 $ hg -R foo unbundle repo.hg
31 adding changesets
31 adding changesets
32 abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob)
32 abort: Permission denied: $TESTTMP/foo/.hg/store/.00changelog.i-* (glob)
33 [255]
33 [255]
34
34
35 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
35 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
36 #endif
36 #endif
37
37
@@ -1,1480 +1,1480 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 Run kwdemo outside a repo
3 Run kwdemo outside a repo
4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
4 $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo
5 [extensions]
5 [extensions]
6 keyword =
6 keyword =
7 [keyword]
7 [keyword]
8 demo.txt =
8 demo.txt =
9 [keywordset]
9 [keywordset]
10 svn = False
10 svn = False
11 [keywordmaps]
11 [keywordmaps]
12 Foo = {author|user}
12 Foo = {author|user}
13 $Foo: test $
13 $Foo: test $
14
14
15 $ cat <<EOF >> $HGRCPATH
15 $ cat <<EOF >> $HGRCPATH
16 > [extensions]
16 > [extensions]
17 > keyword =
17 > keyword =
18 > mq =
18 > mq =
19 > notify =
19 > notify =
20 > record =
20 > record =
21 > transplant =
21 > transplant =
22 > [ui]
22 > [ui]
23 > interactive = true
23 > interactive = true
24 > EOF
24 > EOF
25
25
26 hide outer repo
26 hide outer repo
27 $ hg init
27 $ hg init
28
28
29 Run kwdemo before [keyword] files are set up
29 Run kwdemo before [keyword] files are set up
30 as it would succeed without uisetup otherwise
30 as it would succeed without uisetup otherwise
31
31
32 $ hg --quiet kwdemo
32 $ hg --quiet kwdemo
33 [extensions]
33 [extensions]
34 keyword =
34 keyword =
35 [keyword]
35 [keyword]
36 demo.txt =
36 demo.txt =
37 [keywordset]
37 [keywordset]
38 svn = False
38 svn = False
39 [keywordmaps]
39 [keywordmaps]
40 Author = {author|user}
40 Author = {author|user}
41 Date = {date|utcdate}
41 Date = {date|utcdate}
42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
42 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
43 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
44 RCSFile = {file|basename},v
44 RCSFile = {file|basename},v
45 RCSfile = {file|basename},v
45 RCSfile = {file|basename},v
46 Revision = {node|short}
46 Revision = {node|short}
47 Source = {root}/{file},v
47 Source = {root}/{file},v
48 $Author: test $
48 $Author: test $
49 $Date: ????/??/?? ??:??:?? $ (glob)
49 $Date: ????/??/?? ??:??:?? $ (glob)
50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
50 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
51 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
52 $RCSFile: demo.txt,v $
52 $RCSFile: demo.txt,v $
53 $RCSfile: demo.txt,v $
53 $RCSfile: demo.txt,v $
54 $Revision: ???????????? $ (glob)
54 $Revision: ???????????? $ (glob)
55 $Source: */demo.txt,v $ (glob)
55 $Source: */demo.txt,v $ (glob)
56
56
57 $ hg --quiet kwdemo "Branch = {branches}"
57 $ hg --quiet kwdemo "Branch = {branches}"
58 [extensions]
58 [extensions]
59 keyword =
59 keyword =
60 [keyword]
60 [keyword]
61 demo.txt =
61 demo.txt =
62 [keywordset]
62 [keywordset]
63 svn = False
63 svn = False
64 [keywordmaps]
64 [keywordmaps]
65 Branch = {branches}
65 Branch = {branches}
66 $Branch: demobranch $
66 $Branch: demobranch $
67
67
68 (test template filter svnisodate and svnutcdate)
68 (test template filter svnisodate and svnutcdate)
69
69
70 $ hg --quiet kwdemo --config keywordset.svn=True
70 $ hg --quiet kwdemo --config keywordset.svn=True
71 [extensions]
71 [extensions]
72 keyword =
72 keyword =
73 [keyword]
73 [keyword]
74 demo.txt =
74 demo.txt =
75 [keywordset]
75 [keywordset]
76 svn = True
76 svn = True
77 [keywordmaps]
77 [keywordmaps]
78 Author = {author|user}
78 Author = {author|user}
79 Date = {date|svnisodate}
79 Date = {date|svnisodate}
80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
80 Id = {file|basename},v {node|short} {date|svnutcdate} {author|user}
81 LastChangedBy = {author|user}
81 LastChangedBy = {author|user}
82 LastChangedDate = {date|svnisodate}
82 LastChangedDate = {date|svnisodate}
83 LastChangedRevision = {node|short}
83 LastChangedRevision = {node|short}
84 Revision = {node|short}
84 Revision = {node|short}
85 $Author: test $
85 $Author: test $
86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
86 $Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
87 $Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob)
88 $LastChangedBy: test $
88 $LastChangedBy: test $
89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
89 $LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob)
90 $LastChangedRevision: ???????????? $ (glob)
90 $LastChangedRevision: ???????????? $ (glob)
91 $Revision: ???????????? $ (glob)
91 $Revision: ???????????? $ (glob)
92
92
93 $ cat <<EOF >> $HGRCPATH
93 $ cat <<EOF >> $HGRCPATH
94 > [keyword]
94 > [keyword]
95 > ** =
95 > ** =
96 > b = ignore
96 > b = ignore
97 > i = ignore
97 > i = ignore
98 > [hooks]
98 > [hooks]
99 > EOF
99 > EOF
100 $ cp $HGRCPATH $HGRCPATH.nohooks
100 $ cp $HGRCPATH $HGRCPATH.nohooks
101 > cat <<EOF >> $HGRCPATH
101 > cat <<EOF >> $HGRCPATH
102 > commit=
102 > commit=
103 > commit.test=cp a hooktest
103 > commit.test=cp a hooktest
104 > EOF
104 > EOF
105
105
106 $ hg init Test-bndl
106 $ hg init Test-bndl
107 $ cd Test-bndl
107 $ cd Test-bndl
108
108
109 kwshrink should exit silently in empty/invalid repo
109 kwshrink should exit silently in empty/invalid repo
110
110
111 $ hg kwshrink
111 $ hg kwshrink
112
112
113 Symlinks cannot be created on Windows.
113 Symlinks cannot be created on Windows.
114 A bundle to test this was made with:
114 A bundle to test this was made with:
115 hg init t
115 hg init t
116 cd t
116 cd t
117 echo a > a
117 echo a > a
118 ln -s a sym
118 ln -s a sym
119 hg add sym
119 hg add sym
120 hg ci -m addsym -u mercurial
120 hg ci -m addsym -u mercurial
121 hg bundle --base null ../test-keyword.hg
121 hg bundle --base null ../test-keyword.hg
122
122
123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
123 $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 1 changesets with 1 changes to 1 files
127 added 1 changesets with 1 changes to 1 files
128 new changesets a2392c293916 (1 drafts)
128 new changesets a2392c293916 (1 drafts)
129 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
130 $ hg up a2392c293916
130 $ hg up a2392c293916
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132
132
133 $ echo 'expand $Id$' > a
133 $ echo 'expand $Id$' > a
134 $ echo 'do not process $Id:' >> a
134 $ echo 'do not process $Id:' >> a
135 $ echo 'xxx $' >> a
135 $ echo 'xxx $' >> a
136 $ echo 'ignore $Id$' > b
136 $ echo 'ignore $Id$' > b
137
137
138 Output files as they were created
138 Output files as they were created
139
139
140 $ cat a b
140 $ cat a b
141 expand $Id$
141 expand $Id$
142 do not process $Id:
142 do not process $Id:
143 xxx $
143 xxx $
144 ignore $Id$
144 ignore $Id$
145
145
146 no kwfiles
146 no kwfiles
147
147
148 $ hg kwfiles
148 $ hg kwfiles
149
149
150 untracked candidates
150 untracked candidates
151
151
152 $ hg -v kwfiles --unknown
152 $ hg -v kwfiles --unknown
153 k a
153 k a
154
154
155 Add files and check status
155 Add files and check status
156
156
157 $ hg addremove
157 $ hg addremove
158 adding a
158 adding a
159 adding b
159 adding b
160 $ hg status
160 $ hg status
161 A a
161 A a
162 A b
162 A b
163
163
164
164
165 Default keyword expansion including commit hook
165 Default keyword expansion including commit hook
166 Interrupted commit should not change state or run commit hook
166 Interrupted commit should not change state or run commit hook
167
167
168 $ hg --debug commit
168 $ hg --debug commit
169 abort: empty commit message
169 abort: empty commit message
170 [255]
170 [255]
171 $ hg status
171 $ hg status
172 A a
172 A a
173 A b
173 A b
174
174
175 Commit with several checks
175 Commit with several checks
176
176
177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
177 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
178 committing files:
178 committing files:
179 a
179 a
180 b
180 b
181 committing manifest
181 committing manifest
182 committing changelog
182 committing changelog
183 overwriting a expanding keywords
183 overwriting a expanding keywords
184 updating the branch cache
184 updating the branch cache
185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
185 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
186 running hook commit.test: cp a hooktest
186 running hook commit.test: cp a hooktest
187 $ hg status
187 $ hg status
188 ? hooktest
188 ? hooktest
189 $ hg debugrebuildstate
189 $ hg debugrebuildstate
190 $ hg --quiet identify
190 $ hg --quiet identify
191 ef63ca68695b
191 ef63ca68695b
192
192
193 cat files in working directory with keywords expanded
193 cat files in working directory with keywords expanded
194
194
195 $ cat a b
195 $ cat a b
196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
196 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
197 do not process $Id:
197 do not process $Id:
198 xxx $
198 xxx $
199 ignore $Id$
199 ignore $Id$
200
200
201 hg cat files and symlink, no expansion
201 hg cat files and symlink, no expansion
202
202
203 $ hg cat sym a b && echo
203 $ hg cat sym a b && echo
204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
204 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
205 do not process $Id:
205 do not process $Id:
206 xxx $
206 xxx $
207 ignore $Id$
207 ignore $Id$
208 a
208 a
209
209
210 $ diff a hooktest
210 $ diff a hooktest
211
211
212 $ cp $HGRCPATH.nohooks $HGRCPATH
212 $ cp $HGRCPATH.nohooks $HGRCPATH
213 $ rm hooktest
213 $ rm hooktest
214
214
215 hg status of kw-ignored binary file starting with '\1\n'
215 hg status of kw-ignored binary file starting with '\1\n'
216
216
217 >>> open("i", "wb").write("\1\nfoo")
217 >>> open("i", "wb").write("\1\nfoo")
218 $ hg -q commit -Am metasep i
218 $ hg -q commit -Am metasep i
219 $ hg status
219 $ hg status
220 >>> open("i", "wb").write("\1\nbar")
220 >>> open("i", "wb").write("\1\nbar")
221 $ hg status
221 $ hg status
222 M i
222 M i
223 $ hg -q commit -m "modify metasep" i
223 $ hg -q commit -m "modify metasep" i
224 $ hg status --rev 2:3
224 $ hg status --rev 2:3
225 M i
225 M i
226 $ touch empty
226 $ touch empty
227 $ hg -q commit -A -m "another file"
227 $ hg -q commit -A -m "another file"
228 $ hg status -A --rev 3:4 i
228 $ hg status -A --rev 3:4 i
229 C i
229 C i
230
230
231 $ hg -q strip --no-backup 2
231 $ hg -q strip --no-backup 2
232
232
233 Test hook execution
233 Test hook execution
234
234
235 bundle
235 bundle
236
236
237 $ hg bundle --base null ../kw.hg
237 $ hg bundle --base null ../kw.hg
238 2 changesets found
238 2 changesets found
239 $ cd ..
239 $ cd ..
240 $ hg init Test
240 $ hg init Test
241 $ cd Test
241 $ cd Test
242
242
243 Notify on pull to check whether keywords stay as is in email
243 Notify on pull to check whether keywords stay as is in email
244 ie. if patch.diff wrapper acts as it should
244 ie. if patch.diff wrapper acts as it should
245
245
246 $ cat <<EOF >> $HGRCPATH
246 $ cat <<EOF >> $HGRCPATH
247 > [hooks]
247 > [hooks]
248 > incoming.notify = python:hgext.notify.hook
248 > incoming.notify = python:hgext.notify.hook
249 > [notify]
249 > [notify]
250 > sources = pull
250 > sources = pull
251 > diffstat = False
251 > diffstat = False
252 > maxsubject = 15
252 > maxsubject = 15
253 > [reposubs]
253 > [reposubs]
254 > * = Test
254 > * = Test
255 > EOF
255 > EOF
256
256
257 Pull from bundle and trigger notify
257 Pull from bundle and trigger notify
258
258
259 $ hg pull -u ../kw.hg
259 $ hg pull -u ../kw.hg
260 pulling from ../kw.hg
260 pulling from ../kw.hg
261 requesting all changes
261 requesting all changes
262 adding changesets
262 adding changesets
263 adding manifests
263 adding manifests
264 adding file changes
264 adding file changes
265 added 2 changesets with 3 changes to 3 files
265 added 2 changesets with 3 changes to 3 files
266 new changesets a2392c293916:ef63ca68695b (2 drafts)
266 new changesets a2392c293916:ef63ca68695b (2 drafts)
267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 MIME-Version: 1.0
268 MIME-Version: 1.0
269 Content-Type: text/plain; charset="us-ascii"
269 Content-Type: text/plain; charset="us-ascii"
270 Content-Transfer-Encoding: 7bit
270 Content-Transfer-Encoding: 7bit
271 Date: * (glob)
271 Date: * (glob)
272 Subject: changeset in...
272 Subject: changeset in...
273 From: mercurial
273 From: mercurial
274 X-Hg-Notification: changeset a2392c293916
274 X-Hg-Notification: changeset a2392c293916
275 Message-Id: <hg.a2392c293916*> (glob)
275 Message-Id: <hg.a2392c293916*> (glob)
276 To: Test
276 To: Test
277
277
278 changeset a2392c293916 in $TESTTMP/Test
278 changeset a2392c293916 in $TESTTMP/Test
279 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
279 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
280 description:
280 description:
281 addsym
281 addsym
282
282
283 diffs (6 lines):
283 diffs (6 lines):
284
284
285 diff -r 000000000000 -r a2392c293916 sym
285 diff -r 000000000000 -r a2392c293916 sym
286 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
286 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
287 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
288 @@ -0,0 +1,1 @@
288 @@ -0,0 +1,1 @@
289 +a
289 +a
290 \ No newline at end of file
290 \ No newline at end of file
291 MIME-Version: 1.0
291 MIME-Version: 1.0
292 Content-Type: text/plain; charset="us-ascii"
292 Content-Type: text/plain; charset="us-ascii"
293 Content-Transfer-Encoding: 7bit
293 Content-Transfer-Encoding: 7bit
294 Date:* (glob)
294 Date:* (glob)
295 Subject: changeset in...
295 Subject: changeset in...
296 From: User Name <user@example.com>
296 From: User Name <user@example.com>
297 X-Hg-Notification: changeset ef63ca68695b
297 X-Hg-Notification: changeset ef63ca68695b
298 Message-Id: <hg.ef63ca68695b*> (glob)
298 Message-Id: <hg.ef63ca68695b*> (glob)
299 To: Test
299 To: Test
300
300
301 changeset ef63ca68695b in $TESTTMP/Test
301 changeset ef63ca68695b in $TESTTMP/Test
302 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
302 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
303 description:
303 description:
304 absym
304 absym
305
305
306 diffs (12 lines):
306 diffs (12 lines):
307
307
308 diff -r a2392c293916 -r ef63ca68695b a
308 diff -r a2392c293916 -r ef63ca68695b a
309 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
309 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310 +++ b/a Thu Jan 01 00:00:00 1970 +0000
310 +++ b/a Thu Jan 01 00:00:00 1970 +0000
311 @@ -0,0 +1,3 @@
311 @@ -0,0 +1,3 @@
312 +expand $Id$
312 +expand $Id$
313 +do not process $Id:
313 +do not process $Id:
314 +xxx $
314 +xxx $
315 diff -r a2392c293916 -r ef63ca68695b b
315 diff -r a2392c293916 -r ef63ca68695b b
316 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
316 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
317 +++ b/b Thu Jan 01 00:00:00 1970 +0000
317 +++ b/b Thu Jan 01 00:00:00 1970 +0000
318 @@ -0,0 +1,1 @@
318 @@ -0,0 +1,1 @@
319 +ignore $Id$
319 +ignore $Id$
320
320
321 $ cp $HGRCPATH.nohooks $HGRCPATH
321 $ cp $HGRCPATH.nohooks $HGRCPATH
322
322
323 Touch files and check with status
323 Touch files and check with status
324
324
325 $ touch a b
325 $ touch a b
326 $ hg status
326 $ hg status
327
327
328 Update and expand
328 Update and expand
329
329
330 $ rm sym a b
330 $ rm sym a b
331 $ hg update -C
331 $ hg update -C
332 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 $ cat a b
333 $ cat a b
334 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
334 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
335 do not process $Id:
335 do not process $Id:
336 xxx $
336 xxx $
337 ignore $Id$
337 ignore $Id$
338
338
339 Check whether expansion is filewise and file mode is preserved
339 Check whether expansion is filewise and file mode is preserved
340
340
341 $ echo '$Id$' > c
341 $ echo '$Id$' > c
342 $ echo 'tests for different changenodes' >> c
342 $ echo 'tests for different changenodes' >> c
343 #if unix-permissions
343 #if unix-permissions
344 $ chmod 600 c
344 $ chmod 600 c
345 $ ls -l c | cut -b 1-10
345 $ ls -l c | cut -b 1-10
346 -rw-------
346 -rw-------
347 #endif
347 #endif
348
348
349 commit file c
349 commit file c
350
350
351 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
351 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
352 adding c
352 adding c
353 #if unix-permissions
353 #if unix-permissions
354 $ ls -l c | cut -b 1-10
354 $ ls -l c | cut -b 1-10
355 -rw-------
355 -rw-------
356 #endif
356 #endif
357
357
358 force expansion
358 force expansion
359
359
360 $ hg -v kwexpand
360 $ hg -v kwexpand
361 overwriting a expanding keywords
361 overwriting a expanding keywords
362 overwriting c expanding keywords
362 overwriting c expanding keywords
363
363
364 compare changenodes in a and c
364 compare changenodes in a and c
365
365
366 $ cat a c
366 $ cat a c
367 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
367 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
368 do not process $Id:
368 do not process $Id:
369 xxx $
369 xxx $
370 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
370 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
371 tests for different changenodes
371 tests for different changenodes
372
372
373 record
373 record
374
374
375 $ echo '$Id$' > r
375 $ echo '$Id$' > r
376 $ hg add r
376 $ hg add r
377
377
378 record chunk
378 record chunk
379
379
380 >>> lines = open('a', 'rb').readlines()
380 >>> lines = open('a', 'rb').readlines()
381 >>> lines.insert(1, 'foo\n')
381 >>> lines.insert(1, 'foo\n')
382 >>> lines.append('bar\n')
382 >>> lines.append('bar\n')
383 >>> open('a', 'wb').writelines(lines)
383 >>> open('a', 'wb').writelines(lines)
384 $ hg record -d '10 1' -m rectest a<<EOF
384 $ hg record -d '10 1' -m rectest a<<EOF
385 > y
385 > y
386 > y
386 > y
387 > n
387 > n
388 > EOF
388 > EOF
389 diff --git a/a b/a
389 diff --git a/a b/a
390 2 hunks, 2 lines changed
390 2 hunks, 2 lines changed
391 examine changes to 'a'? [Ynesfdaq?] y
391 examine changes to 'a'? [Ynesfdaq?] y
392
392
393 @@ -1,3 +1,4 @@
393 @@ -1,3 +1,4 @@
394 expand $Id$
394 expand $Id$
395 +foo
395 +foo
396 do not process $Id:
396 do not process $Id:
397 xxx $
397 xxx $
398 record change 1/2 to 'a'? [Ynesfdaq?] y
398 record change 1/2 to 'a'? [Ynesfdaq?] y
399
399
400 @@ -2,2 +3,3 @@
400 @@ -2,2 +3,3 @@
401 do not process $Id:
401 do not process $Id:
402 xxx $
402 xxx $
403 +bar
403 +bar
404 record change 2/2 to 'a'? [Ynesfdaq?] n
404 record change 2/2 to 'a'? [Ynesfdaq?] n
405
405
406
406
407 $ hg identify
407 $ hg identify
408 5f5eb23505c3+ tip
408 5f5eb23505c3+ tip
409 $ hg status
409 $ hg status
410 M a
410 M a
411 A r
411 A r
412
412
413 Cat modified file a
413 Cat modified file a
414
414
415 $ cat a
415 $ cat a
416 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
416 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
417 foo
417 foo
418 do not process $Id:
418 do not process $Id:
419 xxx $
419 xxx $
420 bar
420 bar
421
421
422 Diff remaining chunk
422 Diff remaining chunk
423
423
424 $ hg diff a
424 $ hg diff a
425 diff -r 5f5eb23505c3 a
425 diff -r 5f5eb23505c3 a
426 --- a/a Thu Jan 01 00:00:09 1970 -0000
426 --- a/a Thu Jan 01 00:00:09 1970 -0000
427 +++ b/a * (glob)
427 +++ b/a * (glob)
428 @@ -2,3 +2,4 @@
428 @@ -2,3 +2,4 @@
429 foo
429 foo
430 do not process $Id:
430 do not process $Id:
431 xxx $
431 xxx $
432 +bar
432 +bar
433
433
434 $ hg rollback
434 $ hg rollback
435 repository tip rolled back to revision 2 (undo commit)
435 repository tip rolled back to revision 2 (undo commit)
436 working directory now based on revision 2
436 working directory now based on revision 2
437
437
438 Record all chunks in file a
438 Record all chunks in file a
439
439
440 $ echo foo > msg
440 $ echo foo > msg
441
441
442 - do not use "hg record -m" here!
442 - do not use "hg record -m" here!
443
443
444 $ hg record -l msg -d '11 1' a<<EOF
444 $ hg record -l msg -d '11 1' a<<EOF
445 > y
445 > y
446 > y
446 > y
447 > y
447 > y
448 > EOF
448 > EOF
449 diff --git a/a b/a
449 diff --git a/a b/a
450 2 hunks, 2 lines changed
450 2 hunks, 2 lines changed
451 examine changes to 'a'? [Ynesfdaq?] y
451 examine changes to 'a'? [Ynesfdaq?] y
452
452
453 @@ -1,3 +1,4 @@
453 @@ -1,3 +1,4 @@
454 expand $Id$
454 expand $Id$
455 +foo
455 +foo
456 do not process $Id:
456 do not process $Id:
457 xxx $
457 xxx $
458 record change 1/2 to 'a'? [Ynesfdaq?] y
458 record change 1/2 to 'a'? [Ynesfdaq?] y
459
459
460 @@ -2,2 +3,3 @@
460 @@ -2,2 +3,3 @@
461 do not process $Id:
461 do not process $Id:
462 xxx $
462 xxx $
463 +bar
463 +bar
464 record change 2/2 to 'a'? [Ynesfdaq?] y
464 record change 2/2 to 'a'? [Ynesfdaq?] y
465
465
466
466
467 File a should be clean
467 File a should be clean
468
468
469 $ hg status -A a
469 $ hg status -A a
470 C a
470 C a
471
471
472 rollback and revert expansion
472 rollback and revert expansion
473
473
474 $ cat a
474 $ cat a
475 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
475 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
476 foo
476 foo
477 do not process $Id:
477 do not process $Id:
478 xxx $
478 xxx $
479 bar
479 bar
480 $ hg --verbose rollback
480 $ hg --verbose rollback
481 repository tip rolled back to revision 2 (undo commit)
481 repository tip rolled back to revision 2 (undo commit)
482 working directory now based on revision 2
482 working directory now based on revision 2
483 overwriting a expanding keywords
483 overwriting a expanding keywords
484 $ hg status a
484 $ hg status a
485 M a
485 M a
486 $ cat a
486 $ cat a
487 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
487 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
488 foo
488 foo
489 do not process $Id:
489 do not process $Id:
490 xxx $
490 xxx $
491 bar
491 bar
492 $ echo '$Id$' > y
492 $ echo '$Id$' > y
493 $ echo '$Id$' > z
493 $ echo '$Id$' > z
494 $ hg add y
494 $ hg add y
495 $ hg commit -Am "rollback only" z
495 $ hg commit -Am "rollback only" z
496 $ cat z
496 $ cat z
497 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
497 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
498 $ hg --verbose rollback
498 $ hg --verbose rollback
499 repository tip rolled back to revision 2 (undo commit)
499 repository tip rolled back to revision 2 (undo commit)
500 working directory now based on revision 2
500 working directory now based on revision 2
501 overwriting z shrinking keywords
501 overwriting z shrinking keywords
502
502
503 Only z should be overwritten
503 Only z should be overwritten
504
504
505 $ hg status a y z
505 $ hg status a y z
506 M a
506 M a
507 A y
507 A y
508 A z
508 A z
509 $ cat z
509 $ cat z
510 $Id$
510 $Id$
511 $ hg forget y z
511 $ hg forget y z
512 $ rm y z
512 $ rm y z
513
513
514 record added file alone
514 record added file alone
515
515
516 $ hg -v record -l msg -d '12 2' r<<EOF
516 $ hg -v record -l msg -d '12 2' r<<EOF
517 > y
517 > y
518 > y
518 > y
519 > EOF
519 > EOF
520 diff --git a/r b/r
520 diff --git a/r b/r
521 new file mode 100644
521 new file mode 100644
522 examine changes to 'r'? [Ynesfdaq?] y
522 examine changes to 'r'? [Ynesfdaq?] y
523
523
524 @@ -0,0 +1,1 @@
524 @@ -0,0 +1,1 @@
525 +$Id$
525 +$Id$
526 record this change to 'r'? [Ynesfdaq?] y
526 record this change to 'r'? [Ynesfdaq?] y
527
527
528 resolving manifests
528 resolving manifests
529 patching file r
529 patching file r
530 committing files:
530 committing files:
531 r
531 r
532 committing manifest
532 committing manifest
533 committing changelog
533 committing changelog
534 committed changeset 3:82a2f715724d
534 committed changeset 3:82a2f715724d
535 overwriting r expanding keywords
535 overwriting r expanding keywords
536 $ hg status r
536 $ hg status r
537 $ hg --verbose rollback
537 $ hg --verbose rollback
538 repository tip rolled back to revision 2 (undo commit)
538 repository tip rolled back to revision 2 (undo commit)
539 working directory now based on revision 2
539 working directory now based on revision 2
540 overwriting r shrinking keywords
540 overwriting r shrinking keywords
541 $ hg forget r
541 $ hg forget r
542 $ rm msg r
542 $ rm msg r
543 $ hg update -C
543 $ hg update -C
544 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
545
545
546 record added keyword ignored file
546 record added keyword ignored file
547
547
548 $ echo '$Id$' > i
548 $ echo '$Id$' > i
549 $ hg add i
549 $ hg add i
550 $ hg --verbose record -d '13 1' -m recignored<<EOF
550 $ hg --verbose record -d '13 1' -m recignored<<EOF
551 > y
551 > y
552 > y
552 > y
553 > EOF
553 > EOF
554 diff --git a/i b/i
554 diff --git a/i b/i
555 new file mode 100644
555 new file mode 100644
556 examine changes to 'i'? [Ynesfdaq?] y
556 examine changes to 'i'? [Ynesfdaq?] y
557
557
558 @@ -0,0 +1,1 @@
558 @@ -0,0 +1,1 @@
559 +$Id$
559 +$Id$
560 record this change to 'i'? [Ynesfdaq?] y
560 record this change to 'i'? [Ynesfdaq?] y
561
561
562 resolving manifests
562 resolving manifests
563 patching file i
563 patching file i
564 committing files:
564 committing files:
565 i
565 i
566 committing manifest
566 committing manifest
567 committing changelog
567 committing changelog
568 committed changeset 3:9f40ceb5a072
568 committed changeset 3:9f40ceb5a072
569 $ cat i
569 $ cat i
570 $Id$
570 $Id$
571 $ hg -q rollback
571 $ hg -q rollback
572 $ hg forget i
572 $ hg forget i
573 $ rm i
573 $ rm i
574
574
575 amend
575 amend
576
576
577 $ echo amend >> a
577 $ echo amend >> a
578 $ echo amend >> b
578 $ echo amend >> b
579 $ hg -q commit -d '14 1' -m 'prepare amend'
579 $ hg -q commit -d '14 1' -m 'prepare amend'
580
580
581 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
581 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
582 overwriting a expanding keywords
582 overwriting a expanding keywords
583 $ hg -q id
583 $ hg -q id
584 67d8c481a6be
584 67d8c481a6be
585 $ head -1 a
585 $ head -1 a
586 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
586 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
587
587
588 $ hg -q strip --no-backup tip
588 $ hg -q strip --no-backup tip
589
589
590 Test patch queue repo
590 Test patch queue repo
591
591
592 $ hg init --mq
592 $ hg init --mq
593 $ hg qimport -r tip -n mqtest.diff
593 $ hg qimport -r tip -n mqtest.diff
594 $ hg commit --mq -m mqtest
594 $ hg commit --mq -m mqtest
595
595
596 Keywords should not be expanded in patch
596 Keywords should not be expanded in patch
597
597
598 $ cat .hg/patches/mqtest.diff
598 $ cat .hg/patches/mqtest.diff
599 # HG changeset patch
599 # HG changeset patch
600 # User User Name <user@example.com>
600 # User User Name <user@example.com>
601 # Date 1 0
601 # Date 1 0
602 # Thu Jan 01 00:00:01 1970 +0000
602 # Thu Jan 01 00:00:01 1970 +0000
603 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
603 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
604 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
604 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
605 cndiff
605 cndiff
606
606
607 diff -r ef63ca68695b -r 40a904bbbe4c c
607 diff -r ef63ca68695b -r 40a904bbbe4c c
608 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
608 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 +++ b/c Thu Jan 01 00:00:01 1970 +0000
609 +++ b/c Thu Jan 01 00:00:01 1970 +0000
610 @@ -0,0 +1,2 @@
610 @@ -0,0 +1,2 @@
611 +$Id$
611 +$Id$
612 +tests for different changenodes
612 +tests for different changenodes
613
613
614 $ hg qpop
614 $ hg qpop
615 popping mqtest.diff
615 popping mqtest.diff
616 patch queue now empty
616 patch queue now empty
617
617
618 qgoto, implying qpush, should expand
618 qgoto, implying qpush, should expand
619
619
620 $ hg qgoto mqtest.diff
620 $ hg qgoto mqtest.diff
621 applying mqtest.diff
621 applying mqtest.diff
622 now at: mqtest.diff
622 now at: mqtest.diff
623 $ cat c
623 $ cat c
624 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
624 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
625 tests for different changenodes
625 tests for different changenodes
626 $ hg cat c
626 $ hg cat c
627 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
627 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
628 tests for different changenodes
628 tests for different changenodes
629
629
630 Keywords should not be expanded in filelog
630 Keywords should not be expanded in filelog
631
631
632 $ hg --config 'extensions.keyword=!' cat c
632 $ hg --config 'extensions.keyword=!' cat c
633 $Id$
633 $Id$
634 tests for different changenodes
634 tests for different changenodes
635
635
636 qpop and move on
636 qpop and move on
637
637
638 $ hg qpop
638 $ hg qpop
639 popping mqtest.diff
639 popping mqtest.diff
640 patch queue now empty
640 patch queue now empty
641
641
642 Copy and show added kwfiles
642 Copy and show added kwfiles
643
643
644 $ hg cp a c
644 $ hg cp a c
645 $ hg kwfiles
645 $ hg kwfiles
646 a
646 a
647 c
647 c
648
648
649 Commit and show expansion in original and copy
649 Commit and show expansion in original and copy
650
650
651 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
651 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
652 committing files:
652 committing files:
653 c
653 c
654 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
654 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
655 committing manifest
655 committing manifest
656 committing changelog
656 committing changelog
657 overwriting c expanding keywords
657 overwriting c expanding keywords
658 updating the branch cache
658 updating the branch cache
659 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
659 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
660 $ cat a c
660 $ cat a c
661 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
661 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
662 do not process $Id:
662 do not process $Id:
663 xxx $
663 xxx $
664 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
664 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
665 do not process $Id:
665 do not process $Id:
666 xxx $
666 xxx $
667
667
668 Touch copied c and check its status
668 Touch copied c and check its status
669
669
670 $ touch c
670 $ touch c
671 $ hg status
671 $ hg status
672
672
673 Copy kwfile to keyword ignored file unexpanding keywords
673 Copy kwfile to keyword ignored file unexpanding keywords
674
674
675 $ hg --verbose copy a i
675 $ hg --verbose copy a i
676 copying a to i
676 copying a to i
677 overwriting i shrinking keywords
677 overwriting i shrinking keywords
678 $ head -n 1 i
678 $ head -n 1 i
679 expand $Id$
679 expand $Id$
680 $ hg forget i
680 $ hg forget i
681 $ rm i
681 $ rm i
682
682
683 Copy ignored file to ignored file: no overwriting
683 Copy ignored file to ignored file: no overwriting
684
684
685 $ hg --verbose copy b i
685 $ hg --verbose copy b i
686 copying b to i
686 copying b to i
687 $ hg forget i
687 $ hg forget i
688 $ rm i
688 $ rm i
689
689
690 cp symlink file; hg cp -A symlink file (part1)
690 cp symlink file; hg cp -A symlink file (part1)
691 - copied symlink points to kwfile: overwrite
691 - copied symlink points to kwfile: overwrite
692
692
693 #if symlink
693 #if symlink
694 $ cp sym i
694 $ cp sym i
695 $ ls -l i
695 $ ls -l i
696 -rw-r--r--* (glob)
696 -rw-r--r--* (glob)
697 $ head -1 i
697 $ head -1 i
698 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
698 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
699 $ hg copy --after --verbose sym i
699 $ hg copy --after --verbose sym i
700 copying sym to i
700 copying sym to i
701 overwriting i shrinking keywords
701 overwriting i shrinking keywords
702 $ head -1 i
702 $ head -1 i
703 expand $Id$
703 expand $Id$
704 $ hg forget i
704 $ hg forget i
705 $ rm i
705 $ rm i
706 #endif
706 #endif
707
707
708 Test different options of hg kwfiles
708 Test different options of hg kwfiles
709
709
710 $ hg kwfiles
710 $ hg kwfiles
711 a
711 a
712 c
712 c
713 $ hg -v kwfiles --ignore
713 $ hg -v kwfiles --ignore
714 I b
714 I b
715 I sym
715 I sym
716 $ hg kwfiles --all
716 $ hg kwfiles --all
717 K a
717 K a
718 K c
718 K c
719 I b
719 I b
720 I sym
720 I sym
721
721
722 Diff specific revision
722 Diff specific revision
723
723
724 $ hg diff --rev 1
724 $ hg diff --rev 1
725 diff -r ef63ca68695b c
725 diff -r ef63ca68695b c
726 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
726 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
727 +++ b/c * (glob)
727 +++ b/c * (glob)
728 @@ -0,0 +1,3 @@
728 @@ -0,0 +1,3 @@
729 +expand $Id$
729 +expand $Id$
730 +do not process $Id:
730 +do not process $Id:
731 +xxx $
731 +xxx $
732
732
733 Status after rollback:
733 Status after rollback:
734
734
735 $ hg rollback
735 $ hg rollback
736 repository tip rolled back to revision 1 (undo commit)
736 repository tip rolled back to revision 1 (undo commit)
737 working directory now based on revision 1
737 working directory now based on revision 1
738 $ hg status
738 $ hg status
739 A c
739 A c
740 $ hg update --clean
740 $ hg update --clean
741 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
742
742
743 #if symlink
743 #if symlink
744
744
745 cp symlink file; hg cp -A symlink file (part2)
745 cp symlink file; hg cp -A symlink file (part2)
746 - copied symlink points to kw ignored file: do not overwrite
746 - copied symlink points to kw ignored file: do not overwrite
747
747
748 $ cat a > i
748 $ cat a > i
749 $ ln -s i symignored
749 $ ln -s i symignored
750 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
750 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
751 $ cp symignored x
751 $ cp symignored x
752 $ hg copy --after --verbose symignored x
752 $ hg copy --after --verbose symignored x
753 copying symignored to x
753 copying symignored to x
754 $ head -n 1 x
754 $ head -n 1 x
755 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
755 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
756 $ hg forget x
756 $ hg forget x
757 $ rm x
757 $ rm x
758
758
759 $ hg rollback
759 $ hg rollback
760 repository tip rolled back to revision 1 (undo commit)
760 repository tip rolled back to revision 1 (undo commit)
761 working directory now based on revision 1
761 working directory now based on revision 1
762 $ hg update --clean
762 $ hg update --clean
763 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
763 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 $ rm i symignored
764 $ rm i symignored
765
765
766 #endif
766 #endif
767
767
768 Custom keywordmaps as argument to kwdemo
768 Custom keywordmaps as argument to kwdemo
769
769
770 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
770 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
771 [extensions]
771 [extensions]
772 keyword =
772 keyword =
773 [keyword]
773 [keyword]
774 ** =
774 ** =
775 b = ignore
775 b = ignore
776 demo.txt =
776 demo.txt =
777 i = ignore
777 i = ignore
778 [keywordset]
778 [keywordset]
779 svn = False
779 svn = False
780 [keywordmaps]
780 [keywordmaps]
781 Xinfo = {author}: {desc}
781 Xinfo = {author}: {desc}
782 $Xinfo: test: hg keyword configuration and expansion example $
782 $Xinfo: test: hg keyword configuration and expansion example $
783
783
784 Configure custom keywordmaps
784 Configure custom keywordmaps
785
785
786 $ cat <<EOF >>$HGRCPATH
786 $ cat <<EOF >>$HGRCPATH
787 > [keywordmaps]
787 > [keywordmaps]
788 > Id = {file} {node|short} {date|rfc822date} {author|user}
788 > Id = {file} {node|short} {date|rfc822date} {author|user}
789 > Xinfo = {author}: {desc}
789 > Xinfo = {author}: {desc}
790 > EOF
790 > EOF
791
791
792 Cat and hg cat files before custom expansion
792 Cat and hg cat files before custom expansion
793
793
794 $ cat a b
794 $ cat a b
795 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
795 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
796 do not process $Id:
796 do not process $Id:
797 xxx $
797 xxx $
798 ignore $Id$
798 ignore $Id$
799 $ hg cat sym a b && echo
799 $ hg cat sym a b && echo
800 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
800 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
801 do not process $Id:
801 do not process $Id:
802 xxx $
802 xxx $
803 ignore $Id$
803 ignore $Id$
804 a
804 a
805
805
806 Write custom keyword and prepare multi-line commit message
806 Write custom keyword and prepare multi-line commit message
807
807
808 $ echo '$Xinfo$' >> a
808 $ echo '$Xinfo$' >> a
809 $ cat <<EOF >> log
809 $ cat <<EOF >> log
810 > firstline
810 > firstline
811 > secondline
811 > secondline
812 > EOF
812 > EOF
813
813
814 Interrupted commit should not change state
814 Interrupted commit should not change state
815
815
816 $ hg commit
816 $ hg commit
817 abort: empty commit message
817 abort: empty commit message
818 [255]
818 [255]
819 $ hg status
819 $ hg status
820 M a
820 M a
821 ? c
821 ? c
822 ? log
822 ? log
823
823
824 Commit with multi-line message and custom expansion
824 Commit with multi-line message and custom expansion
825
825
826 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
826 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
827 committing files:
827 committing files:
828 a
828 a
829 committing manifest
829 committing manifest
830 committing changelog
830 committing changelog
831 overwriting a expanding keywords
831 overwriting a expanding keywords
832 updating the branch cache
832 updating the branch cache
833 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
833 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
834 $ rm log
834 $ rm log
835
835
836 Stat, verify and show custom expansion (firstline)
836 Stat, verify and show custom expansion (firstline)
837
837
838 $ hg status
838 $ hg status
839 ? c
839 ? c
840 $ hg verify
840 $ hg verify
841 checking changesets
841 checking changesets
842 checking manifests
842 checking manifests
843 crosschecking files in changesets and manifests
843 crosschecking files in changesets and manifests
844 checking files
844 checking files
845 3 files, 3 changesets, 4 total revisions
845 checked 3 changesets with 4 changes to 3 files
846 $ cat a b
846 $ cat a b
847 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
847 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
848 do not process $Id:
848 do not process $Id:
849 xxx $
849 xxx $
850 $Xinfo: User Name <user@example.com>: firstline $
850 $Xinfo: User Name <user@example.com>: firstline $
851 ignore $Id$
851 ignore $Id$
852 $ hg cat sym a b && echo
852 $ hg cat sym a b && echo
853 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
853 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
854 do not process $Id:
854 do not process $Id:
855 xxx $
855 xxx $
856 $Xinfo: User Name <user@example.com>: firstline $
856 $Xinfo: User Name <user@example.com>: firstline $
857 ignore $Id$
857 ignore $Id$
858 a
858 a
859
859
860 annotate
860 annotate
861
861
862 $ hg annotate a
862 $ hg annotate a
863 1: expand $Id$
863 1: expand $Id$
864 1: do not process $Id:
864 1: do not process $Id:
865 1: xxx $
865 1: xxx $
866 2: $Xinfo$
866 2: $Xinfo$
867
867
868 remove with status checks
868 remove with status checks
869
869
870 $ hg debugrebuildstate
870 $ hg debugrebuildstate
871 $ hg remove a
871 $ hg remove a
872 $ hg --debug commit -m rma
872 $ hg --debug commit -m rma
873 committing files:
873 committing files:
874 committing manifest
874 committing manifest
875 committing changelog
875 committing changelog
876 updating the branch cache
876 updating the branch cache
877 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
877 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
878 $ hg status
878 $ hg status
879 ? c
879 ? c
880
880
881 Rollback, revert, and check expansion
881 Rollback, revert, and check expansion
882
882
883 $ hg rollback
883 $ hg rollback
884 repository tip rolled back to revision 2 (undo commit)
884 repository tip rolled back to revision 2 (undo commit)
885 working directory now based on revision 2
885 working directory now based on revision 2
886 $ hg status
886 $ hg status
887 R a
887 R a
888 ? c
888 ? c
889 $ hg revert --no-backup --rev tip a
889 $ hg revert --no-backup --rev tip a
890 $ cat a
890 $ cat a
891 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
891 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
892 do not process $Id:
892 do not process $Id:
893 xxx $
893 xxx $
894 $Xinfo: User Name <user@example.com>: firstline $
894 $Xinfo: User Name <user@example.com>: firstline $
895
895
896 Clone to test global and local configurations
896 Clone to test global and local configurations
897
897
898 $ cd ..
898 $ cd ..
899
899
900 Expansion in destination with global configuration
900 Expansion in destination with global configuration
901
901
902 $ hg --quiet clone Test globalconf
902 $ hg --quiet clone Test globalconf
903 $ cat globalconf/a
903 $ cat globalconf/a
904 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
904 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
905 do not process $Id:
905 do not process $Id:
906 xxx $
906 xxx $
907 $Xinfo: User Name <user@example.com>: firstline $
907 $Xinfo: User Name <user@example.com>: firstline $
908
908
909 No expansion in destination with local configuration in origin only
909 No expansion in destination with local configuration in origin only
910
910
911 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
911 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
912 $ cat localconf/a
912 $ cat localconf/a
913 expand $Id$
913 expand $Id$
914 do not process $Id:
914 do not process $Id:
915 xxx $
915 xxx $
916 $Xinfo$
916 $Xinfo$
917
917
918 Clone to test incoming
918 Clone to test incoming
919
919
920 $ hg clone -r1 Test Test-a
920 $ hg clone -r1 Test Test-a
921 adding changesets
921 adding changesets
922 adding manifests
922 adding manifests
923 adding file changes
923 adding file changes
924 added 2 changesets with 3 changes to 3 files
924 added 2 changesets with 3 changes to 3 files
925 new changesets a2392c293916:ef63ca68695b
925 new changesets a2392c293916:ef63ca68695b
926 updating to branch default
926 updating to branch default
927 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
927 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 $ cd Test-a
928 $ cd Test-a
929 $ cat <<EOF >> .hg/hgrc
929 $ cat <<EOF >> .hg/hgrc
930 > [paths]
930 > [paths]
931 > default = ../Test
931 > default = ../Test
932 > EOF
932 > EOF
933 $ hg incoming
933 $ hg incoming
934 comparing with $TESTTMP/Test
934 comparing with $TESTTMP/Test
935 searching for changes
935 searching for changes
936 changeset: 2:bb948857c743
936 changeset: 2:bb948857c743
937 tag: tip
937 tag: tip
938 user: User Name <user@example.com>
938 user: User Name <user@example.com>
939 date: Thu Jan 01 00:00:02 1970 +0000
939 date: Thu Jan 01 00:00:02 1970 +0000
940 summary: firstline
940 summary: firstline
941
941
942 Imported patch should not be rejected
942 Imported patch should not be rejected
943
943
944 >>> import re
944 >>> import re
945 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
945 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
946 >>> open('a', 'wb').write(text)
946 >>> open('a', 'wb').write(text)
947 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
947 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
948 committing files:
948 committing files:
949 a
949 a
950 committing manifest
950 committing manifest
951 committing changelog
951 committing changelog
952 overwriting a expanding keywords
952 overwriting a expanding keywords
953 updating the branch cache
953 updating the branch cache
954 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
954 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
955 $ hg export -o ../rejecttest.diff tip
955 $ hg export -o ../rejecttest.diff tip
956 $ cd ../Test
956 $ cd ../Test
957 $ hg import ../rejecttest.diff
957 $ hg import ../rejecttest.diff
958 applying ../rejecttest.diff
958 applying ../rejecttest.diff
959 $ cat a b
959 $ cat a b
960 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
960 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
961 do not process $Id: rejecttest
961 do not process $Id: rejecttest
962 xxx $
962 xxx $
963 $Xinfo: User Name <user@example.com>: rejects? $
963 $Xinfo: User Name <user@example.com>: rejects? $
964 ignore $Id$
964 ignore $Id$
965
965
966 $ hg rollback
966 $ hg rollback
967 repository tip rolled back to revision 2 (undo import)
967 repository tip rolled back to revision 2 (undo import)
968 working directory now based on revision 2
968 working directory now based on revision 2
969 $ hg update --clean
969 $ hg update --clean
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
970 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
971
971
972 kwexpand/kwshrink on selected files
972 kwexpand/kwshrink on selected files
973
973
974 $ mkdir x
974 $ mkdir x
975 $ hg copy a x/a
975 $ hg copy a x/a
976 $ hg --verbose kwshrink a
976 $ hg --verbose kwshrink a
977 overwriting a shrinking keywords
977 overwriting a shrinking keywords
978 - sleep required for dirstate.normal() check
978 - sleep required for dirstate.normal() check
979 $ sleep 1
979 $ sleep 1
980 $ hg status a
980 $ hg status a
981 $ hg --verbose kwexpand a
981 $ hg --verbose kwexpand a
982 overwriting a expanding keywords
982 overwriting a expanding keywords
983 $ hg status a
983 $ hg status a
984
984
985 kwexpand x/a should abort
985 kwexpand x/a should abort
986
986
987 $ hg --verbose kwexpand x/a
987 $ hg --verbose kwexpand x/a
988 abort: outstanding uncommitted changes
988 abort: outstanding uncommitted changes
989 [255]
989 [255]
990 $ cd x
990 $ cd x
991 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
991 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
992 committing files:
992 committing files:
993 x/a
993 x/a
994 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
994 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
995 committing manifest
995 committing manifest
996 committing changelog
996 committing changelog
997 overwriting x/a expanding keywords
997 overwriting x/a expanding keywords
998 updating the branch cache
998 updating the branch cache
999 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
999 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
1000 $ cat a
1000 $ cat a
1001 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
1001 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
1002 do not process $Id:
1002 do not process $Id:
1003 xxx $
1003 xxx $
1004 $Xinfo: User Name <user@example.com>: xa $
1004 $Xinfo: User Name <user@example.com>: xa $
1005
1005
1006 kwshrink a inside directory x
1006 kwshrink a inside directory x
1007
1007
1008 $ hg --verbose kwshrink a
1008 $ hg --verbose kwshrink a
1009 overwriting x/a shrinking keywords
1009 overwriting x/a shrinking keywords
1010 $ cat a
1010 $ cat a
1011 expand $Id$
1011 expand $Id$
1012 do not process $Id:
1012 do not process $Id:
1013 xxx $
1013 xxx $
1014 $Xinfo$
1014 $Xinfo$
1015 $ cd ..
1015 $ cd ..
1016
1016
1017 kwexpand nonexistent
1017 kwexpand nonexistent
1018
1018
1019 $ hg kwexpand nonexistent
1019 $ hg kwexpand nonexistent
1020 nonexistent:* (glob)
1020 nonexistent:* (glob)
1021
1021
1022
1022
1023 #if serve
1023 #if serve
1024 hg serve
1024 hg serve
1025 - expand with hgweb file
1025 - expand with hgweb file
1026 - no expansion with hgweb annotate/changeset/filediff/comparison
1026 - no expansion with hgweb annotate/changeset/filediff/comparison
1027 - expand with hgweb file, again
1027 - expand with hgweb file, again
1028 - check errors
1028 - check errors
1029
1029
1030 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1030 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1031 $ cat hg.pid >> $DAEMON_PIDS
1031 $ cat hg.pid >> $DAEMON_PIDS
1032 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1032 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1033 200 Script output follows
1033 200 Script output follows
1034
1034
1035 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1035 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1036 do not process $Id:
1036 do not process $Id:
1037 xxx $
1037 xxx $
1038 $Xinfo: User Name <user@example.com>: firstline $
1038 $Xinfo: User Name <user@example.com>: firstline $
1039 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1039 $ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw'
1040 200 Script output follows
1040 200 Script output follows
1041
1041
1042
1042
1043 user@1: expand $Id$
1043 user@1: expand $Id$
1044 user@1: do not process $Id:
1044 user@1: do not process $Id:
1045 user@1: xxx $
1045 user@1: xxx $
1046 user@2: $Xinfo$
1046 user@2: $Xinfo$
1047
1047
1048
1048
1049
1049
1050
1050
1051 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1051 $ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw'
1052 200 Script output follows
1052 200 Script output follows
1053
1053
1054
1054
1055 # HG changeset patch
1055 # HG changeset patch
1056 # User User Name <user@example.com>
1056 # User User Name <user@example.com>
1057 # Date 3 0
1057 # Date 3 0
1058 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1058 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
1059 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1059 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
1060 xa
1060 xa
1061
1061
1062 diff -r bb948857c743 -r b4560182a3f9 x/a
1062 diff -r bb948857c743 -r b4560182a3f9 x/a
1063 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1063 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1064 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1064 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
1065 @@ -0,0 +1,4 @@
1065 @@ -0,0 +1,4 @@
1066 +expand $Id$
1066 +expand $Id$
1067 +do not process $Id:
1067 +do not process $Id:
1068 +xxx $
1068 +xxx $
1069 +$Xinfo$
1069 +$Xinfo$
1070
1070
1071 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1071 $ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
1072 200 Script output follows
1072 200 Script output follows
1073
1073
1074
1074
1075 diff -r ef63ca68695b -r bb948857c743 a
1075 diff -r ef63ca68695b -r bb948857c743 a
1076 --- a/a Thu Jan 01 00:00:00 1970 +0000
1076 --- a/a Thu Jan 01 00:00:00 1970 +0000
1077 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1077 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1078 @@ -1,3 +1,4 @@
1078 @@ -1,3 +1,4 @@
1079 expand $Id$
1079 expand $Id$
1080 do not process $Id:
1080 do not process $Id:
1081 xxx $
1081 xxx $
1082 +$Xinfo$
1082 +$Xinfo$
1083
1083
1084
1084
1085
1085
1086
1086
1087 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1087 $ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]'
1088 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1088 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1089 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1089 <td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td>
1090 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1090 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1091 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1091 <td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td>
1092 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1092 <td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td>
1093
1093
1094 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1094 (check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords
1095 at subsequent webcommands)
1095 at subsequent webcommands)
1096
1096
1097 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1097 $ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw'
1098 200 Script output follows
1098 200 Script output follows
1099
1099
1100 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1100 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1101 do not process $Id:
1101 do not process $Id:
1102 xxx $
1102 xxx $
1103 $Xinfo: User Name <user@example.com>: firstline $
1103 $Xinfo: User Name <user@example.com>: firstline $
1104
1104
1105 $ killdaemons.py
1105 $ killdaemons.py
1106 $ cat errors.log
1106 $ cat errors.log
1107 #endif
1107 #endif
1108
1108
1109 Prepare merge and resolve tests
1109 Prepare merge and resolve tests
1110
1110
1111 $ echo '$Id$' > m
1111 $ echo '$Id$' > m
1112 $ hg add m
1112 $ hg add m
1113 $ hg commit -m 4kw
1113 $ hg commit -m 4kw
1114 $ echo foo >> m
1114 $ echo foo >> m
1115 $ hg commit -m 5foo
1115 $ hg commit -m 5foo
1116
1116
1117 simplemerge
1117 simplemerge
1118
1118
1119 $ hg update 4
1119 $ hg update 4
1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1121 $ echo foo >> m
1121 $ echo foo >> m
1122 $ hg commit -m 6foo
1122 $ hg commit -m 6foo
1123 created new head
1123 created new head
1124 $ hg merge
1124 $ hg merge
1125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1126 (branch merge, don't forget to commit)
1126 (branch merge, don't forget to commit)
1127 $ hg commit -m simplemerge
1127 $ hg commit -m simplemerge
1128 $ cat m
1128 $ cat m
1129 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1129 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1130 foo
1130 foo
1131
1131
1132 conflict: keyword should stay outside conflict zone
1132 conflict: keyword should stay outside conflict zone
1133
1133
1134 $ hg update 4
1134 $ hg update 4
1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 $ echo bar >> m
1136 $ echo bar >> m
1137 $ hg commit -m 8bar
1137 $ hg commit -m 8bar
1138 created new head
1138 created new head
1139 $ hg merge
1139 $ hg merge
1140 merging m
1140 merging m
1141 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1141 warning: conflicts while merging m! (edit, then use 'hg resolve --mark')
1142 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1142 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1143 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1143 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1144 [1]
1144 [1]
1145 $ cat m
1145 $ cat m
1146 $Id$
1146 $Id$
1147 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1147 <<<<<<< working copy: 88a80c8d172e - test: 8bar
1148 bar
1148 bar
1149 =======
1149 =======
1150 foo
1150 foo
1151 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1151 >>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge
1152
1152
1153 resolve to local, m must contain hash of last change (local parent)
1153 resolve to local, m must contain hash of last change (local parent)
1154
1154
1155 $ hg resolve -t internal:local -a
1155 $ hg resolve -t internal:local -a
1156 (no more unresolved files)
1156 (no more unresolved files)
1157 $ hg commit -m localresolve
1157 $ hg commit -m localresolve
1158 $ cat m
1158 $ cat m
1159 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1159 $Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $
1160 bar
1160 bar
1161
1161
1162 Test restricted mode with transplant -b
1162 Test restricted mode with transplant -b
1163
1163
1164 $ hg update 6
1164 $ hg update 6
1165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1166 $ hg branch foo
1166 $ hg branch foo
1167 marked working directory as branch foo
1167 marked working directory as branch foo
1168 (branches are permanent and global, did you want a bookmark?)
1168 (branches are permanent and global, did you want a bookmark?)
1169 $ mv a a.bak
1169 $ mv a a.bak
1170 $ echo foobranch > a
1170 $ echo foobranch > a
1171 $ cat a.bak >> a
1171 $ cat a.bak >> a
1172 $ rm a.bak
1172 $ rm a.bak
1173 $ hg commit -m 9foobranch
1173 $ hg commit -m 9foobranch
1174 $ hg update default
1174 $ hg update default
1175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1176 $ hg -y transplant -b foo tip
1176 $ hg -y transplant -b foo tip
1177 applying 4aa30d025d50
1177 applying 4aa30d025d50
1178 4aa30d025d50 transplanted to e00abbf63521
1178 4aa30d025d50 transplanted to e00abbf63521
1179
1179
1180 Expansion in changeset but not in file
1180 Expansion in changeset but not in file
1181
1181
1182 $ hg tip -p
1182 $ hg tip -p
1183 changeset: 11:e00abbf63521
1183 changeset: 11:e00abbf63521
1184 tag: tip
1184 tag: tip
1185 parent: 9:800511b3a22d
1185 parent: 9:800511b3a22d
1186 user: test
1186 user: test
1187 date: Thu Jan 01 00:00:00 1970 +0000
1187 date: Thu Jan 01 00:00:00 1970 +0000
1188 summary: 9foobranch
1188 summary: 9foobranch
1189
1189
1190 diff -r 800511b3a22d -r e00abbf63521 a
1190 diff -r 800511b3a22d -r e00abbf63521 a
1191 --- a/a Thu Jan 01 00:00:00 1970 +0000
1191 --- a/a Thu Jan 01 00:00:00 1970 +0000
1192 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1192 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1193 @@ -1,3 +1,4 @@
1193 @@ -1,3 +1,4 @@
1194 +foobranch
1194 +foobranch
1195 expand $Id$
1195 expand $Id$
1196 do not process $Id:
1196 do not process $Id:
1197 xxx $
1197 xxx $
1198
1198
1199 $ head -n 2 a
1199 $ head -n 2 a
1200 foobranch
1200 foobranch
1201 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1201 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1202
1202
1203 Turn off expansion
1203 Turn off expansion
1204
1204
1205 $ hg -q rollback
1205 $ hg -q rollback
1206 $ hg -q update -C
1206 $ hg -q update -C
1207
1207
1208 kwshrink with unknown file u
1208 kwshrink with unknown file u
1209
1209
1210 $ cp a u
1210 $ cp a u
1211 $ hg --verbose kwshrink
1211 $ hg --verbose kwshrink
1212 overwriting a shrinking keywords
1212 overwriting a shrinking keywords
1213 overwriting m shrinking keywords
1213 overwriting m shrinking keywords
1214 overwriting x/a shrinking keywords
1214 overwriting x/a shrinking keywords
1215
1215
1216 Keywords shrunk in working directory, but not yet disabled
1216 Keywords shrunk in working directory, but not yet disabled
1217 - cat shows unexpanded keywords
1217 - cat shows unexpanded keywords
1218 - hg cat shows expanded keywords
1218 - hg cat shows expanded keywords
1219
1219
1220 $ cat a b
1220 $ cat a b
1221 expand $Id$
1221 expand $Id$
1222 do not process $Id:
1222 do not process $Id:
1223 xxx $
1223 xxx $
1224 $Xinfo$
1224 $Xinfo$
1225 ignore $Id$
1225 ignore $Id$
1226 $ hg cat sym a b && echo
1226 $ hg cat sym a b && echo
1227 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1227 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1228 do not process $Id:
1228 do not process $Id:
1229 xxx $
1229 xxx $
1230 $Xinfo: User Name <user@example.com>: firstline $
1230 $Xinfo: User Name <user@example.com>: firstline $
1231 ignore $Id$
1231 ignore $Id$
1232 a
1232 a
1233
1233
1234 Now disable keyword expansion
1234 Now disable keyword expansion
1235
1235
1236 $ cp $HGRCPATH $HGRCPATH.backup
1236 $ cp $HGRCPATH $HGRCPATH.backup
1237 $ rm "$HGRCPATH"
1237 $ rm "$HGRCPATH"
1238 $ cat a b
1238 $ cat a b
1239 expand $Id$
1239 expand $Id$
1240 do not process $Id:
1240 do not process $Id:
1241 xxx $
1241 xxx $
1242 $Xinfo$
1242 $Xinfo$
1243 ignore $Id$
1243 ignore $Id$
1244 $ hg cat sym a b && echo
1244 $ hg cat sym a b && echo
1245 expand $Id$
1245 expand $Id$
1246 do not process $Id:
1246 do not process $Id:
1247 xxx $
1247 xxx $
1248 $Xinfo$
1248 $Xinfo$
1249 ignore $Id$
1249 ignore $Id$
1250 a
1250 a
1251
1251
1252 enable keyword expansion again
1252 enable keyword expansion again
1253
1253
1254 $ cat $HGRCPATH.backup >> $HGRCPATH
1254 $ cat $HGRCPATH.backup >> $HGRCPATH
1255
1255
1256 Test restricted mode with unshelve
1256 Test restricted mode with unshelve
1257
1257
1258 $ cat <<EOF >> $HGRCPATH
1258 $ cat <<EOF >> $HGRCPATH
1259 > [extensions]
1259 > [extensions]
1260 > shelve =
1260 > shelve =
1261 > EOF
1261 > EOF
1262
1262
1263 $ echo xxxx >> a
1263 $ echo xxxx >> a
1264 $ hg diff
1264 $ hg diff
1265 diff -r 800511b3a22d a
1265 diff -r 800511b3a22d a
1266 --- a/a Thu Jan 01 00:00:00 1970 +0000
1266 --- a/a Thu Jan 01 00:00:00 1970 +0000
1267 +++ b/a * (glob)
1267 +++ b/a * (glob)
1268 @@ -2,3 +2,4 @@
1268 @@ -2,3 +2,4 @@
1269 do not process $Id:
1269 do not process $Id:
1270 xxx $
1270 xxx $
1271 $Xinfo$
1271 $Xinfo$
1272 +xxxx
1272 +xxxx
1273 $ hg shelve -q --name tmp
1273 $ hg shelve -q --name tmp
1274 $ hg shelve --list --patch
1274 $ hg shelve --list --patch
1275 tmp (*)* changes to: localresolve (glob)
1275 tmp (*)* changes to: localresolve (glob)
1276
1276
1277 diff --git a/a b/a
1277 diff --git a/a b/a
1278 --- a/a
1278 --- a/a
1279 +++ b/a
1279 +++ b/a
1280 @@ -2,3 +2,4 @@
1280 @@ -2,3 +2,4 @@
1281 do not process $Id:
1281 do not process $Id:
1282 xxx $
1282 xxx $
1283 $Xinfo$
1283 $Xinfo$
1284 +xxxx
1284 +xxxx
1285
1285
1286 $ hg update -q -C 10
1286 $ hg update -q -C 10
1287 $ hg unshelve -q tmp
1287 $ hg unshelve -q tmp
1288 $ hg diff
1288 $ hg diff
1289 diff -r 4aa30d025d50 a
1289 diff -r 4aa30d025d50 a
1290 --- a/a Thu Jan 01 00:00:00 1970 +0000
1290 --- a/a Thu Jan 01 00:00:00 1970 +0000
1291 +++ b/a * (glob)
1291 +++ b/a * (glob)
1292 @@ -3,3 +3,4 @@
1292 @@ -3,3 +3,4 @@
1293 do not process $Id:
1293 do not process $Id:
1294 xxx $
1294 xxx $
1295 $Xinfo$
1295 $Xinfo$
1296 +xxxx
1296 +xxxx
1297
1297
1298 Test restricted mode with rebase
1298 Test restricted mode with rebase
1299
1299
1300 $ cat <<EOF >> $HGRCPATH
1300 $ cat <<EOF >> $HGRCPATH
1301 > [extensions]
1301 > [extensions]
1302 > rebase =
1302 > rebase =
1303 > EOF
1303 > EOF
1304
1304
1305 $ hg update -q -C 9
1305 $ hg update -q -C 9
1306
1306
1307 $ echo xxxx >> a
1307 $ echo xxxx >> a
1308 $ hg commit -m '#11'
1308 $ hg commit -m '#11'
1309 $ hg diff -c 11
1309 $ hg diff -c 11
1310 diff -r 800511b3a22d -r b07670694489 a
1310 diff -r 800511b3a22d -r b07670694489 a
1311 --- a/a Thu Jan 01 00:00:00 1970 +0000
1311 --- a/a Thu Jan 01 00:00:00 1970 +0000
1312 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1312 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1313 @@ -2,3 +2,4 @@
1313 @@ -2,3 +2,4 @@
1314 do not process $Id:
1314 do not process $Id:
1315 xxx $
1315 xxx $
1316 $Xinfo$
1316 $Xinfo$
1317 +xxxx
1317 +xxxx
1318
1318
1319 $ hg diff -c 10
1319 $ hg diff -c 10
1320 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1320 diff -r 27d48ee14f67 -r 4aa30d025d50 a
1321 --- a/a Thu Jan 01 00:00:00 1970 +0000
1321 --- a/a Thu Jan 01 00:00:00 1970 +0000
1322 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1322 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1323 @@ -1,3 +1,4 @@
1323 @@ -1,3 +1,4 @@
1324 +foobranch
1324 +foobranch
1325 expand $Id$
1325 expand $Id$
1326 do not process $Id:
1326 do not process $Id:
1327 xxx $
1327 xxx $
1328
1328
1329 $ hg rebase -q -s 10 -d 11 --keep
1329 $ hg rebase -q -s 10 -d 11 --keep
1330 $ hg diff -r 9 -r 12 a
1330 $ hg diff -r 9 -r 12 a
1331 diff -r 800511b3a22d -r 1939b927726c a
1331 diff -r 800511b3a22d -r 1939b927726c a
1332 --- a/a Thu Jan 01 00:00:00 1970 +0000
1332 --- a/a Thu Jan 01 00:00:00 1970 +0000
1333 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1333 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1334 @@ -1,4 +1,6 @@
1334 @@ -1,4 +1,6 @@
1335 +foobranch
1335 +foobranch
1336 expand $Id$
1336 expand $Id$
1337 do not process $Id:
1337 do not process $Id:
1338 xxx $
1338 xxx $
1339 $Xinfo$
1339 $Xinfo$
1340 +xxxx
1340 +xxxx
1341
1341
1342 Test restricted mode with graft
1342 Test restricted mode with graft
1343
1343
1344 $ hg graft -q 10
1344 $ hg graft -q 10
1345 $ hg diff -r 9 -r 13 a
1345 $ hg diff -r 9 -r 13 a
1346 diff -r 800511b3a22d -r 01a68de1003a a
1346 diff -r 800511b3a22d -r 01a68de1003a a
1347 --- a/a Thu Jan 01 00:00:00 1970 +0000
1347 --- a/a Thu Jan 01 00:00:00 1970 +0000
1348 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1348 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1349 @@ -1,4 +1,6 @@
1349 @@ -1,4 +1,6 @@
1350 +foobranch
1350 +foobranch
1351 expand $Id$
1351 expand $Id$
1352 do not process $Id:
1352 do not process $Id:
1353 xxx $
1353 xxx $
1354 $Xinfo$
1354 $Xinfo$
1355 +xxxx
1355 +xxxx
1356
1356
1357 Test restricted mode with backout
1357 Test restricted mode with backout
1358
1358
1359 $ hg backout -q 11 --no-commit
1359 $ hg backout -q 11 --no-commit
1360 $ hg diff a
1360 $ hg diff a
1361 diff -r 01a68de1003a a
1361 diff -r 01a68de1003a a
1362 --- a/a Thu Jan 01 00:00:00 1970 +0000
1362 --- a/a Thu Jan 01 00:00:00 1970 +0000
1363 +++ b/a * (glob)
1363 +++ b/a * (glob)
1364 @@ -3,4 +3,3 @@
1364 @@ -3,4 +3,3 @@
1365 do not process $Id:
1365 do not process $Id:
1366 xxx $
1366 xxx $
1367 $Xinfo$
1367 $Xinfo$
1368 -xxxx
1368 -xxxx
1369
1369
1370 Test restricted mode with histedit
1370 Test restricted mode with histedit
1371
1371
1372 $ cat <<EOF >> $HGRCPATH
1372 $ cat <<EOF >> $HGRCPATH
1373 > [extensions]
1373 > [extensions]
1374 > histedit =
1374 > histedit =
1375 > EOF
1375 > EOF
1376
1376
1377 $ hg commit -m 'backout #11'
1377 $ hg commit -m 'backout #11'
1378 $ hg histedit -q --command - 13 <<EOF
1378 $ hg histedit -q --command - 13 <<EOF
1379 > pick 49f5f2d940c3 14 backout #11
1379 > pick 49f5f2d940c3 14 backout #11
1380 > pick 01a68de1003a 13 9foobranch
1380 > pick 01a68de1003a 13 9foobranch
1381 > EOF
1381 > EOF
1382
1382
1383 Test restricted mode with fetch (with merge)
1383 Test restricted mode with fetch (with merge)
1384
1384
1385 $ cat <<EOF >> $HGRCPATH
1385 $ cat <<EOF >> $HGRCPATH
1386 > [extensions]
1386 > [extensions]
1387 > fetch =
1387 > fetch =
1388 > EOF
1388 > EOF
1389
1389
1390 $ hg clone -q -r 9 . ../fetch-merge
1390 $ hg clone -q -r 9 . ../fetch-merge
1391 $ cd ../fetch-merge
1391 $ cd ../fetch-merge
1392 $ hg -R ../Test export 10 | hg import -q -
1392 $ hg -R ../Test export 10 | hg import -q -
1393 $ hg fetch -q -r 11
1393 $ hg fetch -q -r 11
1394 $ hg diff -r 9 a
1394 $ hg diff -r 9 a
1395 diff -r 800511b3a22d a
1395 diff -r 800511b3a22d a
1396 --- a/a Thu Jan 01 00:00:00 1970 +0000
1396 --- a/a Thu Jan 01 00:00:00 1970 +0000
1397 +++ b/a * (glob)
1397 +++ b/a * (glob)
1398 @@ -1,4 +1,6 @@
1398 @@ -1,4 +1,6 @@
1399 +foobranch
1399 +foobranch
1400 expand $Id$
1400 expand $Id$
1401 do not process $Id:
1401 do not process $Id:
1402 xxx $
1402 xxx $
1403 $Xinfo$
1403 $Xinfo$
1404 +xxxx
1404 +xxxx
1405
1405
1406 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1406 Test that patch.diff(), which is implied by "hg diff" or so, doesn't
1407 suppress expanding keywords at subsequent commands
1407 suppress expanding keywords at subsequent commands
1408
1408
1409 #if windows
1409 #if windows
1410 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1410 $ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH"
1411 #else
1411 #else
1412 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1412 $ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH"
1413 #endif
1413 #endif
1414 $ export PYTHONPATH
1414 $ export PYTHONPATH
1415
1415
1416 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1416 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1417 $ mv $HGRCPATH.new $HGRCPATH
1417 $ mv $HGRCPATH.new $HGRCPATH
1418
1418
1419 >>> from __future__ import print_function
1419 >>> from __future__ import print_function
1420 >>> from hgclient import check, readchannel, runcommand
1420 >>> from hgclient import check, readchannel, runcommand
1421 >>> @check
1421 >>> @check
1422 ... def check(server):
1422 ... def check(server):
1423 ... # hello block
1423 ... # hello block
1424 ... readchannel(server)
1424 ... readchannel(server)
1425 ...
1425 ...
1426 ... runcommand(server, ['cat', 'm'])
1426 ... runcommand(server, ['cat', 'm'])
1427 ... runcommand(server, ['diff', '-c', '.', 'm'])
1427 ... runcommand(server, ['diff', '-c', '.', 'm'])
1428 ... runcommand(server, ['cat', 'm'])
1428 ... runcommand(server, ['cat', 'm'])
1429 *** runcommand cat m
1429 *** runcommand cat m
1430 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1430 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1431 bar
1431 bar
1432 *** runcommand diff -c . m
1432 *** runcommand diff -c . m
1433 *** runcommand cat m
1433 *** runcommand cat m
1434 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1434 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1435 bar
1435 bar
1436
1436
1437 $ cd ..
1437 $ cd ..
1438
1438
1439 #if serve
1439 #if serve
1440
1440
1441 Test that keywords are expanded only in repositories, which enable
1441 Test that keywords are expanded only in repositories, which enable
1442 keyword extension, even if multiple repositories are served in a
1442 keyword extension, even if multiple repositories are served in a
1443 process
1443 process
1444
1444
1445 $ cat >> fetch-merge/.hg/hgrc <<EOF
1445 $ cat >> fetch-merge/.hg/hgrc <<EOF
1446 > [extensions]
1446 > [extensions]
1447 > keyword = !
1447 > keyword = !
1448 > EOF
1448 > EOF
1449
1449
1450 $ cat > paths.conf <<EOF
1450 $ cat > paths.conf <<EOF
1451 > [paths]
1451 > [paths]
1452 > enabled=Test
1452 > enabled=Test
1453 > disabled=fetch-merge
1453 > disabled=fetch-merge
1454 > EOF
1454 > EOF
1455
1455
1456 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1456 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf
1457 $ cat hg.pid >> $DAEMON_PIDS
1457 $ cat hg.pid >> $DAEMON_PIDS
1458
1458
1459 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1459 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1460 200 Script output follows
1460 200 Script output follows
1461
1461
1462 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1462 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1463 bar
1463 bar
1464
1464
1465 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1465 $ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw'
1466 200 Script output follows
1466 200 Script output follows
1467
1467
1468 $Id$
1468 $Id$
1469 bar
1469 bar
1470
1470
1471 (check expansion again, for safety)
1471 (check expansion again, for safety)
1472
1472
1473 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1473 $ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw'
1474 200 Script output follows
1474 200 Script output follows
1475
1475
1476 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1476 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1477 bar
1477 bar
1478
1478
1479 $ killdaemons.py
1479 $ killdaemons.py
1480 #endif
1480 #endif
@@ -1,464 +1,464 b''
1 #testcases sshv1 sshv2
1 #testcases sshv1 sshv2
2
2
3 #if sshv2
3 #if sshv2
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [experimental]
5 > [experimental]
6 > sshpeer.advertise-v2 = true
6 > sshpeer.advertise-v2 = true
7 > sshserver.support-v2 = true
7 > sshserver.support-v2 = true
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 This file contains testcases that tend to be related to the wire protocol part
11 This file contains testcases that tend to be related to the wire protocol part
12 of largefiles.
12 of largefiles.
13
13
14 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
14 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
15 $ mkdir "${USERCACHE}"
15 $ mkdir "${USERCACHE}"
16 $ cat >> $HGRCPATH <<EOF
16 $ cat >> $HGRCPATH <<EOF
17 > [extensions]
17 > [extensions]
18 > largefiles=
18 > largefiles=
19 > purge=
19 > purge=
20 > rebase=
20 > rebase=
21 > transplant=
21 > transplant=
22 > [phases]
22 > [phases]
23 > publish=False
23 > publish=False
24 > [largefiles]
24 > [largefiles]
25 > minsize=2
25 > minsize=2
26 > patterns=glob:**.dat
26 > patterns=glob:**.dat
27 > usercache=${USERCACHE}
27 > usercache=${USERCACHE}
28 > [web]
28 > [web]
29 > allow-archive = zip
29 > allow-archive = zip
30 > [hooks]
30 > [hooks]
31 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
31 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
32 > EOF
32 > EOF
33
33
34
34
35 #if serve
35 #if serve
36 vanilla clients not locked out from largefiles servers on vanilla repos
36 vanilla clients not locked out from largefiles servers on vanilla repos
37 $ mkdir r1
37 $ mkdir r1
38 $ cd r1
38 $ cd r1
39 $ hg init
39 $ hg init
40 $ echo c1 > f1
40 $ echo c1 > f1
41 $ hg add f1
41 $ hg add f1
42 $ hg commit -m "m1"
42 $ hg commit -m "m1"
43 Invoking status precommit hook
43 Invoking status precommit hook
44 A f1
44 A f1
45 $ cd ..
45 $ cd ..
46 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
46 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
47 $ cat hg.pid >> $DAEMON_PIDS
47 $ cat hg.pid >> $DAEMON_PIDS
48 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
48 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
49 requesting all changes
49 requesting all changes
50 adding changesets
50 adding changesets
51 adding manifests
51 adding manifests
52 adding file changes
52 adding file changes
53 added 1 changesets with 1 changes to 1 files
53 added 1 changesets with 1 changes to 1 files
54 new changesets b6eb3a2e2efe (1 drafts)
54 new changesets b6eb3a2e2efe (1 drafts)
55 updating to branch default
55 updating to branch default
56 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57
57
58 largefiles clients still work with vanilla servers
58 largefiles clients still work with vanilla servers
59 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
59 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
60 $ cat hg.pid >> $DAEMON_PIDS
60 $ cat hg.pid >> $DAEMON_PIDS
61 $ hg clone http://localhost:$HGPORT1 r3
61 $ hg clone http://localhost:$HGPORT1 r3
62 requesting all changes
62 requesting all changes
63 adding changesets
63 adding changesets
64 adding manifests
64 adding manifests
65 adding file changes
65 adding file changes
66 added 1 changesets with 1 changes to 1 files
66 added 1 changesets with 1 changes to 1 files
67 new changesets b6eb3a2e2efe (1 drafts)
67 new changesets b6eb3a2e2efe (1 drafts)
68 updating to branch default
68 updating to branch default
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 #endif
70 #endif
71
71
72 vanilla clients locked out from largefiles http repos
72 vanilla clients locked out from largefiles http repos
73 $ mkdir r4
73 $ mkdir r4
74 $ cd r4
74 $ cd r4
75 $ hg init
75 $ hg init
76 $ echo c1 > f1
76 $ echo c1 > f1
77 $ hg add --large f1
77 $ hg add --large f1
78 $ hg commit -m "m1"
78 $ hg commit -m "m1"
79 Invoking status precommit hook
79 Invoking status precommit hook
80 A f1
80 A f1
81 $ cd ..
81 $ cd ..
82
82
83 largefiles can be pushed locally (issue3583)
83 largefiles can be pushed locally (issue3583)
84 $ hg init dest
84 $ hg init dest
85 $ cd r4
85 $ cd r4
86 $ hg outgoing ../dest
86 $ hg outgoing ../dest
87 comparing with ../dest
87 comparing with ../dest
88 searching for changes
88 searching for changes
89 changeset: 0:639881c12b4c
89 changeset: 0:639881c12b4c
90 tag: tip
90 tag: tip
91 user: test
91 user: test
92 date: Thu Jan 01 00:00:00 1970 +0000
92 date: Thu Jan 01 00:00:00 1970 +0000
93 summary: m1
93 summary: m1
94
94
95 $ hg push ../dest
95 $ hg push ../dest
96 pushing to ../dest
96 pushing to ../dest
97 searching for changes
97 searching for changes
98 adding changesets
98 adding changesets
99 adding manifests
99 adding manifests
100 adding file changes
100 adding file changes
101 added 1 changesets with 1 changes to 1 files
101 added 1 changesets with 1 changes to 1 files
102
102
103 exit code with nothing outgoing (issue3611)
103 exit code with nothing outgoing (issue3611)
104 $ hg outgoing ../dest
104 $ hg outgoing ../dest
105 comparing with ../dest
105 comparing with ../dest
106 searching for changes
106 searching for changes
107 no changes found
107 no changes found
108 [1]
108 [1]
109 $ cd ..
109 $ cd ..
110
110
111 #if serve
111 #if serve
112 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
112 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
113 $ cat hg.pid >> $DAEMON_PIDS
113 $ cat hg.pid >> $DAEMON_PIDS
114 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
114 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
115 abort: remote error:
115 abort: remote error:
116
116
117 This repository uses the largefiles extension.
117 This repository uses the largefiles extension.
118
118
119 Please enable it in your Mercurial config file.
119 Please enable it in your Mercurial config file.
120 [255]
120 [255]
121
121
122 used all HGPORTs, kill all daemons
122 used all HGPORTs, kill all daemons
123 $ killdaemons.py
123 $ killdaemons.py
124 #endif
124 #endif
125
125
126 vanilla clients locked out from largefiles ssh repos
126 vanilla clients locked out from largefiles ssh repos
127 $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
127 $ hg --config extensions.largefiles=! clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
128 remote:
128 remote:
129 remote: This repository uses the largefiles extension.
129 remote: This repository uses the largefiles extension.
130 remote:
130 remote:
131 remote: Please enable it in your Mercurial config file.
131 remote: Please enable it in your Mercurial config file.
132 remote:
132 remote:
133 remote: -
133 remote: -
134 abort: remote error
134 abort: remote error
135 (check previous remote output)
135 (check previous remote output)
136 [255]
136 [255]
137
137
138 #if serve
138 #if serve
139
139
140 largefiles clients refuse to push largefiles repos to vanilla servers
140 largefiles clients refuse to push largefiles repos to vanilla servers
141 $ mkdir r6
141 $ mkdir r6
142 $ cd r6
142 $ cd r6
143 $ hg init
143 $ hg init
144 $ echo c1 > f1
144 $ echo c1 > f1
145 $ hg add f1
145 $ hg add f1
146 $ hg commit -m "m1"
146 $ hg commit -m "m1"
147 Invoking status precommit hook
147 Invoking status precommit hook
148 A f1
148 A f1
149 $ cat >> .hg/hgrc <<!
149 $ cat >> .hg/hgrc <<!
150 > [web]
150 > [web]
151 > push_ssl = false
151 > push_ssl = false
152 > allow_push = *
152 > allow_push = *
153 > !
153 > !
154 $ cd ..
154 $ cd ..
155 $ hg clone r6 r7
155 $ hg clone r6 r7
156 updating to branch default
156 updating to branch default
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ cd r7
158 $ cd r7
159 $ echo c2 > f2
159 $ echo c2 > f2
160 $ hg add --large f2
160 $ hg add --large f2
161 $ hg commit -m "m2"
161 $ hg commit -m "m2"
162 Invoking status precommit hook
162 Invoking status precommit hook
163 A f2
163 A f2
164 $ hg verify --large
164 $ hg verify --large
165 checking changesets
165 checking changesets
166 checking manifests
166 checking manifests
167 crosschecking files in changesets and manifests
167 crosschecking files in changesets and manifests
168 checking files
168 checking files
169 2 files, 2 changesets, 2 total revisions
169 checked 2 changesets with 2 changes to 2 files
170 searching 1 changesets for largefiles
170 searching 1 changesets for largefiles
171 verified existence of 1 revisions of 1 largefiles
171 verified existence of 1 revisions of 1 largefiles
172 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
172 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
173 $ cat ../hg.pid >> $DAEMON_PIDS
173 $ cat ../hg.pid >> $DAEMON_PIDS
174 $ hg push http://localhost:$HGPORT
174 $ hg push http://localhost:$HGPORT
175 pushing to http://localhost:$HGPORT/
175 pushing to http://localhost:$HGPORT/
176 searching for changes
176 searching for changes
177 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
177 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
178 [255]
178 [255]
179 $ cd ..
179 $ cd ..
180
180
181 putlfile errors are shown (issue3123)
181 putlfile errors are shown (issue3123)
182 Corrupt the cached largefile in r7 and move it out of the servers usercache
182 Corrupt the cached largefile in r7 and move it out of the servers usercache
183 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
183 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
184 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
184 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
185 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
185 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
186 $ hg init empty
186 $ hg init empty
187 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
187 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
188 > --config 'web.allow_push=*' --config web.push_ssl=False
188 > --config 'web.allow_push=*' --config web.push_ssl=False
189 $ cat hg.pid >> $DAEMON_PIDS
189 $ cat hg.pid >> $DAEMON_PIDS
190 $ hg push -R r7 http://localhost:$HGPORT1
190 $ hg push -R r7 http://localhost:$HGPORT1
191 pushing to http://localhost:$HGPORT1/
191 pushing to http://localhost:$HGPORT1/
192 searching for changes
192 searching for changes
193 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
193 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
194 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
194 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
195 [255]
195 [255]
196 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
196 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
197 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
197 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
198 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
198 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
199 $ hg push -R r7 http://localhost:$HGPORT1
199 $ hg push -R r7 http://localhost:$HGPORT1
200 pushing to http://localhost:$HGPORT1/
200 pushing to http://localhost:$HGPORT1/
201 searching for changes
201 searching for changes
202 remote: adding changesets
202 remote: adding changesets
203 remote: adding manifests
203 remote: adding manifests
204 remote: adding file changes
204 remote: adding file changes
205 remote: added 2 changesets with 2 changes to 2 files
205 remote: added 2 changesets with 2 changes to 2 files
206 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
206 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
207 server side corruption
207 server side corruption
208 $ rm -rf empty
208 $ rm -rf empty
209
209
210 Push a largefiles repository to a served empty repository
210 Push a largefiles repository to a served empty repository
211 $ hg init r8
211 $ hg init r8
212 $ echo c3 > r8/f1
212 $ echo c3 > r8/f1
213 $ hg add --large r8/f1 -R r8
213 $ hg add --large r8/f1 -R r8
214 $ hg commit -m "m1" -R r8
214 $ hg commit -m "m1" -R r8
215 Invoking status precommit hook
215 Invoking status precommit hook
216 A f1
216 A f1
217 $ hg init empty
217 $ hg init empty
218 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
218 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
219 > --config 'web.allow_push=*' --config web.push_ssl=False
219 > --config 'web.allow_push=*' --config web.push_ssl=False
220 $ cat hg.pid >> $DAEMON_PIDS
220 $ cat hg.pid >> $DAEMON_PIDS
221 $ rm "${USERCACHE}"/*
221 $ rm "${USERCACHE}"/*
222 $ hg push -R r8 http://localhost:$HGPORT2/#default
222 $ hg push -R r8 http://localhost:$HGPORT2/#default
223 pushing to http://localhost:$HGPORT2/
223 pushing to http://localhost:$HGPORT2/
224 searching for changes
224 searching for changes
225 remote: adding changesets
225 remote: adding changesets
226 remote: adding manifests
226 remote: adding manifests
227 remote: adding file changes
227 remote: adding file changes
228 remote: added 1 changesets with 1 changes to 1 files
228 remote: added 1 changesets with 1 changes to 1 files
229 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
229 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
230 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
230 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
231
231
232 Clone over http, no largefiles pulled on clone.
232 Clone over http, no largefiles pulled on clone.
233
233
234 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
234 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
235 adding changesets
235 adding changesets
236 adding manifests
236 adding manifests
237 adding file changes
237 adding file changes
238 added 1 changesets with 1 changes to 1 files
238 added 1 changesets with 1 changes to 1 files
239 new changesets cf03e5bb9936 (1 drafts)
239 new changesets cf03e5bb9936 (1 drafts)
240
240
241 Archive contains largefiles
241 Archive contains largefiles
242 >>> import os
242 >>> import os
243 >>> import urllib2
243 >>> import urllib2
244 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
244 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
245 >>> with open('archive.zip', 'w') as f:
245 >>> with open('archive.zip', 'w') as f:
246 ... f.write(urllib2.urlopen(u).read())
246 ... f.write(urllib2.urlopen(u).read())
247 $ unzip -t archive.zip
247 $ unzip -t archive.zip
248 Archive: archive.zip
248 Archive: archive.zip
249 testing: empty-default/.hg_archival.txt*OK (glob)
249 testing: empty-default/.hg_archival.txt*OK (glob)
250 testing: empty-default/f1*OK (glob)
250 testing: empty-default/f1*OK (glob)
251 No errors detected in compressed data of archive.zip.
251 No errors detected in compressed data of archive.zip.
252
252
253 test 'verify' with remotestore:
253 test 'verify' with remotestore:
254
254
255 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
255 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
256 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
256 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
257 $ hg -R http-clone verify --large --lfa
257 $ hg -R http-clone verify --large --lfa
258 checking changesets
258 checking changesets
259 checking manifests
259 checking manifests
260 crosschecking files in changesets and manifests
260 crosschecking files in changesets and manifests
261 checking files
261 checking files
262 1 files, 1 changesets, 1 total revisions
262 checked 1 changesets with 1 changes to 1 files
263 searching 1 changesets for largefiles
263 searching 1 changesets for largefiles
264 changeset 0:cf03e5bb9936: f1 missing
264 changeset 0:cf03e5bb9936: f1 missing
265 verified existence of 1 revisions of 1 largefiles
265 verified existence of 1 revisions of 1 largefiles
266 [1]
266 [1]
267 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
267 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
268 $ hg -R http-clone -q verify --large --lfa
268 $ hg -R http-clone -q verify --large --lfa
269
269
270 largefiles pulled on update - a largefile missing on the server:
270 largefiles pulled on update - a largefile missing on the server:
271 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
271 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
272 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
272 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
273 getting changed largefiles
273 getting changed largefiles
274 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
274 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
275 0 largefiles updated, 0 removed
275 0 largefiles updated, 0 removed
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 $ hg -R http-clone st
277 $ hg -R http-clone st
278 ! f1
278 ! f1
279 $ hg -R http-clone up -Cqr null
279 $ hg -R http-clone up -Cqr null
280
280
281 largefiles pulled on update - a largefile corrupted on the server:
281 largefiles pulled on update - a largefile corrupted on the server:
282 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
282 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
283 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
283 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
284 getting changed largefiles
284 getting changed largefiles
285 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
285 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
286 0 largefiles updated, 0 removed
286 0 largefiles updated, 0 removed
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ hg -R http-clone st
288 $ hg -R http-clone st
289 ! f1
289 ! f1
290 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
290 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
291 $ [ ! -f http-clone/f1 ]
291 $ [ ! -f http-clone/f1 ]
292 $ [ ! -f http-clone-usercache ]
292 $ [ ! -f http-clone-usercache ]
293 $ hg -R http-clone verify --large --lfc
293 $ hg -R http-clone verify --large --lfc
294 checking changesets
294 checking changesets
295 checking manifests
295 checking manifests
296 crosschecking files in changesets and manifests
296 crosschecking files in changesets and manifests
297 checking files
297 checking files
298 1 files, 1 changesets, 1 total revisions
298 checked 1 changesets with 1 changes to 1 files
299 searching 1 changesets for largefiles
299 searching 1 changesets for largefiles
300 verified contents of 1 revisions of 1 largefiles
300 verified contents of 1 revisions of 1 largefiles
301 $ hg -R http-clone up -Cqr null
301 $ hg -R http-clone up -Cqr null
302
302
303 largefiles pulled on update - no server side problems:
303 largefiles pulled on update - no server side problems:
304 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
304 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
305 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
305 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
306 resolving manifests
306 resolving manifests
307 branchmerge: False, force: False, partial: False
307 branchmerge: False, force: False, partial: False
308 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
308 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
309 .hglf/f1: remote created -> g
309 .hglf/f1: remote created -> g
310 getting .hglf/f1
310 getting .hglf/f1
311 updating: .hglf/f1 1/1 files (100.00%)
311 updating: .hglf/f1 1/1 files (100.00%)
312 getting changed largefiles
312 getting changed largefiles
313 using http://localhost:$HGPORT2/
313 using http://localhost:$HGPORT2/
314 sending capabilities command
314 sending capabilities command
315 sending statlfile command
315 sending statlfile command
316 getting largefiles: 0/1 files (0.00%)
316 getting largefiles: 0/1 files (0.00%)
317 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
317 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
318 sending getlfile command
318 sending getlfile command
319 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
319 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
320 1 largefiles updated, 0 removed
320 1 largefiles updated, 0 removed
321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
322
322
323 $ ls http-clone-usercache/*
323 $ ls http-clone-usercache/*
324 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
324 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
325
325
326 $ rm -rf empty http-clone*
326 $ rm -rf empty http-clone*
327
327
328 used all HGPORTs, kill all daemons
328 used all HGPORTs, kill all daemons
329 $ killdaemons.py
329 $ killdaemons.py
330
330
331 largefiles should batch verify remote calls
331 largefiles should batch verify remote calls
332
332
333 $ hg init batchverifymain
333 $ hg init batchverifymain
334 $ cd batchverifymain
334 $ cd batchverifymain
335 $ echo "aaa" >> a
335 $ echo "aaa" >> a
336 $ hg add --large a
336 $ hg add --large a
337 $ hg commit -m "a"
337 $ hg commit -m "a"
338 Invoking status precommit hook
338 Invoking status precommit hook
339 A a
339 A a
340 $ echo "bbb" >> b
340 $ echo "bbb" >> b
341 $ hg add --large b
341 $ hg add --large b
342 $ hg commit -m "b"
342 $ hg commit -m "b"
343 Invoking status precommit hook
343 Invoking status precommit hook
344 A b
344 A b
345 $ cd ..
345 $ cd ..
346 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
346 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
347 > -A access.log
347 > -A access.log
348 $ cat hg.pid >> $DAEMON_PIDS
348 $ cat hg.pid >> $DAEMON_PIDS
349 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
349 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
350 requesting all changes
350 requesting all changes
351 adding changesets
351 adding changesets
352 adding manifests
352 adding manifests
353 adding file changes
353 adding file changes
354 added 2 changesets with 2 changes to 2 files
354 added 2 changesets with 2 changes to 2 files
355 new changesets 567253b0f523:04d19c27a332 (2 drafts)
355 new changesets 567253b0f523:04d19c27a332 (2 drafts)
356 $ hg -R batchverifyclone verify --large --lfa
356 $ hg -R batchverifyclone verify --large --lfa
357 checking changesets
357 checking changesets
358 checking manifests
358 checking manifests
359 crosschecking files in changesets and manifests
359 crosschecking files in changesets and manifests
360 checking files
360 checking files
361 2 files, 2 changesets, 2 total revisions
361 checked 2 changesets with 2 changes to 2 files
362 searching 2 changesets for largefiles
362 searching 2 changesets for largefiles
363 verified existence of 2 revisions of 2 largefiles
363 verified existence of 2 revisions of 2 largefiles
364 $ tail -1 access.log
364 $ tail -1 access.log
365 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
365 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
366 $ hg -R batchverifyclone update
366 $ hg -R batchverifyclone update
367 getting changed largefiles
367 getting changed largefiles
368 2 largefiles updated, 0 removed
368 2 largefiles updated, 0 removed
369 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
370
370
371 Clear log file before next test
371 Clear log file before next test
372
372
373 $ printf "" > access.log
373 $ printf "" > access.log
374
374
375 Verify should check file on remote server only when file is not
375 Verify should check file on remote server only when file is not
376 available locally.
376 available locally.
377
377
378 $ echo "ccc" >> batchverifymain/c
378 $ echo "ccc" >> batchverifymain/c
379 $ hg -R batchverifymain status
379 $ hg -R batchverifymain status
380 ? c
380 ? c
381 $ hg -R batchverifymain add --large batchverifymain/c
381 $ hg -R batchverifymain add --large batchverifymain/c
382 $ hg -R batchverifymain commit -m "c"
382 $ hg -R batchverifymain commit -m "c"
383 Invoking status precommit hook
383 Invoking status precommit hook
384 A c
384 A c
385 $ hg -R batchverifyclone pull
385 $ hg -R batchverifyclone pull
386 pulling from http://localhost:$HGPORT/
386 pulling from http://localhost:$HGPORT/
387 searching for changes
387 searching for changes
388 adding changesets
388 adding changesets
389 adding manifests
389 adding manifests
390 adding file changes
390 adding file changes
391 added 1 changesets with 1 changes to 1 files
391 added 1 changesets with 1 changes to 1 files
392 new changesets 6bba8cb6935d (1 drafts)
392 new changesets 6bba8cb6935d (1 drafts)
393 (run 'hg update' to get a working copy)
393 (run 'hg update' to get a working copy)
394 $ hg -R batchverifyclone verify --lfa
394 $ hg -R batchverifyclone verify --lfa
395 checking changesets
395 checking changesets
396 checking manifests
396 checking manifests
397 crosschecking files in changesets and manifests
397 crosschecking files in changesets and manifests
398 checking files
398 checking files
399 3 files, 3 changesets, 3 total revisions
399 checked 3 changesets with 3 changes to 3 files
400 searching 3 changesets for largefiles
400 searching 3 changesets for largefiles
401 verified existence of 3 revisions of 3 largefiles
401 verified existence of 3 revisions of 3 largefiles
402 $ tail -1 access.log
402 $ tail -1 access.log
403 $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
403 $LOCALIP - - [$LOGDATE$] "GET /?cmd=statlfile HTTP/1.1" 200 - x-hgarg-1:sha=c8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
404
404
405 $ killdaemons.py
405 $ killdaemons.py
406
406
407 largefiles should not ask for password again after successful authorization
407 largefiles should not ask for password again after successful authorization
408
408
409 $ hg init credentialmain
409 $ hg init credentialmain
410 $ cd credentialmain
410 $ cd credentialmain
411 $ echo "aaa" >> a
411 $ echo "aaa" >> a
412 $ hg add --large a
412 $ hg add --large a
413 $ hg commit -m "a"
413 $ hg commit -m "a"
414 Invoking status precommit hook
414 Invoking status precommit hook
415 A a
415 A a
416
416
417 Before running server clear the user cache to force clone to download
417 Before running server clear the user cache to force clone to download
418 a large file from the server rather than to get it from the cache
418 a large file from the server rather than to get it from the cache
419
419
420 $ rm "${USERCACHE}"/*
420 $ rm "${USERCACHE}"/*
421
421
422 $ cd ..
422 $ cd ..
423 $ cat << EOT > userpass.py
423 $ cat << EOT > userpass.py
424 > import base64
424 > import base64
425 > from mercurial.hgweb import common
425 > from mercurial.hgweb import common
426 > def perform_authentication(hgweb, req, op):
426 > def perform_authentication(hgweb, req, op):
427 > auth = req.headers.get('Authorization')
427 > auth = req.headers.get('Authorization')
428 > if not auth:
428 > if not auth:
429 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
429 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
430 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
430 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
431 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
431 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
432 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
432 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
433 > def extsetup():
433 > def extsetup():
434 > common.permhooks.insert(0, perform_authentication)
434 > common.permhooks.insert(0, perform_authentication)
435 > EOT
435 > EOT
436 $ hg serve --config extensions.x=userpass.py -R credentialmain \
436 $ hg serve --config extensions.x=userpass.py -R credentialmain \
437 > -d -p $HGPORT --pid-file hg.pid -A access.log
437 > -d -p $HGPORT --pid-file hg.pid -A access.log
438 $ cat hg.pid >> $DAEMON_PIDS
438 $ cat hg.pid >> $DAEMON_PIDS
439 $ cat << EOF > get_pass.py
439 $ cat << EOF > get_pass.py
440 > import getpass
440 > import getpass
441 > def newgetpass(arg):
441 > def newgetpass(arg):
442 > return "pass"
442 > return "pass"
443 > getpass.getpass = newgetpass
443 > getpass.getpass = newgetpass
444 > EOF
444 > EOF
445 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
445 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
446 > http://user@localhost:$HGPORT credentialclone
446 > http://user@localhost:$HGPORT credentialclone
447 http authorization required for http://localhost:$HGPORT/
447 http authorization required for http://localhost:$HGPORT/
448 realm: mercurial
448 realm: mercurial
449 user: user
449 user: user
450 password: requesting all changes
450 password: requesting all changes
451 adding changesets
451 adding changesets
452 adding manifests
452 adding manifests
453 adding file changes
453 adding file changes
454 added 1 changesets with 1 changes to 1 files
454 added 1 changesets with 1 changes to 1 files
455 new changesets 567253b0f523 (1 drafts)
455 new changesets 567253b0f523 (1 drafts)
456 updating to branch default
456 updating to branch default
457 getting changed largefiles
457 getting changed largefiles
458 1 largefiles updated, 0 removed
458 1 largefiles updated, 0 removed
459 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
459 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
460
460
461 $ killdaemons.py
461 $ killdaemons.py
462 $ rm hg.pid access.log
462 $ rm hg.pid access.log
463
463
464 #endif
464 #endif
@@ -1,1889 +1,1889 b''
1 This file used to contains all largefile tests.
1 This file used to contains all largefile tests.
2 Do not add any new tests in this file as it his already far too long to run.
2 Do not add any new tests in this file as it his already far too long to run.
3
3
4 It contains all the testing of the basic concepts of large file in a single block.
4 It contains all the testing of the basic concepts of large file in a single block.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24 Create the repo with a couple of revisions of both large and normal
24 Create the repo with a couple of revisions of both large and normal
25 files.
25 files.
26 Test status and dirstate of largefiles and that summary output is correct.
26 Test status and dirstate of largefiles and that summary output is correct.
27
27
28 $ hg init a
28 $ hg init a
29 $ cd a
29 $ cd a
30 $ mkdir sub
30 $ mkdir sub
31 $ echo normal1 > normal1
31 $ echo normal1 > normal1
32 $ echo normal2 > sub/normal2
32 $ echo normal2 > sub/normal2
33 $ echo large1 > large1
33 $ echo large1 > large1
34 $ echo large2 > sub/large2
34 $ echo large2 > sub/large2
35 $ hg add normal1 sub/normal2
35 $ hg add normal1 sub/normal2
36 $ hg add --large large1 sub/large2
36 $ hg add --large large1 sub/large2
37 $ hg commit -m "add files"
37 $ hg commit -m "add files"
38 Invoking status precommit hook
38 Invoking status precommit hook
39 A large1
39 A large1
40 A normal1
40 A normal1
41 A sub/large2
41 A sub/large2
42 A sub/normal2
42 A sub/normal2
43 $ touch large1 sub/large2
43 $ touch large1 sub/large2
44 $ sleep 1
44 $ sleep 1
45 $ hg st
45 $ hg st
46 $ hg debugstate --nodates
46 $ hg debugstate --nodates
47 n 644 41 set .hglf/large1
47 n 644 41 set .hglf/large1
48 n 644 41 set .hglf/sub/large2
48 n 644 41 set .hglf/sub/large2
49 n 644 8 set normal1
49 n 644 8 set normal1
50 n 644 8 set sub/normal2
50 n 644 8 set sub/normal2
51 $ hg debugstate --large --nodates
51 $ hg debugstate --large --nodates
52 n 644 7 set large1
52 n 644 7 set large1
53 n 644 7 set sub/large2
53 n 644 7 set sub/large2
54 $ echo normal11 > normal1
54 $ echo normal11 > normal1
55 $ echo normal22 > sub/normal2
55 $ echo normal22 > sub/normal2
56 $ echo large11 > large1
56 $ echo large11 > large1
57 $ echo large22 > sub/large2
57 $ echo large22 > sub/large2
58 $ hg commit -m "edit files"
58 $ hg commit -m "edit files"
59 Invoking status precommit hook
59 Invoking status precommit hook
60 M large1
60 M large1
61 M normal1
61 M normal1
62 M sub/large2
62 M sub/large2
63 M sub/normal2
63 M sub/normal2
64 $ hg sum --large
64 $ hg sum --large
65 parent: 1:ce8896473775 tip
65 parent: 1:ce8896473775 tip
66 edit files
66 edit files
67 branch: default
67 branch: default
68 commit: (clean)
68 commit: (clean)
69 update: (current)
69 update: (current)
70 phases: 2 draft
70 phases: 2 draft
71 largefiles: (no remote repo)
71 largefiles: (no remote repo)
72
72
73 Commit preserved largefile contents.
73 Commit preserved largefile contents.
74
74
75 $ cat normal1
75 $ cat normal1
76 normal11
76 normal11
77 $ cat large1
77 $ cat large1
78 large11
78 large11
79 $ cat sub/normal2
79 $ cat sub/normal2
80 normal22
80 normal22
81 $ cat sub/large2
81 $ cat sub/large2
82 large22
82 large22
83
83
84 Test status, subdir and unknown files
84 Test status, subdir and unknown files
85
85
86 $ echo unknown > sub/unknown
86 $ echo unknown > sub/unknown
87 $ hg st --all
87 $ hg st --all
88 ? sub/unknown
88 ? sub/unknown
89 C large1
89 C large1
90 C normal1
90 C normal1
91 C sub/large2
91 C sub/large2
92 C sub/normal2
92 C sub/normal2
93 $ hg st --all sub
93 $ hg st --all sub
94 ? sub/unknown
94 ? sub/unknown
95 C sub/large2
95 C sub/large2
96 C sub/normal2
96 C sub/normal2
97 $ rm sub/unknown
97 $ rm sub/unknown
98
98
99 Test messages and exit codes for remove warning cases
99 Test messages and exit codes for remove warning cases
100
100
101 $ hg remove -A large1
101 $ hg remove -A large1
102 not removing large1: file still exists
102 not removing large1: file still exists
103 [1]
103 [1]
104 $ echo 'modified' > large1
104 $ echo 'modified' > large1
105 $ hg remove large1
105 $ hg remove large1
106 not removing large1: file is modified (use -f to force removal)
106 not removing large1: file is modified (use -f to force removal)
107 [1]
107 [1]
108 $ echo 'new' > normalnew
108 $ echo 'new' > normalnew
109 $ hg add normalnew
109 $ hg add normalnew
110 $ echo 'new' > largenew
110 $ echo 'new' > largenew
111 $ hg add --large normalnew
111 $ hg add --large normalnew
112 normalnew already tracked!
112 normalnew already tracked!
113 $ hg remove normalnew largenew
113 $ hg remove normalnew largenew
114 not removing largenew: file is untracked
114 not removing largenew: file is untracked
115 not removing normalnew: file has been marked for add (use 'hg forget' to undo add)
115 not removing normalnew: file has been marked for add (use 'hg forget' to undo add)
116 [1]
116 [1]
117 $ rm normalnew largenew
117 $ rm normalnew largenew
118 $ hg up -Cq
118 $ hg up -Cq
119
119
120 Remove both largefiles and normal files.
120 Remove both largefiles and normal files.
121
121
122 $ hg remove normal1 large1
122 $ hg remove normal1 large1
123 $ hg status large1
123 $ hg status large1
124 R large1
124 R large1
125 $ hg commit -m "remove files"
125 $ hg commit -m "remove files"
126 Invoking status precommit hook
126 Invoking status precommit hook
127 R large1
127 R large1
128 R normal1
128 R normal1
129 $ ls
129 $ ls
130 sub
130 sub
131 $ echo "testlargefile" > large1-test
131 $ echo "testlargefile" > large1-test
132 $ hg add --large large1-test
132 $ hg add --large large1-test
133 $ hg st
133 $ hg st
134 A large1-test
134 A large1-test
135 $ hg rm large1-test
135 $ hg rm large1-test
136 not removing large1-test: file has been marked for add (use forget to undo)
136 not removing large1-test: file has been marked for add (use forget to undo)
137 [1]
137 [1]
138 $ hg st
138 $ hg st
139 A large1-test
139 A large1-test
140 $ hg forget large1-test
140 $ hg forget large1-test
141 $ hg st
141 $ hg st
142 ? large1-test
142 ? large1-test
143 $ hg remove large1-test
143 $ hg remove large1-test
144 not removing large1-test: file is untracked
144 not removing large1-test: file is untracked
145 [1]
145 [1]
146 $ hg forget large1-test
146 $ hg forget large1-test
147 not removing large1-test: file is already untracked
147 not removing large1-test: file is already untracked
148 [1]
148 [1]
149 $ rm large1-test
149 $ rm large1-test
150
150
151 Copy both largefiles and normal files (testing that status output is correct).
151 Copy both largefiles and normal files (testing that status output is correct).
152
152
153 $ hg cp sub/normal2 normal1
153 $ hg cp sub/normal2 normal1
154 $ hg cp sub/large2 large1
154 $ hg cp sub/large2 large1
155 $ hg commit -m "copy files"
155 $ hg commit -m "copy files"
156 Invoking status precommit hook
156 Invoking status precommit hook
157 A large1
157 A large1
158 A normal1
158 A normal1
159 $ cat normal1
159 $ cat normal1
160 normal22
160 normal22
161 $ cat large1
161 $ cat large1
162 large22
162 large22
163
163
164 Test moving largefiles and verify that normal files are also unaffected.
164 Test moving largefiles and verify that normal files are also unaffected.
165
165
166 $ hg mv normal1 normal3
166 $ hg mv normal1 normal3
167 $ hg mv large1 large3
167 $ hg mv large1 large3
168 $ hg mv sub/normal2 sub/normal4
168 $ hg mv sub/normal2 sub/normal4
169 $ hg mv sub/large2 sub/large4
169 $ hg mv sub/large2 sub/large4
170 $ hg commit -m "move files"
170 $ hg commit -m "move files"
171 Invoking status precommit hook
171 Invoking status precommit hook
172 A large3
172 A large3
173 A normal3
173 A normal3
174 A sub/large4
174 A sub/large4
175 A sub/normal4
175 A sub/normal4
176 R large1
176 R large1
177 R normal1
177 R normal1
178 R sub/large2
178 R sub/large2
179 R sub/normal2
179 R sub/normal2
180 $ cat normal3
180 $ cat normal3
181 normal22
181 normal22
182 $ cat large3
182 $ cat large3
183 large22
183 large22
184 $ cat sub/normal4
184 $ cat sub/normal4
185 normal22
185 normal22
186 $ cat sub/large4
186 $ cat sub/large4
187 large22
187 large22
188
188
189
189
190 #if serve
190 #if serve
191 Test display of largefiles in hgweb
191 Test display of largefiles in hgweb
192
192
193 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
193 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
194 $ cat ../hg.pid >> $DAEMON_PIDS
194 $ cat ../hg.pid >> $DAEMON_PIDS
195 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
195 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
196 200 Script output follows
196 200 Script output follows
197
197
198
198
199 drwxr-xr-x sub
199 drwxr-xr-x sub
200 -rw-r--r-- 41 large3
200 -rw-r--r-- 41 large3
201 -rw-r--r-- 9 normal3
201 -rw-r--r-- 9 normal3
202
202
203
203
204 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
204 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
205 200 Script output follows
205 200 Script output follows
206
206
207
207
208 -rw-r--r-- 41 large4
208 -rw-r--r-- 41 large4
209 -rw-r--r-- 9 normal4
209 -rw-r--r-- 9 normal4
210
210
211
211
212 $ killdaemons.py
212 $ killdaemons.py
213 #endif
213 #endif
214
214
215 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
215 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
216
216
217 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
217 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
218 > #!$PYTHON
218 > #!$PYTHON
219 > from mercurial import demandimport; demandimport.enable()
219 > from mercurial import demandimport; demandimport.enable()
220 > from mercurial.hgweb import hgweb
220 > from mercurial.hgweb import hgweb
221 > from mercurial.hgweb import wsgicgi
221 > from mercurial.hgweb import wsgicgi
222 > application = hgweb(b'.', b'test repo')
222 > application = hgweb(b'.', b'test repo')
223 > wsgicgi.launch(application)
223 > wsgicgi.launch(application)
224 > EOF
224 > EOF
225 $ . "$TESTDIR/cgienv"
225 $ . "$TESTDIR/cgienv"
226
226
227 $ SCRIPT_NAME='' \
227 $ SCRIPT_NAME='' \
228 > $PYTHON "$TESTTMP/hgweb.cgi" > /dev/null
228 > $PYTHON "$TESTTMP/hgweb.cgi" > /dev/null
229
229
230 Test archiving the various revisions. These hit corner cases known with
230 Test archiving the various revisions. These hit corner cases known with
231 archiving.
231 archiving.
232
232
233 $ hg archive -r 0 ../archive0
233 $ hg archive -r 0 ../archive0
234 $ hg archive -r 1 ../archive1
234 $ hg archive -r 1 ../archive1
235 $ hg archive -r 2 ../archive2
235 $ hg archive -r 2 ../archive2
236 $ hg archive -r 3 ../archive3
236 $ hg archive -r 3 ../archive3
237 $ hg archive -r 4 ../archive4
237 $ hg archive -r 4 ../archive4
238 $ cd ../archive0
238 $ cd ../archive0
239 $ cat normal1
239 $ cat normal1
240 normal1
240 normal1
241 $ cat large1
241 $ cat large1
242 large1
242 large1
243 $ cat sub/normal2
243 $ cat sub/normal2
244 normal2
244 normal2
245 $ cat sub/large2
245 $ cat sub/large2
246 large2
246 large2
247 $ cd ../archive1
247 $ cd ../archive1
248 $ cat normal1
248 $ cat normal1
249 normal11
249 normal11
250 $ cat large1
250 $ cat large1
251 large11
251 large11
252 $ cat sub/normal2
252 $ cat sub/normal2
253 normal22
253 normal22
254 $ cat sub/large2
254 $ cat sub/large2
255 large22
255 large22
256 $ cd ../archive2
256 $ cd ../archive2
257 $ ls
257 $ ls
258 sub
258 sub
259 $ cat sub/normal2
259 $ cat sub/normal2
260 normal22
260 normal22
261 $ cat sub/large2
261 $ cat sub/large2
262 large22
262 large22
263 $ cd ../archive3
263 $ cd ../archive3
264 $ cat normal1
264 $ cat normal1
265 normal22
265 normal22
266 $ cat large1
266 $ cat large1
267 large22
267 large22
268 $ cat sub/normal2
268 $ cat sub/normal2
269 normal22
269 normal22
270 $ cat sub/large2
270 $ cat sub/large2
271 large22
271 large22
272 $ cd ../archive4
272 $ cd ../archive4
273 $ cat normal3
273 $ cat normal3
274 normal22
274 normal22
275 $ cat large3
275 $ cat large3
276 large22
276 large22
277 $ cat sub/normal4
277 $ cat sub/normal4
278 normal22
278 normal22
279 $ cat sub/large4
279 $ cat sub/large4
280 large22
280 large22
281
281
282 Commit corner case: specify files to commit.
282 Commit corner case: specify files to commit.
283
283
284 $ cd ../a
284 $ cd ../a
285 $ echo normal3 > normal3
285 $ echo normal3 > normal3
286 $ echo large3 > large3
286 $ echo large3 > large3
287 $ echo normal4 > sub/normal4
287 $ echo normal4 > sub/normal4
288 $ echo large4 > sub/large4
288 $ echo large4 > sub/large4
289 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
289 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
290 Invoking status precommit hook
290 Invoking status precommit hook
291 M large3
291 M large3
292 M normal3
292 M normal3
293 M sub/large4
293 M sub/large4
294 M sub/normal4
294 M sub/normal4
295 $ cat normal3
295 $ cat normal3
296 normal3
296 normal3
297 $ cat large3
297 $ cat large3
298 large3
298 large3
299 $ cat sub/normal4
299 $ cat sub/normal4
300 normal4
300 normal4
301 $ cat sub/large4
301 $ cat sub/large4
302 large4
302 large4
303
303
304 One more commit corner case: commit from a subdirectory.
304 One more commit corner case: commit from a subdirectory.
305
305
306 $ cd ../a
306 $ cd ../a
307 $ echo normal33 > normal3
307 $ echo normal33 > normal3
308 $ echo large33 > large3
308 $ echo large33 > large3
309 $ echo normal44 > sub/normal4
309 $ echo normal44 > sub/normal4
310 $ echo large44 > sub/large4
310 $ echo large44 > sub/large4
311 $ cd sub
311 $ cd sub
312 $ hg commit -m "edit files yet again"
312 $ hg commit -m "edit files yet again"
313 Invoking status precommit hook
313 Invoking status precommit hook
314 M large3
314 M large3
315 M normal3
315 M normal3
316 M sub/large4
316 M sub/large4
317 M sub/normal4
317 M sub/normal4
318 $ cat ../normal3
318 $ cat ../normal3
319 normal33
319 normal33
320 $ cat ../large3
320 $ cat ../large3
321 large33
321 large33
322 $ cat normal4
322 $ cat normal4
323 normal44
323 normal44
324 $ cat large4
324 $ cat large4
325 large44
325 large44
326
326
327 Committing standins is not allowed.
327 Committing standins is not allowed.
328
328
329 $ cd ..
329 $ cd ..
330 $ echo large3 > large3
330 $ echo large3 > large3
331 $ hg commit .hglf/large3 -m "try to commit standin"
331 $ hg commit .hglf/large3 -m "try to commit standin"
332 abort: file ".hglf/large3" is a largefile standin
332 abort: file ".hglf/large3" is a largefile standin
333 (commit the largefile itself instead)
333 (commit the largefile itself instead)
334 [255]
334 [255]
335
335
336 Corner cases for adding largefiles.
336 Corner cases for adding largefiles.
337
337
338 $ echo large5 > large5
338 $ echo large5 > large5
339 $ hg add --large large5
339 $ hg add --large large5
340 $ hg add --large large5
340 $ hg add --large large5
341 large5 already a largefile
341 large5 already a largefile
342 $ mkdir sub2
342 $ mkdir sub2
343 $ echo large6 > sub2/large6
343 $ echo large6 > sub2/large6
344 $ echo large7 > sub2/large7
344 $ echo large7 > sub2/large7
345 $ hg add --large sub2
345 $ hg add --large sub2
346 adding sub2/large6 as a largefile
346 adding sub2/large6 as a largefile
347 adding sub2/large7 as a largefile
347 adding sub2/large7 as a largefile
348 $ hg st
348 $ hg st
349 M large3
349 M large3
350 A large5
350 A large5
351 A sub2/large6
351 A sub2/large6
352 A sub2/large7
352 A sub2/large7
353
353
354 Committing directories containing only largefiles.
354 Committing directories containing only largefiles.
355
355
356 $ mkdir -p z/y/x/m
356 $ mkdir -p z/y/x/m
357 $ touch z/y/x/m/large1
357 $ touch z/y/x/m/large1
358 $ touch z/y/x/large2
358 $ touch z/y/x/large2
359 $ hg add --large z/y/x/m/large1 z/y/x/large2
359 $ hg add --large z/y/x/m/large1 z/y/x/large2
360 $ hg commit -m "Subdir with directory only containing largefiles" z
360 $ hg commit -m "Subdir with directory only containing largefiles" z
361 Invoking status precommit hook
361 Invoking status precommit hook
362 M large3
362 M large3
363 A large5
363 A large5
364 A sub2/large6
364 A sub2/large6
365 A sub2/large7
365 A sub2/large7
366 A z/y/x/large2
366 A z/y/x/large2
367 A z/y/x/m/large1
367 A z/y/x/m/large1
368
368
369 (and a bit of log testing)
369 (and a bit of log testing)
370
370
371 $ hg log -T '{rev}\n' z/y/x/m/large1
371 $ hg log -T '{rev}\n' z/y/x/m/large1
372 7
372 7
373 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
373 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
374 7
374 7
375
375
376 $ hg rollback --quiet
376 $ hg rollback --quiet
377 $ touch z/y/x/m/normal
377 $ touch z/y/x/m/normal
378 $ hg add z/y/x/m/normal
378 $ hg add z/y/x/m/normal
379 $ hg commit -m "Subdir with mixed contents" z
379 $ hg commit -m "Subdir with mixed contents" z
380 Invoking status precommit hook
380 Invoking status precommit hook
381 M large3
381 M large3
382 A large5
382 A large5
383 A sub2/large6
383 A sub2/large6
384 A sub2/large7
384 A sub2/large7
385 A z/y/x/large2
385 A z/y/x/large2
386 A z/y/x/m/large1
386 A z/y/x/m/large1
387 A z/y/x/m/normal
387 A z/y/x/m/normal
388 $ hg st
388 $ hg st
389 M large3
389 M large3
390 A large5
390 A large5
391 A sub2/large6
391 A sub2/large6
392 A sub2/large7
392 A sub2/large7
393 $ hg rollback --quiet
393 $ hg rollback --quiet
394 $ hg revert z/y/x/large2 z/y/x/m/large1
394 $ hg revert z/y/x/large2 z/y/x/m/large1
395 $ rm z/y/x/large2 z/y/x/m/large1
395 $ rm z/y/x/large2 z/y/x/m/large1
396 $ hg commit -m "Subdir with normal contents" z
396 $ hg commit -m "Subdir with normal contents" z
397 Invoking status precommit hook
397 Invoking status precommit hook
398 M large3
398 M large3
399 A large5
399 A large5
400 A sub2/large6
400 A sub2/large6
401 A sub2/large7
401 A sub2/large7
402 A z/y/x/m/normal
402 A z/y/x/m/normal
403 $ hg st
403 $ hg st
404 M large3
404 M large3
405 A large5
405 A large5
406 A sub2/large6
406 A sub2/large6
407 A sub2/large7
407 A sub2/large7
408 $ hg rollback --quiet
408 $ hg rollback --quiet
409 $ hg revert --quiet z
409 $ hg revert --quiet z
410 $ hg commit -m "Empty subdir" z
410 $ hg commit -m "Empty subdir" z
411 abort: z: no match under directory!
411 abort: z: no match under directory!
412 [255]
412 [255]
413 $ rm -rf z
413 $ rm -rf z
414 $ hg ci -m "standin" .hglf
414 $ hg ci -m "standin" .hglf
415 abort: file ".hglf" is a largefile standin
415 abort: file ".hglf" is a largefile standin
416 (commit the largefile itself instead)
416 (commit the largefile itself instead)
417 [255]
417 [255]
418
418
419 Test "hg status" with combination of 'file pattern' and 'directory
419 Test "hg status" with combination of 'file pattern' and 'directory
420 pattern' for largefiles:
420 pattern' for largefiles:
421
421
422 $ hg status sub2/large6 sub2
422 $ hg status sub2/large6 sub2
423 A sub2/large6
423 A sub2/large6
424 A sub2/large7
424 A sub2/large7
425
425
426 Config settings (pattern **.dat, minsize 2 MB) are respected.
426 Config settings (pattern **.dat, minsize 2 MB) are respected.
427
427
428 $ echo testdata > test.dat
428 $ echo testdata > test.dat
429 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
429 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
430 $ hg add
430 $ hg add
431 adding reallylarge as a largefile
431 adding reallylarge as a largefile
432 adding test.dat as a largefile
432 adding test.dat as a largefile
433
433
434 Test that minsize and --lfsize handle float values;
434 Test that minsize and --lfsize handle float values;
435 also tests that --lfsize overrides largefiles.minsize.
435 also tests that --lfsize overrides largefiles.minsize.
436 (0.250 MB = 256 kB = 262144 B)
436 (0.250 MB = 256 kB = 262144 B)
437
437
438 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
438 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
439 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
439 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
440 $ hg --config largefiles.minsize=.25 add
440 $ hg --config largefiles.minsize=.25 add
441 adding ratherlarge as a largefile
441 adding ratherlarge as a largefile
442 adding medium
442 adding medium
443 $ hg forget medium
443 $ hg forget medium
444 $ hg --config largefiles.minsize=.25 add --lfsize=.125
444 $ hg --config largefiles.minsize=.25 add --lfsize=.125
445 adding medium as a largefile
445 adding medium as a largefile
446 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
447 $ hg --config largefiles.minsize=.25 add --lfsize=.125
447 $ hg --config largefiles.minsize=.25 add --lfsize=.125
448 adding notlarge
448 adding notlarge
449 $ hg forget notlarge
449 $ hg forget notlarge
450
450
451 Test forget on largefiles.
451 Test forget on largefiles.
452
452
453 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
453 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
454 $ hg commit -m "add/edit more largefiles"
454 $ hg commit -m "add/edit more largefiles"
455 Invoking status precommit hook
455 Invoking status precommit hook
456 A sub2/large6
456 A sub2/large6
457 A sub2/large7
457 A sub2/large7
458 R large3
458 R large3
459 ? large5
459 ? large5
460 ? medium
460 ? medium
461 ? notlarge
461 ? notlarge
462 ? ratherlarge
462 ? ratherlarge
463 ? reallylarge
463 ? reallylarge
464 ? test.dat
464 ? test.dat
465 $ hg st
465 $ hg st
466 ? large3
466 ? large3
467 ? large5
467 ? large5
468 ? medium
468 ? medium
469 ? notlarge
469 ? notlarge
470 ? ratherlarge
470 ? ratherlarge
471 ? reallylarge
471 ? reallylarge
472 ? test.dat
472 ? test.dat
473
473
474 Purge with largefiles: verify that largefiles are still in the working
474 Purge with largefiles: verify that largefiles are still in the working
475 dir after a purge.
475 dir after a purge.
476
476
477 $ hg purge --all
477 $ hg purge --all
478 $ cat sub/large4
478 $ cat sub/large4
479 large44
479 large44
480 $ cat sub2/large6
480 $ cat sub2/large6
481 large6
481 large6
482 $ cat sub2/large7
482 $ cat sub2/large7
483 large7
483 large7
484
484
485 Test addremove: verify that files that should be added as largefiles are added as
485 Test addremove: verify that files that should be added as largefiles are added as
486 such and that already-existing largefiles are not added as normal files by
486 such and that already-existing largefiles are not added as normal files by
487 accident.
487 accident.
488
488
489 $ rm normal3
489 $ rm normal3
490 $ rm sub/large4
490 $ rm sub/large4
491 $ echo "testing addremove with patterns" > testaddremove.dat
491 $ echo "testing addremove with patterns" > testaddremove.dat
492 $ echo "normaladdremove" > normaladdremove
492 $ echo "normaladdremove" > normaladdremove
493 $ hg addremove
493 $ hg addremove
494 removing sub/large4
494 removing sub/large4
495 adding testaddremove.dat as a largefile
495 adding testaddremove.dat as a largefile
496 removing normal3
496 removing normal3
497 adding normaladdremove
497 adding normaladdremove
498
498
499 Test addremove with -R
499 Test addremove with -R
500
500
501 $ hg up -C
501 $ hg up -C
502 getting changed largefiles
502 getting changed largefiles
503 1 largefiles updated, 0 removed
503 1 largefiles updated, 0 removed
504 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
505 $ rm normal3
505 $ rm normal3
506 $ rm sub/large4
506 $ rm sub/large4
507 $ echo "testing addremove with patterns" > testaddremove.dat
507 $ echo "testing addremove with patterns" > testaddremove.dat
508 $ echo "normaladdremove" > normaladdremove
508 $ echo "normaladdremove" > normaladdremove
509 $ cd ..
509 $ cd ..
510 $ hg -R a -v addremove
510 $ hg -R a -v addremove
511 removing sub/large4
511 removing sub/large4
512 adding testaddremove.dat as a largefile
512 adding testaddremove.dat as a largefile
513 removing normal3
513 removing normal3
514 adding normaladdremove
514 adding normaladdremove
515 $ cd a
515 $ cd a
516
516
517 Test 3364
517 Test 3364
518 $ hg clone . ../addrm
518 $ hg clone . ../addrm
519 updating to branch default
519 updating to branch default
520 getting changed largefiles
520 getting changed largefiles
521 3 largefiles updated, 0 removed
521 3 largefiles updated, 0 removed
522 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
523 $ cd ../addrm
523 $ cd ../addrm
524 $ cat >> .hg/hgrc <<EOF
524 $ cat >> .hg/hgrc <<EOF
525 > [hooks]
525 > [hooks]
526 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
526 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
527 > EOF
527 > EOF
528 $ touch foo
528 $ touch foo
529 $ hg add --large foo
529 $ hg add --large foo
530 $ hg ci -m "add foo"
530 $ hg ci -m "add foo"
531 Invoking status precommit hook
531 Invoking status precommit hook
532 A foo
532 A foo
533 Invoking status postcommit hook
533 Invoking status postcommit hook
534 C foo
534 C foo
535 C normal3
535 C normal3
536 C sub/large4
536 C sub/large4
537 C sub/normal4
537 C sub/normal4
538 C sub2/large6
538 C sub2/large6
539 C sub2/large7
539 C sub2/large7
540 $ rm foo
540 $ rm foo
541 $ hg st
541 $ hg st
542 ! foo
542 ! foo
543 hmm.. no precommit invoked, but there is a postcommit??
543 hmm.. no precommit invoked, but there is a postcommit??
544 $ hg ci -m "will not checkin"
544 $ hg ci -m "will not checkin"
545 nothing changed (1 missing files, see 'hg status')
545 nothing changed (1 missing files, see 'hg status')
546 Invoking status postcommit hook
546 Invoking status postcommit hook
547 ! foo
547 ! foo
548 C normal3
548 C normal3
549 C sub/large4
549 C sub/large4
550 C sub/normal4
550 C sub/normal4
551 C sub2/large6
551 C sub2/large6
552 C sub2/large7
552 C sub2/large7
553 [1]
553 [1]
554 $ hg addremove
554 $ hg addremove
555 removing foo
555 removing foo
556 $ hg st
556 $ hg st
557 R foo
557 R foo
558 $ hg ci -m "used to say nothing changed"
558 $ hg ci -m "used to say nothing changed"
559 Invoking status precommit hook
559 Invoking status precommit hook
560 R foo
560 R foo
561 Invoking status postcommit hook
561 Invoking status postcommit hook
562 C normal3
562 C normal3
563 C sub/large4
563 C sub/large4
564 C sub/normal4
564 C sub/normal4
565 C sub2/large6
565 C sub2/large6
566 C sub2/large7
566 C sub2/large7
567 $ hg st
567 $ hg st
568
568
569 Test 3507 (both normal files and largefiles were a problem)
569 Test 3507 (both normal files and largefiles were a problem)
570
570
571 $ touch normal
571 $ touch normal
572 $ touch large
572 $ touch large
573 $ hg add normal
573 $ hg add normal
574 $ hg add --large large
574 $ hg add --large large
575 $ hg ci -m "added"
575 $ hg ci -m "added"
576 Invoking status precommit hook
576 Invoking status precommit hook
577 A large
577 A large
578 A normal
578 A normal
579 Invoking status postcommit hook
579 Invoking status postcommit hook
580 C large
580 C large
581 C normal
581 C normal
582 C normal3
582 C normal3
583 C sub/large4
583 C sub/large4
584 C sub/normal4
584 C sub/normal4
585 C sub2/large6
585 C sub2/large6
586 C sub2/large7
586 C sub2/large7
587 $ hg remove normal
587 $ hg remove normal
588 $ hg addremove --traceback
588 $ hg addremove --traceback
589 $ hg ci -m "addremoved normal"
589 $ hg ci -m "addremoved normal"
590 Invoking status precommit hook
590 Invoking status precommit hook
591 R normal
591 R normal
592 Invoking status postcommit hook
592 Invoking status postcommit hook
593 C large
593 C large
594 C normal3
594 C normal3
595 C sub/large4
595 C sub/large4
596 C sub/normal4
596 C sub/normal4
597 C sub2/large6
597 C sub2/large6
598 C sub2/large7
598 C sub2/large7
599 $ hg up -C '.^'
599 $ hg up -C '.^'
600 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
600 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
601 $ hg remove large
601 $ hg remove large
602 $ hg addremove --traceback
602 $ hg addremove --traceback
603 $ hg ci -m "removed large"
603 $ hg ci -m "removed large"
604 Invoking status precommit hook
604 Invoking status precommit hook
605 R large
605 R large
606 created new head
606 created new head
607 Invoking status postcommit hook
607 Invoking status postcommit hook
608 C normal
608 C normal
609 C normal3
609 C normal3
610 C sub/large4
610 C sub/large4
611 C sub/normal4
611 C sub/normal4
612 C sub2/large6
612 C sub2/large6
613 C sub2/large7
613 C sub2/large7
614
614
615 Test commit -A (issue3542)
615 Test commit -A (issue3542)
616 $ echo large8 > large8
616 $ echo large8 > large8
617 $ hg add --large large8
617 $ hg add --large large8
618 $ hg ci -Am 'this used to add large8 as normal and commit both'
618 $ hg ci -Am 'this used to add large8 as normal and commit both'
619 Invoking status precommit hook
619 Invoking status precommit hook
620 A large8
620 A large8
621 Invoking status postcommit hook
621 Invoking status postcommit hook
622 C large8
622 C large8
623 C normal
623 C normal
624 C normal3
624 C normal3
625 C sub/large4
625 C sub/large4
626 C sub/normal4
626 C sub/normal4
627 C sub2/large6
627 C sub2/large6
628 C sub2/large7
628 C sub2/large7
629 $ rm large8
629 $ rm large8
630 $ hg ci -Am 'this used to not notice the rm'
630 $ hg ci -Am 'this used to not notice the rm'
631 removing large8
631 removing large8
632 Invoking status precommit hook
632 Invoking status precommit hook
633 R large8
633 R large8
634 Invoking status postcommit hook
634 Invoking status postcommit hook
635 C normal
635 C normal
636 C normal3
636 C normal3
637 C sub/large4
637 C sub/large4
638 C sub/normal4
638 C sub/normal4
639 C sub2/large6
639 C sub2/large6
640 C sub2/large7
640 C sub2/large7
641
641
642 Test that a standin can't be added as a large file
642 Test that a standin can't be added as a large file
643
643
644 $ touch large
644 $ touch large
645 $ hg add --large large
645 $ hg add --large large
646 $ hg ci -m "add"
646 $ hg ci -m "add"
647 Invoking status precommit hook
647 Invoking status precommit hook
648 A large
648 A large
649 Invoking status postcommit hook
649 Invoking status postcommit hook
650 C large
650 C large
651 C normal
651 C normal
652 C normal3
652 C normal3
653 C sub/large4
653 C sub/large4
654 C sub/normal4
654 C sub/normal4
655 C sub2/large6
655 C sub2/large6
656 C sub2/large7
656 C sub2/large7
657 $ hg remove large
657 $ hg remove large
658 $ touch large
658 $ touch large
659 $ hg addremove --config largefiles.patterns=**large --traceback
659 $ hg addremove --config largefiles.patterns=**large --traceback
660 adding large as a largefile
660 adding large as a largefile
661
661
662 Test that outgoing --large works (with revsets too)
662 Test that outgoing --large works (with revsets too)
663 $ hg outgoing --rev '.^' --large
663 $ hg outgoing --rev '.^' --large
664 comparing with $TESTTMP/a
664 comparing with $TESTTMP/a
665 searching for changes
665 searching for changes
666 changeset: 8:c02fd3b77ec4
666 changeset: 8:c02fd3b77ec4
667 user: test
667 user: test
668 date: Thu Jan 01 00:00:00 1970 +0000
668 date: Thu Jan 01 00:00:00 1970 +0000
669 summary: add foo
669 summary: add foo
670
670
671 changeset: 9:289dd08c9bbb
671 changeset: 9:289dd08c9bbb
672 user: test
672 user: test
673 date: Thu Jan 01 00:00:00 1970 +0000
673 date: Thu Jan 01 00:00:00 1970 +0000
674 summary: used to say nothing changed
674 summary: used to say nothing changed
675
675
676 changeset: 10:34f23ac6ac12
676 changeset: 10:34f23ac6ac12
677 user: test
677 user: test
678 date: Thu Jan 01 00:00:00 1970 +0000
678 date: Thu Jan 01 00:00:00 1970 +0000
679 summary: added
679 summary: added
680
680
681 changeset: 12:710c1b2f523c
681 changeset: 12:710c1b2f523c
682 parent: 10:34f23ac6ac12
682 parent: 10:34f23ac6ac12
683 user: test
683 user: test
684 date: Thu Jan 01 00:00:00 1970 +0000
684 date: Thu Jan 01 00:00:00 1970 +0000
685 summary: removed large
685 summary: removed large
686
686
687 changeset: 13:0a3e75774479
687 changeset: 13:0a3e75774479
688 user: test
688 user: test
689 date: Thu Jan 01 00:00:00 1970 +0000
689 date: Thu Jan 01 00:00:00 1970 +0000
690 summary: this used to add large8 as normal and commit both
690 summary: this used to add large8 as normal and commit both
691
691
692 changeset: 14:84f3d378175c
692 changeset: 14:84f3d378175c
693 user: test
693 user: test
694 date: Thu Jan 01 00:00:00 1970 +0000
694 date: Thu Jan 01 00:00:00 1970 +0000
695 summary: this used to not notice the rm
695 summary: this used to not notice the rm
696
696
697 largefiles to upload (1 entities):
697 largefiles to upload (1 entities):
698 large8
698 large8
699
699
700 $ cd ../a
700 $ cd ../a
701
701
702 Clone a largefiles repo.
702 Clone a largefiles repo.
703
703
704 $ hg clone . ../b
704 $ hg clone . ../b
705 updating to branch default
705 updating to branch default
706 getting changed largefiles
706 getting changed largefiles
707 3 largefiles updated, 0 removed
707 3 largefiles updated, 0 removed
708 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
708 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
709 $ cd ../b
709 $ cd ../b
710 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
710 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
711 7:daea875e9014 add/edit more largefiles
711 7:daea875e9014 add/edit more largefiles
712 6:4355d653f84f edit files yet again
712 6:4355d653f84f edit files yet again
713 5:9d5af5072dbd edit files again
713 5:9d5af5072dbd edit files again
714 4:74c02385b94c move files
714 4:74c02385b94c move files
715 3:9e8fbc4bce62 copy files
715 3:9e8fbc4bce62 copy files
716 2:51a0ae4d5864 remove files
716 2:51a0ae4d5864 remove files
717 1:ce8896473775 edit files
717 1:ce8896473775 edit files
718 0:30d30fe6a5be add files
718 0:30d30fe6a5be add files
719 $ cat normal3
719 $ cat normal3
720 normal33
720 normal33
721
721
722 Test graph log
722 Test graph log
723
723
724 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
724 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
725 @ 7:daea875e9014 add/edit more largefiles
725 @ 7:daea875e9014 add/edit more largefiles
726 |
726 |
727 o 6:4355d653f84f edit files yet again
727 o 6:4355d653f84f edit files yet again
728 |
728 |
729 o 5:9d5af5072dbd edit files again
729 o 5:9d5af5072dbd edit files again
730 |
730 |
731 o 4:74c02385b94c move files
731 o 4:74c02385b94c move files
732 |
732 |
733 o 3:9e8fbc4bce62 copy files
733 o 3:9e8fbc4bce62 copy files
734 |
734 |
735 o 2:51a0ae4d5864 remove files
735 o 2:51a0ae4d5864 remove files
736 |
736 |
737 o 1:ce8896473775 edit files
737 o 1:ce8896473775 edit files
738 |
738 |
739 o 0:30d30fe6a5be add files
739 o 0:30d30fe6a5be add files
740
740
741
741
742 Test log with --patch
742 Test log with --patch
743
743
744 $ hg log --patch -r 6::7
744 $ hg log --patch -r 6::7
745 changeset: 6:4355d653f84f
745 changeset: 6:4355d653f84f
746 user: test
746 user: test
747 date: Thu Jan 01 00:00:00 1970 +0000
747 date: Thu Jan 01 00:00:00 1970 +0000
748 summary: edit files yet again
748 summary: edit files yet again
749
749
750 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
750 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
751 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
751 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
752 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
752 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
753 @@ -1,1 +1,1 @@
753 @@ -1,1 +1,1 @@
754 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
754 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
755 +7838695e10da2bb75ac1156565f40a2595fa2fa0
755 +7838695e10da2bb75ac1156565f40a2595fa2fa0
756 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
756 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
757 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
757 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
758 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
758 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
759 @@ -1,1 +1,1 @@
759 @@ -1,1 +1,1 @@
760 -aeb2210d19f02886dde00dac279729a48471e2f9
760 -aeb2210d19f02886dde00dac279729a48471e2f9
761 +971fb41e78fea4f8e0ba5244784239371cb00591
761 +971fb41e78fea4f8e0ba5244784239371cb00591
762 diff -r 9d5af5072dbd -r 4355d653f84f normal3
762 diff -r 9d5af5072dbd -r 4355d653f84f normal3
763 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
763 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
764 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
764 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
765 @@ -1,1 +1,1 @@
765 @@ -1,1 +1,1 @@
766 -normal3
766 -normal3
767 +normal33
767 +normal33
768 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
768 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
769 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
769 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
770 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
770 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
771 @@ -1,1 +1,1 @@
771 @@ -1,1 +1,1 @@
772 -normal4
772 -normal4
773 +normal44
773 +normal44
774
774
775 changeset: 7:daea875e9014
775 changeset: 7:daea875e9014
776 tag: tip
776 tag: tip
777 user: test
777 user: test
778 date: Thu Jan 01 00:00:00 1970 +0000
778 date: Thu Jan 01 00:00:00 1970 +0000
779 summary: add/edit more largefiles
779 summary: add/edit more largefiles
780
780
781 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
781 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
782 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
782 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
783 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
783 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
784 @@ -1,1 +0,0 @@
784 @@ -1,1 +0,0 @@
785 -7838695e10da2bb75ac1156565f40a2595fa2fa0
785 -7838695e10da2bb75ac1156565f40a2595fa2fa0
786 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
786 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
787 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
787 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
788 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
788 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
789 @@ -0,0 +1,1 @@
789 @@ -0,0 +1,1 @@
790 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
790 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
791 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
791 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
792 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
792 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
793 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
793 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
794 @@ -0,0 +1,1 @@
794 @@ -0,0 +1,1 @@
795 +bb3151689acb10f0c3125c560d5e63df914bc1af
795 +bb3151689acb10f0c3125c560d5e63df914bc1af
796
796
797
797
798 $ hg log --patch -r 6::7 sub/
798 $ hg log --patch -r 6::7 sub/
799 changeset: 6:4355d653f84f
799 changeset: 6:4355d653f84f
800 user: test
800 user: test
801 date: Thu Jan 01 00:00:00 1970 +0000
801 date: Thu Jan 01 00:00:00 1970 +0000
802 summary: edit files yet again
802 summary: edit files yet again
803
803
804 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
804 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
805 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
805 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
806 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
806 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
807 @@ -1,1 +1,1 @@
807 @@ -1,1 +1,1 @@
808 -aeb2210d19f02886dde00dac279729a48471e2f9
808 -aeb2210d19f02886dde00dac279729a48471e2f9
809 +971fb41e78fea4f8e0ba5244784239371cb00591
809 +971fb41e78fea4f8e0ba5244784239371cb00591
810 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
810 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
811 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
811 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
812 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
812 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
813 @@ -1,1 +1,1 @@
813 @@ -1,1 +1,1 @@
814 -normal4
814 -normal4
815 +normal44
815 +normal44
816
816
817
817
818 log with both --follow and --patch
818 log with both --follow and --patch
819
819
820 $ hg log --follow --patch --limit 2
820 $ hg log --follow --patch --limit 2
821 changeset: 7:daea875e9014
821 changeset: 7:daea875e9014
822 tag: tip
822 tag: tip
823 user: test
823 user: test
824 date: Thu Jan 01 00:00:00 1970 +0000
824 date: Thu Jan 01 00:00:00 1970 +0000
825 summary: add/edit more largefiles
825 summary: add/edit more largefiles
826
826
827 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
827 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
828 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
828 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
829 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
829 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
830 @@ -1,1 +0,0 @@
830 @@ -1,1 +0,0 @@
831 -7838695e10da2bb75ac1156565f40a2595fa2fa0
831 -7838695e10da2bb75ac1156565f40a2595fa2fa0
832 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
832 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
833 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
833 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
834 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
834 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
835 @@ -0,0 +1,1 @@
835 @@ -0,0 +1,1 @@
836 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
836 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
837 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
837 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
838 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
838 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
839 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
839 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
840 @@ -0,0 +1,1 @@
840 @@ -0,0 +1,1 @@
841 +bb3151689acb10f0c3125c560d5e63df914bc1af
841 +bb3151689acb10f0c3125c560d5e63df914bc1af
842
842
843 changeset: 6:4355d653f84f
843 changeset: 6:4355d653f84f
844 user: test
844 user: test
845 date: Thu Jan 01 00:00:00 1970 +0000
845 date: Thu Jan 01 00:00:00 1970 +0000
846 summary: edit files yet again
846 summary: edit files yet again
847
847
848 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
848 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
849 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
849 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
850 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
850 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
851 @@ -1,1 +1,1 @@
851 @@ -1,1 +1,1 @@
852 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
852 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
853 +7838695e10da2bb75ac1156565f40a2595fa2fa0
853 +7838695e10da2bb75ac1156565f40a2595fa2fa0
854 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
854 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
855 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
855 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
856 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
856 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
857 @@ -1,1 +1,1 @@
857 @@ -1,1 +1,1 @@
858 -aeb2210d19f02886dde00dac279729a48471e2f9
858 -aeb2210d19f02886dde00dac279729a48471e2f9
859 +971fb41e78fea4f8e0ba5244784239371cb00591
859 +971fb41e78fea4f8e0ba5244784239371cb00591
860 diff -r 9d5af5072dbd -r 4355d653f84f normal3
860 diff -r 9d5af5072dbd -r 4355d653f84f normal3
861 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
861 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
862 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
862 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
863 @@ -1,1 +1,1 @@
863 @@ -1,1 +1,1 @@
864 -normal3
864 -normal3
865 +normal33
865 +normal33
866 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
866 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
867 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
867 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
868 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
868 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
869 @@ -1,1 +1,1 @@
869 @@ -1,1 +1,1 @@
870 -normal4
870 -normal4
871 +normal44
871 +normal44
872
872
873 $ hg log --follow --patch sub/large4
873 $ hg log --follow --patch sub/large4
874 changeset: 6:4355d653f84f
874 changeset: 6:4355d653f84f
875 user: test
875 user: test
876 date: Thu Jan 01 00:00:00 1970 +0000
876 date: Thu Jan 01 00:00:00 1970 +0000
877 summary: edit files yet again
877 summary: edit files yet again
878
878
879 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
879 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
880 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
880 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
881 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
881 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
882 @@ -1,1 +1,1 @@
882 @@ -1,1 +1,1 @@
883 -aeb2210d19f02886dde00dac279729a48471e2f9
883 -aeb2210d19f02886dde00dac279729a48471e2f9
884 +971fb41e78fea4f8e0ba5244784239371cb00591
884 +971fb41e78fea4f8e0ba5244784239371cb00591
885
885
886 changeset: 5:9d5af5072dbd
886 changeset: 5:9d5af5072dbd
887 user: test
887 user: test
888 date: Thu Jan 01 00:00:00 1970 +0000
888 date: Thu Jan 01 00:00:00 1970 +0000
889 summary: edit files again
889 summary: edit files again
890
890
891 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
891 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
892 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
892 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
893 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
893 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
894 @@ -1,1 +1,1 @@
894 @@ -1,1 +1,1 @@
895 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
895 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
896 +aeb2210d19f02886dde00dac279729a48471e2f9
896 +aeb2210d19f02886dde00dac279729a48471e2f9
897
897
898 changeset: 4:74c02385b94c
898 changeset: 4:74c02385b94c
899 user: test
899 user: test
900 date: Thu Jan 01 00:00:00 1970 +0000
900 date: Thu Jan 01 00:00:00 1970 +0000
901 summary: move files
901 summary: move files
902
902
903 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
903 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
904 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
904 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
905 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
905 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
906 @@ -0,0 +1,1 @@
906 @@ -0,0 +1,1 @@
907 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
907 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
908
908
909 changeset: 1:ce8896473775
909 changeset: 1:ce8896473775
910 user: test
910 user: test
911 date: Thu Jan 01 00:00:00 1970 +0000
911 date: Thu Jan 01 00:00:00 1970 +0000
912 summary: edit files
912 summary: edit files
913
913
914 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
914 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
915 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
915 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
916 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
916 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
917 @@ -1,1 +1,1 @@
917 @@ -1,1 +1,1 @@
918 -1deebade43c8c498a3c8daddac0244dc55d1331d
918 -1deebade43c8c498a3c8daddac0244dc55d1331d
919 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
919 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
920
920
921 changeset: 0:30d30fe6a5be
921 changeset: 0:30d30fe6a5be
922 user: test
922 user: test
923 date: Thu Jan 01 00:00:00 1970 +0000
923 date: Thu Jan 01 00:00:00 1970 +0000
924 summary: add files
924 summary: add files
925
925
926 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
926 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
927 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
927 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
928 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
928 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
929 @@ -0,0 +1,1 @@
929 @@ -0,0 +1,1 @@
930 +1deebade43c8c498a3c8daddac0244dc55d1331d
930 +1deebade43c8c498a3c8daddac0244dc55d1331d
931
931
932 $ cat sub/normal4
932 $ cat sub/normal4
933 normal44
933 normal44
934 $ cat sub/large4
934 $ cat sub/large4
935 large44
935 large44
936 $ cat sub2/large6
936 $ cat sub2/large6
937 large6
937 large6
938 $ cat sub2/large7
938 $ cat sub2/large7
939 large7
939 large7
940 $ hg log -qf sub2/large7
940 $ hg log -qf sub2/large7
941 7:daea875e9014
941 7:daea875e9014
942 $ hg log -Gqf sub2/large7
942 $ hg log -Gqf sub2/large7
943 @ 7:daea875e9014
943 @ 7:daea875e9014
944 |
944 |
945 ~
945 ~
946 $ cd ..
946 $ cd ..
947
947
948 Test log from outside repo
948 Test log from outside repo
949
949
950 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
950 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
951 6:4355d653f84f edit files yet again
951 6:4355d653f84f edit files yet again
952 5:9d5af5072dbd edit files again
952 5:9d5af5072dbd edit files again
953 4:74c02385b94c move files
953 4:74c02385b94c move files
954 1:ce8896473775 edit files
954 1:ce8896473775 edit files
955 0:30d30fe6a5be add files
955 0:30d30fe6a5be add files
956
956
957 Test clone at revision
957 Test clone at revision
958
958
959 $ hg clone a -r 3 c
959 $ hg clone a -r 3 c
960 adding changesets
960 adding changesets
961 adding manifests
961 adding manifests
962 adding file changes
962 adding file changes
963 added 4 changesets with 10 changes to 4 files
963 added 4 changesets with 10 changes to 4 files
964 new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts)
964 new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts)
965 updating to branch default
965 updating to branch default
966 getting changed largefiles
966 getting changed largefiles
967 2 largefiles updated, 0 removed
967 2 largefiles updated, 0 removed
968 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
968 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
969 $ cd c
969 $ cd c
970 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
970 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
971 3:9e8fbc4bce62 copy files
971 3:9e8fbc4bce62 copy files
972 2:51a0ae4d5864 remove files
972 2:51a0ae4d5864 remove files
973 1:ce8896473775 edit files
973 1:ce8896473775 edit files
974 0:30d30fe6a5be add files
974 0:30d30fe6a5be add files
975 $ cat normal1
975 $ cat normal1
976 normal22
976 normal22
977 $ cat large1
977 $ cat large1
978 large22
978 large22
979 $ cat sub/normal2
979 $ cat sub/normal2
980 normal22
980 normal22
981 $ cat sub/large2
981 $ cat sub/large2
982 large22
982 large22
983
983
984 Old revisions of a clone have correct largefiles content (this also
984 Old revisions of a clone have correct largefiles content (this also
985 tests update).
985 tests update).
986
986
987 $ hg update -r 1
987 $ hg update -r 1
988 getting changed largefiles
988 getting changed largefiles
989 1 largefiles updated, 0 removed
989 1 largefiles updated, 0 removed
990 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
990 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
991 $ cat large1
991 $ cat large1
992 large11
992 large11
993 $ cat sub/large2
993 $ cat sub/large2
994 large22
994 large22
995 $ cd ..
995 $ cd ..
996
996
997 Test cloning with --all-largefiles flag
997 Test cloning with --all-largefiles flag
998
998
999 $ rm "${USERCACHE}"/*
999 $ rm "${USERCACHE}"/*
1000 $ hg clone --all-largefiles a a-backup
1000 $ hg clone --all-largefiles a a-backup
1001 updating to branch default
1001 updating to branch default
1002 getting changed largefiles
1002 getting changed largefiles
1003 3 largefiles updated, 0 removed
1003 3 largefiles updated, 0 removed
1004 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1004 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1005 8 additional largefiles cached
1005 8 additional largefiles cached
1006
1006
1007 $ rm "${USERCACHE}"/*
1007 $ rm "${USERCACHE}"/*
1008 $ hg clone --all-largefiles -u 0 a a-clone0
1008 $ hg clone --all-largefiles -u 0 a a-clone0
1009 updating to branch default
1009 updating to branch default
1010 getting changed largefiles
1010 getting changed largefiles
1011 2 largefiles updated, 0 removed
1011 2 largefiles updated, 0 removed
1012 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1012 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1013 9 additional largefiles cached
1013 9 additional largefiles cached
1014 $ hg -R a-clone0 sum
1014 $ hg -R a-clone0 sum
1015 parent: 0:30d30fe6a5be
1015 parent: 0:30d30fe6a5be
1016 add files
1016 add files
1017 branch: default
1017 branch: default
1018 commit: (clean)
1018 commit: (clean)
1019 update: 7 new changesets (update)
1019 update: 7 new changesets (update)
1020 phases: 8 draft
1020 phases: 8 draft
1021
1021
1022 $ rm "${USERCACHE}"/*
1022 $ rm "${USERCACHE}"/*
1023 $ hg clone --all-largefiles -u 1 a a-clone1
1023 $ hg clone --all-largefiles -u 1 a a-clone1
1024 updating to branch default
1024 updating to branch default
1025 getting changed largefiles
1025 getting changed largefiles
1026 2 largefiles updated, 0 removed
1026 2 largefiles updated, 0 removed
1027 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1027 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1028 8 additional largefiles cached
1028 8 additional largefiles cached
1029 $ hg -R a-clone1 verify --large --lfa --lfc
1029 $ hg -R a-clone1 verify --large --lfa --lfc
1030 checking changesets
1030 checking changesets
1031 checking manifests
1031 checking manifests
1032 crosschecking files in changesets and manifests
1032 crosschecking files in changesets and manifests
1033 checking files
1033 checking files
1034 10 files, 8 changesets, 24 total revisions
1034 checked 8 changesets with 24 changes to 10 files
1035 searching 8 changesets for largefiles
1035 searching 8 changesets for largefiles
1036 verified contents of 13 revisions of 6 largefiles
1036 verified contents of 13 revisions of 6 largefiles
1037 $ hg -R a-clone1 sum
1037 $ hg -R a-clone1 sum
1038 parent: 1:ce8896473775
1038 parent: 1:ce8896473775
1039 edit files
1039 edit files
1040 branch: default
1040 branch: default
1041 commit: (clean)
1041 commit: (clean)
1042 update: 6 new changesets (update)
1042 update: 6 new changesets (update)
1043 phases: 8 draft
1043 phases: 8 draft
1044
1044
1045 $ rm "${USERCACHE}"/*
1045 $ rm "${USERCACHE}"/*
1046 $ hg clone --all-largefiles -U a a-clone-u
1046 $ hg clone --all-largefiles -U a a-clone-u
1047 11 additional largefiles cached
1047 11 additional largefiles cached
1048 $ hg -R a-clone-u sum
1048 $ hg -R a-clone-u sum
1049 parent: -1:000000000000 (no revision checked out)
1049 parent: -1:000000000000 (no revision checked out)
1050 branch: default
1050 branch: default
1051 commit: (clean)
1051 commit: (clean)
1052 update: 8 new changesets (update)
1052 update: 8 new changesets (update)
1053 phases: 8 draft
1053 phases: 8 draft
1054
1054
1055 Show computed destination directory:
1055 Show computed destination directory:
1056
1056
1057 $ mkdir xyz
1057 $ mkdir xyz
1058 $ cd xyz
1058 $ cd xyz
1059 $ hg clone ../a
1059 $ hg clone ../a
1060 destination directory: a
1060 destination directory: a
1061 updating to branch default
1061 updating to branch default
1062 getting changed largefiles
1062 getting changed largefiles
1063 3 largefiles updated, 0 removed
1063 3 largefiles updated, 0 removed
1064 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1064 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1065 $ cd ..
1065 $ cd ..
1066
1066
1067 Clone URL without path:
1067 Clone URL without path:
1068
1068
1069 $ hg clone file://
1069 $ hg clone file://
1070 abort: repository / not found!
1070 abort: repository / not found!
1071 [255]
1071 [255]
1072
1072
1073 Ensure base clone command argument validation
1073 Ensure base clone command argument validation
1074
1074
1075 $ hg clone -U -u 0 a a-clone-failure
1075 $ hg clone -U -u 0 a a-clone-failure
1076 abort: cannot specify both --noupdate and --updaterev
1076 abort: cannot specify both --noupdate and --updaterev
1077 [255]
1077 [255]
1078
1078
1079 $ hg clone --all-largefiles a ssh://localhost/a
1079 $ hg clone --all-largefiles a ssh://localhost/a
1080 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1080 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1081 [255]
1081 [255]
1082
1082
1083 Test pulling with --all-largefiles flag. Also test that the largefiles are
1083 Test pulling with --all-largefiles flag. Also test that the largefiles are
1084 downloaded from 'default' instead of 'default-push' when no source is specified
1084 downloaded from 'default' instead of 'default-push' when no source is specified
1085 (issue3584)
1085 (issue3584)
1086
1086
1087 $ rm -Rf a-backup
1087 $ rm -Rf a-backup
1088 $ hg clone -r 1 a a-backup
1088 $ hg clone -r 1 a a-backup
1089 adding changesets
1089 adding changesets
1090 adding manifests
1090 adding manifests
1091 adding file changes
1091 adding file changes
1092 added 2 changesets with 8 changes to 4 files
1092 added 2 changesets with 8 changes to 4 files
1093 new changesets 30d30fe6a5be:ce8896473775 (2 drafts)
1093 new changesets 30d30fe6a5be:ce8896473775 (2 drafts)
1094 updating to branch default
1094 updating to branch default
1095 getting changed largefiles
1095 getting changed largefiles
1096 2 largefiles updated, 0 removed
1096 2 largefiles updated, 0 removed
1097 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1097 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1098 $ rm "${USERCACHE}"/*
1098 $ rm "${USERCACHE}"/*
1099 $ cd a-backup
1099 $ cd a-backup
1100 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1100 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1101 pulling from $TESTTMP/a
1101 pulling from $TESTTMP/a
1102 searching for changes
1102 searching for changes
1103 adding changesets
1103 adding changesets
1104 adding manifests
1104 adding manifests
1105 adding file changes
1105 adding file changes
1106 added 6 changesets with 16 changes to 8 files
1106 added 6 changesets with 16 changes to 8 files
1107 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1107 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1108 (run 'hg update' to get a working copy)
1108 (run 'hg update' to get a working copy)
1109 6 largefiles cached
1109 6 largefiles cached
1110
1110
1111 redo pull with --lfrev and check it pulls largefiles for the right revs
1111 redo pull with --lfrev and check it pulls largefiles for the right revs
1112
1112
1113 $ hg rollback
1113 $ hg rollback
1114 repository tip rolled back to revision 1 (undo pull)
1114 repository tip rolled back to revision 1 (undo pull)
1115 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1115 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1116 pulling from $TESTTMP/a
1116 pulling from $TESTTMP/a
1117 searching for changes
1117 searching for changes
1118 all local heads known remotely
1118 all local heads known remotely
1119 6 changesets found
1119 6 changesets found
1120 uncompressed size of bundle content:
1120 uncompressed size of bundle content:
1121 1389 (changelog)
1121 1389 (changelog)
1122 1599 (manifests)
1122 1599 (manifests)
1123 254 .hglf/large1
1123 254 .hglf/large1
1124 564 .hglf/large3
1124 564 .hglf/large3
1125 572 .hglf/sub/large4
1125 572 .hglf/sub/large4
1126 182 .hglf/sub2/large6
1126 182 .hglf/sub2/large6
1127 182 .hglf/sub2/large7
1127 182 .hglf/sub2/large7
1128 212 normal1
1128 212 normal1
1129 457 normal3
1129 457 normal3
1130 465 sub/normal4
1130 465 sub/normal4
1131 adding changesets
1131 adding changesets
1132 adding manifests
1132 adding manifests
1133 adding file changes
1133 adding file changes
1134 added 6 changesets with 16 changes to 8 files
1134 added 6 changesets with 16 changes to 8 files
1135 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1135 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1136 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1136 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1137 (run 'hg update' to get a working copy)
1137 (run 'hg update' to get a working copy)
1138 pulling largefiles for revision 7
1138 pulling largefiles for revision 7
1139 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1139 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1140 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1140 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1141 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1141 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1142 pulling largefiles for revision 2
1142 pulling largefiles for revision 2
1143 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1143 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1144 0 largefiles cached
1144 0 largefiles cached
1145
1145
1146 lfpull
1146 lfpull
1147
1147
1148 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1148 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1149 2 largefiles cached
1149 2 largefiles cached
1150 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1150 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1151 pulling largefiles for revision 4
1151 pulling largefiles for revision 4
1152 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1152 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1153 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1153 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1154 pulling largefiles for revision 2
1154 pulling largefiles for revision 2
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1156 0 largefiles cached
1156 0 largefiles cached
1157
1157
1158 $ ls usercache-lfpull/* | sort
1158 $ ls usercache-lfpull/* | sort
1159 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1159 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1160 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1160 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1161
1161
1162 $ cd ..
1162 $ cd ..
1163
1163
1164 Rebasing between two repositories does not revert largefiles to old
1164 Rebasing between two repositories does not revert largefiles to old
1165 revisions (this was a very bad bug that took a lot of work to fix).
1165 revisions (this was a very bad bug that took a lot of work to fix).
1166
1166
1167 $ hg clone a d
1167 $ hg clone a d
1168 updating to branch default
1168 updating to branch default
1169 getting changed largefiles
1169 getting changed largefiles
1170 3 largefiles updated, 0 removed
1170 3 largefiles updated, 0 removed
1171 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1172 $ cd b
1172 $ cd b
1173 $ echo large4-modified > sub/large4
1173 $ echo large4-modified > sub/large4
1174 $ echo normal3-modified > normal3
1174 $ echo normal3-modified > normal3
1175 $ hg commit -m "modify normal file and largefile in repo b"
1175 $ hg commit -m "modify normal file and largefile in repo b"
1176 Invoking status precommit hook
1176 Invoking status precommit hook
1177 M normal3
1177 M normal3
1178 M sub/large4
1178 M sub/large4
1179 $ cd ../d
1179 $ cd ../d
1180 $ echo large6-modified > sub2/large6
1180 $ echo large6-modified > sub2/large6
1181 $ echo normal4-modified > sub/normal4
1181 $ echo normal4-modified > sub/normal4
1182 $ hg commit -m "modify normal file largefile in repo d"
1182 $ hg commit -m "modify normal file largefile in repo d"
1183 Invoking status precommit hook
1183 Invoking status precommit hook
1184 M sub/normal4
1184 M sub/normal4
1185 M sub2/large6
1185 M sub2/large6
1186 $ cd ..
1186 $ cd ..
1187 $ hg clone d e
1187 $ hg clone d e
1188 updating to branch default
1188 updating to branch default
1189 getting changed largefiles
1189 getting changed largefiles
1190 3 largefiles updated, 0 removed
1190 3 largefiles updated, 0 removed
1191 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1191 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1192 $ cd d
1192 $ cd d
1193
1193
1194 More rebase testing, but also test that the largefiles are downloaded from
1194 More rebase testing, but also test that the largefiles are downloaded from
1195 'default-push' when no source is specified (issue3584). (The largefile from the
1195 'default-push' when no source is specified (issue3584). (The largefile from the
1196 pulled revision is however not downloaded but found in the local cache.)
1196 pulled revision is however not downloaded but found in the local cache.)
1197 Largefiles are fetched for the new pulled revision, not for existing revisions,
1197 Largefiles are fetched for the new pulled revision, not for existing revisions,
1198 rebased or not.
1198 rebased or not.
1199
1199
1200 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1200 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1201 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1201 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1202 pulling from $TESTTMP/b
1202 pulling from $TESTTMP/b
1203 searching for changes
1203 searching for changes
1204 adding changesets
1204 adding changesets
1205 adding manifests
1205 adding manifests
1206 adding file changes
1206 adding file changes
1207 added 1 changesets with 2 changes to 2 files (+1 heads)
1207 added 1 changesets with 2 changes to 2 files (+1 heads)
1208 new changesets a381d2c8c80e (1 drafts)
1208 new changesets a381d2c8c80e (1 drafts)
1209 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1209 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1210 Invoking status precommit hook
1210 Invoking status precommit hook
1211 M sub/normal4
1211 M sub/normal4
1212 M sub2/large6
1212 M sub2/large6
1213 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1213 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1214 0 largefiles cached
1214 0 largefiles cached
1215 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1215 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1216 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1216 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1217 9:598410d3eb9a modify normal file largefile in repo d
1217 9:598410d3eb9a modify normal file largefile in repo d
1218 8:a381d2c8c80e modify normal file and largefile in repo b
1218 8:a381d2c8c80e modify normal file and largefile in repo b
1219 7:daea875e9014 add/edit more largefiles
1219 7:daea875e9014 add/edit more largefiles
1220 6:4355d653f84f edit files yet again
1220 6:4355d653f84f edit files yet again
1221 5:9d5af5072dbd edit files again
1221 5:9d5af5072dbd edit files again
1222 4:74c02385b94c move files
1222 4:74c02385b94c move files
1223 3:9e8fbc4bce62 copy files
1223 3:9e8fbc4bce62 copy files
1224 2:51a0ae4d5864 remove files
1224 2:51a0ae4d5864 remove files
1225 1:ce8896473775 edit files
1225 1:ce8896473775 edit files
1226 0:30d30fe6a5be add files
1226 0:30d30fe6a5be add files
1227 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1227 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1228 @ 9:598410d3eb9a modify normal file largefile in repo d
1228 @ 9:598410d3eb9a modify normal file largefile in repo d
1229 |
1229 |
1230 o 8:a381d2c8c80e modify normal file and largefile in repo b
1230 o 8:a381d2c8c80e modify normal file and largefile in repo b
1231 |
1231 |
1232 o 7:daea875e9014 add/edit more largefiles
1232 o 7:daea875e9014 add/edit more largefiles
1233 |
1233 |
1234 o 6:4355d653f84f edit files yet again
1234 o 6:4355d653f84f edit files yet again
1235 |
1235 |
1236 o 5:9d5af5072dbd edit files again
1236 o 5:9d5af5072dbd edit files again
1237 |
1237 |
1238 o 4:74c02385b94c move files
1238 o 4:74c02385b94c move files
1239 |
1239 |
1240 o 3:9e8fbc4bce62 copy files
1240 o 3:9e8fbc4bce62 copy files
1241 |
1241 |
1242 o 2:51a0ae4d5864 remove files
1242 o 2:51a0ae4d5864 remove files
1243 |
1243 |
1244 o 1:ce8896473775 edit files
1244 o 1:ce8896473775 edit files
1245 |
1245 |
1246 o 0:30d30fe6a5be add files
1246 o 0:30d30fe6a5be add files
1247
1247
1248 $ cat normal3
1248 $ cat normal3
1249 normal3-modified
1249 normal3-modified
1250 $ cat sub/normal4
1250 $ cat sub/normal4
1251 normal4-modified
1251 normal4-modified
1252 $ cat sub/large4
1252 $ cat sub/large4
1253 large4-modified
1253 large4-modified
1254 $ cat sub2/large6
1254 $ cat sub2/large6
1255 large6-modified
1255 large6-modified
1256 $ cat sub2/large7
1256 $ cat sub2/large7
1257 large7
1257 large7
1258 $ cd ../e
1258 $ cd ../e
1259 $ hg pull ../b
1259 $ hg pull ../b
1260 pulling from ../b
1260 pulling from ../b
1261 searching for changes
1261 searching for changes
1262 adding changesets
1262 adding changesets
1263 adding manifests
1263 adding manifests
1264 adding file changes
1264 adding file changes
1265 added 1 changesets with 2 changes to 2 files (+1 heads)
1265 added 1 changesets with 2 changes to 2 files (+1 heads)
1266 new changesets a381d2c8c80e (1 drafts)
1266 new changesets a381d2c8c80e (1 drafts)
1267 (run 'hg heads' to see heads, 'hg merge' to merge)
1267 (run 'hg heads' to see heads, 'hg merge' to merge)
1268 $ hg rebase
1268 $ hg rebase
1269 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1269 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1270 Invoking status precommit hook
1270 Invoking status precommit hook
1271 M sub/normal4
1271 M sub/normal4
1272 M sub2/large6
1272 M sub2/large6
1273 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1273 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1274 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1274 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1275 9:598410d3eb9a modify normal file largefile in repo d
1275 9:598410d3eb9a modify normal file largefile in repo d
1276 8:a381d2c8c80e modify normal file and largefile in repo b
1276 8:a381d2c8c80e modify normal file and largefile in repo b
1277 7:daea875e9014 add/edit more largefiles
1277 7:daea875e9014 add/edit more largefiles
1278 6:4355d653f84f edit files yet again
1278 6:4355d653f84f edit files yet again
1279 5:9d5af5072dbd edit files again
1279 5:9d5af5072dbd edit files again
1280 4:74c02385b94c move files
1280 4:74c02385b94c move files
1281 3:9e8fbc4bce62 copy files
1281 3:9e8fbc4bce62 copy files
1282 2:51a0ae4d5864 remove files
1282 2:51a0ae4d5864 remove files
1283 1:ce8896473775 edit files
1283 1:ce8896473775 edit files
1284 0:30d30fe6a5be add files
1284 0:30d30fe6a5be add files
1285 $ cat normal3
1285 $ cat normal3
1286 normal3-modified
1286 normal3-modified
1287 $ cat sub/normal4
1287 $ cat sub/normal4
1288 normal4-modified
1288 normal4-modified
1289 $ cat sub/large4
1289 $ cat sub/large4
1290 large4-modified
1290 large4-modified
1291 $ cat sub2/large6
1291 $ cat sub2/large6
1292 large6-modified
1292 large6-modified
1293 $ cat sub2/large7
1293 $ cat sub2/large7
1294 large7
1294 large7
1295
1295
1296 Log on largefiles
1296 Log on largefiles
1297
1297
1298 - same output
1298 - same output
1299 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1299 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1300 8:a381d2c8c80e modify normal file and largefile in repo b
1300 8:a381d2c8c80e modify normal file and largefile in repo b
1301 6:4355d653f84f edit files yet again
1301 6:4355d653f84f edit files yet again
1302 5:9d5af5072dbd edit files again
1302 5:9d5af5072dbd edit files again
1303 4:74c02385b94c move files
1303 4:74c02385b94c move files
1304 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1304 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1305 o 8:a381d2c8c80e modify normal file and largefile in repo b
1305 o 8:a381d2c8c80e modify normal file and largefile in repo b
1306 :
1306 :
1307 o 6:4355d653f84f edit files yet again
1307 o 6:4355d653f84f edit files yet again
1308 |
1308 |
1309 o 5:9d5af5072dbd edit files again
1309 o 5:9d5af5072dbd edit files again
1310 |
1310 |
1311 o 4:74c02385b94c move files
1311 o 4:74c02385b94c move files
1312 |
1312 |
1313 ~
1313 ~
1314 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1314 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1315 8:a381d2c8c80e modify normal file and largefile in repo b
1315 8:a381d2c8c80e modify normal file and largefile in repo b
1316 6:4355d653f84f edit files yet again
1316 6:4355d653f84f edit files yet again
1317 5:9d5af5072dbd edit files again
1317 5:9d5af5072dbd edit files again
1318 4:74c02385b94c move files
1318 4:74c02385b94c move files
1319 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1319 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1320 o 8:a381d2c8c80e modify normal file and largefile in repo b
1320 o 8:a381d2c8c80e modify normal file and largefile in repo b
1321 :
1321 :
1322 o 6:4355d653f84f edit files yet again
1322 o 6:4355d653f84f edit files yet again
1323 |
1323 |
1324 o 5:9d5af5072dbd edit files again
1324 o 5:9d5af5072dbd edit files again
1325 |
1325 |
1326 o 4:74c02385b94c move files
1326 o 4:74c02385b94c move files
1327 |
1327 |
1328 ~
1328 ~
1329
1329
1330 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1330 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1331 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1331 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1332 8:a381d2c8c80e modify normal file and largefile in repo b
1332 8:a381d2c8c80e modify normal file and largefile in repo b
1333 6:4355d653f84f edit files yet again
1333 6:4355d653f84f edit files yet again
1334 5:9d5af5072dbd edit files again
1334 5:9d5af5072dbd edit files again
1335 4:74c02385b94c move files
1335 4:74c02385b94c move files
1336 1:ce8896473775 edit files
1336 1:ce8896473775 edit files
1337 0:30d30fe6a5be add files
1337 0:30d30fe6a5be add files
1338 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1338 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1339 o 8:a381d2c8c80e modify normal file and largefile in repo b
1339 o 8:a381d2c8c80e modify normal file and largefile in repo b
1340 :
1340 :
1341 o 6:4355d653f84f edit files yet again
1341 o 6:4355d653f84f edit files yet again
1342 |
1342 |
1343 o 5:9d5af5072dbd edit files again
1343 o 5:9d5af5072dbd edit files again
1344 |
1344 |
1345 o 4:74c02385b94c move files
1345 o 4:74c02385b94c move files
1346 :
1346 :
1347 o 1:ce8896473775 edit files
1347 o 1:ce8896473775 edit files
1348 |
1348 |
1349 o 0:30d30fe6a5be add files
1349 o 0:30d30fe6a5be add files
1350
1350
1351 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1351 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1352 9:598410d3eb9a modify normal file largefile in repo d
1352 9:598410d3eb9a modify normal file largefile in repo d
1353 8:a381d2c8c80e modify normal file and largefile in repo b
1353 8:a381d2c8c80e modify normal file and largefile in repo b
1354 6:4355d653f84f edit files yet again
1354 6:4355d653f84f edit files yet again
1355 5:9d5af5072dbd edit files again
1355 5:9d5af5072dbd edit files again
1356 4:74c02385b94c move files
1356 4:74c02385b94c move files
1357 1:ce8896473775 edit files
1357 1:ce8896473775 edit files
1358 0:30d30fe6a5be add files
1358 0:30d30fe6a5be add files
1359 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1359 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1360 @ 9:598410d3eb9a modify normal file largefile in repo d
1360 @ 9:598410d3eb9a modify normal file largefile in repo d
1361 |
1361 |
1362 o 8:a381d2c8c80e modify normal file and largefile in repo b
1362 o 8:a381d2c8c80e modify normal file and largefile in repo b
1363 :
1363 :
1364 o 6:4355d653f84f edit files yet again
1364 o 6:4355d653f84f edit files yet again
1365 |
1365 |
1366 o 5:9d5af5072dbd edit files again
1366 o 5:9d5af5072dbd edit files again
1367 |
1367 |
1368 o 4:74c02385b94c move files
1368 o 4:74c02385b94c move files
1369 :
1369 :
1370 o 1:ce8896473775 edit files
1370 o 1:ce8896473775 edit files
1371 |
1371 |
1372 o 0:30d30fe6a5be add files
1372 o 0:30d30fe6a5be add files
1373
1373
1374 - globbing gives same result
1374 - globbing gives same result
1375 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1375 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1376 9:598410d3eb9a modify normal file largefile in repo d
1376 9:598410d3eb9a modify normal file largefile in repo d
1377 8:a381d2c8c80e modify normal file and largefile in repo b
1377 8:a381d2c8c80e modify normal file and largefile in repo b
1378 6:4355d653f84f edit files yet again
1378 6:4355d653f84f edit files yet again
1379 5:9d5af5072dbd edit files again
1379 5:9d5af5072dbd edit files again
1380 4:74c02385b94c move files
1380 4:74c02385b94c move files
1381 1:ce8896473775 edit files
1381 1:ce8896473775 edit files
1382 0:30d30fe6a5be add files
1382 0:30d30fe6a5be add files
1383 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1383 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1384 @ 9:598410d3eb9a modify normal file largefile in repo d
1384 @ 9:598410d3eb9a modify normal file largefile in repo d
1385 |
1385 |
1386 o 8:a381d2c8c80e modify normal file and largefile in repo b
1386 o 8:a381d2c8c80e modify normal file and largefile in repo b
1387 :
1387 :
1388 o 6:4355d653f84f edit files yet again
1388 o 6:4355d653f84f edit files yet again
1389 |
1389 |
1390 o 5:9d5af5072dbd edit files again
1390 o 5:9d5af5072dbd edit files again
1391 |
1391 |
1392 o 4:74c02385b94c move files
1392 o 4:74c02385b94c move files
1393 :
1393 :
1394 o 1:ce8896473775 edit files
1394 o 1:ce8896473775 edit files
1395 |
1395 |
1396 o 0:30d30fe6a5be add files
1396 o 0:30d30fe6a5be add files
1397
1397
1398 Rollback on largefiles.
1398 Rollback on largefiles.
1399
1399
1400 $ echo large4-modified-again > sub/large4
1400 $ echo large4-modified-again > sub/large4
1401 $ hg commit -m "Modify large4 again"
1401 $ hg commit -m "Modify large4 again"
1402 Invoking status precommit hook
1402 Invoking status precommit hook
1403 M sub/large4
1403 M sub/large4
1404 $ hg rollback
1404 $ hg rollback
1405 repository tip rolled back to revision 9 (undo commit)
1405 repository tip rolled back to revision 9 (undo commit)
1406 working directory now based on revision 9
1406 working directory now based on revision 9
1407 $ hg st
1407 $ hg st
1408 M sub/large4
1408 M sub/large4
1409 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1409 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1410 9:598410d3eb9a modify normal file largefile in repo d
1410 9:598410d3eb9a modify normal file largefile in repo d
1411 8:a381d2c8c80e modify normal file and largefile in repo b
1411 8:a381d2c8c80e modify normal file and largefile in repo b
1412 7:daea875e9014 add/edit more largefiles
1412 7:daea875e9014 add/edit more largefiles
1413 6:4355d653f84f edit files yet again
1413 6:4355d653f84f edit files yet again
1414 5:9d5af5072dbd edit files again
1414 5:9d5af5072dbd edit files again
1415 4:74c02385b94c move files
1415 4:74c02385b94c move files
1416 3:9e8fbc4bce62 copy files
1416 3:9e8fbc4bce62 copy files
1417 2:51a0ae4d5864 remove files
1417 2:51a0ae4d5864 remove files
1418 1:ce8896473775 edit files
1418 1:ce8896473775 edit files
1419 0:30d30fe6a5be add files
1419 0:30d30fe6a5be add files
1420 $ cat sub/large4
1420 $ cat sub/large4
1421 large4-modified-again
1421 large4-modified-again
1422
1422
1423 "update --check" refuses to update with uncommitted changes.
1423 "update --check" refuses to update with uncommitted changes.
1424 $ hg update --check 8
1424 $ hg update --check 8
1425 abort: uncommitted changes
1425 abort: uncommitted changes
1426 [255]
1426 [255]
1427
1427
1428 "update --clean" leaves correct largefiles in working copy, even when there is
1428 "update --clean" leaves correct largefiles in working copy, even when there is
1429 .orig files from revert in .hglf.
1429 .orig files from revert in .hglf.
1430
1430
1431 $ echo mistake > sub2/large7
1431 $ echo mistake > sub2/large7
1432 $ hg revert sub2/large7
1432 $ hg revert sub2/large7
1433 $ cat sub2/large7
1433 $ cat sub2/large7
1434 large7
1434 large7
1435 $ cat sub2/large7.orig
1435 $ cat sub2/large7.orig
1436 mistake
1436 mistake
1437 $ test ! -f .hglf/sub2/large7.orig
1437 $ test ! -f .hglf/sub2/large7.orig
1438
1438
1439 $ hg -q update --clean -r null
1439 $ hg -q update --clean -r null
1440 $ hg update --clean
1440 $ hg update --clean
1441 getting changed largefiles
1441 getting changed largefiles
1442 3 largefiles updated, 0 removed
1442 3 largefiles updated, 0 removed
1443 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1443 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1444 $ cat normal3
1444 $ cat normal3
1445 normal3-modified
1445 normal3-modified
1446 $ cat sub/normal4
1446 $ cat sub/normal4
1447 normal4-modified
1447 normal4-modified
1448 $ cat sub/large4
1448 $ cat sub/large4
1449 large4-modified
1449 large4-modified
1450 $ cat sub2/large6
1450 $ cat sub2/large6
1451 large6-modified
1451 large6-modified
1452 $ cat sub2/large7
1452 $ cat sub2/large7
1453 large7
1453 large7
1454 $ cat sub2/large7.orig
1454 $ cat sub2/large7.orig
1455 mistake
1455 mistake
1456 $ test ! -f .hglf/sub2/large7.orig
1456 $ test ! -f .hglf/sub2/large7.orig
1457
1457
1458 verify that largefile .orig file no longer is overwritten on every update -C:
1458 verify that largefile .orig file no longer is overwritten on every update -C:
1459 $ hg update --clean
1459 $ hg update --clean
1460 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1460 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1461 $ cat sub2/large7.orig
1461 $ cat sub2/large7.orig
1462 mistake
1462 mistake
1463 $ rm sub2/large7.orig
1463 $ rm sub2/large7.orig
1464
1464
1465 Now "update check" is happy.
1465 Now "update check" is happy.
1466 $ hg update --check 8
1466 $ hg update --check 8
1467 getting changed largefiles
1467 getting changed largefiles
1468 1 largefiles updated, 0 removed
1468 1 largefiles updated, 0 removed
1469 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1469 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1470 $ hg update --check
1470 $ hg update --check
1471 getting changed largefiles
1471 getting changed largefiles
1472 1 largefiles updated, 0 removed
1472 1 largefiles updated, 0 removed
1473 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1473 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1474
1474
1475 Test removing empty largefiles directories on update
1475 Test removing empty largefiles directories on update
1476 $ test -d sub2 && echo "sub2 exists"
1476 $ test -d sub2 && echo "sub2 exists"
1477 sub2 exists
1477 sub2 exists
1478 $ hg update -q null
1478 $ hg update -q null
1479 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1479 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1480 [1]
1480 [1]
1481 $ hg update -q
1481 $ hg update -q
1482
1482
1483 Test hg remove removes empty largefiles directories
1483 Test hg remove removes empty largefiles directories
1484 $ test -d sub2 && echo "sub2 exists"
1484 $ test -d sub2 && echo "sub2 exists"
1485 sub2 exists
1485 sub2 exists
1486 $ hg remove sub2/*
1486 $ hg remove sub2/*
1487 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1487 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1488 [1]
1488 [1]
1489 $ hg revert sub2/large6 sub2/large7
1489 $ hg revert sub2/large6 sub2/large7
1490
1490
1491 "revert" works on largefiles (and normal files too).
1491 "revert" works on largefiles (and normal files too).
1492 $ echo hack3 >> normal3
1492 $ echo hack3 >> normal3
1493 $ echo hack4 >> sub/normal4
1493 $ echo hack4 >> sub/normal4
1494 $ echo hack4 >> sub/large4
1494 $ echo hack4 >> sub/large4
1495 $ rm sub2/large6
1495 $ rm sub2/large6
1496 $ hg revert sub2/large6
1496 $ hg revert sub2/large6
1497 $ hg rm sub2/large6
1497 $ hg rm sub2/large6
1498 $ echo new >> sub2/large8
1498 $ echo new >> sub2/large8
1499 $ hg add --large sub2/large8
1499 $ hg add --large sub2/large8
1500 # XXX we don't really want to report that we're reverting the standin;
1500 # XXX we don't really want to report that we're reverting the standin;
1501 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1501 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1502 $ hg revert sub
1502 $ hg revert sub
1503 reverting .hglf/sub/large4
1503 reverting .hglf/sub/large4
1504 reverting sub/normal4
1504 reverting sub/normal4
1505 $ hg status
1505 $ hg status
1506 M normal3
1506 M normal3
1507 A sub2/large8
1507 A sub2/large8
1508 R sub2/large6
1508 R sub2/large6
1509 ? sub/large4.orig
1509 ? sub/large4.orig
1510 ? sub/normal4.orig
1510 ? sub/normal4.orig
1511 $ cat sub/normal4
1511 $ cat sub/normal4
1512 normal4-modified
1512 normal4-modified
1513 $ cat sub/large4
1513 $ cat sub/large4
1514 large4-modified
1514 large4-modified
1515 $ hg revert -a --no-backup
1515 $ hg revert -a --no-backup
1516 forgetting .hglf/sub2/large8
1516 forgetting .hglf/sub2/large8
1517 reverting normal3
1517 reverting normal3
1518 undeleting .hglf/sub2/large6
1518 undeleting .hglf/sub2/large6
1519 $ hg status
1519 $ hg status
1520 ? sub/large4.orig
1520 ? sub/large4.orig
1521 ? sub/normal4.orig
1521 ? sub/normal4.orig
1522 ? sub2/large8
1522 ? sub2/large8
1523 $ cat normal3
1523 $ cat normal3
1524 normal3-modified
1524 normal3-modified
1525 $ cat sub2/large6
1525 $ cat sub2/large6
1526 large6-modified
1526 large6-modified
1527 $ rm sub/*.orig sub2/large8
1527 $ rm sub/*.orig sub2/large8
1528
1528
1529 revert some files to an older revision
1529 revert some files to an older revision
1530 $ hg revert --no-backup -r 8 sub2
1530 $ hg revert --no-backup -r 8 sub2
1531 reverting .hglf/sub2/large6
1531 reverting .hglf/sub2/large6
1532 $ cat sub2/large6
1532 $ cat sub2/large6
1533 large6
1533 large6
1534 $ hg revert --no-backup -C -r '.^' sub2
1534 $ hg revert --no-backup -C -r '.^' sub2
1535 $ hg revert --no-backup sub2
1535 $ hg revert --no-backup sub2
1536 reverting .hglf/sub2/large6
1536 reverting .hglf/sub2/large6
1537 $ hg status
1537 $ hg status
1538
1538
1539 "verify --large" actually verifies largefiles
1539 "verify --large" actually verifies largefiles
1540
1540
1541 - Where Do We Come From? What Are We? Where Are We Going?
1541 - Where Do We Come From? What Are We? Where Are We Going?
1542 $ pwd
1542 $ pwd
1543 $TESTTMP/e
1543 $TESTTMP/e
1544 $ hg paths
1544 $ hg paths
1545 default = $TESTTMP/d
1545 default = $TESTTMP/d
1546
1546
1547 $ hg verify --large
1547 $ hg verify --large
1548 checking changesets
1548 checking changesets
1549 checking manifests
1549 checking manifests
1550 crosschecking files in changesets and manifests
1550 crosschecking files in changesets and manifests
1551 checking files
1551 checking files
1552 10 files, 10 changesets, 28 total revisions
1552 checked 10 changesets with 28 changes to 10 files
1553 searching 1 changesets for largefiles
1553 searching 1 changesets for largefiles
1554 verified existence of 3 revisions of 3 largefiles
1554 verified existence of 3 revisions of 3 largefiles
1555
1555
1556 - introduce missing blob in local store repo and remote store
1556 - introduce missing blob in local store repo and remote store
1557 and make sure that this is caught:
1557 and make sure that this is caught:
1558
1558
1559 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1559 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1560 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1560 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1561 $ hg verify --large
1561 $ hg verify --large
1562 checking changesets
1562 checking changesets
1563 checking manifests
1563 checking manifests
1564 crosschecking files in changesets and manifests
1564 crosschecking files in changesets and manifests
1565 checking files
1565 checking files
1566 10 files, 10 changesets, 28 total revisions
1566 checked 10 changesets with 28 changes to 10 files
1567 searching 1 changesets for largefiles
1567 searching 1 changesets for largefiles
1568 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1568 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1569 verified existence of 3 revisions of 3 largefiles
1569 verified existence of 3 revisions of 3 largefiles
1570 [1]
1570 [1]
1571
1571
1572 - introduce corruption and make sure that it is caught when checking content:
1572 - introduce corruption and make sure that it is caught when checking content:
1573 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1573 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1574 $ hg verify -q --large --lfc
1574 $ hg verify -q --large --lfc
1575 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1575 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1576 [1]
1576 [1]
1577
1577
1578 - cleanup
1578 - cleanup
1579 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1579 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1580 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1580 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1581
1581
1582 - verifying all revisions will fail because we didn't clone all largefiles to d:
1582 - verifying all revisions will fail because we didn't clone all largefiles to d:
1583 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1583 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1584 $ hg verify -q --lfa --lfc
1584 $ hg verify -q --lfa --lfc
1585 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64
1585 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64
1586 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d
1586 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d
1587 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f
1587 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f
1588 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1588 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1589 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1589 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1590 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1590 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1591 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1591 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1592 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c
1592 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c
1593 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9
1593 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9
1594 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0
1594 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0
1595 [1]
1595 [1]
1596
1596
1597 - cleanup
1597 - cleanup
1598 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1598 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1599 $ rm -f .hglf/sub/*.orig
1599 $ rm -f .hglf/sub/*.orig
1600
1600
1601 Update to revision with missing largefile - and make sure it really is missing
1601 Update to revision with missing largefile - and make sure it really is missing
1602
1602
1603 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1603 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1604 $ hg up -r 6
1604 $ hg up -r 6
1605 getting changed largefiles
1605 getting changed largefiles
1606 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1606 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1607 1 largefiles updated, 2 removed
1607 1 largefiles updated, 2 removed
1608 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1608 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1609 $ rm normal3
1609 $ rm normal3
1610 $ echo >> sub/normal4
1610 $ echo >> sub/normal4
1611 $ hg ci -m 'commit with missing files'
1611 $ hg ci -m 'commit with missing files'
1612 Invoking status precommit hook
1612 Invoking status precommit hook
1613 M sub/normal4
1613 M sub/normal4
1614 ! large3
1614 ! large3
1615 ! normal3
1615 ! normal3
1616 created new head
1616 created new head
1617 $ hg st
1617 $ hg st
1618 ! large3
1618 ! large3
1619 ! normal3
1619 ! normal3
1620 $ hg up -r.
1620 $ hg up -r.
1621 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1621 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1622 $ hg st
1622 $ hg st
1623 ! large3
1623 ! large3
1624 ! normal3
1624 ! normal3
1625 $ hg up -Cr.
1625 $ hg up -Cr.
1626 getting changed largefiles
1626 getting changed largefiles
1627 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1627 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1628 0 largefiles updated, 0 removed
1628 0 largefiles updated, 0 removed
1629 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1629 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1630 $ hg st
1630 $ hg st
1631 ! large3
1631 ! large3
1632 $ hg rollback
1632 $ hg rollback
1633 repository tip rolled back to revision 9 (undo commit)
1633 repository tip rolled back to revision 9 (undo commit)
1634 working directory now based on revision 6
1634 working directory now based on revision 6
1635
1635
1636 Merge with revision with missing largefile - and make sure it tries to fetch it.
1636 Merge with revision with missing largefile - and make sure it tries to fetch it.
1637
1637
1638 $ hg up -Cqr null
1638 $ hg up -Cqr null
1639 $ echo f > f
1639 $ echo f > f
1640 $ hg ci -Am branch
1640 $ hg ci -Am branch
1641 adding f
1641 adding f
1642 Invoking status precommit hook
1642 Invoking status precommit hook
1643 A f
1643 A f
1644 created new head
1644 created new head
1645 $ hg merge -r 6
1645 $ hg merge -r 6
1646 getting changed largefiles
1646 getting changed largefiles
1647 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1647 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1648 1 largefiles updated, 0 removed
1648 1 largefiles updated, 0 removed
1649 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1649 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1650 (branch merge, don't forget to commit)
1650 (branch merge, don't forget to commit)
1651
1651
1652 $ hg rollback -q
1652 $ hg rollback -q
1653 $ hg up -Cq
1653 $ hg up -Cq
1654
1654
1655 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1655 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1656
1656
1657 $ hg pull --all-largefiles
1657 $ hg pull --all-largefiles
1658 pulling from $TESTTMP/d
1658 pulling from $TESTTMP/d
1659 searching for changes
1659 searching for changes
1660 no changes found
1660 no changes found
1661
1661
1662 Merging does not revert to old versions of largefiles and also check
1662 Merging does not revert to old versions of largefiles and also check
1663 that merging after having pulled from a non-default remote works
1663 that merging after having pulled from a non-default remote works
1664 correctly.
1664 correctly.
1665
1665
1666 $ cd ..
1666 $ cd ..
1667 $ hg clone -r 7 e temp
1667 $ hg clone -r 7 e temp
1668 adding changesets
1668 adding changesets
1669 adding manifests
1669 adding manifests
1670 adding file changes
1670 adding file changes
1671 added 8 changesets with 24 changes to 10 files
1671 added 8 changesets with 24 changes to 10 files
1672 new changesets 30d30fe6a5be:daea875e9014 (8 drafts)
1672 new changesets 30d30fe6a5be:daea875e9014 (8 drafts)
1673 updating to branch default
1673 updating to branch default
1674 getting changed largefiles
1674 getting changed largefiles
1675 3 largefiles updated, 0 removed
1675 3 largefiles updated, 0 removed
1676 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1676 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1677 $ hg clone temp f
1677 $ hg clone temp f
1678 updating to branch default
1678 updating to branch default
1679 getting changed largefiles
1679 getting changed largefiles
1680 3 largefiles updated, 0 removed
1680 3 largefiles updated, 0 removed
1681 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1681 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1682 # Delete the largefiles in the largefiles system cache so that we have an
1682 # Delete the largefiles in the largefiles system cache so that we have an
1683 # opportunity to test that caching after a pull works.
1683 # opportunity to test that caching after a pull works.
1684 $ rm "${USERCACHE}"/*
1684 $ rm "${USERCACHE}"/*
1685 $ cd f
1685 $ cd f
1686 $ echo "large4-merge-test" > sub/large4
1686 $ echo "large4-merge-test" > sub/large4
1687 $ hg commit -m "Modify large4 to test merge"
1687 $ hg commit -m "Modify large4 to test merge"
1688 Invoking status precommit hook
1688 Invoking status precommit hook
1689 M sub/large4
1689 M sub/large4
1690 # Test --cache-largefiles flag
1690 # Test --cache-largefiles flag
1691 $ hg pull --lfrev 'heads(pulled())' ../e
1691 $ hg pull --lfrev 'heads(pulled())' ../e
1692 pulling from ../e
1692 pulling from ../e
1693 searching for changes
1693 searching for changes
1694 adding changesets
1694 adding changesets
1695 adding manifests
1695 adding manifests
1696 adding file changes
1696 adding file changes
1697 added 2 changesets with 4 changes to 4 files (+1 heads)
1697 added 2 changesets with 4 changes to 4 files (+1 heads)
1698 new changesets a381d2c8c80e:598410d3eb9a (2 drafts)
1698 new changesets a381d2c8c80e:598410d3eb9a (2 drafts)
1699 (run 'hg heads' to see heads, 'hg merge' to merge)
1699 (run 'hg heads' to see heads, 'hg merge' to merge)
1700 2 largefiles cached
1700 2 largefiles cached
1701 $ hg merge
1701 $ hg merge
1702 largefile sub/large4 has a merge conflict
1702 largefile sub/large4 has a merge conflict
1703 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1703 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1704 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1704 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1705 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1705 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1706 getting changed largefiles
1706 getting changed largefiles
1707 1 largefiles updated, 0 removed
1707 1 largefiles updated, 0 removed
1708 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1708 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1709 (branch merge, don't forget to commit)
1709 (branch merge, don't forget to commit)
1710 $ hg commit -m "Merge repos e and f"
1710 $ hg commit -m "Merge repos e and f"
1711 Invoking status precommit hook
1711 Invoking status precommit hook
1712 M normal3
1712 M normal3
1713 M sub/normal4
1713 M sub/normal4
1714 M sub2/large6
1714 M sub2/large6
1715 $ cat normal3
1715 $ cat normal3
1716 normal3-modified
1716 normal3-modified
1717 $ cat sub/normal4
1717 $ cat sub/normal4
1718 normal4-modified
1718 normal4-modified
1719 $ cat sub/large4
1719 $ cat sub/large4
1720 large4-merge-test
1720 large4-merge-test
1721 $ cat sub2/large6
1721 $ cat sub2/large6
1722 large6-modified
1722 large6-modified
1723 $ cat sub2/large7
1723 $ cat sub2/large7
1724 large7
1724 large7
1725
1725
1726 Test status after merging with a branch that introduces a new largefile:
1726 Test status after merging with a branch that introduces a new largefile:
1727
1727
1728 $ echo large > large
1728 $ echo large > large
1729 $ hg add --large large
1729 $ hg add --large large
1730 $ hg commit -m 'add largefile'
1730 $ hg commit -m 'add largefile'
1731 Invoking status precommit hook
1731 Invoking status precommit hook
1732 A large
1732 A large
1733 $ hg update -q ".^"
1733 $ hg update -q ".^"
1734 $ echo change >> normal3
1734 $ echo change >> normal3
1735 $ hg commit -m 'some change'
1735 $ hg commit -m 'some change'
1736 Invoking status precommit hook
1736 Invoking status precommit hook
1737 M normal3
1737 M normal3
1738 created new head
1738 created new head
1739 $ hg merge
1739 $ hg merge
1740 getting changed largefiles
1740 getting changed largefiles
1741 1 largefiles updated, 0 removed
1741 1 largefiles updated, 0 removed
1742 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1742 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1743 (branch merge, don't forget to commit)
1743 (branch merge, don't forget to commit)
1744 $ hg status
1744 $ hg status
1745 M large
1745 M large
1746
1746
1747 - make sure update of merge with removed largefiles fails as expected
1747 - make sure update of merge with removed largefiles fails as expected
1748 $ hg rm sub2/large6
1748 $ hg rm sub2/large6
1749 $ hg up -r.
1749 $ hg up -r.
1750 abort: outstanding uncommitted merge
1750 abort: outstanding uncommitted merge
1751 [255]
1751 [255]
1752
1752
1753 - revert should be able to revert files introduced in a pending merge
1753 - revert should be able to revert files introduced in a pending merge
1754 $ hg revert --all -r .
1754 $ hg revert --all -r .
1755 removing .hglf/large
1755 removing .hglf/large
1756 undeleting .hglf/sub2/large6
1756 undeleting .hglf/sub2/large6
1757
1757
1758 Test that a normal file and a largefile with the same name and path cannot
1758 Test that a normal file and a largefile with the same name and path cannot
1759 coexist.
1759 coexist.
1760
1760
1761 $ rm sub2/large7
1761 $ rm sub2/large7
1762 $ echo "largeasnormal" > sub2/large7
1762 $ echo "largeasnormal" > sub2/large7
1763 $ hg add sub2/large7
1763 $ hg add sub2/large7
1764 sub2/large7 already a largefile
1764 sub2/large7 already a largefile
1765
1765
1766 Test that transplanting a largefile change works correctly.
1766 Test that transplanting a largefile change works correctly.
1767
1767
1768 $ cd ..
1768 $ cd ..
1769 $ hg clone -r 8 d g
1769 $ hg clone -r 8 d g
1770 adding changesets
1770 adding changesets
1771 adding manifests
1771 adding manifests
1772 adding file changes
1772 adding file changes
1773 added 9 changesets with 26 changes to 10 files
1773 added 9 changesets with 26 changes to 10 files
1774 new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts)
1774 new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts)
1775 updating to branch default
1775 updating to branch default
1776 getting changed largefiles
1776 getting changed largefiles
1777 3 largefiles updated, 0 removed
1777 3 largefiles updated, 0 removed
1778 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1778 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1779 $ cd g
1779 $ cd g
1780 $ hg transplant -s ../d 598410d3eb9a
1780 $ hg transplant -s ../d 598410d3eb9a
1781 searching for changes
1781 searching for changes
1782 searching for changes
1782 searching for changes
1783 adding changesets
1783 adding changesets
1784 adding manifests
1784 adding manifests
1785 adding file changes
1785 adding file changes
1786 added 1 changesets with 2 changes to 2 files
1786 added 1 changesets with 2 changes to 2 files
1787 new changesets 598410d3eb9a (1 drafts)
1787 new changesets 598410d3eb9a (1 drafts)
1788 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1788 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1789 9:598410d3eb9a modify normal file largefile in repo d
1789 9:598410d3eb9a modify normal file largefile in repo d
1790 8:a381d2c8c80e modify normal file and largefile in repo b
1790 8:a381d2c8c80e modify normal file and largefile in repo b
1791 7:daea875e9014 add/edit more largefiles
1791 7:daea875e9014 add/edit more largefiles
1792 6:4355d653f84f edit files yet again
1792 6:4355d653f84f edit files yet again
1793 5:9d5af5072dbd edit files again
1793 5:9d5af5072dbd edit files again
1794 4:74c02385b94c move files
1794 4:74c02385b94c move files
1795 3:9e8fbc4bce62 copy files
1795 3:9e8fbc4bce62 copy files
1796 2:51a0ae4d5864 remove files
1796 2:51a0ae4d5864 remove files
1797 1:ce8896473775 edit files
1797 1:ce8896473775 edit files
1798 0:30d30fe6a5be add files
1798 0:30d30fe6a5be add files
1799 $ cat normal3
1799 $ cat normal3
1800 normal3-modified
1800 normal3-modified
1801 $ cat sub/normal4
1801 $ cat sub/normal4
1802 normal4-modified
1802 normal4-modified
1803 $ cat sub/large4
1803 $ cat sub/large4
1804 large4-modified
1804 large4-modified
1805 $ cat sub2/large6
1805 $ cat sub2/large6
1806 large6-modified
1806 large6-modified
1807 $ cat sub2/large7
1807 $ cat sub2/large7
1808 large7
1808 large7
1809
1809
1810 Cat a largefile
1810 Cat a largefile
1811 $ hg cat normal3
1811 $ hg cat normal3
1812 normal3-modified
1812 normal3-modified
1813 $ hg cat sub/large4
1813 $ hg cat sub/large4
1814 large4-modified
1814 large4-modified
1815 $ rm "${USERCACHE}"/*
1815 $ rm "${USERCACHE}"/*
1816 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1816 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1817 $ cat cat.out
1817 $ cat cat.out
1818 large4-modified
1818 large4-modified
1819 $ rm cat.out
1819 $ rm cat.out
1820 $ hg cat -r a381d2c8c80e normal3
1820 $ hg cat -r a381d2c8c80e normal3
1821 normal3-modified
1821 normal3-modified
1822 $ hg cat -r '.^' normal3
1822 $ hg cat -r '.^' normal3
1823 normal3-modified
1823 normal3-modified
1824 $ hg cat -r '.^' sub/large4 doesntexist
1824 $ hg cat -r '.^' sub/large4 doesntexist
1825 large4-modified
1825 large4-modified
1826 doesntexist: no such file in rev a381d2c8c80e
1826 doesntexist: no such file in rev a381d2c8c80e
1827 $ hg --cwd sub cat -r '.^' large4
1827 $ hg --cwd sub cat -r '.^' large4
1828 large4-modified
1828 large4-modified
1829 $ hg --cwd sub cat -r '.^' ../normal3
1829 $ hg --cwd sub cat -r '.^' ../normal3
1830 normal3-modified
1830 normal3-modified
1831 Cat a standin
1831 Cat a standin
1832 $ hg cat .hglf/sub/large4
1832 $ hg cat .hglf/sub/large4
1833 e166e74c7303192238d60af5a9c4ce9bef0b7928
1833 e166e74c7303192238d60af5a9c4ce9bef0b7928
1834 $ hg cat .hglf/normal3
1834 $ hg cat .hglf/normal3
1835 .hglf/normal3: no such file in rev 598410d3eb9a
1835 .hglf/normal3: no such file in rev 598410d3eb9a
1836 [1]
1836 [1]
1837
1837
1838 Test that renaming a largefile results in correct output for status
1838 Test that renaming a largefile results in correct output for status
1839
1839
1840 $ hg rename sub/large4 large4-renamed
1840 $ hg rename sub/large4 large4-renamed
1841 $ hg commit -m "test rename output"
1841 $ hg commit -m "test rename output"
1842 Invoking status precommit hook
1842 Invoking status precommit hook
1843 A large4-renamed
1843 A large4-renamed
1844 R sub/large4
1844 R sub/large4
1845 $ cat large4-renamed
1845 $ cat large4-renamed
1846 large4-modified
1846 large4-modified
1847 $ cd sub2
1847 $ cd sub2
1848 $ hg rename large6 large6-renamed
1848 $ hg rename large6 large6-renamed
1849 $ hg st
1849 $ hg st
1850 A sub2/large6-renamed
1850 A sub2/large6-renamed
1851 R sub2/large6
1851 R sub2/large6
1852 $ cd ..
1852 $ cd ..
1853
1853
1854 Test --normal flag
1854 Test --normal flag
1855
1855
1856 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1856 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1857 $ hg add --normal --large new-largefile
1857 $ hg add --normal --large new-largefile
1858 abort: --normal cannot be used with --large
1858 abort: --normal cannot be used with --large
1859 [255]
1859 [255]
1860 $ hg add --normal new-largefile
1860 $ hg add --normal new-largefile
1861 new-largefile: up to 69 MB of RAM may be required to manage this file
1861 new-largefile: up to 69 MB of RAM may be required to manage this file
1862 (use 'hg revert new-largefile' to cancel the pending addition)
1862 (use 'hg revert new-largefile' to cancel the pending addition)
1863 $ hg revert new-largefile
1863 $ hg revert new-largefile
1864 $ hg --config ui.large-file-limit=22M add --normal new-largefile
1864 $ hg --config ui.large-file-limit=22M add --normal new-largefile
1865
1865
1866 Test explicit commit of switch between normal and largefile - make sure both
1866 Test explicit commit of switch between normal and largefile - make sure both
1867 the add and the remove is committed.
1867 the add and the remove is committed.
1868
1868
1869 $ hg up -qC
1869 $ hg up -qC
1870 $ hg forget normal3 large4-renamed
1870 $ hg forget normal3 large4-renamed
1871 $ hg add --large normal3
1871 $ hg add --large normal3
1872 $ hg add large4-renamed
1872 $ hg add large4-renamed
1873 $ hg commit -m 'swap' normal3 large4-renamed
1873 $ hg commit -m 'swap' normal3 large4-renamed
1874 Invoking status precommit hook
1874 Invoking status precommit hook
1875 A large4-renamed
1875 A large4-renamed
1876 A normal3
1876 A normal3
1877 ? new-largefile
1877 ? new-largefile
1878 ? sub2/large6-renamed
1878 ? sub2/large6-renamed
1879 $ hg mani
1879 $ hg mani
1880 .hglf/normal3
1880 .hglf/normal3
1881 .hglf/sub2/large6
1881 .hglf/sub2/large6
1882 .hglf/sub2/large7
1882 .hglf/sub2/large7
1883 large4-renamed
1883 large4-renamed
1884 sub/normal4
1884 sub/normal4
1885
1885
1886 $ cd ..
1886 $ cd ..
1887
1887
1888
1888
1889
1889
@@ -1,397 +1,397 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles =
5 > largefiles =
6 > share =
6 > share =
7 > strip =
7 > strip =
8 > convert =
8 > convert =
9 > [largefiles]
9 > [largefiles]
10 > minsize = 0.5
10 > minsize = 0.5
11 > patterns = **.other
11 > patterns = **.other
12 > **.dat
12 > **.dat
13 > usercache=${USERCACHE}
13 > usercache=${USERCACHE}
14 > EOF
14 > EOF
15
15
16 "lfconvert" works
16 "lfconvert" works
17 $ hg init bigfile-repo
17 $ hg init bigfile-repo
18 $ cd bigfile-repo
18 $ cd bigfile-repo
19 $ cat >> .hg/hgrc <<EOF
19 $ cat >> .hg/hgrc <<EOF
20 > [extensions]
20 > [extensions]
21 > largefiles = !
21 > largefiles = !
22 > EOF
22 > EOF
23 $ mkdir sub
23 $ mkdir sub
24 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
24 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
25 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
25 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
26 $ echo normal > normal1
26 $ echo normal > normal1
27 $ echo alsonormal > sub/normal2
27 $ echo alsonormal > sub/normal2
28 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
28 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
29 $ hg addremove
29 $ hg addremove
30 adding large
30 adding large
31 adding large2
31 adding large2
32 adding normal1
32 adding normal1
33 adding sub/maybelarge.dat
33 adding sub/maybelarge.dat
34 adding sub/normal2
34 adding sub/normal2
35 $ hg commit -m"add large, normal1" large normal1
35 $ hg commit -m"add large, normal1" large normal1
36 $ hg commit -m"add sub/*" sub
36 $ hg commit -m"add sub/*" sub
37
37
38 Test tag parsing
38 Test tag parsing
39 $ cat >> .hgtags <<EOF
39 $ cat >> .hgtags <<EOF
40 > IncorrectlyFormattedTag!
40 > IncorrectlyFormattedTag!
41 > invalidhash sometag
41 > invalidhash sometag
42 > 0123456789abcdef anothertag
42 > 0123456789abcdef anothertag
43 > EOF
43 > EOF
44 $ hg add .hgtags
44 $ hg add .hgtags
45 $ hg commit -m"add large2" large2 .hgtags
45 $ hg commit -m"add large2" large2 .hgtags
46
46
47 Test link+rename largefile codepath
47 Test link+rename largefile codepath
48 $ [ -d .hg/largefiles ] && echo fail || echo pass
48 $ [ -d .hg/largefiles ] && echo fail || echo pass
49 pass
49 pass
50 $ cd ..
50 $ cd ..
51 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
51 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
52 initializing destination largefiles-repo
52 initializing destination largefiles-repo
53 skipping incorrectly formatted tag IncorrectlyFormattedTag!
53 skipping incorrectly formatted tag IncorrectlyFormattedTag!
54 skipping incorrectly formatted id invalidhash
54 skipping incorrectly formatted id invalidhash
55 no mapping for id 0123456789abcdef
55 no mapping for id 0123456789abcdef
56 #if symlink
56 #if symlink
57 $ hg --cwd bigfile-repo rename large2 large3
57 $ hg --cwd bigfile-repo rename large2 large3
58 $ ln -sf large bigfile-repo/large3
58 $ ln -sf large bigfile-repo/large3
59 $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
59 $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
60 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
60 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
61 initializing destination largefiles-repo-symlink
61 initializing destination largefiles-repo-symlink
62 skipping incorrectly formatted tag IncorrectlyFormattedTag!
62 skipping incorrectly formatted tag IncorrectlyFormattedTag!
63 skipping incorrectly formatted id invalidhash
63 skipping incorrectly formatted id invalidhash
64 no mapping for id 0123456789abcdef
64 no mapping for id 0123456789abcdef
65 abort: renamed/copied largefile large3 becomes symlink
65 abort: renamed/copied largefile large3 becomes symlink
66 [255]
66 [255]
67 #endif
67 #endif
68 $ cd bigfile-repo
68 $ cd bigfile-repo
69 $ hg strip --no-backup 2
69 $ hg strip --no-backup 2
70 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
70 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
71 $ cd ..
71 $ cd ..
72 $ rm -rf largefiles-repo largefiles-repo-symlink
72 $ rm -rf largefiles-repo largefiles-repo-symlink
73
73
74 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
74 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
75 initializing destination largefiles-repo
75 initializing destination largefiles-repo
76
76
77 "lfconvert" converts content correctly
77 "lfconvert" converts content correctly
78 $ cd largefiles-repo
78 $ cd largefiles-repo
79 $ hg up
79 $ hg up
80 getting changed largefiles
80 getting changed largefiles
81 2 largefiles updated, 0 removed
81 2 largefiles updated, 0 removed
82 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 $ hg locate
83 $ hg locate
84 .hglf/large
84 .hglf/large
85 .hglf/sub/maybelarge.dat
85 .hglf/sub/maybelarge.dat
86 normal1
86 normal1
87 sub/normal2
87 sub/normal2
88 $ cat normal1
88 $ cat normal1
89 normal
89 normal
90 $ cat sub/normal2
90 $ cat sub/normal2
91 alsonormal
91 alsonormal
92 $ md5sum.py large sub/maybelarge.dat
92 $ md5sum.py large sub/maybelarge.dat
93 ec87a838931d4d5d2e94a04644788a55 large
93 ec87a838931d4d5d2e94a04644788a55 large
94 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
94 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
95
95
96 "lfconvert" adds 'largefiles' to .hg/requires.
96 "lfconvert" adds 'largefiles' to .hg/requires.
97 $ cat .hg/requires
97 $ cat .hg/requires
98 dotencode
98 dotencode
99 fncache
99 fncache
100 generaldelta
100 generaldelta
101 largefiles
101 largefiles
102 revlogv1
102 revlogv1
103 store
103 store
104 testonly-simplestore (reposimplestore !)
104 testonly-simplestore (reposimplestore !)
105
105
106 "lfconvert" includes a newline at the end of the standin files.
106 "lfconvert" includes a newline at the end of the standin files.
107 $ cat .hglf/large .hglf/sub/maybelarge.dat
107 $ cat .hglf/large .hglf/sub/maybelarge.dat
108 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
108 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
109 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
109 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
110 $ cd ..
110 $ cd ..
111
111
112 add some changesets to rename/remove/merge
112 add some changesets to rename/remove/merge
113 $ cd bigfile-repo
113 $ cd bigfile-repo
114 $ hg mv -q sub stuff
114 $ hg mv -q sub stuff
115 $ hg commit -m"rename sub/ to stuff/"
115 $ hg commit -m"rename sub/ to stuff/"
116 $ hg update -q 1
116 $ hg update -q 1
117 $ echo blah >> normal3
117 $ echo blah >> normal3
118 $ echo blah >> sub/normal2
118 $ echo blah >> sub/normal2
119 $ echo blah >> sub/maybelarge.dat
119 $ echo blah >> sub/maybelarge.dat
120 $ md5sum.py sub/maybelarge.dat
120 $ md5sum.py sub/maybelarge.dat
121 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
121 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
122 $ hg commit -A -m"add normal3, modify sub/*"
122 $ hg commit -A -m"add normal3, modify sub/*"
123 adding normal3
123 adding normal3
124 created new head
124 created new head
125 $ hg rm large normal3
125 $ hg rm large normal3
126 $ hg commit -q -m"remove large, normal3"
126 $ hg commit -q -m"remove large, normal3"
127 $ hg merge
127 $ hg merge
128 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
128 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
129 merging sub/normal2 and stuff/normal2 to stuff/normal2
129 merging sub/normal2 and stuff/normal2 to stuff/normal2
130 warning: stuff/maybelarge.dat looks like a binary file.
130 warning: stuff/maybelarge.dat looks like a binary file.
131 warning: conflicts while merging stuff/maybelarge.dat! (edit, then use 'hg resolve --mark')
131 warning: conflicts while merging stuff/maybelarge.dat! (edit, then use 'hg resolve --mark')
132 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
132 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
133 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
133 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
134 [1]
134 [1]
135 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
135 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
136 $ hg resolve -m stuff/maybelarge.dat
136 $ hg resolve -m stuff/maybelarge.dat
137 (no more unresolved files)
137 (no more unresolved files)
138 $ hg commit -m"merge"
138 $ hg commit -m"merge"
139 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
139 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
140 @ 5:4884f215abda merge
140 @ 5:4884f215abda merge
141 |\
141 |\
142 | o 4:7285f817b77e remove large, normal3
142 | o 4:7285f817b77e remove large, normal3
143 | |
143 | |
144 | o 3:67e3892e3534 add normal3, modify sub/*
144 | o 3:67e3892e3534 add normal3, modify sub/*
145 | |
145 | |
146 o | 2:c96c8beb5d56 rename sub/ to stuff/
146 o | 2:c96c8beb5d56 rename sub/ to stuff/
147 |/
147 |/
148 o 1:020c65d24e11 add sub/*
148 o 1:020c65d24e11 add sub/*
149 |
149 |
150 o 0:117b8328f97a add large, normal1
150 o 0:117b8328f97a add large, normal1
151
151
152 $ cd ..
152 $ cd ..
153
153
154 lfconvert with rename, merge, and remove
154 lfconvert with rename, merge, and remove
155 $ rm -rf largefiles-repo
155 $ rm -rf largefiles-repo
156 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
156 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
157 initializing destination largefiles-repo
157 initializing destination largefiles-repo
158 $ cd largefiles-repo
158 $ cd largefiles-repo
159 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
159 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
160 o 5:8e05f5f2b77e merge
160 o 5:8e05f5f2b77e merge
161 |\
161 |\
162 | o 4:a5a02de7a8e4 remove large, normal3
162 | o 4:a5a02de7a8e4 remove large, normal3
163 | |
163 | |
164 | o 3:55759520c76f add normal3, modify sub/*
164 | o 3:55759520c76f add normal3, modify sub/*
165 | |
165 | |
166 o | 2:261ad3f3f037 rename sub/ to stuff/
166 o | 2:261ad3f3f037 rename sub/ to stuff/
167 |/
167 |/
168 o 1:334e5237836d add sub/*
168 o 1:334e5237836d add sub/*
169 |
169 |
170 o 0:d4892ec57ce2 add large, normal1
170 o 0:d4892ec57ce2 add large, normal1
171
171
172 $ hg locate -r 2
172 $ hg locate -r 2
173 .hglf/large
173 .hglf/large
174 .hglf/stuff/maybelarge.dat
174 .hglf/stuff/maybelarge.dat
175 normal1
175 normal1
176 stuff/normal2
176 stuff/normal2
177 $ hg locate -r 3
177 $ hg locate -r 3
178 .hglf/large
178 .hglf/large
179 .hglf/sub/maybelarge.dat
179 .hglf/sub/maybelarge.dat
180 normal1
180 normal1
181 normal3
181 normal3
182 sub/normal2
182 sub/normal2
183 $ hg locate -r 4
183 $ hg locate -r 4
184 .hglf/sub/maybelarge.dat
184 .hglf/sub/maybelarge.dat
185 normal1
185 normal1
186 sub/normal2
186 sub/normal2
187 $ hg locate -r 5
187 $ hg locate -r 5
188 .hglf/stuff/maybelarge.dat
188 .hglf/stuff/maybelarge.dat
189 normal1
189 normal1
190 stuff/normal2
190 stuff/normal2
191 $ hg update
191 $ hg update
192 getting changed largefiles
192 getting changed largefiles
193 1 largefiles updated, 0 removed
193 1 largefiles updated, 0 removed
194 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ cat stuff/normal2
195 $ cat stuff/normal2
196 alsonormal
196 alsonormal
197 blah
197 blah
198 $ md5sum.py stuff/maybelarge.dat
198 $ md5sum.py stuff/maybelarge.dat
199 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
199 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
200 $ cat .hglf/stuff/maybelarge.dat
200 $ cat .hglf/stuff/maybelarge.dat
201 76236b6a2c6102826c61af4297dd738fb3b1de38
201 76236b6a2c6102826c61af4297dd738fb3b1de38
202 $ cd ..
202 $ cd ..
203
203
204 "lfconvert" error cases
204 "lfconvert" error cases
205 $ hg lfconvert http://localhost/foo foo
205 $ hg lfconvert http://localhost/foo foo
206 abort: http://localhost/foo is not a local Mercurial repo
206 abort: http://localhost/foo is not a local Mercurial repo
207 [255]
207 [255]
208 $ hg lfconvert foo ssh://localhost/foo
208 $ hg lfconvert foo ssh://localhost/foo
209 abort: ssh://localhost/foo is not a local Mercurial repo
209 abort: ssh://localhost/foo is not a local Mercurial repo
210 [255]
210 [255]
211 $ hg lfconvert nosuchrepo foo
211 $ hg lfconvert nosuchrepo foo
212 abort: repository nosuchrepo not found!
212 abort: repository nosuchrepo not found!
213 [255]
213 [255]
214 $ hg share -q -U bigfile-repo shared
214 $ hg share -q -U bigfile-repo shared
215 $ printf 'bogus' > shared/.hg/sharedpath
215 $ printf 'bogus' > shared/.hg/sharedpath
216 $ hg lfconvert shared foo
216 $ hg lfconvert shared foo
217 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus!
217 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus!
218 [255]
218 [255]
219 $ hg lfconvert bigfile-repo largefiles-repo
219 $ hg lfconvert bigfile-repo largefiles-repo
220 initializing destination largefiles-repo
220 initializing destination largefiles-repo
221 abort: repository largefiles-repo already exists!
221 abort: repository largefiles-repo already exists!
222 [255]
222 [255]
223
223
224 add another largefile to the new largefiles repo
224 add another largefile to the new largefiles repo
225 $ cd largefiles-repo
225 $ cd largefiles-repo
226 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
226 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
227 $ hg add --lfsize=1 anotherlarge
227 $ hg add --lfsize=1 anotherlarge
228 $ hg commit -m "add anotherlarge (should be a largefile)"
228 $ hg commit -m "add anotherlarge (should be a largefile)"
229 $ cat .hglf/anotherlarge
229 $ cat .hglf/anotherlarge
230 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
230 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
231 $ hg tag mytag
231 $ hg tag mytag
232 $ cd ..
232 $ cd ..
233
233
234 round-trip: converting back to a normal (non-largefiles) repo with
234 round-trip: converting back to a normal (non-largefiles) repo with
235 "lfconvert --to-normal" should give the same as ../bigfile-repo. The
235 "lfconvert --to-normal" should give the same as ../bigfile-repo. The
236 convert extension is disabled to show config items can be loaded without it.
236 convert extension is disabled to show config items can be loaded without it.
237 $ cd largefiles-repo
237 $ cd largefiles-repo
238 $ hg --config extensions.convert=! lfconvert --to-normal . ../normal-repo
238 $ hg --config extensions.convert=! lfconvert --to-normal . ../normal-repo
239 initializing destination ../normal-repo
239 initializing destination ../normal-repo
240 0 additional largefiles cached
240 0 additional largefiles cached
241 scanning source...
241 scanning source...
242 sorting...
242 sorting...
243 converting...
243 converting...
244 7 add large, normal1
244 7 add large, normal1
245 6 add sub/*
245 6 add sub/*
246 5 rename sub/ to stuff/
246 5 rename sub/ to stuff/
247 4 add normal3, modify sub/*
247 4 add normal3, modify sub/*
248 3 remove large, normal3
248 3 remove large, normal3
249 2 merge
249 2 merge
250 1 add anotherlarge (should be a largefile)
250 1 add anotherlarge (should be a largefile)
251 0 Added tag mytag for changeset abacddda7028
251 0 Added tag mytag for changeset abacddda7028
252 $ cd ../normal-repo
252 $ cd ../normal-repo
253 $ cat >> .hg/hgrc <<EOF
253 $ cat >> .hg/hgrc <<EOF
254 > [extensions]
254 > [extensions]
255 > largefiles = !
255 > largefiles = !
256 > EOF
256 > EOF
257
257
258 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
258 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
259 o 7:b5fedc110b9d Added tag mytag for changeset 867ab992ecf4
259 o 7:b5fedc110b9d Added tag mytag for changeset 867ab992ecf4
260 |
260 |
261 o 6:867ab992ecf4 add anotherlarge (should be a largefile)
261 o 6:867ab992ecf4 add anotherlarge (should be a largefile)
262 |
262 |
263 o 5:4884f215abda merge
263 o 5:4884f215abda merge
264 |\
264 |\
265 | o 4:7285f817b77e remove large, normal3
265 | o 4:7285f817b77e remove large, normal3
266 | |
266 | |
267 | o 3:67e3892e3534 add normal3, modify sub/*
267 | o 3:67e3892e3534 add normal3, modify sub/*
268 | |
268 | |
269 o | 2:c96c8beb5d56 rename sub/ to stuff/
269 o | 2:c96c8beb5d56 rename sub/ to stuff/
270 |/
270 |/
271 o 1:020c65d24e11 add sub/*
271 o 1:020c65d24e11 add sub/*
272 |
272 |
273 o 0:117b8328f97a add large, normal1
273 o 0:117b8328f97a add large, normal1
274
274
275 $ hg update
275 $ hg update
276 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 $ hg locate
277 $ hg locate
278 .hgtags
278 .hgtags
279 anotherlarge
279 anotherlarge
280 normal1
280 normal1
281 stuff/maybelarge.dat
281 stuff/maybelarge.dat
282 stuff/normal2
282 stuff/normal2
283 $ [ -d .hg/largefiles ] && echo fail || echo pass
283 $ [ -d .hg/largefiles ] && echo fail || echo pass
284 pass
284 pass
285
285
286 $ cd ..
286 $ cd ..
287
287
288 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
288 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
289 from the working dir on a convert.
289 from the working dir on a convert.
290 $ rm "${USERCACHE}"/*
290 $ rm "${USERCACHE}"/*
291 $ hg convert largefiles-repo
291 $ hg convert largefiles-repo
292 assuming destination largefiles-repo-hg
292 assuming destination largefiles-repo-hg
293 initializing destination largefiles-repo-hg repository
293 initializing destination largefiles-repo-hg repository
294 scanning source...
294 scanning source...
295 sorting...
295 sorting...
296 converting...
296 converting...
297 7 add large, normal1
297 7 add large, normal1
298 6 add sub/*
298 6 add sub/*
299 5 rename sub/ to stuff/
299 5 rename sub/ to stuff/
300 4 add normal3, modify sub/*
300 4 add normal3, modify sub/*
301 3 remove large, normal3
301 3 remove large, normal3
302 2 merge
302 2 merge
303 1 add anotherlarge (should be a largefile)
303 1 add anotherlarge (should be a largefile)
304 0 Added tag mytag for changeset abacddda7028
304 0 Added tag mytag for changeset abacddda7028
305
305
306 $ hg -R largefiles-repo-hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
306 $ hg -R largefiles-repo-hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
307 o 7:2f08f66459b7 Added tag mytag for changeset 17126745edfd
307 o 7:2f08f66459b7 Added tag mytag for changeset 17126745edfd
308 |
308 |
309 o 6:17126745edfd add anotherlarge (should be a largefile)
309 o 6:17126745edfd add anotherlarge (should be a largefile)
310 |
310 |
311 o 5:9cc5aa7204f0 merge
311 o 5:9cc5aa7204f0 merge
312 |\
312 |\
313 | o 4:a5a02de7a8e4 remove large, normal3
313 | o 4:a5a02de7a8e4 remove large, normal3
314 | |
314 | |
315 | o 3:55759520c76f add normal3, modify sub/*
315 | o 3:55759520c76f add normal3, modify sub/*
316 | |
316 | |
317 o | 2:261ad3f3f037 rename sub/ to stuff/
317 o | 2:261ad3f3f037 rename sub/ to stuff/
318 |/
318 |/
319 o 1:334e5237836d add sub/*
319 o 1:334e5237836d add sub/*
320 |
320 |
321 o 0:d4892ec57ce2 add large, normal1
321 o 0:d4892ec57ce2 add large, normal1
322
322
323 Verify will fail (for now) if the usercache is purged before converting, since
323 Verify will fail (for now) if the usercache is purged before converting, since
324 largefiles are not cached in the converted repo's local store by the conversion
324 largefiles are not cached in the converted repo's local store by the conversion
325 process.
325 process.
326 $ cd largefiles-repo-hg
326 $ cd largefiles-repo-hg
327 $ cat >> .hg/hgrc <<EOF
327 $ cat >> .hg/hgrc <<EOF
328 > [experimental]
328 > [experimental]
329 > evolution.createmarkers=True
329 > evolution.createmarkers=True
330 > EOF
330 > EOF
331 $ hg debugobsolete `hg log -r tip -T "{node}"`
331 $ hg debugobsolete `hg log -r tip -T "{node}"`
332 obsoleted 1 changesets
332 obsoleted 1 changesets
333 $ cd ..
333 $ cd ..
334
334
335 $ hg -R largefiles-repo-hg verify --large --lfa
335 $ hg -R largefiles-repo-hg verify --large --lfa
336 checking changesets
336 checking changesets
337 checking manifests
337 checking manifests
338 crosschecking files in changesets and manifests
338 crosschecking files in changesets and manifests
339 checking files
339 checking files
340 9 files, 8 changesets, 13 total revisions
340 checked 8 changesets with 13 changes to 9 files
341 searching 7 changesets for largefiles
341 searching 7 changesets for largefiles
342 changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7
342 changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7
343 changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
343 changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
344 changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
344 changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
345 changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38
345 changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38
346 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38
346 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38
347 changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
347 changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
348 verified existence of 6 revisions of 4 largefiles
348 verified existence of 6 revisions of 4 largefiles
349 [1]
349 [1]
350 $ hg -R largefiles-repo-hg showconfig paths
350 $ hg -R largefiles-repo-hg showconfig paths
351 [1]
351 [1]
352
352
353
353
354 Avoid a traceback if a largefile isn't available (issue3519)
354 Avoid a traceback if a largefile isn't available (issue3519)
355
355
356 Ensure the largefile can be cached in the source if necessary
356 Ensure the largefile can be cached in the source if necessary
357 $ hg clone -U largefiles-repo issue3519
357 $ hg clone -U largefiles-repo issue3519
358 $ rm -f "${USERCACHE}"/*
358 $ rm -f "${USERCACHE}"/*
359 $ hg lfconvert --to-normal issue3519 normalized3519
359 $ hg lfconvert --to-normal issue3519 normalized3519
360 initializing destination normalized3519
360 initializing destination normalized3519
361 4 additional largefiles cached
361 4 additional largefiles cached
362 scanning source...
362 scanning source...
363 sorting...
363 sorting...
364 converting...
364 converting...
365 7 add large, normal1
365 7 add large, normal1
366 6 add sub/*
366 6 add sub/*
367 5 rename sub/ to stuff/
367 5 rename sub/ to stuff/
368 4 add normal3, modify sub/*
368 4 add normal3, modify sub/*
369 3 remove large, normal3
369 3 remove large, normal3
370 2 merge
370 2 merge
371 1 add anotherlarge (should be a largefile)
371 1 add anotherlarge (should be a largefile)
372 0 Added tag mytag for changeset abacddda7028
372 0 Added tag mytag for changeset abacddda7028
373
373
374 Ensure the abort message is useful if a largefile is entirely unavailable
374 Ensure the abort message is useful if a largefile is entirely unavailable
375 $ rm -rf normalized3519
375 $ rm -rf normalized3519
376 $ rm "${USERCACHE}"/*
376 $ rm "${USERCACHE}"/*
377 $ rm issue3519/.hg/largefiles/*
377 $ rm issue3519/.hg/largefiles/*
378 $ rm largefiles-repo/.hg/largefiles/*
378 $ rm largefiles-repo/.hg/largefiles/*
379 $ hg lfconvert --to-normal issue3519 normalized3519
379 $ hg lfconvert --to-normal issue3519 normalized3519
380 initializing destination normalized3519
380 initializing destination normalized3519
381 anotherlarge: largefile 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 not available from file:/*/$TESTTMP/largefiles-repo (glob)
381 anotherlarge: largefile 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 not available from file:/*/$TESTTMP/largefiles-repo (glob)
382 stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
382 stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
383 stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
383 stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
384 sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
384 sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
385 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
385 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
386 sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
386 sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
387 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
387 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
388 stuff/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob)
388 stuff/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob)
389 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
389 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
390 sub/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob)
390 sub/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob)
391 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
391 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
392 0 additional largefiles cached
392 0 additional largefiles cached
393 11 largefiles failed to download
393 11 largefiles failed to download
394 abort: all largefiles must be present locally
394 abort: all largefiles must be present locally
395 [255]
395 [255]
396
396
397
397
@@ -1,1119 +1,1119 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 # Initial setup
3 # Initial setup
4
4
5 $ cat >> $HGRCPATH << EOF
5 $ cat >> $HGRCPATH << EOF
6 > [extensions]
6 > [extensions]
7 > lfs=
7 > lfs=
8 > [lfs]
8 > [lfs]
9 > # Test deprecated config
9 > # Test deprecated config
10 > threshold=1000B
10 > threshold=1000B
11 > EOF
11 > EOF
12
12
13 $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
13 $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
14
14
15 # Prepare server and enable extension
15 # Prepare server and enable extension
16 $ hg init server
16 $ hg init server
17 $ hg clone -q server client
17 $ hg clone -q server client
18 $ cd client
18 $ cd client
19
19
20 # Commit small file
20 # Commit small file
21 $ echo s > smallfile
21 $ echo s > smallfile
22 $ echo '**.py = LF' > .hgeol
22 $ echo '**.py = LF' > .hgeol
23 $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file"
23 $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file"
24 hg: parse error: unsupported file pattern: size(">1000B")
24 hg: parse error: unsupported file pattern: size(">1000B")
25 (paths must be prefixed with "path:")
25 (paths must be prefixed with "path:")
26 [255]
26 [255]
27 $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file"
27 $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file"
28
28
29 # Commit large file
29 # Commit large file
30 $ echo $LONG > largefile
30 $ echo $LONG > largefile
31 $ grep lfs .hg/requires
31 $ grep lfs .hg/requires
32 [1]
32 [1]
33 $ hg commit --traceback -Aqm "add large file"
33 $ hg commit --traceback -Aqm "add large file"
34 $ grep lfs .hg/requires
34 $ grep lfs .hg/requires
35 lfs
35 lfs
36
36
37 # Ensure metadata is stored
37 # Ensure metadata is stored
38 $ hg debugdata largefile 0
38 $ hg debugdata largefile 0
39 version https://git-lfs.github.com/spec/v1
39 version https://git-lfs.github.com/spec/v1
40 oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
40 oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
41 size 1501
41 size 1501
42 x-is-binary 0
42 x-is-binary 0
43
43
44 # Check the blobstore is populated
44 # Check the blobstore is populated
45 $ find .hg/store/lfs/objects | sort
45 $ find .hg/store/lfs/objects | sort
46 .hg/store/lfs/objects
46 .hg/store/lfs/objects
47 .hg/store/lfs/objects/f1
47 .hg/store/lfs/objects/f1
48 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
48 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
49
49
50 # Check the blob stored contains the actual contents of the file
50 # Check the blob stored contains the actual contents of the file
51 $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
51 $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
52 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
52 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
53
53
54 # Push changes to the server
54 # Push changes to the server
55
55
56 $ hg push
56 $ hg push
57 pushing to $TESTTMP/server
57 pushing to $TESTTMP/server
58 searching for changes
58 searching for changes
59 abort: lfs.url needs to be configured
59 abort: lfs.url needs to be configured
60 [255]
60 [255]
61
61
62 $ cat >> $HGRCPATH << EOF
62 $ cat >> $HGRCPATH << EOF
63 > [lfs]
63 > [lfs]
64 > url=file:$TESTTMP/dummy-remote/
64 > url=file:$TESTTMP/dummy-remote/
65 > EOF
65 > EOF
66
66
67 Push to a local non-lfs repo with the extension enabled will add the
67 Push to a local non-lfs repo with the extension enabled will add the
68 lfs requirement
68 lfs requirement
69
69
70 $ grep lfs $TESTTMP/server/.hg/requires
70 $ grep lfs $TESTTMP/server/.hg/requires
71 [1]
71 [1]
72 $ hg push -v | egrep -v '^(uncompressed| )'
72 $ hg push -v | egrep -v '^(uncompressed| )'
73 pushing to $TESTTMP/server
73 pushing to $TESTTMP/server
74 searching for changes
74 searching for changes
75 lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store
75 lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store
76 2 changesets found
76 2 changesets found
77 adding changesets
77 adding changesets
78 adding manifests
78 adding manifests
79 adding file changes
79 adding file changes
80 added 2 changesets with 3 changes to 3 files
80 added 2 changesets with 3 changes to 3 files
81 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
81 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
82 $ grep lfs $TESTTMP/server/.hg/requires
82 $ grep lfs $TESTTMP/server/.hg/requires
83 lfs
83 lfs
84
84
85 # Unknown URL scheme
85 # Unknown URL scheme
86
86
87 $ hg push --config lfs.url=ftp://foobar
87 $ hg push --config lfs.url=ftp://foobar
88 abort: lfs: unknown url scheme: ftp
88 abort: lfs: unknown url scheme: ftp
89 [255]
89 [255]
90
90
91 $ cd ../
91 $ cd ../
92
92
93 # Initialize new client (not cloning) and setup extension
93 # Initialize new client (not cloning) and setup extension
94 $ hg init client2
94 $ hg init client2
95 $ cd client2
95 $ cd client2
96 $ cat >> .hg/hgrc <<EOF
96 $ cat >> .hg/hgrc <<EOF
97 > [paths]
97 > [paths]
98 > default = $TESTTMP/server
98 > default = $TESTTMP/server
99 > EOF
99 > EOF
100
100
101 # Pull from server
101 # Pull from server
102
102
103 Pulling a local lfs repo into a local non-lfs repo with the extension
103 Pulling a local lfs repo into a local non-lfs repo with the extension
104 enabled adds the lfs requirement
104 enabled adds the lfs requirement
105
105
106 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
106 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
107 $TESTTMP/server/.hg/requires:lfs
107 $TESTTMP/server/.hg/requires:lfs
108 $ hg pull default
108 $ hg pull default
109 pulling from $TESTTMP/server
109 pulling from $TESTTMP/server
110 requesting all changes
110 requesting all changes
111 adding changesets
111 adding changesets
112 adding manifests
112 adding manifests
113 adding file changes
113 adding file changes
114 added 2 changesets with 3 changes to 3 files
114 added 2 changesets with 3 changes to 3 files
115 new changesets 0ead593177f7:b88141481348
115 new changesets 0ead593177f7:b88141481348
116 (run 'hg update' to get a working copy)
116 (run 'hg update' to get a working copy)
117 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
117 $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
118 .hg/requires:lfs
118 .hg/requires:lfs
119 $TESTTMP/server/.hg/requires:lfs
119 $TESTTMP/server/.hg/requires:lfs
120
120
121 # Check the blobstore is not yet populated
121 # Check the blobstore is not yet populated
122 $ [ -d .hg/store/lfs/objects ]
122 $ [ -d .hg/store/lfs/objects ]
123 [1]
123 [1]
124
124
125 # Update to the last revision containing the large file
125 # Update to the last revision containing the large file
126 $ hg update
126 $ hg update
127 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
128
128
129 # Check the blobstore has been populated on update
129 # Check the blobstore has been populated on update
130 $ find .hg/store/lfs/objects | sort
130 $ find .hg/store/lfs/objects | sort
131 .hg/store/lfs/objects
131 .hg/store/lfs/objects
132 .hg/store/lfs/objects/f1
132 .hg/store/lfs/objects/f1
133 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
133 .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
134
134
135 # Check the contents of the file are fetched from blobstore when requested
135 # Check the contents of the file are fetched from blobstore when requested
136 $ hg cat -r . largefile
136 $ hg cat -r . largefile
137 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
137 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
138
138
139 # Check the file has been copied in the working copy
139 # Check the file has been copied in the working copy
140 $ cat largefile
140 $ cat largefile
141 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
141 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
142
142
143 $ cd ..
143 $ cd ..
144
144
145 # Check rename, and switch between large and small files
145 # Check rename, and switch between large and small files
146
146
147 $ hg init repo3
147 $ hg init repo3
148 $ cd repo3
148 $ cd repo3
149 $ cat >> .hg/hgrc << EOF
149 $ cat >> .hg/hgrc << EOF
150 > [lfs]
150 > [lfs]
151 > track=size(">10B")
151 > track=size(">10B")
152 > EOF
152 > EOF
153
153
154 $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
154 $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
155 $ echo SHORTER > small
155 $ echo SHORTER > small
156 $ hg add . -q
156 $ hg add . -q
157 $ hg commit -m 'commit with lfs content'
157 $ hg commit -m 'commit with lfs content'
158
158
159 $ hg files -r . 'set:added()'
159 $ hg files -r . 'set:added()'
160 large
160 large
161 small
161 small
162 $ hg files -r . 'set:added() & lfs()'
162 $ hg files -r . 'set:added() & lfs()'
163 large
163 large
164
164
165 $ hg mv large l
165 $ hg mv large l
166 $ hg mv small s
166 $ hg mv small s
167 $ hg status 'set:removed()'
167 $ hg status 'set:removed()'
168 R large
168 R large
169 R small
169 R small
170 $ hg status 'set:removed() & lfs()'
170 $ hg status 'set:removed() & lfs()'
171 R large
171 R large
172 $ hg commit -m 'renames'
172 $ hg commit -m 'renames'
173
173
174 $ hg files -r . 'set:copied()'
174 $ hg files -r . 'set:copied()'
175 l
175 l
176 s
176 s
177 $ hg files -r . 'set:copied() & lfs()'
177 $ hg files -r . 'set:copied() & lfs()'
178 l
178 l
179 $ hg status --change . 'set:removed()'
179 $ hg status --change . 'set:removed()'
180 R large
180 R large
181 R small
181 R small
182 $ hg status --change . 'set:removed() & lfs()'
182 $ hg status --change . 'set:removed() & lfs()'
183 R large
183 R large
184
184
185 $ echo SHORT > l
185 $ echo SHORT > l
186 $ echo BECOME-LARGER-FROM-SHORTER > s
186 $ echo BECOME-LARGER-FROM-SHORTER > s
187 $ hg commit -m 'large to small, small to large'
187 $ hg commit -m 'large to small, small to large'
188
188
189 $ echo 1 >> l
189 $ echo 1 >> l
190 $ echo 2 >> s
190 $ echo 2 >> s
191 $ hg commit -m 'random modifications'
191 $ hg commit -m 'random modifications'
192
192
193 $ echo RESTORE-TO-BE-LARGE > l
193 $ echo RESTORE-TO-BE-LARGE > l
194 $ echo SHORTER > s
194 $ echo SHORTER > s
195 $ hg commit -m 'switch large and small again'
195 $ hg commit -m 'switch large and small again'
196
196
197 # Test lfs_files template
197 # Test lfs_files template
198
198
199 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
199 $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
200 0 large
200 0 large
201 1 l, large
201 1 l, large
202 2 s
202 2 s
203 3 s
203 3 s
204 4 l
204 4 l
205
205
206 # Push and pull the above repo
206 # Push and pull the above repo
207
207
208 $ hg --cwd .. init repo4
208 $ hg --cwd .. init repo4
209 $ hg push ../repo4
209 $ hg push ../repo4
210 pushing to ../repo4
210 pushing to ../repo4
211 searching for changes
211 searching for changes
212 adding changesets
212 adding changesets
213 adding manifests
213 adding manifests
214 adding file changes
214 adding file changes
215 added 5 changesets with 10 changes to 4 files
215 added 5 changesets with 10 changes to 4 files
216
216
217 $ hg --cwd .. init repo5
217 $ hg --cwd .. init repo5
218 $ hg --cwd ../repo5 pull ../repo3
218 $ hg --cwd ../repo5 pull ../repo3
219 pulling from ../repo3
219 pulling from ../repo3
220 requesting all changes
220 requesting all changes
221 adding changesets
221 adding changesets
222 adding manifests
222 adding manifests
223 adding file changes
223 adding file changes
224 added 5 changesets with 10 changes to 4 files
224 added 5 changesets with 10 changes to 4 files
225 new changesets fd47a419c4f7:5adf850972b9
225 new changesets fd47a419c4f7:5adf850972b9
226 (run 'hg update' to get a working copy)
226 (run 'hg update' to get a working copy)
227
227
228 $ cd ..
228 $ cd ..
229
229
230 # Test clone
230 # Test clone
231
231
232 $ hg init repo6
232 $ hg init repo6
233 $ cd repo6
233 $ cd repo6
234 $ cat >> .hg/hgrc << EOF
234 $ cat >> .hg/hgrc << EOF
235 > [lfs]
235 > [lfs]
236 > track=size(">30B")
236 > track=size(">30B")
237 > EOF
237 > EOF
238
238
239 $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
239 $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
240 $ echo SMALL > small
240 $ echo SMALL > small
241 $ hg commit -Aqm 'create a lfs file' large small
241 $ hg commit -Aqm 'create a lfs file' large small
242 $ hg debuglfsupload -r 'all()' -v
242 $ hg debuglfsupload -r 'all()' -v
243 lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store
243 lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store
244
244
245 $ cd ..
245 $ cd ..
246
246
247 $ hg clone repo6 repo7
247 $ hg clone repo6 repo7
248 updating to branch default
248 updating to branch default
249 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
249 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 $ cd repo7
250 $ cd repo7
251 $ hg config extensions --debug | grep lfs
251 $ hg config extensions --debug | grep lfs
252 $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
252 $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
253 $ cat large
253 $ cat large
254 LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
254 LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
255 $ cat small
255 $ cat small
256 SMALL
256 SMALL
257
257
258 $ cd ..
258 $ cd ..
259
259
260 $ hg --config extensions.share= share repo7 sharedrepo
260 $ hg --config extensions.share= share repo7 sharedrepo
261 updating working directory
261 updating working directory
262 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ hg -R sharedrepo config extensions --debug | grep lfs
263 $ hg -R sharedrepo config extensions --debug | grep lfs
264 $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
264 $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
265
265
266 # Test rename and status
266 # Test rename and status
267
267
268 $ hg init repo8
268 $ hg init repo8
269 $ cd repo8
269 $ cd repo8
270 $ cat >> .hg/hgrc << EOF
270 $ cat >> .hg/hgrc << EOF
271 > [lfs]
271 > [lfs]
272 > track=size(">10B")
272 > track=size(">10B")
273 > EOF
273 > EOF
274
274
275 $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
275 $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
276 $ echo SMALL > a2
276 $ echo SMALL > a2
277 $ hg commit -m a -A a1 a2
277 $ hg commit -m a -A a1 a2
278 $ hg status
278 $ hg status
279 $ hg mv a1 b1
279 $ hg mv a1 b1
280 $ hg mv a2 a1
280 $ hg mv a2 a1
281 $ hg mv b1 a2
281 $ hg mv b1 a2
282 $ hg commit -m b
282 $ hg commit -m b
283 $ hg status
283 $ hg status
284 >>> with open('a2', 'wb') as f:
284 >>> with open('a2', 'wb') as f:
285 ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
285 ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
286 >>> with open('a1', 'wb') as f:
286 >>> with open('a1', 'wb') as f:
287 ... f.write(b'\1\nMETA\n')
287 ... f.write(b'\1\nMETA\n')
288 $ hg commit -m meta
288 $ hg commit -m meta
289 $ hg status
289 $ hg status
290 $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
290 $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
291 2: | |
291 2: | |
292 1: a1 (a2)a2 (a1) | |
292 1: a1 (a2)a2 (a1) | |
293 0: | | a1 a2
293 0: | | a1 a2
294
294
295 $ for n in a1 a2; do
295 $ for n in a1 a2; do
296 > for r in 0 1 2; do
296 > for r in 0 1 2; do
297 > printf '\n%s @ %s\n' $n $r
297 > printf '\n%s @ %s\n' $n $r
298 > hg debugdata $n $r
298 > hg debugdata $n $r
299 > done
299 > done
300 > done
300 > done
301
301
302 a1 @ 0
302 a1 @ 0
303 version https://git-lfs.github.com/spec/v1
303 version https://git-lfs.github.com/spec/v1
304 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
304 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
305 size 29
305 size 29
306 x-is-binary 0
306 x-is-binary 0
307
307
308 a1 @ 1
308 a1 @ 1
309 \x01 (esc)
309 \x01 (esc)
310 copy: a2
310 copy: a2
311 copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
311 copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
312 \x01 (esc)
312 \x01 (esc)
313 SMALL
313 SMALL
314
314
315 a1 @ 2
315 a1 @ 2
316 \x01 (esc)
316 \x01 (esc)
317 \x01 (esc)
317 \x01 (esc)
318 \x01 (esc)
318 \x01 (esc)
319 META
319 META
320
320
321 a2 @ 0
321 a2 @ 0
322 SMALL
322 SMALL
323
323
324 a2 @ 1
324 a2 @ 1
325 version https://git-lfs.github.com/spec/v1
325 version https://git-lfs.github.com/spec/v1
326 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
326 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
327 size 29
327 size 29
328 x-hg-copy a1
328 x-hg-copy a1
329 x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
329 x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
330 x-is-binary 0
330 x-is-binary 0
331
331
332 a2 @ 2
332 a2 @ 2
333 version https://git-lfs.github.com/spec/v1
333 version https://git-lfs.github.com/spec/v1
334 oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
334 oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
335 size 32
335 size 32
336 x-is-binary 0
336 x-is-binary 0
337
337
338 # Verify commit hashes include rename metadata
338 # Verify commit hashes include rename metadata
339
339
340 $ hg log -T '{rev}:{node|short} {desc}\n'
340 $ hg log -T '{rev}:{node|short} {desc}\n'
341 2:0fae949de7fa meta
341 2:0fae949de7fa meta
342 1:9cd6bdffdac0 b
342 1:9cd6bdffdac0 b
343 0:7f96794915f7 a
343 0:7f96794915f7 a
344
344
345 $ cd ..
345 $ cd ..
346
346
347 # Test bundle
347 # Test bundle
348
348
349 $ hg init repo9
349 $ hg init repo9
350 $ cd repo9
350 $ cd repo9
351 $ cat >> .hg/hgrc << EOF
351 $ cat >> .hg/hgrc << EOF
352 > [lfs]
352 > [lfs]
353 > track=size(">10B")
353 > track=size(">10B")
354 > [diff]
354 > [diff]
355 > git=1
355 > git=1
356 > EOF
356 > EOF
357
357
358 $ for i in 0 single two three 4; do
358 $ for i in 0 single two three 4; do
359 > echo 'THIS-IS-LFS-'$i > a
359 > echo 'THIS-IS-LFS-'$i > a
360 > hg commit -m a-$i -A a
360 > hg commit -m a-$i -A a
361 > done
361 > done
362
362
363 $ hg update 2 -q
363 $ hg update 2 -q
364 $ echo 'THIS-IS-LFS-2-CHILD' > a
364 $ echo 'THIS-IS-LFS-2-CHILD' > a
365 $ hg commit -m branching -q
365 $ hg commit -m branching -q
366
366
367 $ hg bundle --base 1 bundle.hg -v
367 $ hg bundle --base 1 bundle.hg -v
368 lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store
368 lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store
369 lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store
369 lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store
370 lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store
370 lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store
371 lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store
371 lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store
372 4 changesets found
372 4 changesets found
373 uncompressed size of bundle content:
373 uncompressed size of bundle content:
374 * (changelog) (glob)
374 * (changelog) (glob)
375 * (manifests) (glob)
375 * (manifests) (glob)
376 * a (glob)
376 * a (glob)
377 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
377 $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
378 $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
378 $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
379 5 branching
379 5 branching
380 diff --git a/a b/a
380 diff --git a/a b/a
381 --- a/a
381 --- a/a
382 +++ b/a
382 +++ b/a
383 @@ -1,1 +1,1 @@
383 @@ -1,1 +1,1 @@
384 -THIS-IS-LFS-two
384 -THIS-IS-LFS-two
385 +THIS-IS-LFS-2-CHILD
385 +THIS-IS-LFS-2-CHILD
386
386
387 4 a-4
387 4 a-4
388 diff --git a/a b/a
388 diff --git a/a b/a
389 --- a/a
389 --- a/a
390 +++ b/a
390 +++ b/a
391 @@ -1,1 +1,1 @@
391 @@ -1,1 +1,1 @@
392 -THIS-IS-LFS-three
392 -THIS-IS-LFS-three
393 +THIS-IS-LFS-4
393 +THIS-IS-LFS-4
394
394
395 3 a-three
395 3 a-three
396 diff --git a/a b/a
396 diff --git a/a b/a
397 --- a/a
397 --- a/a
398 +++ b/a
398 +++ b/a
399 @@ -1,1 +1,1 @@
399 @@ -1,1 +1,1 @@
400 -THIS-IS-LFS-two
400 -THIS-IS-LFS-two
401 +THIS-IS-LFS-three
401 +THIS-IS-LFS-three
402
402
403 2 a-two
403 2 a-two
404 diff --git a/a b/a
404 diff --git a/a b/a
405 --- a/a
405 --- a/a
406 +++ b/a
406 +++ b/a
407 @@ -1,1 +1,1 @@
407 @@ -1,1 +1,1 @@
408 -THIS-IS-LFS-single
408 -THIS-IS-LFS-single
409 +THIS-IS-LFS-two
409 +THIS-IS-LFS-two
410
410
411 1 a-single
411 1 a-single
412 diff --git a/a b/a
412 diff --git a/a b/a
413 --- a/a
413 --- a/a
414 +++ b/a
414 +++ b/a
415 @@ -1,1 +1,1 @@
415 @@ -1,1 +1,1 @@
416 -THIS-IS-LFS-0
416 -THIS-IS-LFS-0
417 +THIS-IS-LFS-single
417 +THIS-IS-LFS-single
418
418
419 0 a-0
419 0 a-0
420 diff --git a/a b/a
420 diff --git a/a b/a
421 new file mode 100644
421 new file mode 100644
422 --- /dev/null
422 --- /dev/null
423 +++ b/a
423 +++ b/a
424 @@ -0,0 +1,1 @@
424 @@ -0,0 +1,1 @@
425 +THIS-IS-LFS-0
425 +THIS-IS-LFS-0
426
426
427 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
427 $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
428 $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
428 $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
429 5 branching
429 5 branching
430 diff --git a/a b/a
430 diff --git a/a b/a
431 --- a/a
431 --- a/a
432 +++ b/a
432 +++ b/a
433 @@ -1,1 +1,1 @@
433 @@ -1,1 +1,1 @@
434 -THIS-IS-LFS-two
434 -THIS-IS-LFS-two
435 +THIS-IS-LFS-2-CHILD
435 +THIS-IS-LFS-2-CHILD
436
436
437 4 a-4
437 4 a-4
438 diff --git a/a b/a
438 diff --git a/a b/a
439 --- a/a
439 --- a/a
440 +++ b/a
440 +++ b/a
441 @@ -1,1 +1,1 @@
441 @@ -1,1 +1,1 @@
442 -THIS-IS-LFS-three
442 -THIS-IS-LFS-three
443 +THIS-IS-LFS-4
443 +THIS-IS-LFS-4
444
444
445 3 a-three
445 3 a-three
446 diff --git a/a b/a
446 diff --git a/a b/a
447 --- a/a
447 --- a/a
448 +++ b/a
448 +++ b/a
449 @@ -1,1 +1,1 @@
449 @@ -1,1 +1,1 @@
450 -THIS-IS-LFS-two
450 -THIS-IS-LFS-two
451 +THIS-IS-LFS-three
451 +THIS-IS-LFS-three
452
452
453 2 a-two
453 2 a-two
454 diff --git a/a b/a
454 diff --git a/a b/a
455 --- a/a
455 --- a/a
456 +++ b/a
456 +++ b/a
457 @@ -1,1 +1,1 @@
457 @@ -1,1 +1,1 @@
458 -THIS-IS-LFS-single
458 -THIS-IS-LFS-single
459 +THIS-IS-LFS-two
459 +THIS-IS-LFS-two
460
460
461 1 a-single
461 1 a-single
462 diff --git a/a b/a
462 diff --git a/a b/a
463 --- a/a
463 --- a/a
464 +++ b/a
464 +++ b/a
465 @@ -1,1 +1,1 @@
465 @@ -1,1 +1,1 @@
466 -THIS-IS-LFS-0
466 -THIS-IS-LFS-0
467 +THIS-IS-LFS-single
467 +THIS-IS-LFS-single
468
468
469 0 a-0
469 0 a-0
470 diff --git a/a b/a
470 diff --git a/a b/a
471 new file mode 100644
471 new file mode 100644
472 --- /dev/null
472 --- /dev/null
473 +++ b/a
473 +++ b/a
474 @@ -0,0 +1,1 @@
474 @@ -0,0 +1,1 @@
475 +THIS-IS-LFS-0
475 +THIS-IS-LFS-0
476
476
477 $ cd ..
477 $ cd ..
478
478
479 # Test isbinary
479 # Test isbinary
480
480
481 $ hg init repo10
481 $ hg init repo10
482 $ cd repo10
482 $ cd repo10
483 $ cat >> .hg/hgrc << EOF
483 $ cat >> .hg/hgrc << EOF
484 > [extensions]
484 > [extensions]
485 > lfs=
485 > lfs=
486 > [lfs]
486 > [lfs]
487 > track=all()
487 > track=all()
488 > EOF
488 > EOF
489 $ $PYTHON <<'EOF'
489 $ $PYTHON <<'EOF'
490 > def write(path, content):
490 > def write(path, content):
491 > with open(path, 'wb') as f:
491 > with open(path, 'wb') as f:
492 > f.write(content)
492 > f.write(content)
493 > write('a', b'\0\0')
493 > write('a', b'\0\0')
494 > write('b', b'\1\n')
494 > write('b', b'\1\n')
495 > write('c', b'\1\n\0')
495 > write('c', b'\1\n\0')
496 > write('d', b'xx')
496 > write('d', b'xx')
497 > EOF
497 > EOF
498 $ hg add a b c d
498 $ hg add a b c d
499 $ hg diff --stat
499 $ hg diff --stat
500 a | Bin
500 a | Bin
501 b | 1 +
501 b | 1 +
502 c | Bin
502 c | Bin
503 d | 1 +
503 d | 1 +
504 4 files changed, 2 insertions(+), 0 deletions(-)
504 4 files changed, 2 insertions(+), 0 deletions(-)
505 $ hg commit -m binarytest
505 $ hg commit -m binarytest
506 $ cat > $TESTTMP/dumpbinary.py << EOF
506 $ cat > $TESTTMP/dumpbinary.py << EOF
507 > def reposetup(ui, repo):
507 > def reposetup(ui, repo):
508 > for n in 'abcd':
508 > for n in 'abcd':
509 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
509 > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
510 > EOF
510 > EOF
511 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
511 $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
512 a: binary=True
512 a: binary=True
513 b: binary=False
513 b: binary=False
514 c: binary=True
514 c: binary=True
515 d: binary=False
515 d: binary=False
516 b55353847f02 tip
516 b55353847f02 tip
517
517
518 Binary blobs don't need to be present to be skipped in filesets. (And their
518 Binary blobs don't need to be present to be skipped in filesets. (And their
519 absence doesn't cause an abort.)
519 absence doesn't cause an abort.)
520
520
521 $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7
521 $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7
522 $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e
522 $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e
523
523
524 $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True'
524 $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True'
525 lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store
525 lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store
526 2 b
526 2 b
527 lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store
527 lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store
528
528
529 $ hg files --debug -r . 'set:binary()' --config 'experimental.lfs.disableusercache=True'
529 $ hg files --debug -r . 'set:binary()' --config 'experimental.lfs.disableusercache=True'
530 2 a
530 2 a
531 3 c
531 3 c
532
532
533 $ cd ..
533 $ cd ..
534
534
535 # Test fctx.cmp fastpath - diff without LFS blobs
535 # Test fctx.cmp fastpath - diff without LFS blobs
536
536
537 $ hg init repo12
537 $ hg init repo12
538 $ cd repo12
538 $ cd repo12
539 $ cat >> .hg/hgrc <<EOF
539 $ cat >> .hg/hgrc <<EOF
540 > [lfs]
540 > [lfs]
541 > threshold=1
541 > threshold=1
542 > EOF
542 > EOF
543 $ cat > ../patch.diff <<EOF
543 $ cat > ../patch.diff <<EOF
544 > # HG changeset patch
544 > # HG changeset patch
545 > 2
545 > 2
546 >
546 >
547 > diff --git a/a b/a
547 > diff --git a/a b/a
548 > old mode 100644
548 > old mode 100644
549 > new mode 100755
549 > new mode 100755
550 > EOF
550 > EOF
551
551
552 $ for i in 1 2 3; do
552 $ for i in 1 2 3; do
553 > cp ../repo10/a a
553 > cp ../repo10/a a
554 > if [ $i = 3 ]; then
554 > if [ $i = 3 ]; then
555 > # make a content-only change
555 > # make a content-only change
556 > hg import -q --bypass ../patch.diff
556 > hg import -q --bypass ../patch.diff
557 > hg update -q
557 > hg update -q
558 > rm ../patch.diff
558 > rm ../patch.diff
559 > else
559 > else
560 > echo $i >> a
560 > echo $i >> a
561 > hg commit -m $i -A a
561 > hg commit -m $i -A a
562 > fi
562 > fi
563 > done
563 > done
564 $ [ -d .hg/store/lfs/objects ]
564 $ [ -d .hg/store/lfs/objects ]
565
565
566 $ cd ..
566 $ cd ..
567
567
568 $ hg clone repo12 repo13 --noupdate
568 $ hg clone repo12 repo13 --noupdate
569 $ cd repo13
569 $ cd repo13
570 $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
570 $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
571 2
571 2
572 diff --git a/a b/a
572 diff --git a/a b/a
573 old mode 100644
573 old mode 100644
574 new mode 100755
574 new mode 100755
575
575
576 2
576 2
577 diff --git a/a b/a
577 diff --git a/a b/a
578 Binary file a has changed
578 Binary file a has changed
579
579
580 1
580 1
581 diff --git a/a b/a
581 diff --git a/a b/a
582 new file mode 100644
582 new file mode 100644
583 Binary file a has changed
583 Binary file a has changed
584
584
585 $ [ -d .hg/store/lfs/objects ]
585 $ [ -d .hg/store/lfs/objects ]
586 [1]
586 [1]
587
587
588 $ cd ..
588 $ cd ..
589
589
590 # Test filter
590 # Test filter
591
591
592 $ hg init repo11
592 $ hg init repo11
593 $ cd repo11
593 $ cd repo11
594 $ cat >> .hg/hgrc << EOF
594 $ cat >> .hg/hgrc << EOF
595 > [lfs]
595 > [lfs]
596 > track=(**.a & size(">5B")) | (**.b & !size(">5B"))
596 > track=(**.a & size(">5B")) | (**.b & !size(">5B"))
597 > | (**.c & "path:d" & !"path:d/c.c") | size(">10B")
597 > | (**.c & "path:d" & !"path:d/c.c") | size(">10B")
598 > EOF
598 > EOF
599
599
600 $ mkdir a
600 $ mkdir a
601 $ echo aaaaaa > a/1.a
601 $ echo aaaaaa > a/1.a
602 $ echo a > a/2.a
602 $ echo a > a/2.a
603 $ echo aaaaaa > 1.b
603 $ echo aaaaaa > 1.b
604 $ echo a > 2.b
604 $ echo a > 2.b
605 $ echo a > 1.c
605 $ echo a > 1.c
606 $ mkdir d
606 $ mkdir d
607 $ echo a > d/c.c
607 $ echo a > d/c.c
608 $ echo a > d/d.c
608 $ echo a > d/d.c
609 $ echo aaaaaaaaaaaa > x
609 $ echo aaaaaaaaaaaa > x
610 $ hg add . -q
610 $ hg add . -q
611 $ hg commit -m files
611 $ hg commit -m files
612
612
613 $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do
613 $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do
614 > if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then
614 > if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then
615 > echo "${p}: is lfs"
615 > echo "${p}: is lfs"
616 > else
616 > else
617 > echo "${p}: not lfs"
617 > echo "${p}: not lfs"
618 > fi
618 > fi
619 > done
619 > done
620 a/1.a: is lfs
620 a/1.a: is lfs
621 a/2.a: not lfs
621 a/2.a: not lfs
622 1.b: not lfs
622 1.b: not lfs
623 2.b: is lfs
623 2.b: is lfs
624 1.c: not lfs
624 1.c: not lfs
625 d/c.c: not lfs
625 d/c.c: not lfs
626 d/d.c: is lfs
626 d/d.c: is lfs
627 x: is lfs
627 x: is lfs
628
628
629 $ cd ..
629 $ cd ..
630
630
631 # Verify the repos
631 # Verify the repos
632
632
633 $ cat > $TESTTMP/dumpflog.py << EOF
633 $ cat > $TESTTMP/dumpflog.py << EOF
634 > # print raw revision sizes, flags, and hashes for certain files
634 > # print raw revision sizes, flags, and hashes for certain files
635 > import hashlib
635 > import hashlib
636 > from mercurial.node import short
636 > from mercurial.node import short
637 > from mercurial import revlog
637 > from mercurial import revlog
638 > def hash(rawtext):
638 > def hash(rawtext):
639 > h = hashlib.sha512()
639 > h = hashlib.sha512()
640 > h.update(rawtext)
640 > h.update(rawtext)
641 > return h.hexdigest()[:4]
641 > return h.hexdigest()[:4]
642 > def reposetup(ui, repo):
642 > def reposetup(ui, repo):
643 > # these 2 files are interesting
643 > # these 2 files are interesting
644 > for name in ['l', 's']:
644 > for name in ['l', 's']:
645 > fl = repo.file(name)
645 > fl = repo.file(name)
646 > if len(fl) == 0:
646 > if len(fl) == 0:
647 > continue
647 > continue
648 > sizes = [fl.rawsize(i) for i in fl]
648 > sizes = [fl.rawsize(i) for i in fl]
649 > texts = [fl.revision(i, raw=True) for i in fl]
649 > texts = [fl.revision(i, raw=True) for i in fl]
650 > flags = [int(fl.flags(i)) for i in fl]
650 > flags = [int(fl.flags(i)) for i in fl]
651 > hashes = [hash(t) for t in texts]
651 > hashes = [hash(t) for t in texts]
652 > print(' %s: rawsizes=%r flags=%r hashes=%r'
652 > print(' %s: rawsizes=%r flags=%r hashes=%r'
653 > % (name, sizes, flags, hashes))
653 > % (name, sizes, flags, hashes))
654 > EOF
654 > EOF
655
655
656 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
656 $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
657 > repo10; do
657 > repo10; do
658 > echo 'repo:' $i
658 > echo 'repo:' $i
659 > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
659 > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
660 > done
660 > done
661 repo: client
661 repo: client
662 repo: client2
662 repo: client2
663 repo: server
663 repo: server
664 repo: repo3
664 repo: repo3
665 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
665 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
666 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
666 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
667 repo: repo4
667 repo: repo4
668 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
668 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
669 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
669 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
670 repo: repo5
670 repo: repo5
671 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
671 l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
672 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
672 s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
673 repo: repo6
673 repo: repo6
674 repo: repo7
674 repo: repo7
675 repo: repo8
675 repo: repo8
676 repo: repo9
676 repo: repo9
677 repo: repo10
677 repo: repo10
678
678
679 repo13 doesn't have any cached lfs files and its source never pushed its
679 repo13 doesn't have any cached lfs files and its source never pushed its
680 files. Therefore, the files don't exist in the remote store. Use the files in
680 files. Therefore, the files don't exist in the remote store. Use the files in
681 the user cache.
681 the user cache.
682
682
683 $ test -d $TESTTMP/repo13/.hg/store/lfs/objects
683 $ test -d $TESTTMP/repo13/.hg/store/lfs/objects
684 [1]
684 [1]
685
685
686 $ hg --config extensions.share= share repo13 repo14
686 $ hg --config extensions.share= share repo13 repo14
687 updating working directory
687 updating working directory
688 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
688 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
689 $ hg -R repo14 -q verify
689 $ hg -R repo14 -q verify
690
690
691 $ hg clone repo13 repo15
691 $ hg clone repo13 repo15
692 updating to branch default
692 updating to branch default
693 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 $ hg -R repo15 -q verify
694 $ hg -R repo15 -q verify
695
695
696 If the source repo doesn't have the blob (maybe it was pulled or cloned with
696 If the source repo doesn't have the blob (maybe it was pulled or cloned with
697 --noupdate), the blob is still accessible via the global cache to send to the
697 --noupdate), the blob is still accessible via the global cache to send to the
698 remote store.
698 remote store.
699
699
700 $ rm -rf $TESTTMP/repo15/.hg/store/lfs
700 $ rm -rf $TESTTMP/repo15/.hg/store/lfs
701 $ hg init repo16
701 $ hg init repo16
702 $ hg -R repo15 push repo16
702 $ hg -R repo15 push repo16
703 pushing to repo16
703 pushing to repo16
704 searching for changes
704 searching for changes
705 adding changesets
705 adding changesets
706 adding manifests
706 adding manifests
707 adding file changes
707 adding file changes
708 added 3 changesets with 2 changes to 1 files
708 added 3 changesets with 2 changes to 1 files
709 $ hg -R repo15 -q verify
709 $ hg -R repo15 -q verify
710
710
711 Test damaged file scenarios. (This also damages the usercache because of the
711 Test damaged file scenarios. (This also damages the usercache because of the
712 hardlinks.)
712 hardlinks.)
713
713
714 $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
714 $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
715
715
716 Repo with damaged lfs objects in any revision will fail verification.
716 Repo with damaged lfs objects in any revision will fail verification.
717
717
718 $ hg -R repo5 verify
718 $ hg -R repo5 verify
719 checking changesets
719 checking changesets
720 checking manifests
720 checking manifests
721 crosschecking files in changesets and manifests
721 crosschecking files in changesets and manifests
722 checking files
722 checking files
723 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
723 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
724 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
724 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
725 4 files, 5 changesets, 10 total revisions
725 checked 5 changesets with 10 changes to 4 files
726 2 integrity errors encountered!
726 2 integrity errors encountered!
727 (first damaged changeset appears to be 0)
727 (first damaged changeset appears to be 0)
728 [1]
728 [1]
729
729
730 Updates work after cloning a damaged repo, if the damaged lfs objects aren't in
730 Updates work after cloning a damaged repo, if the damaged lfs objects aren't in
731 the update destination. Those objects won't be added to the new repo's store
731 the update destination. Those objects won't be added to the new repo's store
732 because they aren't accessed.
732 because they aren't accessed.
733
733
734 $ hg clone -v repo5 fromcorrupt
734 $ hg clone -v repo5 fromcorrupt
735 updating to branch default
735 updating to branch default
736 resolving manifests
736 resolving manifests
737 getting l
737 getting l
738 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache
738 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache
739 getting s
739 getting s
740 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
740 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
741 $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
742 [1]
742 [1]
743
743
744 Verify will copy/link all lfs objects into the local store that aren't already
744 Verify will copy/link all lfs objects into the local store that aren't already
745 present. Bypass the corrupted usercache to show that verify works when fed by
745 present. Bypass the corrupted usercache to show that verify works when fed by
746 the (uncorrupted) remote store.
746 the (uncorrupted) remote store.
747
747
748 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
748 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
749 repository uses revlog format 1
749 repository uses revlog format 1
750 checking changesets
750 checking changesets
751 checking manifests
751 checking manifests
752 crosschecking files in changesets and manifests
752 crosschecking files in changesets and manifests
753 checking files
753 checking files
754 lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
754 lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
755 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
755 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
756 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
756 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
757 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
757 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
758 lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
758 lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
759 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
759 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
760 lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
760 lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
761 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
761 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
762 4 files, 5 changesets, 10 total revisions
762 checked 5 changesets with 10 changes to 4 files
763
763
764 Verify will not copy/link a corrupted file from the usercache into the local
764 Verify will not copy/link a corrupted file from the usercache into the local
765 store, and poison it. (The verify with a good remote now works.)
765 store, and poison it. (The verify with a good remote now works.)
766
766
767 $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
767 $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
768 $ hg -R fromcorrupt verify -v
768 $ hg -R fromcorrupt verify -v
769 repository uses revlog format 1
769 repository uses revlog format 1
770 checking changesets
770 checking changesets
771 checking manifests
771 checking manifests
772 crosschecking files in changesets and manifests
772 crosschecking files in changesets and manifests
773 checking files
773 checking files
774 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
774 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
775 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
775 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
776 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
776 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
777 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
777 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
778 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
778 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
779 4 files, 5 changesets, 10 total revisions
779 checked 5 changesets with 10 changes to 4 files
780 2 integrity errors encountered!
780 2 integrity errors encountered!
781 (first damaged changeset appears to be 0)
781 (first damaged changeset appears to be 0)
782 [1]
782 [1]
783 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
783 $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
784 repository uses revlog format 1
784 repository uses revlog format 1
785 checking changesets
785 checking changesets
786 checking manifests
786 checking manifests
787 crosschecking files in changesets and manifests
787 crosschecking files in changesets and manifests
788 checking files
788 checking files
789 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache
789 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache
790 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
790 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
791 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
791 lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
792 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
792 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
793 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
793 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
794 4 files, 5 changesets, 10 total revisions
794 checked 5 changesets with 10 changes to 4 files
795
795
796 Damaging a file required by the update destination fails the update.
796 Damaging a file required by the update destination fails the update.
797
797
798 $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
798 $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
799 $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2
799 $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2
800 updating to branch default
800 updating to branch default
801 resolving manifests
801 resolving manifests
802 abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
802 abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
803 [255]
803 [255]
804
804
805 A corrupted lfs blob is not transferred from a file://remotestore to the
805 A corrupted lfs blob is not transferred from a file://remotestore to the
806 usercache or local store.
806 usercache or local store.
807
807
808 $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
808 $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
809 [1]
809 [1]
810 $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
810 $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
811 [1]
811 [1]
812
812
813 $ hg -R fromcorrupt2 verify
813 $ hg -R fromcorrupt2 verify
814 checking changesets
814 checking changesets
815 checking manifests
815 checking manifests
816 crosschecking files in changesets and manifests
816 crosschecking files in changesets and manifests
817 checking files
817 checking files
818 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
818 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
819 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
819 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
820 4 files, 5 changesets, 10 total revisions
820 checked 5 changesets with 10 changes to 4 files
821 2 integrity errors encountered!
821 2 integrity errors encountered!
822 (first damaged changeset appears to be 0)
822 (first damaged changeset appears to be 0)
823 [1]
823 [1]
824
824
825 Corrupt local files are not sent upstream. (The alternate dummy remote
825 Corrupt local files are not sent upstream. (The alternate dummy remote
826 avoids the corrupt lfs object in the original remote.)
826 avoids the corrupt lfs object in the original remote.)
827
827
828 $ mkdir $TESTTMP/dummy-remote2
828 $ mkdir $TESTTMP/dummy-remote2
829 $ hg init dest
829 $ hg init dest
830 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest
830 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest
831 pushing to dest
831 pushing to dest
832 searching for changes
832 searching for changes
833 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
833 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
834 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
834 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
835 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
835 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
836 abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
836 abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
837 (run hg verify)
837 (run hg verify)
838 [255]
838 [255]
839
839
840 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v
840 $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v
841 repository uses revlog format 1
841 repository uses revlog format 1
842 checking changesets
842 checking changesets
843 checking manifests
843 checking manifests
844 crosschecking files in changesets and manifests
844 crosschecking files in changesets and manifests
845 checking files
845 checking files
846 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
846 l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
847 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
847 lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
848 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
848 large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
849 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
849 lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
850 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
850 lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
851 4 files, 5 changesets, 10 total revisions
851 checked 5 changesets with 10 changes to 4 files
852 2 integrity errors encountered!
852 2 integrity errors encountered!
853 (first damaged changeset appears to be 0)
853 (first damaged changeset appears to be 0)
854 [1]
854 [1]
855
855
856 $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
856 $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
857 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
857 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
858 $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
858 $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
859 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
859 sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
860 $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
860 $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
861 [1]
861 [1]
862
862
863 Accessing a corrupt file will complain
863 Accessing a corrupt file will complain
864
864
865 $ hg --cwd fromcorrupt2 cat -r 0 large
865 $ hg --cwd fromcorrupt2 cat -r 0 large
866 abort: integrity check failed on data/large.i:0!
866 abort: integrity check failed on data/large.i:0!
867 [255]
867 [255]
868
868
869 lfs -> normal -> lfs round trip conversions are possible. The 'none()'
869 lfs -> normal -> lfs round trip conversions are possible. The 'none()'
870 predicate on the command line will override whatever is configured globally and
870 predicate on the command line will override whatever is configured globally and
871 locally, and ensures everything converts to a regular file. For lfs -> normal,
871 locally, and ensures everything converts to a regular file. For lfs -> normal,
872 there's no 'lfs' destination repo requirement. For normal -> lfs, there is.
872 there's no 'lfs' destination repo requirement. For normal -> lfs, there is.
873
873
874 $ hg --config extensions.convert= --config 'lfs.track=none()' \
874 $ hg --config extensions.convert= --config 'lfs.track=none()' \
875 > convert repo8 convert_normal
875 > convert repo8 convert_normal
876 initializing destination convert_normal repository
876 initializing destination convert_normal repository
877 scanning source...
877 scanning source...
878 sorting...
878 sorting...
879 converting...
879 converting...
880 2 a
880 2 a
881 1 b
881 1 b
882 0 meta
882 0 meta
883 $ grep 'lfs' convert_normal/.hg/requires
883 $ grep 'lfs' convert_normal/.hg/requires
884 [1]
884 [1]
885 $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
885 $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
886 THIS-IS-LFS-BECAUSE-10-BYTES
886 THIS-IS-LFS-BECAUSE-10-BYTES
887
887
888 $ hg --config extensions.convert= --config lfs.threshold=10B \
888 $ hg --config extensions.convert= --config lfs.threshold=10B \
889 > convert convert_normal convert_lfs
889 > convert convert_normal convert_lfs
890 initializing destination convert_lfs repository
890 initializing destination convert_lfs repository
891 scanning source...
891 scanning source...
892 sorting...
892 sorting...
893 converting...
893 converting...
894 2 a
894 2 a
895 1 b
895 1 b
896 0 meta
896 0 meta
897
897
898 $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
898 $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
899 version https://git-lfs.github.com/spec/v1
899 version https://git-lfs.github.com/spec/v1
900 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
900 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
901 size 29
901 size 29
902 x-is-binary 0
902 x-is-binary 0
903 $ hg --cwd convert_lfs debugdata a1 0
903 $ hg --cwd convert_lfs debugdata a1 0
904 version https://git-lfs.github.com/spec/v1
904 version https://git-lfs.github.com/spec/v1
905 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
905 oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
906 size 29
906 size 29
907 x-is-binary 0
907 x-is-binary 0
908 $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}"
908 $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}"
909 version=https://git-lfs.github.com/spec/v1
909 version=https://git-lfs.github.com/spec/v1
910 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
910 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
911 size=29
911 size=29
912 x-is-binary=0
912 x-is-binary=0
913 $ hg --cwd convert_lfs log -r 0 \
913 $ hg --cwd convert_lfs log -r 0 \
914 > -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}'
914 > -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}'
915 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
915 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
916 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
916 sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
917 $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}'
917 $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}'
918 version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
918 version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
919 $ hg --cwd convert_lfs \
919 $ hg --cwd convert_lfs \
920 > log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
920 > log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
921 0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
921 0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
922 1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
922 1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
923 2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
923 2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
924
924
925 $ grep 'lfs' convert_lfs/.hg/requires
925 $ grep 'lfs' convert_lfs/.hg/requires
926 lfs
926 lfs
927
927
928 The hashes in all stages of the conversion are unchanged.
928 The hashes in all stages of the conversion are unchanged.
929
929
930 $ hg -R repo8 log -T '{node|short}\n'
930 $ hg -R repo8 log -T '{node|short}\n'
931 0fae949de7fa
931 0fae949de7fa
932 9cd6bdffdac0
932 9cd6bdffdac0
933 7f96794915f7
933 7f96794915f7
934 $ hg -R convert_normal log -T '{node|short}\n'
934 $ hg -R convert_normal log -T '{node|short}\n'
935 0fae949de7fa
935 0fae949de7fa
936 9cd6bdffdac0
936 9cd6bdffdac0
937 7f96794915f7
937 7f96794915f7
938 $ hg -R convert_lfs log -T '{node|short}\n'
938 $ hg -R convert_lfs log -T '{node|short}\n'
939 0fae949de7fa
939 0fae949de7fa
940 9cd6bdffdac0
940 9cd6bdffdac0
941 7f96794915f7
941 7f96794915f7
942
942
943 This convert is trickier, because it contains deleted files (via `hg mv`)
943 This convert is trickier, because it contains deleted files (via `hg mv`)
944
944
945 $ hg --config extensions.convert= --config lfs.threshold=1000M \
945 $ hg --config extensions.convert= --config lfs.threshold=1000M \
946 > convert repo3 convert_normal2
946 > convert repo3 convert_normal2
947 initializing destination convert_normal2 repository
947 initializing destination convert_normal2 repository
948 scanning source...
948 scanning source...
949 sorting...
949 sorting...
950 converting...
950 converting...
951 4 commit with lfs content
951 4 commit with lfs content
952 3 renames
952 3 renames
953 2 large to small, small to large
953 2 large to small, small to large
954 1 random modifications
954 1 random modifications
955 0 switch large and small again
955 0 switch large and small again
956 $ grep 'lfs' convert_normal2/.hg/requires
956 $ grep 'lfs' convert_normal2/.hg/requires
957 [1]
957 [1]
958 $ hg --cwd convert_normal2 debugdata large 0
958 $ hg --cwd convert_normal2 debugdata large 0
959 LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
959 LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
960
960
961 $ hg --config extensions.convert= --config lfs.threshold=10B \
961 $ hg --config extensions.convert= --config lfs.threshold=10B \
962 > convert convert_normal2 convert_lfs2
962 > convert convert_normal2 convert_lfs2
963 initializing destination convert_lfs2 repository
963 initializing destination convert_lfs2 repository
964 scanning source...
964 scanning source...
965 sorting...
965 sorting...
966 converting...
966 converting...
967 4 commit with lfs content
967 4 commit with lfs content
968 3 renames
968 3 renames
969 2 large to small, small to large
969 2 large to small, small to large
970 1 random modifications
970 1 random modifications
971 0 switch large and small again
971 0 switch large and small again
972 $ grep 'lfs' convert_lfs2/.hg/requires
972 $ grep 'lfs' convert_lfs2/.hg/requires
973 lfs
973 lfs
974 $ hg --cwd convert_lfs2 debugdata large 0
974 $ hg --cwd convert_lfs2 debugdata large 0
975 version https://git-lfs.github.com/spec/v1
975 version https://git-lfs.github.com/spec/v1
976 oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
976 oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
977 size 39
977 size 39
978 x-is-binary 0
978 x-is-binary 0
979
979
980 $ hg -R convert_lfs2 config --debug extensions | grep lfs
980 $ hg -R convert_lfs2 config --debug extensions | grep lfs
981 $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
981 $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
982
982
983 Committing deleted files works:
983 Committing deleted files works:
984
984
985 $ hg init $TESTTMP/repo-del
985 $ hg init $TESTTMP/repo-del
986 $ cd $TESTTMP/repo-del
986 $ cd $TESTTMP/repo-del
987 $ echo 1 > A
987 $ echo 1 > A
988 $ hg commit -m 'add A' -A A
988 $ hg commit -m 'add A' -A A
989 $ hg rm A
989 $ hg rm A
990 $ hg commit -m 'rm A'
990 $ hg commit -m 'rm A'
991
991
992 Bad .hglfs files will block the commit with a useful message
992 Bad .hglfs files will block the commit with a useful message
993
993
994 $ cat > .hglfs << EOF
994 $ cat > .hglfs << EOF
995 > [track]
995 > [track]
996 > **.test = size(">5B")
996 > **.test = size(">5B")
997 > bad file ... no commit
997 > bad file ... no commit
998 > EOF
998 > EOF
999
999
1000 $ echo x > file.txt
1000 $ echo x > file.txt
1001 $ hg ci -Aqm 'should fail'
1001 $ hg ci -Aqm 'should fail'
1002 hg: parse error at .hglfs:3: bad file ... no commit
1002 hg: parse error at .hglfs:3: bad file ... no commit
1003 [255]
1003 [255]
1004
1004
1005 $ cat > .hglfs << EOF
1005 $ cat > .hglfs << EOF
1006 > [track]
1006 > [track]
1007 > **.test = size(">5B")
1007 > **.test = size(">5B")
1008 > ** = nonexistent()
1008 > ** = nonexistent()
1009 > EOF
1009 > EOF
1010
1010
1011 $ hg ci -Aqm 'should fail'
1011 $ hg ci -Aqm 'should fail'
1012 abort: parse error in .hglfs: unknown identifier: nonexistent
1012 abort: parse error in .hglfs: unknown identifier: nonexistent
1013 [255]
1013 [255]
1014
1014
1015 '**' works out to mean all files.
1015 '**' works out to mean all files.
1016
1016
1017 $ cat > .hglfs << EOF
1017 $ cat > .hglfs << EOF
1018 > [track]
1018 > [track]
1019 > path:.hglfs = none()
1019 > path:.hglfs = none()
1020 > **.test = size(">5B")
1020 > **.test = size(">5B")
1021 > **.exclude = none()
1021 > **.exclude = none()
1022 > ** = size(">10B")
1022 > ** = size(">10B")
1023 > EOF
1023 > EOF
1024
1024
1025 The LFS policy takes effect without tracking the .hglfs file
1025 The LFS policy takes effect without tracking the .hglfs file
1026
1026
1027 $ echo 'largefile' > lfs.test
1027 $ echo 'largefile' > lfs.test
1028 $ echo '012345678901234567890' > nolfs.exclude
1028 $ echo '012345678901234567890' > nolfs.exclude
1029 $ echo '01234567890123456' > lfs.catchall
1029 $ echo '01234567890123456' > lfs.catchall
1030 $ hg add *
1030 $ hg add *
1031 $ hg ci -qm 'before add .hglfs'
1031 $ hg ci -qm 'before add .hglfs'
1032 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1032 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1033 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1033 2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1034 lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1034 lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1035
1035
1036 The .hglfs file works when tracked
1036 The .hglfs file works when tracked
1037
1037
1038 $ echo 'largefile2' > lfs.test
1038 $ echo 'largefile2' > lfs.test
1039 $ echo '012345678901234567890a' > nolfs.exclude
1039 $ echo '012345678901234567890a' > nolfs.exclude
1040 $ echo '01234567890123456a' > lfs.catchall
1040 $ echo '01234567890123456a' > lfs.catchall
1041 $ hg ci -Aqm 'after adding .hglfs'
1041 $ hg ci -Aqm 'after adding .hglfs'
1042 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1042 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1043 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1043 3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1044 lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1044 lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1045
1045
1046 The LFS policy stops when the .hglfs is gone
1046 The LFS policy stops when the .hglfs is gone
1047
1047
1048 $ mv .hglfs .hglfs_
1048 $ mv .hglfs .hglfs_
1049 $ echo 'largefile3' > lfs.test
1049 $ echo 'largefile3' > lfs.test
1050 $ echo '012345678901234567890abc' > nolfs.exclude
1050 $ echo '012345678901234567890abc' > nolfs.exclude
1051 $ echo '01234567890123456abc' > lfs.catchall
1051 $ echo '01234567890123456abc' > lfs.catchall
1052 $ hg ci -qm 'file test' -X .hglfs
1052 $ hg ci -qm 'file test' -X .hglfs
1053 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1053 $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
1054 4:
1054 4:
1055
1055
1056 $ mv .hglfs_ .hglfs
1056 $ mv .hglfs_ .hglfs
1057 $ echo '012345678901234567890abc' > lfs.test
1057 $ echo '012345678901234567890abc' > lfs.test
1058 $ hg ci -m 'back to lfs'
1058 $ hg ci -m 'back to lfs'
1059 $ hg rm lfs.test
1059 $ hg rm lfs.test
1060 $ hg ci -qm 'remove lfs'
1060 $ hg ci -qm 'remove lfs'
1061
1061
1062 {lfs_files} will list deleted files too
1062 {lfs_files} will list deleted files too
1063
1063
1064 $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
1064 $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
1065 6 lfs.test:
1065 6 lfs.test:
1066 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
1066 5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
1067 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1067 3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1068 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1068 3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1069 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1069 2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1070 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1070 2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1071
1071
1072 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1072 $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
1073 2 lfs.catchall, lfs.test
1073 2 lfs.catchall, lfs.test
1074 3 lfs.catchall, lfs.test
1074 3 lfs.catchall, lfs.test
1075 5 lfs.test
1075 5 lfs.test
1076 6 lfs.test
1076 6 lfs.test
1077
1077
1078 $ cd ..
1078 $ cd ..
1079
1079
1080 Unbundling adds a requirement to a non-lfs repo, if necessary.
1080 Unbundling adds a requirement to a non-lfs repo, if necessary.
1081
1081
1082 $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg
1082 $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg
1083 $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg
1083 $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg
1084 $ hg init unbundle
1084 $ hg init unbundle
1085 $ hg pull -R unbundle -q nolfs.hg
1085 $ hg pull -R unbundle -q nolfs.hg
1086 $ grep lfs unbundle/.hg/requires
1086 $ grep lfs unbundle/.hg/requires
1087 [1]
1087 [1]
1088 $ hg pull -R unbundle -q lfs.hg
1088 $ hg pull -R unbundle -q lfs.hg
1089 $ grep lfs unbundle/.hg/requires
1089 $ grep lfs unbundle/.hg/requires
1090 lfs
1090 lfs
1091
1091
1092 $ hg init no_lfs
1092 $ hg init no_lfs
1093 $ cat >> no_lfs/.hg/hgrc <<EOF
1093 $ cat >> no_lfs/.hg/hgrc <<EOF
1094 > [experimental]
1094 > [experimental]
1095 > changegroup3 = True
1095 > changegroup3 = True
1096 > [extensions]
1096 > [extensions]
1097 > lfs=!
1097 > lfs=!
1098 > EOF
1098 > EOF
1099 $ cp -R no_lfs no_lfs2
1099 $ cp -R no_lfs no_lfs2
1100
1100
1101 Pushing from a local lfs repo to a local repo without an lfs requirement and
1101 Pushing from a local lfs repo to a local repo without an lfs requirement and
1102 with lfs disabled, fails.
1102 with lfs disabled, fails.
1103
1103
1104 $ hg push -R convert_lfs2 no_lfs
1104 $ hg push -R convert_lfs2 no_lfs
1105 pushing to no_lfs
1105 pushing to no_lfs
1106 abort: required features are not supported in the destination: lfs
1106 abort: required features are not supported in the destination: lfs
1107 [255]
1107 [255]
1108 $ grep lfs no_lfs/.hg/requires
1108 $ grep lfs no_lfs/.hg/requires
1109 [1]
1109 [1]
1110
1110
1111 Pulling from a local lfs repo to a local repo without an lfs requirement and
1111 Pulling from a local lfs repo to a local repo without an lfs requirement and
1112 with lfs disabled, fails.
1112 with lfs disabled, fails.
1113
1113
1114 $ hg pull -R no_lfs2 convert_lfs2
1114 $ hg pull -R no_lfs2 convert_lfs2
1115 pulling from convert_lfs2
1115 pulling from convert_lfs2
1116 abort: required features are not supported in the destination: lfs
1116 abort: required features are not supported in the destination: lfs
1117 [255]
1117 [255]
1118 $ grep lfs no_lfs2/.hg/requires
1118 $ grep lfs no_lfs2/.hg/requires
1119 [1]
1119 [1]
@@ -1,210 +1,210 b''
1
1
2 $ . "$TESTDIR/narrow-library.sh"
2 $ . "$TESTDIR/narrow-library.sh"
3
3
4 create full repo
4 create full repo
5
5
6 $ hg init master
6 $ hg init master
7 $ cd master
7 $ cd master
8 $ cat >> .hg/hgrc <<EOF
8 $ cat >> .hg/hgrc <<EOF
9 > [narrow]
9 > [narrow]
10 > serveellipses=True
10 > serveellipses=True
11 > EOF
11 > EOF
12
12
13 $ mkdir inside
13 $ mkdir inside
14 $ echo 1 > inside/f
14 $ echo 1 > inside/f
15 $ mkdir inside2
15 $ mkdir inside2
16 $ echo 1 > inside2/f
16 $ echo 1 > inside2/f
17 $ mkdir outside
17 $ mkdir outside
18 $ echo 1 > outside/f
18 $ echo 1 > outside/f
19 $ hg ci -Aqm 'initial'
19 $ hg ci -Aqm 'initial'
20
20
21 $ echo 2 > inside/f
21 $ echo 2 > inside/f
22 $ hg ci -qm 'inside 2'
22 $ hg ci -qm 'inside 2'
23
23
24 $ echo 2 > inside2/f
24 $ echo 2 > inside2/f
25 $ hg ci -qm 'inside2 2'
25 $ hg ci -qm 'inside2 2'
26
26
27 $ echo 2 > outside/f
27 $ echo 2 > outside/f
28 $ hg ci -qm 'outside 2'
28 $ hg ci -qm 'outside 2'
29
29
30 $ cd ..
30 $ cd ..
31
31
32 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
32 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
33 requesting all changes
33 requesting all changes
34 adding changesets
34 adding changesets
35 adding manifests
35 adding manifests
36 adding file changes
36 adding file changes
37 added 3 changesets with 2 changes to 1 files
37 added 3 changesets with 2 changes to 1 files
38 new changesets *:* (glob)
38 new changesets *:* (glob)
39 updating to branch default
39 updating to branch default
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41
41
42 $ hg clone --narrow ssh://user@dummy/master narrow2 --include inside --include inside2
42 $ hg clone --narrow ssh://user@dummy/master narrow2 --include inside --include inside2
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 4 changesets with 4 changes to 2 files
47 added 4 changesets with 4 changes to 2 files
48 new changesets *:* (glob)
48 new changesets *:* (glob)
49 updating to branch default
49 updating to branch default
50 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
51
51
52 Can push to wider repo if change does not affect paths in wider repo that are
52 Can push to wider repo if change does not affect paths in wider repo that are
53 not also in narrower repo
53 not also in narrower repo
54
54
55 $ cd narrow
55 $ cd narrow
56 $ echo 3 > inside/f
56 $ echo 3 > inside/f
57 $ hg ci -m 'inside 3'
57 $ hg ci -m 'inside 3'
58 $ hg push ssh://user@dummy/narrow2
58 $ hg push ssh://user@dummy/narrow2
59 pushing to ssh://user@dummy/narrow2
59 pushing to ssh://user@dummy/narrow2
60 searching for changes
60 searching for changes
61 remote: adding changesets
61 remote: adding changesets
62 remote: adding manifests
62 remote: adding manifests
63 remote: adding file changes
63 remote: adding file changes
64 remote: added 1 changesets with 1 changes to 1 files
64 remote: added 1 changesets with 1 changes to 1 files
65
65
66 Can push to narrower repo if change affects only paths within remote's
66 Can push to narrower repo if change affects only paths within remote's
67 narrow spec
67 narrow spec
68
68
69 $ cd ../narrow2
69 $ cd ../narrow2
70 $ cat >> .hg/hgrc <<EOF
70 $ cat >> .hg/hgrc <<EOF
71 > [narrow]
71 > [narrow]
72 > serveellipses=True
72 > serveellipses=True
73 > EOF
73 > EOF
74 $ hg co -r 'desc("inside 3")'
74 $ hg co -r 'desc("inside 3")'
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 $ echo 4 > inside/f
76 $ echo 4 > inside/f
77 $ hg ci -m 'inside 4'
77 $ hg ci -m 'inside 4'
78 $ hg push ssh://user@dummy/narrow
78 $ hg push ssh://user@dummy/narrow
79 pushing to ssh://user@dummy/narrow
79 pushing to ssh://user@dummy/narrow
80 searching for changes
80 searching for changes
81 remote: adding changesets
81 remote: adding changesets
82 remote: adding manifests
82 remote: adding manifests
83 remote: adding file changes
83 remote: adding file changes
84 remote: added 1 changesets with 1 changes to 1 files
84 remote: added 1 changesets with 1 changes to 1 files
85
85
86 Can push to narrow repo if change affects only paths outside remote's
86 Can push to narrow repo if change affects only paths outside remote's
87 narrow spec
87 narrow spec
88
88
89 $ echo 3 > inside2/f
89 $ echo 3 > inside2/f
90 $ hg ci -m 'inside2 3'
90 $ hg ci -m 'inside2 3'
91 TODO: this should be successful
91 TODO: this should be successful
92 $ hg push ssh://user@dummy/narrow
92 $ hg push ssh://user@dummy/narrow
93 pushing to ssh://user@dummy/narrow
93 pushing to ssh://user@dummy/narrow
94 searching for changes
94 searching for changes
95 remote: adding changesets
95 remote: adding changesets
96 remote: adding manifests
96 remote: adding manifests
97 remote: adding file changes
97 remote: adding file changes
98 remote: transaction abort!
98 remote: transaction abort!
99 remote: rollback completed
99 remote: rollback completed
100 remote: abort: data/inside2/f.i@4a1aa07735e6: unknown parent! (reporevlogstore !)
100 remote: abort: data/inside2/f.i@4a1aa07735e6: unknown parent! (reporevlogstore !)
101 remote: abort: data/inside2/f/index@4a1aa07735e6: no node! (reposimplestore !)
101 remote: abort: data/inside2/f/index@4a1aa07735e6: no node! (reposimplestore !)
102 abort: stream ended unexpectedly (got 0 bytes, expected 4)
102 abort: stream ended unexpectedly (got 0 bytes, expected 4)
103 [255]
103 [255]
104
104
105 Can pull from wider repo if change affects only paths outside remote's
105 Can pull from wider repo if change affects only paths outside remote's
106 narrow spec
106 narrow spec
107 $ echo 4 > inside2/f
107 $ echo 4 > inside2/f
108 $ hg ci -m 'inside2 4'
108 $ hg ci -m 'inside2 4'
109 $ hg log -G -T '{rev} {node|short} {files}\n'
109 $ hg log -G -T '{rev} {node|short} {files}\n'
110 @ 7 d78a96df731d inside2/f
110 @ 7 d78a96df731d inside2/f
111 |
111 |
112 o 6 8c26f5218962 inside2/f
112 o 6 8c26f5218962 inside2/f
113 |
113 |
114 o 5 ba3480e2f9de inside/f
114 o 5 ba3480e2f9de inside/f
115 |
115 |
116 o 4 4e5edd526618 inside/f
116 o 4 4e5edd526618 inside/f
117 |
117 |
118 o 3 81e7e07b7ab0 outside/f
118 o 3 81e7e07b7ab0 outside/f
119 |
119 |
120 o 2 f3993b8c0c2b inside2/f
120 o 2 f3993b8c0c2b inside2/f
121 |
121 |
122 o 1 8cd66ca966b4 inside/f
122 o 1 8cd66ca966b4 inside/f
123 |
123 |
124 o 0 c8057d6f53ab inside/f inside2/f outside/f
124 o 0 c8057d6f53ab inside/f inside2/f outside/f
125
125
126 $ cd ../narrow
126 $ cd ../narrow
127 $ hg log -G -T '{rev} {node|short} {files}\n'
127 $ hg log -G -T '{rev} {node|short} {files}\n'
128 o 4 ba3480e2f9de inside/f
128 o 4 ba3480e2f9de inside/f
129 |
129 |
130 @ 3 4e5edd526618 inside/f
130 @ 3 4e5edd526618 inside/f
131 |
131 |
132 o 2 81e7e07b7ab0 outside/f
132 o 2 81e7e07b7ab0 outside/f
133 |
133 |
134 o 1 8cd66ca966b4 inside/f
134 o 1 8cd66ca966b4 inside/f
135 |
135 |
136 o 0 c8057d6f53ab inside/f inside2/f outside/f
136 o 0 c8057d6f53ab inside/f inside2/f outside/f
137
137
138 $ hg pull ssh://user@dummy/narrow2
138 $ hg pull ssh://user@dummy/narrow2
139 pulling from ssh://user@dummy/narrow2
139 pulling from ssh://user@dummy/narrow2
140 searching for changes
140 searching for changes
141 adding changesets
141 adding changesets
142 adding manifests
142 adding manifests
143 adding file changes
143 adding file changes
144 added 1 changesets with 0 changes to 0 files
144 added 1 changesets with 0 changes to 0 files
145 new changesets d78a96df731d
145 new changesets d78a96df731d
146 (run 'hg update' to get a working copy)
146 (run 'hg update' to get a working copy)
147
147
148 Check that the resulting history is valid in the full repo
148 Check that the resulting history is valid in the full repo
149
149
150 $ cd ../narrow2
150 $ cd ../narrow2
151 $ hg push ssh://user@dummy/master
151 $ hg push ssh://user@dummy/master
152 pushing to ssh://user@dummy/master
152 pushing to ssh://user@dummy/master
153 searching for changes
153 searching for changes
154 remote: adding changesets
154 remote: adding changesets
155 remote: adding manifests
155 remote: adding manifests
156 remote: adding file changes
156 remote: adding file changes
157 remote: added 4 changesets with 4 changes to 2 files
157 remote: added 4 changesets with 4 changes to 2 files
158 $ cd ../master
158 $ cd ../master
159 $ hg verify
159 $ hg verify
160 checking changesets
160 checking changesets
161 checking manifests
161 checking manifests
162 crosschecking files in changesets and manifests
162 crosschecking files in changesets and manifests
163 checking files
163 checking files
164 3 files, 8 changesets, 10 total revisions
164 checked 8 changesets with 10 changes to 3 files
165
165
166 Can not push to wider repo if change affects paths in wider repo that are
166 Can not push to wider repo if change affects paths in wider repo that are
167 not also in narrower repo
167 not also in narrower repo
168 $ cd ../master
168 $ cd ../master
169 $ hg co -r 'desc("inside2 4")'
169 $ hg co -r 'desc("inside2 4")'
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 $ echo 5 > inside2/f
171 $ echo 5 > inside2/f
172 $ hg ci -m 'inside2 5'
172 $ hg ci -m 'inside2 5'
173 $ hg log -G -T '{rev} {node|short} {files}\n'
173 $ hg log -G -T '{rev} {node|short} {files}\n'
174 @ 8 5970befb64ba inside2/f
174 @ 8 5970befb64ba inside2/f
175 |
175 |
176 o 7 d78a96df731d inside2/f
176 o 7 d78a96df731d inside2/f
177 |
177 |
178 o 6 8c26f5218962 inside2/f
178 o 6 8c26f5218962 inside2/f
179 |
179 |
180 o 5 ba3480e2f9de inside/f
180 o 5 ba3480e2f9de inside/f
181 |
181 |
182 o 4 4e5edd526618 inside/f
182 o 4 4e5edd526618 inside/f
183 |
183 |
184 o 3 81e7e07b7ab0 outside/f
184 o 3 81e7e07b7ab0 outside/f
185 |
185 |
186 o 2 f3993b8c0c2b inside2/f
186 o 2 f3993b8c0c2b inside2/f
187 |
187 |
188 o 1 8cd66ca966b4 inside/f
188 o 1 8cd66ca966b4 inside/f
189 |
189 |
190 o 0 c8057d6f53ab inside/f inside2/f outside/f
190 o 0 c8057d6f53ab inside/f inside2/f outside/f
191
191
192 $ cd ../narrow
192 $ cd ../narrow
193 $ hg pull
193 $ hg pull
194 pulling from ssh://user@dummy/master
194 pulling from ssh://user@dummy/master
195 searching for changes
195 searching for changes
196 adding changesets
196 adding changesets
197 adding manifests
197 adding manifests
198 adding file changes
198 adding file changes
199 added 1 changesets with 0 changes to 0 files
199 added 1 changesets with 0 changes to 0 files
200 new changesets * (glob)
200 new changesets * (glob)
201 (run 'hg update' to get a working copy)
201 (run 'hg update' to get a working copy)
202 TODO: this should tell the user that their narrow clone does not have the
202 TODO: this should tell the user that their narrow clone does not have the
203 necessary content to be able to push to the target
203 necessary content to be able to push to the target
204 $ hg push ssh://user@dummy/narrow2
204 $ hg push ssh://user@dummy/narrow2
205 pushing to ssh://user@dummy/narrow2
205 pushing to ssh://user@dummy/narrow2
206 searching for changes
206 searching for changes
207 remote: adding changesets
207 remote: adding changesets
208 remote: adding manifests
208 remote: adding manifests
209 remote: adding file changes
209 remote: adding file changes
210 remote: added 1 changesets with 0 changes to 0 files
210 remote: added 1 changesets with 0 changes to 0 files
@@ -1,174 +1,174 b''
1 $ . "$TESTDIR/narrow-library.sh"
1 $ . "$TESTDIR/narrow-library.sh"
2
2
3 $ hg init master
3 $ hg init master
4 $ cd master
4 $ cd master
5 $ cat >> .hg/hgrc <<EOF
5 $ cat >> .hg/hgrc <<EOF
6 > [narrow]
6 > [narrow]
7 > serveellipses=True
7 > serveellipses=True
8 > EOF
8 > EOF
9 $ for x in `$TESTDIR/seq.py 10`
9 $ for x in `$TESTDIR/seq.py 10`
10 > do
10 > do
11 > echo $x > "f$x"
11 > echo $x > "f$x"
12 > hg add "f$x"
12 > hg add "f$x"
13 > hg commit -m "Commit f$x"
13 > hg commit -m "Commit f$x"
14 > done
14 > done
15 $ cd ..
15 $ cd ..
16
16
17 narrow clone a couple files, f2 and f8
17 narrow clone a couple files, f2 and f8
18
18
19 $ hg clone --narrow ssh://user@dummy/master narrow --include "f2" --include "f8"
19 $ hg clone --narrow ssh://user@dummy/master narrow --include "f2" --include "f8"
20 requesting all changes
20 requesting all changes
21 adding changesets
21 adding changesets
22 adding manifests
22 adding manifests
23 adding file changes
23 adding file changes
24 added 5 changesets with 2 changes to 2 files
24 added 5 changesets with 2 changes to 2 files
25 new changesets *:* (glob)
25 new changesets *:* (glob)
26 updating to branch default
26 updating to branch default
27 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ cd narrow
28 $ cd narrow
29 $ ls
29 $ ls
30 f2
30 f2
31 f8
31 f8
32 $ cat f2 f8
32 $ cat f2 f8
33 2
33 2
34 8
34 8
35
35
36 $ cd ..
36 $ cd ..
37
37
38 change every upstream file twice
38 change every upstream file twice
39
39
40 $ cd master
40 $ cd master
41 $ for x in `$TESTDIR/seq.py 10`
41 $ for x in `$TESTDIR/seq.py 10`
42 > do
42 > do
43 > echo "update#1 $x" >> "f$x"
43 > echo "update#1 $x" >> "f$x"
44 > hg commit -m "Update#1 to f$x" "f$x"
44 > hg commit -m "Update#1 to f$x" "f$x"
45 > done
45 > done
46 $ for x in `$TESTDIR/seq.py 10`
46 $ for x in `$TESTDIR/seq.py 10`
47 > do
47 > do
48 > echo "update#2 $x" >> "f$x"
48 > echo "update#2 $x" >> "f$x"
49 > hg commit -m "Update#2 to f$x" "f$x"
49 > hg commit -m "Update#2 to f$x" "f$x"
50 > done
50 > done
51 $ cd ..
51 $ cd ..
52
52
53 look for incoming changes
53 look for incoming changes
54
54
55 $ cd narrow
55 $ cd narrow
56 $ hg incoming --limit 3
56 $ hg incoming --limit 3
57 comparing with ssh://user@dummy/master
57 comparing with ssh://user@dummy/master
58 searching for changes
58 searching for changes
59 changeset: 5:ddc055582556
59 changeset: 5:ddc055582556
60 user: test
60 user: test
61 date: Thu Jan 01 00:00:00 1970 +0000
61 date: Thu Jan 01 00:00:00 1970 +0000
62 summary: Update#1 to f1
62 summary: Update#1 to f1
63
63
64 changeset: 6:f66eb5ad621d
64 changeset: 6:f66eb5ad621d
65 user: test
65 user: test
66 date: Thu Jan 01 00:00:00 1970 +0000
66 date: Thu Jan 01 00:00:00 1970 +0000
67 summary: Update#1 to f2
67 summary: Update#1 to f2
68
68
69 changeset: 7:c42ecff04e99
69 changeset: 7:c42ecff04e99
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
72 summary: Update#1 to f3
72 summary: Update#1 to f3
73
73
74
74
75 Interrupting the pull is safe
75 Interrupting the pull is safe
76 $ hg --config hooks.pretxnchangegroup.bad=false pull -q
76 $ hg --config hooks.pretxnchangegroup.bad=false pull -q
77 transaction abort!
77 transaction abort!
78 rollback completed
78 rollback completed
79 abort: pretxnchangegroup.bad hook exited with status 1
79 abort: pretxnchangegroup.bad hook exited with status 1
80 [255]
80 [255]
81 $ hg id
81 $ hg id
82 223311e70a6f tip
82 223311e70a6f tip
83
83
84 pull new changes down to the narrow clone. Should get 8 new changesets: 4
84 pull new changes down to the narrow clone. Should get 8 new changesets: 4
85 relevant to the narrow spec, and 4 ellipsis nodes gluing them all together.
85 relevant to the narrow spec, and 4 ellipsis nodes gluing them all together.
86
86
87 $ hg pull
87 $ hg pull
88 pulling from ssh://user@dummy/master
88 pulling from ssh://user@dummy/master
89 searching for changes
89 searching for changes
90 adding changesets
90 adding changesets
91 adding manifests
91 adding manifests
92 adding file changes
92 adding file changes
93 added 9 changesets with 4 changes to 2 files
93 added 9 changesets with 4 changes to 2 files
94 new changesets *:* (glob)
94 new changesets *:* (glob)
95 (run 'hg update' to get a working copy)
95 (run 'hg update' to get a working copy)
96 $ hg log -T '{rev}: {desc}\n'
96 $ hg log -T '{rev}: {desc}\n'
97 13: Update#2 to f10
97 13: Update#2 to f10
98 12: Update#2 to f8
98 12: Update#2 to f8
99 11: Update#2 to f7
99 11: Update#2 to f7
100 10: Update#2 to f2
100 10: Update#2 to f2
101 9: Update#2 to f1
101 9: Update#2 to f1
102 8: Update#1 to f8
102 8: Update#1 to f8
103 7: Update#1 to f7
103 7: Update#1 to f7
104 6: Update#1 to f2
104 6: Update#1 to f2
105 5: Update#1 to f1
105 5: Update#1 to f1
106 4: Commit f10
106 4: Commit f10
107 3: Commit f8
107 3: Commit f8
108 2: Commit f7
108 2: Commit f7
109 1: Commit f2
109 1: Commit f2
110 0: Commit f1
110 0: Commit f1
111 $ hg update tip
111 $ hg update tip
112 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
112 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
113
113
114 add a change and push it
114 add a change and push it
115
115
116 $ echo "update#3 2" >> f2
116 $ echo "update#3 2" >> f2
117 $ hg commit -m "Update#3 to f2" f2
117 $ hg commit -m "Update#3 to f2" f2
118 $ hg log f2 -T '{rev}: {desc}\n'
118 $ hg log f2 -T '{rev}: {desc}\n'
119 14: Update#3 to f2
119 14: Update#3 to f2
120 10: Update#2 to f2
120 10: Update#2 to f2
121 6: Update#1 to f2
121 6: Update#1 to f2
122 1: Commit f2
122 1: Commit f2
123 $ hg push
123 $ hg push
124 pushing to ssh://user@dummy/master
124 pushing to ssh://user@dummy/master
125 searching for changes
125 searching for changes
126 remote: adding changesets
126 remote: adding changesets
127 remote: adding manifests
127 remote: adding manifests
128 remote: adding file changes
128 remote: adding file changes
129 remote: added 1 changesets with 1 changes to 1 files
129 remote: added 1 changesets with 1 changes to 1 files
130 $ cd ..
130 $ cd ..
131
131
132 $ cd master
132 $ cd master
133 $ hg log f2 -T '{rev}: {desc}\n'
133 $ hg log f2 -T '{rev}: {desc}\n'
134 30: Update#3 to f2
134 30: Update#3 to f2
135 21: Update#2 to f2
135 21: Update#2 to f2
136 11: Update#1 to f2
136 11: Update#1 to f2
137 1: Commit f2
137 1: Commit f2
138 $ hg log -l 3 -T '{rev}: {desc}\n'
138 $ hg log -l 3 -T '{rev}: {desc}\n'
139 30: Update#3 to f2
139 30: Update#3 to f2
140 29: Update#2 to f10
140 29: Update#2 to f10
141 28: Update#2 to f9
141 28: Update#2 to f9
142
142
143 Can pull into repo with a single commit
143 Can pull into repo with a single commit
144
144
145 $ cd ..
145 $ cd ..
146 $ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0
146 $ hg clone -q --narrow ssh://user@dummy/master narrow2 --include "f1" -r 0
147 $ cd narrow2
147 $ cd narrow2
148 $ hg pull -q -r 1
148 $ hg pull -q -r 1
149 transaction abort!
149 transaction abort!
150 rollback completed
150 rollback completed
151 abort: pull failed on remote
151 abort: pull failed on remote
152 [255]
152 [255]
153
153
154 Can use 'hg share':
154 Can use 'hg share':
155 $ cat >> $HGRCPATH <<EOF
155 $ cat >> $HGRCPATH <<EOF
156 > [extensions]
156 > [extensions]
157 > share=
157 > share=
158 > EOF
158 > EOF
159
159
160 $ cd ..
160 $ cd ..
161 $ hg share narrow2 narrow2-share
161 $ hg share narrow2 narrow2-share
162 updating working directory
162 updating working directory
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 $ cd narrow2-share
164 $ cd narrow2-share
165 $ hg status
165 $ hg status
166
166
167 We should also be able to unshare without breaking everything:
167 We should also be able to unshare without breaking everything:
168 $ hg unshare
168 $ hg unshare
169 $ hg verify
169 $ hg verify
170 checking changesets
170 checking changesets
171 checking manifests
171 checking manifests
172 crosschecking files in changesets and manifests
172 crosschecking files in changesets and manifests
173 checking files
173 checking files
174 1 files, 1 changesets, 1 total revisions
174 checked 1 changesets with 1 changes to 1 files
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
1 NO CONTENT: modified file
NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
General Comments 0
You need to be logged in to leave comments. Login now