##// END OF EJS Templates
bundle: emit full snapshot as is, without doing a redelta...
marmoute -
r50678:e1953a34 default
parent child Browse files
Show More
@@ -1,643 +1,647 b''
1 # storageutil.py - Storage functionality agnostic of backend implementation.
1 # storageutil.py - Storage functionality agnostic of backend implementation.
2 #
2 #
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.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
8
9 import re
9 import re
10 import struct
10 import struct
11
11
12 from ..i18n import _
12 from ..i18n import _
13 from ..node import (
13 from ..node import (
14 bin,
14 bin,
15 nullrev,
15 nullrev,
16 sha1nodeconstants,
16 sha1nodeconstants,
17 )
17 )
18 from .. import (
18 from .. import (
19 dagop,
19 dagop,
20 error,
20 error,
21 mdiff,
21 mdiff,
22 )
22 )
23 from ..interfaces import repository
23 from ..interfaces import repository
24 from ..revlogutils import sidedata as sidedatamod
24 from ..revlogutils import sidedata as sidedatamod
25 from ..utils import hashutil
25 from ..utils import hashutil
26
26
27 _nullhash = hashutil.sha1(sha1nodeconstants.nullid)
27 _nullhash = hashutil.sha1(sha1nodeconstants.nullid)
28
28
29 # revision data contains extra metadata not part of the official digest
29 # revision data contains extra metadata not part of the official digest
30 # Only used in changegroup >= v4.
30 # Only used in changegroup >= v4.
31 CG_FLAG_SIDEDATA = 1
31 CG_FLAG_SIDEDATA = 1
32
32
33
33
34 def hashrevisionsha1(text, p1, p2):
34 def hashrevisionsha1(text, p1, p2):
35 """Compute the SHA-1 for revision data and its parents.
35 """Compute the SHA-1 for revision data and its parents.
36
36
37 This hash combines both the current file contents and its history
37 This hash combines both the current file contents and its history
38 in a manner that makes it easy to distinguish nodes with the same
38 in a manner that makes it easy to distinguish nodes with the same
39 content in the revision graph.
39 content in the revision graph.
40 """
40 """
41 # As of now, if one of the parent node is null, p2 is null
41 # As of now, if one of the parent node is null, p2 is null
42 if p2 == sha1nodeconstants.nullid:
42 if p2 == sha1nodeconstants.nullid:
43 # deep copy of a hash is faster than creating one
43 # deep copy of a hash is faster than creating one
44 s = _nullhash.copy()
44 s = _nullhash.copy()
45 s.update(p1)
45 s.update(p1)
46 else:
46 else:
47 # none of the parent nodes are nullid
47 # none of the parent nodes are nullid
48 if p1 < p2:
48 if p1 < p2:
49 a = p1
49 a = p1
50 b = p2
50 b = p2
51 else:
51 else:
52 a = p2
52 a = p2
53 b = p1
53 b = p1
54 s = hashutil.sha1(a)
54 s = hashutil.sha1(a)
55 s.update(b)
55 s.update(b)
56 s.update(text)
56 s.update(text)
57 return s.digest()
57 return s.digest()
58
58
59
59
60 METADATA_RE = re.compile(b'\x01\n')
60 METADATA_RE = re.compile(b'\x01\n')
61
61
62
62
63 def parsemeta(text):
63 def parsemeta(text):
64 """Parse metadata header from revision data.
64 """Parse metadata header from revision data.
65
65
66 Returns a 2-tuple of (metadata, offset), where both can be None if there
66 Returns a 2-tuple of (metadata, offset), where both can be None if there
67 is no metadata.
67 is no metadata.
68 """
68 """
69 # text can be buffer, so we can't use .startswith or .index
69 # text can be buffer, so we can't use .startswith or .index
70 if text[:2] != b'\x01\n':
70 if text[:2] != b'\x01\n':
71 return None, None
71 return None, None
72 s = METADATA_RE.search(text, 2).start()
72 s = METADATA_RE.search(text, 2).start()
73 mtext = text[2:s]
73 mtext = text[2:s]
74 meta = {}
74 meta = {}
75 for l in mtext.splitlines():
75 for l in mtext.splitlines():
76 k, v = l.split(b': ', 1)
76 k, v = l.split(b': ', 1)
77 meta[k] = v
77 meta[k] = v
78 return meta, s + 2
78 return meta, s + 2
79
79
80
80
81 def packmeta(meta, text):
81 def packmeta(meta, text):
82 """Add metadata to fulltext to produce revision text."""
82 """Add metadata to fulltext to produce revision text."""
83 keys = sorted(meta)
83 keys = sorted(meta)
84 metatext = b''.join(b'%s: %s\n' % (k, meta[k]) for k in keys)
84 metatext = b''.join(b'%s: %s\n' % (k, meta[k]) for k in keys)
85 return b'\x01\n%s\x01\n%s' % (metatext, text)
85 return b'\x01\n%s\x01\n%s' % (metatext, text)
86
86
87
87
88 def iscensoredtext(text):
88 def iscensoredtext(text):
89 meta = parsemeta(text)[0]
89 meta = parsemeta(text)[0]
90 return meta and b'censored' in meta
90 return meta and b'censored' in meta
91
91
92
92
93 def filtermetadata(text):
93 def filtermetadata(text):
94 """Extract just the revision data from source text.
94 """Extract just the revision data from source text.
95
95
96 Returns ``text`` unless it has a metadata header, in which case we return
96 Returns ``text`` unless it has a metadata header, in which case we return
97 a new buffer without hte metadata.
97 a new buffer without hte metadata.
98 """
98 """
99 if not text.startswith(b'\x01\n'):
99 if not text.startswith(b'\x01\n'):
100 return text
100 return text
101
101
102 offset = text.index(b'\x01\n', 2)
102 offset = text.index(b'\x01\n', 2)
103 return text[offset + 2 :]
103 return text[offset + 2 :]
104
104
105
105
106 def filerevisioncopied(store, node):
106 def filerevisioncopied(store, node):
107 """Resolve file revision copy metadata.
107 """Resolve file revision copy metadata.
108
108
109 Returns ``False`` if the file has no copy metadata. Otherwise a
109 Returns ``False`` if the file has no copy metadata. Otherwise a
110 2-tuple of the source filename and node.
110 2-tuple of the source filename and node.
111 """
111 """
112 if store.parents(node)[0] != sha1nodeconstants.nullid:
112 if store.parents(node)[0] != sha1nodeconstants.nullid:
113 # When creating a copy or move we set filelog parents to null,
113 # When creating a copy or move we set filelog parents to null,
114 # because contents are probably unrelated and making a delta
114 # because contents are probably unrelated and making a delta
115 # would not be useful.
115 # would not be useful.
116 # Conversely, if filelog p1 is non-null we know
116 # Conversely, if filelog p1 is non-null we know
117 # there is no copy metadata.
117 # there is no copy metadata.
118 # In the presence of merges, this reasoning becomes invalid
118 # In the presence of merges, this reasoning becomes invalid
119 # if we reorder parents. See tests/test-issue6528.t.
119 # if we reorder parents. See tests/test-issue6528.t.
120 return False
120 return False
121
121
122 meta = parsemeta(store.revision(node))[0]
122 meta = parsemeta(store.revision(node))[0]
123
123
124 # copy and copyrev occur in pairs. In rare cases due to old bugs,
124 # copy and copyrev occur in pairs. In rare cases due to old bugs,
125 # one can occur without the other. So ensure both are present to flag
125 # one can occur without the other. So ensure both are present to flag
126 # as a copy.
126 # as a copy.
127 if meta and b'copy' in meta and b'copyrev' in meta:
127 if meta and b'copy' in meta and b'copyrev' in meta:
128 return meta[b'copy'], bin(meta[b'copyrev'])
128 return meta[b'copy'], bin(meta[b'copyrev'])
129
129
130 return False
130 return False
131
131
132
132
133 def filedataequivalent(store, node, filedata):
133 def filedataequivalent(store, node, filedata):
134 """Determines whether file data is equivalent to a stored node.
134 """Determines whether file data is equivalent to a stored node.
135
135
136 Returns True if the passed file data would hash to the same value
136 Returns True if the passed file data would hash to the same value
137 as a stored revision and False otherwise.
137 as a stored revision and False otherwise.
138
138
139 When a stored revision is censored, filedata must be empty to have
139 When a stored revision is censored, filedata must be empty to have
140 equivalence.
140 equivalence.
141
141
142 When a stored revision has copy metadata, it is ignored as part
142 When a stored revision has copy metadata, it is ignored as part
143 of the compare.
143 of the compare.
144 """
144 """
145
145
146 if filedata.startswith(b'\x01\n'):
146 if filedata.startswith(b'\x01\n'):
147 revisiontext = b'\x01\n\x01\n' + filedata
147 revisiontext = b'\x01\n\x01\n' + filedata
148 else:
148 else:
149 revisiontext = filedata
149 revisiontext = filedata
150
150
151 p1, p2 = store.parents(node)
151 p1, p2 = store.parents(node)
152
152
153 computednode = hashrevisionsha1(revisiontext, p1, p2)
153 computednode = hashrevisionsha1(revisiontext, p1, p2)
154
154
155 if computednode == node:
155 if computednode == node:
156 return True
156 return True
157
157
158 # Censored files compare against the empty file.
158 # Censored files compare against the empty file.
159 if store.iscensored(store.rev(node)):
159 if store.iscensored(store.rev(node)):
160 return filedata == b''
160 return filedata == b''
161
161
162 # Renaming a file produces a different hash, even if the data
162 # Renaming a file produces a different hash, even if the data
163 # remains unchanged. Check if that's the case.
163 # remains unchanged. Check if that's the case.
164 if store.renamed(node):
164 if store.renamed(node):
165 return store.read(node) == filedata
165 return store.read(node) == filedata
166
166
167 return False
167 return False
168
168
169
169
170 def iterrevs(storelen, start=0, stop=None):
170 def iterrevs(storelen, start=0, stop=None):
171 """Iterate over revision numbers in a store."""
171 """Iterate over revision numbers in a store."""
172 step = 1
172 step = 1
173
173
174 if stop is not None:
174 if stop is not None:
175 if start > stop:
175 if start > stop:
176 step = -1
176 step = -1
177 stop += step
177 stop += step
178 if stop > storelen:
178 if stop > storelen:
179 stop = storelen
179 stop = storelen
180 else:
180 else:
181 stop = storelen
181 stop = storelen
182
182
183 return range(start, stop, step)
183 return range(start, stop, step)
184
184
185
185
186 def fileidlookup(store, fileid, identifier):
186 def fileidlookup(store, fileid, identifier):
187 """Resolve the file node for a value.
187 """Resolve the file node for a value.
188
188
189 ``store`` is an object implementing the ``ifileindex`` interface.
189 ``store`` is an object implementing the ``ifileindex`` interface.
190
190
191 ``fileid`` can be:
191 ``fileid`` can be:
192
192
193 * A 20 or 32 byte binary node.
193 * A 20 or 32 byte binary node.
194 * An integer revision number
194 * An integer revision number
195 * A 40 or 64 byte hex node.
195 * A 40 or 64 byte hex node.
196 * A bytes that can be parsed as an integer representing a revision number.
196 * A bytes that can be parsed as an integer representing a revision number.
197
197
198 ``identifier`` is used to populate ``error.LookupError`` with an identifier
198 ``identifier`` is used to populate ``error.LookupError`` with an identifier
199 for the store.
199 for the store.
200
200
201 Raises ``error.LookupError`` on failure.
201 Raises ``error.LookupError`` on failure.
202 """
202 """
203 if isinstance(fileid, int):
203 if isinstance(fileid, int):
204 try:
204 try:
205 return store.node(fileid)
205 return store.node(fileid)
206 except IndexError:
206 except IndexError:
207 raise error.LookupError(
207 raise error.LookupError(
208 b'%d' % fileid, identifier, _(b'no match found')
208 b'%d' % fileid, identifier, _(b'no match found')
209 )
209 )
210
210
211 if len(fileid) in (20, 32):
211 if len(fileid) in (20, 32):
212 try:
212 try:
213 store.rev(fileid)
213 store.rev(fileid)
214 return fileid
214 return fileid
215 except error.LookupError:
215 except error.LookupError:
216 pass
216 pass
217
217
218 if len(fileid) in (40, 64):
218 if len(fileid) in (40, 64):
219 try:
219 try:
220 rawnode = bin(fileid)
220 rawnode = bin(fileid)
221 store.rev(rawnode)
221 store.rev(rawnode)
222 return rawnode
222 return rawnode
223 except TypeError:
223 except TypeError:
224 pass
224 pass
225
225
226 try:
226 try:
227 rev = int(fileid)
227 rev = int(fileid)
228
228
229 if b'%d' % rev != fileid:
229 if b'%d' % rev != fileid:
230 raise ValueError
230 raise ValueError
231
231
232 try:
232 try:
233 return store.node(rev)
233 return store.node(rev)
234 except (IndexError, TypeError):
234 except (IndexError, TypeError):
235 pass
235 pass
236 except (ValueError, OverflowError):
236 except (ValueError, OverflowError):
237 pass
237 pass
238
238
239 raise error.LookupError(fileid, identifier, _(b'no match found'))
239 raise error.LookupError(fileid, identifier, _(b'no match found'))
240
240
241
241
242 def resolvestripinfo(minlinkrev, tiprev, headrevs, linkrevfn, parentrevsfn):
242 def resolvestripinfo(minlinkrev, tiprev, headrevs, linkrevfn, parentrevsfn):
243 """Resolve information needed to strip revisions.
243 """Resolve information needed to strip revisions.
244
244
245 Finds the minimum revision number that must be stripped in order to
245 Finds the minimum revision number that must be stripped in order to
246 strip ``minlinkrev``.
246 strip ``minlinkrev``.
247
247
248 Returns a 2-tuple of the minimum revision number to do that and a set
248 Returns a 2-tuple of the minimum revision number to do that and a set
249 of all revision numbers that have linkrevs that would be broken
249 of all revision numbers that have linkrevs that would be broken
250 by that strip.
250 by that strip.
251
251
252 ``tiprev`` is the current tip-most revision. It is ``len(store) - 1``.
252 ``tiprev`` is the current tip-most revision. It is ``len(store) - 1``.
253 ``headrevs`` is an iterable of head revisions.
253 ``headrevs`` is an iterable of head revisions.
254 ``linkrevfn`` is a callable that receives a revision and returns a linked
254 ``linkrevfn`` is a callable that receives a revision and returns a linked
255 revision.
255 revision.
256 ``parentrevsfn`` is a callable that receives a revision number and returns
256 ``parentrevsfn`` is a callable that receives a revision number and returns
257 an iterable of its parent revision numbers.
257 an iterable of its parent revision numbers.
258 """
258 """
259 brokenrevs = set()
259 brokenrevs = set()
260 strippoint = tiprev + 1
260 strippoint = tiprev + 1
261
261
262 heads = {}
262 heads = {}
263 futurelargelinkrevs = set()
263 futurelargelinkrevs = set()
264 for head in headrevs:
264 for head in headrevs:
265 headlinkrev = linkrevfn(head)
265 headlinkrev = linkrevfn(head)
266 heads[head] = headlinkrev
266 heads[head] = headlinkrev
267 if headlinkrev >= minlinkrev:
267 if headlinkrev >= minlinkrev:
268 futurelargelinkrevs.add(headlinkrev)
268 futurelargelinkrevs.add(headlinkrev)
269
269
270 # This algorithm involves walking down the rev graph, starting at the
270 # This algorithm involves walking down the rev graph, starting at the
271 # heads. Since the revs are topologically sorted according to linkrev,
271 # heads. Since the revs are topologically sorted according to linkrev,
272 # once all head linkrevs are below the minlink, we know there are
272 # once all head linkrevs are below the minlink, we know there are
273 # no more revs that could have a linkrev greater than minlink.
273 # no more revs that could have a linkrev greater than minlink.
274 # So we can stop walking.
274 # So we can stop walking.
275 while futurelargelinkrevs:
275 while futurelargelinkrevs:
276 strippoint -= 1
276 strippoint -= 1
277 linkrev = heads.pop(strippoint)
277 linkrev = heads.pop(strippoint)
278
278
279 if linkrev < minlinkrev:
279 if linkrev < minlinkrev:
280 brokenrevs.add(strippoint)
280 brokenrevs.add(strippoint)
281 else:
281 else:
282 futurelargelinkrevs.remove(linkrev)
282 futurelargelinkrevs.remove(linkrev)
283
283
284 for p in parentrevsfn(strippoint):
284 for p in parentrevsfn(strippoint):
285 if p != nullrev:
285 if p != nullrev:
286 plinkrev = linkrevfn(p)
286 plinkrev = linkrevfn(p)
287 heads[p] = plinkrev
287 heads[p] = plinkrev
288 if plinkrev >= minlinkrev:
288 if plinkrev >= minlinkrev:
289 futurelargelinkrevs.add(plinkrev)
289 futurelargelinkrevs.add(plinkrev)
290
290
291 return strippoint, brokenrevs
291 return strippoint, brokenrevs
292
292
293
293
294 def emitrevisions(
294 def emitrevisions(
295 store,
295 store,
296 nodes,
296 nodes,
297 nodesorder,
297 nodesorder,
298 resultcls,
298 resultcls,
299 deltaparentfn=None,
299 deltaparentfn=None,
300 candeltafn=None,
300 candeltafn=None,
301 rawsizefn=None,
301 rawsizefn=None,
302 revdifffn=None,
302 revdifffn=None,
303 flagsfn=None,
303 flagsfn=None,
304 deltamode=repository.CG_DELTAMODE_STD,
304 deltamode=repository.CG_DELTAMODE_STD,
305 revisiondata=False,
305 revisiondata=False,
306 assumehaveparentrevisions=False,
306 assumehaveparentrevisions=False,
307 sidedata_helpers=None,
307 sidedata_helpers=None,
308 debug_info=None,
308 debug_info=None,
309 ):
309 ):
310 """Generic implementation of ifiledata.emitrevisions().
310 """Generic implementation of ifiledata.emitrevisions().
311
311
312 Emitting revision data is subtly complex. This function attempts to
312 Emitting revision data is subtly complex. This function attempts to
313 encapsulate all the logic for doing so in a backend-agnostic way.
313 encapsulate all the logic for doing so in a backend-agnostic way.
314
314
315 ``store``
315 ``store``
316 Object conforming to ``ifilestorage`` interface.
316 Object conforming to ``ifilestorage`` interface.
317
317
318 ``nodes``
318 ``nodes``
319 List of revision nodes whose data to emit.
319 List of revision nodes whose data to emit.
320
320
321 ``resultcls``
321 ``resultcls``
322 A type implementing the ``irevisiondelta`` interface that will be
322 A type implementing the ``irevisiondelta`` interface that will be
323 constructed and returned.
323 constructed and returned.
324
324
325 ``deltaparentfn`` (optional)
325 ``deltaparentfn`` (optional)
326 Callable receiving a revision number and returning the revision number
326 Callable receiving a revision number and returning the revision number
327 of a revision that the internal delta is stored against. This delta
327 of a revision that the internal delta is stored against. This delta
328 will be preferred over computing a new arbitrary delta.
328 will be preferred over computing a new arbitrary delta.
329
329
330 If not defined, a delta will always be computed from raw revision
330 If not defined, a delta will always be computed from raw revision
331 data.
331 data.
332
332
333 ``candeltafn`` (optional)
333 ``candeltafn`` (optional)
334 Callable receiving a pair of revision numbers that returns a bool
334 Callable receiving a pair of revision numbers that returns a bool
335 indicating whether a delta between them can be produced.
335 indicating whether a delta between them can be produced.
336
336
337 If not defined, it is assumed that any two revisions can delta with
337 If not defined, it is assumed that any two revisions can delta with
338 each other.
338 each other.
339
339
340 ``rawsizefn`` (optional)
340 ``rawsizefn`` (optional)
341 Callable receiving a revision number and returning the length of the
341 Callable receiving a revision number and returning the length of the
342 ``store.rawdata(rev)``.
342 ``store.rawdata(rev)``.
343
343
344 If not defined, ``len(store.rawdata(rev))`` will be called.
344 If not defined, ``len(store.rawdata(rev))`` will be called.
345
345
346 ``revdifffn`` (optional)
346 ``revdifffn`` (optional)
347 Callable receiving a pair of revision numbers that returns a delta
347 Callable receiving a pair of revision numbers that returns a delta
348 between them.
348 between them.
349
349
350 If not defined, a delta will be computed by invoking mdiff code
350 If not defined, a delta will be computed by invoking mdiff code
351 on ``store.revision()`` results.
351 on ``store.revision()`` results.
352
352
353 Defining this function allows a precomputed or stored delta to be
353 Defining this function allows a precomputed or stored delta to be
354 used without having to compute on.
354 used without having to compute on.
355
355
356 ``flagsfn`` (optional)
356 ``flagsfn`` (optional)
357 Callable receiving a revision number and returns the integer flags
357 Callable receiving a revision number and returns the integer flags
358 value for it. If not defined, flags value will be 0.
358 value for it. If not defined, flags value will be 0.
359
359
360 ``deltamode``
360 ``deltamode``
361 constaint on delta to be sent:
361 constaint on delta to be sent:
362 * CG_DELTAMODE_STD - normal mode, try to reuse storage deltas,
362 * CG_DELTAMODE_STD - normal mode, try to reuse storage deltas,
363 * CG_DELTAMODE_PREV - only delta against "prev",
363 * CG_DELTAMODE_PREV - only delta against "prev",
364 * CG_DELTAMODE_FULL - only issue full snapshot.
364 * CG_DELTAMODE_FULL - only issue full snapshot.
365
365
366 Whether to send fulltext revisions instead of deltas, if allowed.
366 Whether to send fulltext revisions instead of deltas, if allowed.
367
367
368 ``nodesorder``
368 ``nodesorder``
369 ``revisiondata``
369 ``revisiondata``
370 ``assumehaveparentrevisions``
370 ``assumehaveparentrevisions``
371 ``sidedata_helpers`` (optional)
371 ``sidedata_helpers`` (optional)
372 If not None, means that sidedata should be included.
372 If not None, means that sidedata should be included.
373 See `revlogutil.sidedata.get_sidedata_helpers`.
373 See `revlogutil.sidedata.get_sidedata_helpers`.
374
374
375 ``debug_info`
375 ``debug_info`
376 An optionnal dictionnary to gather information about the bundling
376 An optionnal dictionnary to gather information about the bundling
377 process (if present, see config: debug.bundling.stats.
377 process (if present, see config: debug.bundling.stats.
378 """
378 """
379
379
380 fnode = store.node
380 fnode = store.node
381 frev = store.rev
381 frev = store.rev
382 parents = store.parentrevs
382 parents = store.parentrevs
383
383
384 if nodesorder == b'nodes':
384 if nodesorder == b'nodes':
385 revs = [frev(n) for n in nodes]
385 revs = [frev(n) for n in nodes]
386 elif nodesorder == b'linear':
386 elif nodesorder == b'linear':
387 revs = {frev(n) for n in nodes}
387 revs = {frev(n) for n in nodes}
388 revs = dagop.linearize(revs, store.parentrevs)
388 revs = dagop.linearize(revs, store.parentrevs)
389 else: # storage and default
389 else: # storage and default
390 revs = sorted(frev(n) for n in nodes)
390 revs = sorted(frev(n) for n in nodes)
391
391
392 prevrev = None
392 prevrev = None
393
393
394 if deltamode == repository.CG_DELTAMODE_PREV or assumehaveparentrevisions:
394 if deltamode == repository.CG_DELTAMODE_PREV or assumehaveparentrevisions:
395 prevrev = parents(revs[0])[0]
395 prevrev = parents(revs[0])[0]
396
396
397 # Sets of revs available to delta against.
397 # Sets of revs available to delta against.
398 emitted = set()
398 emitted = set()
399 available = set()
399 available = set()
400 if assumehaveparentrevisions:
400 if assumehaveparentrevisions:
401 common_heads = set(p for r in revs for p in parents(r))
401 common_heads = set(p for r in revs for p in parents(r))
402 common_heads.difference_update(revs)
402 common_heads.difference_update(revs)
403 available = store.ancestors(common_heads, inclusive=True)
403 available = store.ancestors(common_heads, inclusive=True)
404
404
405 def is_usable_base(rev):
405 def is_usable_base(rev):
406 """Is a delta against this revision usable over the wire"""
406 """Is a delta against this revision usable over the wire"""
407 if rev == nullrev:
407 if rev == nullrev:
408 return False
408 return False
409 return rev in emitted or rev in available
409 return rev in emitted or rev in available
410
410
411 for rev in revs:
411 for rev in revs:
412 if rev == nullrev:
412 if rev == nullrev:
413 continue
413 continue
414
414
415 debug_delta_source = None
415 debug_delta_source = None
416 if debug_info is not None:
416 if debug_info is not None:
417 debug_info['revision-total'] += 1
417 debug_info['revision-total'] += 1
418
418
419 node = fnode(rev)
419 node = fnode(rev)
420 p1rev, p2rev = parents(rev)
420 p1rev, p2rev = parents(rev)
421
421
422 if debug_info is not None:
422 if debug_info is not None:
423 if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev:
423 if p1rev != p2rev and p1rev != nullrev and p2rev != nullrev:
424 debug_info['merge-total'] += 1
424 debug_info['merge-total'] += 1
425
425
426 if deltaparentfn:
426 if deltaparentfn:
427 deltaparentrev = deltaparentfn(rev)
427 deltaparentrev = deltaparentfn(rev)
428 if debug_info is not None:
428 if debug_info is not None:
429 if deltaparentrev == nullrev:
429 if deltaparentrev == nullrev:
430 debug_info['available-full'] += 1
430 debug_info['available-full'] += 1
431 else:
431 else:
432 debug_info['available-delta'] += 1
432 debug_info['available-delta'] += 1
433
433
434 else:
434 else:
435 deltaparentrev = nullrev
435 deltaparentrev = nullrev
436
436
437 # Forced delta against previous mode.
437 # Forced delta against previous mode.
438 if deltamode == repository.CG_DELTAMODE_PREV:
438 if deltamode == repository.CG_DELTAMODE_PREV:
439 if debug_info is not None:
439 if debug_info is not None:
440 debug_delta_source = "prev"
440 debug_delta_source = "prev"
441 baserev = prevrev
441 baserev = prevrev
442
442
443 # We're instructed to send fulltext. Honor that.
443 # We're instructed to send fulltext. Honor that.
444 elif deltamode == repository.CG_DELTAMODE_FULL:
444 elif deltamode == repository.CG_DELTAMODE_FULL:
445 if debug_info is not None:
445 if debug_info is not None:
446 debug_delta_source = "full"
446 debug_delta_source = "full"
447 baserev = nullrev
447 baserev = nullrev
448 # We're instructed to use p1. Honor that
448 # We're instructed to use p1. Honor that
449 elif deltamode == repository.CG_DELTAMODE_P1:
449 elif deltamode == repository.CG_DELTAMODE_P1:
450 if debug_info is not None:
450 if debug_info is not None:
451 debug_delta_source = "p1"
451 debug_delta_source = "p1"
452 baserev = p1rev
452 baserev = p1rev
453
453
454 # There is a delta in storage. We try to use that because it
454 # There is a delta in storage. We try to use that because it
455 # amounts to effectively copying data from storage and is
455 # amounts to effectively copying data from storage and is
456 # therefore the fastest.
456 # therefore the fastest.
457 elif is_usable_base(deltaparentrev):
457 elif is_usable_base(deltaparentrev):
458 if debug_info is not None:
458 if debug_info is not None:
459 debug_delta_source = "storage"
459 debug_delta_source = "storage"
460 baserev = deltaparentrev
460 baserev = deltaparentrev
461 elif deltaparentrev == nullrev:
462 if debug_info is not None:
463 debug_delta_source = "storage"
464 baserev = deltaparentrev
461 else:
465 else:
462 if deltaparentrev != nullrev and debug_info is not None:
466 if deltaparentrev != nullrev and debug_info is not None:
463 debug_info['denied-base-not-available'] += 1
467 debug_info['denied-base-not-available'] += 1
464 # No guarantee the receiver has the delta parent, or Storage has a
468 # No guarantee the receiver has the delta parent, or Storage has a
465 # fulltext revision.
469 # fulltext revision.
466 #
470 #
467 # We compute a delta on the fly to send over the wire.
471 # We compute a delta on the fly to send over the wire.
468 #
472 #
469 # We start with a try against p1, which in the common case should
473 # We start with a try against p1, which in the common case should
470 # be close to this revision content.
474 # be close to this revision content.
471 #
475 #
472 # note: we could optimize between p1 and p2 in merges cases.
476 # note: we could optimize between p1 and p2 in merges cases.
473 elif is_usable_base(p1rev):
477 elif is_usable_base(p1rev):
474 if debug_info is not None:
478 if debug_info is not None:
475 debug_delta_source = "p1"
479 debug_delta_source = "p1"
476 baserev = p1rev
480 baserev = p1rev
477 # if p1 was not an option, try p2
481 # if p1 was not an option, try p2
478 elif is_usable_base(p2rev):
482 elif is_usable_base(p2rev):
479 if debug_info is not None:
483 if debug_info is not None:
480 debug_delta_source = "p2"
484 debug_delta_source = "p2"
481 baserev = p2rev
485 baserev = p2rev
482 # Send delta against prev in despair
486 # Send delta against prev in despair
483 #
487 #
484 # using the closest available ancestors first might be better?
488 # using the closest available ancestors first might be better?
485 elif prevrev is not None:
489 elif prevrev is not None:
486 if debug_info is not None:
490 if debug_info is not None:
487 debug_delta_source = "prev"
491 debug_delta_source = "prev"
488 baserev = prevrev
492 baserev = prevrev
489 else:
493 else:
490 if debug_info is not None:
494 if debug_info is not None:
491 debug_delta_source = "full"
495 debug_delta_source = "full"
492 baserev = nullrev
496 baserev = nullrev
493
497
494 # But we can't actually use our chosen delta base for whatever
498 # But we can't actually use our chosen delta base for whatever
495 # reason. Reset to fulltext.
499 # reason. Reset to fulltext.
496 if (
500 if (
497 baserev != nullrev
501 baserev != nullrev
498 and candeltafn is not None
502 and candeltafn is not None
499 and not candeltafn(baserev, rev)
503 and not candeltafn(baserev, rev)
500 ):
504 ):
501 if debug_info is not None:
505 if debug_info is not None:
502 debug_delta_source = "full"
506 debug_delta_source = "full"
503 debug_info['denied-delta-candeltafn'] += 1
507 debug_info['denied-delta-candeltafn'] += 1
504 baserev = nullrev
508 baserev = nullrev
505
509
506 revision = None
510 revision = None
507 delta = None
511 delta = None
508 baserevisionsize = None
512 baserevisionsize = None
509
513
510 if revisiondata:
514 if revisiondata:
511 if store.iscensored(baserev) or store.iscensored(rev):
515 if store.iscensored(baserev) or store.iscensored(rev):
512 try:
516 try:
513 revision = store.rawdata(node)
517 revision = store.rawdata(node)
514 except error.CensoredNodeError as e:
518 except error.CensoredNodeError as e:
515 if debug_info is not None:
519 if debug_info is not None:
516 debug_delta_source = "full"
520 debug_delta_source = "full"
517 debug_info['denied-delta-not-available'] += 1
521 debug_info['denied-delta-not-available'] += 1
518 revision = e.tombstone
522 revision = e.tombstone
519
523
520 if baserev != nullrev:
524 if baserev != nullrev:
521 if rawsizefn:
525 if rawsizefn:
522 baserevisionsize = rawsizefn(baserev)
526 baserevisionsize = rawsizefn(baserev)
523 else:
527 else:
524 baserevisionsize = len(store.rawdata(baserev))
528 baserevisionsize = len(store.rawdata(baserev))
525
529
526 elif (
530 elif (
527 baserev == nullrev and deltamode != repository.CG_DELTAMODE_PREV
531 baserev == nullrev and deltamode != repository.CG_DELTAMODE_PREV
528 ):
532 ):
529 if debug_info is not None:
533 if debug_info is not None:
530 debug_info['computed-delta'] += 1 # close enough
534 debug_info['computed-delta'] += 1 # close enough
531 debug_info['delta-full'] += 1
535 debug_info['delta-full'] += 1
532 revision = store.rawdata(node)
536 revision = store.rawdata(node)
533 emitted.add(rev)
537 emitted.add(rev)
534 else:
538 else:
535 if revdifffn:
539 if revdifffn:
536 if debug_info is not None:
540 if debug_info is not None:
537 if debug_delta_source == "full":
541 if debug_delta_source == "full":
538 debug_info['computed-delta'] += 1
542 debug_info['computed-delta'] += 1
539 debug_info['delta-full'] += 1
543 debug_info['delta-full'] += 1
540 elif debug_delta_source == "prev":
544 elif debug_delta_source == "prev":
541 debug_info['computed-delta'] += 1
545 debug_info['computed-delta'] += 1
542 debug_info['delta-against-prev'] += 1
546 debug_info['delta-against-prev'] += 1
543 elif debug_delta_source == "p1":
547 elif debug_delta_source == "p1":
544 debug_info['computed-delta'] += 1
548 debug_info['computed-delta'] += 1
545 debug_info['delta-against-p1'] += 1
549 debug_info['delta-against-p1'] += 1
546 elif debug_delta_source == "storage":
550 elif debug_delta_source == "storage":
547 debug_info['reused-storage-delta'] += 1
551 debug_info['reused-storage-delta'] += 1
548 else:
552 else:
549 assert False, 'unreachable'
553 assert False, 'unreachable'
550
554
551 delta = revdifffn(baserev, rev)
555 delta = revdifffn(baserev, rev)
552 else:
556 else:
553 if debug_info is not None:
557 if debug_info is not None:
554 if debug_delta_source == "full":
558 if debug_delta_source == "full":
555 debug_info['computed-delta'] += 1
559 debug_info['computed-delta'] += 1
556 debug_info['delta-full'] += 1
560 debug_info['delta-full'] += 1
557 elif debug_delta_source == "prev":
561 elif debug_delta_source == "prev":
558 debug_info['computed-delta'] += 1
562 debug_info['computed-delta'] += 1
559 debug_info['delta-against-prev'] += 1
563 debug_info['delta-against-prev'] += 1
560 elif debug_delta_source == "p1":
564 elif debug_delta_source == "p1":
561 debug_info['computed-delta'] += 1
565 debug_info['computed-delta'] += 1
562 debug_info['delta-against-p1'] += 1
566 debug_info['delta-against-p1'] += 1
563 elif debug_delta_source == "storage":
567 elif debug_delta_source == "storage":
564 # seem quite unlikelry to happens
568 # seem quite unlikelry to happens
565 debug_info['computed-delta'] += 1
569 debug_info['computed-delta'] += 1
566 debug_info['reused-storage-delta'] += 1
570 debug_info['reused-storage-delta'] += 1
567 else:
571 else:
568 assert False, 'unreachable'
572 assert False, 'unreachable'
569 delta = mdiff.textdiff(
573 delta = mdiff.textdiff(
570 store.rawdata(baserev), store.rawdata(rev)
574 store.rawdata(baserev), store.rawdata(rev)
571 )
575 )
572
576
573 emitted.add(rev)
577 emitted.add(rev)
574
578
575 serialized_sidedata = None
579 serialized_sidedata = None
576 sidedata_flags = (0, 0)
580 sidedata_flags = (0, 0)
577 if sidedata_helpers:
581 if sidedata_helpers:
578 try:
582 try:
579 old_sidedata = store.sidedata(rev)
583 old_sidedata = store.sidedata(rev)
580 except error.CensoredNodeError:
584 except error.CensoredNodeError:
581 # skip any potential sidedata of the censored revision
585 # skip any potential sidedata of the censored revision
582 sidedata = {}
586 sidedata = {}
583 else:
587 else:
584 sidedata, sidedata_flags = sidedatamod.run_sidedata_helpers(
588 sidedata, sidedata_flags = sidedatamod.run_sidedata_helpers(
585 store=store,
589 store=store,
586 sidedata_helpers=sidedata_helpers,
590 sidedata_helpers=sidedata_helpers,
587 sidedata=old_sidedata,
591 sidedata=old_sidedata,
588 rev=rev,
592 rev=rev,
589 )
593 )
590 if sidedata:
594 if sidedata:
591 serialized_sidedata = sidedatamod.serialize_sidedata(sidedata)
595 serialized_sidedata = sidedatamod.serialize_sidedata(sidedata)
592
596
593 flags = flagsfn(rev) if flagsfn else 0
597 flags = flagsfn(rev) if flagsfn else 0
594 protocol_flags = 0
598 protocol_flags = 0
595 if serialized_sidedata:
599 if serialized_sidedata:
596 # Advertise that sidedata exists to the other side
600 # Advertise that sidedata exists to the other side
597 protocol_flags |= CG_FLAG_SIDEDATA
601 protocol_flags |= CG_FLAG_SIDEDATA
598 # Computers and removers can return flags to add and/or remove
602 # Computers and removers can return flags to add and/or remove
599 flags = flags | sidedata_flags[0] & ~sidedata_flags[1]
603 flags = flags | sidedata_flags[0] & ~sidedata_flags[1]
600
604
601 yield resultcls(
605 yield resultcls(
602 node=node,
606 node=node,
603 p1node=fnode(p1rev),
607 p1node=fnode(p1rev),
604 p2node=fnode(p2rev),
608 p2node=fnode(p2rev),
605 basenode=fnode(baserev),
609 basenode=fnode(baserev),
606 flags=flags,
610 flags=flags,
607 baserevisionsize=baserevisionsize,
611 baserevisionsize=baserevisionsize,
608 revision=revision,
612 revision=revision,
609 delta=delta,
613 delta=delta,
610 sidedata=serialized_sidedata,
614 sidedata=serialized_sidedata,
611 protocol_flags=protocol_flags,
615 protocol_flags=protocol_flags,
612 )
616 )
613
617
614 prevrev = rev
618 prevrev = rev
615
619
616
620
617 def deltaiscensored(delta, baserev, baselenfn):
621 def deltaiscensored(delta, baserev, baselenfn):
618 """Determine if a delta represents censored revision data.
622 """Determine if a delta represents censored revision data.
619
623
620 ``baserev`` is the base revision this delta is encoded against.
624 ``baserev`` is the base revision this delta is encoded against.
621 ``baselenfn`` is a callable receiving a revision number that resolves the
625 ``baselenfn`` is a callable receiving a revision number that resolves the
622 length of the revision fulltext.
626 length of the revision fulltext.
623
627
624 Returns a bool indicating if the result of the delta represents a censored
628 Returns a bool indicating if the result of the delta represents a censored
625 revision.
629 revision.
626 """
630 """
627 # Fragile heuristic: unless new file meta keys are added alphabetically
631 # Fragile heuristic: unless new file meta keys are added alphabetically
628 # preceding "censored", all censored revisions are prefixed by
632 # preceding "censored", all censored revisions are prefixed by
629 # "\1\ncensored:". A delta producing such a censored revision must be a
633 # "\1\ncensored:". A delta producing such a censored revision must be a
630 # full-replacement delta, so we inspect the first and only patch in the
634 # full-replacement delta, so we inspect the first and only patch in the
631 # delta for this prefix.
635 # delta for this prefix.
632 hlen = struct.calcsize(b">lll")
636 hlen = struct.calcsize(b">lll")
633 if len(delta) <= hlen:
637 if len(delta) <= hlen:
634 return False
638 return False
635
639
636 oldlen = baselenfn(baserev)
640 oldlen = baselenfn(baserev)
637 newlen = len(delta) - hlen
641 newlen = len(delta) - hlen
638 if delta[:hlen] != mdiff.replacediffheader(oldlen, newlen):
642 if delta[:hlen] != mdiff.replacediffheader(oldlen, newlen):
639 return False
643 return False
640
644
641 add = b"\1\ncensored:"
645 add = b"\1\ncensored:"
642 addlen = len(add)
646 addlen = len(add)
643 return newlen >= addlen and delta[hlen : hlen + addlen] == add
647 return newlen >= addlen and delta[hlen : hlen + addlen] == add
@@ -1,1331 +1,1331 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3
3
4 Setup:
4 Setup:
5
5
6 $ echo a >> a
6 $ echo a >> a
7 $ hg ci -Am 'base'
7 $ hg ci -Am 'base'
8 adding a
8 adding a
9
9
10 Refuse to amend public csets:
10 Refuse to amend public csets:
11
11
12 $ hg phase -r . -p
12 $ hg phase -r . -p
13 $ hg ci --amend
13 $ hg ci --amend
14 abort: cannot amend public changesets: ad120869acf0
14 abort: cannot amend public changesets: ad120869acf0
15 (see 'hg help phases' for details)
15 (see 'hg help phases' for details)
16 [10]
16 [10]
17 $ hg phase -r . -f -d
17 $ hg phase -r . -f -d
18
18
19 $ echo a >> a
19 $ echo a >> a
20 $ hg ci -Am 'base1'
20 $ hg ci -Am 'base1'
21
21
22 Nothing to amend:
22 Nothing to amend:
23
23
24 $ hg ci --amend -m 'base1'
24 $ hg ci --amend -m 'base1'
25 nothing changed
25 nothing changed
26 [1]
26 [1]
27
27
28 $ cat >> $HGRCPATH <<EOF
28 $ cat >> $HGRCPATH <<EOF
29 > [hooks]
29 > [hooks]
30 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
30 > pretxncommit.foo = sh -c "echo \\"pretxncommit \$HG_NODE\\"; hg id -r \$HG_NODE"
31 > EOF
31 > EOF
32
32
33 Amending changeset with changes in working dir:
33 Amending changeset with changes in working dir:
34 (and check that --message does not trigger an editor)
34 (and check that --message does not trigger an editor)
35
35
36 $ echo a >> a
36 $ echo a >> a
37 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
37 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -m 'amend base1'
38 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
38 pretxncommit 43f1ba15f28a50abf0aae529cf8a16bfced7b149
39 43f1ba15f28a tip
39 43f1ba15f28a tip
40 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg
40 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/489edb5b847d-5ab4f721-amend.hg
41 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
41 $ echo 'pretxncommit.foo = ' >> $HGRCPATH
42 $ hg diff -c .
42 $ hg diff -c .
43 diff -r ad120869acf0 -r 43f1ba15f28a a
43 diff -r ad120869acf0 -r 43f1ba15f28a a
44 --- a/a Thu Jan 01 00:00:00 1970 +0000
44 --- a/a Thu Jan 01 00:00:00 1970 +0000
45 +++ b/a Thu Jan 01 00:00:00 1970 +0000
45 +++ b/a Thu Jan 01 00:00:00 1970 +0000
46 @@ -1,1 +1,3 @@
46 @@ -1,1 +1,3 @@
47 a
47 a
48 +a
48 +a
49 +a
49 +a
50 $ hg log
50 $ hg log
51 changeset: 1:43f1ba15f28a
51 changeset: 1:43f1ba15f28a
52 tag: tip
52 tag: tip
53 user: test
53 user: test
54 date: Thu Jan 01 00:00:00 1970 +0000
54 date: Thu Jan 01 00:00:00 1970 +0000
55 summary: amend base1
55 summary: amend base1
56
56
57 changeset: 0:ad120869acf0
57 changeset: 0:ad120869acf0
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: base
60 summary: base
61
61
62
62
63 Check proper abort for empty message
63 Check proper abort for empty message
64
64
65 $ cat > editor.sh << '__EOF__'
65 $ cat > editor.sh << '__EOF__'
66 > #!/bin/sh
66 > #!/bin/sh
67 > echo "" > "$1"
67 > echo "" > "$1"
68 > __EOF__
68 > __EOF__
69
69
70 Update the existing file to ensure that the dirstate is not in pending state
70 Update the existing file to ensure that the dirstate is not in pending state
71 (where the status of some files in the working copy is not known yet). This in
71 (where the status of some files in the working copy is not known yet). This in
72 turn ensures that when the transaction is aborted due to an empty message during
72 turn ensures that when the transaction is aborted due to an empty message during
73 the amend, there should be no rollback.
73 the amend, there should be no rollback.
74 $ echo a >> a
74 $ echo a >> a
75
75
76 $ echo b > b
76 $ echo b > b
77 $ hg add b
77 $ hg add b
78 $ hg summary
78 $ hg summary
79 parent: 1:43f1ba15f28a tip
79 parent: 1:43f1ba15f28a tip
80 amend base1
80 amend base1
81 branch: default
81 branch: default
82 commit: 1 modified, 1 added, 1 unknown
82 commit: 1 modified, 1 added, 1 unknown
83 update: (current)
83 update: (current)
84 phases: 2 draft
84 phases: 2 draft
85 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
85 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
86 abort: empty commit message
86 abort: empty commit message
87 [10]
87 [10]
88 $ hg summary
88 $ hg summary
89 parent: 1:43f1ba15f28a tip
89 parent: 1:43f1ba15f28a tip
90 amend base1
90 amend base1
91 branch: default
91 branch: default
92 commit: 1 modified, 1 added, 1 unknown
92 commit: 1 modified, 1 added, 1 unknown
93 update: (current)
93 update: (current)
94 phases: 2 draft
94 phases: 2 draft
95
95
96 Add new file along with modified existing file:
96 Add new file along with modified existing file:
97 $ hg ci --amend -m 'amend base1 new file'
97 $ hg ci --amend -m 'amend base1 new file'
98 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg
98 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/43f1ba15f28a-007467c2-amend.hg
99
99
100 Remove file that was added in amended commit:
100 Remove file that was added in amended commit:
101 (and test logfile option)
101 (and test logfile option)
102 (and test that logfile option do not trigger an editor)
102 (and test that logfile option do not trigger an editor)
103
103
104 $ hg rm b
104 $ hg rm b
105 $ echo 'amend base1 remove new file' > ../logfile
105 $ echo 'amend base1 remove new file' > ../logfile
106 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
106 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg ci --amend --logfile ../logfile
107 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg
107 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c16295aaf401-1ada9901-amend.hg
108
108
109 $ hg cat b
109 $ hg cat b
110 b: no such file in rev 47343646fa3d
110 b: no such file in rev 47343646fa3d
111 [1]
111 [1]
112
112
113 No changes, just a different message:
113 No changes, just a different message:
114
114
115 $ hg ci -v --amend -m 'no changes, new message'
115 $ hg ci -v --amend -m 'no changes, new message'
116 amending changeset 47343646fa3d
116 amending changeset 47343646fa3d
117 copying changeset 47343646fa3d to ad120869acf0
117 copying changeset 47343646fa3d to ad120869acf0
118 committing files:
118 committing files:
119 a
119 a
120 committing manifest
120 committing manifest
121 committing changelog
121 committing changelog
122 1 changesets found
122 1 changesets found
123 uncompressed size of bundle content:
123 uncompressed size of bundle content:
124 254 (changelog)
124 254 (changelog)
125 163 (manifests)
125 163 (manifests)
126 131 a
126 133 a
127 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/47343646fa3d-c2758885-amend.hg
127 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/47343646fa3d-c2758885-amend.hg
128 1 changesets found
128 1 changesets found
129 uncompressed size of bundle content:
129 uncompressed size of bundle content:
130 250 (changelog)
130 250 (changelog)
131 163 (manifests)
131 163 (manifests)
132 131 a
132 133 a
133 adding branch
133 adding branch
134 adding changesets
134 adding changesets
135 adding manifests
135 adding manifests
136 adding file changes
136 adding file changes
137 added 1 changesets with 1 changes to 1 files
137 added 1 changesets with 1 changes to 1 files
138 committed changeset 1:401431e913a1
138 committed changeset 1:401431e913a1
139 $ hg diff -c .
139 $ hg diff -c .
140 diff -r ad120869acf0 -r 401431e913a1 a
140 diff -r ad120869acf0 -r 401431e913a1 a
141 --- a/a Thu Jan 01 00:00:00 1970 +0000
141 --- a/a Thu Jan 01 00:00:00 1970 +0000
142 +++ b/a Thu Jan 01 00:00:00 1970 +0000
142 +++ b/a Thu Jan 01 00:00:00 1970 +0000
143 @@ -1,1 +1,4 @@
143 @@ -1,1 +1,4 @@
144 a
144 a
145 +a
145 +a
146 +a
146 +a
147 +a
147 +a
148 $ hg log
148 $ hg log
149 changeset: 1:401431e913a1
149 changeset: 1:401431e913a1
150 tag: tip
150 tag: tip
151 user: test
151 user: test
152 date: Thu Jan 01 00:00:00 1970 +0000
152 date: Thu Jan 01 00:00:00 1970 +0000
153 summary: no changes, new message
153 summary: no changes, new message
154
154
155 changeset: 0:ad120869acf0
155 changeset: 0:ad120869acf0
156 user: test
156 user: test
157 date: Thu Jan 01 00:00:00 1970 +0000
157 date: Thu Jan 01 00:00:00 1970 +0000
158 summary: base
158 summary: base
159
159
160
160
161 Disable default date on commit so when -d isn't given, the old date is preserved:
161 Disable default date on commit so when -d isn't given, the old date is preserved:
162
162
163 $ echo '[defaults]' >> $HGRCPATH
163 $ echo '[defaults]' >> $HGRCPATH
164 $ echo 'commit=' >> $HGRCPATH
164 $ echo 'commit=' >> $HGRCPATH
165
165
166 Test -u/-d:
166 Test -u/-d:
167
167
168 $ cat > .hg/checkeditform.sh <<EOF
168 $ cat > .hg/checkeditform.sh <<EOF
169 > env | grep HGEDITFORM
169 > env | grep HGEDITFORM
170 > true
170 > true
171 > EOF
171 > EOF
172 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
172 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -u foo -d '1 0'
173 HGEDITFORM=commit.amend.normal
173 HGEDITFORM=commit.amend.normal
174 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg
174 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/401431e913a1-5e8e532c-amend.hg
175 $ echo a >> a
175 $ echo a >> a
176 $ hg ci --amend -u foo -d '1 0'
176 $ hg ci --amend -u foo -d '1 0'
177 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg
177 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d96b1d28ae33-677e0afb-amend.hg
178 $ hg log -r .
178 $ hg log -r .
179 changeset: 1:a9a13940fc03
179 changeset: 1:a9a13940fc03
180 tag: tip
180 tag: tip
181 user: foo
181 user: foo
182 date: Thu Jan 01 00:00:01 1970 +0000
182 date: Thu Jan 01 00:00:01 1970 +0000
183 summary: no changes, new message
183 summary: no changes, new message
184
184
185
185
186 Open editor with old commit message if a message isn't given otherwise:
186 Open editor with old commit message if a message isn't given otherwise:
187
187
188 $ cat > editor.sh << '__EOF__'
188 $ cat > editor.sh << '__EOF__'
189 > #!/bin/sh
189 > #!/bin/sh
190 > cat $1
190 > cat $1
191 > echo "another precious commit message" > "$1"
191 > echo "another precious commit message" > "$1"
192 > __EOF__
192 > __EOF__
193
193
194 at first, test saving last-message.txt
194 at first, test saving last-message.txt
195
195
196 $ cat > .hg/hgrc << '__EOF__'
196 $ cat > .hg/hgrc << '__EOF__'
197 > [hooks]
197 > [hooks]
198 > pretxncommit.test-saving-last-message = false
198 > pretxncommit.test-saving-last-message = false
199 > __EOF__
199 > __EOF__
200
200
201 $ rm -f .hg/last-message.txt
201 $ rm -f .hg/last-message.txt
202 $ hg commit --amend -v -m "message given from command line"
202 $ hg commit --amend -v -m "message given from command line"
203 amending changeset a9a13940fc03
203 amending changeset a9a13940fc03
204 copying changeset a9a13940fc03 to ad120869acf0
204 copying changeset a9a13940fc03 to ad120869acf0
205 committing files:
205 committing files:
206 a
206 a
207 committing manifest
207 committing manifest
208 committing changelog
208 committing changelog
209 running hook pretxncommit.test-saving-last-message: false
209 running hook pretxncommit.test-saving-last-message: false
210 transaction abort!
210 transaction abort!
211 rollback completed
211 rollback completed
212 abort: pretxncommit.test-saving-last-message hook exited with status 1
212 abort: pretxncommit.test-saving-last-message hook exited with status 1
213 [40]
213 [40]
214 $ cat .hg/last-message.txt
214 $ cat .hg/last-message.txt
215 message given from command line (no-eol)
215 message given from command line (no-eol)
216
216
217 $ rm -f .hg/last-message.txt
217 $ rm -f .hg/last-message.txt
218 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
218 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
219 amending changeset a9a13940fc03
219 amending changeset a9a13940fc03
220 copying changeset a9a13940fc03 to ad120869acf0
220 copying changeset a9a13940fc03 to ad120869acf0
221 no changes, new message
221 no changes, new message
222
222
223
223
224 HG: Enter commit message. Lines beginning with 'HG:' are removed.
224 HG: Enter commit message. Lines beginning with 'HG:' are removed.
225 HG: Leave message empty to abort commit.
225 HG: Leave message empty to abort commit.
226 HG: --
226 HG: --
227 HG: user: foo
227 HG: user: foo
228 HG: branch 'default'
228 HG: branch 'default'
229 HG: changed a
229 HG: changed a
230 committing files:
230 committing files:
231 a
231 a
232 committing manifest
232 committing manifest
233 committing changelog
233 committing changelog
234 running hook pretxncommit.test-saving-last-message: false
234 running hook pretxncommit.test-saving-last-message: false
235 transaction abort!
235 transaction abort!
236 rollback completed
236 rollback completed
237 abort: pretxncommit.test-saving-last-message hook exited with status 1
237 abort: pretxncommit.test-saving-last-message hook exited with status 1
238 [40]
238 [40]
239
239
240 $ cat .hg/last-message.txt
240 $ cat .hg/last-message.txt
241 another precious commit message
241 another precious commit message
242
242
243 $ cat > .hg/hgrc << '__EOF__'
243 $ cat > .hg/hgrc << '__EOF__'
244 > [hooks]
244 > [hooks]
245 > pretxncommit.test-saving-last-message =
245 > pretxncommit.test-saving-last-message =
246 > __EOF__
246 > __EOF__
247
247
248 then, test editing custom commit message
248 then, test editing custom commit message
249
249
250 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
250 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
251 amending changeset a9a13940fc03
251 amending changeset a9a13940fc03
252 copying changeset a9a13940fc03 to ad120869acf0
252 copying changeset a9a13940fc03 to ad120869acf0
253 no changes, new message
253 no changes, new message
254
254
255
255
256 HG: Enter commit message. Lines beginning with 'HG:' are removed.
256 HG: Enter commit message. Lines beginning with 'HG:' are removed.
257 HG: Leave message empty to abort commit.
257 HG: Leave message empty to abort commit.
258 HG: --
258 HG: --
259 HG: user: foo
259 HG: user: foo
260 HG: branch 'default'
260 HG: branch 'default'
261 HG: changed a
261 HG: changed a
262 committing files:
262 committing files:
263 a
263 a
264 committing manifest
264 committing manifest
265 committing changelog
265 committing changelog
266 1 changesets found
266 1 changesets found
267 uncompressed size of bundle content:
267 uncompressed size of bundle content:
268 249 (changelog)
268 249 (changelog)
269 163 (manifests)
269 163 (manifests)
270 133 a
270 135 a
271 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg
271 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a9a13940fc03-7c2e8674-amend.hg
272 1 changesets found
272 1 changesets found
273 uncompressed size of bundle content:
273 uncompressed size of bundle content:
274 257 (changelog)
274 257 (changelog)
275 163 (manifests)
275 163 (manifests)
276 133 a
276 135 a
277 adding branch
277 adding branch
278 adding changesets
278 adding changesets
279 adding manifests
279 adding manifests
280 adding file changes
280 adding file changes
281 added 1 changesets with 1 changes to 1 files
281 added 1 changesets with 1 changes to 1 files
282 committed changeset 1:64a124ba1b44
282 committed changeset 1:64a124ba1b44
283
283
284 Same, but with changes in working dir (different code path):
284 Same, but with changes in working dir (different code path):
285
285
286 $ echo a >> a
286 $ echo a >> a
287 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
287 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend -v
288 amending changeset 64a124ba1b44
288 amending changeset 64a124ba1b44
289 another precious commit message
289 another precious commit message
290
290
291
291
292 HG: Enter commit message. Lines beginning with 'HG:' are removed.
292 HG: Enter commit message. Lines beginning with 'HG:' are removed.
293 HG: Leave message empty to abort commit.
293 HG: Leave message empty to abort commit.
294 HG: --
294 HG: --
295 HG: user: foo
295 HG: user: foo
296 HG: branch 'default'
296 HG: branch 'default'
297 HG: changed a
297 HG: changed a
298 committing files:
298 committing files:
299 a
299 a
300 committing manifest
300 committing manifest
301 committing changelog
301 committing changelog
302 1 changesets found
302 1 changesets found
303 uncompressed size of bundle content:
303 uncompressed size of bundle content:
304 257 (changelog)
304 257 (changelog)
305 163 (manifests)
305 163 (manifests)
306 133 a
306 135 a
307 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg
307 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/64a124ba1b44-10374b8f-amend.hg
308 1 changesets found
308 1 changesets found
309 uncompressed size of bundle content:
309 uncompressed size of bundle content:
310 257 (changelog)
310 257 (changelog)
311 163 (manifests)
311 163 (manifests)
312 135 a
312 137 a
313 adding branch
313 adding branch
314 adding changesets
314 adding changesets
315 adding manifests
315 adding manifests
316 adding file changes
316 adding file changes
317 added 1 changesets with 1 changes to 1 files
317 added 1 changesets with 1 changes to 1 files
318 committed changeset 1:7892795b8e38
318 committed changeset 1:7892795b8e38
319
319
320 $ rm editor.sh
320 $ rm editor.sh
321 $ hg log -r .
321 $ hg log -r .
322 changeset: 1:7892795b8e38
322 changeset: 1:7892795b8e38
323 tag: tip
323 tag: tip
324 user: foo
324 user: foo
325 date: Thu Jan 01 00:00:01 1970 +0000
325 date: Thu Jan 01 00:00:01 1970 +0000
326 summary: another precious commit message
326 summary: another precious commit message
327
327
328
328
329 Moving bookmarks, preserve active bookmark:
329 Moving bookmarks, preserve active bookmark:
330
330
331 $ hg book book1
331 $ hg book book1
332 $ hg book book2
332 $ hg book book2
333 $ hg ci --amend -m 'move bookmarks'
333 $ hg ci --amend -m 'move bookmarks'
334 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg
334 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/7892795b8e38-3fb46217-amend.hg
335 $ hg book
335 $ hg book
336 book1 1:8311f17e2616
336 book1 1:8311f17e2616
337 * book2 1:8311f17e2616
337 * book2 1:8311f17e2616
338 $ echo a >> a
338 $ echo a >> a
339 $ hg ci --amend -m 'move bookmarks'
339 $ hg ci --amend -m 'move bookmarks'
340 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg
340 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/8311f17e2616-f0504fe3-amend.hg
341 $ hg book
341 $ hg book
342 book1 1:a3b65065808c
342 book1 1:a3b65065808c
343 * book2 1:a3b65065808c
343 * book2 1:a3b65065808c
344
344
345 abort does not loose bookmarks
345 abort does not loose bookmarks
346
346
347 $ cat > editor.sh << '__EOF__'
347 $ cat > editor.sh << '__EOF__'
348 > #!/bin/sh
348 > #!/bin/sh
349 > echo "" > "$1"
349 > echo "" > "$1"
350 > __EOF__
350 > __EOF__
351 $ echo a >> a
351 $ echo a >> a
352 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
352 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit --amend
353 abort: empty commit message
353 abort: empty commit message
354 [10]
354 [10]
355 $ hg book
355 $ hg book
356 book1 1:a3b65065808c
356 book1 1:a3b65065808c
357 * book2 1:a3b65065808c
357 * book2 1:a3b65065808c
358 $ hg revert -Caq
358 $ hg revert -Caq
359 $ rm editor.sh
359 $ rm editor.sh
360
360
361 $ echo '[defaults]' >> $HGRCPATH
361 $ echo '[defaults]' >> $HGRCPATH
362 $ echo "commit=-d '0 0'" >> $HGRCPATH
362 $ echo "commit=-d '0 0'" >> $HGRCPATH
363
363
364 Moving branches:
364 Moving branches:
365
365
366 $ hg branch foo
366 $ hg branch foo
367 marked working directory as branch foo
367 marked working directory as branch foo
368 (branches are permanent and global, did you want a bookmark?)
368 (branches are permanent and global, did you want a bookmark?)
369 $ echo a >> a
369 $ echo a >> a
370 $ hg ci -m 'branch foo'
370 $ hg ci -m 'branch foo'
371 $ hg branch default -f
371 $ hg branch default -f
372 marked working directory as branch default
372 marked working directory as branch default
373 $ hg ci --amend -m 'back to default'
373 $ hg ci --amend -m 'back to default'
374 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg
374 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f8339a38efe1-c18453c9-amend.hg
375 $ hg branches
375 $ hg branches
376 default 2:9c07515f2650
376 default 2:9c07515f2650
377
377
378 Close branch:
378 Close branch:
379
379
380 $ hg up -q 0
380 $ hg up -q 0
381 $ echo b >> b
381 $ echo b >> b
382 $ hg branch foo
382 $ hg branch foo
383 marked working directory as branch foo
383 marked working directory as branch foo
384 (branches are permanent and global, did you want a bookmark?)
384 (branches are permanent and global, did you want a bookmark?)
385 $ hg ci -Am 'fork'
385 $ hg ci -Am 'fork'
386 adding b
386 adding b
387 $ echo b >> b
387 $ echo b >> b
388 $ hg ci -mb
388 $ hg ci -mb
389 $ hg ci --amend --close-branch -m 'closing branch foo'
389 $ hg ci --amend --close-branch -m 'closing branch foo'
390 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c962248fa264-54245dc7-amend.hg
390 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/c962248fa264-54245dc7-amend.hg
391
391
392 Same thing, different code path:
392 Same thing, different code path:
393
393
394 $ echo b >> b
394 $ echo b >> b
395 $ hg ci -m 'reopen branch'
395 $ hg ci -m 'reopen branch'
396 reopening closed branch head 4
396 reopening closed branch head 4
397 $ echo b >> b
397 $ echo b >> b
398 $ hg ci --amend --close-branch
398 $ hg ci --amend --close-branch
399 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/027371728205-b900d9fa-amend.hg
399 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/027371728205-b900d9fa-amend.hg
400 $ hg branches
400 $ hg branches
401 default 2:9c07515f2650
401 default 2:9c07515f2650
402
402
403 Refuse to amend during a merge:
403 Refuse to amend during a merge:
404
404
405 $ hg up -q default
405 $ hg up -q default
406 $ hg merge foo
406 $ hg merge foo
407 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 (branch merge, don't forget to commit)
408 (branch merge, don't forget to commit)
409 $ hg ci --amend
409 $ hg ci --amend
410 abort: cannot amend changesets while merging
410 abort: cannot amend changesets while merging
411 [20]
411 [20]
412 $ hg ci -m 'merge'
412 $ hg ci -m 'merge'
413
413
414 Refuse to amend if there is a merge conflict (issue5805):
414 Refuse to amend if there is a merge conflict (issue5805):
415
415
416 $ hg up -q foo
416 $ hg up -q foo
417 $ echo c > a
417 $ echo c > a
418 $ hg up default -t :fail
418 $ hg up default -t :fail
419 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
419 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
420 use 'hg resolve' to retry unresolved file merges
420 use 'hg resolve' to retry unresolved file merges
421 [1]
421 [1]
422 $ hg resolve -l
422 $ hg resolve -l
423 U a
423 U a
424
424
425 $ hg ci --amend
425 $ hg ci --amend
426 abort: unresolved merge conflicts (see 'hg help resolve')
426 abort: unresolved merge conflicts (see 'hg help resolve')
427 [20]
427 [20]
428
428
429 $ hg up -qC .
429 $ hg up -qC .
430
430
431 Follow copies/renames:
431 Follow copies/renames:
432
432
433 $ hg mv b c
433 $ hg mv b c
434 $ hg ci -m 'b -> c'
434 $ hg ci -m 'b -> c'
435 $ hg mv c d
435 $ hg mv c d
436 $ hg ci --amend -m 'b -> d'
436 $ hg ci --amend -m 'b -> d'
437 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg
437 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/42f3f27a067d-f23cc9f7-amend.hg
438 $ hg st --rev '.^' --copies d
438 $ hg st --rev '.^' --copies d
439 A d
439 A d
440 b
440 b
441 $ hg cp d e
441 $ hg cp d e
442 $ hg ci -m 'e = d'
442 $ hg ci -m 'e = d'
443 $ hg cp e f
443 $ hg cp e f
444 $ hg ci --amend -m 'f = d'
444 $ hg ci --amend -m 'f = d'
445 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9198f73182d5-251d584a-amend.hg
445 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9198f73182d5-251d584a-amend.hg
446 $ hg st --rev '.^' --copies f
446 $ hg st --rev '.^' --copies f
447 A f
447 A f
448 d
448 d
449
449
450 $ mv f f.orig
450 $ mv f f.orig
451 $ hg rm -A f
451 $ hg rm -A f
452 $ hg ci -m removef
452 $ hg ci -m removef
453 $ hg cp a f
453 $ hg cp a f
454 $ mv f.orig f
454 $ mv f.orig f
455 $ hg ci --amend -m replacef
455 $ hg ci --amend -m replacef
456 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg
456 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f0993ab6b482-eda301bf-amend.hg
457 $ hg st --change . --copies
457 $ hg st --change . --copies
458 $ hg log -r . --template "{file_copies}\n"
458 $ hg log -r . --template "{file_copies}\n"
459
459
460
460
461 Move added file (issue3410):
461 Move added file (issue3410):
462
462
463 $ echo g >> g
463 $ echo g >> g
464 $ hg ci -Am g
464 $ hg ci -Am g
465 adding g
465 adding g
466 $ hg mv g h
466 $ hg mv g h
467 $ hg ci --amend
467 $ hg ci --amend
468 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg
468 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/58585e3f095c-0f5ebcda-amend.hg
469 $ hg st --change . --copies h
469 $ hg st --change . --copies h
470 A h
470 A h
471 $ hg log -r . --template "{file_copies}\n"
471 $ hg log -r . --template "{file_copies}\n"
472
472
473
473
474 Can't rollback an amend:
474 Can't rollback an amend:
475
475
476 $ hg rollback
476 $ hg rollback
477 no rollback information available
477 no rollback information available
478 [1]
478 [1]
479
479
480 Preserve extra dict (issue3430):
480 Preserve extra dict (issue3430):
481
481
482 $ hg branch a
482 $ hg branch a
483 marked working directory as branch a
483 marked working directory as branch a
484 (branches are permanent and global, did you want a bookmark?)
484 (branches are permanent and global, did you want a bookmark?)
485 $ echo a >> a
485 $ echo a >> a
486 $ hg ci -ma
486 $ hg ci -ma
487 $ hg ci --amend -m "a'"
487 $ hg ci --amend -m "a'"
488 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg
488 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/39a162f1d65e-9dfe13d8-amend.hg
489 $ hg log -r . --template "{branch}\n"
489 $ hg log -r . --template "{branch}\n"
490 a
490 a
491 $ hg ci --amend -m "a''"
491 $ hg ci --amend -m "a''"
492 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg
492 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d5ca7b1ac72b-0b4c1a34-amend.hg
493 $ hg log -r . --template "{branch}\n"
493 $ hg log -r . --template "{branch}\n"
494 a
494 a
495
495
496 Also preserve other entries in the dict that are in the old commit,
496 Also preserve other entries in the dict that are in the old commit,
497 first graft something so there's an additional entry:
497 first graft something so there's an additional entry:
498
498
499 $ hg up 0 -q
499 $ hg up 0 -q
500 $ echo z > z
500 $ echo z > z
501 $ hg ci -Am 'fork'
501 $ hg ci -Am 'fork'
502 adding z
502 adding z
503 created new head
503 created new head
504 $ hg up 11
504 $ hg up 11
505 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
505 5 files updated, 0 files merged, 1 files removed, 0 files unresolved
506 $ hg graft 12
506 $ hg graft 12
507 grafting 12:2647734878ef "fork" (tip)
507 grafting 12:2647734878ef "fork" (tip)
508 $ hg ci --amend -m 'graft amend'
508 $ hg ci --amend -m 'graft amend'
509 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg
509 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/fe8c6f7957ca-25638666-amend.hg
510 $ hg log -r . --debug | grep extra
510 $ hg log -r . --debug | grep extra
511 extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60
511 extra: amend_source=fe8c6f7957ca1665ed77496ed7a07657d469ac60
512 extra: branch=a
512 extra: branch=a
513 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
513 extra: source=2647734878ef0236dda712fae9c1651cf694ea8a
514
514
515 Preserve phase
515 Preserve phase
516
516
517 $ hg phase '.^::.'
517 $ hg phase '.^::.'
518 11: draft
518 11: draft
519 13: draft
519 13: draft
520 $ hg phase --secret --force .
520 $ hg phase --secret --force .
521 $ hg phase '.^::.'
521 $ hg phase '.^::.'
522 11: draft
522 11: draft
523 13: secret
523 13: secret
524 $ hg commit --amend -m 'amend for phase' -q
524 $ hg commit --amend -m 'amend for phase' -q
525 $ hg phase '.^::.'
525 $ hg phase '.^::.'
526 11: draft
526 11: draft
527 13: secret
527 13: secret
528
528
529 Test amend with obsolete
529 Test amend with obsolete
530 ---------------------------
530 ---------------------------
531
531
532 Enable obsolete
532 Enable obsolete
533
533
534 $ cat >> $HGRCPATH << EOF
534 $ cat >> $HGRCPATH << EOF
535 > [experimental]
535 > [experimental]
536 > evolution.createmarkers=True
536 > evolution.createmarkers=True
537 > evolution.allowunstable=True
537 > evolution.allowunstable=True
538 > EOF
538 > EOF
539
539
540 Amend with no files changes
540 Amend with no files changes
541
541
542 $ hg id -n
542 $ hg id -n
543 13
543 13
544 $ hg ci --amend -m 'babar'
544 $ hg ci --amend -m 'babar'
545 $ hg id -n
545 $ hg id -n
546 14
546 14
547 $ hg log -Gl 3 --style=compact
547 $ hg log -Gl 3 --style=compact
548 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
548 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
549 | babar
549 | babar
550 |
550 |
551 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
551 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
552 | | fork
552 | | fork
553 | ~
553 | ~
554 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
554 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
555 | a''
555 | a''
556 ~
556 ~
557 $ hg log -Gl 4 --hidden --style=compact
557 $ hg log -Gl 4 --hidden --style=compact
558 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
558 @ 14[tip]:11 682950e85999 1970-01-01 00:00 +0000 test
559 | babar
559 | babar
560 |
560 |
561 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
561 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
562 |/ amend for phase
562 |/ amend for phase
563 |
563 |
564 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
564 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
565 | | fork
565 | | fork
566 | ~
566 | ~
567 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
567 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
568 | a''
568 | a''
569 ~
569 ~
570
570
571 Amend with files changes
571 Amend with files changes
572
572
573 (note: the extra commit over 15 is a temporary junk I would be happy to get
573 (note: the extra commit over 15 is a temporary junk I would be happy to get
574 ride of)
574 ride of)
575
575
576 $ echo 'babar' >> a
576 $ echo 'babar' >> a
577 $ hg commit --amend
577 $ hg commit --amend
578 $ hg log -Gl 6 --hidden --style=compact
578 $ hg log -Gl 6 --hidden --style=compact
579 @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test
579 @ 15[tip]:11 a5b42b49b0d5 1970-01-01 00:00 +0000 test
580 | babar
580 | babar
581 |
581 |
582 | x 14:11 682950e85999 1970-01-01 00:00 +0000 test
582 | x 14:11 682950e85999 1970-01-01 00:00 +0000 test
583 |/ babar
583 |/ babar
584 |
584 |
585 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
585 | x 13:11 5167600b0f7a 1970-01-01 00:00 +0000 test
586 |/ amend for phase
586 |/ amend for phase
587 |
587 |
588 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
588 | o 12:0 2647734878ef 1970-01-01 00:00 +0000 test
589 | | fork
589 | | fork
590 | ~
590 | ~
591 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
591 o 11 0ddb275cfad1 1970-01-01 00:00 +0000 test
592 | a''
592 | a''
593 |
593 |
594 o 10 5fa75032e226 1970-01-01 00:00 +0000 test
594 o 10 5fa75032e226 1970-01-01 00:00 +0000 test
595 | g
595 | g
596 ~
596 ~
597
597
598
598
599 Test that amend does not make it easy to create obsolescence cycle
599 Test that amend does not make it easy to create obsolescence cycle
600 ---------------------------------------------------------------------
600 ---------------------------------------------------------------------
601
601
602 $ hg id -r 14 --hidden
602 $ hg id -r 14 --hidden
603 682950e85999 (a)
603 682950e85999 (a)
604 $ hg revert -ar 14 --hidden
604 $ hg revert -ar 14 --hidden
605 reverting a
605 reverting a
606 $ hg commit --amend
606 $ hg commit --amend
607 $ hg id
607 $ hg id
608 37973c7e0b61 (a) tip
608 37973c7e0b61 (a) tip
609
609
610 Test that rewriting leaving instability behind is allowed
610 Test that rewriting leaving instability behind is allowed
611 ---------------------------------------------------------------------
611 ---------------------------------------------------------------------
612
612
613 $ hg up '.^'
613 $ hg up '.^'
614 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
614 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
615 $ echo 'b' >> a
615 $ echo 'b' >> a
616 $ hg log --style compact -r 'children(.)'
616 $ hg log --style compact -r 'children(.)'
617 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test
617 16[tip]:11 37973c7e0b61 1970-01-01 00:00 +0000 test
618 babar
618 babar
619
619
620 $ hg commit --amend
620 $ hg commit --amend
621 1 new orphan changesets
621 1 new orphan changesets
622 $ hg log -r 'orphan()'
622 $ hg log -r 'orphan()'
623 changeset: 16:37973c7e0b61
623 changeset: 16:37973c7e0b61
624 branch: a
624 branch: a
625 parent: 11:0ddb275cfad1
625 parent: 11:0ddb275cfad1
626 user: test
626 user: test
627 date: Thu Jan 01 00:00:00 1970 +0000
627 date: Thu Jan 01 00:00:00 1970 +0000
628 instability: orphan
628 instability: orphan
629 summary: babar
629 summary: babar
630
630
631
631
632 Amend a merge changeset (with renames and conflicts from the second parent):
632 Amend a merge changeset (with renames and conflicts from the second parent):
633
633
634 $ hg up -q default
634 $ hg up -q default
635 $ hg branch -q bar
635 $ hg branch -q bar
636 $ hg cp a aa
636 $ hg cp a aa
637 $ hg mv z zz
637 $ hg mv z zz
638 $ echo cc > cc
638 $ echo cc > cc
639 $ hg add cc
639 $ hg add cc
640 $ hg ci -m aazzcc
640 $ hg ci -m aazzcc
641 $ hg up -q default
641 $ hg up -q default
642 $ echo a >> a
642 $ echo a >> a
643 $ echo dd > cc
643 $ echo dd > cc
644 $ hg add cc
644 $ hg add cc
645 $ hg ci -m aa
645 $ hg ci -m aa
646 $ hg merge -q bar
646 $ hg merge -q bar
647 warning: conflicts while merging cc! (edit, then use 'hg resolve --mark')
647 warning: conflicts while merging cc! (edit, then use 'hg resolve --mark')
648 [1]
648 [1]
649 $ hg resolve -m cc
649 $ hg resolve -m cc
650 (no more unresolved files)
650 (no more unresolved files)
651 $ hg ci -m 'merge bar'
651 $ hg ci -m 'merge bar'
652 $ hg log --config diff.git=1 -pr .
652 $ hg log --config diff.git=1 -pr .
653 changeset: 20:5aba7f3726e6
653 changeset: 20:5aba7f3726e6
654 tag: tip
654 tag: tip
655 parent: 19:30d96aeaf27b
655 parent: 19:30d96aeaf27b
656 parent: 18:1aa437659d19
656 parent: 18:1aa437659d19
657 user: test
657 user: test
658 date: Thu Jan 01 00:00:00 1970 +0000
658 date: Thu Jan 01 00:00:00 1970 +0000
659 summary: merge bar
659 summary: merge bar
660
660
661 diff --git a/a b/aa
661 diff --git a/a b/aa
662 copy from a
662 copy from a
663 copy to aa
663 copy to aa
664 diff --git a/cc b/cc
664 diff --git a/cc b/cc
665 --- a/cc
665 --- a/cc
666 +++ b/cc
666 +++ b/cc
667 @@ -1,1 +1,5 @@
667 @@ -1,1 +1,5 @@
668 +<<<<<<< working copy: 30d96aeaf27b - test: aa
668 +<<<<<<< working copy: 30d96aeaf27b - test: aa
669 dd
669 dd
670 +=======
670 +=======
671 +cc
671 +cc
672 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
672 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
673 diff --git a/z b/zz
673 diff --git a/z b/zz
674 rename from z
674 rename from z
675 rename to zz
675 rename to zz
676
676
677 $ hg debugrename aa
677 $ hg debugrename aa
678 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
678 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
679 $ hg debugrename zz
679 $ hg debugrename zz
680 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
680 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
681 $ hg debugrename cc
681 $ hg debugrename cc
682 cc not renamed
682 cc not renamed
683 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
683 $ HGEDITOR="sh .hg/checkeditform.sh" hg ci --amend -m 'merge bar (amend message)' --edit
684 HGEDITFORM=commit.amend.merge
684 HGEDITFORM=commit.amend.merge
685 $ hg log --config diff.git=1 -pr .
685 $ hg log --config diff.git=1 -pr .
686 changeset: 21:4b0631ef043e
686 changeset: 21:4b0631ef043e
687 tag: tip
687 tag: tip
688 parent: 19:30d96aeaf27b
688 parent: 19:30d96aeaf27b
689 parent: 18:1aa437659d19
689 parent: 18:1aa437659d19
690 user: test
690 user: test
691 date: Thu Jan 01 00:00:00 1970 +0000
691 date: Thu Jan 01 00:00:00 1970 +0000
692 summary: merge bar (amend message)
692 summary: merge bar (amend message)
693
693
694 diff --git a/a b/aa
694 diff --git a/a b/aa
695 copy from a
695 copy from a
696 copy to aa
696 copy to aa
697 diff --git a/cc b/cc
697 diff --git a/cc b/cc
698 --- a/cc
698 --- a/cc
699 +++ b/cc
699 +++ b/cc
700 @@ -1,1 +1,5 @@
700 @@ -1,1 +1,5 @@
701 +<<<<<<< working copy: 30d96aeaf27b - test: aa
701 +<<<<<<< working copy: 30d96aeaf27b - test: aa
702 dd
702 dd
703 +=======
703 +=======
704 +cc
704 +cc
705 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
705 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
706 diff --git a/z b/zz
706 diff --git a/z b/zz
707 rename from z
707 rename from z
708 rename to zz
708 rename to zz
709
709
710 $ hg debugrename aa
710 $ hg debugrename aa
711 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
711 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
712 $ hg debugrename zz
712 $ hg debugrename zz
713 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
713 zz renamed from z:69a1b67522704ec122181c0890bd16e9d3e7516a
714 $ hg debugrename cc
714 $ hg debugrename cc
715 cc not renamed
715 cc not renamed
716 $ hg mv zz z
716 $ hg mv zz z
717 $ hg ci --amend -m 'merge bar (undo rename)'
717 $ hg ci --amend -m 'merge bar (undo rename)'
718 $ hg log --config diff.git=1 -pr .
718 $ hg log --config diff.git=1 -pr .
719 changeset: 22:06423be42d60
719 changeset: 22:06423be42d60
720 tag: tip
720 tag: tip
721 parent: 19:30d96aeaf27b
721 parent: 19:30d96aeaf27b
722 parent: 18:1aa437659d19
722 parent: 18:1aa437659d19
723 user: test
723 user: test
724 date: Thu Jan 01 00:00:00 1970 +0000
724 date: Thu Jan 01 00:00:00 1970 +0000
725 summary: merge bar (undo rename)
725 summary: merge bar (undo rename)
726
726
727 diff --git a/a b/aa
727 diff --git a/a b/aa
728 copy from a
728 copy from a
729 copy to aa
729 copy to aa
730 diff --git a/cc b/cc
730 diff --git a/cc b/cc
731 --- a/cc
731 --- a/cc
732 +++ b/cc
732 +++ b/cc
733 @@ -1,1 +1,5 @@
733 @@ -1,1 +1,5 @@
734 +<<<<<<< working copy: 30d96aeaf27b - test: aa
734 +<<<<<<< working copy: 30d96aeaf27b - test: aa
735 dd
735 dd
736 +=======
736 +=======
737 +cc
737 +cc
738 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
738 +>>>>>>> merge rev: 1aa437659d19 bar - test: aazzcc
739
739
740 $ hg debugrename z
740 $ hg debugrename z
741 z not renamed
741 z not renamed
742
742
743 Amend a merge changeset (with renames during the merge):
743 Amend a merge changeset (with renames during the merge):
744
744
745 $ hg up -q bar
745 $ hg up -q bar
746 $ echo x > x
746 $ echo x > x
747 $ hg add x
747 $ hg add x
748 $ hg ci -m x
748 $ hg ci -m x
749 $ hg up -q default
749 $ hg up -q default
750 $ hg merge -q bar
750 $ hg merge -q bar
751 $ hg mv aa aaa
751 $ hg mv aa aaa
752 $ echo aa >> aaa
752 $ echo aa >> aaa
753 $ hg ci -m 'merge bar again'
753 $ hg ci -m 'merge bar again'
754 $ hg log --config diff.git=1 -pr .
754 $ hg log --config diff.git=1 -pr .
755 changeset: 24:a89974a20457
755 changeset: 24:a89974a20457
756 tag: tip
756 tag: tip
757 parent: 22:06423be42d60
757 parent: 22:06423be42d60
758 parent: 23:4c94d5bc65f5
758 parent: 23:4c94d5bc65f5
759 user: test
759 user: test
760 date: Thu Jan 01 00:00:00 1970 +0000
760 date: Thu Jan 01 00:00:00 1970 +0000
761 summary: merge bar again
761 summary: merge bar again
762
762
763 diff --git a/aa b/aa
763 diff --git a/aa b/aa
764 deleted file mode 100644
764 deleted file mode 100644
765 --- a/aa
765 --- a/aa
766 +++ /dev/null
766 +++ /dev/null
767 @@ -1,2 +0,0 @@
767 @@ -1,2 +0,0 @@
768 -a
768 -a
769 -a
769 -a
770 diff --git a/aaa b/aaa
770 diff --git a/aaa b/aaa
771 new file mode 100644
771 new file mode 100644
772 --- /dev/null
772 --- /dev/null
773 +++ b/aaa
773 +++ b/aaa
774 @@ -0,0 +1,3 @@
774 @@ -0,0 +1,3 @@
775 +a
775 +a
776 +a
776 +a
777 +aa
777 +aa
778 diff --git a/x b/x
778 diff --git a/x b/x
779 new file mode 100644
779 new file mode 100644
780 --- /dev/null
780 --- /dev/null
781 +++ b/x
781 +++ b/x
782 @@ -0,0 +1,1 @@
782 @@ -0,0 +1,1 @@
783 +x
783 +x
784
784
785 $ hg debugrename aaa
785 $ hg debugrename aaa
786 aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
786 aaa renamed from aa:37d9b5d994eab34eda9c16b195ace52c7b129980
787
787
788 Update to p1 with 'aaa' modified. 'aaa' was renamed from 'aa' in p2. 'aa' exists
788 Update to p1 with 'aaa' modified. 'aaa' was renamed from 'aa' in p2. 'aa' exists
789 in p1 too, but it was recorded as copied from p2.
789 in p1 too, but it was recorded as copied from p2.
790 $ echo modified >> aaa
790 $ echo modified >> aaa
791 $ hg co -m '.^' -t :merge3
791 $ hg co -m '.^' -t :merge3
792 file 'aaa' was deleted in other [destination] but was modified in local [working copy].
792 file 'aaa' was deleted in other [destination] but was modified in local [working copy].
793 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
793 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
794 What do you want to do? u
794 What do you want to do? u
795 1 files updated, 0 files merged, 1 files removed, 1 files unresolved
795 1 files updated, 0 files merged, 1 files removed, 1 files unresolved
796 use 'hg resolve' to retry unresolved file merges
796 use 'hg resolve' to retry unresolved file merges
797 [1]
797 [1]
798 $ hg co -C tip
798 $ hg co -C tip
799 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
799 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
800
800
801 $ hg mv aaa aa
801 $ hg mv aaa aa
802 $ hg ci --amend -m 'merge bar again (undo rename)'
802 $ hg ci --amend -m 'merge bar again (undo rename)'
803 $ hg log --config diff.git=1 -pr .
803 $ hg log --config diff.git=1 -pr .
804 changeset: 25:282080768800
804 changeset: 25:282080768800
805 tag: tip
805 tag: tip
806 parent: 22:06423be42d60
806 parent: 22:06423be42d60
807 parent: 23:4c94d5bc65f5
807 parent: 23:4c94d5bc65f5
808 user: test
808 user: test
809 date: Thu Jan 01 00:00:00 1970 +0000
809 date: Thu Jan 01 00:00:00 1970 +0000
810 summary: merge bar again (undo rename)
810 summary: merge bar again (undo rename)
811
811
812 diff --git a/aa b/aa
812 diff --git a/aa b/aa
813 --- a/aa
813 --- a/aa
814 +++ b/aa
814 +++ b/aa
815 @@ -1,2 +1,3 @@
815 @@ -1,2 +1,3 @@
816 a
816 a
817 a
817 a
818 +aa
818 +aa
819 diff --git a/x b/x
819 diff --git a/x b/x
820 new file mode 100644
820 new file mode 100644
821 --- /dev/null
821 --- /dev/null
822 +++ b/x
822 +++ b/x
823 @@ -0,0 +1,1 @@
823 @@ -0,0 +1,1 @@
824 +x
824 +x
825
825
826 $ hg debugrename aa
826 $ hg debugrename aa
827 aa not renamed
827 aa not renamed
828 $ hg debugrename -r '.^' aa
828 $ hg debugrename -r '.^' aa
829 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
829 aa renamed from a:a80d06849b333b8a3d5c445f8ba3142010dcdc9e
830
830
831 Amend a merge changeset (with manifest-level conflicts):
831 Amend a merge changeset (with manifest-level conflicts):
832
832
833 $ hg up -q bar
833 $ hg up -q bar
834 $ hg rm aa
834 $ hg rm aa
835 $ hg ci -m 'rm aa'
835 $ hg ci -m 'rm aa'
836 $ hg up -q default
836 $ hg up -q default
837 $ echo aa >> aa
837 $ echo aa >> aa
838 $ hg ci -m aa
838 $ hg ci -m aa
839 $ hg merge -q bar --config ui.interactive=True << EOF
839 $ hg merge -q bar --config ui.interactive=True << EOF
840 > c
840 > c
841 > EOF
841 > EOF
842 file 'aa' was deleted in other [merge rev] but was modified in local [working copy].
842 file 'aa' was deleted in other [merge rev] but was modified in local [working copy].
843 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
843 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
844 What do you want to do? c
844 What do you want to do? c
845 $ hg ci -m 'merge bar (with conflicts)'
845 $ hg ci -m 'merge bar (with conflicts)'
846 $ hg log --config diff.git=1 -pr .
846 $ hg log --config diff.git=1 -pr .
847 changeset: 28:ed15db12298d
847 changeset: 28:ed15db12298d
848 tag: tip
848 tag: tip
849 parent: 27:eb5adec0b43b
849 parent: 27:eb5adec0b43b
850 parent: 26:67db8847a540
850 parent: 26:67db8847a540
851 user: test
851 user: test
852 date: Thu Jan 01 00:00:00 1970 +0000
852 date: Thu Jan 01 00:00:00 1970 +0000
853 summary: merge bar (with conflicts)
853 summary: merge bar (with conflicts)
854
854
855
855
856 $ hg rm aa
856 $ hg rm aa
857 $ hg ci --amend -m 'merge bar (with conflicts, amended)'
857 $ hg ci --amend -m 'merge bar (with conflicts, amended)'
858 $ hg log --config diff.git=1 -pr .
858 $ hg log --config diff.git=1 -pr .
859 changeset: 29:0eeafd043f63
859 changeset: 29:0eeafd043f63
860 tag: tip
860 tag: tip
861 parent: 27:eb5adec0b43b
861 parent: 27:eb5adec0b43b
862 parent: 26:67db8847a540
862 parent: 26:67db8847a540
863 user: test
863 user: test
864 date: Thu Jan 01 00:00:00 1970 +0000
864 date: Thu Jan 01 00:00:00 1970 +0000
865 summary: merge bar (with conflicts, amended)
865 summary: merge bar (with conflicts, amended)
866
866
867 diff --git a/aa b/aa
867 diff --git a/aa b/aa
868 deleted file mode 100644
868 deleted file mode 100644
869 --- a/aa
869 --- a/aa
870 +++ /dev/null
870 +++ /dev/null
871 @@ -1,4 +0,0 @@
871 @@ -1,4 +0,0 @@
872 -a
872 -a
873 -a
873 -a
874 -aa
874 -aa
875 -aa
875 -aa
876
876
877 Issue 3445: amending with --close-branch a commit that created a new head should fail
877 Issue 3445: amending with --close-branch a commit that created a new head should fail
878 This shouldn't be possible:
878 This shouldn't be possible:
879
879
880 $ hg up -q default
880 $ hg up -q default
881 $ hg branch closewithamend
881 $ hg branch closewithamend
882 marked working directory as branch closewithamend
882 marked working directory as branch closewithamend
883 $ echo foo > foo
883 $ echo foo > foo
884 $ hg add foo
884 $ hg add foo
885 $ hg ci -m..
885 $ hg ci -m..
886 $ hg ci --amend --close-branch -m 'closing'
886 $ hg ci --amend --close-branch -m 'closing'
887 abort: can only close branch heads
887 abort: can only close branch heads
888 [10]
888 [10]
889
889
890 This silliness fails:
890 This silliness fails:
891
891
892 $ hg branch silliness
892 $ hg branch silliness
893 marked working directory as branch silliness
893 marked working directory as branch silliness
894 $ echo b >> b
894 $ echo b >> b
895 $ hg ci --close-branch -m'open and close'
895 $ hg ci --close-branch -m'open and close'
896 abort: branch "silliness" has no heads to close
896 abort: branch "silliness" has no heads to close
897 [10]
897 [10]
898
898
899 Test that amend with --secret creates new secret changeset forcibly
899 Test that amend with --secret creates new secret changeset forcibly
900 ---------------------------------------------------------------------
900 ---------------------------------------------------------------------
901
901
902 $ hg phase '.^::.'
902 $ hg phase '.^::.'
903 29: draft
903 29: draft
904 30: draft
904 30: draft
905 $ hg commit --amend --secret -m 'amend as secret' -q
905 $ hg commit --amend --secret -m 'amend as secret' -q
906 $ hg phase '.^::.'
906 $ hg phase '.^::.'
907 29: draft
907 29: draft
908 31: secret
908 31: secret
909
909
910 Test that amend with --edit invokes editor forcibly
910 Test that amend with --edit invokes editor forcibly
911 ---------------------------------------------------
911 ---------------------------------------------------
912
912
913 $ hg parents --template "{desc}\n"
913 $ hg parents --template "{desc}\n"
914 amend as secret
914 amend as secret
915 $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
915 $ HGEDITOR=cat hg commit --amend -m "editor should be suppressed"
916 $ hg parents --template "{desc}\n"
916 $ hg parents --template "{desc}\n"
917 editor should be suppressed
917 editor should be suppressed
918
918
919 $ hg status --rev '.^1::.'
919 $ hg status --rev '.^1::.'
920 A foo
920 A foo
921 $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit
921 $ HGEDITOR=cat hg commit --amend -m "editor should be invoked" --edit
922 editor should be invoked
922 editor should be invoked
923
923
924
924
925 HG: Enter commit message. Lines beginning with 'HG:' are removed.
925 HG: Enter commit message. Lines beginning with 'HG:' are removed.
926 HG: Leave message empty to abort commit.
926 HG: Leave message empty to abort commit.
927 HG: --
927 HG: --
928 HG: user: test
928 HG: user: test
929 HG: branch 'silliness'
929 HG: branch 'silliness'
930 HG: added foo
930 HG: added foo
931 $ hg parents --template "{desc}\n"
931 $ hg parents --template "{desc}\n"
932 editor should be invoked
932 editor should be invoked
933
933
934 Test that amend with --no-edit avoids the editor
934 Test that amend with --no-edit avoids the editor
935 ------------------------------------------------
935 ------------------------------------------------
936
936
937 $ hg commit --amend -m "before anything happens"
937 $ hg commit --amend -m "before anything happens"
938 $ hg parents --template "{desc}\n"
938 $ hg parents --template "{desc}\n"
939 before anything happens
939 before anything happens
940 $ HGEDITOR=cat hg commit --amend --no-edit -m "editor should be suppressed"
940 $ HGEDITOR=cat hg commit --amend --no-edit -m "editor should be suppressed"
941 $ hg parents --template "{desc}\n"
941 $ hg parents --template "{desc}\n"
942 editor should be suppressed
942 editor should be suppressed
943
943
944 (We need a file change here since we won't have a message change)
944 (We need a file change here since we won't have a message change)
945 $ cp foo foo.orig
945 $ cp foo foo.orig
946 $ echo hi >> foo
946 $ echo hi >> foo
947 $ HGEDITOR=cat hg commit --amend --no-edit
947 $ HGEDITOR=cat hg commit --amend --no-edit
948 $ hg parents --template "{desc}\n"
948 $ hg parents --template "{desc}\n"
949 editor should be suppressed
949 editor should be suppressed
950 $ hg status -mar
950 $ hg status -mar
951 (Let's undo adding that "hi" so later tests don't need to be adjusted)
951 (Let's undo adding that "hi" so later tests don't need to be adjusted)
952 $ mv foo.orig foo
952 $ mv foo.orig foo
953 $ hg commit --amend --no-edit
953 $ hg commit --amend --no-edit
954
954
955 Test that "diff()" in committemplate works correctly for amending
955 Test that "diff()" in committemplate works correctly for amending
956 -----------------------------------------------------------------
956 -----------------------------------------------------------------
957
957
958 $ cat >> .hg/hgrc <<EOF
958 $ cat >> .hg/hgrc <<EOF
959 > [committemplate]
959 > [committemplate]
960 > changeset.commit.amend = {desc}\n
960 > changeset.commit.amend = {desc}\n
961 > HG: {revset('parents()') % 'parent: {desc|firstline}\n'}
961 > HG: {revset('parents()') % 'parent: {desc|firstline}\n'}
962 > HG: M: {file_mods}
962 > HG: M: {file_mods}
963 > HG: A: {file_adds}
963 > HG: A: {file_adds}
964 > HG: R: {file_dels}
964 > HG: R: {file_dels}
965 > {splitlines(diff()) % 'HG: {line}\n'}
965 > {splitlines(diff()) % 'HG: {line}\n'}
966 > EOF
966 > EOF
967
967
968 $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
968 $ hg parents --template "M: {file_mods}\nA: {file_adds}\nR: {file_dels}\n"
969 M:
969 M:
970 A: foo
970 A: foo
971 R:
971 R:
972 $ hg status -amr
972 $ hg status -amr
973 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
973 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo"
974 expecting diff of foo
974 expecting diff of foo
975
975
976 HG: parent: editor should be suppressed
976 HG: parent: editor should be suppressed
977
977
978 HG: M:
978 HG: M:
979 HG: A: foo
979 HG: A: foo
980 HG: R:
980 HG: R:
981 HG: diff -r 0eeafd043f63 foo
981 HG: diff -r 0eeafd043f63 foo
982 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
982 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
983 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
983 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
984 HG: @@ -0,0 +1,1 @@
984 HG: @@ -0,0 +1,1 @@
985 HG: +foo
985 HG: +foo
986
986
987 $ echo y > y
987 $ echo y > y
988 $ hg add y
988 $ hg add y
989 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
989 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of foo and y"
990 expecting diff of foo and y
990 expecting diff of foo and y
991
991
992 HG: parent: expecting diff of foo
992 HG: parent: expecting diff of foo
993
993
994 HG: M:
994 HG: M:
995 HG: A: foo y
995 HG: A: foo y
996 HG: R:
996 HG: R:
997 HG: diff -r 0eeafd043f63 foo
997 HG: diff -r 0eeafd043f63 foo
998 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
998 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
999 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
999 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1000 HG: @@ -0,0 +1,1 @@
1000 HG: @@ -0,0 +1,1 @@
1001 HG: +foo
1001 HG: +foo
1002 HG: diff -r 0eeafd043f63 y
1002 HG: diff -r 0eeafd043f63 y
1003 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1003 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1004 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1004 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1005 HG: @@ -0,0 +1,1 @@
1005 HG: @@ -0,0 +1,1 @@
1006 HG: +y
1006 HG: +y
1007
1007
1008 $ hg rm a
1008 $ hg rm a
1009 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
1009 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo and y"
1010 expecting diff of a, foo and y
1010 expecting diff of a, foo and y
1011
1011
1012 HG: parent: expecting diff of foo and y
1012 HG: parent: expecting diff of foo and y
1013
1013
1014 HG: M:
1014 HG: M:
1015 HG: A: foo y
1015 HG: A: foo y
1016 HG: R: a
1016 HG: R: a
1017 HG: diff -r 0eeafd043f63 a
1017 HG: diff -r 0eeafd043f63 a
1018 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1018 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1019 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1019 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1020 HG: @@ -1,2 +0,0 @@
1020 HG: @@ -1,2 +0,0 @@
1021 HG: -a
1021 HG: -a
1022 HG: -a
1022 HG: -a
1023 HG: diff -r 0eeafd043f63 foo
1023 HG: diff -r 0eeafd043f63 foo
1024 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1024 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1025 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1025 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1026 HG: @@ -0,0 +1,1 @@
1026 HG: @@ -0,0 +1,1 @@
1027 HG: +foo
1027 HG: +foo
1028 HG: diff -r 0eeafd043f63 y
1028 HG: diff -r 0eeafd043f63 y
1029 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1029 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1030 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1030 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1031 HG: @@ -0,0 +1,1 @@
1031 HG: @@ -0,0 +1,1 @@
1032 HG: +y
1032 HG: +y
1033
1033
1034 $ hg rm x
1034 $ hg rm x
1035 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
1035 $ HGEDITOR=cat hg commit --amend -e -m "expecting diff of a, foo, x and y"
1036 expecting diff of a, foo, x and y
1036 expecting diff of a, foo, x and y
1037
1037
1038 HG: parent: expecting diff of a, foo and y
1038 HG: parent: expecting diff of a, foo and y
1039
1039
1040 HG: M:
1040 HG: M:
1041 HG: A: foo y
1041 HG: A: foo y
1042 HG: R: a x
1042 HG: R: a x
1043 HG: diff -r 0eeafd043f63 a
1043 HG: diff -r 0eeafd043f63 a
1044 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1044 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1045 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1045 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1046 HG: @@ -1,2 +0,0 @@
1046 HG: @@ -1,2 +0,0 @@
1047 HG: -a
1047 HG: -a
1048 HG: -a
1048 HG: -a
1049 HG: diff -r 0eeafd043f63 foo
1049 HG: diff -r 0eeafd043f63 foo
1050 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1050 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1051 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1051 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1052 HG: @@ -0,0 +1,1 @@
1052 HG: @@ -0,0 +1,1 @@
1053 HG: +foo
1053 HG: +foo
1054 HG: diff -r 0eeafd043f63 x
1054 HG: diff -r 0eeafd043f63 x
1055 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1055 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1056 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1056 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1057 HG: @@ -1,1 +0,0 @@
1057 HG: @@ -1,1 +0,0 @@
1058 HG: -x
1058 HG: -x
1059 HG: diff -r 0eeafd043f63 y
1059 HG: diff -r 0eeafd043f63 y
1060 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1060 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1061 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1061 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1062 HG: @@ -0,0 +1,1 @@
1062 HG: @@ -0,0 +1,1 @@
1063 HG: +y
1063 HG: +y
1064
1064
1065 $ echo cccc >> cc
1065 $ echo cccc >> cc
1066 $ hg status -amr
1066 $ hg status -amr
1067 M cc
1067 M cc
1068 $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc
1068 $ HGEDITOR=cat hg commit --amend -e -m "cc should be excluded" -X cc
1069 cc should be excluded
1069 cc should be excluded
1070
1070
1071 HG: parent: expecting diff of a, foo, x and y
1071 HG: parent: expecting diff of a, foo, x and y
1072
1072
1073 HG: M:
1073 HG: M:
1074 HG: A: foo y
1074 HG: A: foo y
1075 HG: R: a x
1075 HG: R: a x
1076 HG: diff -r 0eeafd043f63 a
1076 HG: diff -r 0eeafd043f63 a
1077 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1077 HG: --- a/a Thu Jan 01 00:00:00 1970 +0000
1078 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1078 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1079 HG: @@ -1,2 +0,0 @@
1079 HG: @@ -1,2 +0,0 @@
1080 HG: -a
1080 HG: -a
1081 HG: -a
1081 HG: -a
1082 HG: diff -r 0eeafd043f63 foo
1082 HG: diff -r 0eeafd043f63 foo
1083 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1083 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1084 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1084 HG: +++ b/foo Thu Jan 01 00:00:00 1970 +0000
1085 HG: @@ -0,0 +1,1 @@
1085 HG: @@ -0,0 +1,1 @@
1086 HG: +foo
1086 HG: +foo
1087 HG: diff -r 0eeafd043f63 x
1087 HG: diff -r 0eeafd043f63 x
1088 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1088 HG: --- a/x Thu Jan 01 00:00:00 1970 +0000
1089 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1089 HG: +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1090 HG: @@ -1,1 +0,0 @@
1090 HG: @@ -1,1 +0,0 @@
1091 HG: -x
1091 HG: -x
1092 HG: diff -r 0eeafd043f63 y
1092 HG: diff -r 0eeafd043f63 y
1093 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1093 HG: --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1094 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1094 HG: +++ b/y Thu Jan 01 00:00:00 1970 +0000
1095 HG: @@ -0,0 +1,1 @@
1095 HG: @@ -0,0 +1,1 @@
1096 HG: +y
1096 HG: +y
1097
1097
1098 Check for issue4405
1098 Check for issue4405
1099 -------------------
1099 -------------------
1100
1100
1101 Setup the repo with a file that gets moved in a second commit.
1101 Setup the repo with a file that gets moved in a second commit.
1102 $ hg init repo
1102 $ hg init repo
1103 $ cd repo
1103 $ cd repo
1104 $ touch a0
1104 $ touch a0
1105 $ hg add a0
1105 $ hg add a0
1106 $ hg commit -m a0
1106 $ hg commit -m a0
1107 $ hg mv a0 a1
1107 $ hg mv a0 a1
1108 $ hg commit -m a1
1108 $ hg commit -m a1
1109 $ hg up -q 0
1109 $ hg up -q 0
1110 $ hg log -G --template '{rev} {desc}'
1110 $ hg log -G --template '{rev} {desc}'
1111 o 1 a1
1111 o 1 a1
1112 |
1112 |
1113 @ 0 a0
1113 @ 0 a0
1114
1114
1115
1115
1116 Now we branch the repro, but re-use the file contents, so we have a divergence
1116 Now we branch the repro, but re-use the file contents, so we have a divergence
1117 in the file revlog topology and the changelog topology.
1117 in the file revlog topology and the changelog topology.
1118 $ hg revert --rev 1 --all
1118 $ hg revert --rev 1 --all
1119 removing a0
1119 removing a0
1120 adding a1
1120 adding a1
1121 $ hg ci -qm 'a1-amend'
1121 $ hg ci -qm 'a1-amend'
1122 $ hg log -G --template '{rev} {desc}'
1122 $ hg log -G --template '{rev} {desc}'
1123 @ 2 a1-amend
1123 @ 2 a1-amend
1124 |
1124 |
1125 | o 1 a1
1125 | o 1 a1
1126 |/
1126 |/
1127 o 0 a0
1127 o 0 a0
1128
1128
1129
1129
1130 The way mercurial does amends is by folding the working copy and old commit
1130 The way mercurial does amends is by folding the working copy and old commit
1131 together into another commit (rev 3). During this process, _findlimit is called
1131 together into another commit (rev 3). During this process, _findlimit is called
1132 to check how far back to look for the transitive closure of file copy
1132 to check how far back to look for the transitive closure of file copy
1133 information, but due to the divergence of the filelog and changelog graph
1133 information, but due to the divergence of the filelog and changelog graph
1134 topologies, before _findlimit was fixed, it returned a rev which was not far
1134 topologies, before _findlimit was fixed, it returned a rev which was not far
1135 enough back in this case.
1135 enough back in this case.
1136 $ hg mv a1 a2
1136 $ hg mv a1 a2
1137 $ hg status --copies --rev 0
1137 $ hg status --copies --rev 0
1138 A a2
1138 A a2
1139 a0
1139 a0
1140 R a0
1140 R a0
1141 $ hg ci --amend -q
1141 $ hg ci --amend -q
1142 $ hg log -G --template '{rev} {desc}'
1142 $ hg log -G --template '{rev} {desc}'
1143 @ 3 a1-amend
1143 @ 3 a1-amend
1144 |
1144 |
1145 | o 1 a1
1145 | o 1 a1
1146 |/
1146 |/
1147 o 0 a0
1147 o 0 a0
1148
1148
1149
1149
1150 Before the fix, the copy information was lost.
1150 Before the fix, the copy information was lost.
1151 $ hg status --copies --rev 0
1151 $ hg status --copies --rev 0
1152 A a2
1152 A a2
1153 a0
1153 a0
1154 R a0
1154 R a0
1155 $ cd ..
1155 $ cd ..
1156
1156
1157 Check that amend properly preserve rename from directory rename (issue-4516)
1157 Check that amend properly preserve rename from directory rename (issue-4516)
1158
1158
1159 If a parent of the merge renames a full directory, any files added to the old
1159 If a parent of the merge renames a full directory, any files added to the old
1160 directory in the other parent will be renamed to the new directory. For some
1160 directory in the other parent will be renamed to the new directory. For some
1161 reason, the rename metadata was when amending such merge. This test ensure we
1161 reason, the rename metadata was when amending such merge. This test ensure we
1162 do not regress. We have a dedicated repo because it needs a setup with renamed
1162 do not regress. We have a dedicated repo because it needs a setup with renamed
1163 directory)
1163 directory)
1164
1164
1165 $ hg init issue4516
1165 $ hg init issue4516
1166 $ cd issue4516
1166 $ cd issue4516
1167 $ mkdir olddirname
1167 $ mkdir olddirname
1168 $ echo line1 > olddirname/commonfile.py
1168 $ echo line1 > olddirname/commonfile.py
1169 $ hg add olddirname/commonfile.py
1169 $ hg add olddirname/commonfile.py
1170 $ hg ci -m first
1170 $ hg ci -m first
1171
1171
1172 $ hg branch newdirname
1172 $ hg branch newdirname
1173 marked working directory as branch newdirname
1173 marked working directory as branch newdirname
1174 (branches are permanent and global, did you want a bookmark?)
1174 (branches are permanent and global, did you want a bookmark?)
1175 $ hg mv olddirname newdirname
1175 $ hg mv olddirname newdirname
1176 moving olddirname/commonfile.py to newdirname/commonfile.py
1176 moving olddirname/commonfile.py to newdirname/commonfile.py
1177 $ hg ci -m rename
1177 $ hg ci -m rename
1178
1178
1179 $ hg update default
1179 $ hg update default
1180 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1180 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1181 $ echo line1 > olddirname/newfile.py
1181 $ echo line1 > olddirname/newfile.py
1182 $ hg add olddirname/newfile.py
1182 $ hg add olddirname/newfile.py
1183 $ hg ci -m log
1183 $ hg ci -m log
1184
1184
1185 $ hg up newdirname
1185 $ hg up newdirname
1186 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1186 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1187 $ # create newdirname/newfile.py
1187 $ # create newdirname/newfile.py
1188 $ hg merge default
1188 $ hg merge default
1189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1190 (branch merge, don't forget to commit)
1190 (branch merge, don't forget to commit)
1191 $ hg ci -m add
1191 $ hg ci -m add
1192 $
1192 $
1193 $ hg debugrename newdirname/newfile.py
1193 $ hg debugrename newdirname/newfile.py
1194 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1194 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1195 $ hg status -C --change .
1195 $ hg status -C --change .
1196 A newdirname/newfile.py
1196 A newdirname/newfile.py
1197 $ hg status -C --rev 1
1197 $ hg status -C --rev 1
1198 A newdirname/newfile.py
1198 A newdirname/newfile.py
1199 $ hg status -C --rev 2
1199 $ hg status -C --rev 2
1200 A newdirname/commonfile.py
1200 A newdirname/commonfile.py
1201 olddirname/commonfile.py
1201 olddirname/commonfile.py
1202 A newdirname/newfile.py
1202 A newdirname/newfile.py
1203 olddirname/newfile.py
1203 olddirname/newfile.py
1204 R olddirname/commonfile.py
1204 R olddirname/commonfile.py
1205 R olddirname/newfile.py
1205 R olddirname/newfile.py
1206 $ hg debugindex newdirname/newfile.py
1206 $ hg debugindex newdirname/newfile.py
1207 rev linkrev nodeid p1-nodeid p2-nodeid
1207 rev linkrev nodeid p1-nodeid p2-nodeid
1208 0 3 34a4d536c0c0 000000000000 000000000000
1208 0 3 34a4d536c0c0 000000000000 000000000000
1209
1209
1210 $ echo a >> newdirname/commonfile.py
1210 $ echo a >> newdirname/commonfile.py
1211 $ hg ci --amend -m bug
1211 $ hg ci --amend -m bug
1212 $ hg debugrename newdirname/newfile.py
1212 $ hg debugrename newdirname/newfile.py
1213 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1213 newdirname/newfile.py renamed from olddirname/newfile.py:690b295714aed510803d3020da9c70fca8336def
1214 $ hg debugindex newdirname/newfile.py
1214 $ hg debugindex newdirname/newfile.py
1215 rev linkrev nodeid p1-nodeid p2-nodeid
1215 rev linkrev nodeid p1-nodeid p2-nodeid
1216 0 3 34a4d536c0c0 000000000000 000000000000
1216 0 3 34a4d536c0c0 000000000000 000000000000
1217
1217
1218 #if execbit
1218 #if execbit
1219
1219
1220 Test if amend preserves executable bit changes
1220 Test if amend preserves executable bit changes
1221 $ chmod +x newdirname/commonfile.py
1221 $ chmod +x newdirname/commonfile.py
1222 $ hg ci -m chmod
1222 $ hg ci -m chmod
1223 $ hg ci --amend -m "chmod amended"
1223 $ hg ci --amend -m "chmod amended"
1224 $ hg ci --amend -m "chmod amended second time"
1224 $ hg ci --amend -m "chmod amended second time"
1225 $ hg log -p --git -r .
1225 $ hg log -p --git -r .
1226 changeset: 7:b1326f52dddf
1226 changeset: 7:b1326f52dddf
1227 branch: newdirname
1227 branch: newdirname
1228 tag: tip
1228 tag: tip
1229 parent: 4:7fd235f7cb2f
1229 parent: 4:7fd235f7cb2f
1230 user: test
1230 user: test
1231 date: Thu Jan 01 00:00:00 1970 +0000
1231 date: Thu Jan 01 00:00:00 1970 +0000
1232 summary: chmod amended second time
1232 summary: chmod amended second time
1233
1233
1234 diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
1234 diff --git a/newdirname/commonfile.py b/newdirname/commonfile.py
1235 old mode 100644
1235 old mode 100644
1236 new mode 100755
1236 new mode 100755
1237
1237
1238 #endif
1238 #endif
1239
1239
1240 Test amend with file inclusion options
1240 Test amend with file inclusion options
1241 --------------------------------------
1241 --------------------------------------
1242
1242
1243 These tests ensure that we are always amending some files that were part of the
1243 These tests ensure that we are always amending some files that were part of the
1244 pre-amend commit. We want to test that the remaining files in the pre-amend
1244 pre-amend commit. We want to test that the remaining files in the pre-amend
1245 commit were not changed in the amended commit. We do so by performing a diff of
1245 commit were not changed in the amended commit. We do so by performing a diff of
1246 the amended commit against its parent commit.
1246 the amended commit against its parent commit.
1247 $ cd ..
1247 $ cd ..
1248 $ hg init testfileinclusions
1248 $ hg init testfileinclusions
1249 $ cd testfileinclusions
1249 $ cd testfileinclusions
1250 $ echo a > a
1250 $ echo a > a
1251 $ echo b > b
1251 $ echo b > b
1252 $ hg commit -Aqm "Adding a and b"
1252 $ hg commit -Aqm "Adding a and b"
1253
1253
1254 Only add changes to a particular file
1254 Only add changes to a particular file
1255 $ echo a >> a
1255 $ echo a >> a
1256 $ echo b >> b
1256 $ echo b >> b
1257 $ hg commit --amend -I a
1257 $ hg commit --amend -I a
1258 $ hg diff --git -r null -r .
1258 $ hg diff --git -r null -r .
1259 diff --git a/a b/a
1259 diff --git a/a b/a
1260 new file mode 100644
1260 new file mode 100644
1261 --- /dev/null
1261 --- /dev/null
1262 +++ b/a
1262 +++ b/a
1263 @@ -0,0 +1,2 @@
1263 @@ -0,0 +1,2 @@
1264 +a
1264 +a
1265 +a
1265 +a
1266 diff --git a/b b/b
1266 diff --git a/b b/b
1267 new file mode 100644
1267 new file mode 100644
1268 --- /dev/null
1268 --- /dev/null
1269 +++ b/b
1269 +++ b/b
1270 @@ -0,0 +1,1 @@
1270 @@ -0,0 +1,1 @@
1271 +b
1271 +b
1272
1272
1273 $ echo a >> a
1273 $ echo a >> a
1274 $ hg commit --amend b
1274 $ hg commit --amend b
1275 $ hg diff --git -r null -r .
1275 $ hg diff --git -r null -r .
1276 diff --git a/a b/a
1276 diff --git a/a b/a
1277 new file mode 100644
1277 new file mode 100644
1278 --- /dev/null
1278 --- /dev/null
1279 +++ b/a
1279 +++ b/a
1280 @@ -0,0 +1,2 @@
1280 @@ -0,0 +1,2 @@
1281 +a
1281 +a
1282 +a
1282 +a
1283 diff --git a/b b/b
1283 diff --git a/b b/b
1284 new file mode 100644
1284 new file mode 100644
1285 --- /dev/null
1285 --- /dev/null
1286 +++ b/b
1286 +++ b/b
1287 @@ -0,0 +1,2 @@
1287 @@ -0,0 +1,2 @@
1288 +b
1288 +b
1289 +b
1289 +b
1290
1290
1291 Exclude changes to a particular file
1291 Exclude changes to a particular file
1292 $ echo b >> b
1292 $ echo b >> b
1293 $ hg commit --amend -X a
1293 $ hg commit --amend -X a
1294 $ hg diff --git -r null -r .
1294 $ hg diff --git -r null -r .
1295 diff --git a/a b/a
1295 diff --git a/a b/a
1296 new file mode 100644
1296 new file mode 100644
1297 --- /dev/null
1297 --- /dev/null
1298 +++ b/a
1298 +++ b/a
1299 @@ -0,0 +1,2 @@
1299 @@ -0,0 +1,2 @@
1300 +a
1300 +a
1301 +a
1301 +a
1302 diff --git a/b b/b
1302 diff --git a/b b/b
1303 new file mode 100644
1303 new file mode 100644
1304 --- /dev/null
1304 --- /dev/null
1305 +++ b/b
1305 +++ b/b
1306 @@ -0,0 +1,3 @@
1306 @@ -0,0 +1,3 @@
1307 +b
1307 +b
1308 +b
1308 +b
1309 +b
1309 +b
1310
1310
1311 Check the addremove flag
1311 Check the addremove flag
1312 $ echo c > c
1312 $ echo c > c
1313 $ rm a
1313 $ rm a
1314 $ hg commit --amend -A
1314 $ hg commit --amend -A
1315 removing a
1315 removing a
1316 adding c
1316 adding c
1317 $ hg diff --git -r null -r .
1317 $ hg diff --git -r null -r .
1318 diff --git a/b b/b
1318 diff --git a/b b/b
1319 new file mode 100644
1319 new file mode 100644
1320 --- /dev/null
1320 --- /dev/null
1321 +++ b/b
1321 +++ b/b
1322 @@ -0,0 +1,3 @@
1322 @@ -0,0 +1,3 @@
1323 +b
1323 +b
1324 +b
1324 +b
1325 +b
1325 +b
1326 diff --git a/c b/c
1326 diff --git a/c b/c
1327 new file mode 100644
1327 new file mode 100644
1328 --- /dev/null
1328 --- /dev/null
1329 +++ b/c
1329 +++ b/c
1330 @@ -0,0 +1,1 @@
1330 @@ -0,0 +1,1 @@
1331 +c
1331 +c
@@ -1,172 +1,172 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of
3 XXX-CHG this test hangs if `hg` is really `chg`. This was hidden by the use of
4 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed
4 `alias hg=chg` by run-tests.py. With such alias removed, this test is revealed
5 buggy. This need to be resolved sooner than later.
5 buggy. This need to be resolved sooner than later.
6
6
7
7
8 Testing infinipush extension and the confi options provided by it
8 Testing infinipush extension and the confi options provided by it
9
9
10 Setup
10 Setup
11
11
12 $ . "$TESTDIR/library-infinitepush.sh"
12 $ . "$TESTDIR/library-infinitepush.sh"
13 $ cp $HGRCPATH $TESTTMP/defaulthgrc
13 $ cp $HGRCPATH $TESTTMP/defaulthgrc
14 $ setupcommon
14 $ setupcommon
15 $ hg init repo
15 $ hg init repo
16 $ cd repo
16 $ cd repo
17 $ setupserver
17 $ setupserver
18 $ echo initialcommit > initialcommit
18 $ echo initialcommit > initialcommit
19 $ hg ci -Aqm "initialcommit"
19 $ hg ci -Aqm "initialcommit"
20 $ hg phase --public .
20 $ hg phase --public .
21
21
22 $ cd ..
22 $ cd ..
23 $ hg clone ssh://user@dummy/repo client -q
23 $ hg clone ssh://user@dummy/repo client -q
24
24
25 Create two heads. Push first head alone, then two heads together. Make sure that
25 Create two heads. Push first head alone, then two heads together. Make sure that
26 multihead push works.
26 multihead push works.
27 $ cd client
27 $ cd client
28 $ echo multihead1 > multihead1
28 $ echo multihead1 > multihead1
29 $ hg add multihead1
29 $ hg add multihead1
30 $ hg ci -m "multihead1"
30 $ hg ci -m "multihead1"
31 $ hg up null
31 $ hg up null
32 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
32 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
33 $ echo multihead2 > multihead2
33 $ echo multihead2 > multihead2
34 $ hg ci -Am "multihead2"
34 $ hg ci -Am "multihead2"
35 adding multihead2
35 adding multihead2
36 created new head
36 created new head
37 $ hg push -r . --bundle-store
37 $ hg push -r . --bundle-store
38 pushing to ssh://user@dummy/repo
38 pushing to ssh://user@dummy/repo
39 searching for changes
39 searching for changes
40 remote: pushing 1 commit:
40 remote: pushing 1 commit:
41 remote: ee4802bf6864 multihead2
41 remote: ee4802bf6864 multihead2
42 $ hg push -r '1:2' --bundle-store
42 $ hg push -r '1:2' --bundle-store
43 pushing to ssh://user@dummy/repo
43 pushing to ssh://user@dummy/repo
44 searching for changes
44 searching for changes
45 remote: pushing 2 commits:
45 remote: pushing 2 commits:
46 remote: bc22f9a30a82 multihead1
46 remote: bc22f9a30a82 multihead1
47 remote: ee4802bf6864 multihead2
47 remote: ee4802bf6864 multihead2
48 $ scratchnodes
48 $ scratchnodes
49 bc22f9a30a821118244deacbd732e394ed0b686c ab1bc557aa090a9e4145512c734b6e8a828393a5
49 bc22f9a30a821118244deacbd732e394ed0b686c de1b7d132ba98f0172cd974e3e69dfa80faa335c
50 ee4802bf6864326a6b3dcfff5a03abc2a0a69b8f ab1bc557aa090a9e4145512c734b6e8a828393a5
50 ee4802bf6864326a6b3dcfff5a03abc2a0a69b8f de1b7d132ba98f0172cd974e3e69dfa80faa335c
51
51
52 Create two new scratch bookmarks
52 Create two new scratch bookmarks
53 $ hg up 0
53 $ hg up 0
54 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
55 $ echo scratchfirstpart > scratchfirstpart
55 $ echo scratchfirstpart > scratchfirstpart
56 $ hg ci -Am "scratchfirstpart"
56 $ hg ci -Am "scratchfirstpart"
57 adding scratchfirstpart
57 adding scratchfirstpart
58 created new head
58 created new head
59 $ hg push -r . -B scratch/firstpart
59 $ hg push -r . -B scratch/firstpart
60 pushing to ssh://user@dummy/repo
60 pushing to ssh://user@dummy/repo
61 searching for changes
61 searching for changes
62 remote: pushing 1 commit:
62 remote: pushing 1 commit:
63 remote: 176993b87e39 scratchfirstpart
63 remote: 176993b87e39 scratchfirstpart
64 $ hg up 0
64 $ hg up 0
65 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
65 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
66 $ echo scratchsecondpart > scratchsecondpart
66 $ echo scratchsecondpart > scratchsecondpart
67 $ hg ci -Am "scratchsecondpart"
67 $ hg ci -Am "scratchsecondpart"
68 adding scratchsecondpart
68 adding scratchsecondpart
69 created new head
69 created new head
70 $ hg push -r . -B scratch/secondpart
70 $ hg push -r . -B scratch/secondpart
71 pushing to ssh://user@dummy/repo
71 pushing to ssh://user@dummy/repo
72 searching for changes
72 searching for changes
73 remote: pushing 1 commit:
73 remote: pushing 1 commit:
74 remote: 8db3891c220e scratchsecondpart
74 remote: 8db3891c220e scratchsecondpart
75
75
76 Pull two bookmarks from the second client
76 Pull two bookmarks from the second client
77 $ cd ..
77 $ cd ..
78 $ hg clone ssh://user@dummy/repo client2 -q
78 $ hg clone ssh://user@dummy/repo client2 -q
79 $ cd client2
79 $ cd client2
80 $ hg pull -B scratch/firstpart -B scratch/secondpart
80 $ hg pull -B scratch/firstpart -B scratch/secondpart
81 pulling from ssh://user@dummy/repo
81 pulling from ssh://user@dummy/repo
82 searching for changes
82 searching for changes
83 adding changesets
83 adding changesets
84 adding manifests
84 adding manifests
85 adding file changes
85 adding file changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 2 changesets with 2 changes to 2 files (+1 heads)
89 added 2 changesets with 2 changes to 2 files (+1 heads)
90 new changesets * (glob)
90 new changesets * (glob)
91 (run 'hg heads' to see heads, 'hg merge' to merge)
91 (run 'hg heads' to see heads, 'hg merge' to merge)
92 $ hg log -r scratch/secondpart -T '{node}'
92 $ hg log -r scratch/secondpart -T '{node}'
93 8db3891c220e216f6da214e8254bd4371f55efca (no-eol)
93 8db3891c220e216f6da214e8254bd4371f55efca (no-eol)
94 $ hg log -r scratch/firstpart -T '{node}'
94 $ hg log -r scratch/firstpart -T '{node}'
95 176993b87e39bd88d66a2cccadabe33f0b346339 (no-eol)
95 176993b87e39bd88d66a2cccadabe33f0b346339 (no-eol)
96 Make two commits to the scratch branch
96 Make two commits to the scratch branch
97
97
98 $ echo testpullbycommithash1 > testpullbycommithash1
98 $ echo testpullbycommithash1 > testpullbycommithash1
99 $ hg ci -Am "testpullbycommithash1"
99 $ hg ci -Am "testpullbycommithash1"
100 adding testpullbycommithash1
100 adding testpullbycommithash1
101 created new head
101 created new head
102 $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
102 $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
103 $ echo testpullbycommithash2 > testpullbycommithash2
103 $ echo testpullbycommithash2 > testpullbycommithash2
104 $ hg ci -Aqm "testpullbycommithash2"
104 $ hg ci -Aqm "testpullbycommithash2"
105 $ hg push -r . -B scratch/mybranch -q
105 $ hg push -r . -B scratch/mybranch -q
106
106
107 Create third client and pull by commit hash.
107 Create third client and pull by commit hash.
108 Make sure testpullbycommithash2 has not fetched
108 Make sure testpullbycommithash2 has not fetched
109 $ cd ..
109 $ cd ..
110 $ hg clone ssh://user@dummy/repo client3 -q
110 $ hg clone ssh://user@dummy/repo client3 -q
111 $ cd client3
111 $ cd client3
112 $ hg pull -r `cat ../testpullbycommithash1`
112 $ hg pull -r `cat ../testpullbycommithash1`
113 pulling from ssh://user@dummy/repo
113 pulling from ssh://user@dummy/repo
114 searching for changes
114 searching for changes
115 adding changesets
115 adding changesets
116 adding manifests
116 adding manifests
117 adding file changes
117 adding file changes
118 added 1 changesets with 1 changes to 1 files
118 added 1 changesets with 1 changes to 1 files
119 new changesets 33910bfe6ffe (1 drafts)
119 new changesets 33910bfe6ffe (1 drafts)
120 (run 'hg update' to get a working copy)
120 (run 'hg update' to get a working copy)
121 $ hg log -G -T '{desc} {phase} {bookmarks}'
121 $ hg log -G -T '{desc} {phase} {bookmarks}'
122 o testpullbycommithash1 draft
122 o testpullbycommithash1 draft
123 |
123 |
124 @ initialcommit public
124 @ initialcommit public
125
125
126 Make public commit in the repo and pull it.
126 Make public commit in the repo and pull it.
127 Make sure phase on the client is public.
127 Make sure phase on the client is public.
128 $ cd ../repo
128 $ cd ../repo
129 $ echo publiccommit > publiccommit
129 $ echo publiccommit > publiccommit
130 $ hg ci -Aqm "publiccommit"
130 $ hg ci -Aqm "publiccommit"
131 $ hg phase --public .
131 $ hg phase --public .
132 $ cd ../client3
132 $ cd ../client3
133 $ hg pull
133 $ hg pull
134 pulling from ssh://user@dummy/repo
134 pulling from ssh://user@dummy/repo
135 searching for changes
135 searching for changes
136 adding changesets
136 adding changesets
137 adding manifests
137 adding manifests
138 adding file changes
138 adding file changes
139 added 1 changesets with 1 changes to 1 files (+1 heads)
139 added 1 changesets with 1 changes to 1 files (+1 heads)
140 new changesets a79b6597f322
140 new changesets a79b6597f322
141 (run 'hg heads' to see heads, 'hg merge' to merge)
141 (run 'hg heads' to see heads, 'hg merge' to merge)
142 $ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
142 $ hg log -G -T '{desc} {phase} {bookmarks} {node|short}'
143 o publiccommit public a79b6597f322
143 o publiccommit public a79b6597f322
144 |
144 |
145 | o testpullbycommithash1 draft 33910bfe6ffe
145 | o testpullbycommithash1 draft 33910bfe6ffe
146 |/
146 |/
147 @ initialcommit public 67145f466344
147 @ initialcommit public 67145f466344
148
148
149 $ hg up a79b6597f322
149 $ hg up a79b6597f322
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 $ echo scratchontopofpublic > scratchontopofpublic
151 $ echo scratchontopofpublic > scratchontopofpublic
152 $ hg ci -Aqm "scratchontopofpublic"
152 $ hg ci -Aqm "scratchontopofpublic"
153 $ hg push -r . -B scratch/scratchontopofpublic
153 $ hg push -r . -B scratch/scratchontopofpublic
154 pushing to ssh://user@dummy/repo
154 pushing to ssh://user@dummy/repo
155 searching for changes
155 searching for changes
156 remote: pushing 1 commit:
156 remote: pushing 1 commit:
157 remote: c70aee6da07d scratchontopofpublic
157 remote: c70aee6da07d scratchontopofpublic
158 $ cd ../client2
158 $ cd ../client2
159 $ hg pull -B scratch/scratchontopofpublic
159 $ hg pull -B scratch/scratchontopofpublic
160 pulling from ssh://user@dummy/repo
160 pulling from ssh://user@dummy/repo
161 searching for changes
161 searching for changes
162 adding changesets
162 adding changesets
163 adding manifests
163 adding manifests
164 adding file changes
164 adding file changes
165 adding changesets
165 adding changesets
166 adding manifests
166 adding manifests
167 adding file changes
167 adding file changes
168 added 2 changesets with 2 changes to 2 files (+1 heads)
168 added 2 changesets with 2 changes to 2 files (+1 heads)
169 new changesets a79b6597f322:c70aee6da07d (1 drafts)
169 new changesets a79b6597f322:c70aee6da07d (1 drafts)
170 (run 'hg heads .' to see heads, 'hg merge' to merge)
170 (run 'hg heads .' to see heads, 'hg merge' to merge)
171 $ hg log -r scratch/scratchontopofpublic -T '{phase}'
171 $ hg log -r scratch/scratchontopofpublic -T '{phase}'
172 draft (no-eol)
172 draft (no-eol)
@@ -1,1892 +1,1892 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 --no-dates
46 $ hg debugstate --no-dates
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 --no-dates
51 $ hg debugstate --large --no-dates
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 -A
129 $ ls -A
130 .hg
130 .hg
131 .hglf
131 .hglf
132 sub
132 sub
133 $ echo "testlargefile" > large1-test
133 $ echo "testlargefile" > large1-test
134 $ hg add --large large1-test
134 $ hg add --large large1-test
135 $ hg st
135 $ hg st
136 A large1-test
136 A large1-test
137 $ hg rm large1-test
137 $ hg rm large1-test
138 not removing large1-test: file has been marked for add (use forget to undo)
138 not removing large1-test: file has been marked for add (use forget to undo)
139 [1]
139 [1]
140 $ hg st
140 $ hg st
141 A large1-test
141 A large1-test
142 $ hg forget large1-test
142 $ hg forget large1-test
143 $ hg st
143 $ hg st
144 ? large1-test
144 ? large1-test
145 $ hg remove large1-test
145 $ hg remove large1-test
146 not removing large1-test: file is untracked
146 not removing large1-test: file is untracked
147 [1]
147 [1]
148 $ hg forget large1-test
148 $ hg forget large1-test
149 not removing large1-test: file is already untracked
149 not removing large1-test: file is already untracked
150 [1]
150 [1]
151 $ rm large1-test
151 $ rm large1-test
152
152
153 Copy both largefiles and normal files (testing that status output is correct).
153 Copy both largefiles and normal files (testing that status output is correct).
154
154
155 $ hg cp sub/normal2 normal1
155 $ hg cp sub/normal2 normal1
156 $ hg cp sub/large2 large1
156 $ hg cp sub/large2 large1
157 $ hg commit -m "copy files"
157 $ hg commit -m "copy files"
158 Invoking status precommit hook
158 Invoking status precommit hook
159 A large1
159 A large1
160 A normal1
160 A normal1
161 $ cat normal1
161 $ cat normal1
162 normal22
162 normal22
163 $ cat large1
163 $ cat large1
164 large22
164 large22
165
165
166 Test moving largefiles and verify that normal files are also unaffected.
166 Test moving largefiles and verify that normal files are also unaffected.
167
167
168 $ hg mv normal1 normal3
168 $ hg mv normal1 normal3
169 $ hg mv large1 large3
169 $ hg mv large1 large3
170 $ hg mv sub/normal2 sub/normal4
170 $ hg mv sub/normal2 sub/normal4
171 $ hg mv sub/large2 sub/large4
171 $ hg mv sub/large2 sub/large4
172 $ hg commit -m "move files"
172 $ hg commit -m "move files"
173 Invoking status precommit hook
173 Invoking status precommit hook
174 A large3
174 A large3
175 A normal3
175 A normal3
176 A sub/large4
176 A sub/large4
177 A sub/normal4
177 A sub/normal4
178 R large1
178 R large1
179 R normal1
179 R normal1
180 R sub/large2
180 R sub/large2
181 R sub/normal2
181 R sub/normal2
182 $ cat normal3
182 $ cat normal3
183 normal22
183 normal22
184 $ cat large3
184 $ cat large3
185 large22
185 large22
186 $ cat sub/normal4
186 $ cat sub/normal4
187 normal22
187 normal22
188 $ cat sub/large4
188 $ cat sub/large4
189 large22
189 large22
190
190
191
191
192 #if serve
192 #if serve
193 Test display of largefiles in hgweb
193 Test display of largefiles in hgweb
194
194
195 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
195 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
196 $ cat ../hg.pid >> $DAEMON_PIDS
196 $ cat ../hg.pid >> $DAEMON_PIDS
197 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
197 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
198 200 Script output follows
198 200 Script output follows
199
199
200
200
201 drwxr-xr-x sub
201 drwxr-xr-x sub
202 -rw-r--r-- 41 large3
202 -rw-r--r-- 41 large3
203 -rw-r--r-- 9 normal3
203 -rw-r--r-- 9 normal3
204
204
205
205
206 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
206 $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
207 200 Script output follows
207 200 Script output follows
208
208
209
209
210 -rw-r--r-- 41 large4
210 -rw-r--r-- 41 large4
211 -rw-r--r-- 9 normal4
211 -rw-r--r-- 9 normal4
212
212
213
213
214 $ killdaemons.py
214 $ killdaemons.py
215 #endif
215 #endif
216
216
217 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
217 Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail)
218
218
219 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
219 $ cat <<EOF > "$TESTTMP/hgweb.cgi"
220 > #!$PYTHON
220 > #!$PYTHON
221 > from mercurial import demandimport; demandimport.enable()
221 > from mercurial import demandimport; demandimport.enable()
222 > from mercurial.hgweb import hgweb
222 > from mercurial.hgweb import hgweb
223 > from mercurial.hgweb import wsgicgi
223 > from mercurial.hgweb import wsgicgi
224 > application = hgweb(b'.', b'test repo')
224 > application = hgweb(b'.', b'test repo')
225 > wsgicgi.launch(application)
225 > wsgicgi.launch(application)
226 > EOF
226 > EOF
227 $ . "$TESTDIR/cgienv"
227 $ . "$TESTDIR/cgienv"
228
228
229 $ SCRIPT_NAME='' \
229 $ SCRIPT_NAME='' \
230 > "$PYTHON" "$TESTTMP/hgweb.cgi" > /dev/null
230 > "$PYTHON" "$TESTTMP/hgweb.cgi" > /dev/null
231
231
232 Test archiving the various revisions. These hit corner cases known with
232 Test archiving the various revisions. These hit corner cases known with
233 archiving.
233 archiving.
234
234
235 $ hg archive -r 0 ../archive0
235 $ hg archive -r 0 ../archive0
236 $ hg archive -r 1 ../archive1
236 $ hg archive -r 1 ../archive1
237 $ hg archive -r 2 ../archive2
237 $ hg archive -r 2 ../archive2
238 $ hg archive -r 3 ../archive3
238 $ hg archive -r 3 ../archive3
239 $ hg archive -r 4 ../archive4
239 $ hg archive -r 4 ../archive4
240 $ cd ../archive0
240 $ cd ../archive0
241 $ cat normal1
241 $ cat normal1
242 normal1
242 normal1
243 $ cat large1
243 $ cat large1
244 large1
244 large1
245 $ cat sub/normal2
245 $ cat sub/normal2
246 normal2
246 normal2
247 $ cat sub/large2
247 $ cat sub/large2
248 large2
248 large2
249 $ cd ../archive1
249 $ cd ../archive1
250 $ cat normal1
250 $ cat normal1
251 normal11
251 normal11
252 $ cat large1
252 $ cat large1
253 large11
253 large11
254 $ cat sub/normal2
254 $ cat sub/normal2
255 normal22
255 normal22
256 $ cat sub/large2
256 $ cat sub/large2
257 large22
257 large22
258 $ cd ../archive2
258 $ cd ../archive2
259 $ ls -A
259 $ ls -A
260 .hg_archival.txt
260 .hg_archival.txt
261 sub
261 sub
262 $ cat sub/normal2
262 $ cat sub/normal2
263 normal22
263 normal22
264 $ cat sub/large2
264 $ cat sub/large2
265 large22
265 large22
266 $ cd ../archive3
266 $ cd ../archive3
267 $ cat normal1
267 $ cat normal1
268 normal22
268 normal22
269 $ cat large1
269 $ cat large1
270 large22
270 large22
271 $ cat sub/normal2
271 $ cat sub/normal2
272 normal22
272 normal22
273 $ cat sub/large2
273 $ cat sub/large2
274 large22
274 large22
275 $ cd ../archive4
275 $ cd ../archive4
276 $ cat normal3
276 $ cat normal3
277 normal22
277 normal22
278 $ cat large3
278 $ cat large3
279 large22
279 large22
280 $ cat sub/normal4
280 $ cat sub/normal4
281 normal22
281 normal22
282 $ cat sub/large4
282 $ cat sub/large4
283 large22
283 large22
284
284
285 Commit corner case: specify files to commit.
285 Commit corner case: specify files to commit.
286
286
287 $ cd ../a
287 $ cd ../a
288 $ echo normal3 > normal3
288 $ echo normal3 > normal3
289 $ echo large3 > large3
289 $ echo large3 > large3
290 $ echo normal4 > sub/normal4
290 $ echo normal4 > sub/normal4
291 $ echo large4 > sub/large4
291 $ echo large4 > sub/large4
292 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
292 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
293 Invoking status precommit hook
293 Invoking status precommit hook
294 M large3
294 M large3
295 M normal3
295 M normal3
296 M sub/large4
296 M sub/large4
297 M sub/normal4
297 M sub/normal4
298 $ cat normal3
298 $ cat normal3
299 normal3
299 normal3
300 $ cat large3
300 $ cat large3
301 large3
301 large3
302 $ cat sub/normal4
302 $ cat sub/normal4
303 normal4
303 normal4
304 $ cat sub/large4
304 $ cat sub/large4
305 large4
305 large4
306
306
307 One more commit corner case: commit from a subdirectory.
307 One more commit corner case: commit from a subdirectory.
308
308
309 $ cd ../a
309 $ cd ../a
310 $ echo normal33 > normal3
310 $ echo normal33 > normal3
311 $ echo large33 > large3
311 $ echo large33 > large3
312 $ echo normal44 > sub/normal4
312 $ echo normal44 > sub/normal4
313 $ echo large44 > sub/large4
313 $ echo large44 > sub/large4
314 $ cd sub
314 $ cd sub
315 $ hg commit -m "edit files yet again"
315 $ hg commit -m "edit files yet again"
316 Invoking status precommit hook
316 Invoking status precommit hook
317 M large3
317 M large3
318 M normal3
318 M normal3
319 M sub/large4
319 M sub/large4
320 M sub/normal4
320 M sub/normal4
321 $ cat ../normal3
321 $ cat ../normal3
322 normal33
322 normal33
323 $ cat ../large3
323 $ cat ../large3
324 large33
324 large33
325 $ cat normal4
325 $ cat normal4
326 normal44
326 normal44
327 $ cat large4
327 $ cat large4
328 large44
328 large44
329
329
330 Committing standins is not allowed.
330 Committing standins is not allowed.
331
331
332 $ cd ..
332 $ cd ..
333 $ echo large3 > large3
333 $ echo large3 > large3
334 $ hg commit .hglf/large3 -m "try to commit standin"
334 $ hg commit .hglf/large3 -m "try to commit standin"
335 abort: file ".hglf/large3" is a largefile standin
335 abort: file ".hglf/large3" is a largefile standin
336 (commit the largefile itself instead)
336 (commit the largefile itself instead)
337 [255]
337 [255]
338
338
339 Corner cases for adding largefiles.
339 Corner cases for adding largefiles.
340
340
341 $ echo large5 > large5
341 $ echo large5 > large5
342 $ hg add --large large5
342 $ hg add --large large5
343 $ hg add --large large5
343 $ hg add --large large5
344 large5 already a largefile
344 large5 already a largefile
345 $ mkdir sub2
345 $ mkdir sub2
346 $ echo large6 > sub2/large6
346 $ echo large6 > sub2/large6
347 $ echo large7 > sub2/large7
347 $ echo large7 > sub2/large7
348 $ hg add --large sub2
348 $ hg add --large sub2
349 adding sub2/large6 as a largefile
349 adding sub2/large6 as a largefile
350 adding sub2/large7 as a largefile
350 adding sub2/large7 as a largefile
351 $ hg st
351 $ hg st
352 M large3
352 M large3
353 A large5
353 A large5
354 A sub2/large6
354 A sub2/large6
355 A sub2/large7
355 A sub2/large7
356
356
357 Committing directories containing only largefiles.
357 Committing directories containing only largefiles.
358
358
359 $ mkdir -p z/y/x/m
359 $ mkdir -p z/y/x/m
360 $ touch z/y/x/m/large1
360 $ touch z/y/x/m/large1
361 $ touch z/y/x/large2
361 $ touch z/y/x/large2
362 $ hg add --large z/y/x/m/large1 z/y/x/large2
362 $ hg add --large z/y/x/m/large1 z/y/x/large2
363 $ hg commit -m "Subdir with directory only containing largefiles" z
363 $ hg commit -m "Subdir with directory only containing largefiles" z
364 Invoking status precommit hook
364 Invoking status precommit hook
365 M large3
365 M large3
366 A large5
366 A large5
367 A sub2/large6
367 A sub2/large6
368 A sub2/large7
368 A sub2/large7
369 A z/y/x/large2
369 A z/y/x/large2
370 A z/y/x/m/large1
370 A z/y/x/m/large1
371
371
372 (and a bit of log testing)
372 (and a bit of log testing)
373
373
374 $ hg log -T '{rev}\n' z/y/x/m/large1
374 $ hg log -T '{rev}\n' z/y/x/m/large1
375 7
375 7
376 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
376 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
377 7
377 7
378
378
379 $ hg rollback --quiet
379 $ hg rollback --quiet
380 $ touch z/y/x/m/normal
380 $ touch z/y/x/m/normal
381 $ hg add z/y/x/m/normal
381 $ hg add z/y/x/m/normal
382 $ hg commit -m "Subdir with mixed contents" z
382 $ hg commit -m "Subdir with mixed contents" z
383 Invoking status precommit hook
383 Invoking status precommit hook
384 M large3
384 M large3
385 A large5
385 A large5
386 A sub2/large6
386 A sub2/large6
387 A sub2/large7
387 A sub2/large7
388 A z/y/x/large2
388 A z/y/x/large2
389 A z/y/x/m/large1
389 A z/y/x/m/large1
390 A z/y/x/m/normal
390 A z/y/x/m/normal
391 $ hg st
391 $ hg st
392 M large3
392 M large3
393 A large5
393 A large5
394 A sub2/large6
394 A sub2/large6
395 A sub2/large7
395 A sub2/large7
396 $ hg rollback --quiet
396 $ hg rollback --quiet
397 $ hg revert z/y/x/large2 z/y/x/m/large1
397 $ hg revert z/y/x/large2 z/y/x/m/large1
398 $ rm z/y/x/large2 z/y/x/m/large1
398 $ rm z/y/x/large2 z/y/x/m/large1
399 $ hg commit -m "Subdir with normal contents" z
399 $ hg commit -m "Subdir with normal contents" z
400 Invoking status precommit hook
400 Invoking status precommit hook
401 M large3
401 M large3
402 A large5
402 A large5
403 A sub2/large6
403 A sub2/large6
404 A sub2/large7
404 A sub2/large7
405 A z/y/x/m/normal
405 A z/y/x/m/normal
406 $ hg st
406 $ hg st
407 M large3
407 M large3
408 A large5
408 A large5
409 A sub2/large6
409 A sub2/large6
410 A sub2/large7
410 A sub2/large7
411 $ hg rollback --quiet
411 $ hg rollback --quiet
412 $ hg revert --quiet z
412 $ hg revert --quiet z
413 $ hg commit -m "Empty subdir" z
413 $ hg commit -m "Empty subdir" z
414 abort: z: no match under directory!
414 abort: z: no match under directory!
415 [10]
415 [10]
416 $ rm -rf z
416 $ rm -rf z
417 $ hg ci -m "standin" .hglf
417 $ hg ci -m "standin" .hglf
418 abort: file ".hglf" is a largefile standin
418 abort: file ".hglf" is a largefile standin
419 (commit the largefile itself instead)
419 (commit the largefile itself instead)
420 [255]
420 [255]
421
421
422 Test "hg status" with combination of 'file pattern' and 'directory
422 Test "hg status" with combination of 'file pattern' and 'directory
423 pattern' for largefiles:
423 pattern' for largefiles:
424
424
425 $ hg status sub2/large6 sub2
425 $ hg status sub2/large6 sub2
426 A sub2/large6
426 A sub2/large6
427 A sub2/large7
427 A sub2/large7
428
428
429 Config settings (pattern **.dat, minsize 2 MB) are respected.
429 Config settings (pattern **.dat, minsize 2 MB) are respected.
430
430
431 $ echo testdata > test.dat
431 $ echo testdata > test.dat
432 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
432 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
433 $ hg add
433 $ hg add
434 adding reallylarge as a largefile
434 adding reallylarge as a largefile
435 adding test.dat as a largefile
435 adding test.dat as a largefile
436
436
437 Test that minsize and --lfsize handle float values;
437 Test that minsize and --lfsize handle float values;
438 also tests that --lfsize overrides largefiles.minsize.
438 also tests that --lfsize overrides largefiles.minsize.
439 (0.250 MB = 256 kB = 262144 B)
439 (0.250 MB = 256 kB = 262144 B)
440
440
441 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
441 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
442 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
442 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
443 $ hg --config largefiles.minsize=.25 add
443 $ hg --config largefiles.minsize=.25 add
444 adding ratherlarge as a largefile
444 adding ratherlarge as a largefile
445 adding medium
445 adding medium
446 $ hg forget medium
446 $ hg forget medium
447 $ hg --config largefiles.minsize=.25 add --lfsize=.125
447 $ hg --config largefiles.minsize=.25 add --lfsize=.125
448 adding medium as a largefile
448 adding medium as a largefile
449 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
449 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
450 $ hg --config largefiles.minsize=.25 add --lfsize=.125
450 $ hg --config largefiles.minsize=.25 add --lfsize=.125
451 adding notlarge
451 adding notlarge
452 $ hg forget notlarge
452 $ hg forget notlarge
453
453
454 Test forget on largefiles.
454 Test forget on largefiles.
455
455
456 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
456 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
457 $ hg commit -m "add/edit more largefiles"
457 $ hg commit -m "add/edit more largefiles"
458 Invoking status precommit hook
458 Invoking status precommit hook
459 A sub2/large6
459 A sub2/large6
460 A sub2/large7
460 A sub2/large7
461 R large3
461 R large3
462 ? large5
462 ? large5
463 ? medium
463 ? medium
464 ? notlarge
464 ? notlarge
465 ? ratherlarge
465 ? ratherlarge
466 ? reallylarge
466 ? reallylarge
467 ? test.dat
467 ? test.dat
468 $ hg st
468 $ hg st
469 ? large3
469 ? large3
470 ? large5
470 ? large5
471 ? medium
471 ? medium
472 ? notlarge
472 ? notlarge
473 ? ratherlarge
473 ? ratherlarge
474 ? reallylarge
474 ? reallylarge
475 ? test.dat
475 ? test.dat
476
476
477 Purge with largefiles: verify that largefiles are still in the working
477 Purge with largefiles: verify that largefiles are still in the working
478 dir after a purge.
478 dir after a purge.
479
479
480 $ hg purge --all
480 $ hg purge --all
481 $ cat sub/large4
481 $ cat sub/large4
482 large44
482 large44
483 $ cat sub2/large6
483 $ cat sub2/large6
484 large6
484 large6
485 $ cat sub2/large7
485 $ cat sub2/large7
486 large7
486 large7
487
487
488 Test addremove: verify that files that should be added as largefiles are added as
488 Test addremove: verify that files that should be added as largefiles are added as
489 such and that already-existing largefiles are not added as normal files by
489 such and that already-existing largefiles are not added as normal files by
490 accident.
490 accident.
491
491
492 $ rm normal3
492 $ rm normal3
493 $ rm sub/large4
493 $ rm sub/large4
494 $ echo "testing addremove with patterns" > testaddremove.dat
494 $ echo "testing addremove with patterns" > testaddremove.dat
495 $ echo "normaladdremove" > normaladdremove
495 $ echo "normaladdremove" > normaladdremove
496 $ hg addremove
496 $ hg addremove
497 removing sub/large4
497 removing sub/large4
498 adding testaddremove.dat as a largefile
498 adding testaddremove.dat as a largefile
499 removing normal3
499 removing normal3
500 adding normaladdremove
500 adding normaladdremove
501
501
502 Test addremove with -R
502 Test addremove with -R
503
503
504 $ hg up -C
504 $ hg up -C
505 getting changed largefiles
505 getting changed largefiles
506 1 largefiles updated, 0 removed
506 1 largefiles updated, 0 removed
507 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
507 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
508 $ rm normal3
508 $ rm normal3
509 $ rm sub/large4
509 $ rm sub/large4
510 $ echo "testing addremove with patterns" > testaddremove.dat
510 $ echo "testing addremove with patterns" > testaddremove.dat
511 $ echo "normaladdremove" > normaladdremove
511 $ echo "normaladdremove" > normaladdremove
512 $ cd ..
512 $ cd ..
513 $ hg -R a -v addremove
513 $ hg -R a -v addremove
514 removing sub/large4
514 removing sub/large4
515 adding testaddremove.dat as a largefile
515 adding testaddremove.dat as a largefile
516 removing normal3
516 removing normal3
517 adding normaladdremove
517 adding normaladdremove
518 $ cd a
518 $ cd a
519
519
520 Test 3364
520 Test 3364
521 $ hg clone . ../addrm
521 $ hg clone . ../addrm
522 updating to branch default
522 updating to branch default
523 getting changed largefiles
523 getting changed largefiles
524 3 largefiles updated, 0 removed
524 3 largefiles updated, 0 removed
525 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
526 $ cd ../addrm
526 $ cd ../addrm
527 $ cat >> .hg/hgrc <<EOF
527 $ cat >> .hg/hgrc <<EOF
528 > [hooks]
528 > [hooks]
529 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
529 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
530 > EOF
530 > EOF
531 $ touch foo
531 $ touch foo
532 $ hg add --large foo
532 $ hg add --large foo
533 $ hg ci -m "add foo"
533 $ hg ci -m "add foo"
534 Invoking status precommit hook
534 Invoking status precommit hook
535 A foo
535 A foo
536 Invoking status postcommit hook
536 Invoking status postcommit hook
537 C foo
537 C foo
538 C normal3
538 C normal3
539 C sub/large4
539 C sub/large4
540 C sub/normal4
540 C sub/normal4
541 C sub2/large6
541 C sub2/large6
542 C sub2/large7
542 C sub2/large7
543 $ rm foo
543 $ rm foo
544 $ hg st
544 $ hg st
545 ! foo
545 ! foo
546 hmm.. no precommit invoked, but there is a postcommit??
546 hmm.. no precommit invoked, but there is a postcommit??
547 $ hg ci -m "will not checkin"
547 $ hg ci -m "will not checkin"
548 nothing changed (1 missing files, see 'hg status')
548 nothing changed (1 missing files, see 'hg status')
549 Invoking status postcommit hook
549 Invoking status postcommit hook
550 ! foo
550 ! foo
551 C normal3
551 C normal3
552 C sub/large4
552 C sub/large4
553 C sub/normal4
553 C sub/normal4
554 C sub2/large6
554 C sub2/large6
555 C sub2/large7
555 C sub2/large7
556 [1]
556 [1]
557 $ hg addremove
557 $ hg addremove
558 removing foo
558 removing foo
559 $ hg st
559 $ hg st
560 R foo
560 R foo
561 $ hg ci -m "used to say nothing changed"
561 $ hg ci -m "used to say nothing changed"
562 Invoking status precommit hook
562 Invoking status precommit hook
563 R foo
563 R foo
564 Invoking status postcommit hook
564 Invoking status postcommit hook
565 C normal3
565 C normal3
566 C sub/large4
566 C sub/large4
567 C sub/normal4
567 C sub/normal4
568 C sub2/large6
568 C sub2/large6
569 C sub2/large7
569 C sub2/large7
570 $ hg st
570 $ hg st
571
571
572 Test 3507 (both normal files and largefiles were a problem)
572 Test 3507 (both normal files and largefiles were a problem)
573
573
574 $ touch normal
574 $ touch normal
575 $ touch large
575 $ touch large
576 $ hg add normal
576 $ hg add normal
577 $ hg add --large large
577 $ hg add --large large
578 $ hg ci -m "added"
578 $ hg ci -m "added"
579 Invoking status precommit hook
579 Invoking status precommit hook
580 A large
580 A large
581 A normal
581 A normal
582 Invoking status postcommit hook
582 Invoking status postcommit hook
583 C large
583 C large
584 C normal
584 C normal
585 C normal3
585 C normal3
586 C sub/large4
586 C sub/large4
587 C sub/normal4
587 C sub/normal4
588 C sub2/large6
588 C sub2/large6
589 C sub2/large7
589 C sub2/large7
590 $ hg remove normal
590 $ hg remove normal
591 $ hg addremove --traceback
591 $ hg addremove --traceback
592 $ hg ci -m "addremoved normal"
592 $ hg ci -m "addremoved normal"
593 Invoking status precommit hook
593 Invoking status precommit hook
594 R normal
594 R normal
595 Invoking status postcommit hook
595 Invoking status postcommit hook
596 C large
596 C large
597 C normal3
597 C normal3
598 C sub/large4
598 C sub/large4
599 C sub/normal4
599 C sub/normal4
600 C sub2/large6
600 C sub2/large6
601 C sub2/large7
601 C sub2/large7
602 $ hg up -C '.^'
602 $ hg up -C '.^'
603 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
603 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
604 $ hg remove large
604 $ hg remove large
605 $ hg addremove --traceback
605 $ hg addremove --traceback
606 $ hg ci -m "removed large"
606 $ hg ci -m "removed large"
607 Invoking status precommit hook
607 Invoking status precommit hook
608 R large
608 R large
609 created new head
609 created new head
610 Invoking status postcommit hook
610 Invoking status postcommit hook
611 C normal
611 C normal
612 C normal3
612 C normal3
613 C sub/large4
613 C sub/large4
614 C sub/normal4
614 C sub/normal4
615 C sub2/large6
615 C sub2/large6
616 C sub2/large7
616 C sub2/large7
617
617
618 Test commit -A (issue3542)
618 Test commit -A (issue3542)
619 $ echo large8 > large8
619 $ echo large8 > large8
620 $ hg add --large large8
620 $ hg add --large large8
621 $ hg ci -Am 'this used to add large8 as normal and commit both'
621 $ hg ci -Am 'this used to add large8 as normal and commit both'
622 Invoking status precommit hook
622 Invoking status precommit hook
623 A large8
623 A large8
624 Invoking status postcommit hook
624 Invoking status postcommit hook
625 C large8
625 C large8
626 C normal
626 C normal
627 C normal3
627 C normal3
628 C sub/large4
628 C sub/large4
629 C sub/normal4
629 C sub/normal4
630 C sub2/large6
630 C sub2/large6
631 C sub2/large7
631 C sub2/large7
632 $ rm large8
632 $ rm large8
633 $ hg ci -Am 'this used to not notice the rm'
633 $ hg ci -Am 'this used to not notice the rm'
634 removing large8
634 removing large8
635 Invoking status precommit hook
635 Invoking status precommit hook
636 R large8
636 R large8
637 Invoking status postcommit hook
637 Invoking status postcommit hook
638 C normal
638 C normal
639 C normal3
639 C normal3
640 C sub/large4
640 C sub/large4
641 C sub/normal4
641 C sub/normal4
642 C sub2/large6
642 C sub2/large6
643 C sub2/large7
643 C sub2/large7
644
644
645 Test that a standin can't be added as a large file
645 Test that a standin can't be added as a large file
646
646
647 $ touch large
647 $ touch large
648 $ hg add --large large
648 $ hg add --large large
649 $ hg ci -m "add"
649 $ hg ci -m "add"
650 Invoking status precommit hook
650 Invoking status precommit hook
651 A large
651 A large
652 Invoking status postcommit hook
652 Invoking status postcommit hook
653 C large
653 C large
654 C normal
654 C normal
655 C normal3
655 C normal3
656 C sub/large4
656 C sub/large4
657 C sub/normal4
657 C sub/normal4
658 C sub2/large6
658 C sub2/large6
659 C sub2/large7
659 C sub2/large7
660 $ hg remove large
660 $ hg remove large
661 $ touch large
661 $ touch large
662 $ hg addremove --config largefiles.patterns=**large --traceback
662 $ hg addremove --config largefiles.patterns=**large --traceback
663 adding large as a largefile
663 adding large as a largefile
664
664
665 Test that outgoing --large works (with revsets too)
665 Test that outgoing --large works (with revsets too)
666 $ hg outgoing --rev '.^' --large
666 $ hg outgoing --rev '.^' --large
667 comparing with $TESTTMP/a
667 comparing with $TESTTMP/a
668 searching for changes
668 searching for changes
669 changeset: 8:c02fd3b77ec4
669 changeset: 8:c02fd3b77ec4
670 user: test
670 user: test
671 date: Thu Jan 01 00:00:00 1970 +0000
671 date: Thu Jan 01 00:00:00 1970 +0000
672 summary: add foo
672 summary: add foo
673
673
674 changeset: 9:289dd08c9bbb
674 changeset: 9:289dd08c9bbb
675 user: test
675 user: test
676 date: Thu Jan 01 00:00:00 1970 +0000
676 date: Thu Jan 01 00:00:00 1970 +0000
677 summary: used to say nothing changed
677 summary: used to say nothing changed
678
678
679 changeset: 10:34f23ac6ac12
679 changeset: 10:34f23ac6ac12
680 user: test
680 user: test
681 date: Thu Jan 01 00:00:00 1970 +0000
681 date: Thu Jan 01 00:00:00 1970 +0000
682 summary: added
682 summary: added
683
683
684 changeset: 12:710c1b2f523c
684 changeset: 12:710c1b2f523c
685 parent: 10:34f23ac6ac12
685 parent: 10:34f23ac6ac12
686 user: test
686 user: test
687 date: Thu Jan 01 00:00:00 1970 +0000
687 date: Thu Jan 01 00:00:00 1970 +0000
688 summary: removed large
688 summary: removed large
689
689
690 changeset: 13:0a3e75774479
690 changeset: 13:0a3e75774479
691 user: test
691 user: test
692 date: Thu Jan 01 00:00:00 1970 +0000
692 date: Thu Jan 01 00:00:00 1970 +0000
693 summary: this used to add large8 as normal and commit both
693 summary: this used to add large8 as normal and commit both
694
694
695 changeset: 14:84f3d378175c
695 changeset: 14:84f3d378175c
696 user: test
696 user: test
697 date: Thu Jan 01 00:00:00 1970 +0000
697 date: Thu Jan 01 00:00:00 1970 +0000
698 summary: this used to not notice the rm
698 summary: this used to not notice the rm
699
699
700 largefiles to upload (1 entities):
700 largefiles to upload (1 entities):
701 large8
701 large8
702
702
703 $ cd ../a
703 $ cd ../a
704
704
705 Clone a largefiles repo.
705 Clone a largefiles repo.
706
706
707 $ hg clone . ../b
707 $ hg clone . ../b
708 updating to branch default
708 updating to branch default
709 getting changed largefiles
709 getting changed largefiles
710 3 largefiles updated, 0 removed
710 3 largefiles updated, 0 removed
711 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
711 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
712 $ cd ../b
712 $ cd ../b
713 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
713 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
714 7:daea875e9014 add/edit more largefiles
714 7:daea875e9014 add/edit more largefiles
715 6:4355d653f84f edit files yet again
715 6:4355d653f84f edit files yet again
716 5:9d5af5072dbd edit files again
716 5:9d5af5072dbd edit files again
717 4:74c02385b94c move files
717 4:74c02385b94c move files
718 3:9e8fbc4bce62 copy files
718 3:9e8fbc4bce62 copy files
719 2:51a0ae4d5864 remove files
719 2:51a0ae4d5864 remove files
720 1:ce8896473775 edit files
720 1:ce8896473775 edit files
721 0:30d30fe6a5be add files
721 0:30d30fe6a5be add files
722 $ cat normal3
722 $ cat normal3
723 normal33
723 normal33
724
724
725 Test graph log
725 Test graph log
726
726
727 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
727 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
728 @ 7:daea875e9014 add/edit more largefiles
728 @ 7:daea875e9014 add/edit more largefiles
729 |
729 |
730 o 6:4355d653f84f edit files yet again
730 o 6:4355d653f84f edit files yet again
731 |
731 |
732 o 5:9d5af5072dbd edit files again
732 o 5:9d5af5072dbd edit files again
733 |
733 |
734 o 4:74c02385b94c move files
734 o 4:74c02385b94c move files
735 |
735 |
736 o 3:9e8fbc4bce62 copy files
736 o 3:9e8fbc4bce62 copy files
737 |
737 |
738 o 2:51a0ae4d5864 remove files
738 o 2:51a0ae4d5864 remove files
739 |
739 |
740 o 1:ce8896473775 edit files
740 o 1:ce8896473775 edit files
741 |
741 |
742 o 0:30d30fe6a5be add files
742 o 0:30d30fe6a5be add files
743
743
744
744
745 Test log with --patch
745 Test log with --patch
746
746
747 $ hg log --patch -r 6::7
747 $ hg log --patch -r 6::7
748 changeset: 6:4355d653f84f
748 changeset: 6:4355d653f84f
749 user: test
749 user: test
750 date: Thu Jan 01 00:00:00 1970 +0000
750 date: Thu Jan 01 00:00:00 1970 +0000
751 summary: edit files yet again
751 summary: edit files yet again
752
752
753 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
753 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
754 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
754 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
755 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
755 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
756 @@ -1,1 +1,1 @@
756 @@ -1,1 +1,1 @@
757 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
757 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
758 +7838695e10da2bb75ac1156565f40a2595fa2fa0
758 +7838695e10da2bb75ac1156565f40a2595fa2fa0
759 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
759 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
760 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
760 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
761 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
761 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
762 @@ -1,1 +1,1 @@
762 @@ -1,1 +1,1 @@
763 -aeb2210d19f02886dde00dac279729a48471e2f9
763 -aeb2210d19f02886dde00dac279729a48471e2f9
764 +971fb41e78fea4f8e0ba5244784239371cb00591
764 +971fb41e78fea4f8e0ba5244784239371cb00591
765 diff -r 9d5af5072dbd -r 4355d653f84f normal3
765 diff -r 9d5af5072dbd -r 4355d653f84f normal3
766 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
766 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
767 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
767 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
768 @@ -1,1 +1,1 @@
768 @@ -1,1 +1,1 @@
769 -normal3
769 -normal3
770 +normal33
770 +normal33
771 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
771 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
772 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
772 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
773 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
773 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
774 @@ -1,1 +1,1 @@
774 @@ -1,1 +1,1 @@
775 -normal4
775 -normal4
776 +normal44
776 +normal44
777
777
778 changeset: 7:daea875e9014
778 changeset: 7:daea875e9014
779 tag: tip
779 tag: tip
780 user: test
780 user: test
781 date: Thu Jan 01 00:00:00 1970 +0000
781 date: Thu Jan 01 00:00:00 1970 +0000
782 summary: add/edit more largefiles
782 summary: add/edit more largefiles
783
783
784 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
784 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
785 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
785 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
786 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
786 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
787 @@ -1,1 +0,0 @@
787 @@ -1,1 +0,0 @@
788 -7838695e10da2bb75ac1156565f40a2595fa2fa0
788 -7838695e10da2bb75ac1156565f40a2595fa2fa0
789 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
789 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
791 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
791 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
792 @@ -0,0 +1,1 @@
792 @@ -0,0 +1,1 @@
793 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
793 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
794 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
794 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
795 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
795 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
796 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
796 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
797 @@ -0,0 +1,1 @@
797 @@ -0,0 +1,1 @@
798 +bb3151689acb10f0c3125c560d5e63df914bc1af
798 +bb3151689acb10f0c3125c560d5e63df914bc1af
799
799
800
800
801 $ hg log --patch -r 6::7 sub/
801 $ hg log --patch -r 6::7 sub/
802 changeset: 6:4355d653f84f
802 changeset: 6:4355d653f84f
803 user: test
803 user: test
804 date: Thu Jan 01 00:00:00 1970 +0000
804 date: Thu Jan 01 00:00:00 1970 +0000
805 summary: edit files yet again
805 summary: edit files yet again
806
806
807 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
807 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
808 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
808 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
809 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
809 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
810 @@ -1,1 +1,1 @@
810 @@ -1,1 +1,1 @@
811 -aeb2210d19f02886dde00dac279729a48471e2f9
811 -aeb2210d19f02886dde00dac279729a48471e2f9
812 +971fb41e78fea4f8e0ba5244784239371cb00591
812 +971fb41e78fea4f8e0ba5244784239371cb00591
813 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
813 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
814 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
814 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
815 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
815 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
816 @@ -1,1 +1,1 @@
816 @@ -1,1 +1,1 @@
817 -normal4
817 -normal4
818 +normal44
818 +normal44
819
819
820
820
821 log with both --follow and --patch
821 log with both --follow and --patch
822
822
823 $ hg log --follow --patch --limit 2
823 $ hg log --follow --patch --limit 2
824 changeset: 7:daea875e9014
824 changeset: 7:daea875e9014
825 tag: tip
825 tag: tip
826 user: test
826 user: test
827 date: Thu Jan 01 00:00:00 1970 +0000
827 date: Thu Jan 01 00:00:00 1970 +0000
828 summary: add/edit more largefiles
828 summary: add/edit more largefiles
829
829
830 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
830 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
831 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
831 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
832 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
832 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
833 @@ -1,1 +0,0 @@
833 @@ -1,1 +0,0 @@
834 -7838695e10da2bb75ac1156565f40a2595fa2fa0
834 -7838695e10da2bb75ac1156565f40a2595fa2fa0
835 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
835 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
836 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
836 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
837 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
837 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
838 @@ -0,0 +1,1 @@
838 @@ -0,0 +1,1 @@
839 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
839 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
840 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
840 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
841 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
841 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
842 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
842 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
843 @@ -0,0 +1,1 @@
843 @@ -0,0 +1,1 @@
844 +bb3151689acb10f0c3125c560d5e63df914bc1af
844 +bb3151689acb10f0c3125c560d5e63df914bc1af
845
845
846 changeset: 6:4355d653f84f
846 changeset: 6:4355d653f84f
847 user: test
847 user: test
848 date: Thu Jan 01 00:00:00 1970 +0000
848 date: Thu Jan 01 00:00:00 1970 +0000
849 summary: edit files yet again
849 summary: edit files yet again
850
850
851 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
851 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
852 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
852 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
853 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
853 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
854 @@ -1,1 +1,1 @@
854 @@ -1,1 +1,1 @@
855 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
855 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
856 +7838695e10da2bb75ac1156565f40a2595fa2fa0
856 +7838695e10da2bb75ac1156565f40a2595fa2fa0
857 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
857 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
858 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
858 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
859 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
859 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
860 @@ -1,1 +1,1 @@
860 @@ -1,1 +1,1 @@
861 -aeb2210d19f02886dde00dac279729a48471e2f9
861 -aeb2210d19f02886dde00dac279729a48471e2f9
862 +971fb41e78fea4f8e0ba5244784239371cb00591
862 +971fb41e78fea4f8e0ba5244784239371cb00591
863 diff -r 9d5af5072dbd -r 4355d653f84f normal3
863 diff -r 9d5af5072dbd -r 4355d653f84f normal3
864 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
864 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
865 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
865 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
866 @@ -1,1 +1,1 @@
866 @@ -1,1 +1,1 @@
867 -normal3
867 -normal3
868 +normal33
868 +normal33
869 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
869 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
870 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
870 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
871 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
871 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
872 @@ -1,1 +1,1 @@
872 @@ -1,1 +1,1 @@
873 -normal4
873 -normal4
874 +normal44
874 +normal44
875
875
876 $ hg log --follow --patch sub/large4
876 $ hg log --follow --patch sub/large4
877 changeset: 6:4355d653f84f
877 changeset: 6:4355d653f84f
878 user: test
878 user: test
879 date: Thu Jan 01 00:00:00 1970 +0000
879 date: Thu Jan 01 00:00:00 1970 +0000
880 summary: edit files yet again
880 summary: edit files yet again
881
881
882 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
882 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
883 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
883 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
884 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
884 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
885 @@ -1,1 +1,1 @@
885 @@ -1,1 +1,1 @@
886 -aeb2210d19f02886dde00dac279729a48471e2f9
886 -aeb2210d19f02886dde00dac279729a48471e2f9
887 +971fb41e78fea4f8e0ba5244784239371cb00591
887 +971fb41e78fea4f8e0ba5244784239371cb00591
888
888
889 changeset: 5:9d5af5072dbd
889 changeset: 5:9d5af5072dbd
890 user: test
890 user: test
891 date: Thu Jan 01 00:00:00 1970 +0000
891 date: Thu Jan 01 00:00:00 1970 +0000
892 summary: edit files again
892 summary: edit files again
893
893
894 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
894 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
895 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
895 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
896 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
896 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
897 @@ -1,1 +1,1 @@
897 @@ -1,1 +1,1 @@
898 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
898 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
899 +aeb2210d19f02886dde00dac279729a48471e2f9
899 +aeb2210d19f02886dde00dac279729a48471e2f9
900
900
901 changeset: 4:74c02385b94c
901 changeset: 4:74c02385b94c
902 user: test
902 user: test
903 date: Thu Jan 01 00:00:00 1970 +0000
903 date: Thu Jan 01 00:00:00 1970 +0000
904 summary: move files
904 summary: move files
905
905
906 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
906 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
907 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
907 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
908 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
908 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
909 @@ -0,0 +1,1 @@
909 @@ -0,0 +1,1 @@
910 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
910 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
911
911
912 changeset: 1:ce8896473775
912 changeset: 1:ce8896473775
913 user: test
913 user: test
914 date: Thu Jan 01 00:00:00 1970 +0000
914 date: Thu Jan 01 00:00:00 1970 +0000
915 summary: edit files
915 summary: edit files
916
916
917 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
917 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
918 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
918 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
919 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
919 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
920 @@ -1,1 +1,1 @@
920 @@ -1,1 +1,1 @@
921 -1deebade43c8c498a3c8daddac0244dc55d1331d
921 -1deebade43c8c498a3c8daddac0244dc55d1331d
922 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
922 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
923
923
924 changeset: 0:30d30fe6a5be
924 changeset: 0:30d30fe6a5be
925 user: test
925 user: test
926 date: Thu Jan 01 00:00:00 1970 +0000
926 date: Thu Jan 01 00:00:00 1970 +0000
927 summary: add files
927 summary: add files
928
928
929 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
929 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
930 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
931 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
931 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
932 @@ -0,0 +1,1 @@
932 @@ -0,0 +1,1 @@
933 +1deebade43c8c498a3c8daddac0244dc55d1331d
933 +1deebade43c8c498a3c8daddac0244dc55d1331d
934
934
935 $ cat sub/normal4
935 $ cat sub/normal4
936 normal44
936 normal44
937 $ cat sub/large4
937 $ cat sub/large4
938 large44
938 large44
939 $ cat sub2/large6
939 $ cat sub2/large6
940 large6
940 large6
941 $ cat sub2/large7
941 $ cat sub2/large7
942 large7
942 large7
943 $ hg log -qf sub2/large7
943 $ hg log -qf sub2/large7
944 7:daea875e9014
944 7:daea875e9014
945 $ hg log -Gqf sub2/large7
945 $ hg log -Gqf sub2/large7
946 @ 7:daea875e9014
946 @ 7:daea875e9014
947 |
947 |
948 ~
948 ~
949 $ cd ..
949 $ cd ..
950
950
951 Test log from outside repo
951 Test log from outside repo
952
952
953 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
953 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
954 6:4355d653f84f edit files yet again
954 6:4355d653f84f edit files yet again
955 5:9d5af5072dbd edit files again
955 5:9d5af5072dbd edit files again
956 4:74c02385b94c move files
956 4:74c02385b94c move files
957 1:ce8896473775 edit files
957 1:ce8896473775 edit files
958 0:30d30fe6a5be add files
958 0:30d30fe6a5be add files
959
959
960 Test clone at revision
960 Test clone at revision
961
961
962 $ hg clone a -r 3 c
962 $ hg clone a -r 3 c
963 adding changesets
963 adding changesets
964 adding manifests
964 adding manifests
965 adding file changes
965 adding file changes
966 added 4 changesets with 10 changes to 4 files
966 added 4 changesets with 10 changes to 4 files
967 new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts)
967 new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts)
968 updating to branch default
968 updating to branch default
969 getting changed largefiles
969 getting changed largefiles
970 2 largefiles updated, 0 removed
970 2 largefiles updated, 0 removed
971 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
971 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
972 $ cd c
972 $ cd c
973 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
973 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
974 3:9e8fbc4bce62 copy files
974 3:9e8fbc4bce62 copy files
975 2:51a0ae4d5864 remove files
975 2:51a0ae4d5864 remove files
976 1:ce8896473775 edit files
976 1:ce8896473775 edit files
977 0:30d30fe6a5be add files
977 0:30d30fe6a5be add files
978 $ cat normal1
978 $ cat normal1
979 normal22
979 normal22
980 $ cat large1
980 $ cat large1
981 large22
981 large22
982 $ cat sub/normal2
982 $ cat sub/normal2
983 normal22
983 normal22
984 $ cat sub/large2
984 $ cat sub/large2
985 large22
985 large22
986
986
987 Old revisions of a clone have correct largefiles content (this also
987 Old revisions of a clone have correct largefiles content (this also
988 tests update).
988 tests update).
989
989
990 $ hg update -r 1
990 $ hg update -r 1
991 getting changed largefiles
991 getting changed largefiles
992 1 largefiles updated, 0 removed
992 1 largefiles updated, 0 removed
993 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 $ cat large1
994 $ cat large1
995 large11
995 large11
996 $ cat sub/large2
996 $ cat sub/large2
997 large22
997 large22
998 $ cd ..
998 $ cd ..
999
999
1000 Test cloning with --all-largefiles flag
1000 Test cloning with --all-largefiles flag
1001
1001
1002 $ rm "${USERCACHE}"/*
1002 $ rm "${USERCACHE}"/*
1003 $ hg clone --all-largefiles a a-backup
1003 $ hg clone --all-largefiles a a-backup
1004 updating to branch default
1004 updating to branch default
1005 getting changed largefiles
1005 getting changed largefiles
1006 3 largefiles updated, 0 removed
1006 3 largefiles updated, 0 removed
1007 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1008 7 additional largefiles cached
1008 7 additional largefiles cached
1009
1009
1010 $ rm "${USERCACHE}"/*
1010 $ rm "${USERCACHE}"/*
1011 $ hg clone --all-largefiles -u 0 a a-clone0
1011 $ hg clone --all-largefiles -u 0 a a-clone0
1012 updating to branch default
1012 updating to branch default
1013 getting changed largefiles
1013 getting changed largefiles
1014 2 largefiles updated, 0 removed
1014 2 largefiles updated, 0 removed
1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1016 8 additional largefiles cached
1016 8 additional largefiles cached
1017 $ hg -R a-clone0 sum
1017 $ hg -R a-clone0 sum
1018 parent: 0:30d30fe6a5be
1018 parent: 0:30d30fe6a5be
1019 add files
1019 add files
1020 branch: default
1020 branch: default
1021 commit: (clean)
1021 commit: (clean)
1022 update: 7 new changesets (update)
1022 update: 7 new changesets (update)
1023 phases: 8 draft
1023 phases: 8 draft
1024
1024
1025 $ rm "${USERCACHE}"/*
1025 $ rm "${USERCACHE}"/*
1026 $ hg clone --all-largefiles -u 1 a a-clone1
1026 $ hg clone --all-largefiles -u 1 a a-clone1
1027 updating to branch default
1027 updating to branch default
1028 getting changed largefiles
1028 getting changed largefiles
1029 2 largefiles updated, 0 removed
1029 2 largefiles updated, 0 removed
1030 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1030 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1031 8 additional largefiles cached
1031 8 additional largefiles cached
1032 $ hg -R a-clone1 verify --large --lfa --lfc
1032 $ hg -R a-clone1 verify --large --lfa --lfc
1033 checking changesets
1033 checking changesets
1034 checking manifests
1034 checking manifests
1035 crosschecking files in changesets and manifests
1035 crosschecking files in changesets and manifests
1036 checking files
1036 checking files
1037 checked 8 changesets with 24 changes to 10 files
1037 checked 8 changesets with 24 changes to 10 files
1038 searching 8 changesets for largefiles
1038 searching 8 changesets for largefiles
1039 verified contents of 13 revisions of 6 largefiles
1039 verified contents of 13 revisions of 6 largefiles
1040 $ hg -R a-clone1 sum
1040 $ hg -R a-clone1 sum
1041 parent: 1:ce8896473775
1041 parent: 1:ce8896473775
1042 edit files
1042 edit files
1043 branch: default
1043 branch: default
1044 commit: (clean)
1044 commit: (clean)
1045 update: 6 new changesets (update)
1045 update: 6 new changesets (update)
1046 phases: 8 draft
1046 phases: 8 draft
1047
1047
1048 $ rm "${USERCACHE}"/*
1048 $ rm "${USERCACHE}"/*
1049 $ hg clone --all-largefiles -U a a-clone-u
1049 $ hg clone --all-largefiles -U a a-clone-u
1050 10 additional largefiles cached
1050 10 additional largefiles cached
1051 $ hg -R a-clone-u sum
1051 $ hg -R a-clone-u sum
1052 parent: -1:000000000000 (no revision checked out)
1052 parent: -1:000000000000 (no revision checked out)
1053 branch: default
1053 branch: default
1054 commit: (clean)
1054 commit: (clean)
1055 update: 8 new changesets (update)
1055 update: 8 new changesets (update)
1056 phases: 8 draft
1056 phases: 8 draft
1057
1057
1058 Show computed destination directory:
1058 Show computed destination directory:
1059
1059
1060 $ mkdir xyz
1060 $ mkdir xyz
1061 $ cd xyz
1061 $ cd xyz
1062 $ hg clone ../a
1062 $ hg clone ../a
1063 destination directory: a
1063 destination directory: a
1064 updating to branch default
1064 updating to branch default
1065 getting changed largefiles
1065 getting changed largefiles
1066 3 largefiles updated, 0 removed
1066 3 largefiles updated, 0 removed
1067 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1067 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1068 $ cd ..
1068 $ cd ..
1069
1069
1070 Clone URL without path:
1070 Clone URL without path:
1071
1071
1072 $ hg clone file://
1072 $ hg clone file://
1073 abort: repository / not found
1073 abort: repository / not found
1074 [255]
1074 [255]
1075
1075
1076 Ensure base clone command argument validation
1076 Ensure base clone command argument validation
1077
1077
1078 $ hg clone -U -u 0 a a-clone-failure
1078 $ hg clone -U -u 0 a a-clone-failure
1079 abort: cannot specify both --noupdate and --updaterev
1079 abort: cannot specify both --noupdate and --updaterev
1080 [10]
1080 [10]
1081
1081
1082 $ hg clone --all-largefiles a ssh://localhost/a
1082 $ hg clone --all-largefiles a ssh://localhost/a
1083 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1083 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1084 [255]
1084 [255]
1085
1085
1086 Test pulling with --all-largefiles flag. Also test that the largefiles are
1086 Test pulling with --all-largefiles flag. Also test that the largefiles are
1087 downloaded from 'default' instead of 'default-push' when no source is specified
1087 downloaded from 'default' instead of 'default-push' when no source is specified
1088 (issue3584)
1088 (issue3584)
1089
1089
1090 $ rm -Rf a-backup
1090 $ rm -Rf a-backup
1091 $ hg clone -r 1 a a-backup
1091 $ hg clone -r 1 a a-backup
1092 adding changesets
1092 adding changesets
1093 adding manifests
1093 adding manifests
1094 adding file changes
1094 adding file changes
1095 added 2 changesets with 8 changes to 4 files
1095 added 2 changesets with 8 changes to 4 files
1096 new changesets 30d30fe6a5be:ce8896473775 (2 drafts)
1096 new changesets 30d30fe6a5be:ce8896473775 (2 drafts)
1097 updating to branch default
1097 updating to branch default
1098 getting changed largefiles
1098 getting changed largefiles
1099 2 largefiles updated, 0 removed
1099 2 largefiles updated, 0 removed
1100 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1100 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1101 $ rm "${USERCACHE}"/*
1101 $ rm "${USERCACHE}"/*
1102 $ cd a-backup
1102 $ cd a-backup
1103 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1103 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1104 pulling from $TESTTMP/a
1104 pulling from $TESTTMP/a
1105 searching for changes
1105 searching for changes
1106 adding changesets
1106 adding changesets
1107 adding manifests
1107 adding manifests
1108 adding file changes
1108 adding file changes
1109 added 6 changesets with 16 changes to 8 files
1109 added 6 changesets with 16 changes to 8 files
1110 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1110 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1111 (run 'hg update' to get a working copy)
1111 (run 'hg update' to get a working copy)
1112 6 largefiles cached
1112 6 largefiles cached
1113
1113
1114 redo pull with --lfrev and check it pulls largefiles for the right revs
1114 redo pull with --lfrev and check it pulls largefiles for the right revs
1115
1115
1116 $ hg rollback
1116 $ hg rollback
1117 repository tip rolled back to revision 1 (undo pull)
1117 repository tip rolled back to revision 1 (undo pull)
1118 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1118 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1119 pulling from $TESTTMP/a
1119 pulling from $TESTTMP/a
1120 searching for changes
1120 searching for changes
1121 all local changesets known remotely
1121 all local changesets known remotely
1122 6 changesets found
1122 6 changesets found
1123 uncompressed size of bundle content:
1123 uncompressed size of bundle content:
1124 1389 (changelog)
1124 1389 (changelog)
1125 1599 (manifests)
1125 1698 (manifests)
1126 254 .hglf/large1
1126 254 .hglf/large1
1127 564 .hglf/large3
1127 564 .hglf/large3
1128 572 .hglf/sub/large4
1128 572 .hglf/sub/large4
1129 182 .hglf/sub2/large6
1129 182 .hglf/sub2/large6
1130 182 .hglf/sub2/large7
1130 182 .hglf/sub2/large7
1131 212 normal1
1131 212 normal1
1132 457 normal3
1132 457 normal3
1133 465 sub/normal4
1133 465 sub/normal4
1134 adding changesets
1134 adding changesets
1135 adding manifests
1135 adding manifests
1136 adding file changes
1136 adding file changes
1137 added 6 changesets with 16 changes to 8 files
1137 added 6 changesets with 16 changes to 8 files
1138 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1138 new changesets 51a0ae4d5864:daea875e9014 (6 drafts)
1139 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1139 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1140 (run 'hg update' to get a working copy)
1140 (run 'hg update' to get a working copy)
1141 pulling largefiles for revision 7
1141 pulling largefiles for revision 7
1142 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1142 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1143 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1143 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1144 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1144 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1145 pulling largefiles for revision 2
1145 pulling largefiles for revision 2
1146 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1146 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1147 0 largefiles cached
1147 0 largefiles cached
1148
1148
1149 lfpull
1149 lfpull
1150
1150
1151 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1151 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1152 2 largefiles cached
1152 2 largefiles cached
1153 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1153 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1154 pulling largefiles for revision 4
1154 pulling largefiles for revision 4
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1155 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1156 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1156 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1157 pulling largefiles for revision 2
1157 pulling largefiles for revision 2
1158 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1158 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1159 0 largefiles cached
1159 0 largefiles cached
1160
1160
1161 $ ls usercache-lfpull/* | sort
1161 $ ls usercache-lfpull/* | sort
1162 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1162 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1163 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1163 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1164
1164
1165 $ cd ..
1165 $ cd ..
1166
1166
1167 Rebasing between two repositories does not revert largefiles to old
1167 Rebasing between two repositories does not revert largefiles to old
1168 revisions (this was a very bad bug that took a lot of work to fix).
1168 revisions (this was a very bad bug that took a lot of work to fix).
1169
1169
1170 $ hg clone a d
1170 $ hg clone a d
1171 updating to branch default
1171 updating to branch default
1172 getting changed largefiles
1172 getting changed largefiles
1173 3 largefiles updated, 0 removed
1173 3 largefiles updated, 0 removed
1174 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1174 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1175 $ cd b
1175 $ cd b
1176 $ echo large4-modified > sub/large4
1176 $ echo large4-modified > sub/large4
1177 $ echo normal3-modified > normal3
1177 $ echo normal3-modified > normal3
1178 $ hg commit -m "modify normal file and largefile in repo b"
1178 $ hg commit -m "modify normal file and largefile in repo b"
1179 Invoking status precommit hook
1179 Invoking status precommit hook
1180 M normal3
1180 M normal3
1181 M sub/large4
1181 M sub/large4
1182 $ cd ../d
1182 $ cd ../d
1183 $ echo large6-modified > sub2/large6
1183 $ echo large6-modified > sub2/large6
1184 $ echo normal4-modified > sub/normal4
1184 $ echo normal4-modified > sub/normal4
1185 $ hg commit -m "modify normal file largefile in repo d"
1185 $ hg commit -m "modify normal file largefile in repo d"
1186 Invoking status precommit hook
1186 Invoking status precommit hook
1187 M sub/normal4
1187 M sub/normal4
1188 M sub2/large6
1188 M sub2/large6
1189 $ cd ..
1189 $ cd ..
1190 $ hg clone d e
1190 $ hg clone d e
1191 updating to branch default
1191 updating to branch default
1192 getting changed largefiles
1192 getting changed largefiles
1193 3 largefiles updated, 0 removed
1193 3 largefiles updated, 0 removed
1194 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1194 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1195 $ cd d
1195 $ cd d
1196
1196
1197 More rebase testing, but also test that the largefiles are downloaded from
1197 More rebase testing, but also test that the largefiles are downloaded from
1198 'default-push' when no source is specified (issue3584). (The largefile from the
1198 'default-push' when no source is specified (issue3584). (The largefile from the
1199 pulled revision is however not downloaded but found in the local cache.)
1199 pulled revision is however not downloaded but found in the local cache.)
1200 Largefiles are fetched for the new pulled revision, not for existing revisions,
1200 Largefiles are fetched for the new pulled revision, not for existing revisions,
1201 rebased or not.
1201 rebased or not.
1202
1202
1203 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1203 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1204 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1204 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1205 pulling from $TESTTMP/b
1205 pulling from $TESTTMP/b
1206 searching for changes
1206 searching for changes
1207 adding changesets
1207 adding changesets
1208 adding manifests
1208 adding manifests
1209 adding file changes
1209 adding file changes
1210 added 1 changesets with 2 changes to 2 files (+1 heads)
1210 added 1 changesets with 2 changes to 2 files (+1 heads)
1211 new changesets a381d2c8c80e (1 drafts)
1211 new changesets a381d2c8c80e (1 drafts)
1212 0 largefiles cached
1212 0 largefiles cached
1213 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1213 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1214 Invoking status precommit hook
1214 Invoking status precommit hook
1215 M sub/normal4
1215 M sub/normal4
1216 M sub2/large6
1216 M sub2/large6
1217 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1217 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1218 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1218 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1219 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1219 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1220 9:598410d3eb9a modify normal file largefile in repo d
1220 9:598410d3eb9a modify normal file largefile in repo d
1221 8:a381d2c8c80e modify normal file and largefile in repo b
1221 8:a381d2c8c80e modify normal file and largefile in repo b
1222 7:daea875e9014 add/edit more largefiles
1222 7:daea875e9014 add/edit more largefiles
1223 6:4355d653f84f edit files yet again
1223 6:4355d653f84f edit files yet again
1224 5:9d5af5072dbd edit files again
1224 5:9d5af5072dbd edit files again
1225 4:74c02385b94c move files
1225 4:74c02385b94c move files
1226 3:9e8fbc4bce62 copy files
1226 3:9e8fbc4bce62 copy files
1227 2:51a0ae4d5864 remove files
1227 2:51a0ae4d5864 remove files
1228 1:ce8896473775 edit files
1228 1:ce8896473775 edit files
1229 0:30d30fe6a5be add files
1229 0:30d30fe6a5be add files
1230 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1230 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1231 @ 9:598410d3eb9a modify normal file largefile in repo d
1231 @ 9:598410d3eb9a modify normal file largefile in repo d
1232 |
1232 |
1233 o 8:a381d2c8c80e modify normal file and largefile in repo b
1233 o 8:a381d2c8c80e modify normal file and largefile in repo b
1234 |
1234 |
1235 o 7:daea875e9014 add/edit more largefiles
1235 o 7:daea875e9014 add/edit more largefiles
1236 |
1236 |
1237 o 6:4355d653f84f edit files yet again
1237 o 6:4355d653f84f edit files yet again
1238 |
1238 |
1239 o 5:9d5af5072dbd edit files again
1239 o 5:9d5af5072dbd edit files again
1240 |
1240 |
1241 o 4:74c02385b94c move files
1241 o 4:74c02385b94c move files
1242 |
1242 |
1243 o 3:9e8fbc4bce62 copy files
1243 o 3:9e8fbc4bce62 copy files
1244 |
1244 |
1245 o 2:51a0ae4d5864 remove files
1245 o 2:51a0ae4d5864 remove files
1246 |
1246 |
1247 o 1:ce8896473775 edit files
1247 o 1:ce8896473775 edit files
1248 |
1248 |
1249 o 0:30d30fe6a5be add files
1249 o 0:30d30fe6a5be add files
1250
1250
1251 $ cat normal3
1251 $ cat normal3
1252 normal3-modified
1252 normal3-modified
1253 $ cat sub/normal4
1253 $ cat sub/normal4
1254 normal4-modified
1254 normal4-modified
1255 $ cat sub/large4
1255 $ cat sub/large4
1256 large4-modified
1256 large4-modified
1257 $ cat sub2/large6
1257 $ cat sub2/large6
1258 large6-modified
1258 large6-modified
1259 $ cat sub2/large7
1259 $ cat sub2/large7
1260 large7
1260 large7
1261 $ cd ../e
1261 $ cd ../e
1262 $ hg pull ../b
1262 $ hg pull ../b
1263 pulling from ../b
1263 pulling from ../b
1264 searching for changes
1264 searching for changes
1265 adding changesets
1265 adding changesets
1266 adding manifests
1266 adding manifests
1267 adding file changes
1267 adding file changes
1268 added 1 changesets with 2 changes to 2 files (+1 heads)
1268 added 1 changesets with 2 changes to 2 files (+1 heads)
1269 new changesets a381d2c8c80e (1 drafts)
1269 new changesets a381d2c8c80e (1 drafts)
1270 (run 'hg heads' to see heads, 'hg merge' to merge)
1270 (run 'hg heads' to see heads, 'hg merge' to merge)
1271 $ hg rebase
1271 $ hg rebase
1272 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1272 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1273 Invoking status precommit hook
1273 Invoking status precommit hook
1274 M sub/normal4
1274 M sub/normal4
1275 M sub2/large6
1275 M sub2/large6
1276 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1276 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg
1277 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1277 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1278 9:598410d3eb9a modify normal file largefile in repo d
1278 9:598410d3eb9a modify normal file largefile in repo d
1279 8:a381d2c8c80e modify normal file and largefile in repo b
1279 8:a381d2c8c80e modify normal file and largefile in repo b
1280 7:daea875e9014 add/edit more largefiles
1280 7:daea875e9014 add/edit more largefiles
1281 6:4355d653f84f edit files yet again
1281 6:4355d653f84f edit files yet again
1282 5:9d5af5072dbd edit files again
1282 5:9d5af5072dbd edit files again
1283 4:74c02385b94c move files
1283 4:74c02385b94c move files
1284 3:9e8fbc4bce62 copy files
1284 3:9e8fbc4bce62 copy files
1285 2:51a0ae4d5864 remove files
1285 2:51a0ae4d5864 remove files
1286 1:ce8896473775 edit files
1286 1:ce8896473775 edit files
1287 0:30d30fe6a5be add files
1287 0:30d30fe6a5be add files
1288 $ cat normal3
1288 $ cat normal3
1289 normal3-modified
1289 normal3-modified
1290 $ cat sub/normal4
1290 $ cat sub/normal4
1291 normal4-modified
1291 normal4-modified
1292 $ cat sub/large4
1292 $ cat sub/large4
1293 large4-modified
1293 large4-modified
1294 $ cat sub2/large6
1294 $ cat sub2/large6
1295 large6-modified
1295 large6-modified
1296 $ cat sub2/large7
1296 $ cat sub2/large7
1297 large7
1297 large7
1298
1298
1299 Log on largefiles
1299 Log on largefiles
1300
1300
1301 - same output
1301 - same output
1302 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1302 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1303 8:a381d2c8c80e modify normal file and largefile in repo b
1303 8:a381d2c8c80e modify normal file and largefile in repo b
1304 6:4355d653f84f edit files yet again
1304 6:4355d653f84f edit files yet again
1305 5:9d5af5072dbd edit files again
1305 5:9d5af5072dbd edit files again
1306 4:74c02385b94c move files
1306 4:74c02385b94c move files
1307 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1307 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1308 o 8:a381d2c8c80e modify normal file and largefile in repo b
1308 o 8:a381d2c8c80e modify normal file and largefile in repo b
1309 :
1309 :
1310 o 6:4355d653f84f edit files yet again
1310 o 6:4355d653f84f edit files yet again
1311 |
1311 |
1312 o 5:9d5af5072dbd edit files again
1312 o 5:9d5af5072dbd edit files again
1313 |
1313 |
1314 o 4:74c02385b94c move files
1314 o 4:74c02385b94c move files
1315 |
1315 |
1316 ~
1316 ~
1317 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1317 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1318 8:a381d2c8c80e modify normal file and largefile in repo b
1318 8:a381d2c8c80e modify normal file and largefile in repo b
1319 6:4355d653f84f edit files yet again
1319 6:4355d653f84f edit files yet again
1320 5:9d5af5072dbd edit files again
1320 5:9d5af5072dbd edit files again
1321 4:74c02385b94c move files
1321 4:74c02385b94c move files
1322 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1322 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1323 o 8:a381d2c8c80e modify normal file and largefile in repo b
1323 o 8:a381d2c8c80e modify normal file and largefile in repo b
1324 :
1324 :
1325 o 6:4355d653f84f edit files yet again
1325 o 6:4355d653f84f edit files yet again
1326 |
1326 |
1327 o 5:9d5af5072dbd edit files again
1327 o 5:9d5af5072dbd edit files again
1328 |
1328 |
1329 o 4:74c02385b94c move files
1329 o 4:74c02385b94c move files
1330 |
1330 |
1331 ~
1331 ~
1332
1332
1333 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1333 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1334 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1334 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1335 8:a381d2c8c80e modify normal file and largefile in repo b
1335 8:a381d2c8c80e modify normal file and largefile in repo b
1336 6:4355d653f84f edit files yet again
1336 6:4355d653f84f edit files yet again
1337 5:9d5af5072dbd edit files again
1337 5:9d5af5072dbd edit files again
1338 4:74c02385b94c move files
1338 4:74c02385b94c move files
1339 1:ce8896473775 edit files
1339 1:ce8896473775 edit files
1340 0:30d30fe6a5be add files
1340 0:30d30fe6a5be add files
1341 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1341 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1342 o 8:a381d2c8c80e modify normal file and largefile in repo b
1342 o 8:a381d2c8c80e modify normal file and largefile in repo b
1343 :
1343 :
1344 o 6:4355d653f84f edit files yet again
1344 o 6:4355d653f84f edit files yet again
1345 |
1345 |
1346 o 5:9d5af5072dbd edit files again
1346 o 5:9d5af5072dbd edit files again
1347 |
1347 |
1348 o 4:74c02385b94c move files
1348 o 4:74c02385b94c move files
1349 :
1349 :
1350 o 1:ce8896473775 edit files
1350 o 1:ce8896473775 edit files
1351 |
1351 |
1352 o 0:30d30fe6a5be add files
1352 o 0:30d30fe6a5be add files
1353
1353
1354 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1354 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1355 9:598410d3eb9a modify normal file largefile in repo d
1355 9:598410d3eb9a modify normal file largefile in repo d
1356 8:a381d2c8c80e modify normal file and largefile in repo b
1356 8:a381d2c8c80e modify normal file and largefile in repo b
1357 6:4355d653f84f edit files yet again
1357 6:4355d653f84f edit files yet again
1358 5:9d5af5072dbd edit files again
1358 5:9d5af5072dbd edit files again
1359 4:74c02385b94c move files
1359 4:74c02385b94c move files
1360 1:ce8896473775 edit files
1360 1:ce8896473775 edit files
1361 0:30d30fe6a5be add files
1361 0:30d30fe6a5be add files
1362 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1362 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1363 @ 9:598410d3eb9a modify normal file largefile in repo d
1363 @ 9:598410d3eb9a modify normal file largefile in repo d
1364 |
1364 |
1365 o 8:a381d2c8c80e modify normal file and largefile in repo b
1365 o 8:a381d2c8c80e modify normal file and largefile in repo b
1366 :
1366 :
1367 o 6:4355d653f84f edit files yet again
1367 o 6:4355d653f84f edit files yet again
1368 |
1368 |
1369 o 5:9d5af5072dbd edit files again
1369 o 5:9d5af5072dbd edit files again
1370 |
1370 |
1371 o 4:74c02385b94c move files
1371 o 4:74c02385b94c move files
1372 :
1372 :
1373 o 1:ce8896473775 edit files
1373 o 1:ce8896473775 edit files
1374 |
1374 |
1375 o 0:30d30fe6a5be add files
1375 o 0:30d30fe6a5be add files
1376
1376
1377 - globbing gives same result
1377 - globbing gives same result
1378 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1378 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1379 9:598410d3eb9a modify normal file largefile in repo d
1379 9:598410d3eb9a modify normal file largefile in repo d
1380 8:a381d2c8c80e modify normal file and largefile in repo b
1380 8:a381d2c8c80e modify normal file and largefile in repo b
1381 6:4355d653f84f edit files yet again
1381 6:4355d653f84f edit files yet again
1382 5:9d5af5072dbd edit files again
1382 5:9d5af5072dbd edit files again
1383 4:74c02385b94c move files
1383 4:74c02385b94c move files
1384 1:ce8896473775 edit files
1384 1:ce8896473775 edit files
1385 0:30d30fe6a5be add files
1385 0:30d30fe6a5be add files
1386 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1386 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1387 @ 9:598410d3eb9a modify normal file largefile in repo d
1387 @ 9:598410d3eb9a modify normal file largefile in repo d
1388 |
1388 |
1389 o 8:a381d2c8c80e modify normal file and largefile in repo b
1389 o 8:a381d2c8c80e modify normal file and largefile in repo b
1390 :
1390 :
1391 o 6:4355d653f84f edit files yet again
1391 o 6:4355d653f84f edit files yet again
1392 |
1392 |
1393 o 5:9d5af5072dbd edit files again
1393 o 5:9d5af5072dbd edit files again
1394 |
1394 |
1395 o 4:74c02385b94c move files
1395 o 4:74c02385b94c move files
1396 :
1396 :
1397 o 1:ce8896473775 edit files
1397 o 1:ce8896473775 edit files
1398 |
1398 |
1399 o 0:30d30fe6a5be add files
1399 o 0:30d30fe6a5be add files
1400
1400
1401 Rollback on largefiles.
1401 Rollback on largefiles.
1402
1402
1403 $ echo large4-modified-again > sub/large4
1403 $ echo large4-modified-again > sub/large4
1404 $ hg commit -m "Modify large4 again"
1404 $ hg commit -m "Modify large4 again"
1405 Invoking status precommit hook
1405 Invoking status precommit hook
1406 M sub/large4
1406 M sub/large4
1407 $ hg rollback
1407 $ hg rollback
1408 repository tip rolled back to revision 9 (undo commit)
1408 repository tip rolled back to revision 9 (undo commit)
1409 working directory now based on revision 9
1409 working directory now based on revision 9
1410 $ hg st
1410 $ hg st
1411 M sub/large4
1411 M sub/large4
1412 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1412 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1413 9:598410d3eb9a modify normal file largefile in repo d
1413 9:598410d3eb9a modify normal file largefile in repo d
1414 8:a381d2c8c80e modify normal file and largefile in repo b
1414 8:a381d2c8c80e modify normal file and largefile in repo b
1415 7:daea875e9014 add/edit more largefiles
1415 7:daea875e9014 add/edit more largefiles
1416 6:4355d653f84f edit files yet again
1416 6:4355d653f84f edit files yet again
1417 5:9d5af5072dbd edit files again
1417 5:9d5af5072dbd edit files again
1418 4:74c02385b94c move files
1418 4:74c02385b94c move files
1419 3:9e8fbc4bce62 copy files
1419 3:9e8fbc4bce62 copy files
1420 2:51a0ae4d5864 remove files
1420 2:51a0ae4d5864 remove files
1421 1:ce8896473775 edit files
1421 1:ce8896473775 edit files
1422 0:30d30fe6a5be add files
1422 0:30d30fe6a5be add files
1423 $ cat sub/large4
1423 $ cat sub/large4
1424 large4-modified-again
1424 large4-modified-again
1425
1425
1426 "update --check" refuses to update with uncommitted changes.
1426 "update --check" refuses to update with uncommitted changes.
1427 $ hg update --check 8
1427 $ hg update --check 8
1428 abort: uncommitted changes
1428 abort: uncommitted changes
1429 [255]
1429 [255]
1430
1430
1431 "update --clean" leaves correct largefiles in working copy, even when there is
1431 "update --clean" leaves correct largefiles in working copy, even when there is
1432 .orig files from revert in .hglf.
1432 .orig files from revert in .hglf.
1433
1433
1434 $ echo mistake > sub2/large7
1434 $ echo mistake > sub2/large7
1435 $ hg revert sub2/large7
1435 $ hg revert sub2/large7
1436 $ cat sub2/large7
1436 $ cat sub2/large7
1437 large7
1437 large7
1438 $ cat sub2/large7.orig
1438 $ cat sub2/large7.orig
1439 mistake
1439 mistake
1440 $ test ! -f .hglf/sub2/large7.orig
1440 $ test ! -f .hglf/sub2/large7.orig
1441
1441
1442 $ hg -q update --clean -r null
1442 $ hg -q update --clean -r null
1443 $ hg update --clean
1443 $ hg update --clean
1444 getting changed largefiles
1444 getting changed largefiles
1445 3 largefiles updated, 0 removed
1445 3 largefiles updated, 0 removed
1446 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1446 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1447 $ cat normal3
1447 $ cat normal3
1448 normal3-modified
1448 normal3-modified
1449 $ cat sub/normal4
1449 $ cat sub/normal4
1450 normal4-modified
1450 normal4-modified
1451 $ cat sub/large4
1451 $ cat sub/large4
1452 large4-modified
1452 large4-modified
1453 $ cat sub2/large6
1453 $ cat sub2/large6
1454 large6-modified
1454 large6-modified
1455 $ cat sub2/large7
1455 $ cat sub2/large7
1456 large7
1456 large7
1457 $ cat sub2/large7.orig
1457 $ cat sub2/large7.orig
1458 mistake
1458 mistake
1459 $ test ! -f .hglf/sub2/large7.orig
1459 $ test ! -f .hglf/sub2/large7.orig
1460
1460
1461 verify that largefile .orig file no longer is overwritten on every update -C:
1461 verify that largefile .orig file no longer is overwritten on every update -C:
1462 $ hg update --clean
1462 $ hg update --clean
1463 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1463 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1464 $ cat sub2/large7.orig
1464 $ cat sub2/large7.orig
1465 mistake
1465 mistake
1466 $ rm sub2/large7.orig
1466 $ rm sub2/large7.orig
1467
1467
1468 Now "update check" is happy.
1468 Now "update check" is happy.
1469 $ hg update --check 8
1469 $ hg update --check 8
1470 getting changed largefiles
1470 getting changed largefiles
1471 1 largefiles updated, 0 removed
1471 1 largefiles updated, 0 removed
1472 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1472 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1473 $ hg update --check
1473 $ hg update --check
1474 getting changed largefiles
1474 getting changed largefiles
1475 1 largefiles updated, 0 removed
1475 1 largefiles updated, 0 removed
1476 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1476 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1477
1477
1478 Test removing empty largefiles directories on update
1478 Test removing empty largefiles directories on update
1479 $ test -d sub2 && echo "sub2 exists"
1479 $ test -d sub2 && echo "sub2 exists"
1480 sub2 exists
1480 sub2 exists
1481 $ hg update -q null
1481 $ hg update -q null
1482 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1482 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1483 [1]
1483 [1]
1484 $ hg update -q
1484 $ hg update -q
1485
1485
1486 Test hg remove removes empty largefiles directories
1486 Test hg remove removes empty largefiles directories
1487 $ test -d sub2 && echo "sub2 exists"
1487 $ test -d sub2 && echo "sub2 exists"
1488 sub2 exists
1488 sub2 exists
1489 $ hg remove sub2/*
1489 $ hg remove sub2/*
1490 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1490 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1491 [1]
1491 [1]
1492 $ hg revert sub2/large6 sub2/large7
1492 $ hg revert sub2/large6 sub2/large7
1493
1493
1494 "revert" works on largefiles (and normal files too).
1494 "revert" works on largefiles (and normal files too).
1495 $ echo hack3 >> normal3
1495 $ echo hack3 >> normal3
1496 $ echo hack4 >> sub/normal4
1496 $ echo hack4 >> sub/normal4
1497 $ echo hack4 >> sub/large4
1497 $ echo hack4 >> sub/large4
1498 $ rm sub2/large6
1498 $ rm sub2/large6
1499 $ hg revert sub2/large6
1499 $ hg revert sub2/large6
1500 $ hg rm sub2/large6
1500 $ hg rm sub2/large6
1501 $ echo new >> sub2/large8
1501 $ echo new >> sub2/large8
1502 $ hg add --large sub2/large8
1502 $ hg add --large sub2/large8
1503 # XXX we don't really want to report that we're reverting the standin;
1503 # XXX we don't really want to report that we're reverting the standin;
1504 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1504 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1505 $ hg revert sub
1505 $ hg revert sub
1506 reverting .hglf/sub/large4
1506 reverting .hglf/sub/large4
1507 reverting sub/normal4
1507 reverting sub/normal4
1508 $ hg status
1508 $ hg status
1509 M normal3
1509 M normal3
1510 A sub2/large8
1510 A sub2/large8
1511 R sub2/large6
1511 R sub2/large6
1512 ? sub/large4.orig
1512 ? sub/large4.orig
1513 ? sub/normal4.orig
1513 ? sub/normal4.orig
1514 $ cat sub/normal4
1514 $ cat sub/normal4
1515 normal4-modified
1515 normal4-modified
1516 $ cat sub/large4
1516 $ cat sub/large4
1517 large4-modified
1517 large4-modified
1518 $ hg revert -a --no-backup
1518 $ hg revert -a --no-backup
1519 forgetting .hglf/sub2/large8
1519 forgetting .hglf/sub2/large8
1520 reverting normal3
1520 reverting normal3
1521 undeleting .hglf/sub2/large6
1521 undeleting .hglf/sub2/large6
1522 $ hg status
1522 $ hg status
1523 ? sub/large4.orig
1523 ? sub/large4.orig
1524 ? sub/normal4.orig
1524 ? sub/normal4.orig
1525 ? sub2/large8
1525 ? sub2/large8
1526 $ cat normal3
1526 $ cat normal3
1527 normal3-modified
1527 normal3-modified
1528 $ cat sub2/large6
1528 $ cat sub2/large6
1529 large6-modified
1529 large6-modified
1530 $ rm sub/*.orig sub2/large8
1530 $ rm sub/*.orig sub2/large8
1531
1531
1532 revert some files to an older revision
1532 revert some files to an older revision
1533 $ hg revert --no-backup -r 8 sub2
1533 $ hg revert --no-backup -r 8 sub2
1534 reverting .hglf/sub2/large6
1534 reverting .hglf/sub2/large6
1535 $ cat sub2/large6
1535 $ cat sub2/large6
1536 large6
1536 large6
1537 $ hg revert --no-backup -C -r '.^' sub2
1537 $ hg revert --no-backup -C -r '.^' sub2
1538 $ hg revert --no-backup sub2
1538 $ hg revert --no-backup sub2
1539 reverting .hglf/sub2/large6
1539 reverting .hglf/sub2/large6
1540 $ hg status
1540 $ hg status
1541
1541
1542 "verify --large" actually verifies largefiles
1542 "verify --large" actually verifies largefiles
1543
1543
1544 - Where Do We Come From? What Are We? Where Are We Going?
1544 - Where Do We Come From? What Are We? Where Are We Going?
1545 $ pwd
1545 $ pwd
1546 $TESTTMP/e
1546 $TESTTMP/e
1547 $ hg paths
1547 $ hg paths
1548 default = $TESTTMP/d
1548 default = $TESTTMP/d
1549
1549
1550 $ hg verify --large
1550 $ hg verify --large
1551 checking changesets
1551 checking changesets
1552 checking manifests
1552 checking manifests
1553 crosschecking files in changesets and manifests
1553 crosschecking files in changesets and manifests
1554 checking files
1554 checking files
1555 checked 10 changesets with 28 changes to 10 files
1555 checked 10 changesets with 28 changes to 10 files
1556 searching 1 changesets for largefiles
1556 searching 1 changesets for largefiles
1557 verified existence of 3 revisions of 3 largefiles
1557 verified existence of 3 revisions of 3 largefiles
1558
1558
1559 - introduce missing blob in local store repo and remote store
1559 - introduce missing blob in local store repo and remote store
1560 and make sure that this is caught:
1560 and make sure that this is caught:
1561
1561
1562 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1562 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1563 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1563 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1564 $ hg verify --large
1564 $ hg verify --large
1565 checking changesets
1565 checking changesets
1566 checking manifests
1566 checking manifests
1567 crosschecking files in changesets and manifests
1567 crosschecking files in changesets and manifests
1568 checking files
1568 checking files
1569 checked 10 changesets with 28 changes to 10 files
1569 checked 10 changesets with 28 changes to 10 files
1570 searching 1 changesets for largefiles
1570 searching 1 changesets for largefiles
1571 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1571 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1572 verified existence of 3 revisions of 3 largefiles
1572 verified existence of 3 revisions of 3 largefiles
1573 [1]
1573 [1]
1574
1574
1575 - introduce corruption and make sure that it is caught when checking content:
1575 - introduce corruption and make sure that it is caught when checking content:
1576 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1576 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1577 $ hg verify -q --large --lfc
1577 $ hg verify -q --large --lfc
1578 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1578 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1579 [1]
1579 [1]
1580
1580
1581 - cleanup
1581 - cleanup
1582 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1582 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1583 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1583 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1584
1584
1585 - verifying all revisions will fail because we didn't clone all largefiles to d:
1585 - verifying all revisions will fail because we didn't clone all largefiles to d:
1586 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1586 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1587 $ hg verify -q --lfa --lfc
1587 $ hg verify -q --lfa --lfc
1588 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64
1588 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64
1589 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d
1589 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d
1590 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f
1590 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f
1591 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1591 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1592 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1592 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1593 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1593 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1594 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1594 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1595 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c
1595 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c
1596 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9
1596 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9
1597 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0
1597 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0
1598 [1]
1598 [1]
1599
1599
1600 - cleanup
1600 - cleanup
1601 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1601 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1602 $ rm -f .hglf/sub/*.orig
1602 $ rm -f .hglf/sub/*.orig
1603
1603
1604 Update to revision with missing largefile - and make sure it really is missing
1604 Update to revision with missing largefile - and make sure it really is missing
1605
1605
1606 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1606 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1607 $ hg up -r 6
1607 $ hg up -r 6
1608 getting changed largefiles
1608 getting changed largefiles
1609 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1609 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1610 1 largefiles updated, 2 removed
1610 1 largefiles updated, 2 removed
1611 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1611 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1612 $ rm normal3
1612 $ rm normal3
1613 $ echo >> sub/normal4
1613 $ echo >> sub/normal4
1614 $ hg ci -m 'commit with missing files'
1614 $ hg ci -m 'commit with missing files'
1615 Invoking status precommit hook
1615 Invoking status precommit hook
1616 M sub/normal4
1616 M sub/normal4
1617 ! large3
1617 ! large3
1618 ! normal3
1618 ! normal3
1619 created new head
1619 created new head
1620 $ hg st
1620 $ hg st
1621 ! large3
1621 ! large3
1622 ! normal3
1622 ! normal3
1623 $ hg up -r.
1623 $ hg up -r.
1624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1625 $ hg st
1625 $ hg st
1626 ! large3
1626 ! large3
1627 ! normal3
1627 ! normal3
1628 $ hg up -Cr.
1628 $ hg up -Cr.
1629 getting changed largefiles
1629 getting changed largefiles
1630 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1630 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1631 0 largefiles updated, 0 removed
1631 0 largefiles updated, 0 removed
1632 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1632 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1633 $ hg st
1633 $ hg st
1634 ! large3
1634 ! large3
1635 $ hg rollback
1635 $ hg rollback
1636 repository tip rolled back to revision 9 (undo commit)
1636 repository tip rolled back to revision 9 (undo commit)
1637 working directory now based on revision 6
1637 working directory now based on revision 6
1638
1638
1639 Merge with revision with missing largefile - and make sure it tries to fetch it.
1639 Merge with revision with missing largefile - and make sure it tries to fetch it.
1640
1640
1641 $ hg up -Cqr null
1641 $ hg up -Cqr null
1642 $ echo f > f
1642 $ echo f > f
1643 $ hg ci -Am branch
1643 $ hg ci -Am branch
1644 adding f
1644 adding f
1645 Invoking status precommit hook
1645 Invoking status precommit hook
1646 A f
1646 A f
1647 created new head
1647 created new head
1648 $ hg merge -r 6
1648 $ hg merge -r 6
1649 getting changed largefiles
1649 getting changed largefiles
1650 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1650 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1651 1 largefiles updated, 0 removed
1651 1 largefiles updated, 0 removed
1652 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1652 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1653 (branch merge, don't forget to commit)
1653 (branch merge, don't forget to commit)
1654
1654
1655 $ hg rollback -q
1655 $ hg rollback -q
1656 $ hg up -Cq
1656 $ hg up -Cq
1657
1657
1658 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1658 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1659
1659
1660 $ hg pull --all-largefiles
1660 $ hg pull --all-largefiles
1661 pulling from $TESTTMP/d
1661 pulling from $TESTTMP/d
1662 searching for changes
1662 searching for changes
1663 no changes found
1663 no changes found
1664
1664
1665 Merging does not revert to old versions of largefiles and also check
1665 Merging does not revert to old versions of largefiles and also check
1666 that merging after having pulled from a non-default remote works
1666 that merging after having pulled from a non-default remote works
1667 correctly.
1667 correctly.
1668
1668
1669 $ cd ..
1669 $ cd ..
1670 $ hg clone -r 7 e temp
1670 $ hg clone -r 7 e temp
1671 adding changesets
1671 adding changesets
1672 adding manifests
1672 adding manifests
1673 adding file changes
1673 adding file changes
1674 added 8 changesets with 24 changes to 10 files
1674 added 8 changesets with 24 changes to 10 files
1675 new changesets 30d30fe6a5be:daea875e9014 (8 drafts)
1675 new changesets 30d30fe6a5be:daea875e9014 (8 drafts)
1676 updating to branch default
1676 updating to branch default
1677 getting changed largefiles
1677 getting changed largefiles
1678 3 largefiles updated, 0 removed
1678 3 largefiles updated, 0 removed
1679 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1679 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1680 $ hg clone temp f
1680 $ hg clone temp f
1681 updating to branch default
1681 updating to branch default
1682 getting changed largefiles
1682 getting changed largefiles
1683 3 largefiles updated, 0 removed
1683 3 largefiles updated, 0 removed
1684 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1684 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1685 # Delete the largefiles in the largefiles system cache so that we have an
1685 # Delete the largefiles in the largefiles system cache so that we have an
1686 # opportunity to test that caching after a pull works.
1686 # opportunity to test that caching after a pull works.
1687 $ rm "${USERCACHE}"/*
1687 $ rm "${USERCACHE}"/*
1688 $ cd f
1688 $ cd f
1689 $ echo "large4-merge-test" > sub/large4
1689 $ echo "large4-merge-test" > sub/large4
1690 $ hg commit -m "Modify large4 to test merge"
1690 $ hg commit -m "Modify large4 to test merge"
1691 Invoking status precommit hook
1691 Invoking status precommit hook
1692 M sub/large4
1692 M sub/large4
1693 # Test --cache-largefiles flag
1693 # Test --cache-largefiles flag
1694 $ hg pull --lfrev 'heads(pulled())' ../e
1694 $ hg pull --lfrev 'heads(pulled())' ../e
1695 pulling from ../e
1695 pulling from ../e
1696 searching for changes
1696 searching for changes
1697 adding changesets
1697 adding changesets
1698 adding manifests
1698 adding manifests
1699 adding file changes
1699 adding file changes
1700 added 2 changesets with 4 changes to 4 files (+1 heads)
1700 added 2 changesets with 4 changes to 4 files (+1 heads)
1701 new changesets a381d2c8c80e:598410d3eb9a (2 drafts)
1701 new changesets a381d2c8c80e:598410d3eb9a (2 drafts)
1702 (run 'hg heads' to see heads, 'hg merge' to merge)
1702 (run 'hg heads' to see heads, 'hg merge' to merge)
1703 2 largefiles cached
1703 2 largefiles cached
1704 $ hg merge
1704 $ hg merge
1705 largefile sub/large4 has a merge conflict
1705 largefile sub/large4 has a merge conflict
1706 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1706 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1707 you can keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928.
1707 you can keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928.
1708 what do you want to do? l
1708 what do you want to do? l
1709 getting changed largefiles
1709 getting changed largefiles
1710 1 largefiles updated, 0 removed
1710 1 largefiles updated, 0 removed
1711 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1711 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1712 (branch merge, don't forget to commit)
1712 (branch merge, don't forget to commit)
1713 $ hg commit -m "Merge repos e and f"
1713 $ hg commit -m "Merge repos e and f"
1714 Invoking status precommit hook
1714 Invoking status precommit hook
1715 M normal3
1715 M normal3
1716 M sub/normal4
1716 M sub/normal4
1717 M sub2/large6
1717 M sub2/large6
1718 $ cat normal3
1718 $ cat normal3
1719 normal3-modified
1719 normal3-modified
1720 $ cat sub/normal4
1720 $ cat sub/normal4
1721 normal4-modified
1721 normal4-modified
1722 $ cat sub/large4
1722 $ cat sub/large4
1723 large4-merge-test
1723 large4-merge-test
1724 $ cat sub2/large6
1724 $ cat sub2/large6
1725 large6-modified
1725 large6-modified
1726 $ cat sub2/large7
1726 $ cat sub2/large7
1727 large7
1727 large7
1728
1728
1729 Test status after merging with a branch that introduces a new largefile:
1729 Test status after merging with a branch that introduces a new largefile:
1730
1730
1731 $ echo large > large
1731 $ echo large > large
1732 $ hg add --large large
1732 $ hg add --large large
1733 $ hg commit -m 'add largefile'
1733 $ hg commit -m 'add largefile'
1734 Invoking status precommit hook
1734 Invoking status precommit hook
1735 A large
1735 A large
1736 $ hg update -q ".^"
1736 $ hg update -q ".^"
1737 $ echo change >> normal3
1737 $ echo change >> normal3
1738 $ hg commit -m 'some change'
1738 $ hg commit -m 'some change'
1739 Invoking status precommit hook
1739 Invoking status precommit hook
1740 M normal3
1740 M normal3
1741 created new head
1741 created new head
1742 $ hg merge
1742 $ hg merge
1743 getting changed largefiles
1743 getting changed largefiles
1744 1 largefiles updated, 0 removed
1744 1 largefiles updated, 0 removed
1745 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1745 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1746 (branch merge, don't forget to commit)
1746 (branch merge, don't forget to commit)
1747 $ hg status
1747 $ hg status
1748 M large
1748 M large
1749
1749
1750 - make sure update of merge with removed largefiles fails as expected
1750 - make sure update of merge with removed largefiles fails as expected
1751 $ hg rm sub2/large6
1751 $ hg rm sub2/large6
1752 $ hg up -r.
1752 $ hg up -r.
1753 abort: outstanding uncommitted merge
1753 abort: outstanding uncommitted merge
1754 [20]
1754 [20]
1755
1755
1756 - revert should be able to revert files introduced in a pending merge
1756 - revert should be able to revert files introduced in a pending merge
1757 $ hg revert --all -r .
1757 $ hg revert --all -r .
1758 removing .hglf/large
1758 removing .hglf/large
1759 undeleting .hglf/sub2/large6
1759 undeleting .hglf/sub2/large6
1760
1760
1761 Test that a normal file and a largefile with the same name and path cannot
1761 Test that a normal file and a largefile with the same name and path cannot
1762 coexist.
1762 coexist.
1763
1763
1764 $ rm sub2/large7
1764 $ rm sub2/large7
1765 $ echo "largeasnormal" > sub2/large7
1765 $ echo "largeasnormal" > sub2/large7
1766 $ hg add sub2/large7
1766 $ hg add sub2/large7
1767 sub2/large7 already a largefile
1767 sub2/large7 already a largefile
1768
1768
1769 Test that transplanting a largefile change works correctly.
1769 Test that transplanting a largefile change works correctly.
1770
1770
1771 $ cd ..
1771 $ cd ..
1772 $ hg clone -r 8 d g
1772 $ hg clone -r 8 d g
1773 adding changesets
1773 adding changesets
1774 adding manifests
1774 adding manifests
1775 adding file changes
1775 adding file changes
1776 added 9 changesets with 26 changes to 10 files
1776 added 9 changesets with 26 changes to 10 files
1777 new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts)
1777 new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts)
1778 updating to branch default
1778 updating to branch default
1779 getting changed largefiles
1779 getting changed largefiles
1780 3 largefiles updated, 0 removed
1780 3 largefiles updated, 0 removed
1781 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1781 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1782 $ cd g
1782 $ cd g
1783 $ hg transplant -s ../d 598410d3eb9a
1783 $ hg transplant -s ../d 598410d3eb9a
1784 searching for changes
1784 searching for changes
1785 searching for changes
1785 searching for changes
1786 adding changesets
1786 adding changesets
1787 adding manifests
1787 adding manifests
1788 adding file changes
1788 adding file changes
1789 added 1 changesets with 2 changes to 2 files
1789 added 1 changesets with 2 changes to 2 files
1790 new changesets 598410d3eb9a (1 drafts)
1790 new changesets 598410d3eb9a (1 drafts)
1791 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1791 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1792 9:598410d3eb9a modify normal file largefile in repo d
1792 9:598410d3eb9a modify normal file largefile in repo d
1793 8:a381d2c8c80e modify normal file and largefile in repo b
1793 8:a381d2c8c80e modify normal file and largefile in repo b
1794 7:daea875e9014 add/edit more largefiles
1794 7:daea875e9014 add/edit more largefiles
1795 6:4355d653f84f edit files yet again
1795 6:4355d653f84f edit files yet again
1796 5:9d5af5072dbd edit files again
1796 5:9d5af5072dbd edit files again
1797 4:74c02385b94c move files
1797 4:74c02385b94c move files
1798 3:9e8fbc4bce62 copy files
1798 3:9e8fbc4bce62 copy files
1799 2:51a0ae4d5864 remove files
1799 2:51a0ae4d5864 remove files
1800 1:ce8896473775 edit files
1800 1:ce8896473775 edit files
1801 0:30d30fe6a5be add files
1801 0:30d30fe6a5be add files
1802 $ cat normal3
1802 $ cat normal3
1803 normal3-modified
1803 normal3-modified
1804 $ cat sub/normal4
1804 $ cat sub/normal4
1805 normal4-modified
1805 normal4-modified
1806 $ cat sub/large4
1806 $ cat sub/large4
1807 large4-modified
1807 large4-modified
1808 $ cat sub2/large6
1808 $ cat sub2/large6
1809 large6-modified
1809 large6-modified
1810 $ cat sub2/large7
1810 $ cat sub2/large7
1811 large7
1811 large7
1812
1812
1813 Cat a largefile
1813 Cat a largefile
1814 $ hg cat normal3
1814 $ hg cat normal3
1815 normal3-modified
1815 normal3-modified
1816 $ hg cat sub/large4
1816 $ hg cat sub/large4
1817 large4-modified
1817 large4-modified
1818 $ rm "${USERCACHE}"/*
1818 $ rm "${USERCACHE}"/*
1819 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1819 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1820 $ cat cat.out
1820 $ cat cat.out
1821 large4-modified
1821 large4-modified
1822 $ rm cat.out
1822 $ rm cat.out
1823 $ hg cat -r a381d2c8c80e normal3
1823 $ hg cat -r a381d2c8c80e normal3
1824 normal3-modified
1824 normal3-modified
1825 $ hg cat -r '.^' normal3
1825 $ hg cat -r '.^' normal3
1826 normal3-modified
1826 normal3-modified
1827 $ hg cat -r '.^' sub/large4 doesntexist
1827 $ hg cat -r '.^' sub/large4 doesntexist
1828 large4-modified
1828 large4-modified
1829 doesntexist: no such file in rev a381d2c8c80e
1829 doesntexist: no such file in rev a381d2c8c80e
1830 $ hg --cwd sub cat -r '.^' large4
1830 $ hg --cwd sub cat -r '.^' large4
1831 large4-modified
1831 large4-modified
1832 $ hg --cwd sub cat -r '.^' ../normal3
1832 $ hg --cwd sub cat -r '.^' ../normal3
1833 normal3-modified
1833 normal3-modified
1834 Cat a standin
1834 Cat a standin
1835 $ hg cat .hglf/sub/large4
1835 $ hg cat .hglf/sub/large4
1836 e166e74c7303192238d60af5a9c4ce9bef0b7928
1836 e166e74c7303192238d60af5a9c4ce9bef0b7928
1837 $ hg cat .hglf/normal3
1837 $ hg cat .hglf/normal3
1838 .hglf/normal3: no such file in rev 598410d3eb9a
1838 .hglf/normal3: no such file in rev 598410d3eb9a
1839 [1]
1839 [1]
1840
1840
1841 Test that renaming a largefile results in correct output for status
1841 Test that renaming a largefile results in correct output for status
1842
1842
1843 $ hg rename sub/large4 large4-renamed
1843 $ hg rename sub/large4 large4-renamed
1844 $ hg commit -m "test rename output"
1844 $ hg commit -m "test rename output"
1845 Invoking status precommit hook
1845 Invoking status precommit hook
1846 A large4-renamed
1846 A large4-renamed
1847 R sub/large4
1847 R sub/large4
1848 $ cat large4-renamed
1848 $ cat large4-renamed
1849 large4-modified
1849 large4-modified
1850 $ cd sub2
1850 $ cd sub2
1851 $ hg rename large6 large6-renamed
1851 $ hg rename large6 large6-renamed
1852 $ hg st
1852 $ hg st
1853 A sub2/large6-renamed
1853 A sub2/large6-renamed
1854 R sub2/large6
1854 R sub2/large6
1855 $ cd ..
1855 $ cd ..
1856
1856
1857 Test --normal flag
1857 Test --normal flag
1858
1858
1859 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1859 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1860 $ hg add --normal --large new-largefile
1860 $ hg add --normal --large new-largefile
1861 abort: --normal cannot be used with --large
1861 abort: --normal cannot be used with --large
1862 [255]
1862 [255]
1863 $ hg add --normal new-largefile
1863 $ hg add --normal new-largefile
1864 new-largefile: up to 69 MB of RAM may be required to manage this file
1864 new-largefile: up to 69 MB of RAM may be required to manage this file
1865 (use 'hg revert new-largefile' to cancel the pending addition)
1865 (use 'hg revert new-largefile' to cancel the pending addition)
1866 $ hg revert new-largefile
1866 $ hg revert new-largefile
1867 $ hg --config ui.large-file-limit=22M add --normal new-largefile
1867 $ hg --config ui.large-file-limit=22M add --normal new-largefile
1868
1868
1869 Test explicit commit of switch between normal and largefile - make sure both
1869 Test explicit commit of switch between normal and largefile - make sure both
1870 the add and the remove is committed.
1870 the add and the remove is committed.
1871
1871
1872 $ hg up -qC
1872 $ hg up -qC
1873 $ hg forget normal3 large4-renamed
1873 $ hg forget normal3 large4-renamed
1874 $ hg add --large normal3
1874 $ hg add --large normal3
1875 $ hg add large4-renamed
1875 $ hg add large4-renamed
1876 $ hg commit -m 'swap' normal3 large4-renamed
1876 $ hg commit -m 'swap' normal3 large4-renamed
1877 Invoking status precommit hook
1877 Invoking status precommit hook
1878 A large4-renamed
1878 A large4-renamed
1879 A normal3
1879 A normal3
1880 ? new-largefile
1880 ? new-largefile
1881 ? sub2/large6-renamed
1881 ? sub2/large6-renamed
1882 $ hg mani
1882 $ hg mani
1883 .hglf/normal3
1883 .hglf/normal3
1884 .hglf/sub2/large6
1884 .hglf/sub2/large6
1885 .hglf/sub2/large7
1885 .hglf/sub2/large7
1886 large4-renamed
1886 large4-renamed
1887 sub/normal4
1887 sub/normal4
1888
1888
1889 $ cd ..
1889 $ cd ..
1890
1890
1891
1891
1892
1892
@@ -1,500 +1,500 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > drawdag=$TESTDIR/drawdag.py
4 > drawdag=$TESTDIR/drawdag.py
5 >
5 >
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
10 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
11 > EOF
11 > EOF
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ echo c1 >common
15 $ echo c1 >common
16 $ hg add common
16 $ hg add common
17 $ hg ci -m C1
17 $ hg ci -m C1
18
18
19 $ echo c2 >>common
19 $ echo c2 >>common
20 $ hg ci -m C2
20 $ hg ci -m C2
21
21
22 $ echo c3 >>common
22 $ echo c3 >>common
23 $ hg ci -m C3
23 $ hg ci -m C3
24
24
25 $ hg up -q -C 1
25 $ hg up -q -C 1
26
26
27 $ echo l1 >>extra
27 $ echo l1 >>extra
28 $ hg add extra
28 $ hg add extra
29 $ hg ci -m L1
29 $ hg ci -m L1
30 created new head
30 created new head
31
31
32 $ sed -e 's/c2/l2/' common > common.new
32 $ sed -e 's/c2/l2/' common > common.new
33 $ mv common.new common
33 $ mv common.new common
34 $ hg ci -m L2
34 $ hg ci -m L2
35
35
36 $ echo l3 >> extra2
36 $ echo l3 >> extra2
37 $ hg add extra2
37 $ hg add extra2
38 $ hg ci -m L3
38 $ hg ci -m L3
39 $ hg bookmark mybook
39 $ hg bookmark mybook
40
40
41 $ hg phase --force --secret 4
41 $ hg phase --force --secret 4
42
42
43 $ hg tglog
43 $ hg tglog
44 @ 5:secret 'L3' mybook
44 @ 5:secret 'L3' mybook
45 |
45 |
46 o 4:secret 'L2'
46 o 4:secret 'L2'
47 |
47 |
48 o 3:draft 'L1'
48 o 3:draft 'L1'
49 |
49 |
50 | o 2:draft 'C3'
50 | o 2:draft 'C3'
51 |/
51 |/
52 o 1:draft 'C2'
52 o 1:draft 'C2'
53 |
53 |
54 o 0:draft 'C1'
54 o 0:draft 'C1'
55
55
56 Try to call --continue:
56 Try to call --continue:
57
57
58 $ hg rebase --continue
58 $ hg rebase --continue
59 abort: no rebase in progress
59 abort: no rebase in progress
60 [20]
60 [20]
61
61
62 Conflicting rebase:
62 Conflicting rebase:
63
63
64 $ hg rebase -s 3 -d 2
64 $ hg rebase -s 3 -d 2
65 rebasing 3:3163e20567cc "L1"
65 rebasing 3:3163e20567cc "L1"
66 rebasing 4:46f0b057b5c0 "L2"
66 rebasing 4:46f0b057b5c0 "L2"
67 merging common
67 merging common
68 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
68 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
69 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
69 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
70 [240]
70 [240]
71
71
72 $ hg status --config commands.status.verbose=1
72 $ hg status --config commands.status.verbose=1
73 M common
73 M common
74 ? common.orig
74 ? common.orig
75 # The repository is in an unfinished *rebase* state.
75 # The repository is in an unfinished *rebase* state.
76
76
77 # Unresolved merge conflicts:
77 # Unresolved merge conflicts:
78 #
78 #
79 # common
79 # common
80 #
80 #
81 # To mark files as resolved: hg resolve --mark FILE
81 # To mark files as resolved: hg resolve --mark FILE
82
82
83 # To continue: hg rebase --continue
83 # To continue: hg rebase --continue
84 # To abort: hg rebase --abort
84 # To abort: hg rebase --abort
85 # To stop: hg rebase --stop
85 # To stop: hg rebase --stop
86
86
87
87
88 Try to continue without solving the conflict:
88 Try to continue without solving the conflict:
89
89
90 $ hg rebase --continue
90 $ hg rebase --continue
91 abort: unresolved merge conflicts (see 'hg help resolve')
91 abort: unresolved merge conflicts (see 'hg help resolve')
92 [20]
92 [20]
93
93
94 Conclude rebase:
94 Conclude rebase:
95
95
96 $ echo 'resolved merge' >common
96 $ echo 'resolved merge' >common
97 $ hg resolve -m common
97 $ hg resolve -m common
98 (no more unresolved files)
98 (no more unresolved files)
99 continue: hg rebase --continue
99 continue: hg rebase --continue
100 $ hg rebase --continue
100 $ hg rebase --continue
101 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
101 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
102 rebasing 4:46f0b057b5c0 "L2"
102 rebasing 4:46f0b057b5c0 "L2"
103 rebasing 5:8029388f38dc mybook "L3"
103 rebasing 5:8029388f38dc mybook "L3"
104 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-rebase.hg
104 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-rebase.hg
105
105
106 $ hg tglog
106 $ hg tglog
107 @ 5:secret 'L3' mybook
107 @ 5:secret 'L3' mybook
108 |
108 |
109 o 4:secret 'L2'
109 o 4:secret 'L2'
110 |
110 |
111 o 3:draft 'L1'
111 o 3:draft 'L1'
112 |
112 |
113 o 2:draft 'C3'
113 o 2:draft 'C3'
114 |
114 |
115 o 1:draft 'C2'
115 o 1:draft 'C2'
116 |
116 |
117 o 0:draft 'C1'
117 o 0:draft 'C1'
118
118
119 Check correctness:
119 Check correctness:
120
120
121 $ hg cat -r 0 common
121 $ hg cat -r 0 common
122 c1
122 c1
123
123
124 $ hg cat -r 1 common
124 $ hg cat -r 1 common
125 c1
125 c1
126 c2
126 c2
127
127
128 $ hg cat -r 2 common
128 $ hg cat -r 2 common
129 c1
129 c1
130 c2
130 c2
131 c3
131 c3
132
132
133 $ hg cat -r 3 common
133 $ hg cat -r 3 common
134 c1
134 c1
135 c2
135 c2
136 c3
136 c3
137
137
138 $ hg cat -r 4 common
138 $ hg cat -r 4 common
139 resolved merge
139 resolved merge
140
140
141 $ hg cat -r 5 common
141 $ hg cat -r 5 common
142 resolved merge
142 resolved merge
143
143
144 Bookmark stays active after --continue
144 Bookmark stays active after --continue
145 $ hg bookmarks
145 $ hg bookmarks
146 * mybook 5:d67b21408fc0
146 * mybook 5:d67b21408fc0
147
147
148 $ cd ..
148 $ cd ..
149
149
150 Check that the right ancestors is used while rebasing a merge (issue4041)
150 Check that the right ancestors is used while rebasing a merge (issue4041)
151
151
152 $ hg init issue4041
152 $ hg init issue4041
153 $ cd issue4041
153 $ cd issue4041
154 $ hg unbundle "$TESTDIR/bundles/issue4041.hg"
154 $ hg unbundle "$TESTDIR/bundles/issue4041.hg"
155 adding changesets
155 adding changesets
156 adding manifests
156 adding manifests
157 adding file changes
157 adding file changes
158 added 11 changesets with 8 changes to 3 files (+1 heads)
158 added 11 changesets with 8 changes to 3 files (+1 heads)
159 new changesets 24797d4f68de:2f2496ddf49d (11 drafts)
159 new changesets 24797d4f68de:2f2496ddf49d (11 drafts)
160 (run 'hg heads' to see heads)
160 (run 'hg heads' to see heads)
161 $ hg up default
161 $ hg up default
162 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 $ hg log -G
163 $ hg log -G
164 o changeset: 10:2f2496ddf49d
164 o changeset: 10:2f2496ddf49d
165 |\ branch: f1
165 |\ branch: f1
166 | | tag: tip
166 | | tag: tip
167 | | parent: 7:4c9fbe56a16f
167 | | parent: 7:4c9fbe56a16f
168 | | parent: 9:e31216eec445
168 | | parent: 9:e31216eec445
169 | | user: szhang
169 | | user: szhang
170 | | date: Thu Sep 05 12:59:39 2013 -0400
170 | | date: Thu Sep 05 12:59:39 2013 -0400
171 | | summary: merge
171 | | summary: merge
172 | |
172 | |
173 | o changeset: 9:e31216eec445
173 | o changeset: 9:e31216eec445
174 | | branch: f1
174 | | branch: f1
175 | | user: szhang
175 | | user: szhang
176 | | date: Thu Sep 05 12:59:10 2013 -0400
176 | | date: Thu Sep 05 12:59:10 2013 -0400
177 | | summary: more changes to f1
177 | | summary: more changes to f1
178 | |
178 | |
179 | o changeset: 8:8e4e2c1a07ae
179 | o changeset: 8:8e4e2c1a07ae
180 | |\ branch: f1
180 | |\ branch: f1
181 | | | parent: 2:4bc80088dc6b
181 | | | parent: 2:4bc80088dc6b
182 | | | parent: 6:400110238667
182 | | | parent: 6:400110238667
183 | | | user: szhang
183 | | | user: szhang
184 | | | date: Thu Sep 05 12:57:59 2013 -0400
184 | | | date: Thu Sep 05 12:57:59 2013 -0400
185 | | | summary: bad merge
185 | | | summary: bad merge
186 | | |
186 | | |
187 o | | changeset: 7:4c9fbe56a16f
187 o | | changeset: 7:4c9fbe56a16f
188 |/ / branch: f1
188 |/ / branch: f1
189 | | parent: 2:4bc80088dc6b
189 | | parent: 2:4bc80088dc6b
190 | | user: szhang
190 | | user: szhang
191 | | date: Thu Sep 05 12:54:00 2013 -0400
191 | | date: Thu Sep 05 12:54:00 2013 -0400
192 | | summary: changed f1
192 | | summary: changed f1
193 | |
193 | |
194 | o changeset: 6:400110238667
194 | o changeset: 6:400110238667
195 | | branch: f2
195 | | branch: f2
196 | | parent: 4:12e8ec6bb010
196 | | parent: 4:12e8ec6bb010
197 | | user: szhang
197 | | user: szhang
198 | | date: Tue Sep 03 13:58:02 2013 -0400
198 | | date: Tue Sep 03 13:58:02 2013 -0400
199 | | summary: changed f2 on f2
199 | | summary: changed f2 on f2
200 | |
200 | |
201 | | @ changeset: 5:d79e2059b5c0
201 | | @ changeset: 5:d79e2059b5c0
202 | | | parent: 3:8a951942e016
202 | | | parent: 3:8a951942e016
203 | | | user: szhang
203 | | | user: szhang
204 | | | date: Tue Sep 03 13:57:39 2013 -0400
204 | | | date: Tue Sep 03 13:57:39 2013 -0400
205 | | | summary: changed f2 on default
205 | | | summary: changed f2 on default
206 | | |
206 | | |
207 | o | changeset: 4:12e8ec6bb010
207 | o | changeset: 4:12e8ec6bb010
208 | |/ branch: f2
208 | |/ branch: f2
209 | | user: szhang
209 | | user: szhang
210 | | date: Tue Sep 03 13:57:18 2013 -0400
210 | | date: Tue Sep 03 13:57:18 2013 -0400
211 | | summary: created f2 branch
211 | | summary: created f2 branch
212 | |
212 | |
213 | o changeset: 3:8a951942e016
213 | o changeset: 3:8a951942e016
214 | | parent: 0:24797d4f68de
214 | | parent: 0:24797d4f68de
215 | | user: szhang
215 | | user: szhang
216 | | date: Tue Sep 03 13:57:11 2013 -0400
216 | | date: Tue Sep 03 13:57:11 2013 -0400
217 | | summary: added f2.txt
217 | | summary: added f2.txt
218 | |
218 | |
219 o | changeset: 2:4bc80088dc6b
219 o | changeset: 2:4bc80088dc6b
220 | | branch: f1
220 | | branch: f1
221 | | user: szhang
221 | | user: szhang
222 | | date: Tue Sep 03 13:56:20 2013 -0400
222 | | date: Tue Sep 03 13:56:20 2013 -0400
223 | | summary: added f1.txt
223 | | summary: added f1.txt
224 | |
224 | |
225 o | changeset: 1:ef53c9e6b608
225 o | changeset: 1:ef53c9e6b608
226 |/ branch: f1
226 |/ branch: f1
227 | user: szhang
227 | user: szhang
228 | date: Tue Sep 03 13:55:26 2013 -0400
228 | date: Tue Sep 03 13:55:26 2013 -0400
229 | summary: created f1 branch
229 | summary: created f1 branch
230 |
230 |
231 o changeset: 0:24797d4f68de
231 o changeset: 0:24797d4f68de
232 user: szhang
232 user: szhang
233 date: Tue Sep 03 13:55:08 2013 -0400
233 date: Tue Sep 03 13:55:08 2013 -0400
234 summary: added default.txt
234 summary: added default.txt
235
235
236 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
236 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
237 rebase onto 4bc80088dc6b starting from e31216eec445
237 rebase onto 4bc80088dc6b starting from e31216eec445
238 rebasing on disk
238 rebasing on disk
239 rebase status stored
239 rebase status stored
240 rebasing 9:e31216eec445 "more changes to f1"
240 rebasing 9:e31216eec445 "more changes to f1"
241 future parents are 2 and -1
241 future parents are 2 and -1
242 update to 2:4bc80088dc6b
242 update to 2:4bc80088dc6b
243 resolving manifests
243 resolving manifests
244 branchmerge: False, force: True, partial: False
244 branchmerge: False, force: True, partial: False
245 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
245 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
246 f2.txt: other deleted -> r
246 f2.txt: other deleted -> r
247 removing f2.txt
247 removing f2.txt
248 f1.txt: remote created -> g
248 f1.txt: remote created -> g
249 getting f1.txt
249 getting f1.txt
250 merge against 9:e31216eec445
250 merge against 9:e31216eec445
251 detach base 8:8e4e2c1a07ae
251 detach base 8:8e4e2c1a07ae
252 resolving manifests
252 resolving manifests
253 branchmerge: True, force: True, partial: False
253 branchmerge: True, force: True, partial: False
254 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
254 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
255 f1.txt: remote is newer -> g
255 f1.txt: remote is newer -> g
256 getting f1.txt
256 getting f1.txt
257 committing files:
257 committing files:
258 f1.txt
258 f1.txt
259 committing manifest
259 committing manifest
260 committing changelog
260 committing changelog
261 updating the branch cache
261 updating the branch cache
262 rebased as 19c888675e13
262 rebased as 19c888675e13
263 rebase status stored
263 rebase status stored
264 rebasing 10:2f2496ddf49d tip "merge"
264 rebasing 10:2f2496ddf49d tip "merge"
265 future parents are 11 and 7
265 future parents are 11 and 7
266 already in destination
266 already in destination
267 merge against 10:2f2496ddf49d
267 merge against 10:2f2496ddf49d
268 detach base 9:e31216eec445
268 detach base 9:e31216eec445
269 resolving manifests
269 resolving manifests
270 branchmerge: True, force: True, partial: False
270 branchmerge: True, force: True, partial: False
271 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
271 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
272 f1.txt: remote is newer -> g
272 f1.txt: remote is newer -> g
273 getting f1.txt
273 getting f1.txt
274 committing files:
274 committing files:
275 f1.txt
275 f1.txt
276 committing manifest
276 committing manifest
277 committing changelog
277 committing changelog
278 updating the branch cache
278 updating the branch cache
279 rebased as c1ffa3b5274e
279 rebased as c1ffa3b5274e
280 rebase status stored
280 rebase status stored
281 rebase merging completed
281 rebase merging completed
282 update back to initial working directory parent
282 update back to initial working directory parent
283 resolving manifests
283 resolving manifests
284 branchmerge: False, force: False, partial: False
284 branchmerge: False, force: False, partial: False
285 ancestor: c1ffa3b5274e, local: c1ffa3b5274e+, remote: d79e2059b5c0
285 ancestor: c1ffa3b5274e, local: c1ffa3b5274e+, remote: d79e2059b5c0
286 f1.txt: other deleted -> r
286 f1.txt: other deleted -> r
287 removing f1.txt
287 removing f1.txt
288 f2.txt: remote created -> g
288 f2.txt: remote created -> g
289 getting f2.txt
289 getting f2.txt
290 2 changesets found
290 2 changesets found
291 list of changesets:
291 list of changesets:
292 e31216eec445e44352c5f01588856059466a24c9
292 e31216eec445e44352c5f01588856059466a24c9
293 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
293 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
294 bundle2-output-bundle: "HG20", (1 params) 3 parts total
294 bundle2-output-bundle: "HG20", (1 params) 3 parts total
295 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
295 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
296 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
296 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
297 bundle2-output-part: "phase-heads" 24 bytes payload
297 bundle2-output-part: "phase-heads" 24 bytes payload
298 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-rebase.hg
298 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-rebase.hg
299 3 changesets found
299 3 changesets found
300 list of changesets:
300 list of changesets:
301 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
301 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
302 19c888675e133ab5dff84516926a65672eaf04d9
302 19c888675e133ab5dff84516926a65672eaf04d9
303 c1ffa3b5274e92a9388fe782854e295d2e8d0443
303 c1ffa3b5274e92a9388fe782854e295d2e8d0443
304 bundle2-output-bundle: "HG20", 3 parts total
304 bundle2-output-bundle: "HG20", 3 parts total
305 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
305 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
306 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
306 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
307 bundle2-output-part: "phase-heads" 24 bytes payload
307 bundle2-output-part: "phase-heads" 24 bytes payload
308 adding branch
308 adding branch
309 bundle2-input-bundle: with-transaction
309 bundle2-input-bundle: with-transaction
310 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
310 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
311 adding changesets
311 adding changesets
312 add changeset 4c9fbe56a16f
312 add changeset 4c9fbe56a16f
313 add changeset 19c888675e13
313 add changeset 19c888675e13
314 add changeset c1ffa3b5274e
314 add changeset c1ffa3b5274e
315 adding manifests
315 adding manifests
316 adding file changes
316 adding file changes
317 adding f1.txt revisions
317 adding f1.txt revisions
318 bundle2-input-part: total payload size 1686
318 bundle2-input-part: total payload size 1739
319 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
319 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
320 bundle2-input-part: total payload size 74
320 bundle2-input-part: total payload size 74
321 bundle2-input-part: "phase-heads" supported
321 bundle2-input-part: "phase-heads" supported
322 bundle2-input-part: total payload size 24
322 bundle2-input-part: total payload size 24
323 bundle2-input-bundle: 3 parts total
323 bundle2-input-bundle: 3 parts total
324 truncating cache/rbc-revs-v1 to 72
324 truncating cache/rbc-revs-v1 to 72
325 added 2 changesets with 2 changes to 1 files
325 added 2 changesets with 2 changes to 1 files
326 updating the branch cache
326 updating the branch cache
327 invalid branch cache (served): tip differs
327 invalid branch cache (served): tip differs
328 invalid branch cache (served.hidden): tip differs
328 invalid branch cache (served.hidden): tip differs
329 rebase completed
329 rebase completed
330
330
331 Test minimization of merge conflicts
331 Test minimization of merge conflicts
332 $ hg up -q null
332 $ hg up -q null
333 $ echo a > a
333 $ echo a > a
334 $ hg add a
334 $ hg add a
335 $ hg commit -q -m 'a'
335 $ hg commit -q -m 'a'
336 $ echo b >> a
336 $ echo b >> a
337 $ hg commit -q -m 'ab'
337 $ hg commit -q -m 'ab'
338 $ hg bookmark ab
338 $ hg bookmark ab
339 $ hg up -q '.^'
339 $ hg up -q '.^'
340 $ echo b >> a
340 $ echo b >> a
341 $ echo c >> a
341 $ echo c >> a
342 $ hg commit -q -m 'abc'
342 $ hg commit -q -m 'abc'
343 $ hg rebase -s 7bc217434fc1 -d ab --keep
343 $ hg rebase -s 7bc217434fc1 -d ab --keep
344 rebasing 13:7bc217434fc1 tip "abc"
344 rebasing 13:7bc217434fc1 tip "abc"
345 merging a
345 merging a
346 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
346 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
347 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
347 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
348 [240]
348 [240]
349 $ hg diff
349 $ hg diff
350 diff -r 328e4ab1f7cc a
350 diff -r 328e4ab1f7cc a
351 --- a/a Thu Jan 01 00:00:00 1970 +0000
351 --- a/a Thu Jan 01 00:00:00 1970 +0000
352 +++ b/a * (glob)
352 +++ b/a * (glob)
353 @@ -1,2 +1,6 @@
353 @@ -1,2 +1,6 @@
354 a
354 a
355 b
355 b
356 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
356 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
357 +=======
357 +=======
358 +c
358 +c
359 +>>>>>>> source: 7bc217434fc1 - test: abc
359 +>>>>>>> source: 7bc217434fc1 - test: abc
360 $ hg rebase --abort
360 $ hg rebase --abort
361 rebase aborted
361 rebase aborted
362 $ hg up -q -C 7bc217434fc1
362 $ hg up -q -C 7bc217434fc1
363 $ hg rebase -s . -d ab --keep -t internal:merge3
363 $ hg rebase -s . -d ab --keep -t internal:merge3
364 rebasing 13:7bc217434fc1 tip "abc"
364 rebasing 13:7bc217434fc1 tip "abc"
365 merging a
365 merging a
366 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
366 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
367 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
367 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
368 [240]
368 [240]
369 $ hg diff
369 $ hg diff
370 diff -r 328e4ab1f7cc a
370 diff -r 328e4ab1f7cc a
371 --- a/a Thu Jan 01 00:00:00 1970 +0000
371 --- a/a Thu Jan 01 00:00:00 1970 +0000
372 +++ b/a * (glob)
372 +++ b/a * (glob)
373 @@ -1,2 +1,8 @@
373 @@ -1,2 +1,8 @@
374 a
374 a
375 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
375 +<<<<<<< dest: 328e4ab1f7cc ab - test: ab
376 b
376 b
377 +||||||| parent of source: cb9a9f314b8b - test: a
377 +||||||| parent of source: cb9a9f314b8b - test: a
378 +=======
378 +=======
379 +b
379 +b
380 +c
380 +c
381 +>>>>>>> source: 7bc217434fc1 - test: abc
381 +>>>>>>> source: 7bc217434fc1 - test: abc
382
382
383 Test rebase with obsstore turned on and off (issue5606)
383 Test rebase with obsstore turned on and off (issue5606)
384
384
385 $ cd $TESTTMP
385 $ cd $TESTTMP
386 $ hg init b
386 $ hg init b
387 $ cd b
387 $ cd b
388 $ hg debugdrawdag <<'EOS'
388 $ hg debugdrawdag <<'EOS'
389 > D
389 > D
390 > |
390 > |
391 > C
391 > C
392 > |
392 > |
393 > B E
393 > B E
394 > |/
394 > |/
395 > A
395 > A
396 > EOS
396 > EOS
397
397
398 $ hg update E -q
398 $ hg update E -q
399 $ echo 3 > B
399 $ echo 3 > B
400 $ hg commit --amend -m E -A B -q
400 $ hg commit --amend -m E -A B -q
401 $ hg rebase -r B+D -d . --config experimental.evolution=true
401 $ hg rebase -r B+D -d . --config experimental.evolution=true
402 rebasing 1:112478962961 B "B"
402 rebasing 1:112478962961 B "B"
403 merging B
403 merging B
404 warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
404 warning: conflicts while merging B! (edit, then use 'hg resolve --mark')
405 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
405 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
406 [240]
406 [240]
407
407
408 $ echo 4 > B
408 $ echo 4 > B
409 $ hg resolve -m
409 $ hg resolve -m
410 (no more unresolved files)
410 (no more unresolved files)
411 continue: hg rebase --continue
411 continue: hg rebase --continue
412 $ hg rebase --continue --config experimental.evolution=none
412 $ hg rebase --continue --config experimental.evolution=none
413 rebasing 1:112478962961 B "B"
413 rebasing 1:112478962961 B "B"
414 rebasing 3:f585351a92f8 D "D"
414 rebasing 3:f585351a92f8 D "D"
415 warning: orphaned descendants detected, not stripping 112478962961
415 warning: orphaned descendants detected, not stripping 112478962961
416 saved backup bundle to $TESTTMP/b/.hg/strip-backup/f585351a92f8-e536a9e4-rebase.hg
416 saved backup bundle to $TESTTMP/b/.hg/strip-backup/f585351a92f8-e536a9e4-rebase.hg
417
417
418 $ rm .hg/localtags
418 $ rm .hg/localtags
419 $ hg tglog
419 $ hg tglog
420 o 5:draft 'D'
420 o 5:draft 'D'
421 |
421 |
422 o 4:draft 'B'
422 o 4:draft 'B'
423 |
423 |
424 @ 3:draft 'E'
424 @ 3:draft 'E'
425 |
425 |
426 | o 2:draft 'C'
426 | o 2:draft 'C'
427 | |
427 | |
428 | o 1:draft 'B'
428 | o 1:draft 'B'
429 |/
429 |/
430 o 0:draft 'A'
430 o 0:draft 'A'
431
431
432
432
433 Test where the conflict happens when rebasing a merge commit
433 Test where the conflict happens when rebasing a merge commit
434
434
435 $ cd $TESTTMP
435 $ cd $TESTTMP
436 $ hg init conflict-in-merge
436 $ hg init conflict-in-merge
437 $ cd conflict-in-merge
437 $ cd conflict-in-merge
438 $ hg debugdrawdag <<'EOS'
438 $ hg debugdrawdag <<'EOS'
439 > F # F/conflict = foo\n
439 > F # F/conflict = foo\n
440 > |\
440 > |\
441 > D E
441 > D E
442 > |/
442 > |/
443 > C B # B/conflict = bar\n
443 > C B # B/conflict = bar\n
444 > |/
444 > |/
445 > A
445 > A
446 > EOS
446 > EOS
447
447
448 $ hg co F
448 $ hg co F
449 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
449 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 $ hg rebase -d B
450 $ hg rebase -d B
451 rebasing 2:dc0947a82db8 C "C"
451 rebasing 2:dc0947a82db8 C "C"
452 rebasing 3:e7b3f00ed42e D "D"
452 rebasing 3:e7b3f00ed42e D "D"
453 rebasing 4:03ca77807e91 E "E"
453 rebasing 4:03ca77807e91 E "E"
454 rebasing 5:9a6b91dc2044 F tip "F"
454 rebasing 5:9a6b91dc2044 F tip "F"
455 merging conflict
455 merging conflict
456 warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark')
456 warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark')
457 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
457 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
458 [240]
458 [240]
459 $ hg tglog
459 $ hg tglog
460 @ 8:draft 'E'
460 @ 8:draft 'E'
461 |
461 |
462 | @ 7:draft 'D'
462 | @ 7:draft 'D'
463 |/
463 |/
464 o 6:draft 'C'
464 o 6:draft 'C'
465 |
465 |
466 | % 5:draft 'F'
466 | % 5:draft 'F'
467 | |\
467 | |\
468 | | o 4:draft 'E'
468 | | o 4:draft 'E'
469 | | |
469 | | |
470 | o | 3:draft 'D'
470 | o | 3:draft 'D'
471 | |/
471 | |/
472 | o 2:draft 'C'
472 | o 2:draft 'C'
473 | |
473 | |
474 o | 1:draft 'B'
474 o | 1:draft 'B'
475 |/
475 |/
476 o 0:draft 'A'
476 o 0:draft 'A'
477
477
478 $ echo baz > conflict
478 $ echo baz > conflict
479 $ hg resolve -m
479 $ hg resolve -m
480 (no more unresolved files)
480 (no more unresolved files)
481 continue: hg rebase --continue
481 continue: hg rebase --continue
482 $ hg rebase -c
482 $ hg rebase -c
483 already rebased 2:dc0947a82db8 C "C" as 0199610c343e
483 already rebased 2:dc0947a82db8 C "C" as 0199610c343e
484 already rebased 3:e7b3f00ed42e D "D" as f0dd538aaa63
484 already rebased 3:e7b3f00ed42e D "D" as f0dd538aaa63
485 already rebased 4:03ca77807e91 E "E" as cbf25af8347d
485 already rebased 4:03ca77807e91 E "E" as cbf25af8347d
486 rebasing 5:9a6b91dc2044 F "F"
486 rebasing 5:9a6b91dc2044 F "F"
487 saved backup bundle to $TESTTMP/conflict-in-merge/.hg/strip-backup/dc0947a82db8-ca7e7d5b-rebase.hg
487 saved backup bundle to $TESTTMP/conflict-in-merge/.hg/strip-backup/dc0947a82db8-ca7e7d5b-rebase.hg
488 $ hg tglog
488 $ hg tglog
489 @ 5:draft 'F'
489 @ 5:draft 'F'
490 |\
490 |\
491 | o 4:draft 'E'
491 | o 4:draft 'E'
492 | |
492 | |
493 o | 3:draft 'D'
493 o | 3:draft 'D'
494 |/
494 |/
495 o 2:draft 'C'
495 o 2:draft 'C'
496 |
496 |
497 o 1:draft 'B'
497 o 1:draft 'B'
498 |
498 |
499 o 0:draft 'A'
499 o 0:draft 'A'
500
500
@@ -1,316 +1,333 b''
1 ==========================================================
1 ==========================================================
2 Test various things around delta computation within revlog
2 Test various things around delta computation within revlog
3 ==========================================================
3 ==========================================================
4
4
5
5
6 basic setup
6 basic setup
7 -----------
7 -----------
8
8
9 $ cat << EOF >> $HGRCPATH
9 $ cat << EOF >> $HGRCPATH
10 > [debug]
10 > [debug]
11 > revlog.debug-delta=yes
11 > revlog.debug-delta=yes
12 > EOF
12 > EOF
13 $ cat << EOF >> sha256line.py
13 $ cat << EOF >> sha256line.py
14 > # a way to quickly produce file of significant size and poorly compressable content.
14 > # a way to quickly produce file of significant size and poorly compressable content.
15 > import hashlib
15 > import hashlib
16 > import sys
16 > import sys
17 > for line in sys.stdin:
17 > for line in sys.stdin:
18 > print(hashlib.sha256(line.encode('utf8')).hexdigest())
18 > print(hashlib.sha256(line.encode('utf8')).hexdigest())
19 > EOF
19 > EOF
20
20
21 $ hg init base-repo
21 $ hg init base-repo
22 $ cd base-repo
22 $ cd base-repo
23
23
24 create a "large" file
24 create a "large" file
25
25
26 $ $TESTDIR/seq.py 1000 | $PYTHON $TESTTMP/sha256line.py > my-file.txt
26 $ $TESTDIR/seq.py 1000 | $PYTHON $TESTTMP/sha256line.py > my-file.txt
27 $ hg add my-file.txt
27 $ hg add my-file.txt
28 $ hg commit -m initial-commit
28 $ hg commit -m initial-commit
29 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
29 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
30 DBG-DELTAS: MANIFESTLOG: * (glob)
30 DBG-DELTAS: MANIFESTLOG: * (glob)
31 DBG-DELTAS: CHANGELOG: * (glob)
31 DBG-DELTAS: CHANGELOG: * (glob)
32
32
33 Add more change at the end of the file
33 Add more change at the end of the file
34
34
35 $ $TESTDIR/seq.py 1001 1200 | $PYTHON $TESTTMP/sha256line.py >> my-file.txt
35 $ $TESTDIR/seq.py 1001 1200 | $PYTHON $TESTTMP/sha256line.py >> my-file.txt
36 $ hg commit -m "large-change"
36 $ hg commit -m "large-change"
37 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
37 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
38 DBG-DELTAS: MANIFESTLOG: * (glob)
38 DBG-DELTAS: MANIFESTLOG: * (glob)
39 DBG-DELTAS: CHANGELOG: * (glob)
39 DBG-DELTAS: CHANGELOG: * (glob)
40
40
41 Add small change at the start
41 Add small change at the start
42
42
43 $ hg up 'desc("initial-commit")' --quiet
43 $ hg up 'desc("initial-commit")' --quiet
44 $ mv my-file.txt foo
44 $ mv my-file.txt foo
45 $ echo "small change at the start" > my-file.txt
45 $ echo "small change at the start" > my-file.txt
46 $ cat foo >> my-file.txt
46 $ cat foo >> my-file.txt
47 $ rm foo
47 $ rm foo
48 $ hg commit -m "small-change"
48 $ hg commit -m "small-change"
49 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
49 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
50 DBG-DELTAS: MANIFESTLOG: * (glob)
50 DBG-DELTAS: MANIFESTLOG: * (glob)
51 DBG-DELTAS: CHANGELOG: * (glob)
51 DBG-DELTAS: CHANGELOG: * (glob)
52 created new head
52 created new head
53
53
54
54
55 $ hg log -r 'head()' -T '{node}\n' >> ../base-heads.nodes
55 $ hg log -r 'head()' -T '{node}\n' >> ../base-heads.nodes
56 $ hg log -r 'desc("initial-commit")' -T '{node}\n' >> ../initial.node
56 $ hg log -r 'desc("initial-commit")' -T '{node}\n' >> ../initial.node
57 $ hg log -r 'desc("small-change")' -T '{node}\n' >> ../small.node
57 $ hg log -r 'desc("small-change")' -T '{node}\n' >> ../small.node
58 $ hg log -r 'desc("large-change")' -T '{node}\n' >> ../large.node
58 $ hg log -r 'desc("large-change")' -T '{node}\n' >> ../large.node
59 $ cd ..
59 $ cd ..
60
60
61 Check delta find policy and result for merge on commit
61 Check delta find policy and result for merge on commit
62 ======================================================
62 ======================================================
63
63
64 Check that delta of merge pick best of the two parents
64 Check that delta of merge pick best of the two parents
65 ------------------------------------------------------
65 ------------------------------------------------------
66
66
67 As we check against both parents, the one with the largest change should
67 As we check against both parents, the one with the largest change should
68 produce the smallest delta and be picked.
68 produce the smallest delta and be picked.
69
69
70 $ hg clone base-repo test-parents --quiet
70 $ hg clone base-repo test-parents --quiet
71 $ hg -R test-parents update 'nodefromfile("small.node")' --quiet
71 $ hg -R test-parents update 'nodefromfile("small.node")' --quiet
72 $ hg -R test-parents merge 'nodefromfile("large.node")' --quiet
72 $ hg -R test-parents merge 'nodefromfile("large.node")' --quiet
73
73
74 The delta base is the "large" revision as it produce a smaller delta.
74 The delta base is the "large" revision as it produce a smaller delta.
75
75
76 $ hg -R test-parents commit -m "merge from small change"
76 $ hg -R test-parents commit -m "merge from small change"
77 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob)
77 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob)
78 DBG-DELTAS: MANIFESTLOG: * (glob)
78 DBG-DELTAS: MANIFESTLOG: * (glob)
79 DBG-DELTAS: CHANGELOG: * (glob)
79 DBG-DELTAS: CHANGELOG: * (glob)
80
80
81 Check that the behavior tested above can we disabled
81 Check that the behavior tested above can we disabled
82 ----------------------------------------------------
82 ----------------------------------------------------
83
83
84 We disable the checking of both parent at the same time. The `small` change,
84 We disable the checking of both parent at the same time. The `small` change,
85 that produce a less optimal delta, should be picked first as it is "closer" to
85 that produce a less optimal delta, should be picked first as it is "closer" to
86 the new commit.
86 the new commit.
87
87
88 $ hg clone base-repo test-no-parents --quiet
88 $ hg clone base-repo test-no-parents --quiet
89 $ hg -R test-no-parents update 'nodefromfile("small.node")' --quiet
89 $ hg -R test-no-parents update 'nodefromfile("small.node")' --quiet
90 $ hg -R test-no-parents merge 'nodefromfile("large.node")' --quiet
90 $ hg -R test-no-parents merge 'nodefromfile("large.node")' --quiet
91
91
92 The delta base is the "large" revision as it produce a smaller delta.
92 The delta base is the "large" revision as it produce a smaller delta.
93
93
94 $ hg -R test-no-parents commit -m "merge from small change" \
94 $ hg -R test-no-parents commit -m "merge from small change" \
95 > --config storage.revlog.optimize-delta-parent-choice=no
95 > --config storage.revlog.optimize-delta-parent-choice=no
96 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
96 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
97 DBG-DELTAS: MANIFESTLOG: * (glob)
97 DBG-DELTAS: MANIFESTLOG: * (glob)
98 DBG-DELTAS: CHANGELOG: * (glob)
98 DBG-DELTAS: CHANGELOG: * (glob)
99
99
100
100
101 Check delta-find policy and result when unbundling
101 Check delta-find policy and result when unbundling
102 ==================================================
102 ==================================================
103
103
104 Build a bundle with all delta built against p1
104 Build a bundle with all delta built against p1
105
105
106 $ hg bundle -R test-parents --all --config devel.bundle.delta=p1 all-p1.hg
106 $ hg bundle -R test-parents --all --config devel.bundle.delta=p1 all-p1.hg
107 4 changesets found
107 4 changesets found
108
108
109 Default policy of trusting delta from the bundle
109 Default policy of trusting delta from the bundle
110 ------------------------------------------------
110 ------------------------------------------------
111
111
112 Keeping the `p1` delta used in the bundle is sub-optimal for storage, but
112 Keeping the `p1` delta used in the bundle is sub-optimal for storage, but
113 strusting in-bundle delta is faster to apply.
113 strusting in-bundle delta is faster to apply.
114
114
115 $ hg init bundle-default
115 $ hg init bundle-default
116 $ hg -R bundle-default unbundle all-p1.hg --quiet
116 $ hg -R bundle-default unbundle all-p1.hg --quiet
117 DBG-DELTAS: CHANGELOG: * (glob)
117 DBG-DELTAS: CHANGELOG: * (glob)
118 DBG-DELTAS: CHANGELOG: * (glob)
118 DBG-DELTAS: CHANGELOG: * (glob)
119 DBG-DELTAS: CHANGELOG: * (glob)
119 DBG-DELTAS: CHANGELOG: * (glob)
120 DBG-DELTAS: CHANGELOG: * (glob)
120 DBG-DELTAS: CHANGELOG: * (glob)
121 DBG-DELTAS: MANIFESTLOG: * (glob)
121 DBG-DELTAS: MANIFESTLOG: * (glob)
122 DBG-DELTAS: MANIFESTLOG: * (glob)
122 DBG-DELTAS: MANIFESTLOG: * (glob)
123 DBG-DELTAS: MANIFESTLOG: * (glob)
123 DBG-DELTAS: MANIFESTLOG: * (glob)
124 DBG-DELTAS: MANIFESTLOG: * (glob)
124 DBG-DELTAS: MANIFESTLOG: * (glob)
125 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
125 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
126 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
126 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
127 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
127 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
128 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
128 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
129
129
130 (confirm the file revision are in the same order, 2 should be smaller than 1)
130 (confirm the file revision are in the same order, 2 should be smaller than 1)
131
131
132 $ hg -R bundle-default debugdata my-file.txt 2 | wc -l
132 $ hg -R bundle-default debugdata my-file.txt 2 | wc -l
133 \s*1001 (re)
133 \s*1001 (re)
134 $ hg -R bundle-default debugdata my-file.txt 1 | wc -l
134 $ hg -R bundle-default debugdata my-file.txt 1 | wc -l
135 \s*1200 (re)
135 \s*1200 (re)
136
136
137 explicitly enabled
137 explicitly enabled
138 ------------------
138 ------------------
139
139
140 Keeping the `p1` delta used in the bundle is sub-optimal for storage, but
140 Keeping the `p1` delta used in the bundle is sub-optimal for storage, but
141 strusting in-bundle delta is faster to apply.
141 strusting in-bundle delta is faster to apply.
142
142
143 $ hg init bundle-reuse-enabled
143 $ hg init bundle-reuse-enabled
144 $ hg -R bundle-reuse-enabled unbundle all-p1.hg --quiet \
144 $ hg -R bundle-reuse-enabled unbundle all-p1.hg --quiet \
145 > --config storage.revlog.reuse-external-delta-parent=yes
145 > --config storage.revlog.reuse-external-delta-parent=yes
146 DBG-DELTAS: CHANGELOG: * (glob)
146 DBG-DELTAS: CHANGELOG: * (glob)
147 DBG-DELTAS: CHANGELOG: * (glob)
147 DBG-DELTAS: CHANGELOG: * (glob)
148 DBG-DELTAS: CHANGELOG: * (glob)
148 DBG-DELTAS: CHANGELOG: * (glob)
149 DBG-DELTAS: CHANGELOG: * (glob)
149 DBG-DELTAS: CHANGELOG: * (glob)
150 DBG-DELTAS: MANIFESTLOG: * (glob)
150 DBG-DELTAS: MANIFESTLOG: * (glob)
151 DBG-DELTAS: MANIFESTLOG: * (glob)
151 DBG-DELTAS: MANIFESTLOG: * (glob)
152 DBG-DELTAS: MANIFESTLOG: * (glob)
152 DBG-DELTAS: MANIFESTLOG: * (glob)
153 DBG-DELTAS: MANIFESTLOG: * (glob)
153 DBG-DELTAS: MANIFESTLOG: * (glob)
154 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
154 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
155 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
155 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
156 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
156 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
157 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
157 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
158
158
159 (confirm the file revision are in the same order, 2 should be smaller than 1)
159 (confirm the file revision are in the same order, 2 should be smaller than 1)
160
160
161 $ hg -R bundle-reuse-enabled debugdata my-file.txt 2 | wc -l
161 $ hg -R bundle-reuse-enabled debugdata my-file.txt 2 | wc -l
162 \s*1001 (re)
162 \s*1001 (re)
163 $ hg -R bundle-reuse-enabled debugdata my-file.txt 1 | wc -l
163 $ hg -R bundle-reuse-enabled debugdata my-file.txt 1 | wc -l
164 \s*1200 (re)
164 \s*1200 (re)
165
165
166 explicitly disabled
166 explicitly disabled
167 -------------------
167 -------------------
168
168
169 Not reusing the delta-base from the parent means we the delta will be made
169 Not reusing the delta-base from the parent means we the delta will be made
170 against the "best" parent. (so not the same as the previous two)
170 against the "best" parent. (so not the same as the previous two)
171
171
172 $ hg init bundle-reuse-disabled
172 $ hg init bundle-reuse-disabled
173 $ hg -R bundle-reuse-disabled unbundle all-p1.hg --quiet \
173 $ hg -R bundle-reuse-disabled unbundle all-p1.hg --quiet \
174 > --config storage.revlog.reuse-external-delta-parent=no
174 > --config storage.revlog.reuse-external-delta-parent=no
175 DBG-DELTAS: CHANGELOG: * (glob)
175 DBG-DELTAS: CHANGELOG: * (glob)
176 DBG-DELTAS: CHANGELOG: * (glob)
176 DBG-DELTAS: CHANGELOG: * (glob)
177 DBG-DELTAS: CHANGELOG: * (glob)
177 DBG-DELTAS: CHANGELOG: * (glob)
178 DBG-DELTAS: CHANGELOG: * (glob)
178 DBG-DELTAS: CHANGELOG: * (glob)
179 DBG-DELTAS: MANIFESTLOG: * (glob)
179 DBG-DELTAS: MANIFESTLOG: * (glob)
180 DBG-DELTAS: MANIFESTLOG: * (glob)
180 DBG-DELTAS: MANIFESTLOG: * (glob)
181 DBG-DELTAS: MANIFESTLOG: * (glob)
181 DBG-DELTAS: MANIFESTLOG: * (glob)
182 DBG-DELTAS: MANIFESTLOG: * (glob)
182 DBG-DELTAS: MANIFESTLOG: * (glob)
183 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
183 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
184 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
184 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
185 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
185 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
186 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob)
186 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob)
187
187
188 (confirm the file revision are in the same order, 2 should be smaller than 1)
188 (confirm the file revision are in the same order, 2 should be smaller than 1)
189
189
190 $ hg -R bundle-reuse-disabled debugdata my-file.txt 2 | wc -l
190 $ hg -R bundle-reuse-disabled debugdata my-file.txt 2 | wc -l
191 \s*1001 (re)
191 \s*1001 (re)
192 $ hg -R bundle-reuse-disabled debugdata my-file.txt 1 | wc -l
192 $ hg -R bundle-reuse-disabled debugdata my-file.txt 1 | wc -l
193 \s*1200 (re)
193 \s*1200 (re)
194
194
195
195
196 Check the path.*:delta-reuse-policy option
196 Check the path.*:delta-reuse-policy option
197 ==========================================
197 ==========================================
198
198
199 Get a repository with the bad parent picked and a clone ready to pull the merge
199 Get a repository with the bad parent picked and a clone ready to pull the merge
200
200
201 $ cp -ar bundle-reuse-enabled peer-bad-delta
201 $ cp -ar bundle-reuse-enabled peer-bad-delta
202 $ hg clone peer-bad-delta local-pre-pull --rev `cat large.node` --rev `cat small.node` --quiet
202 $ hg clone peer-bad-delta local-pre-pull --rev `cat large.node` --rev `cat small.node` --quiet
203 DBG-DELTAS: CHANGELOG: * (glob)
203 DBG-DELTAS: CHANGELOG: * (glob)
204 DBG-DELTAS: CHANGELOG: * (glob)
204 DBG-DELTAS: CHANGELOG: * (glob)
205 DBG-DELTAS: CHANGELOG: * (glob)
205 DBG-DELTAS: CHANGELOG: * (glob)
206 DBG-DELTAS: MANIFESTLOG: * (glob)
206 DBG-DELTAS: MANIFESTLOG: * (glob)
207 DBG-DELTAS: MANIFESTLOG: * (glob)
207 DBG-DELTAS: MANIFESTLOG: * (glob)
208 DBG-DELTAS: MANIFESTLOG: * (glob)
208 DBG-DELTAS: MANIFESTLOG: * (glob)
209 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
209 DBG-DELTAS: FILELOG:my-file.txt: rev=0: delta-base=0 * (glob)
210 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
210 DBG-DELTAS: FILELOG:my-file.txt: rev=1: delta-base=0 * (glob)
211 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
211 DBG-DELTAS: FILELOG:my-file.txt: rev=2: delta-base=0 * (glob)
212
212
213 Check the parent order for the file
213 Check the parent order for the file
214
214
215 $ hg -R local-pre-pull debugdata my-file.txt 2 | wc -l
215 $ hg -R local-pre-pull debugdata my-file.txt 2 | wc -l
216 \s*1001 (re)
216 \s*1001 (re)
217 $ hg -R local-pre-pull debugdata my-file.txt 1 | wc -l
217 $ hg -R local-pre-pull debugdata my-file.txt 1 | wc -l
218 \s*1200 (re)
218 \s*1200 (re)
219
219
220 Pull with no value (so the default)
220 Pull with no value (so the default)
221 -----------------------------------
221 -----------------------------------
222
222
223 default is to reuse the (bad) delta
223 default is to reuse the (bad) delta
224
224
225 $ cp -ar local-pre-pull local-no-value
225 $ cp -ar local-pre-pull local-no-value
226 $ hg -R local-no-value pull --quiet
226 $ hg -R local-no-value pull --quiet
227 DBG-DELTAS: CHANGELOG: * (glob)
227 DBG-DELTAS: CHANGELOG: * (glob)
228 DBG-DELTAS: MANIFESTLOG: * (glob)
228 DBG-DELTAS: MANIFESTLOG: * (glob)
229 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
229 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
230
230
231 Pull with explicitly the default
231 Pull with explicitly the default
232 --------------------------------
232 --------------------------------
233
233
234 default is to reuse the (bad) delta
234 default is to reuse the (bad) delta
235
235
236 $ cp -ar local-pre-pull local-default
236 $ cp -ar local-pre-pull local-default
237 $ hg -R local-default pull --quiet --config 'paths.default:delta-reuse-policy=default'
237 $ hg -R local-default pull --quiet --config 'paths.default:delta-reuse-policy=default'
238 DBG-DELTAS: CHANGELOG: * (glob)
238 DBG-DELTAS: CHANGELOG: * (glob)
239 DBG-DELTAS: MANIFESTLOG: * (glob)
239 DBG-DELTAS: MANIFESTLOG: * (glob)
240 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
240 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
241
241
242 Pull with no-reuse
242 Pull with no-reuse
243 ------------------
243 ------------------
244
244
245 We don't reuse the base, so we get a better delta
245 We don't reuse the base, so we get a better delta
246
246
247 $ cp -ar local-pre-pull local-no-reuse
247 $ cp -ar local-pre-pull local-no-reuse
248 $ hg -R local-no-reuse pull --quiet --config 'paths.default:delta-reuse-policy=no-reuse'
248 $ hg -R local-no-reuse pull --quiet --config 'paths.default:delta-reuse-policy=no-reuse'
249 DBG-DELTAS: CHANGELOG: * (glob)
249 DBG-DELTAS: CHANGELOG: * (glob)
250 DBG-DELTAS: MANIFESTLOG: * (glob)
250 DBG-DELTAS: MANIFESTLOG: * (glob)
251 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob)
251 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=1 * (glob)
252
252
253 Pull with try-base
253 Pull with try-base
254 ------------------
254 ------------------
255
255
256 We requested to use the (bad) delta
256 We requested to use the (bad) delta
257
257
258 $ cp -ar local-pre-pull local-try-base
258 $ cp -ar local-pre-pull local-try-base
259 $ hg -R local-try-base pull --quiet --config 'paths.default:delta-reuse-policy=try-base'
259 $ hg -R local-try-base pull --quiet --config 'paths.default:delta-reuse-policy=try-base'
260 DBG-DELTAS: CHANGELOG: * (glob)
260 DBG-DELTAS: CHANGELOG: * (glob)
261 DBG-DELTAS: MANIFESTLOG: * (glob)
261 DBG-DELTAS: MANIFESTLOG: * (glob)
262 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
262 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
263
263
264 Case where we force a "bad" delta to be applied
264 Case where we force a "bad" delta to be applied
265 ===============================================
265 ===============================================
266
266
267 We build a very different file content to force a full snapshot
267 We build a very different file content to force a full snapshot
268
268
269 $ cp -ar peer-bad-delta peer-bad-delta-with-full
269 $ cp -ar peer-bad-delta peer-bad-delta-with-full
270 $ cp -ar local-pre-pull local-pre-pull-full
270 $ cp -ar local-pre-pull local-pre-pull-full
271 $ echo '[paths]' >> local-pre-pull-full/.hg/hgrc
271 $ echo '[paths]' >> local-pre-pull-full/.hg/hgrc
272 $ echo 'default=../peer-bad-delta-with-full' >> local-pre-pull-full/.hg/hgrc
272 $ echo 'default=../peer-bad-delta-with-full' >> local-pre-pull-full/.hg/hgrc
273
273
274 $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet
274 $ hg -R peer-bad-delta-with-full update 'desc("merge")' --quiet
275 $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \
275 $ ($TESTDIR/seq.py 2000 2100; $TESTDIR/seq.py 500 510; $TESTDIR/seq.py 3000 3050) \
276 > | $PYTHON $TESTTMP/sha256line.py > peer-bad-delta-with-full/my-file.txt
276 > | $PYTHON $TESTTMP/sha256line.py > peer-bad-delta-with-full/my-file.txt
277 $ hg -R peer-bad-delta-with-full commit -m 'trigger-full'
277 $ hg -R peer-bad-delta-with-full commit -m 'trigger-full'
278 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob)
278 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob)
279 DBG-DELTAS: MANIFESTLOG: * (glob)
279 DBG-DELTAS: MANIFESTLOG: * (glob)
280 DBG-DELTAS: CHANGELOG: * (glob)
280 DBG-DELTAS: CHANGELOG: * (glob)
281
281
282 Check that "try-base" behavior challenge the delta
282 Check that "try-base" behavior challenge the delta
283 --------------------------------------------------
283 --------------------------------------------------
284
284
285 The bundling process creates a delta against the previous revision, however this
285 The bundling process creates a delta against the previous revision, however this
286 is an invalid chain for the client, so it is not considered and we do a full
286 is an invalid chain for the client, so it is not considered and we do a full
287 snapshot again.
287 snapshot again.
288
288
289 $ cp -ar local-pre-pull-full local-try-base-full
289 $ cp -ar local-pre-pull-full local-try-base-full
290 $ hg -R local-try-base-full pull --quiet \
290 $ hg -R local-try-base-full pull --quiet \
291 > --config 'paths.default:delta-reuse-policy=try-base'
291 > --config 'paths.default:delta-reuse-policy=try-base'
292 DBG-DELTAS: CHANGELOG: * (glob)
292 DBG-DELTAS: CHANGELOG: * (glob)
293 DBG-DELTAS: CHANGELOG: * (glob)
293 DBG-DELTAS: CHANGELOG: * (glob)
294 DBG-DELTAS: MANIFESTLOG: * (glob)
294 DBG-DELTAS: MANIFESTLOG: * (glob)
295 DBG-DELTAS: MANIFESTLOG: * (glob)
295 DBG-DELTAS: MANIFESTLOG: * (glob)
296 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
296 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
297 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob)
297 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 * (glob)
298
298
299 Check that "forced" behavior do not challenge the delta, even if it is full.
300 ---------------------------------------------------------------------------
301
302 A full bundle should be accepted as full bundle without recomputation
303
304 $ cp -ar local-pre-pull-full local-forced-full
305 $ hg -R local-forced-full pull --quiet \
306 > --config 'paths.default:delta-reuse-policy=forced'
307 DBG-DELTAS: CHANGELOG: * (glob)
308 DBG-DELTAS: CHANGELOG: * (glob)
309 DBG-DELTAS: MANIFESTLOG: * (glob)
310 DBG-DELTAS: MANIFESTLOG: * (glob)
311 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
312 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=4 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - * (glob)
313
299 Check that "forced" behavior do not challenge the delta, even if it is bad.
314 Check that "forced" behavior do not challenge the delta, even if it is bad.
300 ---------------------------------------------------------------------------
315 ---------------------------------------------------------------------------
301
316
302 The client does not challenge anything and applies the bizarre delta directly.
317 The client does not challenge anything and applies the bizarre delta directly.
303
318
304 Note: If the bundling process becomes smarter, this test might no longer work
319 Note: If the bundling process becomes smarter, this test might no longer work
305 (as the server won't be sending "bad" deltas anymore) and might need something
320 (as the server won't be sending "bad" deltas anymore) and might need something
306 more subtle to test this behavior.
321 more subtle to test this behavior.
307
322
308 $ cp -ar local-pre-pull-full local-forced-full
323 $ hg bundle -R peer-bad-delta-with-full --all --config devel.bundle.delta=p1 all-p1.hg
309 $ hg -R local-forced-full pull --quiet \
324 5 changesets found
310 > --config 'paths.default:delta-reuse-policy=forced'
325 $ cp -ar local-pre-pull-full local-forced-full-p1
326 $ hg -R local-forced-full-p1 pull --quiet \
327 > --config 'paths.*:delta-reuse-policy=forced' all-p1.hg
311 DBG-DELTAS: CHANGELOG: * (glob)
328 DBG-DELTAS: CHANGELOG: * (glob)
312 DBG-DELTAS: CHANGELOG: * (glob)
329 DBG-DELTAS: CHANGELOG: * (glob)
313 DBG-DELTAS: MANIFESTLOG: * (glob)
330 DBG-DELTAS: MANIFESTLOG: * (glob)
314 DBG-DELTAS: MANIFESTLOG: * (glob)
331 DBG-DELTAS: MANIFESTLOG: * (glob)
315 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
332 DBG-DELTAS: FILELOG:my-file.txt: rev=3: delta-base=2 * (glob)
316 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=3 * (glob)
333 DBG-DELTAS: FILELOG:my-file.txt: rev=4: delta-base=3 * (glob)
General Comments 0
You need to be logged in to leave comments. Login now