##// END OF EJS Templates
rebase: improve error message for --base being empty or causing emptiness...
Mads Kiilerich -
r20249:dc515784 default
parent child Browse files
Show More
@@ -1,921 +1,947 b''
1 # rebase.py - rebasing feature for mercurial
1 # rebase.py - rebasing feature for mercurial
2 #
2 #
3 # Copyright 2008 Stefano Tortarolo <stefano.tortarolo at gmail dot com>
3 # Copyright 2008 Stefano Tortarolo <stefano.tortarolo at gmail dot 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 '''command to move sets of revisions to a different ancestor
8 '''command to move sets of revisions to a different ancestor
9
9
10 This extension lets you rebase changesets in an existing Mercurial
10 This extension lets you rebase changesets in an existing Mercurial
11 repository.
11 repository.
12
12
13 For more information:
13 For more information:
14 http://mercurial.selenic.com/wiki/RebaseExtension
14 http://mercurial.selenic.com/wiki/RebaseExtension
15 '''
15 '''
16
16
17 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
17 from mercurial import hg, util, repair, merge, cmdutil, commands, bookmarks
18 from mercurial import extensions, patch, scmutil, phases, obsolete, error
18 from mercurial import extensions, patch, scmutil, phases, obsolete, error
19 from mercurial.commands import templateopts
19 from mercurial.commands import templateopts
20 from mercurial.node import nullrev
20 from mercurial.node import nullrev
21 from mercurial.lock import release
21 from mercurial.lock import release
22 from mercurial.i18n import _
22 from mercurial.i18n import _
23 import os, errno
23 import os, errno
24
24
25 nullmerge = -2
25 nullmerge = -2
26 revignored = -3
26 revignored = -3
27
27
28 cmdtable = {}
28 cmdtable = {}
29 command = cmdutil.command(cmdtable)
29 command = cmdutil.command(cmdtable)
30 testedwith = 'internal'
30 testedwith = 'internal'
31
31
32 def _savegraft(ctx, extra):
32 def _savegraft(ctx, extra):
33 s = ctx.extra().get('source', None)
33 s = ctx.extra().get('source', None)
34 if s is not None:
34 if s is not None:
35 extra['source'] = s
35 extra['source'] = s
36
36
37 def _savebranch(ctx, extra):
37 def _savebranch(ctx, extra):
38 extra['branch'] = ctx.branch()
38 extra['branch'] = ctx.branch()
39
39
40 def _makeextrafn(copiers):
40 def _makeextrafn(copiers):
41 """make an extrafn out of the given copy-functions.
41 """make an extrafn out of the given copy-functions.
42
42
43 A copy function takes a context and an extra dict, and mutates the
43 A copy function takes a context and an extra dict, and mutates the
44 extra dict as needed based on the given context.
44 extra dict as needed based on the given context.
45 """
45 """
46 def extrafn(ctx, extra):
46 def extrafn(ctx, extra):
47 for c in copiers:
47 for c in copiers:
48 c(ctx, extra)
48 c(ctx, extra)
49 return extrafn
49 return extrafn
50
50
51 @command('rebase',
51 @command('rebase',
52 [('s', 'source', '',
52 [('s', 'source', '',
53 _('rebase from the specified changeset'), _('REV')),
53 _('rebase from the specified changeset'), _('REV')),
54 ('b', 'base', '',
54 ('b', 'base', '',
55 _('rebase from the base of the specified changeset '
55 _('rebase from the base of the specified changeset '
56 '(up to greatest common ancestor of base and dest)'),
56 '(up to greatest common ancestor of base and dest)'),
57 _('REV')),
57 _('REV')),
58 ('r', 'rev', [],
58 ('r', 'rev', [],
59 _('rebase these revisions'),
59 _('rebase these revisions'),
60 _('REV')),
60 _('REV')),
61 ('d', 'dest', '',
61 ('d', 'dest', '',
62 _('rebase onto the specified changeset'), _('REV')),
62 _('rebase onto the specified changeset'), _('REV')),
63 ('', 'collapse', False, _('collapse the rebased changesets')),
63 ('', 'collapse', False, _('collapse the rebased changesets')),
64 ('m', 'message', '',
64 ('m', 'message', '',
65 _('use text as collapse commit message'), _('TEXT')),
65 _('use text as collapse commit message'), _('TEXT')),
66 ('e', 'edit', False, _('invoke editor on commit messages')),
66 ('e', 'edit', False, _('invoke editor on commit messages')),
67 ('l', 'logfile', '',
67 ('l', 'logfile', '',
68 _('read collapse commit message from file'), _('FILE')),
68 _('read collapse commit message from file'), _('FILE')),
69 ('', 'keep', False, _('keep original changesets')),
69 ('', 'keep', False, _('keep original changesets')),
70 ('', 'keepbranches', False, _('keep original branch names')),
70 ('', 'keepbranches', False, _('keep original branch names')),
71 ('D', 'detach', False, _('(DEPRECATED)')),
71 ('D', 'detach', False, _('(DEPRECATED)')),
72 ('t', 'tool', '', _('specify merge tool')),
72 ('t', 'tool', '', _('specify merge tool')),
73 ('c', 'continue', False, _('continue an interrupted rebase')),
73 ('c', 'continue', False, _('continue an interrupted rebase')),
74 ('a', 'abort', False, _('abort an interrupted rebase'))] +
74 ('a', 'abort', False, _('abort an interrupted rebase'))] +
75 templateopts,
75 templateopts,
76 _('[-s REV | -b REV] [-d REV] [OPTION]'))
76 _('[-s REV | -b REV] [-d REV] [OPTION]'))
77 def rebase(ui, repo, **opts):
77 def rebase(ui, repo, **opts):
78 """move changeset (and descendants) to a different branch
78 """move changeset (and descendants) to a different branch
79
79
80 Rebase uses repeated merging to graft changesets from one part of
80 Rebase uses repeated merging to graft changesets from one part of
81 history (the source) onto another (the destination). This can be
81 history (the source) onto another (the destination). This can be
82 useful for linearizing *local* changes relative to a master
82 useful for linearizing *local* changes relative to a master
83 development tree.
83 development tree.
84
84
85 You should not rebase changesets that have already been shared
85 You should not rebase changesets that have already been shared
86 with others. Doing so will force everybody else to perform the
86 with others. Doing so will force everybody else to perform the
87 same rebase or they will end up with duplicated changesets after
87 same rebase or they will end up with duplicated changesets after
88 pulling in your rebased changesets.
88 pulling in your rebased changesets.
89
89
90 In its default configuration, Mercurial will prevent you from
90 In its default configuration, Mercurial will prevent you from
91 rebasing published changes. See :hg:`help phases` for details.
91 rebasing published changes. See :hg:`help phases` for details.
92
92
93 If you don't specify a destination changeset (``-d/--dest``),
93 If you don't specify a destination changeset (``-d/--dest``),
94 rebase uses the current branch tip as the destination. (The
94 rebase uses the current branch tip as the destination. (The
95 destination changeset is not modified by rebasing, but new
95 destination changeset is not modified by rebasing, but new
96 changesets are added as its descendants.)
96 changesets are added as its descendants.)
97
97
98 You can specify which changesets to rebase in two ways: as a
98 You can specify which changesets to rebase in two ways: as a
99 "source" changeset or as a "base" changeset. Both are shorthand
99 "source" changeset or as a "base" changeset. Both are shorthand
100 for a topologically related set of changesets (the "source
100 for a topologically related set of changesets (the "source
101 branch"). If you specify source (``-s/--source``), rebase will
101 branch"). If you specify source (``-s/--source``), rebase will
102 rebase that changeset and all of its descendants onto dest. If you
102 rebase that changeset and all of its descendants onto dest. If you
103 specify base (``-b/--base``), rebase will select ancestors of base
103 specify base (``-b/--base``), rebase will select ancestors of base
104 back to but not including the common ancestor with dest. Thus,
104 back to but not including the common ancestor with dest. Thus,
105 ``-b`` is less precise but more convenient than ``-s``: you can
105 ``-b`` is less precise but more convenient than ``-s``: you can
106 specify any changeset in the source branch, and rebase will select
106 specify any changeset in the source branch, and rebase will select
107 the whole branch. If you specify neither ``-s`` nor ``-b``, rebase
107 the whole branch. If you specify neither ``-s`` nor ``-b``, rebase
108 uses the parent of the working directory as the base.
108 uses the parent of the working directory as the base.
109
109
110 For advanced usage, a third way is available through the ``--rev``
110 For advanced usage, a third way is available through the ``--rev``
111 option. It allows you to specify an arbitrary set of changesets to
111 option. It allows you to specify an arbitrary set of changesets to
112 rebase. Descendants of revs you specify with this option are not
112 rebase. Descendants of revs you specify with this option are not
113 automatically included in the rebase.
113 automatically included in the rebase.
114
114
115 By default, rebase recreates the changesets in the source branch
115 By default, rebase recreates the changesets in the source branch
116 as descendants of dest and then destroys the originals. Use
116 as descendants of dest and then destroys the originals. Use
117 ``--keep`` to preserve the original source changesets. Some
117 ``--keep`` to preserve the original source changesets. Some
118 changesets in the source branch (e.g. merges from the destination
118 changesets in the source branch (e.g. merges from the destination
119 branch) may be dropped if they no longer contribute any change.
119 branch) may be dropped if they no longer contribute any change.
120
120
121 One result of the rules for selecting the destination changeset
121 One result of the rules for selecting the destination changeset
122 and source branch is that, unlike ``merge``, rebase will do
122 and source branch is that, unlike ``merge``, rebase will do
123 nothing if you are at the branch tip of a named branch
123 nothing if you are at the branch tip of a named branch
124 with two heads. You need to explicitly specify source and/or
124 with two heads. You need to explicitly specify source and/or
125 destination (or ``update`` to the other head, if it's the head of
125 destination (or ``update`` to the other head, if it's the head of
126 the intended source branch).
126 the intended source branch).
127
127
128 If a rebase is interrupted to manually resolve a merge, it can be
128 If a rebase is interrupted to manually resolve a merge, it can be
129 continued with --continue/-c or aborted with --abort/-a.
129 continued with --continue/-c or aborted with --abort/-a.
130
130
131 Returns 0 on success, 1 if nothing to rebase or there are
131 Returns 0 on success, 1 if nothing to rebase or there are
132 unresolved conflicts.
132 unresolved conflicts.
133 """
133 """
134 originalwd = target = None
134 originalwd = target = None
135 activebookmark = None
135 activebookmark = None
136 external = nullrev
136 external = nullrev
137 state = {}
137 state = {}
138 skipped = set()
138 skipped = set()
139 targetancestors = set()
139 targetancestors = set()
140
140
141 editor = None
141 editor = None
142 if opts.get('edit'):
142 if opts.get('edit'):
143 editor = cmdutil.commitforceeditor
143 editor = cmdutil.commitforceeditor
144
144
145 lock = wlock = None
145 lock = wlock = None
146 try:
146 try:
147 wlock = repo.wlock()
147 wlock = repo.wlock()
148 lock = repo.lock()
148 lock = repo.lock()
149
149
150 # Validate input and define rebasing points
150 # Validate input and define rebasing points
151 destf = opts.get('dest', None)
151 destf = opts.get('dest', None)
152 srcf = opts.get('source', None)
152 srcf = opts.get('source', None)
153 basef = opts.get('base', None)
153 basef = opts.get('base', None)
154 revf = opts.get('rev', [])
154 revf = opts.get('rev', [])
155 contf = opts.get('continue')
155 contf = opts.get('continue')
156 abortf = opts.get('abort')
156 abortf = opts.get('abort')
157 collapsef = opts.get('collapse', False)
157 collapsef = opts.get('collapse', False)
158 collapsemsg = cmdutil.logmessage(ui, opts)
158 collapsemsg = cmdutil.logmessage(ui, opts)
159 e = opts.get('extrafn') # internal, used by e.g. hgsubversion
159 e = opts.get('extrafn') # internal, used by e.g. hgsubversion
160 extrafns = [_savegraft]
160 extrafns = [_savegraft]
161 if e:
161 if e:
162 extrafns = [e]
162 extrafns = [e]
163 keepf = opts.get('keep', False)
163 keepf = opts.get('keep', False)
164 keepbranchesf = opts.get('keepbranches', False)
164 keepbranchesf = opts.get('keepbranches', False)
165 # keepopen is not meant for use on the command line, but by
165 # keepopen is not meant for use on the command line, but by
166 # other extensions
166 # other extensions
167 keepopen = opts.get('keepopen', False)
167 keepopen = opts.get('keepopen', False)
168
168
169 if collapsemsg and not collapsef:
169 if collapsemsg and not collapsef:
170 raise util.Abort(
170 raise util.Abort(
171 _('message can only be specified with collapse'))
171 _('message can only be specified with collapse'))
172
172
173 if contf or abortf:
173 if contf or abortf:
174 if contf and abortf:
174 if contf and abortf:
175 raise util.Abort(_('cannot use both abort and continue'))
175 raise util.Abort(_('cannot use both abort and continue'))
176 if collapsef:
176 if collapsef:
177 raise util.Abort(
177 raise util.Abort(
178 _('cannot use collapse with continue or abort'))
178 _('cannot use collapse with continue or abort'))
179 if srcf or basef or destf:
179 if srcf or basef or destf:
180 raise util.Abort(
180 raise util.Abort(
181 _('abort and continue do not allow specifying revisions'))
181 _('abort and continue do not allow specifying revisions'))
182 if opts.get('tool', False):
182 if opts.get('tool', False):
183 ui.warn(_('tool option will be ignored\n'))
183 ui.warn(_('tool option will be ignored\n'))
184
184
185 try:
185 try:
186 (originalwd, target, state, skipped, collapsef, keepf,
186 (originalwd, target, state, skipped, collapsef, keepf,
187 keepbranchesf, external, activebookmark) = restorestatus(repo)
187 keepbranchesf, external, activebookmark) = restorestatus(repo)
188 except error.RepoLookupError:
188 except error.RepoLookupError:
189 if abortf:
189 if abortf:
190 clearstatus(repo)
190 clearstatus(repo)
191 repo.ui.warn(_('rebase aborted (no revision is removed,'
191 repo.ui.warn(_('rebase aborted (no revision is removed,'
192 ' only broken state is cleared)\n'))
192 ' only broken state is cleared)\n'))
193 return 0
193 return 0
194 else:
194 else:
195 msg = _('cannot continue inconsistent rebase')
195 msg = _('cannot continue inconsistent rebase')
196 hint = _('use "hg rebase --abort" to clear borken state')
196 hint = _('use "hg rebase --abort" to clear borken state')
197 raise util.Abort(msg, hint=hint)
197 raise util.Abort(msg, hint=hint)
198 if abortf:
198 if abortf:
199 return abort(repo, originalwd, target, state)
199 return abort(repo, originalwd, target, state)
200 else:
200 else:
201 if srcf and basef:
201 if srcf and basef:
202 raise util.Abort(_('cannot specify both a '
202 raise util.Abort(_('cannot specify both a '
203 'source and a base'))
203 'source and a base'))
204 if revf and basef:
204 if revf and basef:
205 raise util.Abort(_('cannot specify both a '
205 raise util.Abort(_('cannot specify both a '
206 'revision and a base'))
206 'revision and a base'))
207 if revf and srcf:
207 if revf and srcf:
208 raise util.Abort(_('cannot specify both a '
208 raise util.Abort(_('cannot specify both a '
209 'revision and a source'))
209 'revision and a source'))
210
210
211 cmdutil.checkunfinished(repo)
211 cmdutil.checkunfinished(repo)
212 cmdutil.bailifchanged(repo)
212 cmdutil.bailifchanged(repo)
213
213
214 if not destf:
214 if not destf:
215 # Destination defaults to the latest revision in the
215 # Destination defaults to the latest revision in the
216 # current branch
216 # current branch
217 branch = repo[None].branch()
217 branch = repo[None].branch()
218 dest = repo[branch]
218 dest = repo[branch]
219 else:
219 else:
220 dest = scmutil.revsingle(repo, destf)
220 dest = scmutil.revsingle(repo, destf)
221
221
222 if revf:
222 if revf:
223 rebaseset = scmutil.revrange(repo, revf)
223 rebaseset = scmutil.revrange(repo, revf)
224 if not rebaseset:
224 if not rebaseset:
225 raise util.Abort(_('empty "rev" revision set - '
225 raise util.Abort(_('empty "rev" revision set - '
226 'nothing to rebase'))
226 'nothing to rebase'))
227 elif srcf:
227 elif srcf:
228 src = scmutil.revrange(repo, [srcf])
228 src = scmutil.revrange(repo, [srcf])
229 if not src:
229 if not src:
230 raise util.Abort(_('empty "source" revision set - '
230 raise util.Abort(_('empty "source" revision set - '
231 'nothing to rebase'))
231 'nothing to rebase'))
232 rebaseset = repo.revs('(%ld)::', src)
232 rebaseset = repo.revs('(%ld)::', src)
233 assert rebaseset
233 assert rebaseset
234 else:
234 else:
235 base = scmutil.revrange(repo, [basef or '.'])
235 base = scmutil.revrange(repo, [basef or '.'])
236 if not base:
237 raise util.Abort(_('empty "base" revision set - '
238 "can't compute rebase set"))
236 rebaseset = repo.revs(
239 rebaseset = repo.revs(
237 '(children(ancestor(%ld, %d)) and ::(%ld))::',
240 '(children(ancestor(%ld, %d)) and ::(%ld))::',
238 base, dest, base)
241 base, dest, base)
242 if not rebaseset:
243 if base == [dest.rev()]:
244 if basef:
245 ui.status(_('nothing to rebase - %s is both "base"'
246 ' and destination\n') % dest)
247 else:
248 ui.status(_('nothing to rebase - working directory '
249 'parent is also destination\n'))
250 elif not repo.revs('%ld - ::%d', base, dest):
251 if basef:
252 ui.status(_('nothing to rebase - "base" %s is '
253 'already an ancestor of destination '
254 '%s\n') %
255 ('+'.join(str(repo[r]) for r in base),
256 dest))
257 else:
258 ui.status(_('nothing to rebase - working '
259 'directory parent is already an '
260 'ancestor of destination %s\n') % dest)
261 else: # can it happen?
262 ui.status(_('nothing to rebase from %s to %s\n') %
263 ('+'.join(str(repo[r]) for r in base), dest))
264 return 1
239 if rebaseset:
265 if rebaseset:
240 root = min(rebaseset)
266 root = min(rebaseset)
241 else:
267 else:
242 root = None
268 root = None
243
269
244 if not rebaseset:
270 if not rebaseset:
245 repo.ui.debug('base is ancestor of destination\n')
271 repo.ui.debug('base is ancestor of destination\n')
246 result = None
272 result = None
247 elif (not (keepf or obsolete._enabled)
273 elif (not (keepf or obsolete._enabled)
248 and repo.revs('first(children(%ld) - %ld)',
274 and repo.revs('first(children(%ld) - %ld)',
249 rebaseset, rebaseset)):
275 rebaseset, rebaseset)):
250 raise util.Abort(
276 raise util.Abort(
251 _("can't remove original changesets with"
277 _("can't remove original changesets with"
252 " unrebased descendants"),
278 " unrebased descendants"),
253 hint=_('use --keep to keep original changesets'))
279 hint=_('use --keep to keep original changesets'))
254 else:
280 else:
255 result = buildstate(repo, dest, rebaseset, collapsef)
281 result = buildstate(repo, dest, rebaseset, collapsef)
256
282
257 if not result:
283 if not result:
258 # Empty state built, nothing to rebase
284 # Empty state built, nothing to rebase
259 ui.status(_('nothing to rebase\n'))
285 ui.status(_('nothing to rebase\n'))
260 return 1
286 return 1
261 elif not keepf and not repo[root].mutable():
287 elif not keepf and not repo[root].mutable():
262 raise util.Abort(_("can't rebase immutable changeset %s")
288 raise util.Abort(_("can't rebase immutable changeset %s")
263 % repo[root],
289 % repo[root],
264 hint=_('see hg help phases for details'))
290 hint=_('see hg help phases for details'))
265 else:
291 else:
266 originalwd, target, state = result
292 originalwd, target, state = result
267 if collapsef:
293 if collapsef:
268 targetancestors = repo.changelog.ancestors([target],
294 targetancestors = repo.changelog.ancestors([target],
269 inclusive=True)
295 inclusive=True)
270 external = externalparent(repo, state, targetancestors)
296 external = externalparent(repo, state, targetancestors)
271
297
272 if keepbranchesf:
298 if keepbranchesf:
273 # insert _savebranch at the start of extrafns so if
299 # insert _savebranch at the start of extrafns so if
274 # there's a user-provided extrafn it can clobber branch if
300 # there's a user-provided extrafn it can clobber branch if
275 # desired
301 # desired
276 extrafns.insert(0, _savebranch)
302 extrafns.insert(0, _savebranch)
277 if collapsef:
303 if collapsef:
278 branches = set()
304 branches = set()
279 for rev in state:
305 for rev in state:
280 branches.add(repo[rev].branch())
306 branches.add(repo[rev].branch())
281 if len(branches) > 1:
307 if len(branches) > 1:
282 raise util.Abort(_('cannot collapse multiple named '
308 raise util.Abort(_('cannot collapse multiple named '
283 'branches'))
309 'branches'))
284
310
285
311
286 # Rebase
312 # Rebase
287 if not targetancestors:
313 if not targetancestors:
288 targetancestors = repo.changelog.ancestors([target], inclusive=True)
314 targetancestors = repo.changelog.ancestors([target], inclusive=True)
289
315
290 # Keep track of the current bookmarks in order to reset them later
316 # Keep track of the current bookmarks in order to reset them later
291 currentbookmarks = repo._bookmarks.copy()
317 currentbookmarks = repo._bookmarks.copy()
292 activebookmark = activebookmark or repo._bookmarkcurrent
318 activebookmark = activebookmark or repo._bookmarkcurrent
293 if activebookmark:
319 if activebookmark:
294 bookmarks.unsetcurrent(repo)
320 bookmarks.unsetcurrent(repo)
295
321
296 extrafn = _makeextrafn(extrafns)
322 extrafn = _makeextrafn(extrafns)
297
323
298 sortedstate = sorted(state)
324 sortedstate = sorted(state)
299 total = len(sortedstate)
325 total = len(sortedstate)
300 pos = 0
326 pos = 0
301 for rev in sortedstate:
327 for rev in sortedstate:
302 pos += 1
328 pos += 1
303 if state[rev] == -1:
329 if state[rev] == -1:
304 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])),
330 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])),
305 _('changesets'), total)
331 _('changesets'), total)
306 p1, p2 = defineparents(repo, rev, target, state,
332 p1, p2 = defineparents(repo, rev, target, state,
307 targetancestors)
333 targetancestors)
308 storestatus(repo, originalwd, target, state, collapsef, keepf,
334 storestatus(repo, originalwd, target, state, collapsef, keepf,
309 keepbranchesf, external, activebookmark)
335 keepbranchesf, external, activebookmark)
310 if len(repo.parents()) == 2:
336 if len(repo.parents()) == 2:
311 repo.ui.debug('resuming interrupted rebase\n')
337 repo.ui.debug('resuming interrupted rebase\n')
312 else:
338 else:
313 try:
339 try:
314 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
340 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
315 stats = rebasenode(repo, rev, p1, state, collapsef)
341 stats = rebasenode(repo, rev, p1, state, collapsef)
316 if stats and stats[3] > 0:
342 if stats and stats[3] > 0:
317 raise error.InterventionRequired(
343 raise error.InterventionRequired(
318 _('unresolved conflicts (see hg '
344 _('unresolved conflicts (see hg '
319 'resolve, then hg rebase --continue)'))
345 'resolve, then hg rebase --continue)'))
320 finally:
346 finally:
321 ui.setconfig('ui', 'forcemerge', '')
347 ui.setconfig('ui', 'forcemerge', '')
322 cmdutil.duplicatecopies(repo, rev, target)
348 cmdutil.duplicatecopies(repo, rev, target)
323 if not collapsef:
349 if not collapsef:
324 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
350 newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
325 editor=editor)
351 editor=editor)
326 else:
352 else:
327 # Skip commit if we are collapsing
353 # Skip commit if we are collapsing
328 repo.setparents(repo[p1].node())
354 repo.setparents(repo[p1].node())
329 newrev = None
355 newrev = None
330 # Update the state
356 # Update the state
331 if newrev is not None:
357 if newrev is not None:
332 state[rev] = repo[newrev].rev()
358 state[rev] = repo[newrev].rev()
333 else:
359 else:
334 if not collapsef:
360 if not collapsef:
335 ui.note(_('no changes, revision %d skipped\n') % rev)
361 ui.note(_('no changes, revision %d skipped\n') % rev)
336 ui.debug('next revision set to %s\n' % p1)
362 ui.debug('next revision set to %s\n' % p1)
337 skipped.add(rev)
363 skipped.add(rev)
338 state[rev] = p1
364 state[rev] = p1
339
365
340 ui.progress(_('rebasing'), None)
366 ui.progress(_('rebasing'), None)
341 ui.note(_('rebase merging completed\n'))
367 ui.note(_('rebase merging completed\n'))
342
368
343 if collapsef and not keepopen:
369 if collapsef and not keepopen:
344 p1, p2 = defineparents(repo, min(state), target,
370 p1, p2 = defineparents(repo, min(state), target,
345 state, targetancestors)
371 state, targetancestors)
346 if collapsemsg:
372 if collapsemsg:
347 commitmsg = collapsemsg
373 commitmsg = collapsemsg
348 else:
374 else:
349 commitmsg = 'Collapsed revision'
375 commitmsg = 'Collapsed revision'
350 for rebased in state:
376 for rebased in state:
351 if rebased not in skipped and state[rebased] > nullmerge:
377 if rebased not in skipped and state[rebased] > nullmerge:
352 commitmsg += '\n* %s' % repo[rebased].description()
378 commitmsg += '\n* %s' % repo[rebased].description()
353 commitmsg = ui.edit(commitmsg, repo.ui.username())
379 commitmsg = ui.edit(commitmsg, repo.ui.username())
354 newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
380 newrev = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
355 extrafn=extrafn, editor=editor)
381 extrafn=extrafn, editor=editor)
356 for oldrev in state.iterkeys():
382 for oldrev in state.iterkeys():
357 if state[oldrev] > nullmerge:
383 if state[oldrev] > nullmerge:
358 state[oldrev] = newrev
384 state[oldrev] = newrev
359
385
360 if 'qtip' in repo.tags():
386 if 'qtip' in repo.tags():
361 updatemq(repo, state, skipped, **opts)
387 updatemq(repo, state, skipped, **opts)
362
388
363 if currentbookmarks:
389 if currentbookmarks:
364 # Nodeids are needed to reset bookmarks
390 # Nodeids are needed to reset bookmarks
365 nstate = {}
391 nstate = {}
366 for k, v in state.iteritems():
392 for k, v in state.iteritems():
367 if v > nullmerge:
393 if v > nullmerge:
368 nstate[repo[k].node()] = repo[v].node()
394 nstate[repo[k].node()] = repo[v].node()
369 # XXX this is the same as dest.node() for the non-continue path --
395 # XXX this is the same as dest.node() for the non-continue path --
370 # this should probably be cleaned up
396 # this should probably be cleaned up
371 targetnode = repo[target].node()
397 targetnode = repo[target].node()
372
398
373 # restore original working directory
399 # restore original working directory
374 # (we do this before stripping)
400 # (we do this before stripping)
375 newwd = state.get(originalwd, originalwd)
401 newwd = state.get(originalwd, originalwd)
376 if newwd not in [c.rev() for c in repo[None].parents()]:
402 if newwd not in [c.rev() for c in repo[None].parents()]:
377 ui.note(_("update back to initial working directory parent\n"))
403 ui.note(_("update back to initial working directory parent\n"))
378 hg.updaterepo(repo, newwd, False)
404 hg.updaterepo(repo, newwd, False)
379
405
380 if not keepf:
406 if not keepf:
381 collapsedas = None
407 collapsedas = None
382 if collapsef:
408 if collapsef:
383 collapsedas = newrev
409 collapsedas = newrev
384 clearrebased(ui, repo, state, skipped, collapsedas)
410 clearrebased(ui, repo, state, skipped, collapsedas)
385
411
386 if currentbookmarks:
412 if currentbookmarks:
387 updatebookmarks(repo, targetnode, nstate, currentbookmarks)
413 updatebookmarks(repo, targetnode, nstate, currentbookmarks)
388
414
389 clearstatus(repo)
415 clearstatus(repo)
390 ui.note(_("rebase completed\n"))
416 ui.note(_("rebase completed\n"))
391 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
417 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
392 if skipped:
418 if skipped:
393 ui.note(_("%d revisions have been skipped\n") % len(skipped))
419 ui.note(_("%d revisions have been skipped\n") % len(skipped))
394
420
395 if (activebookmark and
421 if (activebookmark and
396 repo['.'].node() == repo._bookmarks[activebookmark]):
422 repo['.'].node() == repo._bookmarks[activebookmark]):
397 bookmarks.setcurrent(repo, activebookmark)
423 bookmarks.setcurrent(repo, activebookmark)
398
424
399 finally:
425 finally:
400 release(lock, wlock)
426 release(lock, wlock)
401
427
402 def externalparent(repo, state, targetancestors):
428 def externalparent(repo, state, targetancestors):
403 """Return the revision that should be used as the second parent
429 """Return the revision that should be used as the second parent
404 when the revisions in state is collapsed on top of targetancestors.
430 when the revisions in state is collapsed on top of targetancestors.
405 Abort if there is more than one parent.
431 Abort if there is more than one parent.
406 """
432 """
407 parents = set()
433 parents = set()
408 source = min(state)
434 source = min(state)
409 for rev in state:
435 for rev in state:
410 if rev == source:
436 if rev == source:
411 continue
437 continue
412 for p in repo[rev].parents():
438 for p in repo[rev].parents():
413 if (p.rev() not in state
439 if (p.rev() not in state
414 and p.rev() not in targetancestors):
440 and p.rev() not in targetancestors):
415 parents.add(p.rev())
441 parents.add(p.rev())
416 if not parents:
442 if not parents:
417 return nullrev
443 return nullrev
418 if len(parents) == 1:
444 if len(parents) == 1:
419 return parents.pop()
445 return parents.pop()
420 raise util.Abort(_('unable to collapse on top of %s, there is more '
446 raise util.Abort(_('unable to collapse on top of %s, there is more '
421 'than one external parent: %s') %
447 'than one external parent: %s') %
422 (max(targetancestors),
448 (max(targetancestors),
423 ', '.join(str(p) for p in sorted(parents))))
449 ', '.join(str(p) for p in sorted(parents))))
424
450
425 def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None):
451 def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None):
426 'Commit the changes and store useful information in extra'
452 'Commit the changes and store useful information in extra'
427 try:
453 try:
428 repo.setparents(repo[p1].node(), repo[p2].node())
454 repo.setparents(repo[p1].node(), repo[p2].node())
429 ctx = repo[rev]
455 ctx = repo[rev]
430 if commitmsg is None:
456 if commitmsg is None:
431 commitmsg = ctx.description()
457 commitmsg = ctx.description()
432 extra = {'rebase_source': ctx.hex()}
458 extra = {'rebase_source': ctx.hex()}
433 if extrafn:
459 if extrafn:
434 extrafn(ctx, extra)
460 extrafn(ctx, extra)
435 # Commit might fail if unresolved files exist
461 # Commit might fail if unresolved files exist
436 newrev = repo.commit(text=commitmsg, user=ctx.user(),
462 newrev = repo.commit(text=commitmsg, user=ctx.user(),
437 date=ctx.date(), extra=extra, editor=editor)
463 date=ctx.date(), extra=extra, editor=editor)
438 repo.dirstate.setbranch(repo[newrev].branch())
464 repo.dirstate.setbranch(repo[newrev].branch())
439 targetphase = max(ctx.phase(), phases.draft)
465 targetphase = max(ctx.phase(), phases.draft)
440 # retractboundary doesn't overwrite upper phase inherited from parent
466 # retractboundary doesn't overwrite upper phase inherited from parent
441 newnode = repo[newrev].node()
467 newnode = repo[newrev].node()
442 if newnode:
468 if newnode:
443 phases.retractboundary(repo, targetphase, [newnode])
469 phases.retractboundary(repo, targetphase, [newnode])
444 return newrev
470 return newrev
445 except util.Abort:
471 except util.Abort:
446 # Invalidate the previous setparents
472 # Invalidate the previous setparents
447 repo.dirstate.invalidate()
473 repo.dirstate.invalidate()
448 raise
474 raise
449
475
450 def rebasenode(repo, rev, p1, state, collapse):
476 def rebasenode(repo, rev, p1, state, collapse):
451 'Rebase a single revision'
477 'Rebase a single revision'
452 # Merge phase
478 # Merge phase
453 # Update to target and merge it with local
479 # Update to target and merge it with local
454 if repo['.'].rev() != repo[p1].rev():
480 if repo['.'].rev() != repo[p1].rev():
455 repo.ui.debug(" update to %d:%s\n" % (repo[p1].rev(), repo[p1]))
481 repo.ui.debug(" update to %d:%s\n" % (repo[p1].rev(), repo[p1]))
456 merge.update(repo, p1, False, True, False)
482 merge.update(repo, p1, False, True, False)
457 else:
483 else:
458 repo.ui.debug(" already in target\n")
484 repo.ui.debug(" already in target\n")
459 repo.dirstate.write()
485 repo.dirstate.write()
460 repo.ui.debug(" merge against %d:%s\n" % (repo[rev].rev(), repo[rev]))
486 repo.ui.debug(" merge against %d:%s\n" % (repo[rev].rev(), repo[rev]))
461 if repo[rev].rev() == repo[min(state)].rev():
487 if repo[rev].rev() == repo[min(state)].rev():
462 # Case (1) initial changeset of a non-detaching rebase.
488 # Case (1) initial changeset of a non-detaching rebase.
463 # Let the merge mechanism find the base itself.
489 # Let the merge mechanism find the base itself.
464 base = None
490 base = None
465 elif not repo[rev].p2():
491 elif not repo[rev].p2():
466 # Case (2) detaching the node with a single parent, use this parent
492 # Case (2) detaching the node with a single parent, use this parent
467 base = repo[rev].p1().node()
493 base = repo[rev].p1().node()
468 else:
494 else:
469 # In case of merge, we need to pick the right parent as merge base.
495 # In case of merge, we need to pick the right parent as merge base.
470 #
496 #
471 # Imagine we have:
497 # Imagine we have:
472 # - M: currently rebase revision in this step
498 # - M: currently rebase revision in this step
473 # - A: one parent of M
499 # - A: one parent of M
474 # - B: second parent of M
500 # - B: second parent of M
475 # - D: destination of this merge step (p1 var)
501 # - D: destination of this merge step (p1 var)
476 #
502 #
477 # If we are rebasing on D, D is the successors of A or B. The right
503 # If we are rebasing on D, D is the successors of A or B. The right
478 # merge base is the one D succeed to. We pretend it is B for the rest
504 # merge base is the one D succeed to. We pretend it is B for the rest
479 # of this comment
505 # of this comment
480 #
506 #
481 # If we pick B as the base, the merge involves:
507 # If we pick B as the base, the merge involves:
482 # - changes from B to M (actual changeset payload)
508 # - changes from B to M (actual changeset payload)
483 # - changes from B to D (induced by rebase) as D is a rebased
509 # - changes from B to D (induced by rebase) as D is a rebased
484 # version of B)
510 # version of B)
485 # Which exactly represent the rebase operation.
511 # Which exactly represent the rebase operation.
486 #
512 #
487 # If we pick the A as the base, the merge involves
513 # If we pick the A as the base, the merge involves
488 # - changes from A to M (actual changeset payload)
514 # - changes from A to M (actual changeset payload)
489 # - changes from A to D (with include changes between unrelated A and B
515 # - changes from A to D (with include changes between unrelated A and B
490 # plus changes induced by rebase)
516 # plus changes induced by rebase)
491 # Which does not represent anything sensible and creates a lot of
517 # Which does not represent anything sensible and creates a lot of
492 # conflicts.
518 # conflicts.
493 for p in repo[rev].parents():
519 for p in repo[rev].parents():
494 if state.get(p.rev()) == repo[p1].rev():
520 if state.get(p.rev()) == repo[p1].rev():
495 base = p.node()
521 base = p.node()
496 break
522 break
497 if base is not None:
523 if base is not None:
498 repo.ui.debug(" detach base %d:%s\n" % (repo[base].rev(), repo[base]))
524 repo.ui.debug(" detach base %d:%s\n" % (repo[base].rev(), repo[base]))
499 # When collapsing in-place, the parent is the common ancestor, we
525 # When collapsing in-place, the parent is the common ancestor, we
500 # have to allow merging with it.
526 # have to allow merging with it.
501 return merge.update(repo, rev, True, True, False, base, collapse)
527 return merge.update(repo, rev, True, True, False, base, collapse)
502
528
503 def nearestrebased(repo, rev, state):
529 def nearestrebased(repo, rev, state):
504 """return the nearest ancestors of rev in the rebase result"""
530 """return the nearest ancestors of rev in the rebase result"""
505 rebased = [r for r in state if state[r] > nullmerge]
531 rebased = [r for r in state if state[r] > nullmerge]
506 candidates = repo.revs('max(%ld and (::%d))', rebased, rev)
532 candidates = repo.revs('max(%ld and (::%d))', rebased, rev)
507 if candidates:
533 if candidates:
508 return state[candidates[0]]
534 return state[candidates[0]]
509 else:
535 else:
510 return None
536 return None
511
537
512 def defineparents(repo, rev, target, state, targetancestors):
538 def defineparents(repo, rev, target, state, targetancestors):
513 'Return the new parent relationship of the revision that will be rebased'
539 'Return the new parent relationship of the revision that will be rebased'
514 parents = repo[rev].parents()
540 parents = repo[rev].parents()
515 p1 = p2 = nullrev
541 p1 = p2 = nullrev
516
542
517 P1n = parents[0].rev()
543 P1n = parents[0].rev()
518 if P1n in targetancestors:
544 if P1n in targetancestors:
519 p1 = target
545 p1 = target
520 elif P1n in state:
546 elif P1n in state:
521 if state[P1n] == nullmerge:
547 if state[P1n] == nullmerge:
522 p1 = target
548 p1 = target
523 elif state[P1n] == revignored:
549 elif state[P1n] == revignored:
524 p1 = nearestrebased(repo, P1n, state)
550 p1 = nearestrebased(repo, P1n, state)
525 if p1 is None:
551 if p1 is None:
526 p1 = target
552 p1 = target
527 else:
553 else:
528 p1 = state[P1n]
554 p1 = state[P1n]
529 else: # P1n external
555 else: # P1n external
530 p1 = target
556 p1 = target
531 p2 = P1n
557 p2 = P1n
532
558
533 if len(parents) == 2 and parents[1].rev() not in targetancestors:
559 if len(parents) == 2 and parents[1].rev() not in targetancestors:
534 P2n = parents[1].rev()
560 P2n = parents[1].rev()
535 # interesting second parent
561 # interesting second parent
536 if P2n in state:
562 if P2n in state:
537 if p1 == target: # P1n in targetancestors or external
563 if p1 == target: # P1n in targetancestors or external
538 p1 = state[P2n]
564 p1 = state[P2n]
539 elif state[P2n] == revignored:
565 elif state[P2n] == revignored:
540 p2 = nearestrebased(repo, P2n, state)
566 p2 = nearestrebased(repo, P2n, state)
541 if p2 is None:
567 if p2 is None:
542 # no ancestors rebased yet, detach
568 # no ancestors rebased yet, detach
543 p2 = target
569 p2 = target
544 else:
570 else:
545 p2 = state[P2n]
571 p2 = state[P2n]
546 else: # P2n external
572 else: # P2n external
547 if p2 != nullrev: # P1n external too => rev is a merged revision
573 if p2 != nullrev: # P1n external too => rev is a merged revision
548 raise util.Abort(_('cannot use revision %d as base, result '
574 raise util.Abort(_('cannot use revision %d as base, result '
549 'would have 3 parents') % rev)
575 'would have 3 parents') % rev)
550 p2 = P2n
576 p2 = P2n
551 repo.ui.debug(" future parents are %d and %d\n" %
577 repo.ui.debug(" future parents are %d and %d\n" %
552 (repo[p1].rev(), repo[p2].rev()))
578 (repo[p1].rev(), repo[p2].rev()))
553 return p1, p2
579 return p1, p2
554
580
555 def isagitpatch(repo, patchname):
581 def isagitpatch(repo, patchname):
556 'Return true if the given patch is in git format'
582 'Return true if the given patch is in git format'
557 mqpatch = os.path.join(repo.mq.path, patchname)
583 mqpatch = os.path.join(repo.mq.path, patchname)
558 for line in patch.linereader(file(mqpatch, 'rb')):
584 for line in patch.linereader(file(mqpatch, 'rb')):
559 if line.startswith('diff --git'):
585 if line.startswith('diff --git'):
560 return True
586 return True
561 return False
587 return False
562
588
563 def updatemq(repo, state, skipped, **opts):
589 def updatemq(repo, state, skipped, **opts):
564 'Update rebased mq patches - finalize and then import them'
590 'Update rebased mq patches - finalize and then import them'
565 mqrebase = {}
591 mqrebase = {}
566 mq = repo.mq
592 mq = repo.mq
567 original_series = mq.fullseries[:]
593 original_series = mq.fullseries[:]
568 skippedpatches = set()
594 skippedpatches = set()
569
595
570 for p in mq.applied:
596 for p in mq.applied:
571 rev = repo[p.node].rev()
597 rev = repo[p.node].rev()
572 if rev in state:
598 if rev in state:
573 repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' %
599 repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' %
574 (rev, p.name))
600 (rev, p.name))
575 mqrebase[rev] = (p.name, isagitpatch(repo, p.name))
601 mqrebase[rev] = (p.name, isagitpatch(repo, p.name))
576 else:
602 else:
577 # Applied but not rebased, not sure this should happen
603 # Applied but not rebased, not sure this should happen
578 skippedpatches.add(p.name)
604 skippedpatches.add(p.name)
579
605
580 if mqrebase:
606 if mqrebase:
581 mq.finish(repo, mqrebase.keys())
607 mq.finish(repo, mqrebase.keys())
582
608
583 # We must start import from the newest revision
609 # We must start import from the newest revision
584 for rev in sorted(mqrebase, reverse=True):
610 for rev in sorted(mqrebase, reverse=True):
585 if rev not in skipped:
611 if rev not in skipped:
586 name, isgit = mqrebase[rev]
612 name, isgit = mqrebase[rev]
587 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name))
613 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name))
588 mq.qimport(repo, (), patchname=name, git=isgit,
614 mq.qimport(repo, (), patchname=name, git=isgit,
589 rev=[str(state[rev])])
615 rev=[str(state[rev])])
590 else:
616 else:
591 # Rebased and skipped
617 # Rebased and skipped
592 skippedpatches.add(mqrebase[rev][0])
618 skippedpatches.add(mqrebase[rev][0])
593
619
594 # Patches were either applied and rebased and imported in
620 # Patches were either applied and rebased and imported in
595 # order, applied and removed or unapplied. Discard the removed
621 # order, applied and removed or unapplied. Discard the removed
596 # ones while preserving the original series order and guards.
622 # ones while preserving the original series order and guards.
597 newseries = [s for s in original_series
623 newseries = [s for s in original_series
598 if mq.guard_re.split(s, 1)[0] not in skippedpatches]
624 if mq.guard_re.split(s, 1)[0] not in skippedpatches]
599 mq.fullseries[:] = newseries
625 mq.fullseries[:] = newseries
600 mq.seriesdirty = True
626 mq.seriesdirty = True
601 mq.savedirty()
627 mq.savedirty()
602
628
603 def updatebookmarks(repo, targetnode, nstate, originalbookmarks):
629 def updatebookmarks(repo, targetnode, nstate, originalbookmarks):
604 'Move bookmarks to their correct changesets, and delete divergent ones'
630 'Move bookmarks to their correct changesets, and delete divergent ones'
605 marks = repo._bookmarks
631 marks = repo._bookmarks
606 for k, v in originalbookmarks.iteritems():
632 for k, v in originalbookmarks.iteritems():
607 if v in nstate:
633 if v in nstate:
608 # update the bookmarks for revs that have moved
634 # update the bookmarks for revs that have moved
609 marks[k] = nstate[v]
635 marks[k] = nstate[v]
610 bookmarks.deletedivergent(repo, [targetnode], k)
636 bookmarks.deletedivergent(repo, [targetnode], k)
611
637
612 marks.write()
638 marks.write()
613
639
614 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
640 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
615 external, activebookmark):
641 external, activebookmark):
616 'Store the current status to allow recovery'
642 'Store the current status to allow recovery'
617 f = repo.opener("rebasestate", "w")
643 f = repo.opener("rebasestate", "w")
618 f.write(repo[originalwd].hex() + '\n')
644 f.write(repo[originalwd].hex() + '\n')
619 f.write(repo[target].hex() + '\n')
645 f.write(repo[target].hex() + '\n')
620 f.write(repo[external].hex() + '\n')
646 f.write(repo[external].hex() + '\n')
621 f.write('%d\n' % int(collapse))
647 f.write('%d\n' % int(collapse))
622 f.write('%d\n' % int(keep))
648 f.write('%d\n' % int(keep))
623 f.write('%d\n' % int(keepbranches))
649 f.write('%d\n' % int(keepbranches))
624 f.write('%s\n' % (activebookmark or ''))
650 f.write('%s\n' % (activebookmark or ''))
625 for d, v in state.iteritems():
651 for d, v in state.iteritems():
626 oldrev = repo[d].hex()
652 oldrev = repo[d].hex()
627 if v > nullmerge:
653 if v > nullmerge:
628 newrev = repo[v].hex()
654 newrev = repo[v].hex()
629 else:
655 else:
630 newrev = v
656 newrev = v
631 f.write("%s:%s\n" % (oldrev, newrev))
657 f.write("%s:%s\n" % (oldrev, newrev))
632 f.close()
658 f.close()
633 repo.ui.debug('rebase status stored\n')
659 repo.ui.debug('rebase status stored\n')
634
660
635 def clearstatus(repo):
661 def clearstatus(repo):
636 'Remove the status files'
662 'Remove the status files'
637 util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
663 util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
638
664
639 def restorestatus(repo):
665 def restorestatus(repo):
640 'Restore a previously stored status'
666 'Restore a previously stored status'
641 try:
667 try:
642 target = None
668 target = None
643 collapse = False
669 collapse = False
644 external = nullrev
670 external = nullrev
645 activebookmark = None
671 activebookmark = None
646 state = {}
672 state = {}
647 f = repo.opener("rebasestate")
673 f = repo.opener("rebasestate")
648 for i, l in enumerate(f.read().splitlines()):
674 for i, l in enumerate(f.read().splitlines()):
649 if i == 0:
675 if i == 0:
650 originalwd = repo[l].rev()
676 originalwd = repo[l].rev()
651 elif i == 1:
677 elif i == 1:
652 target = repo[l].rev()
678 target = repo[l].rev()
653 elif i == 2:
679 elif i == 2:
654 external = repo[l].rev()
680 external = repo[l].rev()
655 elif i == 3:
681 elif i == 3:
656 collapse = bool(int(l))
682 collapse = bool(int(l))
657 elif i == 4:
683 elif i == 4:
658 keep = bool(int(l))
684 keep = bool(int(l))
659 elif i == 5:
685 elif i == 5:
660 keepbranches = bool(int(l))
686 keepbranches = bool(int(l))
661 elif i == 6 and not (len(l) == 81 and ':' in l):
687 elif i == 6 and not (len(l) == 81 and ':' in l):
662 # line 6 is a recent addition, so for backwards compatibility
688 # line 6 is a recent addition, so for backwards compatibility
663 # check that the line doesn't look like the oldrev:newrev lines
689 # check that the line doesn't look like the oldrev:newrev lines
664 activebookmark = l
690 activebookmark = l
665 else:
691 else:
666 oldrev, newrev = l.split(':')
692 oldrev, newrev = l.split(':')
667 if newrev in (str(nullmerge), str(revignored)):
693 if newrev in (str(nullmerge), str(revignored)):
668 state[repo[oldrev].rev()] = int(newrev)
694 state[repo[oldrev].rev()] = int(newrev)
669 else:
695 else:
670 state[repo[oldrev].rev()] = repo[newrev].rev()
696 state[repo[oldrev].rev()] = repo[newrev].rev()
671 skipped = set()
697 skipped = set()
672 # recompute the set of skipped revs
698 # recompute the set of skipped revs
673 if not collapse:
699 if not collapse:
674 seen = set([target])
700 seen = set([target])
675 for old, new in sorted(state.items()):
701 for old, new in sorted(state.items()):
676 if new != nullrev and new in seen:
702 if new != nullrev and new in seen:
677 skipped.add(old)
703 skipped.add(old)
678 seen.add(new)
704 seen.add(new)
679 repo.ui.debug('computed skipped revs: %s\n' % skipped)
705 repo.ui.debug('computed skipped revs: %s\n' % skipped)
680 repo.ui.debug('rebase status resumed\n')
706 repo.ui.debug('rebase status resumed\n')
681 return (originalwd, target, state, skipped,
707 return (originalwd, target, state, skipped,
682 collapse, keep, keepbranches, external, activebookmark)
708 collapse, keep, keepbranches, external, activebookmark)
683 except IOError, err:
709 except IOError, err:
684 if err.errno != errno.ENOENT:
710 if err.errno != errno.ENOENT:
685 raise
711 raise
686 raise util.Abort(_('no rebase in progress'))
712 raise util.Abort(_('no rebase in progress'))
687
713
688 def inrebase(repo, originalwd, state):
714 def inrebase(repo, originalwd, state):
689 '''check whether the working dir is in an interrupted rebase'''
715 '''check whether the working dir is in an interrupted rebase'''
690 parents = [p.rev() for p in repo.parents()]
716 parents = [p.rev() for p in repo.parents()]
691 if originalwd in parents:
717 if originalwd in parents:
692 return True
718 return True
693
719
694 for newrev in state.itervalues():
720 for newrev in state.itervalues():
695 if newrev in parents:
721 if newrev in parents:
696 return True
722 return True
697
723
698 return False
724 return False
699
725
700 def abort(repo, originalwd, target, state):
726 def abort(repo, originalwd, target, state):
701 'Restore the repository to its original state'
727 'Restore the repository to its original state'
702 dstates = [s for s in state.values() if s > nullrev]
728 dstates = [s for s in state.values() if s > nullrev]
703 immutable = [d for d in dstates if not repo[d].mutable()]
729 immutable = [d for d in dstates if not repo[d].mutable()]
704 cleanup = True
730 cleanup = True
705 if immutable:
731 if immutable:
706 repo.ui.warn(_("warning: can't clean up immutable changesets %s\n")
732 repo.ui.warn(_("warning: can't clean up immutable changesets %s\n")
707 % ', '.join(str(repo[r]) for r in immutable),
733 % ', '.join(str(repo[r]) for r in immutable),
708 hint=_('see hg help phases for details'))
734 hint=_('see hg help phases for details'))
709 cleanup = False
735 cleanup = False
710
736
711 descendants = set()
737 descendants = set()
712 if dstates:
738 if dstates:
713 descendants = set(repo.changelog.descendants(dstates))
739 descendants = set(repo.changelog.descendants(dstates))
714 if descendants - set(dstates):
740 if descendants - set(dstates):
715 repo.ui.warn(_("warning: new changesets detected on target branch, "
741 repo.ui.warn(_("warning: new changesets detected on target branch, "
716 "can't strip\n"))
742 "can't strip\n"))
717 cleanup = False
743 cleanup = False
718
744
719 if cleanup:
745 if cleanup:
720 # Update away from the rebase if necessary
746 # Update away from the rebase if necessary
721 if inrebase(repo, originalwd, state):
747 if inrebase(repo, originalwd, state):
722 merge.update(repo, repo[originalwd].rev(), False, True, False)
748 merge.update(repo, repo[originalwd].rev(), False, True, False)
723
749
724 # Strip from the first rebased revision
750 # Strip from the first rebased revision
725 rebased = filter(lambda x: x > -1 and x != target, state.values())
751 rebased = filter(lambda x: x > -1 and x != target, state.values())
726 if rebased:
752 if rebased:
727 strippoints = [c.node() for c in repo.set('roots(%ld)', rebased)]
753 strippoints = [c.node() for c in repo.set('roots(%ld)', rebased)]
728 # no backup of rebased cset versions needed
754 # no backup of rebased cset versions needed
729 repair.strip(repo.ui, repo, strippoints)
755 repair.strip(repo.ui, repo, strippoints)
730
756
731 clearstatus(repo)
757 clearstatus(repo)
732 repo.ui.warn(_('rebase aborted\n'))
758 repo.ui.warn(_('rebase aborted\n'))
733 return 0
759 return 0
734
760
735 def buildstate(repo, dest, rebaseset, collapse):
761 def buildstate(repo, dest, rebaseset, collapse):
736 '''Define which revisions are going to be rebased and where
762 '''Define which revisions are going to be rebased and where
737
763
738 repo: repo
764 repo: repo
739 dest: context
765 dest: context
740 rebaseset: set of rev
766 rebaseset: set of rev
741 '''
767 '''
742
768
743 # This check isn't strictly necessary, since mq detects commits over an
769 # This check isn't strictly necessary, since mq detects commits over an
744 # applied patch. But it prevents messing up the working directory when
770 # applied patch. But it prevents messing up the working directory when
745 # a partially completed rebase is blocked by mq.
771 # a partially completed rebase is blocked by mq.
746 if 'qtip' in repo.tags() and (dest.node() in
772 if 'qtip' in repo.tags() and (dest.node() in
747 [s.node for s in repo.mq.applied]):
773 [s.node for s in repo.mq.applied]):
748 raise util.Abort(_('cannot rebase onto an applied mq patch'))
774 raise util.Abort(_('cannot rebase onto an applied mq patch'))
749
775
750 roots = list(repo.set('roots(%ld)', rebaseset))
776 roots = list(repo.set('roots(%ld)', rebaseset))
751 if not roots:
777 if not roots:
752 raise util.Abort(_('no matching revisions'))
778 raise util.Abort(_('no matching revisions'))
753 roots.sort()
779 roots.sort()
754 state = {}
780 state = {}
755 detachset = set()
781 detachset = set()
756 for root in roots:
782 for root in roots:
757 commonbase = root.ancestor(dest)
783 commonbase = root.ancestor(dest)
758 if commonbase == root:
784 if commonbase == root:
759 raise util.Abort(_('source is ancestor of destination'))
785 raise util.Abort(_('source is ancestor of destination'))
760 if commonbase == dest:
786 if commonbase == dest:
761 samebranch = root.branch() == dest.branch()
787 samebranch = root.branch() == dest.branch()
762 if not collapse and samebranch and root in dest.children():
788 if not collapse and samebranch and root in dest.children():
763 repo.ui.debug('source is a child of destination\n')
789 repo.ui.debug('source is a child of destination\n')
764 return None
790 return None
765
791
766 repo.ui.debug('rebase onto %d starting from %s\n' % (dest, roots))
792 repo.ui.debug('rebase onto %d starting from %s\n' % (dest, roots))
767 state.update(dict.fromkeys(rebaseset, nullrev))
793 state.update(dict.fromkeys(rebaseset, nullrev))
768 # Rebase tries to turn <dest> into a parent of <root> while
794 # Rebase tries to turn <dest> into a parent of <root> while
769 # preserving the number of parents of rebased changesets:
795 # preserving the number of parents of rebased changesets:
770 #
796 #
771 # - A changeset with a single parent will always be rebased as a
797 # - A changeset with a single parent will always be rebased as a
772 # changeset with a single parent.
798 # changeset with a single parent.
773 #
799 #
774 # - A merge will be rebased as merge unless its parents are both
800 # - A merge will be rebased as merge unless its parents are both
775 # ancestors of <dest> or are themselves in the rebased set and
801 # ancestors of <dest> or are themselves in the rebased set and
776 # pruned while rebased.
802 # pruned while rebased.
777 #
803 #
778 # If one parent of <root> is an ancestor of <dest>, the rebased
804 # If one parent of <root> is an ancestor of <dest>, the rebased
779 # version of this parent will be <dest>. This is always true with
805 # version of this parent will be <dest>. This is always true with
780 # --base option.
806 # --base option.
781 #
807 #
782 # Otherwise, we need to *replace* the original parents with
808 # Otherwise, we need to *replace* the original parents with
783 # <dest>. This "detaches" the rebased set from its former location
809 # <dest>. This "detaches" the rebased set from its former location
784 # and rebases it onto <dest>. Changes introduced by ancestors of
810 # and rebases it onto <dest>. Changes introduced by ancestors of
785 # <root> not common with <dest> (the detachset, marked as
811 # <root> not common with <dest> (the detachset, marked as
786 # nullmerge) are "removed" from the rebased changesets.
812 # nullmerge) are "removed" from the rebased changesets.
787 #
813 #
788 # - If <root> has a single parent, set it to <dest>.
814 # - If <root> has a single parent, set it to <dest>.
789 #
815 #
790 # - If <root> is a merge, we cannot decide which parent to
816 # - If <root> is a merge, we cannot decide which parent to
791 # replace, the rebase operation is not clearly defined.
817 # replace, the rebase operation is not clearly defined.
792 #
818 #
793 # The table below sums up this behavior:
819 # The table below sums up this behavior:
794 #
820 #
795 # +------------------+----------------------+-------------------------+
821 # +------------------+----------------------+-------------------------+
796 # | | one parent | merge |
822 # | | one parent | merge |
797 # +------------------+----------------------+-------------------------+
823 # +------------------+----------------------+-------------------------+
798 # | parent in | new parent is <dest> | parents in ::<dest> are |
824 # | parent in | new parent is <dest> | parents in ::<dest> are |
799 # | ::<dest> | | remapped to <dest> |
825 # | ::<dest> | | remapped to <dest> |
800 # +------------------+----------------------+-------------------------+
826 # +------------------+----------------------+-------------------------+
801 # | unrelated source | new parent is <dest> | ambiguous, abort |
827 # | unrelated source | new parent is <dest> | ambiguous, abort |
802 # +------------------+----------------------+-------------------------+
828 # +------------------+----------------------+-------------------------+
803 #
829 #
804 # The actual abort is handled by `defineparents`
830 # The actual abort is handled by `defineparents`
805 if len(root.parents()) <= 1:
831 if len(root.parents()) <= 1:
806 # ancestors of <root> not ancestors of <dest>
832 # ancestors of <root> not ancestors of <dest>
807 detachset.update(repo.changelog.findmissingrevs([commonbase.rev()],
833 detachset.update(repo.changelog.findmissingrevs([commonbase.rev()],
808 [root.rev()]))
834 [root.rev()]))
809 for r in detachset:
835 for r in detachset:
810 if r not in state:
836 if r not in state:
811 state[r] = nullmerge
837 state[r] = nullmerge
812 if len(roots) > 1:
838 if len(roots) > 1:
813 # If we have multiple roots, we may have "hole" in the rebase set.
839 # If we have multiple roots, we may have "hole" in the rebase set.
814 # Rebase roots that descend from those "hole" should not be detached as
840 # Rebase roots that descend from those "hole" should not be detached as
815 # other root are. We use the special `revignored` to inform rebase that
841 # other root are. We use the special `revignored` to inform rebase that
816 # the revision should be ignored but that `defineparents` should search
842 # the revision should be ignored but that `defineparents` should search
817 # a rebase destination that make sense regarding rebased topology.
843 # a rebase destination that make sense regarding rebased topology.
818 rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset))
844 rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset))
819 for ignored in set(rebasedomain) - set(rebaseset):
845 for ignored in set(rebasedomain) - set(rebaseset):
820 state[ignored] = revignored
846 state[ignored] = revignored
821 return repo['.'].rev(), dest.rev(), state
847 return repo['.'].rev(), dest.rev(), state
822
848
823 def clearrebased(ui, repo, state, skipped, collapsedas=None):
849 def clearrebased(ui, repo, state, skipped, collapsedas=None):
824 """dispose of rebased revision at the end of the rebase
850 """dispose of rebased revision at the end of the rebase
825
851
826 If `collapsedas` is not None, the rebase was a collapse whose result if the
852 If `collapsedas` is not None, the rebase was a collapse whose result if the
827 `collapsedas` node."""
853 `collapsedas` node."""
828 if obsolete._enabled:
854 if obsolete._enabled:
829 markers = []
855 markers = []
830 for rev, newrev in sorted(state.items()):
856 for rev, newrev in sorted(state.items()):
831 if newrev >= 0:
857 if newrev >= 0:
832 if rev in skipped:
858 if rev in skipped:
833 succs = ()
859 succs = ()
834 elif collapsedas is not None:
860 elif collapsedas is not None:
835 succs = (repo[collapsedas],)
861 succs = (repo[collapsedas],)
836 else:
862 else:
837 succs = (repo[newrev],)
863 succs = (repo[newrev],)
838 markers.append((repo[rev], succs))
864 markers.append((repo[rev], succs))
839 if markers:
865 if markers:
840 obsolete.createmarkers(repo, markers)
866 obsolete.createmarkers(repo, markers)
841 else:
867 else:
842 rebased = [rev for rev in state if state[rev] > nullmerge]
868 rebased = [rev for rev in state if state[rev] > nullmerge]
843 if rebased:
869 if rebased:
844 stripped = []
870 stripped = []
845 for root in repo.set('roots(%ld)', rebased):
871 for root in repo.set('roots(%ld)', rebased):
846 if set(repo.changelog.descendants([root.rev()])) - set(state):
872 if set(repo.changelog.descendants([root.rev()])) - set(state):
847 ui.warn(_("warning: new changesets detected "
873 ui.warn(_("warning: new changesets detected "
848 "on source branch, not stripping\n"))
874 "on source branch, not stripping\n"))
849 else:
875 else:
850 stripped.append(root.node())
876 stripped.append(root.node())
851 if stripped:
877 if stripped:
852 # backup the old csets by default
878 # backup the old csets by default
853 repair.strip(ui, repo, stripped, "all")
879 repair.strip(ui, repo, stripped, "all")
854
880
855
881
856 def pullrebase(orig, ui, repo, *args, **opts):
882 def pullrebase(orig, ui, repo, *args, **opts):
857 'Call rebase after pull if the latter has been invoked with --rebase'
883 'Call rebase after pull if the latter has been invoked with --rebase'
858 if opts.get('rebase'):
884 if opts.get('rebase'):
859 if opts.get('update'):
885 if opts.get('update'):
860 del opts['update']
886 del opts['update']
861 ui.debug('--update and --rebase are not compatible, ignoring '
887 ui.debug('--update and --rebase are not compatible, ignoring '
862 'the update flag\n')
888 'the update flag\n')
863
889
864 movemarkfrom = repo['.'].node()
890 movemarkfrom = repo['.'].node()
865 revsprepull = len(repo)
891 revsprepull = len(repo)
866 origpostincoming = commands.postincoming
892 origpostincoming = commands.postincoming
867 def _dummy(*args, **kwargs):
893 def _dummy(*args, **kwargs):
868 pass
894 pass
869 commands.postincoming = _dummy
895 commands.postincoming = _dummy
870 try:
896 try:
871 orig(ui, repo, *args, **opts)
897 orig(ui, repo, *args, **opts)
872 finally:
898 finally:
873 commands.postincoming = origpostincoming
899 commands.postincoming = origpostincoming
874 revspostpull = len(repo)
900 revspostpull = len(repo)
875 if revspostpull > revsprepull:
901 if revspostpull > revsprepull:
876 # --rev option from pull conflict with rebase own --rev
902 # --rev option from pull conflict with rebase own --rev
877 # dropping it
903 # dropping it
878 if 'rev' in opts:
904 if 'rev' in opts:
879 del opts['rev']
905 del opts['rev']
880 rebase(ui, repo, **opts)
906 rebase(ui, repo, **opts)
881 branch = repo[None].branch()
907 branch = repo[None].branch()
882 dest = repo[branch].rev()
908 dest = repo[branch].rev()
883 if dest != repo['.'].rev():
909 if dest != repo['.'].rev():
884 # there was nothing to rebase we force an update
910 # there was nothing to rebase we force an update
885 hg.update(repo, dest)
911 hg.update(repo, dest)
886 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
912 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
887 ui.status(_("updating bookmark %s\n")
913 ui.status(_("updating bookmark %s\n")
888 % repo._bookmarkcurrent)
914 % repo._bookmarkcurrent)
889 else:
915 else:
890 if opts.get('tool'):
916 if opts.get('tool'):
891 raise util.Abort(_('--tool can only be used with --rebase'))
917 raise util.Abort(_('--tool can only be used with --rebase'))
892 orig(ui, repo, *args, **opts)
918 orig(ui, repo, *args, **opts)
893
919
894 def summaryhook(ui, repo):
920 def summaryhook(ui, repo):
895 if not os.path.exists(repo.join('rebasestate')):
921 if not os.path.exists(repo.join('rebasestate')):
896 return
922 return
897 try:
923 try:
898 state = restorestatus(repo)[2]
924 state = restorestatus(repo)[2]
899 except error.RepoLookupError:
925 except error.RepoLookupError:
900 # i18n: column positioning for "hg summary"
926 # i18n: column positioning for "hg summary"
901 msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n')
927 msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n')
902 ui.write(msg)
928 ui.write(msg)
903 return
929 return
904 numrebased = len([i for i in state.itervalues() if i != -1])
930 numrebased = len([i for i in state.itervalues() if i != -1])
905 # i18n: column positioning for "hg summary"
931 # i18n: column positioning for "hg summary"
906 ui.write(_('rebase: %s, %s (rebase --continue)\n') %
932 ui.write(_('rebase: %s, %s (rebase --continue)\n') %
907 (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased,
933 (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased,
908 ui.label(_('%d remaining'), 'rebase.remaining') %
934 ui.label(_('%d remaining'), 'rebase.remaining') %
909 (len(state) - numrebased)))
935 (len(state) - numrebased)))
910
936
911 def uisetup(ui):
937 def uisetup(ui):
912 'Replace pull with a decorator to provide --rebase option'
938 'Replace pull with a decorator to provide --rebase option'
913 entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
939 entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
914 entry[1].append(('', 'rebase', None,
940 entry[1].append(('', 'rebase', None,
915 _("rebase working directory to branch head")))
941 _("rebase working directory to branch head")))
916 entry[1].append(('t', 'tool', '',
942 entry[1].append(('t', 'tool', '',
917 _("specify merge tool for rebase")))
943 _("specify merge tool for rebase")))
918 cmdutil.summaryhooks.add('rebase', summaryhook)
944 cmdutil.summaryhooks.add('rebase', summaryhook)
919 cmdutil.unfinishedstates.append(
945 cmdutil.unfinishedstates.append(
920 ['rebasestate', False, False, _('rebase in progress'),
946 ['rebasestate', False, False, _('rebase in progress'),
921 _("use 'hg rebase --continue' or 'hg rebase --abort'")])
947 _("use 'hg rebase --continue' or 'hg rebase --abort'")])
@@ -1,2287 +1,2287 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 > [largefiles]
11 > [largefiles]
12 > minsize=2
12 > minsize=2
13 > patterns=glob:**.dat
13 > patterns=glob:**.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > [hooks]
15 > [hooks]
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
17 > EOF
17 > EOF
18
18
19 Create the repo with a couple of revisions of both large and normal
19 Create the repo with a couple of revisions of both large and normal
20 files.
20 files.
21 Test status and dirstate of largefiles and that summary output is correct.
21 Test status and dirstate of largefiles and that summary output is correct.
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ mkdir sub
25 $ mkdir sub
26 $ echo normal1 > normal1
26 $ echo normal1 > normal1
27 $ echo normal2 > sub/normal2
27 $ echo normal2 > sub/normal2
28 $ echo large1 > large1
28 $ echo large1 > large1
29 $ echo large2 > sub/large2
29 $ echo large2 > sub/large2
30 $ hg add normal1 sub/normal2
30 $ hg add normal1 sub/normal2
31 $ hg add --large large1 sub/large2
31 $ hg add --large large1 sub/large2
32 $ hg commit -m "add files"
32 $ hg commit -m "add files"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A large1
34 A large1
35 A normal1
35 A normal1
36 A sub/large2
36 A sub/large2
37 A sub/normal2
37 A sub/normal2
38 $ touch large1 sub/large2
38 $ touch large1 sub/large2
39 $ sleep 1
39 $ sleep 1
40 $ hg st
40 $ hg st
41 $ hg debugstate --nodates
41 $ hg debugstate --nodates
42 n 644 41 .hglf/large1
42 n 644 41 .hglf/large1
43 n 644 41 .hglf/sub/large2
43 n 644 41 .hglf/sub/large2
44 n 644 8 normal1
44 n 644 8 normal1
45 n 644 8 sub/normal2
45 n 644 8 sub/normal2
46 $ hg debugstate --large
46 $ hg debugstate --large
47 n 644 7 large1
47 n 644 7 large1
48 n 644 7 sub/large2
48 n 644 7 sub/large2
49 $ echo normal11 > normal1
49 $ echo normal11 > normal1
50 $ echo normal22 > sub/normal2
50 $ echo normal22 > sub/normal2
51 $ echo large11 > large1
51 $ echo large11 > large1
52 $ echo large22 > sub/large2
52 $ echo large22 > sub/large2
53 $ hg commit -m "edit files"
53 $ hg commit -m "edit files"
54 Invoking status precommit hook
54 Invoking status precommit hook
55 M large1
55 M large1
56 M normal1
56 M normal1
57 M sub/large2
57 M sub/large2
58 M sub/normal2
58 M sub/normal2
59 $ hg sum --large
59 $ hg sum --large
60 parent: 1:ce8896473775 tip
60 parent: 1:ce8896473775 tip
61 edit files
61 edit files
62 branch: default
62 branch: default
63 commit: (clean)
63 commit: (clean)
64 update: (current)
64 update: (current)
65 largefiles: (no remote repo)
65 largefiles: (no remote repo)
66
66
67 Commit preserved largefile contents.
67 Commit preserved largefile contents.
68
68
69 $ cat normal1
69 $ cat normal1
70 normal11
70 normal11
71 $ cat large1
71 $ cat large1
72 large11
72 large11
73 $ cat sub/normal2
73 $ cat sub/normal2
74 normal22
74 normal22
75 $ cat sub/large2
75 $ cat sub/large2
76 large22
76 large22
77
77
78 Test status, subdir and unknown files
78 Test status, subdir and unknown files
79
79
80 $ echo unknown > sub/unknown
80 $ echo unknown > sub/unknown
81 $ hg st --all
81 $ hg st --all
82 ? sub/unknown
82 ? sub/unknown
83 C large1
83 C large1
84 C normal1
84 C normal1
85 C sub/large2
85 C sub/large2
86 C sub/normal2
86 C sub/normal2
87 $ hg st --all sub
87 $ hg st --all sub
88 ? sub/unknown
88 ? sub/unknown
89 C sub/large2
89 C sub/large2
90 C sub/normal2
90 C sub/normal2
91 $ rm sub/unknown
91 $ rm sub/unknown
92
92
93 Test messages and exit codes for remove warning cases
93 Test messages and exit codes for remove warning cases
94
94
95 $ hg remove -A large1
95 $ hg remove -A large1
96 not removing large1: file still exists
96 not removing large1: file still exists
97 [1]
97 [1]
98 $ echo 'modified' > large1
98 $ echo 'modified' > large1
99 $ hg remove large1
99 $ hg remove large1
100 not removing large1: file is modified (use -f to force removal)
100 not removing large1: file is modified (use -f to force removal)
101 [1]
101 [1]
102 $ echo 'new' > normalnew
102 $ echo 'new' > normalnew
103 $ hg add normalnew
103 $ hg add normalnew
104 $ echo 'new' > largenew
104 $ echo 'new' > largenew
105 $ hg add --large normalnew
105 $ hg add --large normalnew
106 normalnew already tracked!
106 normalnew already tracked!
107 $ hg remove normalnew largenew
107 $ hg remove normalnew largenew
108 not removing largenew: file is untracked
108 not removing largenew: file is untracked
109 not removing normalnew: file has been marked for add (use forget to undo)
109 not removing normalnew: file has been marked for add (use forget to undo)
110 [1]
110 [1]
111 $ rm normalnew largenew
111 $ rm normalnew largenew
112 $ hg up -Cq
112 $ hg up -Cq
113
113
114 Remove both largefiles and normal files.
114 Remove both largefiles and normal files.
115
115
116 $ hg remove normal1 large1
116 $ hg remove normal1 large1
117 $ hg status large1
117 $ hg status large1
118 R large1
118 R large1
119 $ hg commit -m "remove files"
119 $ hg commit -m "remove files"
120 Invoking status precommit hook
120 Invoking status precommit hook
121 R large1
121 R large1
122 R normal1
122 R normal1
123 $ ls
123 $ ls
124 sub
124 sub
125 $ echo "testlargefile" > large1-test
125 $ echo "testlargefile" > large1-test
126 $ hg add --large large1-test
126 $ hg add --large large1-test
127 $ hg st
127 $ hg st
128 A large1-test
128 A large1-test
129 $ hg rm large1-test
129 $ hg rm large1-test
130 not removing large1-test: file has been marked for add (use forget to undo)
130 not removing large1-test: file has been marked for add (use forget to undo)
131 [1]
131 [1]
132 $ hg st
132 $ hg st
133 A large1-test
133 A large1-test
134 $ hg forget large1-test
134 $ hg forget large1-test
135 $ hg st
135 $ hg st
136 ? large1-test
136 ? large1-test
137 $ hg remove large1-test
137 $ hg remove large1-test
138 not removing large1-test: file is untracked
138 not removing large1-test: file is untracked
139 [1]
139 [1]
140 $ hg forget large1-test
140 $ hg forget large1-test
141 not removing large1-test: file is already untracked
141 not removing large1-test: file is already untracked
142 [1]
142 [1]
143 $ rm large1-test
143 $ rm large1-test
144
144
145 Copy both largefiles and normal files (testing that status output is correct).
145 Copy both largefiles and normal files (testing that status output is correct).
146
146
147 $ hg cp sub/normal2 normal1
147 $ hg cp sub/normal2 normal1
148 $ hg cp sub/large2 large1
148 $ hg cp sub/large2 large1
149 $ hg commit -m "copy files"
149 $ hg commit -m "copy files"
150 Invoking status precommit hook
150 Invoking status precommit hook
151 A large1
151 A large1
152 A normal1
152 A normal1
153 $ cat normal1
153 $ cat normal1
154 normal22
154 normal22
155 $ cat large1
155 $ cat large1
156 large22
156 large22
157
157
158 Test moving largefiles and verify that normal files are also unaffected.
158 Test moving largefiles and verify that normal files are also unaffected.
159
159
160 $ hg mv normal1 normal3
160 $ hg mv normal1 normal3
161 $ hg mv large1 large3
161 $ hg mv large1 large3
162 $ hg mv sub/normal2 sub/normal4
162 $ hg mv sub/normal2 sub/normal4
163 $ hg mv sub/large2 sub/large4
163 $ hg mv sub/large2 sub/large4
164 $ hg commit -m "move files"
164 $ hg commit -m "move files"
165 Invoking status precommit hook
165 Invoking status precommit hook
166 A large3
166 A large3
167 A normal3
167 A normal3
168 A sub/large4
168 A sub/large4
169 A sub/normal4
169 A sub/normal4
170 R large1
170 R large1
171 R normal1
171 R normal1
172 R sub/large2
172 R sub/large2
173 R sub/normal2
173 R sub/normal2
174 $ cat normal3
174 $ cat normal3
175 normal22
175 normal22
176 $ cat large3
176 $ cat large3
177 large22
177 large22
178 $ cat sub/normal4
178 $ cat sub/normal4
179 normal22
179 normal22
180 $ cat sub/large4
180 $ cat sub/large4
181 large22
181 large22
182
182
183 Test copies and moves from a directory other than root (issue3516)
183 Test copies and moves from a directory other than root (issue3516)
184
184
185 $ cd ..
185 $ cd ..
186 $ hg init lf_cpmv
186 $ hg init lf_cpmv
187 $ cd lf_cpmv
187 $ cd lf_cpmv
188 $ mkdir dira
188 $ mkdir dira
189 $ mkdir dira/dirb
189 $ mkdir dira/dirb
190 $ touch dira/dirb/largefile
190 $ touch dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
192 $ hg commit -m "added"
192 $ hg commit -m "added"
193 Invoking status precommit hook
193 Invoking status precommit hook
194 A dira/dirb/largefile
194 A dira/dirb/largefile
195 $ cd dira
195 $ cd dira
196 $ hg cp dirb/largefile foo/largefile
196 $ hg cp dirb/largefile foo/largefile
197 $ hg ci -m "deep copy"
197 $ hg ci -m "deep copy"
198 Invoking status precommit hook
198 Invoking status precommit hook
199 A dira/foo/largefile
199 A dira/foo/largefile
200 $ find . | sort
200 $ find . | sort
201 .
201 .
202 ./dirb
202 ./dirb
203 ./dirb/largefile
203 ./dirb/largefile
204 ./foo
204 ./foo
205 ./foo/largefile
205 ./foo/largefile
206 $ hg mv foo/largefile baz/largefile
206 $ hg mv foo/largefile baz/largefile
207 $ hg ci -m "moved"
207 $ hg ci -m "moved"
208 Invoking status precommit hook
208 Invoking status precommit hook
209 A dira/baz/largefile
209 A dira/baz/largefile
210 R dira/foo/largefile
210 R dira/foo/largefile
211 $ find . | sort
211 $ find . | sort
212 .
212 .
213 ./baz
213 ./baz
214 ./baz/largefile
214 ./baz/largefile
215 ./dirb
215 ./dirb
216 ./dirb/largefile
216 ./dirb/largefile
217 ./foo
217 ./foo
218 $ cd ../../a
218 $ cd ../../a
219
219
220 #if serve
220 #if serve
221 Test display of largefiles in hgweb
221 Test display of largefiles in hgweb
222
222
223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
224 $ cat ../hg.pid >> $DAEMON_PIDS
224 $ cat ../hg.pid >> $DAEMON_PIDS
225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
226 200 Script output follows
226 200 Script output follows
227
227
228
228
229 drwxr-xr-x sub
229 drwxr-xr-x sub
230 -rw-r--r-- 41 large3
230 -rw-r--r-- 41 large3
231 -rw-r--r-- 9 normal3
231 -rw-r--r-- 9 normal3
232
232
233
233
234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
235 200 Script output follows
235 200 Script output follows
236
236
237
237
238 -rw-r--r-- 41 large4
238 -rw-r--r-- 41 large4
239 -rw-r--r-- 9 normal4
239 -rw-r--r-- 9 normal4
240
240
241
241
242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
243 #endif
243 #endif
244
244
245 Test archiving the various revisions. These hit corner cases known with
245 Test archiving the various revisions. These hit corner cases known with
246 archiving.
246 archiving.
247
247
248 $ hg archive -r 0 ../archive0
248 $ hg archive -r 0 ../archive0
249 $ hg archive -r 1 ../archive1
249 $ hg archive -r 1 ../archive1
250 $ hg archive -r 2 ../archive2
250 $ hg archive -r 2 ../archive2
251 $ hg archive -r 3 ../archive3
251 $ hg archive -r 3 ../archive3
252 $ hg archive -r 4 ../archive4
252 $ hg archive -r 4 ../archive4
253 $ cd ../archive0
253 $ cd ../archive0
254 $ cat normal1
254 $ cat normal1
255 normal1
255 normal1
256 $ cat large1
256 $ cat large1
257 large1
257 large1
258 $ cat sub/normal2
258 $ cat sub/normal2
259 normal2
259 normal2
260 $ cat sub/large2
260 $ cat sub/large2
261 large2
261 large2
262 $ cd ../archive1
262 $ cd ../archive1
263 $ cat normal1
263 $ cat normal1
264 normal11
264 normal11
265 $ cat large1
265 $ cat large1
266 large11
266 large11
267 $ cat sub/normal2
267 $ cat sub/normal2
268 normal22
268 normal22
269 $ cat sub/large2
269 $ cat sub/large2
270 large22
270 large22
271 $ cd ../archive2
271 $ cd ../archive2
272 $ ls
272 $ ls
273 sub
273 sub
274 $ cat sub/normal2
274 $ cat sub/normal2
275 normal22
275 normal22
276 $ cat sub/large2
276 $ cat sub/large2
277 large22
277 large22
278 $ cd ../archive3
278 $ cd ../archive3
279 $ cat normal1
279 $ cat normal1
280 normal22
280 normal22
281 $ cat large1
281 $ cat large1
282 large22
282 large22
283 $ cat sub/normal2
283 $ cat sub/normal2
284 normal22
284 normal22
285 $ cat sub/large2
285 $ cat sub/large2
286 large22
286 large22
287 $ cd ../archive4
287 $ cd ../archive4
288 $ cat normal3
288 $ cat normal3
289 normal22
289 normal22
290 $ cat large3
290 $ cat large3
291 large22
291 large22
292 $ cat sub/normal4
292 $ cat sub/normal4
293 normal22
293 normal22
294 $ cat sub/large4
294 $ cat sub/large4
295 large22
295 large22
296
296
297 Commit corner case: specify files to commit.
297 Commit corner case: specify files to commit.
298
298
299 $ cd ../a
299 $ cd ../a
300 $ echo normal3 > normal3
300 $ echo normal3 > normal3
301 $ echo large3 > large3
301 $ echo large3 > large3
302 $ echo normal4 > sub/normal4
302 $ echo normal4 > sub/normal4
303 $ echo large4 > sub/large4
303 $ echo large4 > sub/large4
304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
305 Invoking status precommit hook
305 Invoking status precommit hook
306 M large3
306 M large3
307 M normal3
307 M normal3
308 M sub/large4
308 M sub/large4
309 M sub/normal4
309 M sub/normal4
310 $ cat normal3
310 $ cat normal3
311 normal3
311 normal3
312 $ cat large3
312 $ cat large3
313 large3
313 large3
314 $ cat sub/normal4
314 $ cat sub/normal4
315 normal4
315 normal4
316 $ cat sub/large4
316 $ cat sub/large4
317 large4
317 large4
318
318
319 One more commit corner case: commit from a subdirectory.
319 One more commit corner case: commit from a subdirectory.
320
320
321 $ cd ../a
321 $ cd ../a
322 $ echo normal33 > normal3
322 $ echo normal33 > normal3
323 $ echo large33 > large3
323 $ echo large33 > large3
324 $ echo normal44 > sub/normal4
324 $ echo normal44 > sub/normal4
325 $ echo large44 > sub/large4
325 $ echo large44 > sub/large4
326 $ cd sub
326 $ cd sub
327 $ hg commit -m "edit files yet again"
327 $ hg commit -m "edit files yet again"
328 Invoking status precommit hook
328 Invoking status precommit hook
329 M large3
329 M large3
330 M normal3
330 M normal3
331 M sub/large4
331 M sub/large4
332 M sub/normal4
332 M sub/normal4
333 $ cat ../normal3
333 $ cat ../normal3
334 normal33
334 normal33
335 $ cat ../large3
335 $ cat ../large3
336 large33
336 large33
337 $ cat normal4
337 $ cat normal4
338 normal44
338 normal44
339 $ cat large4
339 $ cat large4
340 large44
340 large44
341
341
342 Committing standins is not allowed.
342 Committing standins is not allowed.
343
343
344 $ cd ..
344 $ cd ..
345 $ echo large3 > large3
345 $ echo large3 > large3
346 $ hg commit .hglf/large3 -m "try to commit standin"
346 $ hg commit .hglf/large3 -m "try to commit standin"
347 abort: file ".hglf/large3" is a largefile standin
347 abort: file ".hglf/large3" is a largefile standin
348 (commit the largefile itself instead)
348 (commit the largefile itself instead)
349 [255]
349 [255]
350
350
351 Corner cases for adding largefiles.
351 Corner cases for adding largefiles.
352
352
353 $ echo large5 > large5
353 $ echo large5 > large5
354 $ hg add --large large5
354 $ hg add --large large5
355 $ hg add --large large5
355 $ hg add --large large5
356 large5 already a largefile
356 large5 already a largefile
357 $ mkdir sub2
357 $ mkdir sub2
358 $ echo large6 > sub2/large6
358 $ echo large6 > sub2/large6
359 $ echo large7 > sub2/large7
359 $ echo large7 > sub2/large7
360 $ hg add --large sub2
360 $ hg add --large sub2
361 adding sub2/large6 as a largefile (glob)
361 adding sub2/large6 as a largefile (glob)
362 adding sub2/large7 as a largefile (glob)
362 adding sub2/large7 as a largefile (glob)
363 $ hg st
363 $ hg st
364 M large3
364 M large3
365 A large5
365 A large5
366 A sub2/large6
366 A sub2/large6
367 A sub2/large7
367 A sub2/large7
368
368
369 Committing directories containing only largefiles.
369 Committing directories containing only largefiles.
370
370
371 $ mkdir -p z/y/x/m
371 $ mkdir -p z/y/x/m
372 $ touch z/y/x/m/large1
372 $ touch z/y/x/m/large1
373 $ touch z/y/x/large2
373 $ touch z/y/x/large2
374 $ hg add --large z/y/x/m/large1 z/y/x/large2
374 $ hg add --large z/y/x/m/large1 z/y/x/large2
375 $ hg commit -m "Subdir with directory only containing largefiles" z
375 $ hg commit -m "Subdir with directory only containing largefiles" z
376 Invoking status precommit hook
376 Invoking status precommit hook
377 M large3
377 M large3
378 A large5
378 A large5
379 A sub2/large6
379 A sub2/large6
380 A sub2/large7
380 A sub2/large7
381 A z/y/x/large2
381 A z/y/x/large2
382 A z/y/x/m/large1
382 A z/y/x/m/large1
383 $ hg rollback --quiet
383 $ hg rollback --quiet
384 $ touch z/y/x/m/normal
384 $ touch z/y/x/m/normal
385 $ hg add z/y/x/m/normal
385 $ hg add z/y/x/m/normal
386 $ hg commit -m "Subdir with mixed contents" z
386 $ hg commit -m "Subdir with mixed contents" z
387 Invoking status precommit hook
387 Invoking status precommit hook
388 M large3
388 M large3
389 A large5
389 A large5
390 A sub2/large6
390 A sub2/large6
391 A sub2/large7
391 A sub2/large7
392 A z/y/x/large2
392 A z/y/x/large2
393 A z/y/x/m/large1
393 A z/y/x/m/large1
394 A z/y/x/m/normal
394 A z/y/x/m/normal
395 $ hg st
395 $ hg st
396 M large3
396 M large3
397 A large5
397 A large5
398 A sub2/large6
398 A sub2/large6
399 A sub2/large7
399 A sub2/large7
400 $ hg rollback --quiet
400 $ hg rollback --quiet
401 $ hg revert z/y/x/large2 z/y/x/m/large1
401 $ hg revert z/y/x/large2 z/y/x/m/large1
402 $ rm z/y/x/large2 z/y/x/m/large1
402 $ rm z/y/x/large2 z/y/x/m/large1
403 $ hg commit -m "Subdir with normal contents" z
403 $ hg commit -m "Subdir with normal contents" z
404 Invoking status precommit hook
404 Invoking status precommit hook
405 M large3
405 M large3
406 A large5
406 A large5
407 A sub2/large6
407 A sub2/large6
408 A sub2/large7
408 A sub2/large7
409 A z/y/x/m/normal
409 A z/y/x/m/normal
410 $ hg st
410 $ hg st
411 M large3
411 M large3
412 A large5
412 A large5
413 A sub2/large6
413 A sub2/large6
414 A sub2/large7
414 A sub2/large7
415 $ hg rollback --quiet
415 $ hg rollback --quiet
416 $ hg revert --quiet z
416 $ hg revert --quiet z
417 $ hg commit -m "Empty subdir" z
417 $ hg commit -m "Empty subdir" z
418 abort: z: no match under directory!
418 abort: z: no match under directory!
419 [255]
419 [255]
420 $ rm -rf z
420 $ rm -rf z
421 $ hg ci -m "standin" .hglf
421 $ hg ci -m "standin" .hglf
422 abort: file ".hglf" is a largefile standin
422 abort: file ".hglf" is a largefile standin
423 (commit the largefile itself instead)
423 (commit the largefile itself instead)
424 [255]
424 [255]
425
425
426 Test "hg status" with combination of 'file pattern' and 'directory
426 Test "hg status" with combination of 'file pattern' and 'directory
427 pattern' for largefiles:
427 pattern' for largefiles:
428
428
429 $ hg status sub2/large6 sub2
429 $ hg status sub2/large6 sub2
430 A sub2/large6
430 A sub2/large6
431 A sub2/large7
431 A sub2/large7
432
432
433 Config settings (pattern **.dat, minsize 2 MB) are respected.
433 Config settings (pattern **.dat, minsize 2 MB) are respected.
434
434
435 $ echo testdata > test.dat
435 $ echo testdata > test.dat
436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
437 $ hg add
437 $ hg add
438 adding reallylarge as a largefile
438 adding reallylarge as a largefile
439 adding test.dat as a largefile
439 adding test.dat as a largefile
440
440
441 Test that minsize and --lfsize handle float values;
441 Test that minsize and --lfsize handle float values;
442 also tests that --lfsize overrides largefiles.minsize.
442 also tests that --lfsize overrides largefiles.minsize.
443 (0.250 MB = 256 kB = 262144 B)
443 (0.250 MB = 256 kB = 262144 B)
444
444
445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
447 $ hg --config largefiles.minsize=.25 add
447 $ hg --config largefiles.minsize=.25 add
448 adding ratherlarge as a largefile
448 adding ratherlarge as a largefile
449 adding medium
449 adding medium
450 $ hg forget medium
450 $ hg forget medium
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
452 adding medium as a largefile
452 adding medium as a largefile
453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
455 adding notlarge
455 adding notlarge
456 $ hg forget notlarge
456 $ hg forget notlarge
457
457
458 Test forget on largefiles.
458 Test forget on largefiles.
459
459
460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
461 $ hg commit -m "add/edit more largefiles"
461 $ hg commit -m "add/edit more largefiles"
462 Invoking status precommit hook
462 Invoking status precommit hook
463 A sub2/large6
463 A sub2/large6
464 A sub2/large7
464 A sub2/large7
465 R large3
465 R large3
466 ? large5
466 ? large5
467 ? medium
467 ? medium
468 ? notlarge
468 ? notlarge
469 ? ratherlarge
469 ? ratherlarge
470 ? reallylarge
470 ? reallylarge
471 ? test.dat
471 ? test.dat
472 $ hg st
472 $ hg st
473 ? large3
473 ? large3
474 ? large5
474 ? large5
475 ? medium
475 ? medium
476 ? notlarge
476 ? notlarge
477 ? ratherlarge
477 ? ratherlarge
478 ? reallylarge
478 ? reallylarge
479 ? test.dat
479 ? test.dat
480
480
481 Purge with largefiles: verify that largefiles are still in the working
481 Purge with largefiles: verify that largefiles are still in the working
482 dir after a purge.
482 dir after a purge.
483
483
484 $ hg purge --all
484 $ hg purge --all
485 $ cat sub/large4
485 $ cat sub/large4
486 large44
486 large44
487 $ cat sub2/large6
487 $ cat sub2/large6
488 large6
488 large6
489 $ cat sub2/large7
489 $ cat sub2/large7
490 large7
490 large7
491
491
492 Test addremove: verify that files that should be added as largfiles are added as
492 Test addremove: verify that files that should be added as largfiles are added as
493 such and that already-existing largfiles are not added as normal files by
493 such and that already-existing largfiles are not added as normal files by
494 accident.
494 accident.
495
495
496 $ rm normal3
496 $ rm normal3
497 $ rm sub/large4
497 $ rm sub/large4
498 $ echo "testing addremove with patterns" > testaddremove.dat
498 $ echo "testing addremove with patterns" > testaddremove.dat
499 $ echo "normaladdremove" > normaladdremove
499 $ echo "normaladdremove" > normaladdremove
500 $ hg addremove
500 $ hg addremove
501 removing sub/large4
501 removing sub/large4
502 adding testaddremove.dat as a largefile
502 adding testaddremove.dat as a largefile
503 removing normal3
503 removing normal3
504 adding normaladdremove
504 adding normaladdremove
505
505
506 Test addremove with -R
506 Test addremove with -R
507
507
508 $ hg up -C
508 $ hg up -C
509 getting changed largefiles
509 getting changed largefiles
510 1 largefiles updated, 0 removed
510 1 largefiles updated, 0 removed
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ rm normal3
512 $ rm normal3
513 $ rm sub/large4
513 $ rm sub/large4
514 $ echo "testing addremove with patterns" > testaddremove.dat
514 $ echo "testing addremove with patterns" > testaddremove.dat
515 $ echo "normaladdremove" > normaladdremove
515 $ echo "normaladdremove" > normaladdremove
516 $ cd ..
516 $ cd ..
517 $ hg -R a addremove
517 $ hg -R a addremove
518 removing sub/large4
518 removing sub/large4
519 adding a/testaddremove.dat as a largefile (glob)
519 adding a/testaddremove.dat as a largefile (glob)
520 removing normal3
520 removing normal3
521 adding normaladdremove
521 adding normaladdremove
522 $ cd a
522 $ cd a
523
523
524 Test 3364
524 Test 3364
525 $ hg clone . ../addrm
525 $ hg clone . ../addrm
526 updating to branch default
526 updating to branch default
527 getting changed largefiles
527 getting changed largefiles
528 3 largefiles updated, 0 removed
528 3 largefiles updated, 0 removed
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 $ cd ../addrm
530 $ cd ../addrm
531 $ cat >> .hg/hgrc <<EOF
531 $ cat >> .hg/hgrc <<EOF
532 > [hooks]
532 > [hooks]
533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
534 > EOF
534 > EOF
535 $ touch foo
535 $ touch foo
536 $ hg add --large foo
536 $ hg add --large foo
537 $ hg ci -m "add foo"
537 $ hg ci -m "add foo"
538 Invoking status precommit hook
538 Invoking status precommit hook
539 A foo
539 A foo
540 Invoking status postcommit hook
540 Invoking status postcommit hook
541 C foo
541 C foo
542 C normal3
542 C normal3
543 C sub/large4
543 C sub/large4
544 C sub/normal4
544 C sub/normal4
545 C sub2/large6
545 C sub2/large6
546 C sub2/large7
546 C sub2/large7
547 $ rm foo
547 $ rm foo
548 $ hg st
548 $ hg st
549 ! foo
549 ! foo
550 hmm.. no precommit invoked, but there is a postcommit??
550 hmm.. no precommit invoked, but there is a postcommit??
551 $ hg ci -m "will not checkin"
551 $ hg ci -m "will not checkin"
552 nothing changed
552 nothing changed
553 Invoking status postcommit hook
553 Invoking status postcommit hook
554 ! foo
554 ! foo
555 C normal3
555 C normal3
556 C sub/large4
556 C sub/large4
557 C sub/normal4
557 C sub/normal4
558 C sub2/large6
558 C sub2/large6
559 C sub2/large7
559 C sub2/large7
560 [1]
560 [1]
561 $ hg addremove
561 $ hg addremove
562 removing foo
562 removing foo
563 $ hg st
563 $ hg st
564 R foo
564 R foo
565 $ hg ci -m "used to say nothing changed"
565 $ hg ci -m "used to say nothing changed"
566 Invoking status precommit hook
566 Invoking status precommit hook
567 R foo
567 R foo
568 Invoking status postcommit hook
568 Invoking status postcommit hook
569 C normal3
569 C normal3
570 C sub/large4
570 C sub/large4
571 C sub/normal4
571 C sub/normal4
572 C sub2/large6
572 C sub2/large6
573 C sub2/large7
573 C sub2/large7
574 $ hg st
574 $ hg st
575
575
576 Test 3507 (both normal files and largefiles were a problem)
576 Test 3507 (both normal files and largefiles were a problem)
577
577
578 $ touch normal
578 $ touch normal
579 $ touch large
579 $ touch large
580 $ hg add normal
580 $ hg add normal
581 $ hg add --large large
581 $ hg add --large large
582 $ hg ci -m "added"
582 $ hg ci -m "added"
583 Invoking status precommit hook
583 Invoking status precommit hook
584 A large
584 A large
585 A normal
585 A normal
586 Invoking status postcommit hook
586 Invoking status postcommit hook
587 C large
587 C large
588 C normal
588 C normal
589 C normal3
589 C normal3
590 C sub/large4
590 C sub/large4
591 C sub/normal4
591 C sub/normal4
592 C sub2/large6
592 C sub2/large6
593 C sub2/large7
593 C sub2/large7
594 $ hg remove normal
594 $ hg remove normal
595 $ hg addremove --traceback
595 $ hg addremove --traceback
596 $ hg ci -m "addremoved normal"
596 $ hg ci -m "addremoved normal"
597 Invoking status precommit hook
597 Invoking status precommit hook
598 R normal
598 R normal
599 Invoking status postcommit hook
599 Invoking status postcommit hook
600 C large
600 C large
601 C normal3
601 C normal3
602 C sub/large4
602 C sub/large4
603 C sub/normal4
603 C sub/normal4
604 C sub2/large6
604 C sub2/large6
605 C sub2/large7
605 C sub2/large7
606 $ hg up -C '.^'
606 $ hg up -C '.^'
607 getting changed largefiles
607 getting changed largefiles
608 0 largefiles updated, 0 removed
608 0 largefiles updated, 0 removed
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 $ hg remove large
610 $ hg remove large
611 $ hg addremove --traceback
611 $ hg addremove --traceback
612 $ hg ci -m "removed large"
612 $ hg ci -m "removed large"
613 Invoking status precommit hook
613 Invoking status precommit hook
614 R large
614 R large
615 created new head
615 created new head
616 Invoking status postcommit hook
616 Invoking status postcommit hook
617 C normal
617 C normal
618 C normal3
618 C normal3
619 C sub/large4
619 C sub/large4
620 C sub/normal4
620 C sub/normal4
621 C sub2/large6
621 C sub2/large6
622 C sub2/large7
622 C sub2/large7
623
623
624 Test commit -A (issue 3542)
624 Test commit -A (issue 3542)
625 $ echo large8 > large8
625 $ echo large8 > large8
626 $ hg add --large large8
626 $ hg add --large large8
627 $ hg ci -Am 'this used to add large8 as normal and commit both'
627 $ hg ci -Am 'this used to add large8 as normal and commit both'
628 Invoking status precommit hook
628 Invoking status precommit hook
629 A large8
629 A large8
630 Invoking status postcommit hook
630 Invoking status postcommit hook
631 C large8
631 C large8
632 C normal
632 C normal
633 C normal3
633 C normal3
634 C sub/large4
634 C sub/large4
635 C sub/normal4
635 C sub/normal4
636 C sub2/large6
636 C sub2/large6
637 C sub2/large7
637 C sub2/large7
638 $ rm large8
638 $ rm large8
639 $ hg ci -Am 'this used to not notice the rm'
639 $ hg ci -Am 'this used to not notice the rm'
640 removing large8
640 removing large8
641 Invoking status precommit hook
641 Invoking status precommit hook
642 R large8
642 R large8
643 Invoking status postcommit hook
643 Invoking status postcommit hook
644 C normal
644 C normal
645 C normal3
645 C normal3
646 C sub/large4
646 C sub/large4
647 C sub/normal4
647 C sub/normal4
648 C sub2/large6
648 C sub2/large6
649 C sub2/large7
649 C sub2/large7
650
650
651 Test that a standin can't be added as a large file
651 Test that a standin can't be added as a large file
652
652
653 $ touch large
653 $ touch large
654 $ hg add --large large
654 $ hg add --large large
655 $ hg ci -m "add"
655 $ hg ci -m "add"
656 Invoking status precommit hook
656 Invoking status precommit hook
657 A large
657 A large
658 Invoking status postcommit hook
658 Invoking status postcommit hook
659 C large
659 C large
660 C normal
660 C normal
661 C normal3
661 C normal3
662 C sub/large4
662 C sub/large4
663 C sub/normal4
663 C sub/normal4
664 C sub2/large6
664 C sub2/large6
665 C sub2/large7
665 C sub2/large7
666 $ hg remove large
666 $ hg remove large
667 $ touch large
667 $ touch large
668 $ hg addremove --config largefiles.patterns=**large --traceback
668 $ hg addremove --config largefiles.patterns=**large --traceback
669 adding large as a largefile
669 adding large as a largefile
670
670
671 Test that outgoing --large works (with revsets too)
671 Test that outgoing --large works (with revsets too)
672 $ hg outgoing --rev '.^' --large
672 $ hg outgoing --rev '.^' --large
673 comparing with $TESTTMP/a (glob)
673 comparing with $TESTTMP/a (glob)
674 searching for changes
674 searching for changes
675 changeset: 8:c02fd3b77ec4
675 changeset: 8:c02fd3b77ec4
676 user: test
676 user: test
677 date: Thu Jan 01 00:00:00 1970 +0000
677 date: Thu Jan 01 00:00:00 1970 +0000
678 summary: add foo
678 summary: add foo
679
679
680 changeset: 9:289dd08c9bbb
680 changeset: 9:289dd08c9bbb
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:00 1970 +0000
682 date: Thu Jan 01 00:00:00 1970 +0000
683 summary: used to say nothing changed
683 summary: used to say nothing changed
684
684
685 changeset: 10:34f23ac6ac12
685 changeset: 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: added
688 summary: added
689
689
690 changeset: 12:710c1b2f523c
690 changeset: 12:710c1b2f523c
691 parent: 10:34f23ac6ac12
691 parent: 10:34f23ac6ac12
692 user: test
692 user: test
693 date: Thu Jan 01 00:00:00 1970 +0000
693 date: Thu Jan 01 00:00:00 1970 +0000
694 summary: removed large
694 summary: removed large
695
695
696 changeset: 13:0a3e75774479
696 changeset: 13:0a3e75774479
697 user: test
697 user: test
698 date: Thu Jan 01 00:00:00 1970 +0000
698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: this used to add large8 as normal and commit both
699 summary: this used to add large8 as normal and commit both
700
700
701 changeset: 14:84f3d378175c
701 changeset: 14:84f3d378175c
702 user: test
702 user: test
703 date: Thu Jan 01 00:00:00 1970 +0000
703 date: Thu Jan 01 00:00:00 1970 +0000
704 summary: this used to not notice the rm
704 summary: this used to not notice the rm
705
705
706 searching for changes
706 searching for changes
707 largefiles to upload:
707 largefiles to upload:
708 foo
708 foo
709 large
709 large
710 large8
710 large8
711
711
712 $ cd ../a
712 $ cd ../a
713
713
714 Clone a largefiles repo.
714 Clone a largefiles repo.
715
715
716 $ hg clone . ../b
716 $ hg clone . ../b
717 updating to branch default
717 updating to branch default
718 getting changed largefiles
718 getting changed largefiles
719 3 largefiles updated, 0 removed
719 3 largefiles updated, 0 removed
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 $ cd ../b
721 $ cd ../b
722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
723 7:daea875e9014 add/edit more largefiles
723 7:daea875e9014 add/edit more largefiles
724 6:4355d653f84f edit files yet again
724 6:4355d653f84f edit files yet again
725 5:9d5af5072dbd edit files again
725 5:9d5af5072dbd edit files again
726 4:74c02385b94c move files
726 4:74c02385b94c move files
727 3:9e8fbc4bce62 copy files
727 3:9e8fbc4bce62 copy files
728 2:51a0ae4d5864 remove files
728 2:51a0ae4d5864 remove files
729 1:ce8896473775 edit files
729 1:ce8896473775 edit files
730 0:30d30fe6a5be add files
730 0:30d30fe6a5be add files
731 $ cat normal3
731 $ cat normal3
732 normal33
732 normal33
733 $ cat sub/normal4
733 $ cat sub/normal4
734 normal44
734 normal44
735 $ cat sub/large4
735 $ cat sub/large4
736 large44
736 large44
737 $ cat sub2/large6
737 $ cat sub2/large6
738 large6
738 large6
739 $ cat sub2/large7
739 $ cat sub2/large7
740 large7
740 large7
741 $ hg log -qf sub2/large7
741 $ hg log -qf sub2/large7
742 7:daea875e9014
742 7:daea875e9014
743 $ cd ..
743 $ cd ..
744 $ hg clone a -r 3 c
744 $ hg clone a -r 3 c
745 adding changesets
745 adding changesets
746 adding manifests
746 adding manifests
747 adding file changes
747 adding file changes
748 added 4 changesets with 10 changes to 4 files
748 added 4 changesets with 10 changes to 4 files
749 updating to branch default
749 updating to branch default
750 getting changed largefiles
750 getting changed largefiles
751 2 largefiles updated, 0 removed
751 2 largefiles updated, 0 removed
752 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
753 $ cd c
753 $ cd c
754 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
754 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
755 3:9e8fbc4bce62 copy files
755 3:9e8fbc4bce62 copy files
756 2:51a0ae4d5864 remove files
756 2:51a0ae4d5864 remove files
757 1:ce8896473775 edit files
757 1:ce8896473775 edit files
758 0:30d30fe6a5be add files
758 0:30d30fe6a5be add files
759 $ cat normal1
759 $ cat normal1
760 normal22
760 normal22
761 $ cat large1
761 $ cat large1
762 large22
762 large22
763 $ cat sub/normal2
763 $ cat sub/normal2
764 normal22
764 normal22
765 $ cat sub/large2
765 $ cat sub/large2
766 large22
766 large22
767
767
768 Old revisions of a clone have correct largefiles content (this also
768 Old revisions of a clone have correct largefiles content (this also
769 tests update).
769 tests update).
770
770
771 $ hg update -r 1
771 $ hg update -r 1
772 getting changed largefiles
772 getting changed largefiles
773 1 largefiles updated, 0 removed
773 1 largefiles updated, 0 removed
774 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 $ cat large1
775 $ cat large1
776 large11
776 large11
777 $ cat sub/large2
777 $ cat sub/large2
778 large22
778 large22
779 $ cd ..
779 $ cd ..
780
780
781 Test cloning with --all-largefiles flag
781 Test cloning with --all-largefiles flag
782
782
783 $ rm "${USERCACHE}"/*
783 $ rm "${USERCACHE}"/*
784 $ hg clone --all-largefiles a a-backup
784 $ hg clone --all-largefiles a a-backup
785 updating to branch default
785 updating to branch default
786 getting changed largefiles
786 getting changed largefiles
787 3 largefiles updated, 0 removed
787 3 largefiles updated, 0 removed
788 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 8 additional largefiles cached
789 8 additional largefiles cached
790
790
791 $ rm "${USERCACHE}"/*
791 $ rm "${USERCACHE}"/*
792 $ hg clone --all-largefiles -u 0 a a-clone0
792 $ hg clone --all-largefiles -u 0 a a-clone0
793 updating to branch default
793 updating to branch default
794 getting changed largefiles
794 getting changed largefiles
795 2 largefiles updated, 0 removed
795 2 largefiles updated, 0 removed
796 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 9 additional largefiles cached
797 9 additional largefiles cached
798 $ hg -R a-clone0 sum
798 $ hg -R a-clone0 sum
799 parent: 0:30d30fe6a5be
799 parent: 0:30d30fe6a5be
800 add files
800 add files
801 branch: default
801 branch: default
802 commit: (clean)
802 commit: (clean)
803 update: 7 new changesets (update)
803 update: 7 new changesets (update)
804
804
805 $ rm "${USERCACHE}"/*
805 $ rm "${USERCACHE}"/*
806 $ hg clone --all-largefiles -u 1 a a-clone1
806 $ hg clone --all-largefiles -u 1 a a-clone1
807 updating to branch default
807 updating to branch default
808 getting changed largefiles
808 getting changed largefiles
809 2 largefiles updated, 0 removed
809 2 largefiles updated, 0 removed
810 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
810 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 8 additional largefiles cached
811 8 additional largefiles cached
812 $ hg -R a-clone1 verify --large --lfa --lfc
812 $ hg -R a-clone1 verify --large --lfa --lfc
813 checking changesets
813 checking changesets
814 checking manifests
814 checking manifests
815 crosschecking files in changesets and manifests
815 crosschecking files in changesets and manifests
816 checking files
816 checking files
817 10 files, 8 changesets, 24 total revisions
817 10 files, 8 changesets, 24 total revisions
818 searching 8 changesets for largefiles
818 searching 8 changesets for largefiles
819 verified contents of 13 revisions of 6 largefiles
819 verified contents of 13 revisions of 6 largefiles
820 $ hg -R a-clone1 sum
820 $ hg -R a-clone1 sum
821 parent: 1:ce8896473775
821 parent: 1:ce8896473775
822 edit files
822 edit files
823 branch: default
823 branch: default
824 commit: (clean)
824 commit: (clean)
825 update: 6 new changesets (update)
825 update: 6 new changesets (update)
826
826
827 $ rm "${USERCACHE}"/*
827 $ rm "${USERCACHE}"/*
828 $ hg clone --all-largefiles -U a a-clone-u
828 $ hg clone --all-largefiles -U a a-clone-u
829 11 additional largefiles cached
829 11 additional largefiles cached
830 $ hg -R a-clone-u sum
830 $ hg -R a-clone-u sum
831 parent: -1:000000000000 (no revision checked out)
831 parent: -1:000000000000 (no revision checked out)
832 branch: default
832 branch: default
833 commit: (clean)
833 commit: (clean)
834 update: 8 new changesets (update)
834 update: 8 new changesets (update)
835
835
836 Show computed destination directory:
836 Show computed destination directory:
837
837
838 $ mkdir xyz
838 $ mkdir xyz
839 $ cd xyz
839 $ cd xyz
840 $ hg clone ../a
840 $ hg clone ../a
841 destination directory: a
841 destination directory: a
842 updating to branch default
842 updating to branch default
843 getting changed largefiles
843 getting changed largefiles
844 3 largefiles updated, 0 removed
844 3 largefiles updated, 0 removed
845 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
846 $ cd ..
846 $ cd ..
847
847
848 Clone URL without path:
848 Clone URL without path:
849
849
850 $ hg clone file://
850 $ hg clone file://
851 abort: repository / not found!
851 abort: repository / not found!
852 [255]
852 [255]
853
853
854 Ensure base clone command argument validation
854 Ensure base clone command argument validation
855
855
856 $ hg clone -U -u 0 a a-clone-failure
856 $ hg clone -U -u 0 a a-clone-failure
857 abort: cannot specify both --noupdate and --updaterev
857 abort: cannot specify both --noupdate and --updaterev
858 [255]
858 [255]
859
859
860 $ hg clone --all-largefiles a ssh://localhost/a
860 $ hg clone --all-largefiles a ssh://localhost/a
861 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
861 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
862 [255]
862 [255]
863
863
864 Test pulling with --all-largefiles flag. Also test that the largefiles are
864 Test pulling with --all-largefiles flag. Also test that the largefiles are
865 downloaded from 'default' instead of 'default-push' when no source is specified
865 downloaded from 'default' instead of 'default-push' when no source is specified
866 (issue3584)
866 (issue3584)
867
867
868 $ rm -Rf a-backup
868 $ rm -Rf a-backup
869 $ hg clone -r 1 a a-backup
869 $ hg clone -r 1 a a-backup
870 adding changesets
870 adding changesets
871 adding manifests
871 adding manifests
872 adding file changes
872 adding file changes
873 added 2 changesets with 8 changes to 4 files
873 added 2 changesets with 8 changes to 4 files
874 updating to branch default
874 updating to branch default
875 getting changed largefiles
875 getting changed largefiles
876 2 largefiles updated, 0 removed
876 2 largefiles updated, 0 removed
877 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
877 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
878 $ rm "${USERCACHE}"/*
878 $ rm "${USERCACHE}"/*
879 $ cd a-backup
879 $ cd a-backup
880 $ hg pull --all-largefiles --config paths.default-push=bogus/path
880 $ hg pull --all-largefiles --config paths.default-push=bogus/path
881 pulling from $TESTTMP/a (glob)
881 pulling from $TESTTMP/a (glob)
882 searching for changes
882 searching for changes
883 adding changesets
883 adding changesets
884 adding manifests
884 adding manifests
885 adding file changes
885 adding file changes
886 added 6 changesets with 16 changes to 8 files
886 added 6 changesets with 16 changes to 8 files
887 (run 'hg update' to get a working copy)
887 (run 'hg update' to get a working copy)
888 6 largefiles cached
888 6 largefiles cached
889
889
890 redo pull with --lfrev and check it pulls largefiles for the right revs
890 redo pull with --lfrev and check it pulls largefiles for the right revs
891
891
892 $ hg rollback
892 $ hg rollback
893 repository tip rolled back to revision 1 (undo pull)
893 repository tip rolled back to revision 1 (undo pull)
894 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
894 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
895 pulling from $TESTTMP/a (glob)
895 pulling from $TESTTMP/a (glob)
896 searching for changes
896 searching for changes
897 all local heads known remotely
897 all local heads known remotely
898 6 changesets found
898 6 changesets found
899 adding changesets
899 adding changesets
900 adding manifests
900 adding manifests
901 adding file changes
901 adding file changes
902 added 6 changesets with 16 changes to 8 files
902 added 6 changesets with 16 changes to 8 files
903 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
903 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
904 (run 'hg update' to get a working copy)
904 (run 'hg update' to get a working copy)
905 pulling largefiles for revision 7
905 pulling largefiles for revision 7
906 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
906 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
907 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
907 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
908 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
908 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
909 pulling largefiles for revision 2
909 pulling largefiles for revision 2
910 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
910 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
911 0 largefiles cached
911 0 largefiles cached
912
912
913 lfpull
913 lfpull
914
914
915 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
915 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
916 2 largefiles cached
916 2 largefiles cached
917 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
917 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
918 pulling largefiles for revision 4
918 pulling largefiles for revision 4
919 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
919 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
920 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
920 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
921 pulling largefiles for revision 2
921 pulling largefiles for revision 2
922 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
922 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
923 0 largefiles cached
923 0 largefiles cached
924
924
925 $ ls usercache-lfpull/* | sort
925 $ ls usercache-lfpull/* | sort
926 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
926 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
927 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
927 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
928
928
929 $ cd ..
929 $ cd ..
930
930
931 Rebasing between two repositories does not revert largefiles to old
931 Rebasing between two repositories does not revert largefiles to old
932 revisions (this was a very bad bug that took a lot of work to fix).
932 revisions (this was a very bad bug that took a lot of work to fix).
933
933
934 $ hg clone a d
934 $ hg clone a d
935 updating to branch default
935 updating to branch default
936 getting changed largefiles
936 getting changed largefiles
937 3 largefiles updated, 0 removed
937 3 largefiles updated, 0 removed
938 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
938 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
939 $ cd b
939 $ cd b
940 $ echo large4-modified > sub/large4
940 $ echo large4-modified > sub/large4
941 $ echo normal3-modified > normal3
941 $ echo normal3-modified > normal3
942 $ hg commit -m "modify normal file and largefile in repo b"
942 $ hg commit -m "modify normal file and largefile in repo b"
943 Invoking status precommit hook
943 Invoking status precommit hook
944 M normal3
944 M normal3
945 M sub/large4
945 M sub/large4
946 $ cd ../d
946 $ cd ../d
947 $ echo large6-modified > sub2/large6
947 $ echo large6-modified > sub2/large6
948 $ echo normal4-modified > sub/normal4
948 $ echo normal4-modified > sub/normal4
949 $ hg commit -m "modify normal file largefile in repo d"
949 $ hg commit -m "modify normal file largefile in repo d"
950 Invoking status precommit hook
950 Invoking status precommit hook
951 M sub/normal4
951 M sub/normal4
952 M sub2/large6
952 M sub2/large6
953 $ cd ..
953 $ cd ..
954 $ hg clone d e
954 $ hg clone d e
955 updating to branch default
955 updating to branch default
956 getting changed largefiles
956 getting changed largefiles
957 3 largefiles updated, 0 removed
957 3 largefiles updated, 0 removed
958 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
958 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
959 $ cd d
959 $ cd d
960
960
961 More rebase testing, but also test that the largefiles are downloaded from
961 More rebase testing, but also test that the largefiles are downloaded from
962 'default-push' when no source is specified (issue3584). (The largefile from the
962 'default-push' when no source is specified (issue3584). (The largefile from the
963 pulled revision is however not downloaded but found in the local cache.)
963 pulled revision is however not downloaded but found in the local cache.)
964 Largefiles are fetched for the new pulled revision, not for existing revisions,
964 Largefiles are fetched for the new pulled revision, not for existing revisions,
965 rebased or not.
965 rebased or not.
966
966
967 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
967 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
968 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
968 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
969 pulling from $TESTTMP/b (glob)
969 pulling from $TESTTMP/b (glob)
970 searching for changes
970 searching for changes
971 adding changesets
971 adding changesets
972 adding manifests
972 adding manifests
973 adding file changes
973 adding file changes
974 added 1 changesets with 2 changes to 2 files (+1 heads)
974 added 1 changesets with 2 changes to 2 files (+1 heads)
975 Invoking status precommit hook
975 Invoking status precommit hook
976 M sub/normal4
976 M sub/normal4
977 M sub2/large6
977 M sub2/large6
978 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
978 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
979 0 largefiles cached
979 0 largefiles cached
980 nothing to rebase
980 nothing to rebase - working directory parent is also destination
981 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
981 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
982 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
982 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
983 9:598410d3eb9a modify normal file largefile in repo d
983 9:598410d3eb9a modify normal file largefile in repo d
984 8:a381d2c8c80e modify normal file and largefile in repo b
984 8:a381d2c8c80e modify normal file and largefile in repo b
985 7:daea875e9014 add/edit more largefiles
985 7:daea875e9014 add/edit more largefiles
986 6:4355d653f84f edit files yet again
986 6:4355d653f84f edit files yet again
987 5:9d5af5072dbd edit files again
987 5:9d5af5072dbd edit files again
988 4:74c02385b94c move files
988 4:74c02385b94c move files
989 3:9e8fbc4bce62 copy files
989 3:9e8fbc4bce62 copy files
990 2:51a0ae4d5864 remove files
990 2:51a0ae4d5864 remove files
991 1:ce8896473775 edit files
991 1:ce8896473775 edit files
992 0:30d30fe6a5be add files
992 0:30d30fe6a5be add files
993 $ cat normal3
993 $ cat normal3
994 normal3-modified
994 normal3-modified
995 $ cat sub/normal4
995 $ cat sub/normal4
996 normal4-modified
996 normal4-modified
997 $ cat sub/large4
997 $ cat sub/large4
998 large4-modified
998 large4-modified
999 $ cat sub2/large6
999 $ cat sub2/large6
1000 large6-modified
1000 large6-modified
1001 $ cat sub2/large7
1001 $ cat sub2/large7
1002 large7
1002 large7
1003 $ cd ../e
1003 $ cd ../e
1004 $ hg pull ../b
1004 $ hg pull ../b
1005 pulling from ../b
1005 pulling from ../b
1006 searching for changes
1006 searching for changes
1007 adding changesets
1007 adding changesets
1008 adding manifests
1008 adding manifests
1009 adding file changes
1009 adding file changes
1010 added 1 changesets with 2 changes to 2 files (+1 heads)
1010 added 1 changesets with 2 changes to 2 files (+1 heads)
1011 (run 'hg heads' to see heads, 'hg merge' to merge)
1011 (run 'hg heads' to see heads, 'hg merge' to merge)
1012 $ hg rebase
1012 $ hg rebase
1013 Invoking status precommit hook
1013 Invoking status precommit hook
1014 M sub/normal4
1014 M sub/normal4
1015 M sub2/large6
1015 M sub2/large6
1016 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1016 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1017 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1017 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1018 9:598410d3eb9a modify normal file largefile in repo d
1018 9:598410d3eb9a modify normal file largefile in repo d
1019 8:a381d2c8c80e modify normal file and largefile in repo b
1019 8:a381d2c8c80e modify normal file and largefile in repo b
1020 7:daea875e9014 add/edit more largefiles
1020 7:daea875e9014 add/edit more largefiles
1021 6:4355d653f84f edit files yet again
1021 6:4355d653f84f edit files yet again
1022 5:9d5af5072dbd edit files again
1022 5:9d5af5072dbd edit files again
1023 4:74c02385b94c move files
1023 4:74c02385b94c move files
1024 3:9e8fbc4bce62 copy files
1024 3:9e8fbc4bce62 copy files
1025 2:51a0ae4d5864 remove files
1025 2:51a0ae4d5864 remove files
1026 1:ce8896473775 edit files
1026 1:ce8896473775 edit files
1027 0:30d30fe6a5be add files
1027 0:30d30fe6a5be add files
1028 $ cat normal3
1028 $ cat normal3
1029 normal3-modified
1029 normal3-modified
1030 $ cat sub/normal4
1030 $ cat sub/normal4
1031 normal4-modified
1031 normal4-modified
1032 $ cat sub/large4
1032 $ cat sub/large4
1033 large4-modified
1033 large4-modified
1034 $ cat sub2/large6
1034 $ cat sub2/large6
1035 large6-modified
1035 large6-modified
1036 $ cat sub2/large7
1036 $ cat sub2/large7
1037 large7
1037 large7
1038
1038
1039 Log on largefiles
1039 Log on largefiles
1040
1040
1041 - same output
1041 - same output
1042 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1042 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1043 8:a381d2c8c80e modify normal file and largefile in repo b
1043 8:a381d2c8c80e modify normal file and largefile in repo b
1044 6:4355d653f84f edit files yet again
1044 6:4355d653f84f edit files yet again
1045 5:9d5af5072dbd edit files again
1045 5:9d5af5072dbd edit files again
1046 4:74c02385b94c move files
1046 4:74c02385b94c move files
1047 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1047 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1048 8:a381d2c8c80e modify normal file and largefile in repo b
1048 8:a381d2c8c80e modify normal file and largefile in repo b
1049 6:4355d653f84f edit files yet again
1049 6:4355d653f84f edit files yet again
1050 5:9d5af5072dbd edit files again
1050 5:9d5af5072dbd edit files again
1051 4:74c02385b94c move files
1051 4:74c02385b94c move files
1052
1052
1053 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1053 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1054 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1054 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1055 8:a381d2c8c80e modify normal file and largefile in repo b
1055 8:a381d2c8c80e modify normal file and largefile in repo b
1056 6:4355d653f84f edit files yet again
1056 6:4355d653f84f edit files yet again
1057 5:9d5af5072dbd edit files again
1057 5:9d5af5072dbd edit files again
1058 4:74c02385b94c move files
1058 4:74c02385b94c move files
1059 1:ce8896473775 edit files
1059 1:ce8896473775 edit files
1060 0:30d30fe6a5be add files
1060 0:30d30fe6a5be add files
1061 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1061 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1062 9:598410d3eb9a modify normal file largefile in repo d
1062 9:598410d3eb9a modify normal file largefile in repo d
1063 8:a381d2c8c80e modify normal file and largefile in repo b
1063 8:a381d2c8c80e modify normal file and largefile in repo b
1064 6:4355d653f84f edit files yet again
1064 6:4355d653f84f edit files yet again
1065 5:9d5af5072dbd edit files again
1065 5:9d5af5072dbd edit files again
1066 4:74c02385b94c move files
1066 4:74c02385b94c move files
1067 1:ce8896473775 edit files
1067 1:ce8896473775 edit files
1068 0:30d30fe6a5be add files
1068 0:30d30fe6a5be add files
1069
1069
1070 - globbing gives same result
1070 - globbing gives same result
1071 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1071 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1072 9:598410d3eb9a modify normal file largefile in repo d
1072 9:598410d3eb9a modify normal file largefile in repo d
1073 8:a381d2c8c80e modify normal file and largefile in repo b
1073 8:a381d2c8c80e modify normal file and largefile in repo b
1074 6:4355d653f84f edit files yet again
1074 6:4355d653f84f edit files yet again
1075 5:9d5af5072dbd edit files again
1075 5:9d5af5072dbd edit files again
1076 4:74c02385b94c move files
1076 4:74c02385b94c move files
1077 1:ce8896473775 edit files
1077 1:ce8896473775 edit files
1078 0:30d30fe6a5be add files
1078 0:30d30fe6a5be add files
1079
1079
1080 Rollback on largefiles.
1080 Rollback on largefiles.
1081
1081
1082 $ echo large4-modified-again > sub/large4
1082 $ echo large4-modified-again > sub/large4
1083 $ hg commit -m "Modify large4 again"
1083 $ hg commit -m "Modify large4 again"
1084 Invoking status precommit hook
1084 Invoking status precommit hook
1085 M sub/large4
1085 M sub/large4
1086 $ hg rollback
1086 $ hg rollback
1087 repository tip rolled back to revision 9 (undo commit)
1087 repository tip rolled back to revision 9 (undo commit)
1088 working directory now based on revision 9
1088 working directory now based on revision 9
1089 $ hg st
1089 $ hg st
1090 M sub/large4
1090 M sub/large4
1091 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1091 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1092 9:598410d3eb9a modify normal file largefile in repo d
1092 9:598410d3eb9a modify normal file largefile in repo d
1093 8:a381d2c8c80e modify normal file and largefile in repo b
1093 8:a381d2c8c80e modify normal file and largefile in repo b
1094 7:daea875e9014 add/edit more largefiles
1094 7:daea875e9014 add/edit more largefiles
1095 6:4355d653f84f edit files yet again
1095 6:4355d653f84f edit files yet again
1096 5:9d5af5072dbd edit files again
1096 5:9d5af5072dbd edit files again
1097 4:74c02385b94c move files
1097 4:74c02385b94c move files
1098 3:9e8fbc4bce62 copy files
1098 3:9e8fbc4bce62 copy files
1099 2:51a0ae4d5864 remove files
1099 2:51a0ae4d5864 remove files
1100 1:ce8896473775 edit files
1100 1:ce8896473775 edit files
1101 0:30d30fe6a5be add files
1101 0:30d30fe6a5be add files
1102 $ cat sub/large4
1102 $ cat sub/large4
1103 large4-modified-again
1103 large4-modified-again
1104
1104
1105 "update --check" refuses to update with uncommitted changes.
1105 "update --check" refuses to update with uncommitted changes.
1106 $ hg update --check 8
1106 $ hg update --check 8
1107 abort: uncommitted changes
1107 abort: uncommitted changes
1108 [255]
1108 [255]
1109
1109
1110 "update --clean" leaves correct largefiles in working copy, even when there is
1110 "update --clean" leaves correct largefiles in working copy, even when there is
1111 .orig files from revert in .hglf.
1111 .orig files from revert in .hglf.
1112
1112
1113 $ echo mistake > sub2/large7
1113 $ echo mistake > sub2/large7
1114 $ hg revert sub2/large7
1114 $ hg revert sub2/large7
1115 $ hg -q update --clean -r null
1115 $ hg -q update --clean -r null
1116 $ hg update --clean
1116 $ hg update --clean
1117 getting changed largefiles
1117 getting changed largefiles
1118 3 largefiles updated, 0 removed
1118 3 largefiles updated, 0 removed
1119 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1119 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1120 $ cat normal3
1120 $ cat normal3
1121 normal3-modified
1121 normal3-modified
1122 $ cat sub/normal4
1122 $ cat sub/normal4
1123 normal4-modified
1123 normal4-modified
1124 $ cat sub/large4
1124 $ cat sub/large4
1125 large4-modified
1125 large4-modified
1126 $ cat sub2/large6
1126 $ cat sub2/large6
1127 large6-modified
1127 large6-modified
1128 $ cat sub2/large7
1128 $ cat sub2/large7
1129 large7
1129 large7
1130 $ cat sub2/large7.orig
1130 $ cat sub2/large7.orig
1131 mistake
1131 mistake
1132 $ cat .hglf/sub2/large7.orig
1132 $ cat .hglf/sub2/large7.orig
1133 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1133 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1134
1134
1135 demonstrate misfeature: .orig file is overwritten on every update -C,
1135 demonstrate misfeature: .orig file is overwritten on every update -C,
1136 also when clean:
1136 also when clean:
1137 $ hg update --clean
1137 $ hg update --clean
1138 getting changed largefiles
1138 getting changed largefiles
1139 0 largefiles updated, 0 removed
1139 0 largefiles updated, 0 removed
1140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1141 $ cat sub2/large7.orig
1141 $ cat sub2/large7.orig
1142 large7
1142 large7
1143 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1143 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1144
1144
1145 Now "update check" is happy.
1145 Now "update check" is happy.
1146 $ hg update --check 8
1146 $ hg update --check 8
1147 getting changed largefiles
1147 getting changed largefiles
1148 1 largefiles updated, 0 removed
1148 1 largefiles updated, 0 removed
1149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1150 $ hg update --check
1150 $ hg update --check
1151 getting changed largefiles
1151 getting changed largefiles
1152 1 largefiles updated, 0 removed
1152 1 largefiles updated, 0 removed
1153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1154
1154
1155 Test removing empty largefiles directories on update
1155 Test removing empty largefiles directories on update
1156 $ test -d sub2 && echo "sub2 exists"
1156 $ test -d sub2 && echo "sub2 exists"
1157 sub2 exists
1157 sub2 exists
1158 $ hg update -q null
1158 $ hg update -q null
1159 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1159 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1160 [1]
1160 [1]
1161 $ hg update -q
1161 $ hg update -q
1162
1162
1163 Test hg remove removes empty largefiles directories
1163 Test hg remove removes empty largefiles directories
1164 $ test -d sub2 && echo "sub2 exists"
1164 $ test -d sub2 && echo "sub2 exists"
1165 sub2 exists
1165 sub2 exists
1166 $ hg remove sub2/*
1166 $ hg remove sub2/*
1167 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1167 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1168 [1]
1168 [1]
1169 $ hg revert sub2/large6 sub2/large7
1169 $ hg revert sub2/large6 sub2/large7
1170
1170
1171 "revert" works on largefiles (and normal files too).
1171 "revert" works on largefiles (and normal files too).
1172 $ echo hack3 >> normal3
1172 $ echo hack3 >> normal3
1173 $ echo hack4 >> sub/normal4
1173 $ echo hack4 >> sub/normal4
1174 $ echo hack4 >> sub/large4
1174 $ echo hack4 >> sub/large4
1175 $ rm sub2/large6
1175 $ rm sub2/large6
1176 $ hg revert sub2/large6
1176 $ hg revert sub2/large6
1177 $ hg rm sub2/large6
1177 $ hg rm sub2/large6
1178 $ echo new >> sub2/large8
1178 $ echo new >> sub2/large8
1179 $ hg add --large sub2/large8
1179 $ hg add --large sub2/large8
1180 # XXX we don't really want to report that we're reverting the standin;
1180 # XXX we don't really want to report that we're reverting the standin;
1181 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1181 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1182 $ hg revert sub
1182 $ hg revert sub
1183 reverting .hglf/sub/large4 (glob)
1183 reverting .hglf/sub/large4 (glob)
1184 reverting sub/normal4 (glob)
1184 reverting sub/normal4 (glob)
1185 $ hg status
1185 $ hg status
1186 M normal3
1186 M normal3
1187 A sub2/large8
1187 A sub2/large8
1188 R sub2/large6
1188 R sub2/large6
1189 ? sub/large4.orig
1189 ? sub/large4.orig
1190 ? sub/normal4.orig
1190 ? sub/normal4.orig
1191 $ cat sub/normal4
1191 $ cat sub/normal4
1192 normal4-modified
1192 normal4-modified
1193 $ cat sub/large4
1193 $ cat sub/large4
1194 large4-modified
1194 large4-modified
1195 $ hg revert -a --no-backup
1195 $ hg revert -a --no-backup
1196 undeleting .hglf/sub2/large6 (glob)
1196 undeleting .hglf/sub2/large6 (glob)
1197 forgetting .hglf/sub2/large8 (glob)
1197 forgetting .hglf/sub2/large8 (glob)
1198 reverting normal3
1198 reverting normal3
1199 $ hg status
1199 $ hg status
1200 ? sub/large4.orig
1200 ? sub/large4.orig
1201 ? sub/normal4.orig
1201 ? sub/normal4.orig
1202 ? sub2/large8
1202 ? sub2/large8
1203 $ cat normal3
1203 $ cat normal3
1204 normal3-modified
1204 normal3-modified
1205 $ cat sub2/large6
1205 $ cat sub2/large6
1206 large6-modified
1206 large6-modified
1207 $ rm sub/*.orig sub2/large8
1207 $ rm sub/*.orig sub2/large8
1208
1208
1209 revert some files to an older revision
1209 revert some files to an older revision
1210 $ hg revert --no-backup -r 8 sub2
1210 $ hg revert --no-backup -r 8 sub2
1211 reverting .hglf/sub2/large6 (glob)
1211 reverting .hglf/sub2/large6 (glob)
1212 $ cat sub2/large6
1212 $ cat sub2/large6
1213 large6
1213 large6
1214 $ hg revert --no-backup -C -r '.^' sub2
1214 $ hg revert --no-backup -C -r '.^' sub2
1215 reverting .hglf/sub2/large6 (glob)
1215 reverting .hglf/sub2/large6 (glob)
1216 $ hg revert --no-backup sub2
1216 $ hg revert --no-backup sub2
1217 reverting .hglf/sub2/large6 (glob)
1217 reverting .hglf/sub2/large6 (glob)
1218 $ hg status
1218 $ hg status
1219
1219
1220 "verify --large" actually verifies largefiles
1220 "verify --large" actually verifies largefiles
1221
1221
1222 - Where Do We Come From? What Are We? Where Are We Going?
1222 - Where Do We Come From? What Are We? Where Are We Going?
1223 $ pwd
1223 $ pwd
1224 $TESTTMP/e
1224 $TESTTMP/e
1225 $ hg paths
1225 $ hg paths
1226 default = $TESTTMP/d (glob)
1226 default = $TESTTMP/d (glob)
1227
1227
1228 $ hg verify --large
1228 $ hg verify --large
1229 checking changesets
1229 checking changesets
1230 checking manifests
1230 checking manifests
1231 crosschecking files in changesets and manifests
1231 crosschecking files in changesets and manifests
1232 checking files
1232 checking files
1233 10 files, 10 changesets, 28 total revisions
1233 10 files, 10 changesets, 28 total revisions
1234 searching 1 changesets for largefiles
1234 searching 1 changesets for largefiles
1235 verified existence of 3 revisions of 3 largefiles
1235 verified existence of 3 revisions of 3 largefiles
1236
1236
1237 - introduce missing blob in local store repo and make sure that this is caught:
1237 - introduce missing blob in local store repo and make sure that this is caught:
1238 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1238 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1239 $ hg verify --large
1239 $ hg verify --large
1240 checking changesets
1240 checking changesets
1241 checking manifests
1241 checking manifests
1242 crosschecking files in changesets and manifests
1242 crosschecking files in changesets and manifests
1243 checking files
1243 checking files
1244 10 files, 10 changesets, 28 total revisions
1244 10 files, 10 changesets, 28 total revisions
1245 searching 1 changesets for largefiles
1245 searching 1 changesets for largefiles
1246 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1246 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1247 verified existence of 3 revisions of 3 largefiles
1247 verified existence of 3 revisions of 3 largefiles
1248 [1]
1248 [1]
1249
1249
1250 - introduce corruption and make sure that it is caught when checking content:
1250 - introduce corruption and make sure that it is caught when checking content:
1251 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1251 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1252 $ hg verify -q --large --lfc
1252 $ hg verify -q --large --lfc
1253 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1253 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1254 [1]
1254 [1]
1255
1255
1256 - cleanup
1256 - cleanup
1257 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1257 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1258
1258
1259 - verifying all revisions will fail because we didn't clone all largefiles to d:
1259 - verifying all revisions will fail because we didn't clone all largefiles to d:
1260 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1260 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1261 $ hg verify -q --lfa --lfc
1261 $ hg verify -q --lfa --lfc
1262 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1262 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1263 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1263 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1264 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1264 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1265 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1265 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1266 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1266 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1267 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1267 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1268 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1268 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1269 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1269 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1270 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1270 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1271 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1271 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1272 [1]
1272 [1]
1273
1273
1274 - cleanup
1274 - cleanup
1275 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1275 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1276 $ rm -f .hglf/sub/*.orig
1276 $ rm -f .hglf/sub/*.orig
1277
1277
1278 Update to revision with missing largefile - and make sure it really is missing
1278 Update to revision with missing largefile - and make sure it really is missing
1279
1279
1280 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1280 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1281 $ hg up -r 6
1281 $ hg up -r 6
1282 getting changed largefiles
1282 getting changed largefiles
1283 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1283 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1284 1 largefiles updated, 2 removed
1284 1 largefiles updated, 2 removed
1285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1286 $ rm normal3
1286 $ rm normal3
1287 $ echo >> sub/normal4
1287 $ echo >> sub/normal4
1288 $ hg ci -m 'commit with missing files'
1288 $ hg ci -m 'commit with missing files'
1289 Invoking status precommit hook
1289 Invoking status precommit hook
1290 M sub/normal4
1290 M sub/normal4
1291 ! large3
1291 ! large3
1292 ! normal3
1292 ! normal3
1293 created new head
1293 created new head
1294 $ hg st
1294 $ hg st
1295 ! large3
1295 ! large3
1296 ! normal3
1296 ! normal3
1297 $ hg up -r.
1297 $ hg up -r.
1298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1299 $ hg st
1299 $ hg st
1300 ! large3
1300 ! large3
1301 ! normal3
1301 ! normal3
1302 $ hg up -Cr.
1302 $ hg up -Cr.
1303 getting changed largefiles
1303 getting changed largefiles
1304 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1304 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1305 0 largefiles updated, 0 removed
1305 0 largefiles updated, 0 removed
1306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1307 $ hg st
1307 $ hg st
1308 ! large3
1308 ! large3
1309 $ hg rollback
1309 $ hg rollback
1310 repository tip rolled back to revision 9 (undo commit)
1310 repository tip rolled back to revision 9 (undo commit)
1311 working directory now based on revision 6
1311 working directory now based on revision 6
1312
1312
1313 Merge with revision with missing largefile - and make sure it tries to fetch it.
1313 Merge with revision with missing largefile - and make sure it tries to fetch it.
1314
1314
1315 $ hg up -Cqr null
1315 $ hg up -Cqr null
1316 $ echo f > f
1316 $ echo f > f
1317 $ hg ci -Am branch
1317 $ hg ci -Am branch
1318 adding f
1318 adding f
1319 Invoking status precommit hook
1319 Invoking status precommit hook
1320 A f
1320 A f
1321 created new head
1321 created new head
1322 $ hg merge -r 6
1322 $ hg merge -r 6
1323 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1323 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1324 (branch merge, don't forget to commit)
1324 (branch merge, don't forget to commit)
1325 getting changed largefiles
1325 getting changed largefiles
1326 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1326 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1327 1 largefiles updated, 0 removed
1327 1 largefiles updated, 0 removed
1328
1328
1329 $ hg rollback -q
1329 $ hg rollback -q
1330 $ hg up -Cq
1330 $ hg up -Cq
1331
1331
1332 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1332 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1333
1333
1334 $ hg pull --all-largefiles
1334 $ hg pull --all-largefiles
1335 pulling from $TESTTMP/d (glob)
1335 pulling from $TESTTMP/d (glob)
1336 searching for changes
1336 searching for changes
1337 no changes found
1337 no changes found
1338
1338
1339 Merging does not revert to old versions of largefiles and also check
1339 Merging does not revert to old versions of largefiles and also check
1340 that merging after having pulled from a non-default remote works
1340 that merging after having pulled from a non-default remote works
1341 correctly.
1341 correctly.
1342
1342
1343 $ cd ..
1343 $ cd ..
1344 $ hg clone -r 7 e temp
1344 $ hg clone -r 7 e temp
1345 adding changesets
1345 adding changesets
1346 adding manifests
1346 adding manifests
1347 adding file changes
1347 adding file changes
1348 added 8 changesets with 24 changes to 10 files
1348 added 8 changesets with 24 changes to 10 files
1349 updating to branch default
1349 updating to branch default
1350 getting changed largefiles
1350 getting changed largefiles
1351 3 largefiles updated, 0 removed
1351 3 largefiles updated, 0 removed
1352 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1352 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1353 $ hg clone temp f
1353 $ hg clone temp f
1354 updating to branch default
1354 updating to branch default
1355 getting changed largefiles
1355 getting changed largefiles
1356 3 largefiles updated, 0 removed
1356 3 largefiles updated, 0 removed
1357 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1357 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1358 # Delete the largefiles in the largefiles system cache so that we have an
1358 # Delete the largefiles in the largefiles system cache so that we have an
1359 # opportunity to test that caching after a pull works.
1359 # opportunity to test that caching after a pull works.
1360 $ rm "${USERCACHE}"/*
1360 $ rm "${USERCACHE}"/*
1361 $ cd f
1361 $ cd f
1362 $ echo "large4-merge-test" > sub/large4
1362 $ echo "large4-merge-test" > sub/large4
1363 $ hg commit -m "Modify large4 to test merge"
1363 $ hg commit -m "Modify large4 to test merge"
1364 Invoking status precommit hook
1364 Invoking status precommit hook
1365 M sub/large4
1365 M sub/large4
1366 # Test --cache-largefiles flag
1366 # Test --cache-largefiles flag
1367 $ hg pull --lfrev 'heads(pulled())' ../e
1367 $ hg pull --lfrev 'heads(pulled())' ../e
1368 pulling from ../e
1368 pulling from ../e
1369 searching for changes
1369 searching for changes
1370 adding changesets
1370 adding changesets
1371 adding manifests
1371 adding manifests
1372 adding file changes
1372 adding file changes
1373 added 2 changesets with 4 changes to 4 files (+1 heads)
1373 added 2 changesets with 4 changes to 4 files (+1 heads)
1374 (run 'hg heads' to see heads, 'hg merge' to merge)
1374 (run 'hg heads' to see heads, 'hg merge' to merge)
1375 2 largefiles cached
1375 2 largefiles cached
1376 $ hg merge
1376 $ hg merge
1377 merging sub/large4
1377 merging sub/large4
1378 largefile sub/large4 has a merge conflict
1378 largefile sub/large4 has a merge conflict
1379 keep (l)ocal or take (o)ther? l
1379 keep (l)ocal or take (o)ther? l
1380 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1380 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1381 (branch merge, don't forget to commit)
1381 (branch merge, don't forget to commit)
1382 getting changed largefiles
1382 getting changed largefiles
1383 1 largefiles updated, 0 removed
1383 1 largefiles updated, 0 removed
1384 $ hg commit -m "Merge repos e and f"
1384 $ hg commit -m "Merge repos e and f"
1385 Invoking status precommit hook
1385 Invoking status precommit hook
1386 M normal3
1386 M normal3
1387 M sub/normal4
1387 M sub/normal4
1388 M sub2/large6
1388 M sub2/large6
1389 $ cat normal3
1389 $ cat normal3
1390 normal3-modified
1390 normal3-modified
1391 $ cat sub/normal4
1391 $ cat sub/normal4
1392 normal4-modified
1392 normal4-modified
1393 $ cat sub/large4
1393 $ cat sub/large4
1394 large4-merge-test
1394 large4-merge-test
1395 $ cat sub2/large6
1395 $ cat sub2/large6
1396 large6-modified
1396 large6-modified
1397 $ cat sub2/large7
1397 $ cat sub2/large7
1398 large7
1398 large7
1399
1399
1400 Test status after merging with a branch that introduces a new largefile:
1400 Test status after merging with a branch that introduces a new largefile:
1401
1401
1402 $ echo large > large
1402 $ echo large > large
1403 $ hg add --large large
1403 $ hg add --large large
1404 $ hg commit -m 'add largefile'
1404 $ hg commit -m 'add largefile'
1405 Invoking status precommit hook
1405 Invoking status precommit hook
1406 A large
1406 A large
1407 $ hg update -q ".^"
1407 $ hg update -q ".^"
1408 $ echo change >> normal3
1408 $ echo change >> normal3
1409 $ hg commit -m 'some change'
1409 $ hg commit -m 'some change'
1410 Invoking status precommit hook
1410 Invoking status precommit hook
1411 M normal3
1411 M normal3
1412 created new head
1412 created new head
1413 $ hg merge
1413 $ hg merge
1414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1415 (branch merge, don't forget to commit)
1415 (branch merge, don't forget to commit)
1416 getting changed largefiles
1416 getting changed largefiles
1417 1 largefiles updated, 0 removed
1417 1 largefiles updated, 0 removed
1418 $ hg status
1418 $ hg status
1419 M large
1419 M large
1420
1420
1421 - make sure update of merge with removed largefiles fails as expected
1421 - make sure update of merge with removed largefiles fails as expected
1422 $ hg rm sub2/large6
1422 $ hg rm sub2/large6
1423 $ hg up -r.
1423 $ hg up -r.
1424 abort: outstanding uncommitted merges
1424 abort: outstanding uncommitted merges
1425 [255]
1425 [255]
1426
1426
1427 - revert should be able to revert files introduced in a pending merge
1427 - revert should be able to revert files introduced in a pending merge
1428 $ hg revert --all -r .
1428 $ hg revert --all -r .
1429 removing .hglf/large (glob)
1429 removing .hglf/large (glob)
1430 undeleting .hglf/sub2/large6 (glob)
1430 undeleting .hglf/sub2/large6 (glob)
1431
1431
1432 Test that a normal file and a largefile with the same name and path cannot
1432 Test that a normal file and a largefile with the same name and path cannot
1433 coexist.
1433 coexist.
1434
1434
1435 $ rm sub2/large7
1435 $ rm sub2/large7
1436 $ echo "largeasnormal" > sub2/large7
1436 $ echo "largeasnormal" > sub2/large7
1437 $ hg add sub2/large7
1437 $ hg add sub2/large7
1438 sub2/large7 already a largefile
1438 sub2/large7 already a largefile
1439
1439
1440 Test that transplanting a largefile change works correctly.
1440 Test that transplanting a largefile change works correctly.
1441
1441
1442 $ cd ..
1442 $ cd ..
1443 $ hg clone -r 8 d g
1443 $ hg clone -r 8 d g
1444 adding changesets
1444 adding changesets
1445 adding manifests
1445 adding manifests
1446 adding file changes
1446 adding file changes
1447 added 9 changesets with 26 changes to 10 files
1447 added 9 changesets with 26 changes to 10 files
1448 updating to branch default
1448 updating to branch default
1449 getting changed largefiles
1449 getting changed largefiles
1450 3 largefiles updated, 0 removed
1450 3 largefiles updated, 0 removed
1451 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1451 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1452 $ cd g
1452 $ cd g
1453 $ hg transplant -s ../d 598410d3eb9a
1453 $ hg transplant -s ../d 598410d3eb9a
1454 searching for changes
1454 searching for changes
1455 searching for changes
1455 searching for changes
1456 adding changesets
1456 adding changesets
1457 adding manifests
1457 adding manifests
1458 adding file changes
1458 adding file changes
1459 added 1 changesets with 2 changes to 2 files
1459 added 1 changesets with 2 changes to 2 files
1460 getting changed largefiles
1460 getting changed largefiles
1461 1 largefiles updated, 0 removed
1461 1 largefiles updated, 0 removed
1462 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1462 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1463 9:598410d3eb9a modify normal file largefile in repo d
1463 9:598410d3eb9a modify normal file largefile in repo d
1464 8:a381d2c8c80e modify normal file and largefile in repo b
1464 8:a381d2c8c80e modify normal file and largefile in repo b
1465 7:daea875e9014 add/edit more largefiles
1465 7:daea875e9014 add/edit more largefiles
1466 6:4355d653f84f edit files yet again
1466 6:4355d653f84f edit files yet again
1467 5:9d5af5072dbd edit files again
1467 5:9d5af5072dbd edit files again
1468 4:74c02385b94c move files
1468 4:74c02385b94c move files
1469 3:9e8fbc4bce62 copy files
1469 3:9e8fbc4bce62 copy files
1470 2:51a0ae4d5864 remove files
1470 2:51a0ae4d5864 remove files
1471 1:ce8896473775 edit files
1471 1:ce8896473775 edit files
1472 0:30d30fe6a5be add files
1472 0:30d30fe6a5be add files
1473 $ cat normal3
1473 $ cat normal3
1474 normal3-modified
1474 normal3-modified
1475 $ cat sub/normal4
1475 $ cat sub/normal4
1476 normal4-modified
1476 normal4-modified
1477 $ cat sub/large4
1477 $ cat sub/large4
1478 large4-modified
1478 large4-modified
1479 $ cat sub2/large6
1479 $ cat sub2/large6
1480 large6-modified
1480 large6-modified
1481 $ cat sub2/large7
1481 $ cat sub2/large7
1482 large7
1482 large7
1483
1483
1484 Cat a largefile
1484 Cat a largefile
1485 $ hg cat normal3
1485 $ hg cat normal3
1486 normal3-modified
1486 normal3-modified
1487 $ hg cat sub/large4
1487 $ hg cat sub/large4
1488 large4-modified
1488 large4-modified
1489 $ rm "${USERCACHE}"/*
1489 $ rm "${USERCACHE}"/*
1490 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1490 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1491 $ cat cat.out
1491 $ cat cat.out
1492 large4-modified
1492 large4-modified
1493 $ rm cat.out
1493 $ rm cat.out
1494 $ hg cat -r a381d2c8c80e normal3
1494 $ hg cat -r a381d2c8c80e normal3
1495 normal3-modified
1495 normal3-modified
1496 $ hg cat -r '.^' normal3
1496 $ hg cat -r '.^' normal3
1497 normal3-modified
1497 normal3-modified
1498 $ hg cat -r '.^' sub/large4 doesntexist
1498 $ hg cat -r '.^' sub/large4 doesntexist
1499 large4-modified
1499 large4-modified
1500 doesntexist: no such file in rev a381d2c8c80e
1500 doesntexist: no such file in rev a381d2c8c80e
1501 $ hg --cwd sub cat -r '.^' large4
1501 $ hg --cwd sub cat -r '.^' large4
1502 large4-modified
1502 large4-modified
1503 $ hg --cwd sub cat -r '.^' ../normal3
1503 $ hg --cwd sub cat -r '.^' ../normal3
1504 normal3-modified
1504 normal3-modified
1505
1505
1506 Test that renaming a largefile results in correct output for status
1506 Test that renaming a largefile results in correct output for status
1507
1507
1508 $ hg rename sub/large4 large4-renamed
1508 $ hg rename sub/large4 large4-renamed
1509 $ hg commit -m "test rename output"
1509 $ hg commit -m "test rename output"
1510 Invoking status precommit hook
1510 Invoking status precommit hook
1511 A large4-renamed
1511 A large4-renamed
1512 R sub/large4
1512 R sub/large4
1513 $ cat large4-renamed
1513 $ cat large4-renamed
1514 large4-modified
1514 large4-modified
1515 $ cd sub2
1515 $ cd sub2
1516 $ hg rename large6 large6-renamed
1516 $ hg rename large6 large6-renamed
1517 $ hg st
1517 $ hg st
1518 A sub2/large6-renamed
1518 A sub2/large6-renamed
1519 R sub2/large6
1519 R sub2/large6
1520 $ cd ..
1520 $ cd ..
1521
1521
1522 Test --normal flag
1522 Test --normal flag
1523
1523
1524 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1524 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1525 $ hg add --normal --large new-largefile
1525 $ hg add --normal --large new-largefile
1526 abort: --normal cannot be used with --large
1526 abort: --normal cannot be used with --large
1527 [255]
1527 [255]
1528 $ hg add --normal new-largefile
1528 $ hg add --normal new-largefile
1529 new-largefile: up to 69 MB of RAM may be required to manage this file
1529 new-largefile: up to 69 MB of RAM may be required to manage this file
1530 (use 'hg revert new-largefile' to cancel the pending addition)
1530 (use 'hg revert new-largefile' to cancel the pending addition)
1531 $ cd ..
1531 $ cd ..
1532
1532
1533 #if serve
1533 #if serve
1534 vanilla clients not locked out from largefiles servers on vanilla repos
1534 vanilla clients not locked out from largefiles servers on vanilla repos
1535 $ mkdir r1
1535 $ mkdir r1
1536 $ cd r1
1536 $ cd r1
1537 $ hg init
1537 $ hg init
1538 $ echo c1 > f1
1538 $ echo c1 > f1
1539 $ hg add f1
1539 $ hg add f1
1540 $ hg commit -m "m1"
1540 $ hg commit -m "m1"
1541 Invoking status precommit hook
1541 Invoking status precommit hook
1542 A f1
1542 A f1
1543 $ cd ..
1543 $ cd ..
1544 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1544 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1545 $ cat hg.pid >> $DAEMON_PIDS
1545 $ cat hg.pid >> $DAEMON_PIDS
1546 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1546 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1547 requesting all changes
1547 requesting all changes
1548 adding changesets
1548 adding changesets
1549 adding manifests
1549 adding manifests
1550 adding file changes
1550 adding file changes
1551 added 1 changesets with 1 changes to 1 files
1551 added 1 changesets with 1 changes to 1 files
1552 updating to branch default
1552 updating to branch default
1553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1554
1554
1555 largefiles clients still work with vanilla servers
1555 largefiles clients still work with vanilla servers
1556 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1556 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1557 $ cat hg.pid >> $DAEMON_PIDS
1557 $ cat hg.pid >> $DAEMON_PIDS
1558 $ hg clone http://localhost:$HGPORT1 r3
1558 $ hg clone http://localhost:$HGPORT1 r3
1559 requesting all changes
1559 requesting all changes
1560 adding changesets
1560 adding changesets
1561 adding manifests
1561 adding manifests
1562 adding file changes
1562 adding file changes
1563 added 1 changesets with 1 changes to 1 files
1563 added 1 changesets with 1 changes to 1 files
1564 updating to branch default
1564 updating to branch default
1565 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1565 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1566 #endif
1566 #endif
1567
1567
1568
1568
1569 vanilla clients locked out from largefiles http repos
1569 vanilla clients locked out from largefiles http repos
1570 $ mkdir r4
1570 $ mkdir r4
1571 $ cd r4
1571 $ cd r4
1572 $ hg init
1572 $ hg init
1573 $ echo c1 > f1
1573 $ echo c1 > f1
1574 $ hg add --large f1
1574 $ hg add --large f1
1575 $ hg commit -m "m1"
1575 $ hg commit -m "m1"
1576 Invoking status precommit hook
1576 Invoking status precommit hook
1577 A f1
1577 A f1
1578 $ cd ..
1578 $ cd ..
1579
1579
1580 largefiles can be pushed locally (issue3583)
1580 largefiles can be pushed locally (issue3583)
1581 $ hg init dest
1581 $ hg init dest
1582 $ cd r4
1582 $ cd r4
1583 $ hg outgoing ../dest
1583 $ hg outgoing ../dest
1584 comparing with ../dest
1584 comparing with ../dest
1585 searching for changes
1585 searching for changes
1586 changeset: 0:639881c12b4c
1586 changeset: 0:639881c12b4c
1587 tag: tip
1587 tag: tip
1588 user: test
1588 user: test
1589 date: Thu Jan 01 00:00:00 1970 +0000
1589 date: Thu Jan 01 00:00:00 1970 +0000
1590 summary: m1
1590 summary: m1
1591
1591
1592 $ hg push ../dest
1592 $ hg push ../dest
1593 pushing to ../dest
1593 pushing to ../dest
1594 searching for changes
1594 searching for changes
1595 searching for changes
1595 searching for changes
1596 adding changesets
1596 adding changesets
1597 adding manifests
1597 adding manifests
1598 adding file changes
1598 adding file changes
1599 added 1 changesets with 1 changes to 1 files
1599 added 1 changesets with 1 changes to 1 files
1600
1600
1601 exit code with nothing outgoing (issue3611)
1601 exit code with nothing outgoing (issue3611)
1602 $ hg outgoing ../dest
1602 $ hg outgoing ../dest
1603 comparing with ../dest
1603 comparing with ../dest
1604 searching for changes
1604 searching for changes
1605 no changes found
1605 no changes found
1606 [1]
1606 [1]
1607 $ cd ..
1607 $ cd ..
1608
1608
1609 #if serve
1609 #if serve
1610 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1610 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1611 $ cat hg.pid >> $DAEMON_PIDS
1611 $ cat hg.pid >> $DAEMON_PIDS
1612 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1612 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1613 abort: remote error:
1613 abort: remote error:
1614
1614
1615 This repository uses the largefiles extension.
1615 This repository uses the largefiles extension.
1616
1616
1617 Please enable it in your Mercurial config file.
1617 Please enable it in your Mercurial config file.
1618 [255]
1618 [255]
1619
1619
1620 used all HGPORTs, kill all daemons
1620 used all HGPORTs, kill all daemons
1621 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1621 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1622 #endif
1622 #endif
1623
1623
1624 vanilla clients locked out from largefiles ssh repos
1624 vanilla clients locked out from largefiles ssh repos
1625 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1625 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1626 abort: remote error:
1626 abort: remote error:
1627
1627
1628 This repository uses the largefiles extension.
1628 This repository uses the largefiles extension.
1629
1629
1630 Please enable it in your Mercurial config file.
1630 Please enable it in your Mercurial config file.
1631 [255]
1631 [255]
1632
1632
1633 #if serve
1633 #if serve
1634
1634
1635 largefiles clients refuse to push largefiles repos to vanilla servers
1635 largefiles clients refuse to push largefiles repos to vanilla servers
1636 $ mkdir r6
1636 $ mkdir r6
1637 $ cd r6
1637 $ cd r6
1638 $ hg init
1638 $ hg init
1639 $ echo c1 > f1
1639 $ echo c1 > f1
1640 $ hg add f1
1640 $ hg add f1
1641 $ hg commit -m "m1"
1641 $ hg commit -m "m1"
1642 Invoking status precommit hook
1642 Invoking status precommit hook
1643 A f1
1643 A f1
1644 $ cat >> .hg/hgrc <<!
1644 $ cat >> .hg/hgrc <<!
1645 > [web]
1645 > [web]
1646 > push_ssl = false
1646 > push_ssl = false
1647 > allow_push = *
1647 > allow_push = *
1648 > !
1648 > !
1649 $ cd ..
1649 $ cd ..
1650 $ hg clone r6 r7
1650 $ hg clone r6 r7
1651 updating to branch default
1651 updating to branch default
1652 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1652 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1653 $ cd r7
1653 $ cd r7
1654 $ echo c2 > f2
1654 $ echo c2 > f2
1655 $ hg add --large f2
1655 $ hg add --large f2
1656 $ hg commit -m "m2"
1656 $ hg commit -m "m2"
1657 Invoking status precommit hook
1657 Invoking status precommit hook
1658 A f2
1658 A f2
1659 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1659 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1660 $ cat ../hg.pid >> $DAEMON_PIDS
1660 $ cat ../hg.pid >> $DAEMON_PIDS
1661 $ hg push http://localhost:$HGPORT
1661 $ hg push http://localhost:$HGPORT
1662 pushing to http://localhost:$HGPORT/
1662 pushing to http://localhost:$HGPORT/
1663 searching for changes
1663 searching for changes
1664 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1664 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1665 [255]
1665 [255]
1666 $ cd ..
1666 $ cd ..
1667
1667
1668 putlfile errors are shown (issue3123)
1668 putlfile errors are shown (issue3123)
1669 Corrupt the cached largefile in r7 and move it out of the servers usercache
1669 Corrupt the cached largefile in r7 and move it out of the servers usercache
1670 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1670 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1671 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1671 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1672 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1672 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1673 $ hg init empty
1673 $ hg init empty
1674 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1674 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1675 > --config 'web.allow_push=*' --config web.push_ssl=False
1675 > --config 'web.allow_push=*' --config web.push_ssl=False
1676 $ cat hg.pid >> $DAEMON_PIDS
1676 $ cat hg.pid >> $DAEMON_PIDS
1677 $ hg push -R r7 http://localhost:$HGPORT1
1677 $ hg push -R r7 http://localhost:$HGPORT1
1678 pushing to http://localhost:$HGPORT1/
1678 pushing to http://localhost:$HGPORT1/
1679 searching for changes
1679 searching for changes
1680 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1680 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1681 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1681 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1682 [255]
1682 [255]
1683 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1683 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1684 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1684 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1685 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1685 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1686 $ hg push -R r7 http://localhost:$HGPORT1
1686 $ hg push -R r7 http://localhost:$HGPORT1
1687 pushing to http://localhost:$HGPORT1/
1687 pushing to http://localhost:$HGPORT1/
1688 searching for changes
1688 searching for changes
1689 searching for changes
1689 searching for changes
1690 remote: adding changesets
1690 remote: adding changesets
1691 remote: adding manifests
1691 remote: adding manifests
1692 remote: adding file changes
1692 remote: adding file changes
1693 remote: added 2 changesets with 2 changes to 2 files
1693 remote: added 2 changesets with 2 changes to 2 files
1694 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1694 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1695 server side corruption
1695 server side corruption
1696 $ rm -rf empty
1696 $ rm -rf empty
1697
1697
1698 Push a largefiles repository to a served empty repository
1698 Push a largefiles repository to a served empty repository
1699 $ hg init r8
1699 $ hg init r8
1700 $ echo c3 > r8/f1
1700 $ echo c3 > r8/f1
1701 $ hg add --large r8/f1 -R r8
1701 $ hg add --large r8/f1 -R r8
1702 $ hg commit -m "m1" -R r8
1702 $ hg commit -m "m1" -R r8
1703 Invoking status precommit hook
1703 Invoking status precommit hook
1704 A f1
1704 A f1
1705 $ hg init empty
1705 $ hg init empty
1706 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1706 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1707 > --config 'web.allow_push=*' --config web.push_ssl=False
1707 > --config 'web.allow_push=*' --config web.push_ssl=False
1708 $ cat hg.pid >> $DAEMON_PIDS
1708 $ cat hg.pid >> $DAEMON_PIDS
1709 $ rm "${USERCACHE}"/*
1709 $ rm "${USERCACHE}"/*
1710 $ hg push -R r8 http://localhost:$HGPORT2/#default
1710 $ hg push -R r8 http://localhost:$HGPORT2/#default
1711 pushing to http://localhost:$HGPORT2/
1711 pushing to http://localhost:$HGPORT2/
1712 searching for changes
1712 searching for changes
1713 searching for changes
1713 searching for changes
1714 remote: adding changesets
1714 remote: adding changesets
1715 remote: adding manifests
1715 remote: adding manifests
1716 remote: adding file changes
1716 remote: adding file changes
1717 remote: added 1 changesets with 1 changes to 1 files
1717 remote: added 1 changesets with 1 changes to 1 files
1718 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1718 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1719 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1719 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1720
1720
1721 Clone over http, no largefiles pulled on clone.
1721 Clone over http, no largefiles pulled on clone.
1722
1722
1723 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1723 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1724 adding changesets
1724 adding changesets
1725 adding manifests
1725 adding manifests
1726 adding file changes
1726 adding file changes
1727 added 1 changesets with 1 changes to 1 files
1727 added 1 changesets with 1 changes to 1 files
1728
1728
1729 test 'verify' with remotestore:
1729 test 'verify' with remotestore:
1730
1730
1731 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1731 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1732 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1732 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1733 $ hg -R http-clone verify --large --lfa
1733 $ hg -R http-clone verify --large --lfa
1734 checking changesets
1734 checking changesets
1735 checking manifests
1735 checking manifests
1736 crosschecking files in changesets and manifests
1736 crosschecking files in changesets and manifests
1737 checking files
1737 checking files
1738 1 files, 1 changesets, 1 total revisions
1738 1 files, 1 changesets, 1 total revisions
1739 searching 1 changesets for largefiles
1739 searching 1 changesets for largefiles
1740 changeset 0:cf03e5bb9936: f1 missing
1740 changeset 0:cf03e5bb9936: f1 missing
1741 verified existence of 1 revisions of 1 largefiles
1741 verified existence of 1 revisions of 1 largefiles
1742 [1]
1742 [1]
1743 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1743 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1744 $ hg -R http-clone -q verify --large --lfa
1744 $ hg -R http-clone -q verify --large --lfa
1745
1745
1746 largefiles pulled on update - a largefile missing on the server:
1746 largefiles pulled on update - a largefile missing on the server:
1747 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1747 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1748 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1748 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1749 getting changed largefiles
1749 getting changed largefiles
1750 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1750 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1751 0 largefiles updated, 0 removed
1751 0 largefiles updated, 0 removed
1752 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1752 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1753 $ hg -R http-clone st
1753 $ hg -R http-clone st
1754 ! f1
1754 ! f1
1755 $ hg -R http-clone up -Cqr null
1755 $ hg -R http-clone up -Cqr null
1756
1756
1757 largefiles pulled on update - a largefile corrupted on the server:
1757 largefiles pulled on update - a largefile corrupted on the server:
1758 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1758 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1759 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1759 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1760 getting changed largefiles
1760 getting changed largefiles
1761 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1761 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1762 0 largefiles updated, 0 removed
1762 0 largefiles updated, 0 removed
1763 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1763 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1764 $ hg -R http-clone st
1764 $ hg -R http-clone st
1765 ! f1
1765 ! f1
1766 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1766 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1767 $ [ ! -f http-clone/f1 ]
1767 $ [ ! -f http-clone/f1 ]
1768 $ [ ! -f http-clone-usercache ]
1768 $ [ ! -f http-clone-usercache ]
1769 $ hg -R http-clone verify --large --lfc
1769 $ hg -R http-clone verify --large --lfc
1770 checking changesets
1770 checking changesets
1771 checking manifests
1771 checking manifests
1772 crosschecking files in changesets and manifests
1772 crosschecking files in changesets and manifests
1773 checking files
1773 checking files
1774 1 files, 1 changesets, 1 total revisions
1774 1 files, 1 changesets, 1 total revisions
1775 searching 1 changesets for largefiles
1775 searching 1 changesets for largefiles
1776 verified contents of 1 revisions of 1 largefiles
1776 verified contents of 1 revisions of 1 largefiles
1777 $ hg -R http-clone up -Cqr null
1777 $ hg -R http-clone up -Cqr null
1778
1778
1779 largefiles pulled on update - no server side problems:
1779 largefiles pulled on update - no server side problems:
1780 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1780 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1781 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1781 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1782 resolving manifests
1782 resolving manifests
1783 branchmerge: False, force: False, partial: False
1783 branchmerge: False, force: False, partial: False
1784 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1784 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1785 .hglf/f1: remote created -> g
1785 .hglf/f1: remote created -> g
1786 getting .hglf/f1
1786 getting .hglf/f1
1787 updating: .hglf/f1 1/1 files (100.00%)
1787 updating: .hglf/f1 1/1 files (100.00%)
1788 getting changed largefiles
1788 getting changed largefiles
1789 using http://localhost:$HGPORT2/
1789 using http://localhost:$HGPORT2/
1790 sending capabilities command
1790 sending capabilities command
1791 sending batch command
1791 sending batch command
1792 getting largefiles: 0/1 lfile (0.00%)
1792 getting largefiles: 0/1 lfile (0.00%)
1793 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1793 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1794 sending getlfile command
1794 sending getlfile command
1795 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1795 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1796 1 largefiles updated, 0 removed
1796 1 largefiles updated, 0 removed
1797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1798
1798
1799 $ ls http-clone-usercache/*
1799 $ ls http-clone-usercache/*
1800 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1800 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1801
1801
1802 $ rm -rf empty http-clone*
1802 $ rm -rf empty http-clone*
1803
1803
1804 used all HGPORTs, kill all daemons
1804 used all HGPORTs, kill all daemons
1805 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1805 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1806
1806
1807 #endif
1807 #endif
1808
1808
1809
1809
1810 #if unix-permissions
1810 #if unix-permissions
1811
1811
1812 Clone a local repository owned by another user
1812 Clone a local repository owned by another user
1813 We have to simulate that here by setting $HOME and removing write permissions
1813 We have to simulate that here by setting $HOME and removing write permissions
1814 $ ORIGHOME="$HOME"
1814 $ ORIGHOME="$HOME"
1815 $ mkdir alice
1815 $ mkdir alice
1816 $ HOME="`pwd`/alice"
1816 $ HOME="`pwd`/alice"
1817 $ cd alice
1817 $ cd alice
1818 $ hg init pubrepo
1818 $ hg init pubrepo
1819 $ cd pubrepo
1819 $ cd pubrepo
1820 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1820 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1821 $ hg add --large a-large-file
1821 $ hg add --large a-large-file
1822 $ hg commit -m "Add a large file"
1822 $ hg commit -m "Add a large file"
1823 Invoking status precommit hook
1823 Invoking status precommit hook
1824 A a-large-file
1824 A a-large-file
1825 $ cd ..
1825 $ cd ..
1826 $ chmod -R a-w pubrepo
1826 $ chmod -R a-w pubrepo
1827 $ cd ..
1827 $ cd ..
1828 $ mkdir bob
1828 $ mkdir bob
1829 $ HOME="`pwd`/bob"
1829 $ HOME="`pwd`/bob"
1830 $ cd bob
1830 $ cd bob
1831 $ hg clone --pull ../alice/pubrepo pubrepo
1831 $ hg clone --pull ../alice/pubrepo pubrepo
1832 requesting all changes
1832 requesting all changes
1833 adding changesets
1833 adding changesets
1834 adding manifests
1834 adding manifests
1835 adding file changes
1835 adding file changes
1836 added 1 changesets with 1 changes to 1 files
1836 added 1 changesets with 1 changes to 1 files
1837 updating to branch default
1837 updating to branch default
1838 getting changed largefiles
1838 getting changed largefiles
1839 1 largefiles updated, 0 removed
1839 1 largefiles updated, 0 removed
1840 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1840 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1841 $ cd ..
1841 $ cd ..
1842 $ chmod -R u+w alice/pubrepo
1842 $ chmod -R u+w alice/pubrepo
1843 $ HOME="$ORIGHOME"
1843 $ HOME="$ORIGHOME"
1844
1844
1845 #endif
1845 #endif
1846
1846
1847 #if symlink
1847 #if symlink
1848
1848
1849 Symlink to a large largefile should behave the same as a symlink to a normal file
1849 Symlink to a large largefile should behave the same as a symlink to a normal file
1850 $ hg init largesymlink
1850 $ hg init largesymlink
1851 $ cd largesymlink
1851 $ cd largesymlink
1852 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1852 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1853 $ hg add --large largefile
1853 $ hg add --large largefile
1854 $ hg commit -m "commit a large file"
1854 $ hg commit -m "commit a large file"
1855 Invoking status precommit hook
1855 Invoking status precommit hook
1856 A largefile
1856 A largefile
1857 $ ln -s largefile largelink
1857 $ ln -s largefile largelink
1858 $ hg add largelink
1858 $ hg add largelink
1859 $ hg commit -m "commit a large symlink"
1859 $ hg commit -m "commit a large symlink"
1860 Invoking status precommit hook
1860 Invoking status precommit hook
1861 A largelink
1861 A largelink
1862 $ rm -f largelink
1862 $ rm -f largelink
1863 $ hg up >/dev/null
1863 $ hg up >/dev/null
1864 $ test -f largelink
1864 $ test -f largelink
1865 [1]
1865 [1]
1866 $ test -L largelink
1866 $ test -L largelink
1867 [1]
1867 [1]
1868 $ rm -f largelink # make next part of the test independent of the previous
1868 $ rm -f largelink # make next part of the test independent of the previous
1869 $ hg up -C >/dev/null
1869 $ hg up -C >/dev/null
1870 $ test -f largelink
1870 $ test -f largelink
1871 $ test -L largelink
1871 $ test -L largelink
1872 $ cd ..
1872 $ cd ..
1873
1873
1874 #endif
1874 #endif
1875
1875
1876 test for pattern matching on 'hg status':
1876 test for pattern matching on 'hg status':
1877 to boost performance, largefiles checks whether specified patterns are
1877 to boost performance, largefiles checks whether specified patterns are
1878 related to largefiles in working directory (NOT to STANDIN) or not.
1878 related to largefiles in working directory (NOT to STANDIN) or not.
1879
1879
1880 $ hg init statusmatch
1880 $ hg init statusmatch
1881 $ cd statusmatch
1881 $ cd statusmatch
1882
1882
1883 $ mkdir -p a/b/c/d
1883 $ mkdir -p a/b/c/d
1884 $ echo normal > a/b/c/d/e.normal.txt
1884 $ echo normal > a/b/c/d/e.normal.txt
1885 $ hg add a/b/c/d/e.normal.txt
1885 $ hg add a/b/c/d/e.normal.txt
1886 $ echo large > a/b/c/d/e.large.txt
1886 $ echo large > a/b/c/d/e.large.txt
1887 $ hg add --large a/b/c/d/e.large.txt
1887 $ hg add --large a/b/c/d/e.large.txt
1888 $ mkdir -p a/b/c/x
1888 $ mkdir -p a/b/c/x
1889 $ echo normal > a/b/c/x/y.normal.txt
1889 $ echo normal > a/b/c/x/y.normal.txt
1890 $ hg add a/b/c/x/y.normal.txt
1890 $ hg add a/b/c/x/y.normal.txt
1891 $ hg commit -m 'add files'
1891 $ hg commit -m 'add files'
1892 Invoking status precommit hook
1892 Invoking status precommit hook
1893 A a/b/c/d/e.large.txt
1893 A a/b/c/d/e.large.txt
1894 A a/b/c/d/e.normal.txt
1894 A a/b/c/d/e.normal.txt
1895 A a/b/c/x/y.normal.txt
1895 A a/b/c/x/y.normal.txt
1896
1896
1897 (1) no pattern: no performance boost
1897 (1) no pattern: no performance boost
1898 $ hg status -A
1898 $ hg status -A
1899 C a/b/c/d/e.large.txt
1899 C a/b/c/d/e.large.txt
1900 C a/b/c/d/e.normal.txt
1900 C a/b/c/d/e.normal.txt
1901 C a/b/c/x/y.normal.txt
1901 C a/b/c/x/y.normal.txt
1902
1902
1903 (2) pattern not related to largefiles: performance boost
1903 (2) pattern not related to largefiles: performance boost
1904 $ hg status -A a/b/c/x
1904 $ hg status -A a/b/c/x
1905 C a/b/c/x/y.normal.txt
1905 C a/b/c/x/y.normal.txt
1906
1906
1907 (3) pattern related to largefiles: no performance boost
1907 (3) pattern related to largefiles: no performance boost
1908 $ hg status -A a/b/c/d
1908 $ hg status -A a/b/c/d
1909 C a/b/c/d/e.large.txt
1909 C a/b/c/d/e.large.txt
1910 C a/b/c/d/e.normal.txt
1910 C a/b/c/d/e.normal.txt
1911
1911
1912 (4) pattern related to STANDIN (not to largefiles): performance boost
1912 (4) pattern related to STANDIN (not to largefiles): performance boost
1913 $ hg status -A .hglf/a
1913 $ hg status -A .hglf/a
1914 C .hglf/a/b/c/d/e.large.txt
1914 C .hglf/a/b/c/d/e.large.txt
1915
1915
1916 (5) mixed case: no performance boost
1916 (5) mixed case: no performance boost
1917 $ hg status -A a/b/c/x a/b/c/d
1917 $ hg status -A a/b/c/x a/b/c/d
1918 C a/b/c/d/e.large.txt
1918 C a/b/c/d/e.large.txt
1919 C a/b/c/d/e.normal.txt
1919 C a/b/c/d/e.normal.txt
1920 C a/b/c/x/y.normal.txt
1920 C a/b/c/x/y.normal.txt
1921
1921
1922 verify that largefiles doesn't break filesets
1922 verify that largefiles doesn't break filesets
1923
1923
1924 $ hg log --rev . --exclude "set:binary()"
1924 $ hg log --rev . --exclude "set:binary()"
1925 changeset: 0:41bd42f10efa
1925 changeset: 0:41bd42f10efa
1926 tag: tip
1926 tag: tip
1927 user: test
1927 user: test
1928 date: Thu Jan 01 00:00:00 1970 +0000
1928 date: Thu Jan 01 00:00:00 1970 +0000
1929 summary: add files
1929 summary: add files
1930
1930
1931 verify that large files in subrepos handled properly
1931 verify that large files in subrepos handled properly
1932 $ hg init subrepo
1932 $ hg init subrepo
1933 $ echo "subrepo = subrepo" > .hgsub
1933 $ echo "subrepo = subrepo" > .hgsub
1934 $ hg add .hgsub
1934 $ hg add .hgsub
1935 $ hg ci -m "add subrepo"
1935 $ hg ci -m "add subrepo"
1936 Invoking status precommit hook
1936 Invoking status precommit hook
1937 A .hgsub
1937 A .hgsub
1938 ? .hgsubstate
1938 ? .hgsubstate
1939 $ echo "rev 1" > subrepo/large.txt
1939 $ echo "rev 1" > subrepo/large.txt
1940 $ hg -R subrepo add --large subrepo/large.txt
1940 $ hg -R subrepo add --large subrepo/large.txt
1941 $ hg sum
1941 $ hg sum
1942 parent: 1:8ee150ea2e9c tip
1942 parent: 1:8ee150ea2e9c tip
1943 add subrepo
1943 add subrepo
1944 branch: default
1944 branch: default
1945 commit: 1 subrepos
1945 commit: 1 subrepos
1946 update: (current)
1946 update: (current)
1947 $ hg st
1947 $ hg st
1948 $ hg st -S
1948 $ hg st -S
1949 A subrepo/large.txt
1949 A subrepo/large.txt
1950 $ hg ci -S -m "commit top repo"
1950 $ hg ci -S -m "commit top repo"
1951 committing subrepository subrepo
1951 committing subrepository subrepo
1952 Invoking status precommit hook
1952 Invoking status precommit hook
1953 A large.txt
1953 A large.txt
1954 Invoking status precommit hook
1954 Invoking status precommit hook
1955 M .hgsubstate
1955 M .hgsubstate
1956 # No differences
1956 # No differences
1957 $ hg st -S
1957 $ hg st -S
1958 $ hg sum
1958 $ hg sum
1959 parent: 2:ce4cd0c527a6 tip
1959 parent: 2:ce4cd0c527a6 tip
1960 commit top repo
1960 commit top repo
1961 branch: default
1961 branch: default
1962 commit: (clean)
1962 commit: (clean)
1963 update: (current)
1963 update: (current)
1964 $ echo "rev 2" > subrepo/large.txt
1964 $ echo "rev 2" > subrepo/large.txt
1965 $ hg st -S
1965 $ hg st -S
1966 M subrepo/large.txt
1966 M subrepo/large.txt
1967 $ hg sum
1967 $ hg sum
1968 parent: 2:ce4cd0c527a6 tip
1968 parent: 2:ce4cd0c527a6 tip
1969 commit top repo
1969 commit top repo
1970 branch: default
1970 branch: default
1971 commit: 1 subrepos
1971 commit: 1 subrepos
1972 update: (current)
1972 update: (current)
1973 $ hg ci -m "this commit should fail without -S"
1973 $ hg ci -m "this commit should fail without -S"
1974 abort: uncommitted changes in subrepo subrepo
1974 abort: uncommitted changes in subrepo subrepo
1975 (use --subrepos for recursive commit)
1975 (use --subrepos for recursive commit)
1976 [255]
1976 [255]
1977
1977
1978 Add a normal file to the subrepo, then test archiving
1978 Add a normal file to the subrepo, then test archiving
1979
1979
1980 $ echo 'normal file' > subrepo/normal.txt
1980 $ echo 'normal file' > subrepo/normal.txt
1981 $ hg -R subrepo add subrepo/normal.txt
1981 $ hg -R subrepo add subrepo/normal.txt
1982
1982
1983 Lock in subrepo, otherwise the change isn't archived
1983 Lock in subrepo, otherwise the change isn't archived
1984
1984
1985 $ hg ci -S -m "add normal file to top level"
1985 $ hg ci -S -m "add normal file to top level"
1986 committing subrepository subrepo
1986 committing subrepository subrepo
1987 Invoking status precommit hook
1987 Invoking status precommit hook
1988 M large.txt
1988 M large.txt
1989 A normal.txt
1989 A normal.txt
1990 Invoking status precommit hook
1990 Invoking status precommit hook
1991 M .hgsubstate
1991 M .hgsubstate
1992 $ hg archive -S ../lf_subrepo_archive
1992 $ hg archive -S ../lf_subrepo_archive
1993 $ find ../lf_subrepo_archive | sort
1993 $ find ../lf_subrepo_archive | sort
1994 ../lf_subrepo_archive
1994 ../lf_subrepo_archive
1995 ../lf_subrepo_archive/.hg_archival.txt
1995 ../lf_subrepo_archive/.hg_archival.txt
1996 ../lf_subrepo_archive/.hgsub
1996 ../lf_subrepo_archive/.hgsub
1997 ../lf_subrepo_archive/.hgsubstate
1997 ../lf_subrepo_archive/.hgsubstate
1998 ../lf_subrepo_archive/a
1998 ../lf_subrepo_archive/a
1999 ../lf_subrepo_archive/a/b
1999 ../lf_subrepo_archive/a/b
2000 ../lf_subrepo_archive/a/b/c
2000 ../lf_subrepo_archive/a/b/c
2001 ../lf_subrepo_archive/a/b/c/d
2001 ../lf_subrepo_archive/a/b/c/d
2002 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2002 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2003 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2003 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2004 ../lf_subrepo_archive/a/b/c/x
2004 ../lf_subrepo_archive/a/b/c/x
2005 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2005 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2006 ../lf_subrepo_archive/subrepo
2006 ../lf_subrepo_archive/subrepo
2007 ../lf_subrepo_archive/subrepo/large.txt
2007 ../lf_subrepo_archive/subrepo/large.txt
2008 ../lf_subrepo_archive/subrepo/normal.txt
2008 ../lf_subrepo_archive/subrepo/normal.txt
2009
2009
2010 Test update with subrepos.
2010 Test update with subrepos.
2011
2011
2012 $ hg update 0
2012 $ hg update 0
2013 getting changed largefiles
2013 getting changed largefiles
2014 0 largefiles updated, 1 removed
2014 0 largefiles updated, 1 removed
2015 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2015 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2016 $ hg status -S
2016 $ hg status -S
2017 $ hg update tip
2017 $ hg update tip
2018 getting changed largefiles
2018 getting changed largefiles
2019 1 largefiles updated, 0 removed
2019 1 largefiles updated, 0 removed
2020 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2020 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2021 $ hg status -S
2021 $ hg status -S
2022 # modify a large file
2022 # modify a large file
2023 $ echo "modified" > subrepo/large.txt
2023 $ echo "modified" > subrepo/large.txt
2024 $ hg st -S
2024 $ hg st -S
2025 M subrepo/large.txt
2025 M subrepo/large.txt
2026 # update -C should revert the change.
2026 # update -C should revert the change.
2027 $ hg update -C
2027 $ hg update -C
2028 getting changed largefiles
2028 getting changed largefiles
2029 1 largefiles updated, 0 removed
2029 1 largefiles updated, 0 removed
2030 getting changed largefiles
2030 getting changed largefiles
2031 0 largefiles updated, 0 removed
2031 0 largefiles updated, 0 removed
2032 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2032 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2033 $ hg status -S
2033 $ hg status -S
2034
2034
2035 Test archiving a revision that references a subrepo that is not yet
2035 Test archiving a revision that references a subrepo that is not yet
2036 cloned (see test-subrepo-recursion.t):
2036 cloned (see test-subrepo-recursion.t):
2037
2037
2038 $ hg clone -U . ../empty
2038 $ hg clone -U . ../empty
2039 $ cd ../empty
2039 $ cd ../empty
2040 $ hg archive --subrepos -r tip ../archive.tar.gz
2040 $ hg archive --subrepos -r tip ../archive.tar.gz
2041 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2041 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2042 $ cd ..
2042 $ cd ..
2043
2043
2044 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2044 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2045
2045
2046 $ hg init addrm2
2046 $ hg init addrm2
2047 $ cd addrm2
2047 $ cd addrm2
2048 $ touch large.dat
2048 $ touch large.dat
2049 $ touch large2.dat
2049 $ touch large2.dat
2050 $ touch normal
2050 $ touch normal
2051 $ hg add --large large.dat
2051 $ hg add --large large.dat
2052 $ hg addremove -v
2052 $ hg addremove -v
2053 adding large2.dat as a largefile
2053 adding large2.dat as a largefile
2054 adding normal
2054 adding normal
2055
2055
2056 Test that forgetting all largefiles reverts to islfilesrepo() == False
2056 Test that forgetting all largefiles reverts to islfilesrepo() == False
2057 (addremove will add *.dat as normal files now)
2057 (addremove will add *.dat as normal files now)
2058 $ hg forget large.dat
2058 $ hg forget large.dat
2059 $ hg forget large2.dat
2059 $ hg forget large2.dat
2060 $ hg addremove -v
2060 $ hg addremove -v
2061 adding large.dat
2061 adding large.dat
2062 adding large2.dat
2062 adding large2.dat
2063
2063
2064 Test commit's addremove option prior to the first commit
2064 Test commit's addremove option prior to the first commit
2065 $ hg forget large.dat
2065 $ hg forget large.dat
2066 $ hg forget large2.dat
2066 $ hg forget large2.dat
2067 $ hg add --large large.dat
2067 $ hg add --large large.dat
2068 $ hg ci -Am "commit"
2068 $ hg ci -Am "commit"
2069 adding large2.dat as a largefile
2069 adding large2.dat as a largefile
2070 Invoking status precommit hook
2070 Invoking status precommit hook
2071 A large.dat
2071 A large.dat
2072 A large2.dat
2072 A large2.dat
2073 A normal
2073 A normal
2074 $ find .hglf | sort
2074 $ find .hglf | sort
2075 .hglf
2075 .hglf
2076 .hglf/large.dat
2076 .hglf/large.dat
2077 .hglf/large2.dat
2077 .hglf/large2.dat
2078
2078
2079 Test actions on largefiles using relative paths from subdir
2079 Test actions on largefiles using relative paths from subdir
2080
2080
2081 $ mkdir sub
2081 $ mkdir sub
2082 $ cd sub
2082 $ cd sub
2083 $ echo anotherlarge > anotherlarge
2083 $ echo anotherlarge > anotherlarge
2084 $ hg add --large anotherlarge
2084 $ hg add --large anotherlarge
2085 $ hg st
2085 $ hg st
2086 A sub/anotherlarge
2086 A sub/anotherlarge
2087 $ hg st anotherlarge
2087 $ hg st anotherlarge
2088 A anotherlarge
2088 A anotherlarge
2089 $ hg commit -m anotherlarge anotherlarge
2089 $ hg commit -m anotherlarge anotherlarge
2090 Invoking status precommit hook
2090 Invoking status precommit hook
2091 A sub/anotherlarge
2091 A sub/anotherlarge
2092 $ hg log anotherlarge
2092 $ hg log anotherlarge
2093 changeset: 1:9627a577c5e9
2093 changeset: 1:9627a577c5e9
2094 tag: tip
2094 tag: tip
2095 user: test
2095 user: test
2096 date: Thu Jan 01 00:00:00 1970 +0000
2096 date: Thu Jan 01 00:00:00 1970 +0000
2097 summary: anotherlarge
2097 summary: anotherlarge
2098
2098
2099 $ echo more >> anotherlarge
2099 $ echo more >> anotherlarge
2100 $ hg st .
2100 $ hg st .
2101 M anotherlarge
2101 M anotherlarge
2102 $ hg cat anotherlarge
2102 $ hg cat anotherlarge
2103 anotherlarge
2103 anotherlarge
2104 $ hg revert anotherlarge
2104 $ hg revert anotherlarge
2105 $ hg st
2105 $ hg st
2106 ? sub/anotherlarge.orig
2106 ? sub/anotherlarge.orig
2107 $ cd ..
2107 $ cd ..
2108
2108
2109 $ cd ..
2109 $ cd ..
2110
2110
2111 issue3651: summary/outgoing with largefiles shows "no remote repo"
2111 issue3651: summary/outgoing with largefiles shows "no remote repo"
2112 unexpectedly
2112 unexpectedly
2113
2113
2114 $ mkdir issue3651
2114 $ mkdir issue3651
2115 $ cd issue3651
2115 $ cd issue3651
2116
2116
2117 $ hg init src
2117 $ hg init src
2118 $ echo a > src/a
2118 $ echo a > src/a
2119 $ hg -R src add --large src/a
2119 $ hg -R src add --large src/a
2120 $ hg -R src commit -m '#0'
2120 $ hg -R src commit -m '#0'
2121 Invoking status precommit hook
2121 Invoking status precommit hook
2122 A a
2122 A a
2123
2123
2124 check messages when no remote repository is specified:
2124 check messages when no remote repository is specified:
2125 "no remote repo" route for "hg outgoing --large" is not tested here,
2125 "no remote repo" route for "hg outgoing --large" is not tested here,
2126 because it can't be reproduced easily.
2126 because it can't be reproduced easily.
2127
2127
2128 $ hg init clone1
2128 $ hg init clone1
2129 $ hg -R clone1 -q pull src
2129 $ hg -R clone1 -q pull src
2130 $ hg -R clone1 -q update
2130 $ hg -R clone1 -q update
2131 $ hg -R clone1 paths | grep default
2131 $ hg -R clone1 paths | grep default
2132 [1]
2132 [1]
2133
2133
2134 $ hg -R clone1 summary --large
2134 $ hg -R clone1 summary --large
2135 parent: 0:fc0bd45326d3 tip
2135 parent: 0:fc0bd45326d3 tip
2136 #0
2136 #0
2137 branch: default
2137 branch: default
2138 commit: (clean)
2138 commit: (clean)
2139 update: (current)
2139 update: (current)
2140 largefiles: (no remote repo)
2140 largefiles: (no remote repo)
2141
2141
2142 check messages when there is no files to upload:
2142 check messages when there is no files to upload:
2143
2143
2144 $ hg -q clone src clone2
2144 $ hg -q clone src clone2
2145 $ hg -R clone2 paths | grep default
2145 $ hg -R clone2 paths | grep default
2146 default = $TESTTMP/issue3651/src (glob)
2146 default = $TESTTMP/issue3651/src (glob)
2147
2147
2148 $ hg -R clone2 summary --large
2148 $ hg -R clone2 summary --large
2149 parent: 0:fc0bd45326d3 tip
2149 parent: 0:fc0bd45326d3 tip
2150 #0
2150 #0
2151 branch: default
2151 branch: default
2152 commit: (clean)
2152 commit: (clean)
2153 update: (current)
2153 update: (current)
2154 searching for changes
2154 searching for changes
2155 largefiles: (no files to upload)
2155 largefiles: (no files to upload)
2156 $ hg -R clone2 outgoing --large
2156 $ hg -R clone2 outgoing --large
2157 comparing with $TESTTMP/issue3651/src (glob)
2157 comparing with $TESTTMP/issue3651/src (glob)
2158 searching for changes
2158 searching for changes
2159 no changes found
2159 no changes found
2160 searching for changes
2160 searching for changes
2161 largefiles: no files to upload
2161 largefiles: no files to upload
2162 [1]
2162 [1]
2163
2163
2164 check messages when there are files to upload:
2164 check messages when there are files to upload:
2165
2165
2166 $ echo b > clone2/b
2166 $ echo b > clone2/b
2167 $ hg -R clone2 add --large clone2/b
2167 $ hg -R clone2 add --large clone2/b
2168 $ hg -R clone2 commit -m '#1'
2168 $ hg -R clone2 commit -m '#1'
2169 Invoking status precommit hook
2169 Invoking status precommit hook
2170 A b
2170 A b
2171 $ hg -R clone2 summary --large
2171 $ hg -R clone2 summary --large
2172 parent: 1:1acbe71ce432 tip
2172 parent: 1:1acbe71ce432 tip
2173 #1
2173 #1
2174 branch: default
2174 branch: default
2175 commit: (clean)
2175 commit: (clean)
2176 update: (current)
2176 update: (current)
2177 searching for changes
2177 searching for changes
2178 largefiles: 1 to upload
2178 largefiles: 1 to upload
2179 $ hg -R clone2 outgoing --large
2179 $ hg -R clone2 outgoing --large
2180 comparing with $TESTTMP/issue3651/src (glob)
2180 comparing with $TESTTMP/issue3651/src (glob)
2181 searching for changes
2181 searching for changes
2182 changeset: 1:1acbe71ce432
2182 changeset: 1:1acbe71ce432
2183 tag: tip
2183 tag: tip
2184 user: test
2184 user: test
2185 date: Thu Jan 01 00:00:00 1970 +0000
2185 date: Thu Jan 01 00:00:00 1970 +0000
2186 summary: #1
2186 summary: #1
2187
2187
2188 searching for changes
2188 searching for changes
2189 largefiles to upload:
2189 largefiles to upload:
2190 b
2190 b
2191
2191
2192
2192
2193 $ cd ..
2193 $ cd ..
2194
2194
2195 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2195 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2196
2196
2197 $ hg init merge-action
2197 $ hg init merge-action
2198 $ cd merge-action
2198 $ cd merge-action
2199 $ touch l
2199 $ touch l
2200 $ hg add --large l
2200 $ hg add --large l
2201 $ mkdir d1
2201 $ mkdir d1
2202 $ touch d1/f
2202 $ touch d1/f
2203 $ hg ci -Aqm0
2203 $ hg ci -Aqm0
2204 Invoking status precommit hook
2204 Invoking status precommit hook
2205 A d1/f
2205 A d1/f
2206 A l
2206 A l
2207 $ echo > d1/f
2207 $ echo > d1/f
2208 $ touch d1/g
2208 $ touch d1/g
2209 $ hg ci -Aqm1
2209 $ hg ci -Aqm1
2210 Invoking status precommit hook
2210 Invoking status precommit hook
2211 M d1/f
2211 M d1/f
2212 A d1/g
2212 A d1/g
2213 $ hg up -qr0
2213 $ hg up -qr0
2214 $ hg mv d1 d2
2214 $ hg mv d1 d2
2215 moving d1/f to d2/f (glob)
2215 moving d1/f to d2/f (glob)
2216 $ hg ci -qm2
2216 $ hg ci -qm2
2217 Invoking status precommit hook
2217 Invoking status precommit hook
2218 A d2/f
2218 A d2/f
2219 R d1/f
2219 R d1/f
2220 $ hg merge
2220 $ hg merge
2221 merging d2/f and d1/f to d2/f
2221 merging d2/f and d1/f to d2/f
2222 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2222 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2223 (branch merge, don't forget to commit)
2223 (branch merge, don't forget to commit)
2224 getting changed largefiles
2224 getting changed largefiles
2225 0 largefiles updated, 0 removed
2225 0 largefiles updated, 0 removed
2226 $ cd ..
2226 $ cd ..
2227
2227
2228 Check whether "largefiles" feature is supported only in repositories
2228 Check whether "largefiles" feature is supported only in repositories
2229 enabling largefiles extension.
2229 enabling largefiles extension.
2230
2230
2231 $ mkdir individualenabling
2231 $ mkdir individualenabling
2232 $ cd individualenabling
2232 $ cd individualenabling
2233
2233
2234 $ hg init enabledlocally
2234 $ hg init enabledlocally
2235 $ echo large > enabledlocally/large
2235 $ echo large > enabledlocally/large
2236 $ hg -R enabledlocally add --large enabledlocally/large
2236 $ hg -R enabledlocally add --large enabledlocally/large
2237 $ hg -R enabledlocally commit -m '#0'
2237 $ hg -R enabledlocally commit -m '#0'
2238 Invoking status precommit hook
2238 Invoking status precommit hook
2239 A large
2239 A large
2240
2240
2241 $ hg init notenabledlocally
2241 $ hg init notenabledlocally
2242 $ echo large > notenabledlocally/large
2242 $ echo large > notenabledlocally/large
2243 $ hg -R notenabledlocally add --large notenabledlocally/large
2243 $ hg -R notenabledlocally add --large notenabledlocally/large
2244 $ hg -R notenabledlocally commit -m '#0'
2244 $ hg -R notenabledlocally commit -m '#0'
2245 Invoking status precommit hook
2245 Invoking status precommit hook
2246 A large
2246 A large
2247
2247
2248 $ cat >> $HGRCPATH <<EOF
2248 $ cat >> $HGRCPATH <<EOF
2249 > [extensions]
2249 > [extensions]
2250 > # disable globally
2250 > # disable globally
2251 > largefiles=!
2251 > largefiles=!
2252 > EOF
2252 > EOF
2253 $ cat >> enabledlocally/.hg/hgrc <<EOF
2253 $ cat >> enabledlocally/.hg/hgrc <<EOF
2254 > [extensions]
2254 > [extensions]
2255 > # enable locally
2255 > # enable locally
2256 > largefiles=
2256 > largefiles=
2257 > EOF
2257 > EOF
2258 $ hg -R enabledlocally root
2258 $ hg -R enabledlocally root
2259 $TESTTMP/individualenabling/enabledlocally (glob)
2259 $TESTTMP/individualenabling/enabledlocally (glob)
2260 $ hg -R notenabledlocally root
2260 $ hg -R notenabledlocally root
2261 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2261 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2262 [255]
2262 [255]
2263
2263
2264 $ hg init push-dst
2264 $ hg init push-dst
2265 $ hg -R enabledlocally push push-dst
2265 $ hg -R enabledlocally push push-dst
2266 pushing to push-dst
2266 pushing to push-dst
2267 abort: required features are not supported in the destination: largefiles
2267 abort: required features are not supported in the destination: largefiles
2268 [255]
2268 [255]
2269
2269
2270 $ hg init pull-src
2270 $ hg init pull-src
2271 $ hg -R pull-src pull enabledlocally
2271 $ hg -R pull-src pull enabledlocally
2272 pulling from enabledlocally
2272 pulling from enabledlocally
2273 abort: required features are not supported in the destination: largefiles
2273 abort: required features are not supported in the destination: largefiles
2274 [255]
2274 [255]
2275
2275
2276 $ hg clone enabledlocally clone-dst
2276 $ hg clone enabledlocally clone-dst
2277 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2277 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2278 [255]
2278 [255]
2279 $ test -d clone-dst
2279 $ test -d clone-dst
2280 [1]
2280 [1]
2281 $ hg clone --pull enabledlocally clone-pull-dst
2281 $ hg clone --pull enabledlocally clone-pull-dst
2282 abort: required features are not supported in the destination: largefiles
2282 abort: required features are not supported in the destination: largefiles
2283 [255]
2283 [255]
2284 $ test -d clone-pull-dst
2284 $ test -d clone-pull-dst
2285 [1]
2285 [1]
2286
2286
2287 $ cd ..
2287 $ cd ..
@@ -1,450 +1,461 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 >
4 >
5 > [phases]
5 > [phases]
6 > publish=False
6 > publish=False
7 >
7 >
8 > [alias]
8 > [alias]
9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 > EOF
10 > EOF
11
11
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
15 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
16 adding changesets
16 adding changesets
17 adding manifests
17 adding manifests
18 adding file changes
18 adding file changes
19 added 8 changesets with 7 changes to 7 files (+2 heads)
19 added 8 changesets with 7 changes to 7 files (+2 heads)
20 (run 'hg heads' to see heads, 'hg merge' to merge)
20 (run 'hg heads' to see heads, 'hg merge' to merge)
21 $ hg up tip
21 $ hg up tip
22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
23
23
24 $ echo I > I
24 $ echo I > I
25 $ hg ci -AmI
25 $ hg ci -AmI
26 adding I
26 adding I
27
27
28 $ hg tglog
28 $ hg tglog
29 @ 8: 'I'
29 @ 8: 'I'
30 |
30 |
31 o 7: 'H'
31 o 7: 'H'
32 |
32 |
33 | o 6: 'G'
33 | o 6: 'G'
34 |/|
34 |/|
35 o | 5: 'F'
35 o | 5: 'F'
36 | |
36 | |
37 | o 4: 'E'
37 | o 4: 'E'
38 |/
38 |/
39 | o 3: 'D'
39 | o 3: 'D'
40 | |
40 | |
41 | o 2: 'C'
41 | o 2: 'C'
42 | |
42 | |
43 | o 1: 'B'
43 | o 1: 'B'
44 |/
44 |/
45 o 0: 'A'
45 o 0: 'A'
46
46
47 $ cd ..
47 $ cd ..
48
48
49
49
50 These fail:
50 These fail:
51
51
52 $ hg clone -q -u . a a1
52 $ hg clone -q -u . a a1
53 $ cd a1
53 $ cd a1
54
54
55 $ hg rebase -s 8 -d 7
55 $ hg rebase -s 8 -d 7
56 nothing to rebase
56 nothing to rebase
57 [1]
57 [1]
58
58
59 $ hg rebase --continue --abort
59 $ hg rebase --continue --abort
60 abort: cannot use both abort and continue
60 abort: cannot use both abort and continue
61 [255]
61 [255]
62
62
63 $ hg rebase --continue --collapse
63 $ hg rebase --continue --collapse
64 abort: cannot use collapse with continue or abort
64 abort: cannot use collapse with continue or abort
65 [255]
65 [255]
66
66
67 $ hg rebase --continue --dest 4
67 $ hg rebase --continue --dest 4
68 abort: abort and continue do not allow specifying revisions
68 abort: abort and continue do not allow specifying revisions
69 [255]
69 [255]
70
70
71 $ hg rebase --base 5 --source 4
71 $ hg rebase --base 5 --source 4
72 abort: cannot specify both a source and a base
72 abort: cannot specify both a source and a base
73 [255]
73 [255]
74
74
75 $ hg rebase --rev 5 --source 4
75 $ hg rebase --rev 5 --source 4
76 abort: cannot specify both a revision and a source
76 abort: cannot specify both a revision and a source
77 [255]
77 [255]
78 $ hg rebase --base 5 --rev 4
78 $ hg rebase --base 5 --rev 4
79 abort: cannot specify both a revision and a base
79 abort: cannot specify both a revision and a base
80 [255]
80 [255]
81
81
82 $ hg rebase --rev '1 & !1'
82 $ hg rebase --rev '1 & !1'
83 abort: empty "rev" revision set - nothing to rebase
83 abort: empty "rev" revision set - nothing to rebase
84 [255]
84 [255]
85
85
86 $ hg rebase --source '1 & !1'
86 $ hg rebase --source '1 & !1'
87 abort: empty "source" revision set - nothing to rebase
87 abort: empty "source" revision set - nothing to rebase
88 [255]
88 [255]
89
89
90 $ hg rebase --base '1 & !1'
91 abort: empty "base" revision set - can't compute rebase set
92 [255]
93
90 $ hg rebase
94 $ hg rebase
91 nothing to rebase
95 nothing to rebase - working directory parent is also destination
96 [1]
97
98 $ hg rebase -b.
99 nothing to rebase - e7ec4e813ba6 is both "base" and destination
92 [1]
100 [1]
93
101
94 $ hg up -q 7
102 $ hg up -q 7
95
103
96 $ hg rebase --traceback
104 $ hg rebase --traceback
97 nothing to rebase
105 nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6
106 [1]
107
108 $ hg rebase -b.
109 nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6
98 [1]
110 [1]
99
111
100 $ hg rebase --dest '1 & !1'
112 $ hg rebase --dest '1 & !1'
101 abort: empty revision set
113 abort: empty revision set
102 [255]
114 [255]
103
115
104 These work:
116 These work:
105
117
106 Rebase with no arguments (from 3 onto 8):
118 Rebase with no arguments (from 3 onto 8):
107
119
108 $ hg up -q -C 3
120 $ hg up -q -C 3
109
121
110 $ hg rebase
122 $ hg rebase
111 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
123 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
112
124
113 $ hg tglog
125 $ hg tglog
114 @ 8: 'D'
126 @ 8: 'D'
115 |
127 |
116 o 7: 'C'
128 o 7: 'C'
117 |
129 |
118 o 6: 'B'
130 o 6: 'B'
119 |
131 |
120 o 5: 'I'
132 o 5: 'I'
121 |
133 |
122 o 4: 'H'
134 o 4: 'H'
123 |
135 |
124 | o 3: 'G'
136 | o 3: 'G'
125 |/|
137 |/|
126 o | 2: 'F'
138 o | 2: 'F'
127 | |
139 | |
128 | o 1: 'E'
140 | o 1: 'E'
129 |/
141 |/
130 o 0: 'A'
142 o 0: 'A'
131
143
132 Try to rollback after a rebase (fail):
144 Try to rollback after a rebase (fail):
133
145
134 $ hg rollback
146 $ hg rollback
135 no rollback information available
147 no rollback information available
136 [1]
148 [1]
137
149
138 $ cd ..
150 $ cd ..
139
151
140
141 Rebase with base == '.' => same as no arguments (from 3 onto 8):
152 Rebase with base == '.' => same as no arguments (from 3 onto 8):
142
153
143 $ hg clone -q -u 3 a a2
154 $ hg clone -q -u 3 a a2
144 $ cd a2
155 $ cd a2
145
156
146 $ hg rebase --base .
157 $ hg rebase --base .
147 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
158 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
148
159
149 $ hg tglog
160 $ hg tglog
150 @ 8: 'D'
161 @ 8: 'D'
151 |
162 |
152 o 7: 'C'
163 o 7: 'C'
153 |
164 |
154 o 6: 'B'
165 o 6: 'B'
155 |
166 |
156 o 5: 'I'
167 o 5: 'I'
157 |
168 |
158 o 4: 'H'
169 o 4: 'H'
159 |
170 |
160 | o 3: 'G'
171 | o 3: 'G'
161 |/|
172 |/|
162 o | 2: 'F'
173 o | 2: 'F'
163 | |
174 | |
164 | o 1: 'E'
175 | o 1: 'E'
165 |/
176 |/
166 o 0: 'A'
177 o 0: 'A'
167
178
168 $ cd ..
179 $ cd ..
169
180
170
181
171 Rebase with dest == branch(.) => same as no arguments (from 3 onto 8):
182 Rebase with dest == branch(.) => same as no arguments (from 3 onto 8):
172
183
173 $ hg clone -q -u 3 a a3
184 $ hg clone -q -u 3 a a3
174 $ cd a3
185 $ cd a3
175
186
176 $ hg rebase --dest 'branch(.)'
187 $ hg rebase --dest 'branch(.)'
177 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
188 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
178
189
179 $ hg tglog
190 $ hg tglog
180 @ 8: 'D'
191 @ 8: 'D'
181 |
192 |
182 o 7: 'C'
193 o 7: 'C'
183 |
194 |
184 o 6: 'B'
195 o 6: 'B'
185 |
196 |
186 o 5: 'I'
197 o 5: 'I'
187 |
198 |
188 o 4: 'H'
199 o 4: 'H'
189 |
200 |
190 | o 3: 'G'
201 | o 3: 'G'
191 |/|
202 |/|
192 o | 2: 'F'
203 o | 2: 'F'
193 | |
204 | |
194 | o 1: 'E'
205 | o 1: 'E'
195 |/
206 |/
196 o 0: 'A'
207 o 0: 'A'
197
208
198 $ cd ..
209 $ cd ..
199
210
200
211
201 Specify only source (from 2 onto 8):
212 Specify only source (from 2 onto 8):
202
213
203 $ hg clone -q -u . a a4
214 $ hg clone -q -u . a a4
204 $ cd a4
215 $ cd a4
205
216
206 $ hg rebase --source 'desc("C")'
217 $ hg rebase --source 'desc("C")'
207 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
218 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
208
219
209 $ hg tglog
220 $ hg tglog
210 o 8: 'D'
221 o 8: 'D'
211 |
222 |
212 o 7: 'C'
223 o 7: 'C'
213 |
224 |
214 @ 6: 'I'
225 @ 6: 'I'
215 |
226 |
216 o 5: 'H'
227 o 5: 'H'
217 |
228 |
218 | o 4: 'G'
229 | o 4: 'G'
219 |/|
230 |/|
220 o | 3: 'F'
231 o | 3: 'F'
221 | |
232 | |
222 | o 2: 'E'
233 | o 2: 'E'
223 |/
234 |/
224 | o 1: 'B'
235 | o 1: 'B'
225 |/
236 |/
226 o 0: 'A'
237 o 0: 'A'
227
238
228 $ cd ..
239 $ cd ..
229
240
230
241
231 Specify only dest (from 3 onto 6):
242 Specify only dest (from 3 onto 6):
232
243
233 $ hg clone -q -u 3 a a5
244 $ hg clone -q -u 3 a a5
234 $ cd a5
245 $ cd a5
235
246
236 $ hg rebase --dest 6
247 $ hg rebase --dest 6
237 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
248 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
238
249
239 $ hg tglog
250 $ hg tglog
240 @ 8: 'D'
251 @ 8: 'D'
241 |
252 |
242 o 7: 'C'
253 o 7: 'C'
243 |
254 |
244 o 6: 'B'
255 o 6: 'B'
245 |
256 |
246 | o 5: 'I'
257 | o 5: 'I'
247 | |
258 | |
248 | o 4: 'H'
259 | o 4: 'H'
249 | |
260 | |
250 o | 3: 'G'
261 o | 3: 'G'
251 |\|
262 |\|
252 | o 2: 'F'
263 | o 2: 'F'
253 | |
264 | |
254 o | 1: 'E'
265 o | 1: 'E'
255 |/
266 |/
256 o 0: 'A'
267 o 0: 'A'
257
268
258 $ cd ..
269 $ cd ..
259
270
260
271
261 Specify only base (from 1 onto 8):
272 Specify only base (from 1 onto 8):
262
273
263 $ hg clone -q -u . a a6
274 $ hg clone -q -u . a a6
264 $ cd a6
275 $ cd a6
265
276
266 $ hg rebase --base 'desc("D")'
277 $ hg rebase --base 'desc("D")'
267 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
278 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
268
279
269 $ hg tglog
280 $ hg tglog
270 o 8: 'D'
281 o 8: 'D'
271 |
282 |
272 o 7: 'C'
283 o 7: 'C'
273 |
284 |
274 o 6: 'B'
285 o 6: 'B'
275 |
286 |
276 @ 5: 'I'
287 @ 5: 'I'
277 |
288 |
278 o 4: 'H'
289 o 4: 'H'
279 |
290 |
280 | o 3: 'G'
291 | o 3: 'G'
281 |/|
292 |/|
282 o | 2: 'F'
293 o | 2: 'F'
283 | |
294 | |
284 | o 1: 'E'
295 | o 1: 'E'
285 |/
296 |/
286 o 0: 'A'
297 o 0: 'A'
287
298
288 $ cd ..
299 $ cd ..
289
300
290
301
291 Specify source and dest (from 2 onto 7):
302 Specify source and dest (from 2 onto 7):
292
303
293 $ hg clone -q -u . a a7
304 $ hg clone -q -u . a a7
294 $ cd a7
305 $ cd a7
295
306
296 $ hg rebase --source 2 --dest 7
307 $ hg rebase --source 2 --dest 7
297 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob)
308 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob)
298
309
299 $ hg tglog
310 $ hg tglog
300 o 8: 'D'
311 o 8: 'D'
301 |
312 |
302 o 7: 'C'
313 o 7: 'C'
303 |
314 |
304 | @ 6: 'I'
315 | @ 6: 'I'
305 |/
316 |/
306 o 5: 'H'
317 o 5: 'H'
307 |
318 |
308 | o 4: 'G'
319 | o 4: 'G'
309 |/|
320 |/|
310 o | 3: 'F'
321 o | 3: 'F'
311 | |
322 | |
312 | o 2: 'E'
323 | o 2: 'E'
313 |/
324 |/
314 | o 1: 'B'
325 | o 1: 'B'
315 |/
326 |/
316 o 0: 'A'
327 o 0: 'A'
317
328
318 $ cd ..
329 $ cd ..
319
330
320
331
321 Specify base and dest (from 1 onto 7):
332 Specify base and dest (from 1 onto 7):
322
333
323 $ hg clone -q -u . a a8
334 $ hg clone -q -u . a a8
324 $ cd a8
335 $ cd a8
325
336
326 $ hg rebase --base 3 --dest 7
337 $ hg rebase --base 3 --dest 7
327 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob)
338 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob)
328
339
329 $ hg tglog
340 $ hg tglog
330 o 8: 'D'
341 o 8: 'D'
331 |
342 |
332 o 7: 'C'
343 o 7: 'C'
333 |
344 |
334 o 6: 'B'
345 o 6: 'B'
335 |
346 |
336 | @ 5: 'I'
347 | @ 5: 'I'
337 |/
348 |/
338 o 4: 'H'
349 o 4: 'H'
339 |
350 |
340 | o 3: 'G'
351 | o 3: 'G'
341 |/|
352 |/|
342 o | 2: 'F'
353 o | 2: 'F'
343 | |
354 | |
344 | o 1: 'E'
355 | o 1: 'E'
345 |/
356 |/
346 o 0: 'A'
357 o 0: 'A'
347
358
348 $ cd ..
359 $ cd ..
349
360
350
361
351 Specify only revs (from 2 onto 8)
362 Specify only revs (from 2 onto 8)
352
363
353 $ hg clone -q -u . a a9
364 $ hg clone -q -u . a a9
354 $ cd a9
365 $ cd a9
355
366
356 $ hg rebase --rev 'desc("C")::'
367 $ hg rebase --rev 'desc("C")::'
357 saved backup bundle to $TESTTMP/a9/.hg/strip-backup/*-backup.hg (glob)
368 saved backup bundle to $TESTTMP/a9/.hg/strip-backup/*-backup.hg (glob)
358
369
359 $ hg tglog
370 $ hg tglog
360 o 8: 'D'
371 o 8: 'D'
361 |
372 |
362 o 7: 'C'
373 o 7: 'C'
363 |
374 |
364 @ 6: 'I'
375 @ 6: 'I'
365 |
376 |
366 o 5: 'H'
377 o 5: 'H'
367 |
378 |
368 | o 4: 'G'
379 | o 4: 'G'
369 |/|
380 |/|
370 o | 3: 'F'
381 o | 3: 'F'
371 | |
382 | |
372 | o 2: 'E'
383 | o 2: 'E'
373 |/
384 |/
374 | o 1: 'B'
385 | o 1: 'B'
375 |/
386 |/
376 o 0: 'A'
387 o 0: 'A'
377
388
378 $ cd ..
389 $ cd ..
379
390
380 Test --tool parameter:
391 Test --tool parameter:
381
392
382 $ hg init b
393 $ hg init b
383 $ cd b
394 $ cd b
384
395
385 $ echo c1 > c1
396 $ echo c1 > c1
386 $ hg ci -Am c1
397 $ hg ci -Am c1
387 adding c1
398 adding c1
388
399
389 $ echo c2 > c2
400 $ echo c2 > c2
390 $ hg ci -Am c2
401 $ hg ci -Am c2
391 adding c2
402 adding c2
392
403
393 $ hg up -q 0
404 $ hg up -q 0
394 $ echo c2b > c2
405 $ echo c2b > c2
395 $ hg ci -Am c2b
406 $ hg ci -Am c2b
396 adding c2
407 adding c2
397 created new head
408 created new head
398
409
399 $ cd ..
410 $ cd ..
400
411
401 $ hg clone -q -u . b b1
412 $ hg clone -q -u . b b1
402 $ cd b1
413 $ cd b1
403
414
404 $ hg rebase -s 2 -d 1 --tool internal:local
415 $ hg rebase -s 2 -d 1 --tool internal:local
405 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
416 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
406
417
407 $ hg cat c2
418 $ hg cat c2
408 c2
419 c2
409
420
410 $ cd ..
421 $ cd ..
411
422
412
423
413 $ hg clone -q -u . b b2
424 $ hg clone -q -u . b b2
414 $ cd b2
425 $ cd b2
415
426
416 $ hg rebase -s 2 -d 1 --tool internal:other
427 $ hg rebase -s 2 -d 1 --tool internal:other
417 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/*-backup.hg (glob)
428 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/*-backup.hg (glob)
418
429
419 $ hg cat c2
430 $ hg cat c2
420 c2b
431 c2b
421
432
422 $ cd ..
433 $ cd ..
423
434
424
435
425 $ hg clone -q -u . b b3
436 $ hg clone -q -u . b b3
426 $ cd b3
437 $ cd b3
427
438
428 $ hg rebase -s 2 -d 1 --tool internal:fail
439 $ hg rebase -s 2 -d 1 --tool internal:fail
429 unresolved conflicts (see hg resolve, then hg rebase --continue)
440 unresolved conflicts (see hg resolve, then hg rebase --continue)
430 [1]
441 [1]
431
442
432 $ hg summary
443 $ hg summary
433 parent: 1:56daeba07f4b
444 parent: 1:56daeba07f4b
434 c2
445 c2
435 parent: 2:e4e3f3546619 tip
446 parent: 2:e4e3f3546619 tip
436 c2b
447 c2b
437 branch: default
448 branch: default
438 commit: 1 modified, 1 unresolved (merge)
449 commit: 1 modified, 1 unresolved (merge)
439 update: (current)
450 update: (current)
440 rebase: 0 rebased, 1 remaining (rebase --continue)
451 rebase: 0 rebased, 1 remaining (rebase --continue)
441
452
442 $ hg resolve -l
453 $ hg resolve -l
443 U c2
454 U c2
444
455
445 $ hg resolve -m c2
456 $ hg resolve -m c2
446 $ hg rebase -c --tool internal:fail
457 $ hg rebase -c --tool internal:fail
447 tool option will be ignored
458 tool option will be ignored
448 saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob)
459 saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob)
449
460
450 $ cd ..
461 $ cd ..
@@ -1,167 +1,167 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 >
4 >
5 > [alias]
5 > [alias]
6 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
6 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
7 > EOF
7 > EOF
8
8
9
9
10 $ hg init a
10 $ hg init a
11 $ cd a
11 $ cd a
12
12
13 $ echo C1 > C1
13 $ echo C1 > C1
14 $ hg ci -Am C1
14 $ hg ci -Am C1
15 adding C1
15 adding C1
16
16
17 $ echo C2 > C2
17 $ echo C2 > C2
18 $ hg ci -Am C2
18 $ hg ci -Am C2
19 adding C2
19 adding C2
20
20
21 $ cd ..
21 $ cd ..
22
22
23 $ hg clone a b
23 $ hg clone a b
24 updating to branch default
24 updating to branch default
25 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
26
26
27 $ hg clone a c
27 $ hg clone a c
28 updating to branch default
28 updating to branch default
29 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
30
30
31 $ cd b
31 $ cd b
32
32
33 $ echo L1 > L1
33 $ echo L1 > L1
34 $ hg ci -Am L1
34 $ hg ci -Am L1
35 adding L1
35 adding L1
36
36
37
37
38 $ cd ../a
38 $ cd ../a
39
39
40 $ echo R1 > R1
40 $ echo R1 > R1
41 $ hg ci -Am R1
41 $ hg ci -Am R1
42 adding R1
42 adding R1
43
43
44
44
45 $ cd ../b
45 $ cd ../b
46
46
47 Now b has one revision to be pulled from a:
47 Now b has one revision to be pulled from a:
48
48
49 $ hg pull --rebase
49 $ hg pull --rebase
50 pulling from $TESTTMP/a (glob)
50 pulling from $TESTTMP/a (glob)
51 searching for changes
51 searching for changes
52 adding changesets
52 adding changesets
53 adding manifests
53 adding manifests
54 adding file changes
54 adding file changes
55 added 1 changesets with 1 changes to 1 files (+1 heads)
55 added 1 changesets with 1 changes to 1 files (+1 heads)
56 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
56 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
57
57
58 $ hg tglog
58 $ hg tglog
59 @ 3: 'L1'
59 @ 3: 'L1'
60 |
60 |
61 o 2: 'R1'
61 o 2: 'R1'
62 |
62 |
63 o 1: 'C2'
63 o 1: 'C2'
64 |
64 |
65 o 0: 'C1'
65 o 0: 'C1'
66
66
67 Re-run:
67 Re-run:
68
68
69 $ hg pull --rebase
69 $ hg pull --rebase
70 pulling from $TESTTMP/a (glob)
70 pulling from $TESTTMP/a (glob)
71 searching for changes
71 searching for changes
72 no changes found
72 no changes found
73
73
74
74
75 Invoke pull --rebase and nothing to rebase:
75 Invoke pull --rebase and nothing to rebase:
76
76
77 $ cd ../c
77 $ cd ../c
78
78
79 $ hg book norebase
79 $ hg book norebase
80 $ hg pull --rebase
80 $ hg pull --rebase
81 pulling from $TESTTMP/a (glob)
81 pulling from $TESTTMP/a (glob)
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 added 1 changesets with 1 changes to 1 files
86 added 1 changesets with 1 changes to 1 files
87 nothing to rebase
87 nothing to rebase - working directory parent is already an ancestor of destination 77ae9631bcca
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 updating bookmark norebase
89 updating bookmark norebase
90
90
91 $ hg tglog -l 1
91 $ hg tglog -l 1
92 @ 2: 'R1'
92 @ 2: 'R1'
93 |
93 |
94
94
95 pull --rebase --update should ignore --update:
95 pull --rebase --update should ignore --update:
96
96
97 $ hg pull --rebase --update
97 $ hg pull --rebase --update
98 pulling from $TESTTMP/a (glob)
98 pulling from $TESTTMP/a (glob)
99 searching for changes
99 searching for changes
100 no changes found
100 no changes found
101
101
102 pull --rebase doesn't update if nothing has been pulled:
102 pull --rebase doesn't update if nothing has been pulled:
103
103
104 $ hg up -q 1
104 $ hg up -q 1
105
105
106 $ hg pull --rebase
106 $ hg pull --rebase
107 pulling from $TESTTMP/a (glob)
107 pulling from $TESTTMP/a (glob)
108 searching for changes
108 searching for changes
109 no changes found
109 no changes found
110
110
111 $ hg tglog -l 1
111 $ hg tglog -l 1
112 o 2: 'R1'
112 o 2: 'R1'
113 |
113 |
114
114
115 $ cd ..
115 $ cd ..
116
116
117 pull --rebase works when a specific revision is pulled (issue3619)
117 pull --rebase works when a specific revision is pulled (issue3619)
118
118
119 $ cd a
119 $ cd a
120 $ hg tglog
120 $ hg tglog
121 @ 2: 'R1'
121 @ 2: 'R1'
122 |
122 |
123 o 1: 'C2'
123 o 1: 'C2'
124 |
124 |
125 o 0: 'C1'
125 o 0: 'C1'
126
126
127 $ echo R2 > R2
127 $ echo R2 > R2
128 $ hg ci -Am R2
128 $ hg ci -Am R2
129 adding R2
129 adding R2
130 $ echo R3 > R3
130 $ echo R3 > R3
131 $ hg ci -Am R3
131 $ hg ci -Am R3
132 adding R3
132 adding R3
133 $ cd ../c
133 $ cd ../c
134 $ hg tglog
134 $ hg tglog
135 o 2: 'R1'
135 o 2: 'R1'
136 |
136 |
137 @ 1: 'C2'
137 @ 1: 'C2'
138 |
138 |
139 o 0: 'C1'
139 o 0: 'C1'
140
140
141 $ echo L1 > L1
141 $ echo L1 > L1
142 $ hg ci -Am L1
142 $ hg ci -Am L1
143 adding L1
143 adding L1
144 created new head
144 created new head
145 $ hg pull --rev tip --rebase
145 $ hg pull --rev tip --rebase
146 pulling from $TESTTMP/a (glob)
146 pulling from $TESTTMP/a (glob)
147 searching for changes
147 searching for changes
148 adding changesets
148 adding changesets
149 adding manifests
149 adding manifests
150 adding file changes
150 adding file changes
151 added 2 changesets with 2 changes to 2 files
151 added 2 changesets with 2 changes to 2 files
152 saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-backup.hg (glob)
152 saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-backup.hg (glob)
153 $ hg tglog
153 $ hg tglog
154 @ 5: 'L1'
154 @ 5: 'L1'
155 |
155 |
156 o 4: 'R3'
156 o 4: 'R3'
157 |
157 |
158 o 3: 'R2'
158 o 3: 'R2'
159 |
159 |
160 o 2: 'R1'
160 o 2: 'R1'
161 |
161 |
162 o 1: 'C2'
162 o 1: 'C2'
163 |
163 |
164 o 0: 'C1'
164 o 0: 'C1'
165
165
166
166
167
167
@@ -1,651 +1,651 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 >
4 >
5 > [phases]
5 > [phases]
6 > publish=False
6 > publish=False
7 >
7 >
8 > [alias]
8 > [alias]
9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
9 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 > EOF
10 > EOF
11
11
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
15 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
16 adding changesets
16 adding changesets
17 adding manifests
17 adding manifests
18 adding file changes
18 adding file changes
19 added 8 changesets with 7 changes to 7 files (+2 heads)
19 added 8 changesets with 7 changes to 7 files (+2 heads)
20 (run 'hg heads' to see heads, 'hg merge' to merge)
20 (run 'hg heads' to see heads, 'hg merge' to merge)
21 $ hg up tip
21 $ hg up tip
22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 $ cd ..
23 $ cd ..
24
24
25
25
26 Rebasing
26 Rebasing
27 D onto H - simple rebase:
27 D onto H - simple rebase:
28
28
29 $ hg clone -q -u . a a1
29 $ hg clone -q -u . a a1
30 $ cd a1
30 $ cd a1
31
31
32 $ hg tglog
32 $ hg tglog
33 @ 7: 'H'
33 @ 7: 'H'
34 |
34 |
35 | o 6: 'G'
35 | o 6: 'G'
36 |/|
36 |/|
37 o | 5: 'F'
37 o | 5: 'F'
38 | |
38 | |
39 | o 4: 'E'
39 | o 4: 'E'
40 |/
40 |/
41 | o 3: 'D'
41 | o 3: 'D'
42 | |
42 | |
43 | o 2: 'C'
43 | o 2: 'C'
44 | |
44 | |
45 | o 1: 'B'
45 | o 1: 'B'
46 |/
46 |/
47 o 0: 'A'
47 o 0: 'A'
48
48
49
49
50 $ hg rebase -s 3 -d 7
50 $ hg rebase -s 3 -d 7
51 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
51 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
52
52
53 $ hg tglog
53 $ hg tglog
54 o 7: 'D'
54 o 7: 'D'
55 |
55 |
56 @ 6: 'H'
56 @ 6: 'H'
57 |
57 |
58 | o 5: 'G'
58 | o 5: 'G'
59 |/|
59 |/|
60 o | 4: 'F'
60 o | 4: 'F'
61 | |
61 | |
62 | o 3: 'E'
62 | o 3: 'E'
63 |/
63 |/
64 | o 2: 'C'
64 | o 2: 'C'
65 | |
65 | |
66 | o 1: 'B'
66 | o 1: 'B'
67 |/
67 |/
68 o 0: 'A'
68 o 0: 'A'
69
69
70 $ cd ..
70 $ cd ..
71
71
72
72
73 D onto F - intermediate point:
73 D onto F - intermediate point:
74
74
75 $ hg clone -q -u . a a2
75 $ hg clone -q -u . a a2
76 $ cd a2
76 $ cd a2
77
77
78 $ hg rebase -s 3 -d 5
78 $ hg rebase -s 3 -d 5
79 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
79 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
80
80
81 $ hg tglog
81 $ hg tglog
82 o 7: 'D'
82 o 7: 'D'
83 |
83 |
84 | @ 6: 'H'
84 | @ 6: 'H'
85 |/
85 |/
86 | o 5: 'G'
86 | o 5: 'G'
87 |/|
87 |/|
88 o | 4: 'F'
88 o | 4: 'F'
89 | |
89 | |
90 | o 3: 'E'
90 | o 3: 'E'
91 |/
91 |/
92 | o 2: 'C'
92 | o 2: 'C'
93 | |
93 | |
94 | o 1: 'B'
94 | o 1: 'B'
95 |/
95 |/
96 o 0: 'A'
96 o 0: 'A'
97
97
98 $ cd ..
98 $ cd ..
99
99
100
100
101 E onto H - skip of G:
101 E onto H - skip of G:
102
102
103 $ hg clone -q -u . a a3
103 $ hg clone -q -u . a a3
104 $ cd a3
104 $ cd a3
105
105
106 $ hg rebase -s 4 -d 7
106 $ hg rebase -s 4 -d 7
107 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
107 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
108
108
109 $ hg tglog
109 $ hg tglog
110 o 6: 'E'
110 o 6: 'E'
111 |
111 |
112 @ 5: 'H'
112 @ 5: 'H'
113 |
113 |
114 o 4: 'F'
114 o 4: 'F'
115 |
115 |
116 | o 3: 'D'
116 | o 3: 'D'
117 | |
117 | |
118 | o 2: 'C'
118 | o 2: 'C'
119 | |
119 | |
120 | o 1: 'B'
120 | o 1: 'B'
121 |/
121 |/
122 o 0: 'A'
122 o 0: 'A'
123
123
124 $ cd ..
124 $ cd ..
125
125
126
126
127 F onto E - rebase of a branching point (skip G):
127 F onto E - rebase of a branching point (skip G):
128
128
129 $ hg clone -q -u . a a4
129 $ hg clone -q -u . a a4
130 $ cd a4
130 $ cd a4
131
131
132 $ hg rebase -s 5 -d 4
132 $ hg rebase -s 5 -d 4
133 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
133 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
134
134
135 $ hg tglog
135 $ hg tglog
136 @ 6: 'H'
136 @ 6: 'H'
137 |
137 |
138 o 5: 'F'
138 o 5: 'F'
139 |
139 |
140 o 4: 'E'
140 o 4: 'E'
141 |
141 |
142 | o 3: 'D'
142 | o 3: 'D'
143 | |
143 | |
144 | o 2: 'C'
144 | o 2: 'C'
145 | |
145 | |
146 | o 1: 'B'
146 | o 1: 'B'
147 |/
147 |/
148 o 0: 'A'
148 o 0: 'A'
149
149
150 $ cd ..
150 $ cd ..
151
151
152
152
153 G onto H - merged revision having a parent in ancestors of target:
153 G onto H - merged revision having a parent in ancestors of target:
154
154
155 $ hg clone -q -u . a a5
155 $ hg clone -q -u . a a5
156 $ cd a5
156 $ cd a5
157
157
158 $ hg rebase -s 6 -d 7
158 $ hg rebase -s 6 -d 7
159 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
159 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
160
160
161 $ hg tglog
161 $ hg tglog
162 o 7: 'G'
162 o 7: 'G'
163 |\
163 |\
164 | @ 6: 'H'
164 | @ 6: 'H'
165 | |
165 | |
166 | o 5: 'F'
166 | o 5: 'F'
167 | |
167 | |
168 o | 4: 'E'
168 o | 4: 'E'
169 |/
169 |/
170 | o 3: 'D'
170 | o 3: 'D'
171 | |
171 | |
172 | o 2: 'C'
172 | o 2: 'C'
173 | |
173 | |
174 | o 1: 'B'
174 | o 1: 'B'
175 |/
175 |/
176 o 0: 'A'
176 o 0: 'A'
177
177
178 $ cd ..
178 $ cd ..
179
179
180
180
181 F onto B - G maintains E as parent:
181 F onto B - G maintains E as parent:
182
182
183 $ hg clone -q -u . a a6
183 $ hg clone -q -u . a a6
184 $ cd a6
184 $ cd a6
185
185
186 $ hg rebase -s 5 -d 1
186 $ hg rebase -s 5 -d 1
187 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
187 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
188
188
189 $ hg tglog
189 $ hg tglog
190 @ 7: 'H'
190 @ 7: 'H'
191 |
191 |
192 | o 6: 'G'
192 | o 6: 'G'
193 |/|
193 |/|
194 o | 5: 'F'
194 o | 5: 'F'
195 | |
195 | |
196 | o 4: 'E'
196 | o 4: 'E'
197 | |
197 | |
198 | | o 3: 'D'
198 | | o 3: 'D'
199 | | |
199 | | |
200 +---o 2: 'C'
200 +---o 2: 'C'
201 | |
201 | |
202 o | 1: 'B'
202 o | 1: 'B'
203 |/
203 |/
204 o 0: 'A'
204 o 0: 'A'
205
205
206 $ cd ..
206 $ cd ..
207
207
208
208
209 These will fail (using --source):
209 These will fail (using --source):
210
210
211 G onto F - rebase onto an ancestor:
211 G onto F - rebase onto an ancestor:
212
212
213 $ hg clone -q -u . a a7
213 $ hg clone -q -u . a a7
214 $ cd a7
214 $ cd a7
215
215
216 $ hg rebase -s 6 -d 5
216 $ hg rebase -s 6 -d 5
217 nothing to rebase
217 nothing to rebase
218 [1]
218 [1]
219
219
220 F onto G - rebase onto a descendant:
220 F onto G - rebase onto a descendant:
221
221
222 $ hg rebase -s 5 -d 6
222 $ hg rebase -s 5 -d 6
223 abort: source is ancestor of destination
223 abort: source is ancestor of destination
224 [255]
224 [255]
225
225
226 G onto B - merge revision with both parents not in ancestors of target:
226 G onto B - merge revision with both parents not in ancestors of target:
227
227
228 $ hg rebase -s 6 -d 1
228 $ hg rebase -s 6 -d 1
229 abort: cannot use revision 6 as base, result would have 3 parents
229 abort: cannot use revision 6 as base, result would have 3 parents
230 [255]
230 [255]
231
231
232
232
233 These will abort gracefully (using --base):
233 These will abort gracefully (using --base):
234
234
235 G onto G - rebase onto same changeset:
235 G onto G - rebase onto same changeset:
236
236
237 $ hg rebase -b 6 -d 6
237 $ hg rebase -b 6 -d 6
238 nothing to rebase
238 nothing to rebase - eea13746799a is both "base" and destination
239 [1]
239 [1]
240
240
241 G onto F - rebase onto an ancestor:
241 G onto F - rebase onto an ancestor:
242
242
243 $ hg rebase -b 6 -d 5
243 $ hg rebase -b 6 -d 5
244 nothing to rebase
244 nothing to rebase
245 [1]
245 [1]
246
246
247 F onto G - rebase onto a descendant:
247 F onto G - rebase onto a descendant:
248
248
249 $ hg rebase -b 5 -d 6
249 $ hg rebase -b 5 -d 6
250 nothing to rebase
250 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
251 [1]
251 [1]
252
252
253 C onto A - rebase onto an ancestor:
253 C onto A - rebase onto an ancestor:
254
254
255 $ hg rebase -d 0 -s 2
255 $ hg rebase -d 0 -s 2
256 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
256 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
257 $ hg tglog
257 $ hg tglog
258 o 7: 'D'
258 o 7: 'D'
259 |
259 |
260 o 6: 'C'
260 o 6: 'C'
261 |
261 |
262 | @ 5: 'H'
262 | @ 5: 'H'
263 | |
263 | |
264 | | o 4: 'G'
264 | | o 4: 'G'
265 | |/|
265 | |/|
266 | o | 3: 'F'
266 | o | 3: 'F'
267 |/ /
267 |/ /
268 | o 2: 'E'
268 | o 2: 'E'
269 |/
269 |/
270 | o 1: 'B'
270 | o 1: 'B'
271 |/
271 |/
272 o 0: 'A'
272 o 0: 'A'
273
273
274
274
275 Check rebasing public changeset
275 Check rebasing public changeset
276
276
277 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
277 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
278 $ hg rebase -d 0 -b 6
278 $ hg rebase -d 0 -b 6
279 nothing to rebase
279 nothing to rebase
280 [1]
280 [1]
281 $ hg rebase -d 5 -b 6
281 $ hg rebase -d 5 -b 6
282 abort: can't rebase immutable changeset e1c4361dd923
282 abort: can't rebase immutable changeset e1c4361dd923
283 (see hg help phases for details)
283 (see hg help phases for details)
284 [255]
284 [255]
285
285
286 $ hg rebase -d 5 -b 6 --keep
286 $ hg rebase -d 5 -b 6 --keep
287
287
288 Check rebasing mutable changeset
288 Check rebasing mutable changeset
289 Source phase greater or equal to destination phase: new changeset get the phase of source:
289 Source phase greater or equal to destination phase: new changeset get the phase of source:
290 $ hg rebase -s9 -d0
290 $ hg rebase -s9 -d0
291 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg (glob)
291 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg (glob)
292 $ hg log --template "{phase}\n" -r 9
292 $ hg log --template "{phase}\n" -r 9
293 draft
293 draft
294 $ hg rebase -s9 -d1
294 $ hg rebase -s9 -d1
295 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg (glob)
295 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg (glob)
296 $ hg log --template "{phase}\n" -r 9
296 $ hg log --template "{phase}\n" -r 9
297 draft
297 draft
298 $ hg phase --force --secret 9
298 $ hg phase --force --secret 9
299 $ hg rebase -s9 -d0
299 $ hg rebase -s9 -d0
300 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-backup.hg (glob)
300 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-backup.hg (glob)
301 $ hg log --template "{phase}\n" -r 9
301 $ hg log --template "{phase}\n" -r 9
302 secret
302 secret
303 $ hg rebase -s9 -d1
303 $ hg rebase -s9 -d1
304 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg (glob)
304 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg (glob)
305 $ hg log --template "{phase}\n" -r 9
305 $ hg log --template "{phase}\n" -r 9
306 secret
306 secret
307 Source phase lower than destination phase: new changeset get the phase of destination:
307 Source phase lower than destination phase: new changeset get the phase of destination:
308 $ hg rebase -s8 -d9
308 $ hg rebase -s8 -d9
309 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-backup.hg (glob)
309 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-backup.hg (glob)
310 $ hg log --template "{phase}\n" -r 'rev(9)'
310 $ hg log --template "{phase}\n" -r 'rev(9)'
311 secret
311 secret
312
312
313 $ cd ..
313 $ cd ..
314
314
315 Test for revset
315 Test for revset
316
316
317 We need a bit different graph
317 We need a bit different graph
318 All destination are B
318 All destination are B
319
319
320 $ hg init ah
320 $ hg init ah
321 $ cd ah
321 $ cd ah
322 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
322 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
323 adding changesets
323 adding changesets
324 adding manifests
324 adding manifests
325 adding file changes
325 adding file changes
326 added 9 changesets with 9 changes to 9 files (+2 heads)
326 added 9 changesets with 9 changes to 9 files (+2 heads)
327 (run 'hg heads' to see heads, 'hg merge' to merge)
327 (run 'hg heads' to see heads, 'hg merge' to merge)
328 $ hg tglog
328 $ hg tglog
329 o 8: 'I'
329 o 8: 'I'
330 |
330 |
331 o 7: 'H'
331 o 7: 'H'
332 |
332 |
333 o 6: 'G'
333 o 6: 'G'
334 |
334 |
335 | o 5: 'F'
335 | o 5: 'F'
336 | |
336 | |
337 | o 4: 'E'
337 | o 4: 'E'
338 |/
338 |/
339 o 3: 'D'
339 o 3: 'D'
340 |
340 |
341 o 2: 'C'
341 o 2: 'C'
342 |
342 |
343 | o 1: 'B'
343 | o 1: 'B'
344 |/
344 |/
345 o 0: 'A'
345 o 0: 'A'
346
346
347 $ cd ..
347 $ cd ..
348
348
349
349
350 Simple case with keep:
350 Simple case with keep:
351
351
352 Source on have two descendant heads but ask for one
352 Source on have two descendant heads but ask for one
353
353
354 $ hg clone -q -u . ah ah1
354 $ hg clone -q -u . ah ah1
355 $ cd ah1
355 $ cd ah1
356 $ hg rebase -r '2::8' -d 1
356 $ hg rebase -r '2::8' -d 1
357 abort: can't remove original changesets with unrebased descendants
357 abort: can't remove original changesets with unrebased descendants
358 (use --keep to keep original changesets)
358 (use --keep to keep original changesets)
359 [255]
359 [255]
360 $ hg rebase -r '2::8' -d 1 --keep
360 $ hg rebase -r '2::8' -d 1 --keep
361 $ hg tglog
361 $ hg tglog
362 o 13: 'I'
362 o 13: 'I'
363 |
363 |
364 o 12: 'H'
364 o 12: 'H'
365 |
365 |
366 o 11: 'G'
366 o 11: 'G'
367 |
367 |
368 o 10: 'D'
368 o 10: 'D'
369 |
369 |
370 o 9: 'C'
370 o 9: 'C'
371 |
371 |
372 | o 8: 'I'
372 | o 8: 'I'
373 | |
373 | |
374 | o 7: 'H'
374 | o 7: 'H'
375 | |
375 | |
376 | o 6: 'G'
376 | o 6: 'G'
377 | |
377 | |
378 | | o 5: 'F'
378 | | o 5: 'F'
379 | | |
379 | | |
380 | | o 4: 'E'
380 | | o 4: 'E'
381 | |/
381 | |/
382 | o 3: 'D'
382 | o 3: 'D'
383 | |
383 | |
384 | o 2: 'C'
384 | o 2: 'C'
385 | |
385 | |
386 o | 1: 'B'
386 o | 1: 'B'
387 |/
387 |/
388 o 0: 'A'
388 o 0: 'A'
389
389
390
390
391 $ cd ..
391 $ cd ..
392
392
393 Base on have one descendant heads we ask for but common ancestor have two
393 Base on have one descendant heads we ask for but common ancestor have two
394
394
395 $ hg clone -q -u . ah ah2
395 $ hg clone -q -u . ah ah2
396 $ cd ah2
396 $ cd ah2
397 $ hg rebase -r '3::8' -d 1
397 $ hg rebase -r '3::8' -d 1
398 abort: can't remove original changesets with unrebased descendants
398 abort: can't remove original changesets with unrebased descendants
399 (use --keep to keep original changesets)
399 (use --keep to keep original changesets)
400 [255]
400 [255]
401 $ hg rebase -r '3::8' -d 1 --keep
401 $ hg rebase -r '3::8' -d 1 --keep
402 $ hg tglog
402 $ hg tglog
403 o 12: 'I'
403 o 12: 'I'
404 |
404 |
405 o 11: 'H'
405 o 11: 'H'
406 |
406 |
407 o 10: 'G'
407 o 10: 'G'
408 |
408 |
409 o 9: 'D'
409 o 9: 'D'
410 |
410 |
411 | o 8: 'I'
411 | o 8: 'I'
412 | |
412 | |
413 | o 7: 'H'
413 | o 7: 'H'
414 | |
414 | |
415 | o 6: 'G'
415 | o 6: 'G'
416 | |
416 | |
417 | | o 5: 'F'
417 | | o 5: 'F'
418 | | |
418 | | |
419 | | o 4: 'E'
419 | | o 4: 'E'
420 | |/
420 | |/
421 | o 3: 'D'
421 | o 3: 'D'
422 | |
422 | |
423 | o 2: 'C'
423 | o 2: 'C'
424 | |
424 | |
425 o | 1: 'B'
425 o | 1: 'B'
426 |/
426 |/
427 o 0: 'A'
427 o 0: 'A'
428
428
429
429
430 $ cd ..
430 $ cd ..
431
431
432 rebase subset
432 rebase subset
433
433
434 $ hg clone -q -u . ah ah3
434 $ hg clone -q -u . ah ah3
435 $ cd ah3
435 $ cd ah3
436 $ hg rebase -r '3::7' -d 1
436 $ hg rebase -r '3::7' -d 1
437 abort: can't remove original changesets with unrebased descendants
437 abort: can't remove original changesets with unrebased descendants
438 (use --keep to keep original changesets)
438 (use --keep to keep original changesets)
439 [255]
439 [255]
440 $ hg rebase -r '3::7' -d 1 --keep
440 $ hg rebase -r '3::7' -d 1 --keep
441 $ hg tglog
441 $ hg tglog
442 o 11: 'H'
442 o 11: 'H'
443 |
443 |
444 o 10: 'G'
444 o 10: 'G'
445 |
445 |
446 o 9: 'D'
446 o 9: 'D'
447 |
447 |
448 | o 8: 'I'
448 | o 8: 'I'
449 | |
449 | |
450 | o 7: 'H'
450 | o 7: 'H'
451 | |
451 | |
452 | o 6: 'G'
452 | o 6: 'G'
453 | |
453 | |
454 | | o 5: 'F'
454 | | o 5: 'F'
455 | | |
455 | | |
456 | | o 4: 'E'
456 | | o 4: 'E'
457 | |/
457 | |/
458 | o 3: 'D'
458 | o 3: 'D'
459 | |
459 | |
460 | o 2: 'C'
460 | o 2: 'C'
461 | |
461 | |
462 o | 1: 'B'
462 o | 1: 'B'
463 |/
463 |/
464 o 0: 'A'
464 o 0: 'A'
465
465
466
466
467 $ cd ..
467 $ cd ..
468
468
469 rebase subset with multiple head
469 rebase subset with multiple head
470
470
471 $ hg clone -q -u . ah ah4
471 $ hg clone -q -u . ah ah4
472 $ cd ah4
472 $ cd ah4
473 $ hg rebase -r '3::(7+5)' -d 1
473 $ hg rebase -r '3::(7+5)' -d 1
474 abort: can't remove original changesets with unrebased descendants
474 abort: can't remove original changesets with unrebased descendants
475 (use --keep to keep original changesets)
475 (use --keep to keep original changesets)
476 [255]
476 [255]
477 $ hg rebase -r '3::(7+5)' -d 1 --keep
477 $ hg rebase -r '3::(7+5)' -d 1 --keep
478 $ hg tglog
478 $ hg tglog
479 o 13: 'H'
479 o 13: 'H'
480 |
480 |
481 o 12: 'G'
481 o 12: 'G'
482 |
482 |
483 | o 11: 'F'
483 | o 11: 'F'
484 | |
484 | |
485 | o 10: 'E'
485 | o 10: 'E'
486 |/
486 |/
487 o 9: 'D'
487 o 9: 'D'
488 |
488 |
489 | o 8: 'I'
489 | o 8: 'I'
490 | |
490 | |
491 | o 7: 'H'
491 | o 7: 'H'
492 | |
492 | |
493 | o 6: 'G'
493 | o 6: 'G'
494 | |
494 | |
495 | | o 5: 'F'
495 | | o 5: 'F'
496 | | |
496 | | |
497 | | o 4: 'E'
497 | | o 4: 'E'
498 | |/
498 | |/
499 | o 3: 'D'
499 | o 3: 'D'
500 | |
500 | |
501 | o 2: 'C'
501 | o 2: 'C'
502 | |
502 | |
503 o | 1: 'B'
503 o | 1: 'B'
504 |/
504 |/
505 o 0: 'A'
505 o 0: 'A'
506
506
507
507
508 $ cd ..
508 $ cd ..
509
509
510 More advanced tests
510 More advanced tests
511
511
512 rebase on ancestor with revset
512 rebase on ancestor with revset
513
513
514 $ hg clone -q -u . ah ah5
514 $ hg clone -q -u . ah ah5
515 $ cd ah5
515 $ cd ah5
516 $ hg rebase -r '6::' -d 2
516 $ hg rebase -r '6::' -d 2
517 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
517 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
518 $ hg tglog
518 $ hg tglog
519 o 8: 'I'
519 o 8: 'I'
520 |
520 |
521 o 7: 'H'
521 o 7: 'H'
522 |
522 |
523 o 6: 'G'
523 o 6: 'G'
524 |
524 |
525 | o 5: 'F'
525 | o 5: 'F'
526 | |
526 | |
527 | o 4: 'E'
527 | o 4: 'E'
528 | |
528 | |
529 | o 3: 'D'
529 | o 3: 'D'
530 |/
530 |/
531 o 2: 'C'
531 o 2: 'C'
532 |
532 |
533 | o 1: 'B'
533 | o 1: 'B'
534 |/
534 |/
535 o 0: 'A'
535 o 0: 'A'
536
536
537 $ cd ..
537 $ cd ..
538
538
539
539
540 rebase with multiple root.
540 rebase with multiple root.
541 We rebase E and G on B
541 We rebase E and G on B
542 We would expect heads are I, F if it was supported
542 We would expect heads are I, F if it was supported
543
543
544 $ hg clone -q -u . ah ah6
544 $ hg clone -q -u . ah ah6
545 $ cd ah6
545 $ cd ah6
546 $ hg rebase -r '(4+6)::' -d 1
546 $ hg rebase -r '(4+6)::' -d 1
547 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
547 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
548 $ hg tglog
548 $ hg tglog
549 o 8: 'I'
549 o 8: 'I'
550 |
550 |
551 o 7: 'H'
551 o 7: 'H'
552 |
552 |
553 o 6: 'G'
553 o 6: 'G'
554 |
554 |
555 | o 5: 'F'
555 | o 5: 'F'
556 | |
556 | |
557 | o 4: 'E'
557 | o 4: 'E'
558 |/
558 |/
559 | o 3: 'D'
559 | o 3: 'D'
560 | |
560 | |
561 | o 2: 'C'
561 | o 2: 'C'
562 | |
562 | |
563 o | 1: 'B'
563 o | 1: 'B'
564 |/
564 |/
565 o 0: 'A'
565 o 0: 'A'
566
566
567 $ cd ..
567 $ cd ..
568
568
569 More complex rebase with multiple roots
569 More complex rebase with multiple roots
570 each root have a different common ancestor with the destination and this is a detach
570 each root have a different common ancestor with the destination and this is a detach
571
571
572 (setup)
572 (setup)
573
573
574 $ hg clone -q -u . a a8
574 $ hg clone -q -u . a a8
575 $ cd a8
575 $ cd a8
576 $ echo I > I
576 $ echo I > I
577 $ hg add I
577 $ hg add I
578 $ hg commit -m I
578 $ hg commit -m I
579 $ hg up 4
579 $ hg up 4
580 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
580 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
581 $ echo I > J
581 $ echo I > J
582 $ hg add J
582 $ hg add J
583 $ hg commit -m J
583 $ hg commit -m J
584 created new head
584 created new head
585 $ echo I > K
585 $ echo I > K
586 $ hg add K
586 $ hg add K
587 $ hg commit -m K
587 $ hg commit -m K
588 $ hg tglog
588 $ hg tglog
589 @ 10: 'K'
589 @ 10: 'K'
590 |
590 |
591 o 9: 'J'
591 o 9: 'J'
592 |
592 |
593 | o 8: 'I'
593 | o 8: 'I'
594 | |
594 | |
595 | o 7: 'H'
595 | o 7: 'H'
596 | |
596 | |
597 +---o 6: 'G'
597 +---o 6: 'G'
598 | |/
598 | |/
599 | o 5: 'F'
599 | o 5: 'F'
600 | |
600 | |
601 o | 4: 'E'
601 o | 4: 'E'
602 |/
602 |/
603 | o 3: 'D'
603 | o 3: 'D'
604 | |
604 | |
605 | o 2: 'C'
605 | o 2: 'C'
606 | |
606 | |
607 | o 1: 'B'
607 | o 1: 'B'
608 |/
608 |/
609 o 0: 'A'
609 o 0: 'A'
610
610
611 (actual test)
611 (actual test)
612
612
613 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
613 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
614 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-backup.hg (glob)
614 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-backup.hg (glob)
615 $ hg log --rev 'children(desc(G))'
615 $ hg log --rev 'children(desc(G))'
616 changeset: 9:adb617877056
616 changeset: 9:adb617877056
617 parent: 6:eea13746799a
617 parent: 6:eea13746799a
618 user: test
618 user: test
619 date: Thu Jan 01 00:00:00 1970 +0000
619 date: Thu Jan 01 00:00:00 1970 +0000
620 summary: I
620 summary: I
621
621
622 changeset: 10:882431a34a0e
622 changeset: 10:882431a34a0e
623 tag: tip
623 tag: tip
624 parent: 6:eea13746799a
624 parent: 6:eea13746799a
625 user: test
625 user: test
626 date: Thu Jan 01 00:00:00 1970 +0000
626 date: Thu Jan 01 00:00:00 1970 +0000
627 summary: K
627 summary: K
628
628
629 $ hg tglog
629 $ hg tglog
630 @ 10: 'K'
630 @ 10: 'K'
631 |
631 |
632 | o 9: 'I'
632 | o 9: 'I'
633 |/
633 |/
634 | o 8: 'J'
634 | o 8: 'J'
635 | |
635 | |
636 | | o 7: 'H'
636 | | o 7: 'H'
637 | | |
637 | | |
638 o---+ 6: 'G'
638 o---+ 6: 'G'
639 |/ /
639 |/ /
640 | o 5: 'F'
640 | o 5: 'F'
641 | |
641 | |
642 o | 4: 'E'
642 o | 4: 'E'
643 |/
643 |/
644 | o 3: 'D'
644 | o 3: 'D'
645 | |
645 | |
646 | o 2: 'C'
646 | o 2: 'C'
647 | |
647 | |
648 | o 1: 'B'
648 | o 1: 'B'
649 |/
649 |/
650 o 0: 'A'
650 o 0: 'A'
651
651
General Comments 0
You need to be logged in to leave comments. Login now