##// END OF EJS Templates
rebase: show more useful status information while rebasing...
Mads Kiilerich -
r23517:4f18e80d default
parent child Browse files
Show More
@@ -1,1047 +1,1061 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 import copies
19 from mercurial import copies
20 from mercurial.commands import templateopts
20 from mercurial.commands import templateopts
21 from mercurial.node import nullrev, nullid, hex
21 from mercurial.node import nullrev, nullid, hex, short
22 from mercurial.lock import release
22 from mercurial.lock import release
23 from mercurial.i18n import _
23 from mercurial.i18n import _
24 import os, errno
24 import os, errno
25
25
26 revtodo = -1
26 revtodo = -1
27 nullmerge = -2
27 nullmerge = -2
28 revignored = -3
28 revignored = -3
29
29
30 cmdtable = {}
30 cmdtable = {}
31 command = cmdutil.command(cmdtable)
31 command = cmdutil.command(cmdtable)
32 testedwith = 'internal'
32 testedwith = 'internal'
33
33
34 def _savegraft(ctx, extra):
34 def _savegraft(ctx, extra):
35 s = ctx.extra().get('source', None)
35 s = ctx.extra().get('source', None)
36 if s is not None:
36 if s is not None:
37 extra['source'] = s
37 extra['source'] = s
38
38
39 def _savebranch(ctx, extra):
39 def _savebranch(ctx, extra):
40 extra['branch'] = ctx.branch()
40 extra['branch'] = ctx.branch()
41
41
42 def _makeextrafn(copiers):
42 def _makeextrafn(copiers):
43 """make an extrafn out of the given copy-functions.
43 """make an extrafn out of the given copy-functions.
44
44
45 A copy function takes a context and an extra dict, and mutates the
45 A copy function takes a context and an extra dict, and mutates the
46 extra dict as needed based on the given context.
46 extra dict as needed based on the given context.
47 """
47 """
48 def extrafn(ctx, extra):
48 def extrafn(ctx, extra):
49 for c in copiers:
49 for c in copiers:
50 c(ctx, extra)
50 c(ctx, extra)
51 return extrafn
51 return extrafn
52
52
53 @command('rebase',
53 @command('rebase',
54 [('s', 'source', '',
54 [('s', 'source', '',
55 _('rebase the specified changeset and descendants'), _('REV')),
55 _('rebase the specified changeset and descendants'), _('REV')),
56 ('b', 'base', '',
56 ('b', 'base', '',
57 _('rebase everything from branching point of specified changeset'),
57 _('rebase everything from branching point of specified changeset'),
58 _('REV')),
58 _('REV')),
59 ('r', 'rev', [],
59 ('r', 'rev', [],
60 _('rebase these revisions'),
60 _('rebase these revisions'),
61 _('REV')),
61 _('REV')),
62 ('d', 'dest', '',
62 ('d', 'dest', '',
63 _('rebase onto the specified changeset'), _('REV')),
63 _('rebase onto the specified changeset'), _('REV')),
64 ('', 'collapse', False, _('collapse the rebased changesets')),
64 ('', 'collapse', False, _('collapse the rebased changesets')),
65 ('m', 'message', '',
65 ('m', 'message', '',
66 _('use text as collapse commit message'), _('TEXT')),
66 _('use text as collapse commit message'), _('TEXT')),
67 ('e', 'edit', False, _('invoke editor on commit messages')),
67 ('e', 'edit', False, _('invoke editor on commit messages')),
68 ('l', 'logfile', '',
68 ('l', 'logfile', '',
69 _('read collapse commit message from file'), _('FILE')),
69 _('read collapse commit message from file'), _('FILE')),
70 ('', 'keep', False, _('keep original changesets')),
70 ('', 'keep', False, _('keep original changesets')),
71 ('', 'keepbranches', False, _('keep original branch names')),
71 ('', 'keepbranches', False, _('keep original branch names')),
72 ('D', 'detach', False, _('(DEPRECATED)')),
72 ('D', 'detach', False, _('(DEPRECATED)')),
73 ('i', 'interactive', False, _('(DEPRECATED)')),
73 ('i', 'interactive', False, _('(DEPRECATED)')),
74 ('t', 'tool', '', _('specify merge tool')),
74 ('t', 'tool', '', _('specify merge tool')),
75 ('c', 'continue', False, _('continue an interrupted rebase')),
75 ('c', 'continue', False, _('continue an interrupted rebase')),
76 ('a', 'abort', False, _('abort an interrupted rebase'))] +
76 ('a', 'abort', False, _('abort an interrupted rebase'))] +
77 templateopts,
77 templateopts,
78 _('[-s REV | -b REV] [-d REV] [OPTION]'))
78 _('[-s REV | -b REV] [-d REV] [OPTION]'))
79 def rebase(ui, repo, **opts):
79 def rebase(ui, repo, **opts):
80 """move changeset (and descendants) to a different branch
80 """move changeset (and descendants) to a different branch
81
81
82 Rebase uses repeated merging to graft changesets from one part of
82 Rebase uses repeated merging to graft changesets from one part of
83 history (the source) onto another (the destination). This can be
83 history (the source) onto another (the destination). This can be
84 useful for linearizing *local* changes relative to a master
84 useful for linearizing *local* changes relative to a master
85 development tree.
85 development tree.
86
86
87 You should not rebase changesets that have already been shared
87 You should not rebase changesets that have already been shared
88 with others. Doing so will force everybody else to perform the
88 with others. Doing so will force everybody else to perform the
89 same rebase or they will end up with duplicated changesets after
89 same rebase or they will end up with duplicated changesets after
90 pulling in your rebased changesets.
90 pulling in your rebased changesets.
91
91
92 In its default configuration, Mercurial will prevent you from
92 In its default configuration, Mercurial will prevent you from
93 rebasing published changes. See :hg:`help phases` for details.
93 rebasing published changes. See :hg:`help phases` for details.
94
94
95 If you don't specify a destination changeset (``-d/--dest``),
95 If you don't specify a destination changeset (``-d/--dest``),
96 rebase uses the current branch tip as the destination. (The
96 rebase uses the current branch tip as the destination. (The
97 destination changeset is not modified by rebasing, but new
97 destination changeset is not modified by rebasing, but new
98 changesets are added as its descendants.)
98 changesets are added as its descendants.)
99
99
100 You can specify which changesets to rebase in two ways: as a
100 You can specify which changesets to rebase in two ways: as a
101 "source" changeset or as a "base" changeset. Both are shorthand
101 "source" changeset or as a "base" changeset. Both are shorthand
102 for a topologically related set of changesets (the "source
102 for a topologically related set of changesets (the "source
103 branch"). If you specify source (``-s/--source``), rebase will
103 branch"). If you specify source (``-s/--source``), rebase will
104 rebase that changeset and all of its descendants onto dest. If you
104 rebase that changeset and all of its descendants onto dest. If you
105 specify base (``-b/--base``), rebase will select ancestors of base
105 specify base (``-b/--base``), rebase will select ancestors of base
106 back to but not including the common ancestor with dest. Thus,
106 back to but not including the common ancestor with dest. Thus,
107 ``-b`` is less precise but more convenient than ``-s``: you can
107 ``-b`` is less precise but more convenient than ``-s``: you can
108 specify any changeset in the source branch, and rebase will select
108 specify any changeset in the source branch, and rebase will select
109 the whole branch. If you specify neither ``-s`` nor ``-b``, rebase
109 the whole branch. If you specify neither ``-s`` nor ``-b``, rebase
110 uses the parent of the working directory as the base.
110 uses the parent of the working directory as the base.
111
111
112 For advanced usage, a third way is available through the ``--rev``
112 For advanced usage, a third way is available through the ``--rev``
113 option. It allows you to specify an arbitrary set of changesets to
113 option. It allows you to specify an arbitrary set of changesets to
114 rebase. Descendants of revs you specify with this option are not
114 rebase. Descendants of revs you specify with this option are not
115 automatically included in the rebase.
115 automatically included in the rebase.
116
116
117 By default, rebase recreates the changesets in the source branch
117 By default, rebase recreates the changesets in the source branch
118 as descendants of dest and then destroys the originals. Use
118 as descendants of dest and then destroys the originals. Use
119 ``--keep`` to preserve the original source changesets. Some
119 ``--keep`` to preserve the original source changesets. Some
120 changesets in the source branch (e.g. merges from the destination
120 changesets in the source branch (e.g. merges from the destination
121 branch) may be dropped if they no longer contribute any change.
121 branch) may be dropped if they no longer contribute any change.
122
122
123 One result of the rules for selecting the destination changeset
123 One result of the rules for selecting the destination changeset
124 and source branch is that, unlike ``merge``, rebase will do
124 and source branch is that, unlike ``merge``, rebase will do
125 nothing if you are at the branch tip of a named branch
125 nothing if you are at the branch tip of a named branch
126 with two heads. You need to explicitly specify source and/or
126 with two heads. You need to explicitly specify source and/or
127 destination (or ``update`` to the other head, if it's the head of
127 destination (or ``update`` to the other head, if it's the head of
128 the intended source branch).
128 the intended source branch).
129
129
130 If a rebase is interrupted to manually resolve a merge, it can be
130 If a rebase is interrupted to manually resolve a merge, it can be
131 continued with --continue/-c or aborted with --abort/-a.
131 continued with --continue/-c or aborted with --abort/-a.
132
132
133 .. container:: verbose
133 .. container:: verbose
134
134
135 Examples:
135 Examples:
136
136
137 - move "local changes" (current commit back to branching point)
137 - move "local changes" (current commit back to branching point)
138 to the current branch tip after a pull::
138 to the current branch tip after a pull::
139
139
140 hg rebase
140 hg rebase
141
141
142 - move a single changeset to the stable branch::
142 - move a single changeset to the stable branch::
143
143
144 hg rebase -r 5f493448 -d stable
144 hg rebase -r 5f493448 -d stable
145
145
146 - splice a commit and all its descendants onto another part of history::
146 - splice a commit and all its descendants onto another part of history::
147
147
148 hg rebase --source c0c3 --dest 4cf9
148 hg rebase --source c0c3 --dest 4cf9
149
149
150 - rebase everything on a branch marked by a bookmark onto the
150 - rebase everything on a branch marked by a bookmark onto the
151 default branch::
151 default branch::
152
152
153 hg rebase --base myfeature --dest default
153 hg rebase --base myfeature --dest default
154
154
155 - collapse a sequence of changes into a single commit::
155 - collapse a sequence of changes into a single commit::
156
156
157 hg rebase --collapse -r 1520:1525 -d .
157 hg rebase --collapse -r 1520:1525 -d .
158
158
159 - move a named branch while preserving its name::
159 - move a named branch while preserving its name::
160
160
161 hg rebase -r "branch(featureX)" -d 1.3 --keepbranches
161 hg rebase -r "branch(featureX)" -d 1.3 --keepbranches
162
162
163 Returns 0 on success, 1 if nothing to rebase or there are
163 Returns 0 on success, 1 if nothing to rebase or there are
164 unresolved conflicts.
164 unresolved conflicts.
165
165
166 """
166 """
167 originalwd = target = None
167 originalwd = target = None
168 activebookmark = None
168 activebookmark = None
169 external = nullrev
169 external = nullrev
170 state = {}
170 state = {}
171 skipped = set()
171 skipped = set()
172 targetancestors = set()
172 targetancestors = set()
173
173
174
174
175 lock = wlock = None
175 lock = wlock = None
176 try:
176 try:
177 wlock = repo.wlock()
177 wlock = repo.wlock()
178 lock = repo.lock()
178 lock = repo.lock()
179
179
180 # Validate input and define rebasing points
180 # Validate input and define rebasing points
181 destf = opts.get('dest', None)
181 destf = opts.get('dest', None)
182 srcf = opts.get('source', None)
182 srcf = opts.get('source', None)
183 basef = opts.get('base', None)
183 basef = opts.get('base', None)
184 revf = opts.get('rev', [])
184 revf = opts.get('rev', [])
185 contf = opts.get('continue')
185 contf = opts.get('continue')
186 abortf = opts.get('abort')
186 abortf = opts.get('abort')
187 collapsef = opts.get('collapse', False)
187 collapsef = opts.get('collapse', False)
188 collapsemsg = cmdutil.logmessage(ui, opts)
188 collapsemsg = cmdutil.logmessage(ui, opts)
189 e = opts.get('extrafn') # internal, used by e.g. hgsubversion
189 e = opts.get('extrafn') # internal, used by e.g. hgsubversion
190 extrafns = [_savegraft]
190 extrafns = [_savegraft]
191 if e:
191 if e:
192 extrafns = [e]
192 extrafns = [e]
193 keepf = opts.get('keep', False)
193 keepf = opts.get('keep', False)
194 keepbranchesf = opts.get('keepbranches', False)
194 keepbranchesf = opts.get('keepbranches', False)
195 # keepopen is not meant for use on the command line, but by
195 # keepopen is not meant for use on the command line, but by
196 # other extensions
196 # other extensions
197 keepopen = opts.get('keepopen', False)
197 keepopen = opts.get('keepopen', False)
198
198
199 if opts.get('interactive'):
199 if opts.get('interactive'):
200 msg = _("interactive history editing is supported by the "
200 msg = _("interactive history editing is supported by the "
201 "'histedit' extension (see 'hg help histedit')")
201 "'histedit' extension (see 'hg help histedit')")
202 raise util.Abort(msg)
202 raise util.Abort(msg)
203
203
204 if collapsemsg and not collapsef:
204 if collapsemsg and not collapsef:
205 raise util.Abort(
205 raise util.Abort(
206 _('message can only be specified with collapse'))
206 _('message can only be specified with collapse'))
207
207
208 if contf or abortf:
208 if contf or abortf:
209 if contf and abortf:
209 if contf and abortf:
210 raise util.Abort(_('cannot use both abort and continue'))
210 raise util.Abort(_('cannot use both abort and continue'))
211 if collapsef:
211 if collapsef:
212 raise util.Abort(
212 raise util.Abort(
213 _('cannot use collapse with continue or abort'))
213 _('cannot use collapse with continue or abort'))
214 if srcf or basef or destf:
214 if srcf or basef or destf:
215 raise util.Abort(
215 raise util.Abort(
216 _('abort and continue do not allow specifying revisions'))
216 _('abort and continue do not allow specifying revisions'))
217 if opts.get('tool', False):
217 if opts.get('tool', False):
218 ui.warn(_('tool option will be ignored\n'))
218 ui.warn(_('tool option will be ignored\n'))
219
219
220 try:
220 try:
221 (originalwd, target, state, skipped, collapsef, keepf,
221 (originalwd, target, state, skipped, collapsef, keepf,
222 keepbranchesf, external, activebookmark) = restorestatus(repo)
222 keepbranchesf, external, activebookmark) = restorestatus(repo)
223 except error.RepoLookupError:
223 except error.RepoLookupError:
224 if abortf:
224 if abortf:
225 clearstatus(repo)
225 clearstatus(repo)
226 repo.ui.warn(_('rebase aborted (no revision is removed,'
226 repo.ui.warn(_('rebase aborted (no revision is removed,'
227 ' only broken state is cleared)\n'))
227 ' only broken state is cleared)\n'))
228 return 0
228 return 0
229 else:
229 else:
230 msg = _('cannot continue inconsistent rebase')
230 msg = _('cannot continue inconsistent rebase')
231 hint = _('use "hg rebase --abort" to clear broken state')
231 hint = _('use "hg rebase --abort" to clear broken state')
232 raise util.Abort(msg, hint=hint)
232 raise util.Abort(msg, hint=hint)
233 if abortf:
233 if abortf:
234 return abort(repo, originalwd, target, state)
234 return abort(repo, originalwd, target, state)
235 else:
235 else:
236 if srcf and basef:
236 if srcf and basef:
237 raise util.Abort(_('cannot specify both a '
237 raise util.Abort(_('cannot specify both a '
238 'source and a base'))
238 'source and a base'))
239 if revf and basef:
239 if revf and basef:
240 raise util.Abort(_('cannot specify both a '
240 raise util.Abort(_('cannot specify both a '
241 'revision and a base'))
241 'revision and a base'))
242 if revf and srcf:
242 if revf and srcf:
243 raise util.Abort(_('cannot specify both a '
243 raise util.Abort(_('cannot specify both a '
244 'revision and a source'))
244 'revision and a source'))
245
245
246 cmdutil.checkunfinished(repo)
246 cmdutil.checkunfinished(repo)
247 cmdutil.bailifchanged(repo)
247 cmdutil.bailifchanged(repo)
248
248
249 if not destf:
249 if not destf:
250 # Destination defaults to the latest revision in the
250 # Destination defaults to the latest revision in the
251 # current branch
251 # current branch
252 branch = repo[None].branch()
252 branch = repo[None].branch()
253 dest = repo[branch]
253 dest = repo[branch]
254 else:
254 else:
255 dest = scmutil.revsingle(repo, destf)
255 dest = scmutil.revsingle(repo, destf)
256
256
257 if revf:
257 if revf:
258 rebaseset = scmutil.revrange(repo, revf)
258 rebaseset = scmutil.revrange(repo, revf)
259 if not rebaseset:
259 if not rebaseset:
260 ui.status(_('empty "rev" revision set - '
260 ui.status(_('empty "rev" revision set - '
261 'nothing to rebase\n'))
261 'nothing to rebase\n'))
262 return 1
262 return 1
263 elif srcf:
263 elif srcf:
264 src = scmutil.revrange(repo, [srcf])
264 src = scmutil.revrange(repo, [srcf])
265 if not src:
265 if not src:
266 ui.status(_('empty "source" revision set - '
266 ui.status(_('empty "source" revision set - '
267 'nothing to rebase\n'))
267 'nothing to rebase\n'))
268 return 1
268 return 1
269 rebaseset = repo.revs('(%ld)::', src)
269 rebaseset = repo.revs('(%ld)::', src)
270 assert rebaseset
270 assert rebaseset
271 else:
271 else:
272 base = scmutil.revrange(repo, [basef or '.'])
272 base = scmutil.revrange(repo, [basef or '.'])
273 if not base:
273 if not base:
274 ui.status(_('empty "base" revision set - '
274 ui.status(_('empty "base" revision set - '
275 "can't compute rebase set\n"))
275 "can't compute rebase set\n"))
276 return 1
276 return 1
277 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first()
277 commonanc = repo.revs('ancestor(%ld, %d)', base, dest).first()
278 if commonanc is not None:
278 if commonanc is not None:
279 rebaseset = repo.revs('(%d::(%ld) - %d)::',
279 rebaseset = repo.revs('(%d::(%ld) - %d)::',
280 commonanc, base, commonanc)
280 commonanc, base, commonanc)
281 else:
281 else:
282 rebaseset = []
282 rebaseset = []
283
283
284 if not rebaseset:
284 if not rebaseset:
285 # transform to list because smartsets are not comparable to
285 # transform to list because smartsets are not comparable to
286 # lists. This should be improved to honor laziness of
286 # lists. This should be improved to honor laziness of
287 # smartset.
287 # smartset.
288 if list(base) == [dest.rev()]:
288 if list(base) == [dest.rev()]:
289 if basef:
289 if basef:
290 ui.status(_('nothing to rebase - %s is both "base"'
290 ui.status(_('nothing to rebase - %s is both "base"'
291 ' and destination\n') % dest)
291 ' and destination\n') % dest)
292 else:
292 else:
293 ui.status(_('nothing to rebase - working directory '
293 ui.status(_('nothing to rebase - working directory '
294 'parent is also destination\n'))
294 'parent is also destination\n'))
295 elif not repo.revs('%ld - ::%d', base, dest):
295 elif not repo.revs('%ld - ::%d', base, dest):
296 if basef:
296 if basef:
297 ui.status(_('nothing to rebase - "base" %s is '
297 ui.status(_('nothing to rebase - "base" %s is '
298 'already an ancestor of destination '
298 'already an ancestor of destination '
299 '%s\n') %
299 '%s\n') %
300 ('+'.join(str(repo[r]) for r in base),
300 ('+'.join(str(repo[r]) for r in base),
301 dest))
301 dest))
302 else:
302 else:
303 ui.status(_('nothing to rebase - working '
303 ui.status(_('nothing to rebase - working '
304 'directory parent is already an '
304 'directory parent is already an '
305 'ancestor of destination %s\n') % dest)
305 'ancestor of destination %s\n') % dest)
306 else: # can it happen?
306 else: # can it happen?
307 ui.status(_('nothing to rebase from %s to %s\n') %
307 ui.status(_('nothing to rebase from %s to %s\n') %
308 ('+'.join(str(repo[r]) for r in base), dest))
308 ('+'.join(str(repo[r]) for r in base), dest))
309 return 1
309 return 1
310
310
311 allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
311 allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
312 if (not (keepf or allowunstable)
312 if (not (keepf or allowunstable)
313 and repo.revs('first(children(%ld) - %ld)',
313 and repo.revs('first(children(%ld) - %ld)',
314 rebaseset, rebaseset)):
314 rebaseset, rebaseset)):
315 raise util.Abort(
315 raise util.Abort(
316 _("can't remove original changesets with"
316 _("can't remove original changesets with"
317 " unrebased descendants"),
317 " unrebased descendants"),
318 hint=_('use --keep to keep original changesets'))
318 hint=_('use --keep to keep original changesets'))
319
319
320 result = buildstate(repo, dest, rebaseset, collapsef)
320 result = buildstate(repo, dest, rebaseset, collapsef)
321 if not result:
321 if not result:
322 # Empty state built, nothing to rebase
322 # Empty state built, nothing to rebase
323 ui.status(_('nothing to rebase\n'))
323 ui.status(_('nothing to rebase\n'))
324 return 1
324 return 1
325
325
326 root = min(rebaseset)
326 root = min(rebaseset)
327 if not keepf and not repo[root].mutable():
327 if not keepf and not repo[root].mutable():
328 raise util.Abort(_("can't rebase immutable changeset %s")
328 raise util.Abort(_("can't rebase immutable changeset %s")
329 % repo[root],
329 % repo[root],
330 hint=_('see hg help phases for details'))
330 hint=_('see hg help phases for details'))
331
331
332 originalwd, target, state = result
332 originalwd, target, state = result
333 if collapsef:
333 if collapsef:
334 targetancestors = repo.changelog.ancestors([target],
334 targetancestors = repo.changelog.ancestors([target],
335 inclusive=True)
335 inclusive=True)
336 external = externalparent(repo, state, targetancestors)
336 external = externalparent(repo, state, targetancestors)
337
337
338 if dest.closesbranch() and not keepbranchesf:
338 if dest.closesbranch() and not keepbranchesf:
339 ui.status(_('reopening closed branch head %s\n') % dest)
339 ui.status(_('reopening closed branch head %s\n') % dest)
340
340
341 if keepbranchesf:
341 if keepbranchesf:
342 # insert _savebranch at the start of extrafns so if
342 # insert _savebranch at the start of extrafns so if
343 # there's a user-provided extrafn it can clobber branch if
343 # there's a user-provided extrafn it can clobber branch if
344 # desired
344 # desired
345 extrafns.insert(0, _savebranch)
345 extrafns.insert(0, _savebranch)
346 if collapsef:
346 if collapsef:
347 branches = set()
347 branches = set()
348 for rev in state:
348 for rev in state:
349 branches.add(repo[rev].branch())
349 branches.add(repo[rev].branch())
350 if len(branches) > 1:
350 if len(branches) > 1:
351 raise util.Abort(_('cannot collapse multiple named '
351 raise util.Abort(_('cannot collapse multiple named '
352 'branches'))
352 'branches'))
353
353
354 # Rebase
354 # Rebase
355 if not targetancestors:
355 if not targetancestors:
356 targetancestors = repo.changelog.ancestors([target], inclusive=True)
356 targetancestors = repo.changelog.ancestors([target], inclusive=True)
357
357
358 # Keep track of the current bookmarks in order to reset them later
358 # Keep track of the current bookmarks in order to reset them later
359 currentbookmarks = repo._bookmarks.copy()
359 currentbookmarks = repo._bookmarks.copy()
360 activebookmark = activebookmark or repo._bookmarkcurrent
360 activebookmark = activebookmark or repo._bookmarkcurrent
361 if activebookmark:
361 if activebookmark:
362 bookmarks.unsetcurrent(repo)
362 bookmarks.unsetcurrent(repo)
363
363
364 extrafn = _makeextrafn(extrafns)
364 extrafn = _makeextrafn(extrafns)
365
365
366 sortedstate = sorted(state)
366 sortedstate = sorted(state)
367 total = len(sortedstate)
367 total = len(sortedstate)
368 pos = 0
368 pos = 0
369 for rev in sortedstate:
369 for rev in sortedstate:
370 ctx = repo[rev]
371 desc = '%d:%s "%s"' % (ctx.rev(), ctx,
372 ctx.description().split('\n', 1)[0])
373 names = repo.nodetags(ctx.node()) + repo.nodebookmarks(ctx.node())
374 if names:
375 desc += ' (%s)' % ' '.join(names)
370 pos += 1
376 pos += 1
371 if state[rev] == revtodo:
377 if state[rev] == revtodo:
372 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])),
378 ui.status(_('rebasing %s\n') % desc)
379 ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, ctx)),
373 _('changesets'), total)
380 _('changesets'), total)
374 p1, p2, base = defineparents(repo, rev, target, state,
381 p1, p2, base = defineparents(repo, rev, target, state,
375 targetancestors)
382 targetancestors)
376 storestatus(repo, originalwd, target, state, collapsef, keepf,
383 storestatus(repo, originalwd, target, state, collapsef, keepf,
377 keepbranchesf, external, activebookmark)
384 keepbranchesf, external, activebookmark)
378 if len(repo.parents()) == 2:
385 if len(repo.parents()) == 2:
379 repo.ui.debug('resuming interrupted rebase\n')
386 repo.ui.debug('resuming interrupted rebase\n')
380 else:
387 else:
381 try:
388 try:
382 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
389 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
383 'rebase')
390 'rebase')
384 stats = rebasenode(repo, rev, p1, base, state,
391 stats = rebasenode(repo, rev, p1, base, state,
385 collapsef, target)
392 collapsef, target)
386 if stats and stats[3] > 0:
393 if stats and stats[3] > 0:
387 raise error.InterventionRequired(
394 raise error.InterventionRequired(
388 _('unresolved conflicts (see hg '
395 _('unresolved conflicts (see hg '
389 'resolve, then hg rebase --continue)'))
396 'resolve, then hg rebase --continue)'))
390 finally:
397 finally:
391 ui.setconfig('ui', 'forcemerge', '', 'rebase')
398 ui.setconfig('ui', 'forcemerge', '', 'rebase')
392 if not collapsef:
399 if not collapsef:
393 merging = p2 != nullrev
400 merging = p2 != nullrev
394 editform = cmdutil.mergeeditform(merging, 'rebase')
401 editform = cmdutil.mergeeditform(merging, 'rebase')
395 editor = cmdutil.getcommiteditor(editform=editform, **opts)
402 editor = cmdutil.getcommiteditor(editform=editform, **opts)
396 newnode = concludenode(repo, rev, p1, p2, extrafn=extrafn,
403 newnode = concludenode(repo, rev, p1, p2, extrafn=extrafn,
397 editor=editor)
404 editor=editor)
398 else:
405 else:
399 # Skip commit if we are collapsing
406 # Skip commit if we are collapsing
400 repo.dirstate.beginparentchange()
407 repo.dirstate.beginparentchange()
401 repo.setparents(repo[p1].node())
408 repo.setparents(repo[p1].node())
402 repo.dirstate.endparentchange()
409 repo.dirstate.endparentchange()
403 newnode = None
410 newnode = None
404 # Update the state
411 # Update the state
405 if newnode is not None:
412 if newnode is not None:
406 state[rev] = repo[newnode].rev()
413 state[rev] = repo[newnode].rev()
407 else:
414 else:
408 if not collapsef:
415 if not collapsef:
409 ui.note(_('no changes, revision %d skipped\n') % rev)
416 ui.note(_('no changes, revision %d skipped\n') % rev)
410 ui.debug('next revision set to %s\n' % p1)
417 ui.debug('next revision set to %s\n' % p1)
411 skipped.add(rev)
418 skipped.add(rev)
412 state[rev] = p1
419 state[rev] = p1
420 elif state[rev] == nullmerge:
421 pass
422 elif state[rev] == revignored:
423 ui.status(_('not rebasing ignored %s\n') % desc)
424 else:
425 ui.status(_('already rebased %s as %s\n') %
426 (desc, repo[state[rev]]))
413
427
414 ui.progress(_('rebasing'), None)
428 ui.progress(_('rebasing'), None)
415 ui.note(_('rebase merging completed\n'))
429 ui.note(_('rebase merging completed\n'))
416
430
417 if collapsef and not keepopen:
431 if collapsef and not keepopen:
418 p1, p2, _base = defineparents(repo, min(state), target,
432 p1, p2, _base = defineparents(repo, min(state), target,
419 state, targetancestors)
433 state, targetancestors)
420 editopt = opts.get('edit')
434 editopt = opts.get('edit')
421 editform = 'rebase.collapse'
435 editform = 'rebase.collapse'
422 if collapsemsg:
436 if collapsemsg:
423 commitmsg = collapsemsg
437 commitmsg = collapsemsg
424 else:
438 else:
425 commitmsg = 'Collapsed revision'
439 commitmsg = 'Collapsed revision'
426 for rebased in state:
440 for rebased in state:
427 if rebased not in skipped and state[rebased] > nullmerge:
441 if rebased not in skipped and state[rebased] > nullmerge:
428 commitmsg += '\n* %s' % repo[rebased].description()
442 commitmsg += '\n* %s' % repo[rebased].description()
429 editopt = True
443 editopt = True
430 editor = cmdutil.getcommiteditor(edit=editopt, editform=editform)
444 editor = cmdutil.getcommiteditor(edit=editopt, editform=editform)
431 newnode = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
445 newnode = concludenode(repo, rev, p1, external, commitmsg=commitmsg,
432 extrafn=extrafn, editor=editor)
446 extrafn=extrafn, editor=editor)
433 if newnode is None:
447 if newnode is None:
434 newrev = target
448 newrev = target
435 else:
449 else:
436 newrev = repo[newnode].rev()
450 newrev = repo[newnode].rev()
437 for oldrev in state.iterkeys():
451 for oldrev in state.iterkeys():
438 if state[oldrev] > nullmerge:
452 if state[oldrev] > nullmerge:
439 state[oldrev] = newrev
453 state[oldrev] = newrev
440
454
441 if 'qtip' in repo.tags():
455 if 'qtip' in repo.tags():
442 updatemq(repo, state, skipped, **opts)
456 updatemq(repo, state, skipped, **opts)
443
457
444 if currentbookmarks:
458 if currentbookmarks:
445 # Nodeids are needed to reset bookmarks
459 # Nodeids are needed to reset bookmarks
446 nstate = {}
460 nstate = {}
447 for k, v in state.iteritems():
461 for k, v in state.iteritems():
448 if v > nullmerge:
462 if v > nullmerge:
449 nstate[repo[k].node()] = repo[v].node()
463 nstate[repo[k].node()] = repo[v].node()
450 # XXX this is the same as dest.node() for the non-continue path --
464 # XXX this is the same as dest.node() for the non-continue path --
451 # this should probably be cleaned up
465 # this should probably be cleaned up
452 targetnode = repo[target].node()
466 targetnode = repo[target].node()
453
467
454 # restore original working directory
468 # restore original working directory
455 # (we do this before stripping)
469 # (we do this before stripping)
456 newwd = state.get(originalwd, originalwd)
470 newwd = state.get(originalwd, originalwd)
457 if newwd < 0:
471 if newwd < 0:
458 # original directory is a parent of rebase set root or ignored
472 # original directory is a parent of rebase set root or ignored
459 newwd = originalwd
473 newwd = originalwd
460 if newwd not in [c.rev() for c in repo[None].parents()]:
474 if newwd not in [c.rev() for c in repo[None].parents()]:
461 ui.note(_("update back to initial working directory parent\n"))
475 ui.note(_("update back to initial working directory parent\n"))
462 hg.updaterepo(repo, newwd, False)
476 hg.updaterepo(repo, newwd, False)
463
477
464 if not keepf:
478 if not keepf:
465 collapsedas = None
479 collapsedas = None
466 if collapsef:
480 if collapsef:
467 collapsedas = newnode
481 collapsedas = newnode
468 clearrebased(ui, repo, state, skipped, collapsedas)
482 clearrebased(ui, repo, state, skipped, collapsedas)
469
483
470 if currentbookmarks:
484 if currentbookmarks:
471 updatebookmarks(repo, targetnode, nstate, currentbookmarks)
485 updatebookmarks(repo, targetnode, nstate, currentbookmarks)
472 if activebookmark not in repo._bookmarks:
486 if activebookmark not in repo._bookmarks:
473 # active bookmark was divergent one and has been deleted
487 # active bookmark was divergent one and has been deleted
474 activebookmark = None
488 activebookmark = None
475
489
476 clearstatus(repo)
490 clearstatus(repo)
477 ui.note(_("rebase completed\n"))
491 ui.note(_("rebase completed\n"))
478 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
492 util.unlinkpath(repo.sjoin('undo'), ignoremissing=True)
479 if skipped:
493 if skipped:
480 ui.note(_("%d revisions have been skipped\n") % len(skipped))
494 ui.note(_("%d revisions have been skipped\n") % len(skipped))
481
495
482 if (activebookmark and
496 if (activebookmark and
483 repo['.'].node() == repo._bookmarks[activebookmark]):
497 repo['.'].node() == repo._bookmarks[activebookmark]):
484 bookmarks.setcurrent(repo, activebookmark)
498 bookmarks.setcurrent(repo, activebookmark)
485
499
486 finally:
500 finally:
487 release(lock, wlock)
501 release(lock, wlock)
488
502
489 def externalparent(repo, state, targetancestors):
503 def externalparent(repo, state, targetancestors):
490 """Return the revision that should be used as the second parent
504 """Return the revision that should be used as the second parent
491 when the revisions in state is collapsed on top of targetancestors.
505 when the revisions in state is collapsed on top of targetancestors.
492 Abort if there is more than one parent.
506 Abort if there is more than one parent.
493 """
507 """
494 parents = set()
508 parents = set()
495 source = min(state)
509 source = min(state)
496 for rev in state:
510 for rev in state:
497 if rev == source:
511 if rev == source:
498 continue
512 continue
499 for p in repo[rev].parents():
513 for p in repo[rev].parents():
500 if (p.rev() not in state
514 if (p.rev() not in state
501 and p.rev() not in targetancestors):
515 and p.rev() not in targetancestors):
502 parents.add(p.rev())
516 parents.add(p.rev())
503 if not parents:
517 if not parents:
504 return nullrev
518 return nullrev
505 if len(parents) == 1:
519 if len(parents) == 1:
506 return parents.pop()
520 return parents.pop()
507 raise util.Abort(_('unable to collapse on top of %s, there is more '
521 raise util.Abort(_('unable to collapse on top of %s, there is more '
508 'than one external parent: %s') %
522 'than one external parent: %s') %
509 (max(targetancestors),
523 (max(targetancestors),
510 ', '.join(str(p) for p in sorted(parents))))
524 ', '.join(str(p) for p in sorted(parents))))
511
525
512 def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None):
526 def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None):
513 '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev
527 '''Commit the wd changes with parents p1 and p2. Reuse commit info from rev
514 but also store useful information in extra.
528 but also store useful information in extra.
515 Return node of committed revision.'''
529 Return node of committed revision.'''
516 try:
530 try:
517 repo.dirstate.beginparentchange()
531 repo.dirstate.beginparentchange()
518 repo.setparents(repo[p1].node(), repo[p2].node())
532 repo.setparents(repo[p1].node(), repo[p2].node())
519 repo.dirstate.endparentchange()
533 repo.dirstate.endparentchange()
520 ctx = repo[rev]
534 ctx = repo[rev]
521 if commitmsg is None:
535 if commitmsg is None:
522 commitmsg = ctx.description()
536 commitmsg = ctx.description()
523 extra = {'rebase_source': ctx.hex()}
537 extra = {'rebase_source': ctx.hex()}
524 if extrafn:
538 if extrafn:
525 extrafn(ctx, extra)
539 extrafn(ctx, extra)
526
540
527 backup = repo.ui.backupconfig('phases', 'new-commit')
541 backup = repo.ui.backupconfig('phases', 'new-commit')
528 try:
542 try:
529 targetphase = max(ctx.phase(), phases.draft)
543 targetphase = max(ctx.phase(), phases.draft)
530 repo.ui.setconfig('phases', 'new-commit', targetphase, 'rebase')
544 repo.ui.setconfig('phases', 'new-commit', targetphase, 'rebase')
531 # Commit might fail if unresolved files exist
545 # Commit might fail if unresolved files exist
532 newnode = repo.commit(text=commitmsg, user=ctx.user(),
546 newnode = repo.commit(text=commitmsg, user=ctx.user(),
533 date=ctx.date(), extra=extra, editor=editor)
547 date=ctx.date(), extra=extra, editor=editor)
534 finally:
548 finally:
535 repo.ui.restoreconfig(backup)
549 repo.ui.restoreconfig(backup)
536
550
537 repo.dirstate.setbranch(repo[newnode].branch())
551 repo.dirstate.setbranch(repo[newnode].branch())
538 return newnode
552 return newnode
539 except util.Abort:
553 except util.Abort:
540 # Invalidate the previous setparents
554 # Invalidate the previous setparents
541 repo.dirstate.invalidate()
555 repo.dirstate.invalidate()
542 raise
556 raise
543
557
544 def rebasenode(repo, rev, p1, base, state, collapse, target):
558 def rebasenode(repo, rev, p1, base, state, collapse, target):
545 'Rebase a single revision rev on top of p1 using base as merge ancestor'
559 'Rebase a single revision rev on top of p1 using base as merge ancestor'
546 # Merge phase
560 # Merge phase
547 # Update to target and merge it with local
561 # Update to target and merge it with local
548 if repo['.'].rev() != p1:
562 if repo['.'].rev() != p1:
549 repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
563 repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
550 merge.update(repo, p1, False, True, False)
564 merge.update(repo, p1, False, True, False)
551 else:
565 else:
552 repo.ui.debug(" already in target\n")
566 repo.ui.debug(" already in target\n")
553 repo.dirstate.write()
567 repo.dirstate.write()
554 repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev]))
568 repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev]))
555 if base is not None:
569 if base is not None:
556 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
570 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
557 # When collapsing in-place, the parent is the common ancestor, we
571 # When collapsing in-place, the parent is the common ancestor, we
558 # have to allow merging with it.
572 # have to allow merging with it.
559 stats = merge.update(repo, rev, True, True, False, base, collapse,
573 stats = merge.update(repo, rev, True, True, False, base, collapse,
560 labels=['dest', 'source'])
574 labels=['dest', 'source'])
561 if collapse:
575 if collapse:
562 copies.duplicatecopies(repo, rev, target)
576 copies.duplicatecopies(repo, rev, target)
563 else:
577 else:
564 # If we're not using --collapse, we need to
578 # If we're not using --collapse, we need to
565 # duplicate copies between the revision we're
579 # duplicate copies between the revision we're
566 # rebasing and its first parent, but *not*
580 # rebasing and its first parent, but *not*
567 # duplicate any copies that have already been
581 # duplicate any copies that have already been
568 # performed in the destination.
582 # performed in the destination.
569 p1rev = repo[rev].p1().rev()
583 p1rev = repo[rev].p1().rev()
570 copies.duplicatecopies(repo, rev, p1rev, skiprev=target)
584 copies.duplicatecopies(repo, rev, p1rev, skiprev=target)
571 return stats
585 return stats
572
586
573 def nearestrebased(repo, rev, state):
587 def nearestrebased(repo, rev, state):
574 """return the nearest ancestors of rev in the rebase result"""
588 """return the nearest ancestors of rev in the rebase result"""
575 rebased = [r for r in state if state[r] > nullmerge]
589 rebased = [r for r in state if state[r] > nullmerge]
576 candidates = repo.revs('max(%ld and (::%d))', rebased, rev)
590 candidates = repo.revs('max(%ld and (::%d))', rebased, rev)
577 if candidates:
591 if candidates:
578 return state[candidates.first()]
592 return state[candidates.first()]
579 else:
593 else:
580 return None
594 return None
581
595
582 def defineparents(repo, rev, target, state, targetancestors):
596 def defineparents(repo, rev, target, state, targetancestors):
583 'Return the new parent relationship of the revision that will be rebased'
597 'Return the new parent relationship of the revision that will be rebased'
584 parents = repo[rev].parents()
598 parents = repo[rev].parents()
585 p1 = p2 = nullrev
599 p1 = p2 = nullrev
586
600
587 p1n = parents[0].rev()
601 p1n = parents[0].rev()
588 if p1n in targetancestors:
602 if p1n in targetancestors:
589 p1 = target
603 p1 = target
590 elif p1n in state:
604 elif p1n in state:
591 if state[p1n] == nullmerge:
605 if state[p1n] == nullmerge:
592 p1 = target
606 p1 = target
593 elif state[p1n] == revignored:
607 elif state[p1n] == revignored:
594 p1 = nearestrebased(repo, p1n, state)
608 p1 = nearestrebased(repo, p1n, state)
595 if p1 is None:
609 if p1 is None:
596 p1 = target
610 p1 = target
597 else:
611 else:
598 p1 = state[p1n]
612 p1 = state[p1n]
599 else: # p1n external
613 else: # p1n external
600 p1 = target
614 p1 = target
601 p2 = p1n
615 p2 = p1n
602
616
603 if len(parents) == 2 and parents[1].rev() not in targetancestors:
617 if len(parents) == 2 and parents[1].rev() not in targetancestors:
604 p2n = parents[1].rev()
618 p2n = parents[1].rev()
605 # interesting second parent
619 # interesting second parent
606 if p2n in state:
620 if p2n in state:
607 if p1 == target: # p1n in targetancestors or external
621 if p1 == target: # p1n in targetancestors or external
608 p1 = state[p2n]
622 p1 = state[p2n]
609 elif state[p2n] == revignored:
623 elif state[p2n] == revignored:
610 p2 = nearestrebased(repo, p2n, state)
624 p2 = nearestrebased(repo, p2n, state)
611 if p2 is None:
625 if p2 is None:
612 # no ancestors rebased yet, detach
626 # no ancestors rebased yet, detach
613 p2 = target
627 p2 = target
614 else:
628 else:
615 p2 = state[p2n]
629 p2 = state[p2n]
616 else: # p2n external
630 else: # p2n external
617 if p2 != nullrev: # p1n external too => rev is a merged revision
631 if p2 != nullrev: # p1n external too => rev is a merged revision
618 raise util.Abort(_('cannot use revision %d as base, result '
632 raise util.Abort(_('cannot use revision %d as base, result '
619 'would have 3 parents') % rev)
633 'would have 3 parents') % rev)
620 p2 = p2n
634 p2 = p2n
621 repo.ui.debug(" future parents are %d and %d\n" %
635 repo.ui.debug(" future parents are %d and %d\n" %
622 (repo[p1].rev(), repo[p2].rev()))
636 (repo[p1].rev(), repo[p2].rev()))
623
637
624 if rev == min(state):
638 if rev == min(state):
625 # Case (1) initial changeset of a non-detaching rebase.
639 # Case (1) initial changeset of a non-detaching rebase.
626 # Let the merge mechanism find the base itself.
640 # Let the merge mechanism find the base itself.
627 base = None
641 base = None
628 elif not repo[rev].p2():
642 elif not repo[rev].p2():
629 # Case (2) detaching the node with a single parent, use this parent
643 # Case (2) detaching the node with a single parent, use this parent
630 base = repo[rev].p1().rev()
644 base = repo[rev].p1().rev()
631 else:
645 else:
632 # In case of merge, we need to pick the right parent as merge base.
646 # In case of merge, we need to pick the right parent as merge base.
633 #
647 #
634 # Imagine we have:
648 # Imagine we have:
635 # - M: currently rebase revision in this step
649 # - M: currently rebase revision in this step
636 # - A: one parent of M
650 # - A: one parent of M
637 # - B: second parent of M
651 # - B: second parent of M
638 # - D: destination of this merge step (p1 var)
652 # - D: destination of this merge step (p1 var)
639 #
653 #
640 # If we are rebasing on D, D is the successors of A or B. The right
654 # If we are rebasing on D, D is the successors of A or B. The right
641 # merge base is the one D succeed to. We pretend it is B for the rest
655 # merge base is the one D succeed to. We pretend it is B for the rest
642 # of this comment
656 # of this comment
643 #
657 #
644 # If we pick B as the base, the merge involves:
658 # If we pick B as the base, the merge involves:
645 # - changes from B to M (actual changeset payload)
659 # - changes from B to M (actual changeset payload)
646 # - changes from B to D (induced by rebase) as D is a rebased
660 # - changes from B to D (induced by rebase) as D is a rebased
647 # version of B)
661 # version of B)
648 # Which exactly represent the rebase operation.
662 # Which exactly represent the rebase operation.
649 #
663 #
650 # If we pick the A as the base, the merge involves
664 # If we pick the A as the base, the merge involves
651 # - changes from A to M (actual changeset payload)
665 # - changes from A to M (actual changeset payload)
652 # - changes from A to D (with include changes between unrelated A and B
666 # - changes from A to D (with include changes between unrelated A and B
653 # plus changes induced by rebase)
667 # plus changes induced by rebase)
654 # Which does not represent anything sensible and creates a lot of
668 # Which does not represent anything sensible and creates a lot of
655 # conflicts.
669 # conflicts.
656 for p in repo[rev].parents():
670 for p in repo[rev].parents():
657 if state.get(p.rev()) == p1:
671 if state.get(p.rev()) == p1:
658 base = p.rev()
672 base = p.rev()
659 break
673 break
660 else: # fallback when base not found
674 else: # fallback when base not found
661 base = None
675 base = None
662
676
663 # Raise because this function is called wrong (see issue 4106)
677 # Raise because this function is called wrong (see issue 4106)
664 raise AssertionError('no base found to rebase on '
678 raise AssertionError('no base found to rebase on '
665 '(defineparents called wrong)')
679 '(defineparents called wrong)')
666 return p1, p2, base
680 return p1, p2, base
667
681
668 def isagitpatch(repo, patchname):
682 def isagitpatch(repo, patchname):
669 'Return true if the given patch is in git format'
683 'Return true if the given patch is in git format'
670 mqpatch = os.path.join(repo.mq.path, patchname)
684 mqpatch = os.path.join(repo.mq.path, patchname)
671 for line in patch.linereader(file(mqpatch, 'rb')):
685 for line in patch.linereader(file(mqpatch, 'rb')):
672 if line.startswith('diff --git'):
686 if line.startswith('diff --git'):
673 return True
687 return True
674 return False
688 return False
675
689
676 def updatemq(repo, state, skipped, **opts):
690 def updatemq(repo, state, skipped, **opts):
677 'Update rebased mq patches - finalize and then import them'
691 'Update rebased mq patches - finalize and then import them'
678 mqrebase = {}
692 mqrebase = {}
679 mq = repo.mq
693 mq = repo.mq
680 original_series = mq.fullseries[:]
694 original_series = mq.fullseries[:]
681 skippedpatches = set()
695 skippedpatches = set()
682
696
683 for p in mq.applied:
697 for p in mq.applied:
684 rev = repo[p.node].rev()
698 rev = repo[p.node].rev()
685 if rev in state:
699 if rev in state:
686 repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' %
700 repo.ui.debug('revision %d is an mq patch (%s), finalize it.\n' %
687 (rev, p.name))
701 (rev, p.name))
688 mqrebase[rev] = (p.name, isagitpatch(repo, p.name))
702 mqrebase[rev] = (p.name, isagitpatch(repo, p.name))
689 else:
703 else:
690 # Applied but not rebased, not sure this should happen
704 # Applied but not rebased, not sure this should happen
691 skippedpatches.add(p.name)
705 skippedpatches.add(p.name)
692
706
693 if mqrebase:
707 if mqrebase:
694 mq.finish(repo, mqrebase.keys())
708 mq.finish(repo, mqrebase.keys())
695
709
696 # We must start import from the newest revision
710 # We must start import from the newest revision
697 for rev in sorted(mqrebase, reverse=True):
711 for rev in sorted(mqrebase, reverse=True):
698 if rev not in skipped:
712 if rev not in skipped:
699 name, isgit = mqrebase[rev]
713 name, isgit = mqrebase[rev]
700 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name))
714 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name))
701 mq.qimport(repo, (), patchname=name, git=isgit,
715 mq.qimport(repo, (), patchname=name, git=isgit,
702 rev=[str(state[rev])])
716 rev=[str(state[rev])])
703 else:
717 else:
704 # Rebased and skipped
718 # Rebased and skipped
705 skippedpatches.add(mqrebase[rev][0])
719 skippedpatches.add(mqrebase[rev][0])
706
720
707 # Patches were either applied and rebased and imported in
721 # Patches were either applied and rebased and imported in
708 # order, applied and removed or unapplied. Discard the removed
722 # order, applied and removed or unapplied. Discard the removed
709 # ones while preserving the original series order and guards.
723 # ones while preserving the original series order and guards.
710 newseries = [s for s in original_series
724 newseries = [s for s in original_series
711 if mq.guard_re.split(s, 1)[0] not in skippedpatches]
725 if mq.guard_re.split(s, 1)[0] not in skippedpatches]
712 mq.fullseries[:] = newseries
726 mq.fullseries[:] = newseries
713 mq.seriesdirty = True
727 mq.seriesdirty = True
714 mq.savedirty()
728 mq.savedirty()
715
729
716 def updatebookmarks(repo, targetnode, nstate, originalbookmarks):
730 def updatebookmarks(repo, targetnode, nstate, originalbookmarks):
717 'Move bookmarks to their correct changesets, and delete divergent ones'
731 'Move bookmarks to their correct changesets, and delete divergent ones'
718 marks = repo._bookmarks
732 marks = repo._bookmarks
719 for k, v in originalbookmarks.iteritems():
733 for k, v in originalbookmarks.iteritems():
720 if v in nstate:
734 if v in nstate:
721 # update the bookmarks for revs that have moved
735 # update the bookmarks for revs that have moved
722 marks[k] = nstate[v]
736 marks[k] = nstate[v]
723 bookmarks.deletedivergent(repo, [targetnode], k)
737 bookmarks.deletedivergent(repo, [targetnode], k)
724
738
725 marks.write()
739 marks.write()
726
740
727 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
741 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
728 external, activebookmark):
742 external, activebookmark):
729 'Store the current status to allow recovery'
743 'Store the current status to allow recovery'
730 f = repo.opener("rebasestate", "w")
744 f = repo.opener("rebasestate", "w")
731 f.write(repo[originalwd].hex() + '\n')
745 f.write(repo[originalwd].hex() + '\n')
732 f.write(repo[target].hex() + '\n')
746 f.write(repo[target].hex() + '\n')
733 f.write(repo[external].hex() + '\n')
747 f.write(repo[external].hex() + '\n')
734 f.write('%d\n' % int(collapse))
748 f.write('%d\n' % int(collapse))
735 f.write('%d\n' % int(keep))
749 f.write('%d\n' % int(keep))
736 f.write('%d\n' % int(keepbranches))
750 f.write('%d\n' % int(keepbranches))
737 f.write('%s\n' % (activebookmark or ''))
751 f.write('%s\n' % (activebookmark or ''))
738 for d, v in state.iteritems():
752 for d, v in state.iteritems():
739 oldrev = repo[d].hex()
753 oldrev = repo[d].hex()
740 if v >= 0:
754 if v >= 0:
741 newrev = repo[v].hex()
755 newrev = repo[v].hex()
742 elif v == revtodo:
756 elif v == revtodo:
743 # To maintain format compatibility, we have to use nullid.
757 # To maintain format compatibility, we have to use nullid.
744 # Please do remove this special case when upgrading the format.
758 # Please do remove this special case when upgrading the format.
745 newrev = hex(nullid)
759 newrev = hex(nullid)
746 else:
760 else:
747 newrev = v
761 newrev = v
748 f.write("%s:%s\n" % (oldrev, newrev))
762 f.write("%s:%s\n" % (oldrev, newrev))
749 f.close()
763 f.close()
750 repo.ui.debug('rebase status stored\n')
764 repo.ui.debug('rebase status stored\n')
751
765
752 def clearstatus(repo):
766 def clearstatus(repo):
753 'Remove the status files'
767 'Remove the status files'
754 util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
768 util.unlinkpath(repo.join("rebasestate"), ignoremissing=True)
755
769
756 def restorestatus(repo):
770 def restorestatus(repo):
757 'Restore a previously stored status'
771 'Restore a previously stored status'
758 try:
772 try:
759 keepbranches = None
773 keepbranches = None
760 target = None
774 target = None
761 collapse = False
775 collapse = False
762 external = nullrev
776 external = nullrev
763 activebookmark = None
777 activebookmark = None
764 state = {}
778 state = {}
765 f = repo.opener("rebasestate")
779 f = repo.opener("rebasestate")
766 for i, l in enumerate(f.read().splitlines()):
780 for i, l in enumerate(f.read().splitlines()):
767 if i == 0:
781 if i == 0:
768 originalwd = repo[l].rev()
782 originalwd = repo[l].rev()
769 elif i == 1:
783 elif i == 1:
770 target = repo[l].rev()
784 target = repo[l].rev()
771 elif i == 2:
785 elif i == 2:
772 external = repo[l].rev()
786 external = repo[l].rev()
773 elif i == 3:
787 elif i == 3:
774 collapse = bool(int(l))
788 collapse = bool(int(l))
775 elif i == 4:
789 elif i == 4:
776 keep = bool(int(l))
790 keep = bool(int(l))
777 elif i == 5:
791 elif i == 5:
778 keepbranches = bool(int(l))
792 keepbranches = bool(int(l))
779 elif i == 6 and not (len(l) == 81 and ':' in l):
793 elif i == 6 and not (len(l) == 81 and ':' in l):
780 # line 6 is a recent addition, so for backwards compatibility
794 # line 6 is a recent addition, so for backwards compatibility
781 # check that the line doesn't look like the oldrev:newrev lines
795 # check that the line doesn't look like the oldrev:newrev lines
782 activebookmark = l
796 activebookmark = l
783 else:
797 else:
784 oldrev, newrev = l.split(':')
798 oldrev, newrev = l.split(':')
785 if newrev in (str(nullmerge), str(revignored)):
799 if newrev in (str(nullmerge), str(revignored)):
786 state[repo[oldrev].rev()] = int(newrev)
800 state[repo[oldrev].rev()] = int(newrev)
787 elif newrev == nullid:
801 elif newrev == nullid:
788 state[repo[oldrev].rev()] = revtodo
802 state[repo[oldrev].rev()] = revtodo
789 # Legacy compat special case
803 # Legacy compat special case
790 else:
804 else:
791 state[repo[oldrev].rev()] = repo[newrev].rev()
805 state[repo[oldrev].rev()] = repo[newrev].rev()
792
806
793 if keepbranches is None:
807 if keepbranches is None:
794 raise util.Abort(_('.hg/rebasestate is incomplete'))
808 raise util.Abort(_('.hg/rebasestate is incomplete'))
795
809
796 skipped = set()
810 skipped = set()
797 # recompute the set of skipped revs
811 # recompute the set of skipped revs
798 if not collapse:
812 if not collapse:
799 seen = set([target])
813 seen = set([target])
800 for old, new in sorted(state.items()):
814 for old, new in sorted(state.items()):
801 if new != revtodo and new in seen:
815 if new != revtodo and new in seen:
802 skipped.add(old)
816 skipped.add(old)
803 seen.add(new)
817 seen.add(new)
804 repo.ui.debug('computed skipped revs: %s\n' %
818 repo.ui.debug('computed skipped revs: %s\n' %
805 (' '.join(str(r) for r in sorted(skipped)) or None))
819 (' '.join(str(r) for r in sorted(skipped)) or None))
806 repo.ui.debug('rebase status resumed\n')
820 repo.ui.debug('rebase status resumed\n')
807 return (originalwd, target, state, skipped,
821 return (originalwd, target, state, skipped,
808 collapse, keep, keepbranches, external, activebookmark)
822 collapse, keep, keepbranches, external, activebookmark)
809 except IOError, err:
823 except IOError, err:
810 if err.errno != errno.ENOENT:
824 if err.errno != errno.ENOENT:
811 raise
825 raise
812 raise util.Abort(_('no rebase in progress'))
826 raise util.Abort(_('no rebase in progress'))
813
827
814 def inrebase(repo, originalwd, state):
828 def inrebase(repo, originalwd, state):
815 '''check whether the working dir is in an interrupted rebase'''
829 '''check whether the working dir is in an interrupted rebase'''
816 parents = [p.rev() for p in repo.parents()]
830 parents = [p.rev() for p in repo.parents()]
817 if originalwd in parents:
831 if originalwd in parents:
818 return True
832 return True
819
833
820 for newrev in state.itervalues():
834 for newrev in state.itervalues():
821 if newrev in parents:
835 if newrev in parents:
822 return True
836 return True
823
837
824 return False
838 return False
825
839
826 def abort(repo, originalwd, target, state):
840 def abort(repo, originalwd, target, state):
827 'Restore the repository to its original state'
841 'Restore the repository to its original state'
828 dstates = [s for s in state.values() if s >= 0]
842 dstates = [s for s in state.values() if s >= 0]
829 immutable = [d for d in dstates if not repo[d].mutable()]
843 immutable = [d for d in dstates if not repo[d].mutable()]
830 cleanup = True
844 cleanup = True
831 if immutable:
845 if immutable:
832 repo.ui.warn(_("warning: can't clean up immutable changesets %s\n")
846 repo.ui.warn(_("warning: can't clean up immutable changesets %s\n")
833 % ', '.join(str(repo[r]) for r in immutable),
847 % ', '.join(str(repo[r]) for r in immutable),
834 hint=_('see hg help phases for details'))
848 hint=_('see hg help phases for details'))
835 cleanup = False
849 cleanup = False
836
850
837 descendants = set()
851 descendants = set()
838 if dstates:
852 if dstates:
839 descendants = set(repo.changelog.descendants(dstates))
853 descendants = set(repo.changelog.descendants(dstates))
840 if descendants - set(dstates):
854 if descendants - set(dstates):
841 repo.ui.warn(_("warning: new changesets detected on target branch, "
855 repo.ui.warn(_("warning: new changesets detected on target branch, "
842 "can't strip\n"))
856 "can't strip\n"))
843 cleanup = False
857 cleanup = False
844
858
845 if cleanup:
859 if cleanup:
846 # Update away from the rebase if necessary
860 # Update away from the rebase if necessary
847 if inrebase(repo, originalwd, state):
861 if inrebase(repo, originalwd, state):
848 merge.update(repo, originalwd, False, True, False)
862 merge.update(repo, originalwd, False, True, False)
849
863
850 # Strip from the first rebased revision
864 # Strip from the first rebased revision
851 rebased = filter(lambda x: x >= 0 and x != target, state.values())
865 rebased = filter(lambda x: x >= 0 and x != target, state.values())
852 if rebased:
866 if rebased:
853 strippoints = [c.node() for c in repo.set('roots(%ld)', rebased)]
867 strippoints = [c.node() for c in repo.set('roots(%ld)', rebased)]
854 # no backup of rebased cset versions needed
868 # no backup of rebased cset versions needed
855 repair.strip(repo.ui, repo, strippoints)
869 repair.strip(repo.ui, repo, strippoints)
856
870
857 clearstatus(repo)
871 clearstatus(repo)
858 repo.ui.warn(_('rebase aborted\n'))
872 repo.ui.warn(_('rebase aborted\n'))
859 return 0
873 return 0
860
874
861 def buildstate(repo, dest, rebaseset, collapse):
875 def buildstate(repo, dest, rebaseset, collapse):
862 '''Define which revisions are going to be rebased and where
876 '''Define which revisions are going to be rebased and where
863
877
864 repo: repo
878 repo: repo
865 dest: context
879 dest: context
866 rebaseset: set of rev
880 rebaseset: set of rev
867 '''
881 '''
868
882
869 # This check isn't strictly necessary, since mq detects commits over an
883 # This check isn't strictly necessary, since mq detects commits over an
870 # applied patch. But it prevents messing up the working directory when
884 # applied patch. But it prevents messing up the working directory when
871 # a partially completed rebase is blocked by mq.
885 # a partially completed rebase is blocked by mq.
872 if 'qtip' in repo.tags() and (dest.node() in
886 if 'qtip' in repo.tags() and (dest.node() in
873 [s.node for s in repo.mq.applied]):
887 [s.node for s in repo.mq.applied]):
874 raise util.Abort(_('cannot rebase onto an applied mq patch'))
888 raise util.Abort(_('cannot rebase onto an applied mq patch'))
875
889
876 roots = list(repo.set('roots(%ld)', rebaseset))
890 roots = list(repo.set('roots(%ld)', rebaseset))
877 if not roots:
891 if not roots:
878 raise util.Abort(_('no matching revisions'))
892 raise util.Abort(_('no matching revisions'))
879 roots.sort()
893 roots.sort()
880 state = {}
894 state = {}
881 detachset = set()
895 detachset = set()
882 for root in roots:
896 for root in roots:
883 commonbase = root.ancestor(dest)
897 commonbase = root.ancestor(dest)
884 if commonbase == root:
898 if commonbase == root:
885 raise util.Abort(_('source is ancestor of destination'))
899 raise util.Abort(_('source is ancestor of destination'))
886 if commonbase == dest:
900 if commonbase == dest:
887 samebranch = root.branch() == dest.branch()
901 samebranch = root.branch() == dest.branch()
888 if not collapse and samebranch and root in dest.children():
902 if not collapse and samebranch and root in dest.children():
889 repo.ui.debug('source is a child of destination\n')
903 repo.ui.debug('source is a child of destination\n')
890 return None
904 return None
891
905
892 repo.ui.debug('rebase onto %d starting from %s\n' % (dest, root))
906 repo.ui.debug('rebase onto %d starting from %s\n' % (dest, root))
893 state.update(dict.fromkeys(rebaseset, revtodo))
907 state.update(dict.fromkeys(rebaseset, revtodo))
894 # Rebase tries to turn <dest> into a parent of <root> while
908 # Rebase tries to turn <dest> into a parent of <root> while
895 # preserving the number of parents of rebased changesets:
909 # preserving the number of parents of rebased changesets:
896 #
910 #
897 # - A changeset with a single parent will always be rebased as a
911 # - A changeset with a single parent will always be rebased as a
898 # changeset with a single parent.
912 # changeset with a single parent.
899 #
913 #
900 # - A merge will be rebased as merge unless its parents are both
914 # - A merge will be rebased as merge unless its parents are both
901 # ancestors of <dest> or are themselves in the rebased set and
915 # ancestors of <dest> or are themselves in the rebased set and
902 # pruned while rebased.
916 # pruned while rebased.
903 #
917 #
904 # If one parent of <root> is an ancestor of <dest>, the rebased
918 # If one parent of <root> is an ancestor of <dest>, the rebased
905 # version of this parent will be <dest>. This is always true with
919 # version of this parent will be <dest>. This is always true with
906 # --base option.
920 # --base option.
907 #
921 #
908 # Otherwise, we need to *replace* the original parents with
922 # Otherwise, we need to *replace* the original parents with
909 # <dest>. This "detaches" the rebased set from its former location
923 # <dest>. This "detaches" the rebased set from its former location
910 # and rebases it onto <dest>. Changes introduced by ancestors of
924 # and rebases it onto <dest>. Changes introduced by ancestors of
911 # <root> not common with <dest> (the detachset, marked as
925 # <root> not common with <dest> (the detachset, marked as
912 # nullmerge) are "removed" from the rebased changesets.
926 # nullmerge) are "removed" from the rebased changesets.
913 #
927 #
914 # - If <root> has a single parent, set it to <dest>.
928 # - If <root> has a single parent, set it to <dest>.
915 #
929 #
916 # - If <root> is a merge, we cannot decide which parent to
930 # - If <root> is a merge, we cannot decide which parent to
917 # replace, the rebase operation is not clearly defined.
931 # replace, the rebase operation is not clearly defined.
918 #
932 #
919 # The table below sums up this behavior:
933 # The table below sums up this behavior:
920 #
934 #
921 # +------------------+----------------------+-------------------------+
935 # +------------------+----------------------+-------------------------+
922 # | | one parent | merge |
936 # | | one parent | merge |
923 # +------------------+----------------------+-------------------------+
937 # +------------------+----------------------+-------------------------+
924 # | parent in | new parent is <dest> | parents in ::<dest> are |
938 # | parent in | new parent is <dest> | parents in ::<dest> are |
925 # | ::<dest> | | remapped to <dest> |
939 # | ::<dest> | | remapped to <dest> |
926 # +------------------+----------------------+-------------------------+
940 # +------------------+----------------------+-------------------------+
927 # | unrelated source | new parent is <dest> | ambiguous, abort |
941 # | unrelated source | new parent is <dest> | ambiguous, abort |
928 # +------------------+----------------------+-------------------------+
942 # +------------------+----------------------+-------------------------+
929 #
943 #
930 # The actual abort is handled by `defineparents`
944 # The actual abort is handled by `defineparents`
931 if len(root.parents()) <= 1:
945 if len(root.parents()) <= 1:
932 # ancestors of <root> not ancestors of <dest>
946 # ancestors of <root> not ancestors of <dest>
933 detachset.update(repo.changelog.findmissingrevs([commonbase.rev()],
947 detachset.update(repo.changelog.findmissingrevs([commonbase.rev()],
934 [root.rev()]))
948 [root.rev()]))
935 for r in detachset:
949 for r in detachset:
936 if r not in state:
950 if r not in state:
937 state[r] = nullmerge
951 state[r] = nullmerge
938 if len(roots) > 1:
952 if len(roots) > 1:
939 # If we have multiple roots, we may have "hole" in the rebase set.
953 # If we have multiple roots, we may have "hole" in the rebase set.
940 # Rebase roots that descend from those "hole" should not be detached as
954 # Rebase roots that descend from those "hole" should not be detached as
941 # other root are. We use the special `revignored` to inform rebase that
955 # other root are. We use the special `revignored` to inform rebase that
942 # the revision should be ignored but that `defineparents` should search
956 # the revision should be ignored but that `defineparents` should search
943 # a rebase destination that make sense regarding rebased topology.
957 # a rebase destination that make sense regarding rebased topology.
944 rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset))
958 rebasedomain = set(repo.revs('%ld::%ld', rebaseset, rebaseset))
945 for ignored in set(rebasedomain) - set(rebaseset):
959 for ignored in set(rebasedomain) - set(rebaseset):
946 state[ignored] = revignored
960 state[ignored] = revignored
947 return repo['.'].rev(), dest.rev(), state
961 return repo['.'].rev(), dest.rev(), state
948
962
949 def clearrebased(ui, repo, state, skipped, collapsedas=None):
963 def clearrebased(ui, repo, state, skipped, collapsedas=None):
950 """dispose of rebased revision at the end of the rebase
964 """dispose of rebased revision at the end of the rebase
951
965
952 If `collapsedas` is not None, the rebase was a collapse whose result if the
966 If `collapsedas` is not None, the rebase was a collapse whose result if the
953 `collapsedas` node."""
967 `collapsedas` node."""
954 if obsolete.isenabled(repo, obsolete.createmarkersopt):
968 if obsolete.isenabled(repo, obsolete.createmarkersopt):
955 markers = []
969 markers = []
956 for rev, newrev in sorted(state.items()):
970 for rev, newrev in sorted(state.items()):
957 if newrev >= 0:
971 if newrev >= 0:
958 if rev in skipped:
972 if rev in skipped:
959 succs = ()
973 succs = ()
960 elif collapsedas is not None:
974 elif collapsedas is not None:
961 succs = (repo[collapsedas],)
975 succs = (repo[collapsedas],)
962 else:
976 else:
963 succs = (repo[newrev],)
977 succs = (repo[newrev],)
964 markers.append((repo[rev], succs))
978 markers.append((repo[rev], succs))
965 if markers:
979 if markers:
966 obsolete.createmarkers(repo, markers)
980 obsolete.createmarkers(repo, markers)
967 else:
981 else:
968 rebased = [rev for rev in state if state[rev] > nullmerge]
982 rebased = [rev for rev in state if state[rev] > nullmerge]
969 if rebased:
983 if rebased:
970 stripped = []
984 stripped = []
971 for root in repo.set('roots(%ld)', rebased):
985 for root in repo.set('roots(%ld)', rebased):
972 if set(repo.changelog.descendants([root.rev()])) - set(state):
986 if set(repo.changelog.descendants([root.rev()])) - set(state):
973 ui.warn(_("warning: new changesets detected "
987 ui.warn(_("warning: new changesets detected "
974 "on source branch, not stripping\n"))
988 "on source branch, not stripping\n"))
975 else:
989 else:
976 stripped.append(root.node())
990 stripped.append(root.node())
977 if stripped:
991 if stripped:
978 # backup the old csets by default
992 # backup the old csets by default
979 repair.strip(ui, repo, stripped, "all")
993 repair.strip(ui, repo, stripped, "all")
980
994
981
995
982 def pullrebase(orig, ui, repo, *args, **opts):
996 def pullrebase(orig, ui, repo, *args, **opts):
983 'Call rebase after pull if the latter has been invoked with --rebase'
997 'Call rebase after pull if the latter has been invoked with --rebase'
984 if opts.get('rebase'):
998 if opts.get('rebase'):
985 if opts.get('update'):
999 if opts.get('update'):
986 del opts['update']
1000 del opts['update']
987 ui.debug('--update and --rebase are not compatible, ignoring '
1001 ui.debug('--update and --rebase are not compatible, ignoring '
988 'the update flag\n')
1002 'the update flag\n')
989
1003
990 movemarkfrom = repo['.'].node()
1004 movemarkfrom = repo['.'].node()
991 revsprepull = len(repo)
1005 revsprepull = len(repo)
992 origpostincoming = commands.postincoming
1006 origpostincoming = commands.postincoming
993 def _dummy(*args, **kwargs):
1007 def _dummy(*args, **kwargs):
994 pass
1008 pass
995 commands.postincoming = _dummy
1009 commands.postincoming = _dummy
996 try:
1010 try:
997 orig(ui, repo, *args, **opts)
1011 orig(ui, repo, *args, **opts)
998 finally:
1012 finally:
999 commands.postincoming = origpostincoming
1013 commands.postincoming = origpostincoming
1000 revspostpull = len(repo)
1014 revspostpull = len(repo)
1001 if revspostpull > revsprepull:
1015 if revspostpull > revsprepull:
1002 # --rev option from pull conflict with rebase own --rev
1016 # --rev option from pull conflict with rebase own --rev
1003 # dropping it
1017 # dropping it
1004 if 'rev' in opts:
1018 if 'rev' in opts:
1005 del opts['rev']
1019 del opts['rev']
1006 rebase(ui, repo, **opts)
1020 rebase(ui, repo, **opts)
1007 branch = repo[None].branch()
1021 branch = repo[None].branch()
1008 dest = repo[branch].rev()
1022 dest = repo[branch].rev()
1009 if dest != repo['.'].rev():
1023 if dest != repo['.'].rev():
1010 # there was nothing to rebase we force an update
1024 # there was nothing to rebase we force an update
1011 hg.update(repo, dest)
1025 hg.update(repo, dest)
1012 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
1026 if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
1013 ui.status(_("updating bookmark %s\n")
1027 ui.status(_("updating bookmark %s\n")
1014 % repo._bookmarkcurrent)
1028 % repo._bookmarkcurrent)
1015 else:
1029 else:
1016 if opts.get('tool'):
1030 if opts.get('tool'):
1017 raise util.Abort(_('--tool can only be used with --rebase'))
1031 raise util.Abort(_('--tool can only be used with --rebase'))
1018 orig(ui, repo, *args, **opts)
1032 orig(ui, repo, *args, **opts)
1019
1033
1020 def summaryhook(ui, repo):
1034 def summaryhook(ui, repo):
1021 if not os.path.exists(repo.join('rebasestate')):
1035 if not os.path.exists(repo.join('rebasestate')):
1022 return
1036 return
1023 try:
1037 try:
1024 state = restorestatus(repo)[2]
1038 state = restorestatus(repo)[2]
1025 except error.RepoLookupError:
1039 except error.RepoLookupError:
1026 # i18n: column positioning for "hg summary"
1040 # i18n: column positioning for "hg summary"
1027 msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n')
1041 msg = _('rebase: (use "hg rebase --abort" to clear broken state)\n')
1028 ui.write(msg)
1042 ui.write(msg)
1029 return
1043 return
1030 numrebased = len([i for i in state.itervalues() if i >= 0])
1044 numrebased = len([i for i in state.itervalues() if i >= 0])
1031 # i18n: column positioning for "hg summary"
1045 # i18n: column positioning for "hg summary"
1032 ui.write(_('rebase: %s, %s (rebase --continue)\n') %
1046 ui.write(_('rebase: %s, %s (rebase --continue)\n') %
1033 (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased,
1047 (ui.label(_('%d rebased'), 'rebase.rebased') % numrebased,
1034 ui.label(_('%d remaining'), 'rebase.remaining') %
1048 ui.label(_('%d remaining'), 'rebase.remaining') %
1035 (len(state) - numrebased)))
1049 (len(state) - numrebased)))
1036
1050
1037 def uisetup(ui):
1051 def uisetup(ui):
1038 'Replace pull with a decorator to provide --rebase option'
1052 'Replace pull with a decorator to provide --rebase option'
1039 entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
1053 entry = extensions.wrapcommand(commands.table, 'pull', pullrebase)
1040 entry[1].append(('', 'rebase', None,
1054 entry[1].append(('', 'rebase', None,
1041 _("rebase working directory to branch head")))
1055 _("rebase working directory to branch head")))
1042 entry[1].append(('t', 'tool', '',
1056 entry[1].append(('t', 'tool', '',
1043 _("specify merge tool for rebase")))
1057 _("specify merge tool for rebase")))
1044 cmdutil.summaryhooks.add('rebase', summaryhook)
1058 cmdutil.summaryhooks.add('rebase', summaryhook)
1045 cmdutil.unfinishedstates.append(
1059 cmdutil.unfinishedstates.append(
1046 ['rebasestate', False, False, _('rebase in progress'),
1060 ['rebasestate', False, False, _('rebase in progress'),
1047 _("use 'hg rebase --continue' or 'hg rebase --abort'")])
1061 _("use 'hg rebase --continue' or 'hg rebase --abort'")])
@@ -1,67 +1,68 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "rebase=" >> $HGRCPATH
2 $ echo "rebase=" >> $HGRCPATH
3
3
4 initialize repository
4 initialize repository
5
5
6 $ hg init
6 $ hg init
7
7
8 $ echo 'a' > a
8 $ echo 'a' > a
9 $ hg ci -A -m "0"
9 $ hg ci -A -m "0"
10 adding a
10 adding a
11
11
12 $ echo 'b' > b
12 $ echo 'b' > b
13 $ hg ci -A -m "1"
13 $ hg ci -A -m "1"
14 adding b
14 adding b
15
15
16 $ hg up 0
16 $ hg up 0
17 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
17 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
18 $ echo 'c' > c
18 $ echo 'c' > c
19 $ hg ci -A -m "2"
19 $ hg ci -A -m "2"
20 adding c
20 adding c
21 created new head
21 created new head
22
22
23 $ echo 'd' > d
23 $ echo 'd' > d
24 $ hg ci -A -m "3"
24 $ hg ci -A -m "3"
25 adding d
25 adding d
26
26
27 $ hg bookmark -r 1 one
27 $ hg bookmark -r 1 one
28 $ hg bookmark -r 3 two
28 $ hg bookmark -r 3 two
29 $ hg up -q two
29 $ hg up -q two
30
30
31 bookmark list
31 bookmark list
32
32
33 $ hg bookmark
33 $ hg bookmark
34 one 1:925d80f479bb
34 one 1:925d80f479bb
35 * two 3:2ae46b1d99a7
35 * two 3:2ae46b1d99a7
36
36
37 rebase
37 rebase
38
38
39 $ hg rebase -s two -d one
39 $ hg rebase -s two -d one
40 rebasing 3:2ae46b1d99a7 "3" (tip two)
40 saved backup bundle to $TESTTMP/.hg/strip-backup/2ae46b1d99a7-backup.hg (glob)
41 saved backup bundle to $TESTTMP/.hg/strip-backup/2ae46b1d99a7-backup.hg (glob)
41
42
42 $ hg log
43 $ hg log
43 changeset: 3:42e5ed2cdcf4
44 changeset: 3:42e5ed2cdcf4
44 bookmark: two
45 bookmark: two
45 tag: tip
46 tag: tip
46 parent: 1:925d80f479bb
47 parent: 1:925d80f479bb
47 user: test
48 user: test
48 date: Thu Jan 01 00:00:00 1970 +0000
49 date: Thu Jan 01 00:00:00 1970 +0000
49 summary: 3
50 summary: 3
50
51
51 changeset: 2:db815d6d32e6
52 changeset: 2:db815d6d32e6
52 parent: 0:f7b1eb17ad24
53 parent: 0:f7b1eb17ad24
53 user: test
54 user: test
54 date: Thu Jan 01 00:00:00 1970 +0000
55 date: Thu Jan 01 00:00:00 1970 +0000
55 summary: 2
56 summary: 2
56
57
57 changeset: 1:925d80f479bb
58 changeset: 1:925d80f479bb
58 bookmark: one
59 bookmark: one
59 user: test
60 user: test
60 date: Thu Jan 01 00:00:00 1970 +0000
61 date: Thu Jan 01 00:00:00 1970 +0000
61 summary: 1
62 summary: 1
62
63
63 changeset: 0:f7b1eb17ad24
64 changeset: 0:f7b1eb17ad24
64 user: test
65 user: test
65 date: Thu Jan 01 00:00:00 1970 +0000
66 date: Thu Jan 01 00:00:00 1970 +0000
66 summary: 0
67 summary: 0
67
68
@@ -1,458 +1,459 b''
1 $ . "$TESTDIR/histedit-helpers.sh"
1 $ . "$TESTDIR/histedit-helpers.sh"
2
2
3 Enable obsolete
3 Enable obsolete
4
4
5 $ cat >> $HGRCPATH << EOF
5 $ cat >> $HGRCPATH << EOF
6 > [ui]
6 > [ui]
7 > logtemplate= {rev}:{node|short} {desc|firstline}
7 > logtemplate= {rev}:{node|short} {desc|firstline}
8 > [phases]
8 > [phases]
9 > publish=False
9 > publish=False
10 > [experimental]
10 > [experimental]
11 > evolution=createmarkers,allowunstable
11 > evolution=createmarkers,allowunstable
12 > [extensions]
12 > [extensions]
13 > histedit=
13 > histedit=
14 > rebase=
14 > rebase=
15 > EOF
15 > EOF
16
16
17 $ hg init base
17 $ hg init base
18 $ cd base
18 $ cd base
19
19
20 $ for x in a b c d e f ; do
20 $ for x in a b c d e f ; do
21 > echo $x > $x
21 > echo $x > $x
22 > hg add $x
22 > hg add $x
23 > hg ci -m $x
23 > hg ci -m $x
24 > done
24 > done
25
25
26 $ hg log --graph
26 $ hg log --graph
27 @ 5:652413bf663e f
27 @ 5:652413bf663e f
28 |
28 |
29 o 4:e860deea161a e
29 o 4:e860deea161a e
30 |
30 |
31 o 3:055a42cdd887 d
31 o 3:055a42cdd887 d
32 |
32 |
33 o 2:177f92b77385 c
33 o 2:177f92b77385 c
34 |
34 |
35 o 1:d2ae7f538514 b
35 o 1:d2ae7f538514 b
36 |
36 |
37 o 0:cb9a9f314b8b a
37 o 0:cb9a9f314b8b a
38
38
39
39
40 $ HGEDITOR=cat hg histedit 1
40 $ HGEDITOR=cat hg histedit 1
41 pick d2ae7f538514 1 b
41 pick d2ae7f538514 1 b
42 pick 177f92b77385 2 c
42 pick 177f92b77385 2 c
43 pick 055a42cdd887 3 d
43 pick 055a42cdd887 3 d
44 pick e860deea161a 4 e
44 pick e860deea161a 4 e
45 pick 652413bf663e 5 f
45 pick 652413bf663e 5 f
46
46
47 # Edit history between d2ae7f538514 and 652413bf663e
47 # Edit history between d2ae7f538514 and 652413bf663e
48 #
48 #
49 # Commits are listed from least to most recent
49 # Commits are listed from least to most recent
50 #
50 #
51 # Commands:
51 # Commands:
52 # p, pick = use commit
52 # p, pick = use commit
53 # e, edit = use commit, but stop for amending
53 # e, edit = use commit, but stop for amending
54 # f, fold = use commit, but combine it with the one above
54 # f, fold = use commit, but combine it with the one above
55 # r, roll = like fold, but discard this commit's description
55 # r, roll = like fold, but discard this commit's description
56 # d, drop = remove commit from history
56 # d, drop = remove commit from history
57 # m, mess = edit message without changing commit content
57 # m, mess = edit message without changing commit content
58 #
58 #
59 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 $ hg histedit 1 --commands - --verbose <<EOF | grep histedit
60 $ hg histedit 1 --commands - --verbose <<EOF | grep histedit
61 > pick 177f92b77385 2 c
61 > pick 177f92b77385 2 c
62 > drop d2ae7f538514 1 b
62 > drop d2ae7f538514 1 b
63 > pick 055a42cdd887 3 d
63 > pick 055a42cdd887 3 d
64 > fold e860deea161a 4 e
64 > fold e860deea161a 4 e
65 > pick 652413bf663e 5 f
65 > pick 652413bf663e 5 f
66 > EOF
66 > EOF
67 saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-backup.hg (glob)
67 saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-backup.hg (glob)
68 $ hg log --graph --hidden
68 $ hg log --graph --hidden
69 @ 8:cacdfd884a93 f
69 @ 8:cacdfd884a93 f
70 |
70 |
71 o 7:59d9f330561f d
71 o 7:59d9f330561f d
72 |
72 |
73 o 6:b346ab9a313d c
73 o 6:b346ab9a313d c
74 |
74 |
75 | x 5:652413bf663e f
75 | x 5:652413bf663e f
76 | |
76 | |
77 | x 4:e860deea161a e
77 | x 4:e860deea161a e
78 | |
78 | |
79 | x 3:055a42cdd887 d
79 | x 3:055a42cdd887 d
80 | |
80 | |
81 | x 2:177f92b77385 c
81 | x 2:177f92b77385 c
82 | |
82 | |
83 | x 1:d2ae7f538514 b
83 | x 1:d2ae7f538514 b
84 |/
84 |/
85 o 0:cb9a9f314b8b a
85 o 0:cb9a9f314b8b a
86
86
87 $ hg debugobsolete
87 $ hg debugobsolete
88 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (*) {'user': 'test'} (glob)
88 d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b} (*) {'user': 'test'} (glob)
89 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (*) {'user': 'test'} (glob)
89 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 (*) {'user': 'test'} (glob)
90 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
90 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
91 e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
91 e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 (*) {'user': 'test'} (glob)
92 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (*) {'user': 'test'} (glob)
92 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 (*) {'user': 'test'} (glob)
93
93
94
94
95 Ensure hidden revision does not prevent histedit
95 Ensure hidden revision does not prevent histedit
96 -------------------------------------------------
96 -------------------------------------------------
97
97
98 create an hidden revision
98 create an hidden revision
99
99
100 $ hg histedit 6 --commands - << EOF
100 $ hg histedit 6 --commands - << EOF
101 > pick b346ab9a313d 6 c
101 > pick b346ab9a313d 6 c
102 > drop 59d9f330561f 7 d
102 > drop 59d9f330561f 7 d
103 > pick cacdfd884a93 8 f
103 > pick cacdfd884a93 8 f
104 > EOF
104 > EOF
105 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
105 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
106 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 $ hg log --graph
107 $ hg log --graph
108 @ 9:c13eb81022ca f
108 @ 9:c13eb81022ca f
109 |
109 |
110 o 6:b346ab9a313d c
110 o 6:b346ab9a313d c
111 |
111 |
112 o 0:cb9a9f314b8b a
112 o 0:cb9a9f314b8b a
113
113
114 check hidden revision are ignored (6 have hidden children 7 and 8)
114 check hidden revision are ignored (6 have hidden children 7 and 8)
115
115
116 $ hg histedit 6 --commands - << EOF
116 $ hg histedit 6 --commands - << EOF
117 > pick b346ab9a313d 6 c
117 > pick b346ab9a313d 6 c
118 > pick c13eb81022ca 8 f
118 > pick c13eb81022ca 8 f
119 > EOF
119 > EOF
120 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
121
121
122
122
123
123
124 Test that rewriting leaving instability behind is allowed
124 Test that rewriting leaving instability behind is allowed
125 ---------------------------------------------------------------------
125 ---------------------------------------------------------------------
126
126
127 $ hg up '.^'
127 $ hg up '.^'
128 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
128 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
129 $ hg log -r 'children(.)'
129 $ hg log -r 'children(.)'
130 9:c13eb81022ca f (no-eol)
130 9:c13eb81022ca f (no-eol)
131 $ hg histedit -r '.' --commands - <<EOF
131 $ hg histedit -r '.' --commands - <<EOF
132 > edit b346ab9a313d 6 c
132 > edit b346ab9a313d 6 c
133 > EOF
133 > EOF
134 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
134 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
135 adding c
135 adding c
136 Make changes as needed, you may commit or record as needed now.
136 Make changes as needed, you may commit or record as needed now.
137 When you are finished, run hg histedit --continue to resume.
137 When you are finished, run hg histedit --continue to resume.
138 [1]
138 [1]
139 $ echo c >> c
139 $ echo c >> c
140 $ hg histedit --continue
140 $ hg histedit --continue
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
142
142
143 $ hg log -r 'unstable()'
143 $ hg log -r 'unstable()'
144 9:c13eb81022ca f (no-eol)
144 9:c13eb81022ca f (no-eol)
145
145
146 stabilise
146 stabilise
147
147
148 $ hg rebase -r 'unstable()' -d .
148 $ hg rebase -r 'unstable()' -d .
149 rebasing 9:c13eb81022ca "f"
149 $ hg up tip -q
150 $ hg up tip -q
150
151
151 Test dropping of changeset on the top of the stack
152 Test dropping of changeset on the top of the stack
152 -------------------------------------------------------
153 -------------------------------------------------------
153
154
154 Nothing is rewritten below, the working directory parent must be change for the
155 Nothing is rewritten below, the working directory parent must be change for the
155 dropped changeset to be hidden.
156 dropped changeset to be hidden.
156
157
157 $ cd ..
158 $ cd ..
158 $ hg clone base droplast
159 $ hg clone base droplast
159 updating to branch default
160 updating to branch default
160 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 $ cd droplast
162 $ cd droplast
162 $ hg histedit -r '40db8afa467b' --commands - << EOF
163 $ hg histedit -r '40db8afa467b' --commands - << EOF
163 > pick 40db8afa467b 10 c
164 > pick 40db8afa467b 10 c
164 > drop b449568bf7fc 11 f
165 > drop b449568bf7fc 11 f
165 > EOF
166 > EOF
166 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
167 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
167 $ hg log -G
168 $ hg log -G
168 @ 10:40db8afa467b c
169 @ 10:40db8afa467b c
169 |
170 |
170 o 0:cb9a9f314b8b a
171 o 0:cb9a9f314b8b a
171
172
172
173
173 With rewritten ancestors
174 With rewritten ancestors
174
175
175 $ echo e > e
176 $ echo e > e
176 $ hg add e
177 $ hg add e
177 $ hg commit -m g
178 $ hg commit -m g
178 $ echo f > f
179 $ echo f > f
179 $ hg add f
180 $ hg add f
180 $ hg commit -m h
181 $ hg commit -m h
181 $ hg histedit -r '40db8afa467b' --commands - << EOF
182 $ hg histedit -r '40db8afa467b' --commands - << EOF
182 > pick 47a8561c0449 12 g
183 > pick 47a8561c0449 12 g
183 > pick 40db8afa467b 10 c
184 > pick 40db8afa467b 10 c
184 > drop 1b3b05f35ff0 13 h
185 > drop 1b3b05f35ff0 13 h
185 > EOF
186 > EOF
186 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
187 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
187 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 $ hg log -G
190 $ hg log -G
190 @ 15:ee6544123ab8 c
191 @ 15:ee6544123ab8 c
191 |
192 |
192 o 14:269e713e9eae g
193 o 14:269e713e9eae g
193 |
194 |
194 o 0:cb9a9f314b8b a
195 o 0:cb9a9f314b8b a
195
196
196 $ cd ../base
197 $ cd ../base
197
198
198
199
199
200
200 Test phases support
201 Test phases support
201 ===========================================
202 ===========================================
202
203
203 Check that histedit respect immutability
204 Check that histedit respect immutability
204 -------------------------------------------
205 -------------------------------------------
205
206
206 $ cat >> $HGRCPATH << EOF
207 $ cat >> $HGRCPATH << EOF
207 > [ui]
208 > [ui]
208 > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n
209 > logtemplate= {rev}:{node|short} ({phase}) {desc|firstline}\n
209 > EOF
210 > EOF
210
211
211 $ hg ph -pv '.^'
212 $ hg ph -pv '.^'
212 phase changed for 2 changesets
213 phase changed for 2 changesets
213 $ hg log -G
214 $ hg log -G
214 @ 11:b449568bf7fc (draft) f
215 @ 11:b449568bf7fc (draft) f
215 |
216 |
216 o 10:40db8afa467b (public) c
217 o 10:40db8afa467b (public) c
217 |
218 |
218 o 0:cb9a9f314b8b (public) a
219 o 0:cb9a9f314b8b (public) a
219
220
220 $ hg histedit -r '.~2'
221 $ hg histedit -r '.~2'
221 abort: cannot edit immutable changeset: cb9a9f314b8b
222 abort: cannot edit immutable changeset: cb9a9f314b8b
222 [255]
223 [255]
223
224
224
225
225 Prepare further testing
226 Prepare further testing
226 -------------------------------------------
227 -------------------------------------------
227
228
228 $ for x in g h i j k ; do
229 $ for x in g h i j k ; do
229 > echo $x > $x
230 > echo $x > $x
230 > hg add $x
231 > hg add $x
231 > hg ci -m $x
232 > hg ci -m $x
232 > done
233 > done
233 $ hg phase --force --secret .~2
234 $ hg phase --force --secret .~2
234 $ hg log -G
235 $ hg log -G
235 @ 16:ee118ab9fa44 (secret) k
236 @ 16:ee118ab9fa44 (secret) k
236 |
237 |
237 o 15:3a6c53ee7f3d (secret) j
238 o 15:3a6c53ee7f3d (secret) j
238 |
239 |
239 o 14:b605fb7503f2 (secret) i
240 o 14:b605fb7503f2 (secret) i
240 |
241 |
241 o 13:7395e1ff83bd (draft) h
242 o 13:7395e1ff83bd (draft) h
242 |
243 |
243 o 12:6b70183d2492 (draft) g
244 o 12:6b70183d2492 (draft) g
244 |
245 |
245 o 11:b449568bf7fc (draft) f
246 o 11:b449568bf7fc (draft) f
246 |
247 |
247 o 10:40db8afa467b (public) c
248 o 10:40db8afa467b (public) c
248 |
249 |
249 o 0:cb9a9f314b8b (public) a
250 o 0:cb9a9f314b8b (public) a
250
251
251 $ cd ..
252 $ cd ..
252
253
253 simple phase conservation
254 simple phase conservation
254 -------------------------------------------
255 -------------------------------------------
255
256
256 Resulting changeset should conserve the phase of the original one whatever the
257 Resulting changeset should conserve the phase of the original one whatever the
257 phases.new-commit option is.
258 phases.new-commit option is.
258
259
259 New-commit as draft (default)
260 New-commit as draft (default)
260
261
261 $ cp -r base simple-draft
262 $ cp -r base simple-draft
262 $ cd simple-draft
263 $ cd simple-draft
263 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
264 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
264 > edit b449568bf7fc 11 f
265 > edit b449568bf7fc 11 f
265 > pick 6b70183d2492 12 g
266 > pick 6b70183d2492 12 g
266 > pick 7395e1ff83bd 13 h
267 > pick 7395e1ff83bd 13 h
267 > pick b605fb7503f2 14 i
268 > pick b605fb7503f2 14 i
268 > pick 3a6c53ee7f3d 15 j
269 > pick 3a6c53ee7f3d 15 j
269 > pick ee118ab9fa44 16 k
270 > pick ee118ab9fa44 16 k
270 > EOF
271 > EOF
271 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
272 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
272 adding f
273 adding f
273 Make changes as needed, you may commit or record as needed now.
274 Make changes as needed, you may commit or record as needed now.
274 When you are finished, run hg histedit --continue to resume.
275 When you are finished, run hg histedit --continue to resume.
275 [1]
276 [1]
276 $ echo f >> f
277 $ echo f >> f
277 $ hg histedit --continue
278 $ hg histedit --continue
278 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
280 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
281 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
282 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
282 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
283 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
283 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 $ hg log -G
285 $ hg log -G
285 @ 22:12e89af74238 (secret) k
286 @ 22:12e89af74238 (secret) k
286 |
287 |
287 o 21:636a8687b22e (secret) j
288 o 21:636a8687b22e (secret) j
288 |
289 |
289 o 20:ccaf0a38653f (secret) i
290 o 20:ccaf0a38653f (secret) i
290 |
291 |
291 o 19:11a89d1c2613 (draft) h
292 o 19:11a89d1c2613 (draft) h
292 |
293 |
293 o 18:c1dec7ca82ea (draft) g
294 o 18:c1dec7ca82ea (draft) g
294 |
295 |
295 o 17:087281e68428 (draft) f
296 o 17:087281e68428 (draft) f
296 |
297 |
297 o 10:40db8afa467b (public) c
298 o 10:40db8afa467b (public) c
298 |
299 |
299 o 0:cb9a9f314b8b (public) a
300 o 0:cb9a9f314b8b (public) a
300
301
301 $ cd ..
302 $ cd ..
302
303
303
304
304 New-commit as draft (default)
305 New-commit as draft (default)
305
306
306 $ cp -r base simple-secret
307 $ cp -r base simple-secret
307 $ cd simple-secret
308 $ cd simple-secret
308 $ cat >> .hg/hgrc << EOF
309 $ cat >> .hg/hgrc << EOF
309 > [phases]
310 > [phases]
310 > new-commit=secret
311 > new-commit=secret
311 > EOF
312 > EOF
312 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
313 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
313 > edit b449568bf7fc 11 f
314 > edit b449568bf7fc 11 f
314 > pick 6b70183d2492 12 g
315 > pick 6b70183d2492 12 g
315 > pick 7395e1ff83bd 13 h
316 > pick 7395e1ff83bd 13 h
316 > pick b605fb7503f2 14 i
317 > pick b605fb7503f2 14 i
317 > pick 3a6c53ee7f3d 15 j
318 > pick 3a6c53ee7f3d 15 j
318 > pick ee118ab9fa44 16 k
319 > pick ee118ab9fa44 16 k
319 > EOF
320 > EOF
320 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
321 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
321 adding f
322 adding f
322 Make changes as needed, you may commit or record as needed now.
323 Make changes as needed, you may commit or record as needed now.
323 When you are finished, run hg histedit --continue to resume.
324 When you are finished, run hg histedit --continue to resume.
324 [1]
325 [1]
325 $ echo f >> f
326 $ echo f >> f
326 $ hg histedit --continue
327 $ hg histedit --continue
327 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 $ hg log -G
334 $ hg log -G
334 @ 22:12e89af74238 (secret) k
335 @ 22:12e89af74238 (secret) k
335 |
336 |
336 o 21:636a8687b22e (secret) j
337 o 21:636a8687b22e (secret) j
337 |
338 |
338 o 20:ccaf0a38653f (secret) i
339 o 20:ccaf0a38653f (secret) i
339 |
340 |
340 o 19:11a89d1c2613 (draft) h
341 o 19:11a89d1c2613 (draft) h
341 |
342 |
342 o 18:c1dec7ca82ea (draft) g
343 o 18:c1dec7ca82ea (draft) g
343 |
344 |
344 o 17:087281e68428 (draft) f
345 o 17:087281e68428 (draft) f
345 |
346 |
346 o 10:40db8afa467b (public) c
347 o 10:40db8afa467b (public) c
347 |
348 |
348 o 0:cb9a9f314b8b (public) a
349 o 0:cb9a9f314b8b (public) a
349
350
350 $ cd ..
351 $ cd ..
351
352
352
353
353 Changeset reordering
354 Changeset reordering
354 -------------------------------------------
355 -------------------------------------------
355
356
356 If a secret changeset is put before a draft one, all descendant should be secret.
357 If a secret changeset is put before a draft one, all descendant should be secret.
357 It seems more important to present the secret phase.
358 It seems more important to present the secret phase.
358
359
359 $ cp -r base reorder
360 $ cp -r base reorder
360 $ cd reorder
361 $ cd reorder
361 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
362 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
362 > pick b449568bf7fc 11 f
363 > pick b449568bf7fc 11 f
363 > pick 3a6c53ee7f3d 15 j
364 > pick 3a6c53ee7f3d 15 j
364 > pick 6b70183d2492 12 g
365 > pick 6b70183d2492 12 g
365 > pick b605fb7503f2 14 i
366 > pick b605fb7503f2 14 i
366 > pick 7395e1ff83bd 13 h
367 > pick 7395e1ff83bd 13 h
367 > pick ee118ab9fa44 16 k
368 > pick ee118ab9fa44 16 k
368 > EOF
369 > EOF
369 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
370 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
370 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
373 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
373 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 $ hg log -G
376 $ hg log -G
376 @ 21:558246857888 (secret) k
377 @ 21:558246857888 (secret) k
377 |
378 |
378 o 20:28bd44768535 (secret) h
379 o 20:28bd44768535 (secret) h
379 |
380 |
380 o 19:d5395202aeb9 (secret) i
381 o 19:d5395202aeb9 (secret) i
381 |
382 |
382 o 18:21edda8e341b (secret) g
383 o 18:21edda8e341b (secret) g
383 |
384 |
384 o 17:5ab64f3a4832 (secret) j
385 o 17:5ab64f3a4832 (secret) j
385 |
386 |
386 o 11:b449568bf7fc (draft) f
387 o 11:b449568bf7fc (draft) f
387 |
388 |
388 o 10:40db8afa467b (public) c
389 o 10:40db8afa467b (public) c
389 |
390 |
390 o 0:cb9a9f314b8b (public) a
391 o 0:cb9a9f314b8b (public) a
391
392
392 $ cd ..
393 $ cd ..
393
394
394 Changeset folding
395 Changeset folding
395 -------------------------------------------
396 -------------------------------------------
396
397
397 Folding a secret changeset with a draft one turn the result secret (again,
398 Folding a secret changeset with a draft one turn the result secret (again,
398 better safe than sorry). Folding between same phase changeset still works
399 better safe than sorry). Folding between same phase changeset still works
399
400
400 Note that there is a few reordering in this series for more extensive test
401 Note that there is a few reordering in this series for more extensive test
401
402
402 $ cp -r base folding
403 $ cp -r base folding
403 $ cd folding
404 $ cd folding
404 $ cat >> .hg/hgrc << EOF
405 $ cat >> .hg/hgrc << EOF
405 > [phases]
406 > [phases]
406 > new-commit=secret
407 > new-commit=secret
407 > EOF
408 > EOF
408 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
409 $ hg histedit -r 'b449568bf7fc' --commands - << EOF
409 > pick 7395e1ff83bd 13 h
410 > pick 7395e1ff83bd 13 h
410 > fold b449568bf7fc 11 f
411 > fold b449568bf7fc 11 f
411 > pick 6b70183d2492 12 g
412 > pick 6b70183d2492 12 g
412 > fold 3a6c53ee7f3d 15 j
413 > fold 3a6c53ee7f3d 15 j
413 > pick b605fb7503f2 14 i
414 > pick b605fb7503f2 14 i
414 > fold ee118ab9fa44 16 k
415 > fold ee118ab9fa44 16 k
415 > EOF
416 > EOF
416 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
417 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
417 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
418 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
418 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
419 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
419 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
420 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
420 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
423 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
423 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
427 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
427 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 saved backup bundle to $TESTTMP/folding/.hg/strip-backup/58019c66f35f-backup.hg (glob)
430 saved backup bundle to $TESTTMP/folding/.hg/strip-backup/58019c66f35f-backup.hg (glob)
430 saved backup bundle to $TESTTMP/folding/.hg/strip-backup/83d1858e070b-backup.hg (glob)
431 saved backup bundle to $TESTTMP/folding/.hg/strip-backup/83d1858e070b-backup.hg (glob)
431 saved backup bundle to $TESTTMP/folding/.hg/strip-backup/859969f5ed7e-backup.hg (glob)
432 saved backup bundle to $TESTTMP/folding/.hg/strip-backup/859969f5ed7e-backup.hg (glob)
432 $ hg log -G
433 $ hg log -G
433 @ 19:f9daec13fb98 (secret) i
434 @ 19:f9daec13fb98 (secret) i
434 |
435 |
435 o 18:49807617f46a (secret) g
436 o 18:49807617f46a (secret) g
436 |
437 |
437 o 17:050280826e04 (draft) h
438 o 17:050280826e04 (draft) h
438 |
439 |
439 o 10:40db8afa467b (public) c
440 o 10:40db8afa467b (public) c
440 |
441 |
441 o 0:cb9a9f314b8b (public) a
442 o 0:cb9a9f314b8b (public) a
442
443
443 $ hg co 18
444 $ hg co 18
444 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
445 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
445 $ echo wat >> wat
446 $ echo wat >> wat
446 $ hg add wat
447 $ hg add wat
447 $ hg ci -m 'add wat'
448 $ hg ci -m 'add wat'
448 created new head
449 created new head
449 $ hg merge 19
450 $ hg merge 19
450 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
451 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
451 (branch merge, don't forget to commit)
452 (branch merge, don't forget to commit)
452 $ hg ci -m 'merge'
453 $ hg ci -m 'merge'
453 $ echo not wat > wat
454 $ echo not wat > wat
454 $ hg ci -m 'modify wat'
455 $ hg ci -m 'modify wat'
455 $ hg histedit 17
456 $ hg histedit 17
456 abort: cannot edit history that contains merges
457 abort: cannot edit history that contains merges
457 [255]
458 [255]
458 $ cd ..
459 $ cd ..
@@ -1,651 +1,656 b''
1 This file focuses mainly on updating largefiles in the working
1 This file focuses mainly on updating largefiles in the working
2 directory (and ".hg/largefiles/dirstate")
2 directory (and ".hg/largefiles/dirstate")
3
3
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [ui]
5 > [ui]
6 > merge = internal:fail
6 > merge = internal:fail
7 > [extensions]
7 > [extensions]
8 > largefiles =
8 > largefiles =
9 > EOF
9 > EOF
10
10
11 $ hg init repo
11 $ hg init repo
12 $ cd repo
12 $ cd repo
13
13
14 $ echo large1 > large1
14 $ echo large1 > large1
15 $ echo large2 > large2
15 $ echo large2 > large2
16 $ hg add --large large1 large2
16 $ hg add --large large1 large2
17 $ echo normal1 > normal1
17 $ echo normal1 > normal1
18 $ hg add normal1
18 $ hg add normal1
19 $ hg commit -m '#0'
19 $ hg commit -m '#0'
20 $ echo 'large1 in #1' > large1
20 $ echo 'large1 in #1' > large1
21 $ echo 'normal1 in #1' > normal1
21 $ echo 'normal1 in #1' > normal1
22 $ hg commit -m '#1'
22 $ hg commit -m '#1'
23 $ hg update -q -C 0
23 $ hg update -q -C 0
24 $ echo 'large2 in #2' > large2
24 $ echo 'large2 in #2' > large2
25 $ hg commit -m '#2'
25 $ hg commit -m '#2'
26 created new head
26 created new head
27
27
28 Test that "hg merge" updates largefiles from "other" correctly
28 Test that "hg merge" updates largefiles from "other" correctly
29
29
30 (getting largefiles from "other" normally)
30 (getting largefiles from "other" normally)
31
31
32 $ hg status -A large1
32 $ hg status -A large1
33 C large1
33 C large1
34 $ cat large1
34 $ cat large1
35 large1
35 large1
36 $ cat .hglf/large1
36 $ cat .hglf/large1
37 4669e532d5b2c093a78eca010077e708a071bb64
37 4669e532d5b2c093a78eca010077e708a071bb64
38 $ hg merge --config debug.dirstate.delaywrite=2
38 $ hg merge --config debug.dirstate.delaywrite=2
39 getting changed largefiles
39 getting changed largefiles
40 1 largefiles updated, 0 removed
40 1 largefiles updated, 0 removed
41 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 (branch merge, don't forget to commit)
42 (branch merge, don't forget to commit)
43 $ hg status -A large1
43 $ hg status -A large1
44 M large1
44 M large1
45 $ cat large1
45 $ cat large1
46 large1 in #1
46 large1 in #1
47 $ cat .hglf/large1
47 $ cat .hglf/large1
48 58e24f733a964da346e2407a2bee99d9001184f5
48 58e24f733a964da346e2407a2bee99d9001184f5
49 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
49 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
50 -4669e532d5b2c093a78eca010077e708a071bb64
50 -4669e532d5b2c093a78eca010077e708a071bb64
51 +58e24f733a964da346e2407a2bee99d9001184f5
51 +58e24f733a964da346e2407a2bee99d9001184f5
52
52
53 (getting largefiles from "other" via conflict prompt)
53 (getting largefiles from "other" via conflict prompt)
54
54
55 $ hg update -q -C 2
55 $ hg update -q -C 2
56 $ echo 'large1 in #3' > large1
56 $ echo 'large1 in #3' > large1
57 $ echo 'normal1 in #3' > normal1
57 $ echo 'normal1 in #3' > normal1
58 $ hg commit -m '#3'
58 $ hg commit -m '#3'
59 $ cat .hglf/large1
59 $ cat .hglf/large1
60 e5bb990443d6a92aaf7223813720f7566c9dd05b
60 e5bb990443d6a92aaf7223813720f7566c9dd05b
61 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
61 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
62 > o
62 > o
63 > EOF
63 > EOF
64 largefile large1 has a merge conflict
64 largefile large1 has a merge conflict
65 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
65 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
66 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
66 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
67 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
67 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
68 merging normal1
68 merging normal1
69 warning: conflicts during merge.
69 warning: conflicts during merge.
70 merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
70 merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
71 getting changed largefiles
71 getting changed largefiles
72 1 largefiles updated, 0 removed
72 1 largefiles updated, 0 removed
73 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
73 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
74 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
74 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
75 [1]
75 [1]
76 $ hg status -A large1
76 $ hg status -A large1
77 M large1
77 M large1
78 $ cat large1
78 $ cat large1
79 large1 in #1
79 large1 in #1
80 $ cat .hglf/large1
80 $ cat .hglf/large1
81 58e24f733a964da346e2407a2bee99d9001184f5
81 58e24f733a964da346e2407a2bee99d9001184f5
82
82
83 Test that "hg revert -r REV" updates largefiles from "REV" correctly
83 Test that "hg revert -r REV" updates largefiles from "REV" correctly
84
84
85 $ hg update -q -C 3
85 $ hg update -q -C 3
86 $ hg status -A large1
86 $ hg status -A large1
87 C large1
87 C large1
88 $ cat large1
88 $ cat large1
89 large1 in #3
89 large1 in #3
90 $ cat .hglf/large1
90 $ cat .hglf/large1
91 e5bb990443d6a92aaf7223813720f7566c9dd05b
91 e5bb990443d6a92aaf7223813720f7566c9dd05b
92 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
92 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
93 -4669e532d5b2c093a78eca010077e708a071bb64
93 -4669e532d5b2c093a78eca010077e708a071bb64
94 +58e24f733a964da346e2407a2bee99d9001184f5
94 +58e24f733a964da346e2407a2bee99d9001184f5
95 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
95 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
96 $ hg status -A large1
96 $ hg status -A large1
97 M large1
97 M large1
98 $ cat large1
98 $ cat large1
99 large1 in #1
99 large1 in #1
100 $ cat .hglf/large1
100 $ cat .hglf/large1
101 58e24f733a964da346e2407a2bee99d9001184f5
101 58e24f733a964da346e2407a2bee99d9001184f5
102
102
103 Test that "hg rollback" restores status of largefiles correctly
103 Test that "hg rollback" restores status of largefiles correctly
104
104
105 $ hg update -C -q
105 $ hg update -C -q
106 $ hg remove large1
106 $ hg remove large1
107 $ test -f .hglf/large1
107 $ test -f .hglf/large1
108 [1]
108 [1]
109 $ hg forget large2
109 $ hg forget large2
110 $ test -f .hglf/large2
110 $ test -f .hglf/large2
111 [1]
111 [1]
112 $ echo largeX > largeX
112 $ echo largeX > largeX
113 $ hg add --large largeX
113 $ hg add --large largeX
114 $ cat .hglf/largeX
114 $ cat .hglf/largeX
115
115
116 $ hg commit -m 'will be rollback-ed soon'
116 $ hg commit -m 'will be rollback-ed soon'
117 $ echo largeY > largeY
117 $ echo largeY > largeY
118 $ hg add --large largeY
118 $ hg add --large largeY
119 #if windows
119 #if windows
120 $ hg status -A large1
120 $ hg status -A large1
121 large1: * (glob)
121 large1: * (glob)
122 #else
122 #else
123 $ hg status -A large1
123 $ hg status -A large1
124 large1: No such file or directory
124 large1: No such file or directory
125 #endif
125 #endif
126 $ hg status -A large2
126 $ hg status -A large2
127 ? large2
127 ? large2
128 $ hg status -A largeX
128 $ hg status -A largeX
129 C largeX
129 C largeX
130 $ hg status -A largeY
130 $ hg status -A largeY
131 A largeY
131 A largeY
132 $ hg rollback
132 $ hg rollback
133 repository tip rolled back to revision 3 (undo commit)
133 repository tip rolled back to revision 3 (undo commit)
134 working directory now based on revision 3
134 working directory now based on revision 3
135 $ hg status -A large1
135 $ hg status -A large1
136 R large1
136 R large1
137 $ test -f .hglf/large1
137 $ test -f .hglf/large1
138 [1]
138 [1]
139 $ hg status -A large2
139 $ hg status -A large2
140 R large2
140 R large2
141 $ test -f .hglf/large2
141 $ test -f .hglf/large2
142 [1]
142 [1]
143 $ hg status -A largeX
143 $ hg status -A largeX
144 A largeX
144 A largeX
145 $ cat .hglf/largeX
145 $ cat .hglf/largeX
146
146
147 $ hg status -A largeY
147 $ hg status -A largeY
148 ? largeY
148 ? largeY
149 $ test -f .hglf/largeY
149 $ test -f .hglf/largeY
150 [1]
150 [1]
151
151
152 Test that "hg rollback" restores standins correctly
152 Test that "hg rollback" restores standins correctly
153
153
154 $ hg commit -m 'will be rollback-ed soon'
154 $ hg commit -m 'will be rollback-ed soon'
155 $ hg update -q -C 2
155 $ hg update -q -C 2
156 $ cat large1
156 $ cat large1
157 large1
157 large1
158 $ cat .hglf/large1
158 $ cat .hglf/large1
159 4669e532d5b2c093a78eca010077e708a071bb64
159 4669e532d5b2c093a78eca010077e708a071bb64
160 $ cat large2
160 $ cat large2
161 large2 in #2
161 large2 in #2
162 $ cat .hglf/large2
162 $ cat .hglf/large2
163 3cfce6277e7668985707b6887ce56f9f62f6ccd9
163 3cfce6277e7668985707b6887ce56f9f62f6ccd9
164
164
165 $ hg rollback -q -f
165 $ hg rollback -q -f
166 $ cat large1
166 $ cat large1
167 large1
167 large1
168 $ cat .hglf/large1
168 $ cat .hglf/large1
169 4669e532d5b2c093a78eca010077e708a071bb64
169 4669e532d5b2c093a78eca010077e708a071bb64
170 $ cat large2
170 $ cat large2
171 large2 in #2
171 large2 in #2
172 $ cat .hglf/large2
172 $ cat .hglf/large2
173 3cfce6277e7668985707b6887ce56f9f62f6ccd9
173 3cfce6277e7668985707b6887ce56f9f62f6ccd9
174
174
175 (rollback the parent of the working directory, when the parent of it
175 (rollback the parent of the working directory, when the parent of it
176 is not branch-tip)
176 is not branch-tip)
177
177
178 $ hg update -q -C 1
178 $ hg update -q -C 1
179 $ cat .hglf/large1
179 $ cat .hglf/large1
180 58e24f733a964da346e2407a2bee99d9001184f5
180 58e24f733a964da346e2407a2bee99d9001184f5
181 $ cat .hglf/large2
181 $ cat .hglf/large2
182 1deebade43c8c498a3c8daddac0244dc55d1331d
182 1deebade43c8c498a3c8daddac0244dc55d1331d
183
183
184 $ echo normalX > normalX
184 $ echo normalX > normalX
185 $ hg add normalX
185 $ hg add normalX
186 $ hg commit -m 'will be rollback-ed soon'
186 $ hg commit -m 'will be rollback-ed soon'
187 $ hg rollback -q
187 $ hg rollback -q
188
188
189 $ cat .hglf/large1
189 $ cat .hglf/large1
190 58e24f733a964da346e2407a2bee99d9001184f5
190 58e24f733a964da346e2407a2bee99d9001184f5
191 $ cat .hglf/large2
191 $ cat .hglf/large2
192 1deebade43c8c498a3c8daddac0244dc55d1331d
192 1deebade43c8c498a3c8daddac0244dc55d1331d
193
193
194 Test that "hg status" shows status of largefiles correctly just after
194 Test that "hg status" shows status of largefiles correctly just after
195 automated commit like rebase/transplant
195 automated commit like rebase/transplant
196
196
197 $ cat >> .hg/hgrc <<EOF
197 $ cat >> .hg/hgrc <<EOF
198 > [extensions]
198 > [extensions]
199 > rebase =
199 > rebase =
200 > strip =
200 > strip =
201 > transplant =
201 > transplant =
202 > EOF
202 > EOF
203 $ hg update -q -C 1
203 $ hg update -q -C 1
204 $ hg remove large1
204 $ hg remove large1
205 $ echo largeX > largeX
205 $ echo largeX > largeX
206 $ hg add --large largeX
206 $ hg add --large largeX
207 $ hg commit -m '#4'
207 $ hg commit -m '#4'
208
208
209 $ hg rebase -s 1 -d 2 --keep
209 $ hg rebase -s 1 -d 2 --keep
210 rebasing 1:72518492caa6 "#1"
211 rebasing 4:07d6153b5c04 "#4" (tip)
210 #if windows
212 #if windows
211 $ hg status -A large1
213 $ hg status -A large1
212 large1: * (glob)
214 large1: * (glob)
213 #else
215 #else
214 $ hg status -A large1
216 $ hg status -A large1
215 large1: No such file or directory
217 large1: No such file or directory
216 #endif
218 #endif
217 $ hg status -A largeX
219 $ hg status -A largeX
218 C largeX
220 C largeX
219 $ hg strip -q 5
221 $ hg strip -q 5
220
222
221 $ hg update -q -C 2
223 $ hg update -q -C 2
222 $ hg transplant -q 1 4
224 $ hg transplant -q 1 4
223 #if windows
225 #if windows
224 $ hg status -A large1
226 $ hg status -A large1
225 large1: * (glob)
227 large1: * (glob)
226 #else
228 #else
227 $ hg status -A large1
229 $ hg status -A large1
228 large1: No such file or directory
230 large1: No such file or directory
229 #endif
231 #endif
230 $ hg status -A largeX
232 $ hg status -A largeX
231 C largeX
233 C largeX
232 $ hg strip -q 5
234 $ hg strip -q 5
233
235
234 $ hg update -q -C 2
236 $ hg update -q -C 2
235 $ hg transplant -q --merge 1 --merge 4
237 $ hg transplant -q --merge 1 --merge 4
236 #if windows
238 #if windows
237 $ hg status -A large1
239 $ hg status -A large1
238 large1: * (glob)
240 large1: * (glob)
239 #else
241 #else
240 $ hg status -A large1
242 $ hg status -A large1
241 large1: No such file or directory
243 large1: No such file or directory
242 #endif
244 #endif
243 $ hg status -A largeX
245 $ hg status -A largeX
244 C largeX
246 C largeX
245 $ hg strip -q 5
247 $ hg strip -q 5
246
248
247 Test that linear merge can detect modification (and conflict) correctly
249 Test that linear merge can detect modification (and conflict) correctly
248
250
249 (linear merge without conflict)
251 (linear merge without conflict)
250
252
251 $ echo 'large2 for linear merge (no conflict)' > large2
253 $ echo 'large2 for linear merge (no conflict)' > large2
252 $ hg update 3 --config debug.dirstate.delaywrite=2
254 $ hg update 3 --config debug.dirstate.delaywrite=2
253 getting changed largefiles
255 getting changed largefiles
254 1 largefiles updated, 0 removed
256 1 largefiles updated, 0 removed
255 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 $ hg status -A large2
258 $ hg status -A large2
257 M large2
259 M large2
258 $ cat large2
260 $ cat large2
259 large2 for linear merge (no conflict)
261 large2 for linear merge (no conflict)
260 $ cat .hglf/large2
262 $ cat .hglf/large2
261 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
263 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
262
264
263 (linear merge with conflict, choosing "other")
265 (linear merge with conflict, choosing "other")
264
266
265 $ hg update -q -C 2
267 $ hg update -q -C 2
266 $ echo 'large1 for linear merge (conflict)' > large1
268 $ echo 'large1 for linear merge (conflict)' > large1
267 $ hg update 3 --config ui.interactive=True <<EOF
269 $ hg update 3 --config ui.interactive=True <<EOF
268 > o
270 > o
269 > EOF
271 > EOF
270 largefile large1 has a merge conflict
272 largefile large1 has a merge conflict
271 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
273 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
272 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
274 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
273 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
275 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
274 getting changed largefiles
276 getting changed largefiles
275 1 largefiles updated, 0 removed
277 1 largefiles updated, 0 removed
276 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
278 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
277 $ hg status -A large1
279 $ hg status -A large1
278 C large1
280 C large1
279 $ cat large1
281 $ cat large1
280 large1 in #3
282 large1 in #3
281 $ cat .hglf/large1
283 $ cat .hglf/large1
282 e5bb990443d6a92aaf7223813720f7566c9dd05b
284 e5bb990443d6a92aaf7223813720f7566c9dd05b
283
285
284 (linear merge with conflict, choosing "local")
286 (linear merge with conflict, choosing "local")
285
287
286 $ hg update -q -C 2
288 $ hg update -q -C 2
287 $ echo 'large1 for linear merge (conflict)' > large1
289 $ echo 'large1 for linear merge (conflict)' > large1
288 $ hg update 3 --config debug.dirstate.delaywrite=2
290 $ hg update 3 --config debug.dirstate.delaywrite=2
289 largefile large1 has a merge conflict
291 largefile large1 has a merge conflict
290 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
292 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
291 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
293 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
292 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
294 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
293 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
295 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
294 $ hg status -A large1
296 $ hg status -A large1
295 M large1
297 M large1
296 $ cat large1
298 $ cat large1
297 large1 for linear merge (conflict)
299 large1 for linear merge (conflict)
298 $ cat .hglf/large1
300 $ cat .hglf/large1
299 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
301 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
300
302
301 Test a linear merge to a revision containing same-name normal file
303 Test a linear merge to a revision containing same-name normal file
302
304
303 $ hg update -q -C 3
305 $ hg update -q -C 3
304 $ hg remove large2
306 $ hg remove large2
305 $ echo 'large2 as normal file' > large2
307 $ echo 'large2 as normal file' > large2
306 $ hg add large2
308 $ hg add large2
307 $ echo 'large3 as normal file' > large3
309 $ echo 'large3 as normal file' > large3
308 $ hg add large3
310 $ hg add large3
309 $ hg commit -m '#5'
311 $ hg commit -m '#5'
310 $ hg manifest
312 $ hg manifest
311 .hglf/large1
313 .hglf/large1
312 large2
314 large2
313 large3
315 large3
314 normal1
316 normal1
315
317
316 (modified largefile is already switched to normal)
318 (modified largefile is already switched to normal)
317
319
318 $ hg update -q -C 2
320 $ hg update -q -C 2
319 $ echo 'modified large2 for linear merge' > large2
321 $ echo 'modified large2 for linear merge' > large2
320 $ hg update -q 5
322 $ hg update -q 5
321 local changed .hglf/large2 which remote deleted
323 local changed .hglf/large2 which remote deleted
322 use (c)hanged version or (d)elete? c
324 use (c)hanged version or (d)elete? c
323 remote turned local largefile large2 into a normal file
325 remote turned local largefile large2 into a normal file
324 keep (l)argefile or use (n)ormal file? l
326 keep (l)argefile or use (n)ormal file? l
325 $ hg debugdirstate --nodates | grep large2
327 $ hg debugdirstate --nodates | grep large2
326 a 0 -1 .hglf/large2
328 a 0 -1 .hglf/large2
327 r 0 0 large2
329 r 0 0 large2
328 $ hg status -A large2
330 $ hg status -A large2
329 A large2
331 A large2
330 $ cat large2
332 $ cat large2
331 modified large2 for linear merge
333 modified large2 for linear merge
332
334
333 (added largefile is already committed as normal)
335 (added largefile is already committed as normal)
334
336
335 $ hg update -q -C 2
337 $ hg update -q -C 2
336 $ echo 'large3 as large file for linear merge' > large3
338 $ echo 'large3 as large file for linear merge' > large3
337 $ hg add --large large3
339 $ hg add --large large3
338 $ hg update -q 5
340 $ hg update -q 5
339 remote turned local largefile large3 into a normal file
341 remote turned local largefile large3 into a normal file
340 keep (l)argefile or use (n)ormal file? l
342 keep (l)argefile or use (n)ormal file? l
341 $ hg debugdirstate --nodates | grep large3
343 $ hg debugdirstate --nodates | grep large3
342 a 0 -1 .hglf/large3
344 a 0 -1 .hglf/large3
343 r 0 0 large3
345 r 0 0 large3
344 $ hg status -A large3
346 $ hg status -A large3
345 A large3
347 A large3
346 $ cat large3
348 $ cat large3
347 large3 as large file for linear merge
349 large3 as large file for linear merge
348 $ rm -f large3 .hglf/large3
350 $ rm -f large3 .hglf/large3
349
351
350 Test that the internal linear merging works correctly
352 Test that the internal linear merging works correctly
351 (both heads are stripped to keep pairing of revision number and commit log)
353 (both heads are stripped to keep pairing of revision number and commit log)
352
354
353 $ hg update -q -C 2
355 $ hg update -q -C 2
354 $ hg strip 3 4
356 $ hg strip 3 4
355 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob)
357 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-backup.hg (glob)
356 $ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP
358 $ mv .hg/strip-backup/9530e27857f7-backup.hg $TESTTMP
357
359
358 (internal linear merging at "hg pull --update")
360 (internal linear merging at "hg pull --update")
359
361
360 $ echo 'large1 for linear merge (conflict)' > large1
362 $ echo 'large1 for linear merge (conflict)' > large1
361 $ echo 'large2 for linear merge (conflict with normal file)' > large2
363 $ echo 'large2 for linear merge (conflict with normal file)' > large2
362 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
364 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
363 pulling from $TESTTMP/9530e27857f7-backup.hg (glob)
365 pulling from $TESTTMP/9530e27857f7-backup.hg (glob)
364 searching for changes
366 searching for changes
365 adding changesets
367 adding changesets
366 adding manifests
368 adding manifests
367 adding file changes
369 adding file changes
368 added 3 changesets with 5 changes to 5 files
370 added 3 changesets with 5 changes to 5 files
369 local changed .hglf/large2 which remote deleted
371 local changed .hglf/large2 which remote deleted
370 use (c)hanged version or (d)elete? c
372 use (c)hanged version or (d)elete? c
371 remote turned local largefile large2 into a normal file
373 remote turned local largefile large2 into a normal file
372 keep (l)argefile or use (n)ormal file? l
374 keep (l)argefile or use (n)ormal file? l
373 largefile large1 has a merge conflict
375 largefile large1 has a merge conflict
374 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
376 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
375 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
377 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
376 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
378 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
377 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
379 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
378
380
379 $ hg status -A large1
381 $ hg status -A large1
380 M large1
382 M large1
381 $ cat large1
383 $ cat large1
382 large1 for linear merge (conflict)
384 large1 for linear merge (conflict)
383 $ cat .hglf/large1
385 $ cat .hglf/large1
384 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
386 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
385 $ hg status -A large2
387 $ hg status -A large2
386 A large2
388 A large2
387 $ cat large2
389 $ cat large2
388 large2 for linear merge (conflict with normal file)
390 large2 for linear merge (conflict with normal file)
389 $ cat .hglf/large2
391 $ cat .hglf/large2
390 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
392 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
391
393
392 (internal linear merging at "hg unbundle --update")
394 (internal linear merging at "hg unbundle --update")
393
395
394 $ hg update -q -C 2
396 $ hg update -q -C 2
395 $ hg rollback -q
397 $ hg rollback -q
396
398
397 $ echo 'large1 for linear merge (conflict)' > large1
399 $ echo 'large1 for linear merge (conflict)' > large1
398 $ echo 'large2 for linear merge (conflict with normal file)' > large2
400 $ echo 'large2 for linear merge (conflict with normal file)' > large2
399 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
401 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-backup.hg
400 adding changesets
402 adding changesets
401 adding manifests
403 adding manifests
402 adding file changes
404 adding file changes
403 added 3 changesets with 5 changes to 5 files
405 added 3 changesets with 5 changes to 5 files
404 local changed .hglf/large2 which remote deleted
406 local changed .hglf/large2 which remote deleted
405 use (c)hanged version or (d)elete? c
407 use (c)hanged version or (d)elete? c
406 remote turned local largefile large2 into a normal file
408 remote turned local largefile large2 into a normal file
407 keep (l)argefile or use (n)ormal file? l
409 keep (l)argefile or use (n)ormal file? l
408 largefile large1 has a merge conflict
410 largefile large1 has a merge conflict
409 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
411 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
410 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
412 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
411 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
413 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
412 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
414 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
413
415
414 $ hg status -A large1
416 $ hg status -A large1
415 M large1
417 M large1
416 $ cat large1
418 $ cat large1
417 large1 for linear merge (conflict)
419 large1 for linear merge (conflict)
418 $ cat .hglf/large1
420 $ cat .hglf/large1
419 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
421 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
420 $ hg status -A large2
422 $ hg status -A large2
421 A large2
423 A large2
422 $ cat large2
424 $ cat large2
423 large2 for linear merge (conflict with normal file)
425 large2 for linear merge (conflict with normal file)
424 $ cat .hglf/large2
426 $ cat .hglf/large2
425 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
427 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
426
428
427 (internal linear merging in subrepo at "hg update")
429 (internal linear merging in subrepo at "hg update")
428
430
429 $ cd ..
431 $ cd ..
430 $ hg init subparent
432 $ hg init subparent
431 $ cd subparent
433 $ cd subparent
432
434
433 $ hg clone -q -u 2 ../repo sub
435 $ hg clone -q -u 2 ../repo sub
434 $ cat > .hgsub <<EOF
436 $ cat > .hgsub <<EOF
435 > sub = sub
437 > sub = sub
436 > EOF
438 > EOF
437 $ hg add .hgsub
439 $ hg add .hgsub
438 $ hg commit -m '#0@parent'
440 $ hg commit -m '#0@parent'
439 $ cat .hgsubstate
441 $ cat .hgsubstate
440 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
442 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
441 $ hg -R sub update -q
443 $ hg -R sub update -q
442 $ hg commit -m '#1@parent'
444 $ hg commit -m '#1@parent'
443 $ cat .hgsubstate
445 $ cat .hgsubstate
444 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
446 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
445 $ hg update -q 0
447 $ hg update -q 0
446
448
447 $ echo 'large1 for linear merge (conflict)' > sub/large1
449 $ echo 'large1 for linear merge (conflict)' > sub/large1
448 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
450 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
449 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
451 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
450 > m
452 > m
451 > r
453 > r
452 > c
454 > c
453 > l
455 > l
454 > l
456 > l
455 > EOF
457 > EOF
456 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
458 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
457 (M)erge, keep (l)ocal or keep (r)emote? m
459 (M)erge, keep (l)ocal or keep (r)emote? m
458 subrepository sources for sub differ (in checked out version)
460 subrepository sources for sub differ (in checked out version)
459 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
461 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
460 local changed .hglf/large2 which remote deleted
462 local changed .hglf/large2 which remote deleted
461 use (c)hanged version or (d)elete? c
463 use (c)hanged version or (d)elete? c
462 remote turned local largefile large2 into a normal file
464 remote turned local largefile large2 into a normal file
463 keep (l)argefile or use (n)ormal file? l
465 keep (l)argefile or use (n)ormal file? l
464 largefile large1 has a merge conflict
466 largefile large1 has a merge conflict
465 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
467 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
466 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
468 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
467 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
469 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
468 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
470 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
469 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
471 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
470
472
471 $ hg -R sub status -A sub/large1
473 $ hg -R sub status -A sub/large1
472 M sub/large1
474 M sub/large1
473 $ cat sub/large1
475 $ cat sub/large1
474 large1 for linear merge (conflict)
476 large1 for linear merge (conflict)
475 $ cat sub/.hglf/large1
477 $ cat sub/.hglf/large1
476 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
478 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
477 $ hg -R sub status -A sub/large2
479 $ hg -R sub status -A sub/large2
478 A sub/large2
480 A sub/large2
479 $ cat sub/large2
481 $ cat sub/large2
480 large2 for linear merge (conflict with normal file)
482 large2 for linear merge (conflict with normal file)
481 $ cat sub/.hglf/large2
483 $ cat sub/.hglf/large2
482 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
484 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
483
485
484 $ cd ..
486 $ cd ..
485 $ cd repo
487 $ cd repo
486
488
487 Test that rebase updates largefiles in the working directory even if
489 Test that rebase updates largefiles in the working directory even if
488 it is aborted by conflict.
490 it is aborted by conflict.
489
491
490 $ hg update -q -C 3
492 $ hg update -q -C 3
491 $ cat .hglf/large1
493 $ cat .hglf/large1
492 e5bb990443d6a92aaf7223813720f7566c9dd05b
494 e5bb990443d6a92aaf7223813720f7566c9dd05b
493 $ cat large1
495 $ cat large1
494 large1 in #3
496 large1 in #3
495 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
497 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
496 > o
498 > o
497 > EOF
499 > EOF
500 rebasing 1:72518492caa6 "#1"
498 largefile large1 has a merge conflict
501 largefile large1 has a merge conflict
499 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
502 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
500 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
503 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
501 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
504 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
502 merging normal1
505 merging normal1
503 warning: conflicts during merge.
506 warning: conflicts during merge.
504 merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
507 merging normal1 incomplete! (edit conflicts, then use 'hg resolve --mark')
505 unresolved conflicts (see hg resolve, then hg rebase --continue)
508 unresolved conflicts (see hg resolve, then hg rebase --continue)
506 [1]
509 [1]
507 $ cat .hglf/large1
510 $ cat .hglf/large1
508 58e24f733a964da346e2407a2bee99d9001184f5
511 58e24f733a964da346e2407a2bee99d9001184f5
509 $ cat large1
512 $ cat large1
510 large1 in #1
513 large1 in #1
511
514
512 Test that rebase updates standins for manually modified largefiles at
515 Test that rebase updates standins for manually modified largefiles at
513 the 1st commit of resuming.
516 the 1st commit of resuming.
514
517
515 $ echo "manually modified before 'hg rebase --continue'" > large1
518 $ echo "manually modified before 'hg rebase --continue'" > large1
516 $ hg resolve -m normal1
519 $ hg resolve -m normal1
517 (no more unresolved files)
520 (no more unresolved files)
518 $ hg rebase --continue --config ui.interactive=True <<EOF
521 $ hg rebase --continue --config ui.interactive=True <<EOF
519 > c
522 > c
520 > EOF
523 > EOF
524 rebasing 1:72518492caa6 "#1"
525 rebasing 4:07d6153b5c04 "#4"
521 local changed .hglf/large1 which remote deleted
526 local changed .hglf/large1 which remote deleted
522 use (c)hanged version or (d)elete? c
527 use (c)hanged version or (d)elete? c
523
528
524 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
529 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
525 -e5bb990443d6a92aaf7223813720f7566c9dd05b
530 -e5bb990443d6a92aaf7223813720f7566c9dd05b
526 +8a4f783556e7dea21139ca0466eafce954c75c13
531 +8a4f783556e7dea21139ca0466eafce954c75c13
527 $ rm -f large1
532 $ rm -f large1
528 $ hg update -q -C tip
533 $ hg update -q -C tip
529 $ cat large1
534 $ cat large1
530 manually modified before 'hg rebase --continue'
535 manually modified before 'hg rebase --continue'
531
536
532 Test that transplant updates largefiles, of which standins are safely
537 Test that transplant updates largefiles, of which standins are safely
533 changed, even if it is aborted by conflict of other.
538 changed, even if it is aborted by conflict of other.
534
539
535 $ hg update -q -C 5
540 $ hg update -q -C 5
536 $ cat .hglf/large1
541 $ cat .hglf/large1
537 e5bb990443d6a92aaf7223813720f7566c9dd05b
542 e5bb990443d6a92aaf7223813720f7566c9dd05b
538 $ cat large1
543 $ cat large1
539 large1 in #3
544 large1 in #3
540 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
545 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
541 +fa44618ea25181aff4f48b70428294790cec9f61
546 +fa44618ea25181aff4f48b70428294790cec9f61
542 $ hg transplant 4
547 $ hg transplant 4
543 applying 07d6153b5c04
548 applying 07d6153b5c04
544 patching file .hglf/large1
549 patching file .hglf/large1
545 Hunk #1 FAILED at 0
550 Hunk #1 FAILED at 0
546 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
551 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
547 patch failed to apply
552 patch failed to apply
548 abort: fix up the merge and run hg transplant --continue
553 abort: fix up the merge and run hg transplant --continue
549 [255]
554 [255]
550 $ hg status -A large1
555 $ hg status -A large1
551 C large1
556 C large1
552 $ cat .hglf/large1
557 $ cat .hglf/large1
553 e5bb990443d6a92aaf7223813720f7566c9dd05b
558 e5bb990443d6a92aaf7223813720f7566c9dd05b
554 $ cat large1
559 $ cat large1
555 large1 in #3
560 large1 in #3
556 $ hg status -A largeX
561 $ hg status -A largeX
557 A largeX
562 A largeX
558 $ cat .hglf/largeX
563 $ cat .hglf/largeX
559 fa44618ea25181aff4f48b70428294790cec9f61
564 fa44618ea25181aff4f48b70428294790cec9f61
560 $ cat largeX
565 $ cat largeX
561 largeX
566 largeX
562
567
563 Test that transplant updates standins for manually modified largefiles
568 Test that transplant updates standins for manually modified largefiles
564 at the 1st commit of resuming.
569 at the 1st commit of resuming.
565
570
566 $ echo "manually modified before 'hg transplant --continue'" > large1
571 $ echo "manually modified before 'hg transplant --continue'" > large1
567 $ hg transplant --continue
572 $ hg transplant --continue
568 07d6153b5c04 transplanted as f1bf30eb88cc
573 07d6153b5c04 transplanted as f1bf30eb88cc
569 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
574 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
570 -e5bb990443d6a92aaf7223813720f7566c9dd05b
575 -e5bb990443d6a92aaf7223813720f7566c9dd05b
571 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
576 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
572 $ rm -f large1
577 $ rm -f large1
573 $ hg update -q -C tip
578 $ hg update -q -C tip
574 $ cat large1
579 $ cat large1
575 manually modified before 'hg transplant --continue'
580 manually modified before 'hg transplant --continue'
576
581
577 Test that "hg status" doesn't show removal of largefiles not managed
582 Test that "hg status" doesn't show removal of largefiles not managed
578 in the target context.
583 in the target context.
579
584
580 $ hg update -q -C 4
585 $ hg update -q -C 4
581 $ hg remove largeX
586 $ hg remove largeX
582 $ hg status -A largeX
587 $ hg status -A largeX
583 R largeX
588 R largeX
584 $ hg status -A --rev '.^1' largeX
589 $ hg status -A --rev '.^1' largeX
585
590
586 #if execbit
591 #if execbit
587
592
588 Test that "hg status" against revisions other than parent notices exec
593 Test that "hg status" against revisions other than parent notices exec
589 bit changes of largefiles.
594 bit changes of largefiles.
590
595
591 $ hg update -q -C 4
596 $ hg update -q -C 4
592
597
593 (the case that large2 doesn't have exec bit in the target context but
598 (the case that large2 doesn't have exec bit in the target context but
594 in the working context)
599 in the working context)
595
600
596 $ chmod +x large2
601 $ chmod +x large2
597 $ hg status -A --rev 0 large2
602 $ hg status -A --rev 0 large2
598 M large2
603 M large2
599 $ hg commit -m 'chmod +x large2'
604 $ hg commit -m 'chmod +x large2'
600
605
601 (the case that large2 has exec bit in the target context but not in
606 (the case that large2 has exec bit in the target context but not in
602 the working context)
607 the working context)
603
608
604 $ echo dummy > dummy
609 $ echo dummy > dummy
605 $ hg add dummy
610 $ hg add dummy
606 $ hg commit -m 'revision for separation'
611 $ hg commit -m 'revision for separation'
607 $ chmod -x large2
612 $ chmod -x large2
608 $ hg status -A --rev '.^1' large2
613 $ hg status -A --rev '.^1' large2
609 M large2
614 M large2
610
615
611 #else
616 #else
612
617
613 Test that "hg status" against revisions other than parent ignores exec
618 Test that "hg status" against revisions other than parent ignores exec
614 bit correctly on the platform being unaware of it.
619 bit correctly on the platform being unaware of it.
615
620
616 $ hg update -q -C 4
621 $ hg update -q -C 4
617
622
618 $ cat > exec-bit.patch <<EOF
623 $ cat > exec-bit.patch <<EOF
619 > # HG changeset patch
624 > # HG changeset patch
620 > # User test
625 > # User test
621 > # Date 0 0
626 > # Date 0 0
622 > # Thu Jan 01 00:00:00 1970 +0000
627 > # Thu Jan 01 00:00:00 1970 +0000
623 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
628 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
624 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
629 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
625 > chmod +x large2
630 > chmod +x large2
626 >
631 >
627 > diff --git a/.hglf/large2 b/.hglf/large2
632 > diff --git a/.hglf/large2 b/.hglf/large2
628 > old mode 100644
633 > old mode 100644
629 > new mode 100755
634 > new mode 100755
630 > EOF
635 > EOF
631 $ hg import --exact --bypass exec-bit.patch
636 $ hg import --exact --bypass exec-bit.patch
632 applying exec-bit.patch
637 applying exec-bit.patch
633 $ hg status -A --rev tip large2
638 $ hg status -A --rev tip large2
634 C large2
639 C large2
635
640
636 #endif
641 #endif
637
642
638 $ cd ..
643 $ cd ..
639
644
640 Test that "hg convert" avoids copying largefiles from the working
645 Test that "hg convert" avoids copying largefiles from the working
641 directory into store, because "hg convert" doesn't update largefiles
646 directory into store, because "hg convert" doesn't update largefiles
642 in the working directory (removing files under ".cache/largefiles"
647 in the working directory (removing files under ".cache/largefiles"
643 forces "hg convert" to copy corresponding largefiles)
648 forces "hg convert" to copy corresponding largefiles)
644
649
645 $ cat >> $HGRCPATH <<EOF
650 $ cat >> $HGRCPATH <<EOF
646 > [extensions]
651 > [extensions]
647 > convert =
652 > convert =
648 > EOF
653 > EOF
649
654
650 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
655 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
651 $ hg convert -q repo repo.converted
656 $ hg convert -q repo repo.converted
@@ -1,1821 +1,1823 b''
1 This file used to contains all largefile tests.
1 This file used to contains all largefile tests.
2 Do not add any new tests in this file as it his already far too long to run.
2 Do not add any new tests in this file as it his already far too long to run.
3
3
4 It contains all the testing of the basic concepts of large file in a single block.
4 It contains all the testing of the basic concepts of large file in a single block.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24 Create the repo with a couple of revisions of both large and normal
24 Create the repo with a couple of revisions of both large and normal
25 files.
25 files.
26 Test status and dirstate of largefiles and that summary output is correct.
26 Test status and dirstate of largefiles and that summary output is correct.
27
27
28 $ hg init a
28 $ hg init a
29 $ cd a
29 $ cd a
30 $ mkdir sub
30 $ mkdir sub
31 $ echo normal1 > normal1
31 $ echo normal1 > normal1
32 $ echo normal2 > sub/normal2
32 $ echo normal2 > sub/normal2
33 $ echo large1 > large1
33 $ echo large1 > large1
34 $ echo large2 > sub/large2
34 $ echo large2 > sub/large2
35 $ hg add normal1 sub/normal2
35 $ hg add normal1 sub/normal2
36 $ hg add --large large1 sub/large2
36 $ hg add --large large1 sub/large2
37 $ hg commit -m "add files"
37 $ hg commit -m "add files"
38 Invoking status precommit hook
38 Invoking status precommit hook
39 A large1
39 A large1
40 A normal1
40 A normal1
41 A sub/large2
41 A sub/large2
42 A sub/normal2
42 A sub/normal2
43 $ touch large1 sub/large2
43 $ touch large1 sub/large2
44 $ sleep 1
44 $ sleep 1
45 $ hg st
45 $ hg st
46 $ hg debugstate --nodates
46 $ hg debugstate --nodates
47 n 644 41 .hglf/large1
47 n 644 41 .hglf/large1
48 n 644 41 .hglf/sub/large2
48 n 644 41 .hglf/sub/large2
49 n 644 8 normal1
49 n 644 8 normal1
50 n 644 8 sub/normal2
50 n 644 8 sub/normal2
51 $ hg debugstate --large --nodates
51 $ hg debugstate --large --nodates
52 n 644 7 large1
52 n 644 7 large1
53 n 644 7 sub/large2
53 n 644 7 sub/large2
54 $ echo normal11 > normal1
54 $ echo normal11 > normal1
55 $ echo normal22 > sub/normal2
55 $ echo normal22 > sub/normal2
56 $ echo large11 > large1
56 $ echo large11 > large1
57 $ echo large22 > sub/large2
57 $ echo large22 > sub/large2
58 $ hg commit -m "edit files"
58 $ hg commit -m "edit files"
59 Invoking status precommit hook
59 Invoking status precommit hook
60 M large1
60 M large1
61 M normal1
61 M normal1
62 M sub/large2
62 M sub/large2
63 M sub/normal2
63 M sub/normal2
64 $ hg sum --large
64 $ hg sum --large
65 parent: 1:ce8896473775 tip
65 parent: 1:ce8896473775 tip
66 edit files
66 edit files
67 branch: default
67 branch: default
68 commit: (clean)
68 commit: (clean)
69 update: (current)
69 update: (current)
70 largefiles: (no remote repo)
70 largefiles: (no remote repo)
71
71
72 Commit preserved largefile contents.
72 Commit preserved largefile contents.
73
73
74 $ cat normal1
74 $ cat normal1
75 normal11
75 normal11
76 $ cat large1
76 $ cat large1
77 large11
77 large11
78 $ cat sub/normal2
78 $ cat sub/normal2
79 normal22
79 normal22
80 $ cat sub/large2
80 $ cat sub/large2
81 large22
81 large22
82
82
83 Test status, subdir and unknown files
83 Test status, subdir and unknown files
84
84
85 $ echo unknown > sub/unknown
85 $ echo unknown > sub/unknown
86 $ hg st --all
86 $ hg st --all
87 ? sub/unknown
87 ? sub/unknown
88 C large1
88 C large1
89 C normal1
89 C normal1
90 C sub/large2
90 C sub/large2
91 C sub/normal2
91 C sub/normal2
92 $ hg st --all sub
92 $ hg st --all sub
93 ? sub/unknown
93 ? sub/unknown
94 C sub/large2
94 C sub/large2
95 C sub/normal2
95 C sub/normal2
96 $ rm sub/unknown
96 $ rm sub/unknown
97
97
98 Test messages and exit codes for remove warning cases
98 Test messages and exit codes for remove warning cases
99
99
100 $ hg remove -A large1
100 $ hg remove -A large1
101 not removing large1: file still exists
101 not removing large1: file still exists
102 [1]
102 [1]
103 $ echo 'modified' > large1
103 $ echo 'modified' > large1
104 $ hg remove large1
104 $ hg remove large1
105 not removing large1: file is modified (use -f to force removal)
105 not removing large1: file is modified (use -f to force removal)
106 [1]
106 [1]
107 $ echo 'new' > normalnew
107 $ echo 'new' > normalnew
108 $ hg add normalnew
108 $ hg add normalnew
109 $ echo 'new' > largenew
109 $ echo 'new' > largenew
110 $ hg add --large normalnew
110 $ hg add --large normalnew
111 normalnew already tracked!
111 normalnew already tracked!
112 $ hg remove normalnew largenew
112 $ hg remove normalnew largenew
113 not removing largenew: file is untracked
113 not removing largenew: file is untracked
114 not removing normalnew: file has been marked for add (use forget to undo)
114 not removing normalnew: file has been marked for add (use forget to undo)
115 [1]
115 [1]
116 $ rm normalnew largenew
116 $ rm normalnew largenew
117 $ hg up -Cq
117 $ hg up -Cq
118
118
119 Remove both largefiles and normal files.
119 Remove both largefiles and normal files.
120
120
121 $ hg remove normal1 large1
121 $ hg remove normal1 large1
122 $ hg status large1
122 $ hg status large1
123 R large1
123 R large1
124 $ hg commit -m "remove files"
124 $ hg commit -m "remove files"
125 Invoking status precommit hook
125 Invoking status precommit hook
126 R large1
126 R large1
127 R normal1
127 R normal1
128 $ ls
128 $ ls
129 sub
129 sub
130 $ echo "testlargefile" > large1-test
130 $ echo "testlargefile" > large1-test
131 $ hg add --large large1-test
131 $ hg add --large large1-test
132 $ hg st
132 $ hg st
133 A large1-test
133 A large1-test
134 $ hg rm large1-test
134 $ hg rm large1-test
135 not removing large1-test: file has been marked for add (use forget to undo)
135 not removing large1-test: file has been marked for add (use forget to undo)
136 [1]
136 [1]
137 $ hg st
137 $ hg st
138 A large1-test
138 A large1-test
139 $ hg forget large1-test
139 $ hg forget large1-test
140 $ hg st
140 $ hg st
141 ? large1-test
141 ? large1-test
142 $ hg remove large1-test
142 $ hg remove large1-test
143 not removing large1-test: file is untracked
143 not removing large1-test: file is untracked
144 [1]
144 [1]
145 $ hg forget large1-test
145 $ hg forget large1-test
146 not removing large1-test: file is already untracked
146 not removing large1-test: file is already untracked
147 [1]
147 [1]
148 $ rm large1-test
148 $ rm large1-test
149
149
150 Copy both largefiles and normal files (testing that status output is correct).
150 Copy both largefiles and normal files (testing that status output is correct).
151
151
152 $ hg cp sub/normal2 normal1
152 $ hg cp sub/normal2 normal1
153 $ hg cp sub/large2 large1
153 $ hg cp sub/large2 large1
154 $ hg commit -m "copy files"
154 $ hg commit -m "copy files"
155 Invoking status precommit hook
155 Invoking status precommit hook
156 A large1
156 A large1
157 A normal1
157 A normal1
158 $ cat normal1
158 $ cat normal1
159 normal22
159 normal22
160 $ cat large1
160 $ cat large1
161 large22
161 large22
162
162
163 Test moving largefiles and verify that normal files are also unaffected.
163 Test moving largefiles and verify that normal files are also unaffected.
164
164
165 $ hg mv normal1 normal3
165 $ hg mv normal1 normal3
166 $ hg mv large1 large3
166 $ hg mv large1 large3
167 $ hg mv sub/normal2 sub/normal4
167 $ hg mv sub/normal2 sub/normal4
168 $ hg mv sub/large2 sub/large4
168 $ hg mv sub/large2 sub/large4
169 $ hg commit -m "move files"
169 $ hg commit -m "move files"
170 Invoking status precommit hook
170 Invoking status precommit hook
171 A large3
171 A large3
172 A normal3
172 A normal3
173 A sub/large4
173 A sub/large4
174 A sub/normal4
174 A sub/normal4
175 R large1
175 R large1
176 R normal1
176 R normal1
177 R sub/large2
177 R sub/large2
178 R sub/normal2
178 R sub/normal2
179 $ cat normal3
179 $ cat normal3
180 normal22
180 normal22
181 $ cat large3
181 $ cat large3
182 large22
182 large22
183 $ cat sub/normal4
183 $ cat sub/normal4
184 normal22
184 normal22
185 $ cat sub/large4
185 $ cat sub/large4
186 large22
186 large22
187
187
188
188
189 #if serve
189 #if serve
190 Test display of largefiles in hgweb
190 Test display of largefiles in hgweb
191
191
192 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
192 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
193 $ cat ../hg.pid >> $DAEMON_PIDS
193 $ cat ../hg.pid >> $DAEMON_PIDS
194 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
194 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
195 200 Script output follows
195 200 Script output follows
196
196
197
197
198 drwxr-xr-x sub
198 drwxr-xr-x sub
199 -rw-r--r-- 41 large3
199 -rw-r--r-- 41 large3
200 -rw-r--r-- 9 normal3
200 -rw-r--r-- 9 normal3
201
201
202
202
203 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
203 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
204 200 Script output follows
204 200 Script output follows
205
205
206
206
207 -rw-r--r-- 41 large4
207 -rw-r--r-- 41 large4
208 -rw-r--r-- 9 normal4
208 -rw-r--r-- 9 normal4
209
209
210
210
211 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
211 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
212 #endif
212 #endif
213
213
214 Test archiving the various revisions. These hit corner cases known with
214 Test archiving the various revisions. These hit corner cases known with
215 archiving.
215 archiving.
216
216
217 $ hg archive -r 0 ../archive0
217 $ hg archive -r 0 ../archive0
218 $ hg archive -r 1 ../archive1
218 $ hg archive -r 1 ../archive1
219 $ hg archive -r 2 ../archive2
219 $ hg archive -r 2 ../archive2
220 $ hg archive -r 3 ../archive3
220 $ hg archive -r 3 ../archive3
221 $ hg archive -r 4 ../archive4
221 $ hg archive -r 4 ../archive4
222 $ cd ../archive0
222 $ cd ../archive0
223 $ cat normal1
223 $ cat normal1
224 normal1
224 normal1
225 $ cat large1
225 $ cat large1
226 large1
226 large1
227 $ cat sub/normal2
227 $ cat sub/normal2
228 normal2
228 normal2
229 $ cat sub/large2
229 $ cat sub/large2
230 large2
230 large2
231 $ cd ../archive1
231 $ cd ../archive1
232 $ cat normal1
232 $ cat normal1
233 normal11
233 normal11
234 $ cat large1
234 $ cat large1
235 large11
235 large11
236 $ cat sub/normal2
236 $ cat sub/normal2
237 normal22
237 normal22
238 $ cat sub/large2
238 $ cat sub/large2
239 large22
239 large22
240 $ cd ../archive2
240 $ cd ../archive2
241 $ ls
241 $ ls
242 sub
242 sub
243 $ cat sub/normal2
243 $ cat sub/normal2
244 normal22
244 normal22
245 $ cat sub/large2
245 $ cat sub/large2
246 large22
246 large22
247 $ cd ../archive3
247 $ cd ../archive3
248 $ cat normal1
248 $ cat normal1
249 normal22
249 normal22
250 $ cat large1
250 $ cat large1
251 large22
251 large22
252 $ cat sub/normal2
252 $ cat sub/normal2
253 normal22
253 normal22
254 $ cat sub/large2
254 $ cat sub/large2
255 large22
255 large22
256 $ cd ../archive4
256 $ cd ../archive4
257 $ cat normal3
257 $ cat normal3
258 normal22
258 normal22
259 $ cat large3
259 $ cat large3
260 large22
260 large22
261 $ cat sub/normal4
261 $ cat sub/normal4
262 normal22
262 normal22
263 $ cat sub/large4
263 $ cat sub/large4
264 large22
264 large22
265
265
266 Commit corner case: specify files to commit.
266 Commit corner case: specify files to commit.
267
267
268 $ cd ../a
268 $ cd ../a
269 $ echo normal3 > normal3
269 $ echo normal3 > normal3
270 $ echo large3 > large3
270 $ echo large3 > large3
271 $ echo normal4 > sub/normal4
271 $ echo normal4 > sub/normal4
272 $ echo large4 > sub/large4
272 $ echo large4 > sub/large4
273 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
273 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
274 Invoking status precommit hook
274 Invoking status precommit hook
275 M large3
275 M large3
276 M normal3
276 M normal3
277 M sub/large4
277 M sub/large4
278 M sub/normal4
278 M sub/normal4
279 $ cat normal3
279 $ cat normal3
280 normal3
280 normal3
281 $ cat large3
281 $ cat large3
282 large3
282 large3
283 $ cat sub/normal4
283 $ cat sub/normal4
284 normal4
284 normal4
285 $ cat sub/large4
285 $ cat sub/large4
286 large4
286 large4
287
287
288 One more commit corner case: commit from a subdirectory.
288 One more commit corner case: commit from a subdirectory.
289
289
290 $ cd ../a
290 $ cd ../a
291 $ echo normal33 > normal3
291 $ echo normal33 > normal3
292 $ echo large33 > large3
292 $ echo large33 > large3
293 $ echo normal44 > sub/normal4
293 $ echo normal44 > sub/normal4
294 $ echo large44 > sub/large4
294 $ echo large44 > sub/large4
295 $ cd sub
295 $ cd sub
296 $ hg commit -m "edit files yet again"
296 $ hg commit -m "edit files yet again"
297 Invoking status precommit hook
297 Invoking status precommit hook
298 M large3
298 M large3
299 M normal3
299 M normal3
300 M sub/large4
300 M sub/large4
301 M sub/normal4
301 M sub/normal4
302 $ cat ../normal3
302 $ cat ../normal3
303 normal33
303 normal33
304 $ cat ../large3
304 $ cat ../large3
305 large33
305 large33
306 $ cat normal4
306 $ cat normal4
307 normal44
307 normal44
308 $ cat large4
308 $ cat large4
309 large44
309 large44
310
310
311 Committing standins is not allowed.
311 Committing standins is not allowed.
312
312
313 $ cd ..
313 $ cd ..
314 $ echo large3 > large3
314 $ echo large3 > large3
315 $ hg commit .hglf/large3 -m "try to commit standin"
315 $ hg commit .hglf/large3 -m "try to commit standin"
316 abort: file ".hglf/large3" is a largefile standin
316 abort: file ".hglf/large3" is a largefile standin
317 (commit the largefile itself instead)
317 (commit the largefile itself instead)
318 [255]
318 [255]
319
319
320 Corner cases for adding largefiles.
320 Corner cases for adding largefiles.
321
321
322 $ echo large5 > large5
322 $ echo large5 > large5
323 $ hg add --large large5
323 $ hg add --large large5
324 $ hg add --large large5
324 $ hg add --large large5
325 large5 already a largefile
325 large5 already a largefile
326 $ mkdir sub2
326 $ mkdir sub2
327 $ echo large6 > sub2/large6
327 $ echo large6 > sub2/large6
328 $ echo large7 > sub2/large7
328 $ echo large7 > sub2/large7
329 $ hg add --large sub2
329 $ hg add --large sub2
330 adding sub2/large6 as a largefile (glob)
330 adding sub2/large6 as a largefile (glob)
331 adding sub2/large7 as a largefile (glob)
331 adding sub2/large7 as a largefile (glob)
332 $ hg st
332 $ hg st
333 M large3
333 M large3
334 A large5
334 A large5
335 A sub2/large6
335 A sub2/large6
336 A sub2/large7
336 A sub2/large7
337
337
338 Committing directories containing only largefiles.
338 Committing directories containing only largefiles.
339
339
340 $ mkdir -p z/y/x/m
340 $ mkdir -p z/y/x/m
341 $ touch z/y/x/m/large1
341 $ touch z/y/x/m/large1
342 $ touch z/y/x/large2
342 $ touch z/y/x/large2
343 $ hg add --large z/y/x/m/large1 z/y/x/large2
343 $ hg add --large z/y/x/m/large1 z/y/x/large2
344 $ hg commit -m "Subdir with directory only containing largefiles" z
344 $ hg commit -m "Subdir with directory only containing largefiles" z
345 Invoking status precommit hook
345 Invoking status precommit hook
346 M large3
346 M large3
347 A large5
347 A large5
348 A sub2/large6
348 A sub2/large6
349 A sub2/large7
349 A sub2/large7
350 A z/y/x/large2
350 A z/y/x/large2
351 A z/y/x/m/large1
351 A z/y/x/m/large1
352
352
353 (and a bit of log testing)
353 (and a bit of log testing)
354
354
355 $ hg log -T '{rev}\n' z/y/x/m/large1
355 $ hg log -T '{rev}\n' z/y/x/m/large1
356 7
356 7
357 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
357 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
358 7
358 7
359
359
360 $ hg rollback --quiet
360 $ hg rollback --quiet
361 $ touch z/y/x/m/normal
361 $ touch z/y/x/m/normal
362 $ hg add z/y/x/m/normal
362 $ hg add z/y/x/m/normal
363 $ hg commit -m "Subdir with mixed contents" z
363 $ hg commit -m "Subdir with mixed contents" z
364 Invoking status precommit hook
364 Invoking status precommit hook
365 M large3
365 M large3
366 A large5
366 A large5
367 A sub2/large6
367 A sub2/large6
368 A sub2/large7
368 A sub2/large7
369 A z/y/x/large2
369 A z/y/x/large2
370 A z/y/x/m/large1
370 A z/y/x/m/large1
371 A z/y/x/m/normal
371 A z/y/x/m/normal
372 $ hg st
372 $ hg st
373 M large3
373 M large3
374 A large5
374 A large5
375 A sub2/large6
375 A sub2/large6
376 A sub2/large7
376 A sub2/large7
377 $ hg rollback --quiet
377 $ hg rollback --quiet
378 $ hg revert z/y/x/large2 z/y/x/m/large1
378 $ hg revert z/y/x/large2 z/y/x/m/large1
379 $ rm z/y/x/large2 z/y/x/m/large1
379 $ rm z/y/x/large2 z/y/x/m/large1
380 $ hg commit -m "Subdir with normal contents" z
380 $ hg commit -m "Subdir with normal contents" z
381 Invoking status precommit hook
381 Invoking status precommit hook
382 M large3
382 M large3
383 A large5
383 A large5
384 A sub2/large6
384 A sub2/large6
385 A sub2/large7
385 A sub2/large7
386 A z/y/x/m/normal
386 A z/y/x/m/normal
387 $ hg st
387 $ hg st
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 $ hg rollback --quiet
392 $ hg rollback --quiet
393 $ hg revert --quiet z
393 $ hg revert --quiet z
394 $ hg commit -m "Empty subdir" z
394 $ hg commit -m "Empty subdir" z
395 abort: z: no match under directory!
395 abort: z: no match under directory!
396 [255]
396 [255]
397 $ rm -rf z
397 $ rm -rf z
398 $ hg ci -m "standin" .hglf
398 $ hg ci -m "standin" .hglf
399 abort: file ".hglf" is a largefile standin
399 abort: file ".hglf" is a largefile standin
400 (commit the largefile itself instead)
400 (commit the largefile itself instead)
401 [255]
401 [255]
402
402
403 Test "hg status" with combination of 'file pattern' and 'directory
403 Test "hg status" with combination of 'file pattern' and 'directory
404 pattern' for largefiles:
404 pattern' for largefiles:
405
405
406 $ hg status sub2/large6 sub2
406 $ hg status sub2/large6 sub2
407 A sub2/large6
407 A sub2/large6
408 A sub2/large7
408 A sub2/large7
409
409
410 Config settings (pattern **.dat, minsize 2 MB) are respected.
410 Config settings (pattern **.dat, minsize 2 MB) are respected.
411
411
412 $ echo testdata > test.dat
412 $ echo testdata > test.dat
413 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
413 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
414 $ hg add
414 $ hg add
415 adding reallylarge as a largefile
415 adding reallylarge as a largefile
416 adding test.dat as a largefile
416 adding test.dat as a largefile
417
417
418 Test that minsize and --lfsize handle float values;
418 Test that minsize and --lfsize handle float values;
419 also tests that --lfsize overrides largefiles.minsize.
419 also tests that --lfsize overrides largefiles.minsize.
420 (0.250 MB = 256 kB = 262144 B)
420 (0.250 MB = 256 kB = 262144 B)
421
421
422 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
422 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
423 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
423 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
424 $ hg --config largefiles.minsize=.25 add
424 $ hg --config largefiles.minsize=.25 add
425 adding ratherlarge as a largefile
425 adding ratherlarge as a largefile
426 adding medium
426 adding medium
427 $ hg forget medium
427 $ hg forget medium
428 $ hg --config largefiles.minsize=.25 add --lfsize=.125
428 $ hg --config largefiles.minsize=.25 add --lfsize=.125
429 adding medium as a largefile
429 adding medium as a largefile
430 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
430 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
431 $ hg --config largefiles.minsize=.25 add --lfsize=.125
431 $ hg --config largefiles.minsize=.25 add --lfsize=.125
432 adding notlarge
432 adding notlarge
433 $ hg forget notlarge
433 $ hg forget notlarge
434
434
435 Test forget on largefiles.
435 Test forget on largefiles.
436
436
437 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
437 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
438 $ hg commit -m "add/edit more largefiles"
438 $ hg commit -m "add/edit more largefiles"
439 Invoking status precommit hook
439 Invoking status precommit hook
440 A sub2/large6
440 A sub2/large6
441 A sub2/large7
441 A sub2/large7
442 R large3
442 R large3
443 ? large5
443 ? large5
444 ? medium
444 ? medium
445 ? notlarge
445 ? notlarge
446 ? ratherlarge
446 ? ratherlarge
447 ? reallylarge
447 ? reallylarge
448 ? test.dat
448 ? test.dat
449 $ hg st
449 $ hg st
450 ? large3
450 ? large3
451 ? large5
451 ? large5
452 ? medium
452 ? medium
453 ? notlarge
453 ? notlarge
454 ? ratherlarge
454 ? ratherlarge
455 ? reallylarge
455 ? reallylarge
456 ? test.dat
456 ? test.dat
457
457
458 Purge with largefiles: verify that largefiles are still in the working
458 Purge with largefiles: verify that largefiles are still in the working
459 dir after a purge.
459 dir after a purge.
460
460
461 $ hg purge --all
461 $ hg purge --all
462 $ cat sub/large4
462 $ cat sub/large4
463 large44
463 large44
464 $ cat sub2/large6
464 $ cat sub2/large6
465 large6
465 large6
466 $ cat sub2/large7
466 $ cat sub2/large7
467 large7
467 large7
468
468
469 Test addremove: verify that files that should be added as largefiles are added as
469 Test addremove: verify that files that should be added as largefiles are added as
470 such and that already-existing largefiles are not added as normal files by
470 such and that already-existing largefiles are not added as normal files by
471 accident.
471 accident.
472
472
473 $ rm normal3
473 $ rm normal3
474 $ rm sub/large4
474 $ rm sub/large4
475 $ echo "testing addremove with patterns" > testaddremove.dat
475 $ echo "testing addremove with patterns" > testaddremove.dat
476 $ echo "normaladdremove" > normaladdremove
476 $ echo "normaladdremove" > normaladdremove
477 $ hg addremove
477 $ hg addremove
478 removing sub/large4
478 removing sub/large4
479 adding testaddremove.dat as a largefile
479 adding testaddremove.dat as a largefile
480 removing normal3
480 removing normal3
481 adding normaladdremove
481 adding normaladdremove
482
482
483 Test addremove with -R
483 Test addremove with -R
484
484
485 $ hg up -C
485 $ hg up -C
486 getting changed largefiles
486 getting changed largefiles
487 1 largefiles updated, 0 removed
487 1 largefiles updated, 0 removed
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 $ rm normal3
489 $ rm normal3
490 $ rm sub/large4
490 $ rm sub/large4
491 $ echo "testing addremove with patterns" > testaddremove.dat
491 $ echo "testing addremove with patterns" > testaddremove.dat
492 $ echo "normaladdremove" > normaladdremove
492 $ echo "normaladdremove" > normaladdremove
493 $ cd ..
493 $ cd ..
494 $ hg -R a addremove
494 $ hg -R a addremove
495 removing sub/large4
495 removing sub/large4
496 adding a/testaddremove.dat as a largefile (glob)
496 adding a/testaddremove.dat as a largefile (glob)
497 removing normal3
497 removing normal3
498 adding normaladdremove
498 adding normaladdremove
499 $ cd a
499 $ cd a
500
500
501 Test 3364
501 Test 3364
502 $ hg clone . ../addrm
502 $ hg clone . ../addrm
503 updating to branch default
503 updating to branch default
504 getting changed largefiles
504 getting changed largefiles
505 3 largefiles updated, 0 removed
505 3 largefiles updated, 0 removed
506 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
506 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
507 $ cd ../addrm
507 $ cd ../addrm
508 $ cat >> .hg/hgrc <<EOF
508 $ cat >> .hg/hgrc <<EOF
509 > [hooks]
509 > [hooks]
510 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
510 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
511 > EOF
511 > EOF
512 $ touch foo
512 $ touch foo
513 $ hg add --large foo
513 $ hg add --large foo
514 $ hg ci -m "add foo"
514 $ hg ci -m "add foo"
515 Invoking status precommit hook
515 Invoking status precommit hook
516 A foo
516 A foo
517 Invoking status postcommit hook
517 Invoking status postcommit hook
518 C foo
518 C foo
519 C normal3
519 C normal3
520 C sub/large4
520 C sub/large4
521 C sub/normal4
521 C sub/normal4
522 C sub2/large6
522 C sub2/large6
523 C sub2/large7
523 C sub2/large7
524 $ rm foo
524 $ rm foo
525 $ hg st
525 $ hg st
526 ! foo
526 ! foo
527 hmm.. no precommit invoked, but there is a postcommit??
527 hmm.. no precommit invoked, but there is a postcommit??
528 $ hg ci -m "will not checkin"
528 $ hg ci -m "will not checkin"
529 nothing changed
529 nothing changed
530 Invoking status postcommit hook
530 Invoking status postcommit hook
531 ! foo
531 ! foo
532 C normal3
532 C normal3
533 C sub/large4
533 C sub/large4
534 C sub/normal4
534 C sub/normal4
535 C sub2/large6
535 C sub2/large6
536 C sub2/large7
536 C sub2/large7
537 [1]
537 [1]
538 $ hg addremove
538 $ hg addremove
539 removing foo
539 removing foo
540 $ hg st
540 $ hg st
541 R foo
541 R foo
542 $ hg ci -m "used to say nothing changed"
542 $ hg ci -m "used to say nothing changed"
543 Invoking status precommit hook
543 Invoking status precommit hook
544 R foo
544 R foo
545 Invoking status postcommit hook
545 Invoking status postcommit hook
546 C normal3
546 C normal3
547 C sub/large4
547 C sub/large4
548 C sub/normal4
548 C sub/normal4
549 C sub2/large6
549 C sub2/large6
550 C sub2/large7
550 C sub2/large7
551 $ hg st
551 $ hg st
552
552
553 Test 3507 (both normal files and largefiles were a problem)
553 Test 3507 (both normal files and largefiles were a problem)
554
554
555 $ touch normal
555 $ touch normal
556 $ touch large
556 $ touch large
557 $ hg add normal
557 $ hg add normal
558 $ hg add --large large
558 $ hg add --large large
559 $ hg ci -m "added"
559 $ hg ci -m "added"
560 Invoking status precommit hook
560 Invoking status precommit hook
561 A large
561 A large
562 A normal
562 A normal
563 Invoking status postcommit hook
563 Invoking status postcommit hook
564 C large
564 C large
565 C normal
565 C normal
566 C normal3
566 C normal3
567 C sub/large4
567 C sub/large4
568 C sub/normal4
568 C sub/normal4
569 C sub2/large6
569 C sub2/large6
570 C sub2/large7
570 C sub2/large7
571 $ hg remove normal
571 $ hg remove normal
572 $ hg addremove --traceback
572 $ hg addremove --traceback
573 $ hg ci -m "addremoved normal"
573 $ hg ci -m "addremoved normal"
574 Invoking status precommit hook
574 Invoking status precommit hook
575 R normal
575 R normal
576 Invoking status postcommit hook
576 Invoking status postcommit hook
577 C large
577 C large
578 C normal3
578 C normal3
579 C sub/large4
579 C sub/large4
580 C sub/normal4
580 C sub/normal4
581 C sub2/large6
581 C sub2/large6
582 C sub2/large7
582 C sub2/large7
583 $ hg up -C '.^'
583 $ hg up -C '.^'
584 getting changed largefiles
584 getting changed largefiles
585 0 largefiles updated, 0 removed
585 0 largefiles updated, 0 removed
586 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
586 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 $ hg remove large
587 $ hg remove large
588 $ hg addremove --traceback
588 $ hg addremove --traceback
589 $ hg ci -m "removed large"
589 $ hg ci -m "removed large"
590 Invoking status precommit hook
590 Invoking status precommit hook
591 R large
591 R large
592 created new head
592 created new head
593 Invoking status postcommit hook
593 Invoking status postcommit hook
594 C normal
594 C normal
595 C normal3
595 C normal3
596 C sub/large4
596 C sub/large4
597 C sub/normal4
597 C sub/normal4
598 C sub2/large6
598 C sub2/large6
599 C sub2/large7
599 C sub2/large7
600
600
601 Test commit -A (issue3542)
601 Test commit -A (issue3542)
602 $ echo large8 > large8
602 $ echo large8 > large8
603 $ hg add --large large8
603 $ hg add --large large8
604 $ hg ci -Am 'this used to add large8 as normal and commit both'
604 $ hg ci -Am 'this used to add large8 as normal and commit both'
605 Invoking status precommit hook
605 Invoking status precommit hook
606 A large8
606 A large8
607 Invoking status postcommit hook
607 Invoking status postcommit hook
608 C large8
608 C large8
609 C normal
609 C normal
610 C normal3
610 C normal3
611 C sub/large4
611 C sub/large4
612 C sub/normal4
612 C sub/normal4
613 C sub2/large6
613 C sub2/large6
614 C sub2/large7
614 C sub2/large7
615 $ rm large8
615 $ rm large8
616 $ hg ci -Am 'this used to not notice the rm'
616 $ hg ci -Am 'this used to not notice the rm'
617 removing large8
617 removing large8
618 Invoking status precommit hook
618 Invoking status precommit hook
619 R large8
619 R large8
620 Invoking status postcommit hook
620 Invoking status postcommit hook
621 C normal
621 C normal
622 C normal3
622 C normal3
623 C sub/large4
623 C sub/large4
624 C sub/normal4
624 C sub/normal4
625 C sub2/large6
625 C sub2/large6
626 C sub2/large7
626 C sub2/large7
627
627
628 Test that a standin can't be added as a large file
628 Test that a standin can't be added as a large file
629
629
630 $ touch large
630 $ touch large
631 $ hg add --large large
631 $ hg add --large large
632 $ hg ci -m "add"
632 $ hg ci -m "add"
633 Invoking status precommit hook
633 Invoking status precommit hook
634 A large
634 A large
635 Invoking status postcommit hook
635 Invoking status postcommit hook
636 C large
636 C large
637 C normal
637 C normal
638 C normal3
638 C normal3
639 C sub/large4
639 C sub/large4
640 C sub/normal4
640 C sub/normal4
641 C sub2/large6
641 C sub2/large6
642 C sub2/large7
642 C sub2/large7
643 $ hg remove large
643 $ hg remove large
644 $ touch large
644 $ touch large
645 $ hg addremove --config largefiles.patterns=**large --traceback
645 $ hg addremove --config largefiles.patterns=**large --traceback
646 adding large as a largefile
646 adding large as a largefile
647
647
648 Test that outgoing --large works (with revsets too)
648 Test that outgoing --large works (with revsets too)
649 $ hg outgoing --rev '.^' --large
649 $ hg outgoing --rev '.^' --large
650 comparing with $TESTTMP/a (glob)
650 comparing with $TESTTMP/a (glob)
651 searching for changes
651 searching for changes
652 changeset: 8:c02fd3b77ec4
652 changeset: 8:c02fd3b77ec4
653 user: test
653 user: test
654 date: Thu Jan 01 00:00:00 1970 +0000
654 date: Thu Jan 01 00:00:00 1970 +0000
655 summary: add foo
655 summary: add foo
656
656
657 changeset: 9:289dd08c9bbb
657 changeset: 9:289dd08c9bbb
658 user: test
658 user: test
659 date: Thu Jan 01 00:00:00 1970 +0000
659 date: Thu Jan 01 00:00:00 1970 +0000
660 summary: used to say nothing changed
660 summary: used to say nothing changed
661
661
662 changeset: 10:34f23ac6ac12
662 changeset: 10:34f23ac6ac12
663 user: test
663 user: test
664 date: Thu Jan 01 00:00:00 1970 +0000
664 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: added
665 summary: added
666
666
667 changeset: 12:710c1b2f523c
667 changeset: 12:710c1b2f523c
668 parent: 10:34f23ac6ac12
668 parent: 10:34f23ac6ac12
669 user: test
669 user: test
670 date: Thu Jan 01 00:00:00 1970 +0000
670 date: Thu Jan 01 00:00:00 1970 +0000
671 summary: removed large
671 summary: removed large
672
672
673 changeset: 13:0a3e75774479
673 changeset: 13:0a3e75774479
674 user: test
674 user: test
675 date: Thu Jan 01 00:00:00 1970 +0000
675 date: Thu Jan 01 00:00:00 1970 +0000
676 summary: this used to add large8 as normal and commit both
676 summary: this used to add large8 as normal and commit both
677
677
678 changeset: 14:84f3d378175c
678 changeset: 14:84f3d378175c
679 user: test
679 user: test
680 date: Thu Jan 01 00:00:00 1970 +0000
680 date: Thu Jan 01 00:00:00 1970 +0000
681 summary: this used to not notice the rm
681 summary: this used to not notice the rm
682
682
683 largefiles to upload (1 entities):
683 largefiles to upload (1 entities):
684 large8
684 large8
685
685
686 $ cd ../a
686 $ cd ../a
687
687
688 Clone a largefiles repo.
688 Clone a largefiles repo.
689
689
690 $ hg clone . ../b
690 $ hg clone . ../b
691 updating to branch default
691 updating to branch default
692 getting changed largefiles
692 getting changed largefiles
693 3 largefiles updated, 0 removed
693 3 largefiles updated, 0 removed
694 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
695 $ cd ../b
695 $ cd ../b
696 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
696 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
697 7:daea875e9014 add/edit more largefiles
697 7:daea875e9014 add/edit more largefiles
698 6:4355d653f84f edit files yet again
698 6:4355d653f84f edit files yet again
699 5:9d5af5072dbd edit files again
699 5:9d5af5072dbd edit files again
700 4:74c02385b94c move files
700 4:74c02385b94c move files
701 3:9e8fbc4bce62 copy files
701 3:9e8fbc4bce62 copy files
702 2:51a0ae4d5864 remove files
702 2:51a0ae4d5864 remove files
703 1:ce8896473775 edit files
703 1:ce8896473775 edit files
704 0:30d30fe6a5be add files
704 0:30d30fe6a5be add files
705 $ cat normal3
705 $ cat normal3
706 normal33
706 normal33
707
707
708 Test graph log
708 Test graph log
709
709
710 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
710 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
711 @ 7:daea875e9014 add/edit more largefiles
711 @ 7:daea875e9014 add/edit more largefiles
712 |
712 |
713 o 6:4355d653f84f edit files yet again
713 o 6:4355d653f84f edit files yet again
714 |
714 |
715 o 5:9d5af5072dbd edit files again
715 o 5:9d5af5072dbd edit files again
716 |
716 |
717 o 4:74c02385b94c move files
717 o 4:74c02385b94c move files
718 |
718 |
719 o 3:9e8fbc4bce62 copy files
719 o 3:9e8fbc4bce62 copy files
720 |
720 |
721 o 2:51a0ae4d5864 remove files
721 o 2:51a0ae4d5864 remove files
722 |
722 |
723 o 1:ce8896473775 edit files
723 o 1:ce8896473775 edit files
724 |
724 |
725 o 0:30d30fe6a5be add files
725 o 0:30d30fe6a5be add files
726
726
727
727
728 Test log with --patch
728 Test log with --patch
729
729
730 $ hg log --patch -r 6::7
730 $ hg log --patch -r 6::7
731 changeset: 6:4355d653f84f
731 changeset: 6:4355d653f84f
732 user: test
732 user: test
733 date: Thu Jan 01 00:00:00 1970 +0000
733 date: Thu Jan 01 00:00:00 1970 +0000
734 summary: edit files yet again
734 summary: edit files yet again
735
735
736 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
736 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
737 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
737 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
738 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
738 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
739 @@ -1,1 +1,1 @@
739 @@ -1,1 +1,1 @@
740 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
740 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
741 +7838695e10da2bb75ac1156565f40a2595fa2fa0
741 +7838695e10da2bb75ac1156565f40a2595fa2fa0
742 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
742 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
743 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
743 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
744 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
744 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
745 @@ -1,1 +1,1 @@
745 @@ -1,1 +1,1 @@
746 -aeb2210d19f02886dde00dac279729a48471e2f9
746 -aeb2210d19f02886dde00dac279729a48471e2f9
747 +971fb41e78fea4f8e0ba5244784239371cb00591
747 +971fb41e78fea4f8e0ba5244784239371cb00591
748 diff -r 9d5af5072dbd -r 4355d653f84f normal3
748 diff -r 9d5af5072dbd -r 4355d653f84f normal3
749 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
749 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
750 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
750 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
751 @@ -1,1 +1,1 @@
751 @@ -1,1 +1,1 @@
752 -normal3
752 -normal3
753 +normal33
753 +normal33
754 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
754 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
755 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
755 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
756 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
756 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
757 @@ -1,1 +1,1 @@
757 @@ -1,1 +1,1 @@
758 -normal4
758 -normal4
759 +normal44
759 +normal44
760
760
761 changeset: 7:daea875e9014
761 changeset: 7:daea875e9014
762 tag: tip
762 tag: tip
763 user: test
763 user: test
764 date: Thu Jan 01 00:00:00 1970 +0000
764 date: Thu Jan 01 00:00:00 1970 +0000
765 summary: add/edit more largefiles
765 summary: add/edit more largefiles
766
766
767 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
767 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
768 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
768 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
769 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
769 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
770 @@ -1,1 +0,0 @@
770 @@ -1,1 +0,0 @@
771 -7838695e10da2bb75ac1156565f40a2595fa2fa0
771 -7838695e10da2bb75ac1156565f40a2595fa2fa0
772 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
772 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
773 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
773 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
774 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
774 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
775 @@ -0,0 +1,1 @@
775 @@ -0,0 +1,1 @@
776 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
776 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
777 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
777 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
778 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
778 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
779 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
779 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
780 @@ -0,0 +1,1 @@
780 @@ -0,0 +1,1 @@
781 +bb3151689acb10f0c3125c560d5e63df914bc1af
781 +bb3151689acb10f0c3125c560d5e63df914bc1af
782
782
783
783
784 $ hg log --patch -r 6::7 sub/
784 $ hg log --patch -r 6::7 sub/
785 changeset: 6:4355d653f84f
785 changeset: 6:4355d653f84f
786 user: test
786 user: test
787 date: Thu Jan 01 00:00:00 1970 +0000
787 date: Thu Jan 01 00:00:00 1970 +0000
788 summary: edit files yet again
788 summary: edit files yet again
789
789
790 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
790 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
791 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
791 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
792 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
792 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
793 @@ -1,1 +1,1 @@
793 @@ -1,1 +1,1 @@
794 -aeb2210d19f02886dde00dac279729a48471e2f9
794 -aeb2210d19f02886dde00dac279729a48471e2f9
795 +971fb41e78fea4f8e0ba5244784239371cb00591
795 +971fb41e78fea4f8e0ba5244784239371cb00591
796 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
796 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
797 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
797 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
798 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
798 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
799 @@ -1,1 +1,1 @@
799 @@ -1,1 +1,1 @@
800 -normal4
800 -normal4
801 +normal44
801 +normal44
802
802
803
803
804 log with both --follow and --patch
804 log with both --follow and --patch
805
805
806 $ hg log --follow --patch --limit 2
806 $ hg log --follow --patch --limit 2
807 changeset: 7:daea875e9014
807 changeset: 7:daea875e9014
808 tag: tip
808 tag: tip
809 user: test
809 user: test
810 date: Thu Jan 01 00:00:00 1970 +0000
810 date: Thu Jan 01 00:00:00 1970 +0000
811 summary: add/edit more largefiles
811 summary: add/edit more largefiles
812
812
813 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
813 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
814 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
814 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
815 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
815 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
816 @@ -1,1 +0,0 @@
816 @@ -1,1 +0,0 @@
817 -7838695e10da2bb75ac1156565f40a2595fa2fa0
817 -7838695e10da2bb75ac1156565f40a2595fa2fa0
818 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
818 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
819 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
819 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
820 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
820 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
821 @@ -0,0 +1,1 @@
821 @@ -0,0 +1,1 @@
822 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
822 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
823 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
823 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
824 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
824 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
825 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
825 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
826 @@ -0,0 +1,1 @@
826 @@ -0,0 +1,1 @@
827 +bb3151689acb10f0c3125c560d5e63df914bc1af
827 +bb3151689acb10f0c3125c560d5e63df914bc1af
828
828
829 changeset: 6:4355d653f84f
829 changeset: 6:4355d653f84f
830 user: test
830 user: test
831 date: Thu Jan 01 00:00:00 1970 +0000
831 date: Thu Jan 01 00:00:00 1970 +0000
832 summary: edit files yet again
832 summary: edit files yet again
833
833
834 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
834 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
835 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
835 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
836 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
836 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
837 @@ -1,1 +1,1 @@
837 @@ -1,1 +1,1 @@
838 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
838 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
839 +7838695e10da2bb75ac1156565f40a2595fa2fa0
839 +7838695e10da2bb75ac1156565f40a2595fa2fa0
840 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
840 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
841 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
841 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
842 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
842 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
843 @@ -1,1 +1,1 @@
843 @@ -1,1 +1,1 @@
844 -aeb2210d19f02886dde00dac279729a48471e2f9
844 -aeb2210d19f02886dde00dac279729a48471e2f9
845 +971fb41e78fea4f8e0ba5244784239371cb00591
845 +971fb41e78fea4f8e0ba5244784239371cb00591
846 diff -r 9d5af5072dbd -r 4355d653f84f normal3
846 diff -r 9d5af5072dbd -r 4355d653f84f normal3
847 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
847 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
848 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
848 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
849 @@ -1,1 +1,1 @@
849 @@ -1,1 +1,1 @@
850 -normal3
850 -normal3
851 +normal33
851 +normal33
852 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
852 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
853 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
853 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
854 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
854 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
855 @@ -1,1 +1,1 @@
855 @@ -1,1 +1,1 @@
856 -normal4
856 -normal4
857 +normal44
857 +normal44
858
858
859 $ hg log --follow --patch sub/large4
859 $ hg log --follow --patch sub/large4
860 changeset: 6:4355d653f84f
860 changeset: 6:4355d653f84f
861 user: test
861 user: test
862 date: Thu Jan 01 00:00:00 1970 +0000
862 date: Thu Jan 01 00:00:00 1970 +0000
863 summary: edit files yet again
863 summary: edit files yet again
864
864
865 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
865 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
866 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
866 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
867 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
867 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
868 @@ -1,1 +1,1 @@
868 @@ -1,1 +1,1 @@
869 -aeb2210d19f02886dde00dac279729a48471e2f9
869 -aeb2210d19f02886dde00dac279729a48471e2f9
870 +971fb41e78fea4f8e0ba5244784239371cb00591
870 +971fb41e78fea4f8e0ba5244784239371cb00591
871
871
872 changeset: 5:9d5af5072dbd
872 changeset: 5:9d5af5072dbd
873 user: test
873 user: test
874 date: Thu Jan 01 00:00:00 1970 +0000
874 date: Thu Jan 01 00:00:00 1970 +0000
875 summary: edit files again
875 summary: edit files again
876
876
877 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
877 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
878 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
878 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
879 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
879 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
880 @@ -1,1 +1,1 @@
880 @@ -1,1 +1,1 @@
881 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
881 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
882 +aeb2210d19f02886dde00dac279729a48471e2f9
882 +aeb2210d19f02886dde00dac279729a48471e2f9
883
883
884 changeset: 4:74c02385b94c
884 changeset: 4:74c02385b94c
885 user: test
885 user: test
886 date: Thu Jan 01 00:00:00 1970 +0000
886 date: Thu Jan 01 00:00:00 1970 +0000
887 summary: move files
887 summary: move files
888
888
889 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
889 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
890 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
890 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
891 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
891 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
892 @@ -0,0 +1,1 @@
892 @@ -0,0 +1,1 @@
893 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
893 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
894
894
895 changeset: 1:ce8896473775
895 changeset: 1:ce8896473775
896 user: test
896 user: test
897 date: Thu Jan 01 00:00:00 1970 +0000
897 date: Thu Jan 01 00:00:00 1970 +0000
898 summary: edit files
898 summary: edit files
899
899
900 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
900 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
901 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
901 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
902 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
902 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
903 @@ -1,1 +1,1 @@
903 @@ -1,1 +1,1 @@
904 -1deebade43c8c498a3c8daddac0244dc55d1331d
904 -1deebade43c8c498a3c8daddac0244dc55d1331d
905 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
905 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
906
906
907 changeset: 0:30d30fe6a5be
907 changeset: 0:30d30fe6a5be
908 user: test
908 user: test
909 date: Thu Jan 01 00:00:00 1970 +0000
909 date: Thu Jan 01 00:00:00 1970 +0000
910 summary: add files
910 summary: add files
911
911
912 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
912 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
913 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
913 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
914 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
914 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
915 @@ -0,0 +1,1 @@
915 @@ -0,0 +1,1 @@
916 +1deebade43c8c498a3c8daddac0244dc55d1331d
916 +1deebade43c8c498a3c8daddac0244dc55d1331d
917
917
918 $ cat sub/normal4
918 $ cat sub/normal4
919 normal44
919 normal44
920 $ cat sub/large4
920 $ cat sub/large4
921 large44
921 large44
922 $ cat sub2/large6
922 $ cat sub2/large6
923 large6
923 large6
924 $ cat sub2/large7
924 $ cat sub2/large7
925 large7
925 large7
926 $ hg log -qf sub2/large7
926 $ hg log -qf sub2/large7
927 7:daea875e9014
927 7:daea875e9014
928 $ hg log -Gqf sub2/large7
928 $ hg log -Gqf sub2/large7
929 @ 7:daea875e9014
929 @ 7:daea875e9014
930 |
930 |
931 $ cd ..
931 $ cd ..
932
932
933 Test log from outside repo
933 Test log from outside repo
934
934
935 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
935 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
936 6:4355d653f84f edit files yet again
936 6:4355d653f84f edit files yet again
937 5:9d5af5072dbd edit files again
937 5:9d5af5072dbd edit files again
938 4:74c02385b94c move files
938 4:74c02385b94c move files
939 1:ce8896473775 edit files
939 1:ce8896473775 edit files
940 0:30d30fe6a5be add files
940 0:30d30fe6a5be add files
941
941
942 Test clone at revision
942 Test clone at revision
943
943
944 $ hg clone a -r 3 c
944 $ hg clone a -r 3 c
945 adding changesets
945 adding changesets
946 adding manifests
946 adding manifests
947 adding file changes
947 adding file changes
948 added 4 changesets with 10 changes to 4 files
948 added 4 changesets with 10 changes to 4 files
949 updating to branch default
949 updating to branch default
950 getting changed largefiles
950 getting changed largefiles
951 2 largefiles updated, 0 removed
951 2 largefiles updated, 0 removed
952 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
952 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
953 $ cd c
953 $ cd c
954 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
954 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
955 3:9e8fbc4bce62 copy files
955 3:9e8fbc4bce62 copy files
956 2:51a0ae4d5864 remove files
956 2:51a0ae4d5864 remove files
957 1:ce8896473775 edit files
957 1:ce8896473775 edit files
958 0:30d30fe6a5be add files
958 0:30d30fe6a5be add files
959 $ cat normal1
959 $ cat normal1
960 normal22
960 normal22
961 $ cat large1
961 $ cat large1
962 large22
962 large22
963 $ cat sub/normal2
963 $ cat sub/normal2
964 normal22
964 normal22
965 $ cat sub/large2
965 $ cat sub/large2
966 large22
966 large22
967
967
968 Old revisions of a clone have correct largefiles content (this also
968 Old revisions of a clone have correct largefiles content (this also
969 tests update).
969 tests update).
970
970
971 $ hg update -r 1
971 $ hg update -r 1
972 getting changed largefiles
972 getting changed largefiles
973 1 largefiles updated, 0 removed
973 1 largefiles updated, 0 removed
974 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
974 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
975 $ cat large1
975 $ cat large1
976 large11
976 large11
977 $ cat sub/large2
977 $ cat sub/large2
978 large22
978 large22
979 $ cd ..
979 $ cd ..
980
980
981 Test cloning with --all-largefiles flag
981 Test cloning with --all-largefiles flag
982
982
983 $ rm "${USERCACHE}"/*
983 $ rm "${USERCACHE}"/*
984 $ hg clone --all-largefiles a a-backup
984 $ hg clone --all-largefiles a a-backup
985 updating to branch default
985 updating to branch default
986 getting changed largefiles
986 getting changed largefiles
987 3 largefiles updated, 0 removed
987 3 largefiles updated, 0 removed
988 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
988 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
989 8 additional largefiles cached
989 8 additional largefiles cached
990
990
991 $ rm "${USERCACHE}"/*
991 $ rm "${USERCACHE}"/*
992 $ hg clone --all-largefiles -u 0 a a-clone0
992 $ hg clone --all-largefiles -u 0 a a-clone0
993 updating to branch default
993 updating to branch default
994 getting changed largefiles
994 getting changed largefiles
995 2 largefiles updated, 0 removed
995 2 largefiles updated, 0 removed
996 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
996 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
997 9 additional largefiles cached
997 9 additional largefiles cached
998 $ hg -R a-clone0 sum
998 $ hg -R a-clone0 sum
999 parent: 0:30d30fe6a5be
999 parent: 0:30d30fe6a5be
1000 add files
1000 add files
1001 branch: default
1001 branch: default
1002 commit: (clean)
1002 commit: (clean)
1003 update: 7 new changesets (update)
1003 update: 7 new changesets (update)
1004
1004
1005 $ rm "${USERCACHE}"/*
1005 $ rm "${USERCACHE}"/*
1006 $ hg clone --all-largefiles -u 1 a a-clone1
1006 $ hg clone --all-largefiles -u 1 a a-clone1
1007 updating to branch default
1007 updating to branch default
1008 getting changed largefiles
1008 getting changed largefiles
1009 2 largefiles updated, 0 removed
1009 2 largefiles updated, 0 removed
1010 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1010 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1011 8 additional largefiles cached
1011 8 additional largefiles cached
1012 $ hg -R a-clone1 verify --large --lfa --lfc
1012 $ hg -R a-clone1 verify --large --lfa --lfc
1013 checking changesets
1013 checking changesets
1014 checking manifests
1014 checking manifests
1015 crosschecking files in changesets and manifests
1015 crosschecking files in changesets and manifests
1016 checking files
1016 checking files
1017 10 files, 8 changesets, 24 total revisions
1017 10 files, 8 changesets, 24 total revisions
1018 searching 8 changesets for largefiles
1018 searching 8 changesets for largefiles
1019 verified contents of 13 revisions of 6 largefiles
1019 verified contents of 13 revisions of 6 largefiles
1020 $ hg -R a-clone1 sum
1020 $ hg -R a-clone1 sum
1021 parent: 1:ce8896473775
1021 parent: 1:ce8896473775
1022 edit files
1022 edit files
1023 branch: default
1023 branch: default
1024 commit: (clean)
1024 commit: (clean)
1025 update: 6 new changesets (update)
1025 update: 6 new changesets (update)
1026
1026
1027 $ rm "${USERCACHE}"/*
1027 $ rm "${USERCACHE}"/*
1028 $ hg clone --all-largefiles -U a a-clone-u
1028 $ hg clone --all-largefiles -U a a-clone-u
1029 11 additional largefiles cached
1029 11 additional largefiles cached
1030 $ hg -R a-clone-u sum
1030 $ hg -R a-clone-u sum
1031 parent: -1:000000000000 (no revision checked out)
1031 parent: -1:000000000000 (no revision checked out)
1032 branch: default
1032 branch: default
1033 commit: (clean)
1033 commit: (clean)
1034 update: 8 new changesets (update)
1034 update: 8 new changesets (update)
1035
1035
1036 Show computed destination directory:
1036 Show computed destination directory:
1037
1037
1038 $ mkdir xyz
1038 $ mkdir xyz
1039 $ cd xyz
1039 $ cd xyz
1040 $ hg clone ../a
1040 $ hg clone ../a
1041 destination directory: a
1041 destination directory: a
1042 updating to branch default
1042 updating to branch default
1043 getting changed largefiles
1043 getting changed largefiles
1044 3 largefiles updated, 0 removed
1044 3 largefiles updated, 0 removed
1045 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1045 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1046 $ cd ..
1046 $ cd ..
1047
1047
1048 Clone URL without path:
1048 Clone URL without path:
1049
1049
1050 $ hg clone file://
1050 $ hg clone file://
1051 abort: repository / not found!
1051 abort: repository / not found!
1052 [255]
1052 [255]
1053
1053
1054 Ensure base clone command argument validation
1054 Ensure base clone command argument validation
1055
1055
1056 $ hg clone -U -u 0 a a-clone-failure
1056 $ hg clone -U -u 0 a a-clone-failure
1057 abort: cannot specify both --noupdate and --updaterev
1057 abort: cannot specify both --noupdate and --updaterev
1058 [255]
1058 [255]
1059
1059
1060 $ hg clone --all-largefiles a ssh://localhost/a
1060 $ hg clone --all-largefiles a ssh://localhost/a
1061 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1061 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1062 [255]
1062 [255]
1063
1063
1064 Test pulling with --all-largefiles flag. Also test that the largefiles are
1064 Test pulling with --all-largefiles flag. Also test that the largefiles are
1065 downloaded from 'default' instead of 'default-push' when no source is specified
1065 downloaded from 'default' instead of 'default-push' when no source is specified
1066 (issue3584)
1066 (issue3584)
1067
1067
1068 $ rm -Rf a-backup
1068 $ rm -Rf a-backup
1069 $ hg clone -r 1 a a-backup
1069 $ hg clone -r 1 a a-backup
1070 adding changesets
1070 adding changesets
1071 adding manifests
1071 adding manifests
1072 adding file changes
1072 adding file changes
1073 added 2 changesets with 8 changes to 4 files
1073 added 2 changesets with 8 changes to 4 files
1074 updating to branch default
1074 updating to branch default
1075 getting changed largefiles
1075 getting changed largefiles
1076 2 largefiles updated, 0 removed
1076 2 largefiles updated, 0 removed
1077 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1077 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1078 $ rm "${USERCACHE}"/*
1078 $ rm "${USERCACHE}"/*
1079 $ cd a-backup
1079 $ cd a-backup
1080 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1080 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1081 pulling from $TESTTMP/a (glob)
1081 pulling from $TESTTMP/a (glob)
1082 searching for changes
1082 searching for changes
1083 adding changesets
1083 adding changesets
1084 adding manifests
1084 adding manifests
1085 adding file changes
1085 adding file changes
1086 added 6 changesets with 16 changes to 8 files
1086 added 6 changesets with 16 changes to 8 files
1087 (run 'hg update' to get a working copy)
1087 (run 'hg update' to get a working copy)
1088 6 largefiles cached
1088 6 largefiles cached
1089
1089
1090 redo pull with --lfrev and check it pulls largefiles for the right revs
1090 redo pull with --lfrev and check it pulls largefiles for the right revs
1091
1091
1092 $ hg rollback
1092 $ hg rollback
1093 repository tip rolled back to revision 1 (undo pull)
1093 repository tip rolled back to revision 1 (undo pull)
1094 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1094 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1095 pulling from $TESTTMP/a (glob)
1095 pulling from $TESTTMP/a (glob)
1096 searching for changes
1096 searching for changes
1097 all local heads known remotely
1097 all local heads known remotely
1098 6 changesets found
1098 6 changesets found
1099 adding changesets
1099 adding changesets
1100 adding manifests
1100 adding manifests
1101 adding file changes
1101 adding file changes
1102 added 6 changesets with 16 changes to 8 files
1102 added 6 changesets with 16 changes to 8 files
1103 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1103 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1104 (run 'hg update' to get a working copy)
1104 (run 'hg update' to get a working copy)
1105 pulling largefiles for revision 7
1105 pulling largefiles for revision 7
1106 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1106 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1107 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1107 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1108 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1108 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1109 pulling largefiles for revision 2
1109 pulling largefiles for revision 2
1110 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1110 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1111 0 largefiles cached
1111 0 largefiles cached
1112
1112
1113 lfpull
1113 lfpull
1114
1114
1115 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1115 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1116 2 largefiles cached
1116 2 largefiles cached
1117 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1117 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1118 pulling largefiles for revision 4
1118 pulling largefiles for revision 4
1119 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1119 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1120 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1120 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1121 pulling largefiles for revision 2
1121 pulling largefiles for revision 2
1122 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1122 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1123 0 largefiles cached
1123 0 largefiles cached
1124
1124
1125 $ ls usercache-lfpull/* | sort
1125 $ ls usercache-lfpull/* | sort
1126 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1126 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1127 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1127 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1128
1128
1129 $ cd ..
1129 $ cd ..
1130
1130
1131 Rebasing between two repositories does not revert largefiles to old
1131 Rebasing between two repositories does not revert largefiles to old
1132 revisions (this was a very bad bug that took a lot of work to fix).
1132 revisions (this was a very bad bug that took a lot of work to fix).
1133
1133
1134 $ hg clone a d
1134 $ hg clone a d
1135 updating to branch default
1135 updating to branch default
1136 getting changed largefiles
1136 getting changed largefiles
1137 3 largefiles updated, 0 removed
1137 3 largefiles updated, 0 removed
1138 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1138 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1139 $ cd b
1139 $ cd b
1140 $ echo large4-modified > sub/large4
1140 $ echo large4-modified > sub/large4
1141 $ echo normal3-modified > normal3
1141 $ echo normal3-modified > normal3
1142 $ hg commit -m "modify normal file and largefile in repo b"
1142 $ hg commit -m "modify normal file and largefile in repo b"
1143 Invoking status precommit hook
1143 Invoking status precommit hook
1144 M normal3
1144 M normal3
1145 M sub/large4
1145 M sub/large4
1146 $ cd ../d
1146 $ cd ../d
1147 $ echo large6-modified > sub2/large6
1147 $ echo large6-modified > sub2/large6
1148 $ echo normal4-modified > sub/normal4
1148 $ echo normal4-modified > sub/normal4
1149 $ hg commit -m "modify normal file largefile in repo d"
1149 $ hg commit -m "modify normal file largefile in repo d"
1150 Invoking status precommit hook
1150 Invoking status precommit hook
1151 M sub/normal4
1151 M sub/normal4
1152 M sub2/large6
1152 M sub2/large6
1153 $ cd ..
1153 $ cd ..
1154 $ hg clone d e
1154 $ hg clone d e
1155 updating to branch default
1155 updating to branch default
1156 getting changed largefiles
1156 getting changed largefiles
1157 3 largefiles updated, 0 removed
1157 3 largefiles updated, 0 removed
1158 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1158 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1159 $ cd d
1159 $ cd d
1160
1160
1161 More rebase testing, but also test that the largefiles are downloaded from
1161 More rebase testing, but also test that the largefiles are downloaded from
1162 'default-push' when no source is specified (issue3584). (The largefile from the
1162 'default-push' when no source is specified (issue3584). (The largefile from the
1163 pulled revision is however not downloaded but found in the local cache.)
1163 pulled revision is however not downloaded but found in the local cache.)
1164 Largefiles are fetched for the new pulled revision, not for existing revisions,
1164 Largefiles are fetched for the new pulled revision, not for existing revisions,
1165 rebased or not.
1165 rebased or not.
1166
1166
1167 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1167 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1168 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1168 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1169 pulling from $TESTTMP/b (glob)
1169 pulling from $TESTTMP/b (glob)
1170 searching for changes
1170 searching for changes
1171 adding changesets
1171 adding changesets
1172 adding manifests
1172 adding manifests
1173 adding file changes
1173 adding file changes
1174 added 1 changesets with 2 changes to 2 files (+1 heads)
1174 added 1 changesets with 2 changes to 2 files (+1 heads)
1175 0 largefiles cached
1175 0 largefiles cached
1176 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1176 Invoking status precommit hook
1177 Invoking status precommit hook
1177 M sub/normal4
1178 M sub/normal4
1178 M sub2/large6
1179 M sub2/large6
1179 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1180 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1180 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1181 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1181 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1182 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1182 9:598410d3eb9a modify normal file largefile in repo d
1183 9:598410d3eb9a modify normal file largefile in repo d
1183 8:a381d2c8c80e modify normal file and largefile in repo b
1184 8:a381d2c8c80e modify normal file and largefile in repo b
1184 7:daea875e9014 add/edit more largefiles
1185 7:daea875e9014 add/edit more largefiles
1185 6:4355d653f84f edit files yet again
1186 6:4355d653f84f edit files yet again
1186 5:9d5af5072dbd edit files again
1187 5:9d5af5072dbd edit files again
1187 4:74c02385b94c move files
1188 4:74c02385b94c move files
1188 3:9e8fbc4bce62 copy files
1189 3:9e8fbc4bce62 copy files
1189 2:51a0ae4d5864 remove files
1190 2:51a0ae4d5864 remove files
1190 1:ce8896473775 edit files
1191 1:ce8896473775 edit files
1191 0:30d30fe6a5be add files
1192 0:30d30fe6a5be add files
1192 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1193 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1193 @ 9:598410d3eb9a modify normal file largefile in repo d
1194 @ 9:598410d3eb9a modify normal file largefile in repo d
1194 |
1195 |
1195 o 8:a381d2c8c80e modify normal file and largefile in repo b
1196 o 8:a381d2c8c80e modify normal file and largefile in repo b
1196 |
1197 |
1197 o 7:daea875e9014 add/edit more largefiles
1198 o 7:daea875e9014 add/edit more largefiles
1198 |
1199 |
1199 o 6:4355d653f84f edit files yet again
1200 o 6:4355d653f84f edit files yet again
1200 |
1201 |
1201 o 5:9d5af5072dbd edit files again
1202 o 5:9d5af5072dbd edit files again
1202 |
1203 |
1203 o 4:74c02385b94c move files
1204 o 4:74c02385b94c move files
1204 |
1205 |
1205 o 3:9e8fbc4bce62 copy files
1206 o 3:9e8fbc4bce62 copy files
1206 |
1207 |
1207 o 2:51a0ae4d5864 remove files
1208 o 2:51a0ae4d5864 remove files
1208 |
1209 |
1209 o 1:ce8896473775 edit files
1210 o 1:ce8896473775 edit files
1210 |
1211 |
1211 o 0:30d30fe6a5be add files
1212 o 0:30d30fe6a5be add files
1212
1213
1213 $ cat normal3
1214 $ cat normal3
1214 normal3-modified
1215 normal3-modified
1215 $ cat sub/normal4
1216 $ cat sub/normal4
1216 normal4-modified
1217 normal4-modified
1217 $ cat sub/large4
1218 $ cat sub/large4
1218 large4-modified
1219 large4-modified
1219 $ cat sub2/large6
1220 $ cat sub2/large6
1220 large6-modified
1221 large6-modified
1221 $ cat sub2/large7
1222 $ cat sub2/large7
1222 large7
1223 large7
1223 $ cd ../e
1224 $ cd ../e
1224 $ hg pull ../b
1225 $ hg pull ../b
1225 pulling from ../b
1226 pulling from ../b
1226 searching for changes
1227 searching for changes
1227 adding changesets
1228 adding changesets
1228 adding manifests
1229 adding manifests
1229 adding file changes
1230 adding file changes
1230 added 1 changesets with 2 changes to 2 files (+1 heads)
1231 added 1 changesets with 2 changes to 2 files (+1 heads)
1231 (run 'hg heads' to see heads, 'hg merge' to merge)
1232 (run 'hg heads' to see heads, 'hg merge' to merge)
1232 $ hg rebase
1233 $ hg rebase
1234 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1233 Invoking status precommit hook
1235 Invoking status precommit hook
1234 M sub/normal4
1236 M sub/normal4
1235 M sub2/large6
1237 M sub2/large6
1236 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1238 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1237 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1239 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1238 9:598410d3eb9a modify normal file largefile in repo d
1240 9:598410d3eb9a modify normal file largefile in repo d
1239 8:a381d2c8c80e modify normal file and largefile in repo b
1241 8:a381d2c8c80e modify normal file and largefile in repo b
1240 7:daea875e9014 add/edit more largefiles
1242 7:daea875e9014 add/edit more largefiles
1241 6:4355d653f84f edit files yet again
1243 6:4355d653f84f edit files yet again
1242 5:9d5af5072dbd edit files again
1244 5:9d5af5072dbd edit files again
1243 4:74c02385b94c move files
1245 4:74c02385b94c move files
1244 3:9e8fbc4bce62 copy files
1246 3:9e8fbc4bce62 copy files
1245 2:51a0ae4d5864 remove files
1247 2:51a0ae4d5864 remove files
1246 1:ce8896473775 edit files
1248 1:ce8896473775 edit files
1247 0:30d30fe6a5be add files
1249 0:30d30fe6a5be add files
1248 $ cat normal3
1250 $ cat normal3
1249 normal3-modified
1251 normal3-modified
1250 $ cat sub/normal4
1252 $ cat sub/normal4
1251 normal4-modified
1253 normal4-modified
1252 $ cat sub/large4
1254 $ cat sub/large4
1253 large4-modified
1255 large4-modified
1254 $ cat sub2/large6
1256 $ cat sub2/large6
1255 large6-modified
1257 large6-modified
1256 $ cat sub2/large7
1258 $ cat sub2/large7
1257 large7
1259 large7
1258
1260
1259 Log on largefiles
1261 Log on largefiles
1260
1262
1261 - same output
1263 - same output
1262 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1264 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1263 8:a381d2c8c80e modify normal file and largefile in repo b
1265 8:a381d2c8c80e modify normal file and largefile in repo b
1264 6:4355d653f84f edit files yet again
1266 6:4355d653f84f edit files yet again
1265 5:9d5af5072dbd edit files again
1267 5:9d5af5072dbd edit files again
1266 4:74c02385b94c move files
1268 4:74c02385b94c move files
1267 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1269 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1268 o 8:a381d2c8c80e modify normal file and largefile in repo b
1270 o 8:a381d2c8c80e modify normal file and largefile in repo b
1269 |
1271 |
1270 o 6:4355d653f84f edit files yet again
1272 o 6:4355d653f84f edit files yet again
1271 |
1273 |
1272 o 5:9d5af5072dbd edit files again
1274 o 5:9d5af5072dbd edit files again
1273 |
1275 |
1274 o 4:74c02385b94c move files
1276 o 4:74c02385b94c move files
1275 |
1277 |
1276 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1278 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1277 8:a381d2c8c80e modify normal file and largefile in repo b
1279 8:a381d2c8c80e modify normal file and largefile in repo b
1278 6:4355d653f84f edit files yet again
1280 6:4355d653f84f edit files yet again
1279 5:9d5af5072dbd edit files again
1281 5:9d5af5072dbd edit files again
1280 4:74c02385b94c move files
1282 4:74c02385b94c move files
1281 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1283 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1282 o 8:a381d2c8c80e modify normal file and largefile in repo b
1284 o 8:a381d2c8c80e modify normal file and largefile in repo b
1283 |
1285 |
1284 o 6:4355d653f84f edit files yet again
1286 o 6:4355d653f84f edit files yet again
1285 |
1287 |
1286 o 5:9d5af5072dbd edit files again
1288 o 5:9d5af5072dbd edit files again
1287 |
1289 |
1288 o 4:74c02385b94c move files
1290 o 4:74c02385b94c move files
1289 |
1291 |
1290
1292
1291 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1293 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1292 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1294 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1293 8:a381d2c8c80e modify normal file and largefile in repo b
1295 8:a381d2c8c80e modify normal file and largefile in repo b
1294 6:4355d653f84f edit files yet again
1296 6:4355d653f84f edit files yet again
1295 5:9d5af5072dbd edit files again
1297 5:9d5af5072dbd edit files again
1296 4:74c02385b94c move files
1298 4:74c02385b94c move files
1297 1:ce8896473775 edit files
1299 1:ce8896473775 edit files
1298 0:30d30fe6a5be add files
1300 0:30d30fe6a5be add files
1299 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1301 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1300 o 8:a381d2c8c80e modify normal file and largefile in repo b
1302 o 8:a381d2c8c80e modify normal file and largefile in repo b
1301 |
1303 |
1302 o 6:4355d653f84f edit files yet again
1304 o 6:4355d653f84f edit files yet again
1303 |
1305 |
1304 o 5:9d5af5072dbd edit files again
1306 o 5:9d5af5072dbd edit files again
1305 |
1307 |
1306 o 4:74c02385b94c move files
1308 o 4:74c02385b94c move files
1307 |
1309 |
1308 o 1:ce8896473775 edit files
1310 o 1:ce8896473775 edit files
1309 |
1311 |
1310 o 0:30d30fe6a5be add files
1312 o 0:30d30fe6a5be add files
1311
1313
1312 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1314 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1313 9:598410d3eb9a modify normal file largefile in repo d
1315 9:598410d3eb9a modify normal file largefile in repo d
1314 8:a381d2c8c80e modify normal file and largefile in repo b
1316 8:a381d2c8c80e modify normal file and largefile in repo b
1315 6:4355d653f84f edit files yet again
1317 6:4355d653f84f edit files yet again
1316 5:9d5af5072dbd edit files again
1318 5:9d5af5072dbd edit files again
1317 4:74c02385b94c move files
1319 4:74c02385b94c move files
1318 1:ce8896473775 edit files
1320 1:ce8896473775 edit files
1319 0:30d30fe6a5be add files
1321 0:30d30fe6a5be add files
1320 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1322 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1321 @ 9:598410d3eb9a modify normal file largefile in repo d
1323 @ 9:598410d3eb9a modify normal file largefile in repo d
1322 |
1324 |
1323 o 8:a381d2c8c80e modify normal file and largefile in repo b
1325 o 8:a381d2c8c80e modify normal file and largefile in repo b
1324 |
1326 |
1325 o 6:4355d653f84f edit files yet again
1327 o 6:4355d653f84f edit files yet again
1326 |
1328 |
1327 o 5:9d5af5072dbd edit files again
1329 o 5:9d5af5072dbd edit files again
1328 |
1330 |
1329 o 4:74c02385b94c move files
1331 o 4:74c02385b94c move files
1330 |
1332 |
1331 o 1:ce8896473775 edit files
1333 o 1:ce8896473775 edit files
1332 |
1334 |
1333 o 0:30d30fe6a5be add files
1335 o 0:30d30fe6a5be add files
1334
1336
1335 - globbing gives same result
1337 - globbing gives same result
1336 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1338 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1337 9:598410d3eb9a modify normal file largefile in repo d
1339 9:598410d3eb9a modify normal file largefile in repo d
1338 8:a381d2c8c80e modify normal file and largefile in repo b
1340 8:a381d2c8c80e modify normal file and largefile in repo b
1339 6:4355d653f84f edit files yet again
1341 6:4355d653f84f edit files yet again
1340 5:9d5af5072dbd edit files again
1342 5:9d5af5072dbd edit files again
1341 4:74c02385b94c move files
1343 4:74c02385b94c move files
1342 1:ce8896473775 edit files
1344 1:ce8896473775 edit files
1343 0:30d30fe6a5be add files
1345 0:30d30fe6a5be add files
1344 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1346 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1345 @ 9:598410d3eb9a modify normal file largefile in repo d
1347 @ 9:598410d3eb9a modify normal file largefile in repo d
1346 |
1348 |
1347 o 8:a381d2c8c80e modify normal file and largefile in repo b
1349 o 8:a381d2c8c80e modify normal file and largefile in repo b
1348 |
1350 |
1349 o 6:4355d653f84f edit files yet again
1351 o 6:4355d653f84f edit files yet again
1350 |
1352 |
1351 o 5:9d5af5072dbd edit files again
1353 o 5:9d5af5072dbd edit files again
1352 |
1354 |
1353 o 4:74c02385b94c move files
1355 o 4:74c02385b94c move files
1354 |
1356 |
1355 o 1:ce8896473775 edit files
1357 o 1:ce8896473775 edit files
1356 |
1358 |
1357 o 0:30d30fe6a5be add files
1359 o 0:30d30fe6a5be add files
1358
1360
1359 Rollback on largefiles.
1361 Rollback on largefiles.
1360
1362
1361 $ echo large4-modified-again > sub/large4
1363 $ echo large4-modified-again > sub/large4
1362 $ hg commit -m "Modify large4 again"
1364 $ hg commit -m "Modify large4 again"
1363 Invoking status precommit hook
1365 Invoking status precommit hook
1364 M sub/large4
1366 M sub/large4
1365 $ hg rollback
1367 $ hg rollback
1366 repository tip rolled back to revision 9 (undo commit)
1368 repository tip rolled back to revision 9 (undo commit)
1367 working directory now based on revision 9
1369 working directory now based on revision 9
1368 $ hg st
1370 $ hg st
1369 M sub/large4
1371 M sub/large4
1370 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1372 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1371 9:598410d3eb9a modify normal file largefile in repo d
1373 9:598410d3eb9a modify normal file largefile in repo d
1372 8:a381d2c8c80e modify normal file and largefile in repo b
1374 8:a381d2c8c80e modify normal file and largefile in repo b
1373 7:daea875e9014 add/edit more largefiles
1375 7:daea875e9014 add/edit more largefiles
1374 6:4355d653f84f edit files yet again
1376 6:4355d653f84f edit files yet again
1375 5:9d5af5072dbd edit files again
1377 5:9d5af5072dbd edit files again
1376 4:74c02385b94c move files
1378 4:74c02385b94c move files
1377 3:9e8fbc4bce62 copy files
1379 3:9e8fbc4bce62 copy files
1378 2:51a0ae4d5864 remove files
1380 2:51a0ae4d5864 remove files
1379 1:ce8896473775 edit files
1381 1:ce8896473775 edit files
1380 0:30d30fe6a5be add files
1382 0:30d30fe6a5be add files
1381 $ cat sub/large4
1383 $ cat sub/large4
1382 large4-modified-again
1384 large4-modified-again
1383
1385
1384 "update --check" refuses to update with uncommitted changes.
1386 "update --check" refuses to update with uncommitted changes.
1385 $ hg update --check 8
1387 $ hg update --check 8
1386 abort: uncommitted changes
1388 abort: uncommitted changes
1387 [255]
1389 [255]
1388
1390
1389 "update --clean" leaves correct largefiles in working copy, even when there is
1391 "update --clean" leaves correct largefiles in working copy, even when there is
1390 .orig files from revert in .hglf.
1392 .orig files from revert in .hglf.
1391
1393
1392 $ echo mistake > sub2/large7
1394 $ echo mistake > sub2/large7
1393 $ hg revert sub2/large7
1395 $ hg revert sub2/large7
1394 $ cat sub2/large7
1396 $ cat sub2/large7
1395 large7
1397 large7
1396 $ cat sub2/large7.orig
1398 $ cat sub2/large7.orig
1397 mistake
1399 mistake
1398 $ test ! -f .hglf/sub2/large7.orig
1400 $ test ! -f .hglf/sub2/large7.orig
1399
1401
1400 $ hg -q update --clean -r null
1402 $ hg -q update --clean -r null
1401 $ hg update --clean
1403 $ hg update --clean
1402 getting changed largefiles
1404 getting changed largefiles
1403 3 largefiles updated, 0 removed
1405 3 largefiles updated, 0 removed
1404 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1406 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1405 $ cat normal3
1407 $ cat normal3
1406 normal3-modified
1408 normal3-modified
1407 $ cat sub/normal4
1409 $ cat sub/normal4
1408 normal4-modified
1410 normal4-modified
1409 $ cat sub/large4
1411 $ cat sub/large4
1410 large4-modified
1412 large4-modified
1411 $ cat sub2/large6
1413 $ cat sub2/large6
1412 large6-modified
1414 large6-modified
1413 $ cat sub2/large7
1415 $ cat sub2/large7
1414 large7
1416 large7
1415 $ cat sub2/large7.orig
1417 $ cat sub2/large7.orig
1416 mistake
1418 mistake
1417 $ test ! -f .hglf/sub2/large7.orig
1419 $ test ! -f .hglf/sub2/large7.orig
1418
1420
1419 verify that largefile .orig file no longer is overwritten on every update -C:
1421 verify that largefile .orig file no longer is overwritten on every update -C:
1420 $ hg update --clean
1422 $ hg update --clean
1421 getting changed largefiles
1423 getting changed largefiles
1422 0 largefiles updated, 0 removed
1424 0 largefiles updated, 0 removed
1423 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1425 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1424 $ cat sub2/large7.orig
1426 $ cat sub2/large7.orig
1425 mistake
1427 mistake
1426 $ rm sub2/large7.orig
1428 $ rm sub2/large7.orig
1427
1429
1428 Now "update check" is happy.
1430 Now "update check" is happy.
1429 $ hg update --check 8
1431 $ hg update --check 8
1430 getting changed largefiles
1432 getting changed largefiles
1431 1 largefiles updated, 0 removed
1433 1 largefiles updated, 0 removed
1432 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1434 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1433 $ hg update --check
1435 $ hg update --check
1434 getting changed largefiles
1436 getting changed largefiles
1435 1 largefiles updated, 0 removed
1437 1 largefiles updated, 0 removed
1436 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1438 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1437
1439
1438 Test removing empty largefiles directories on update
1440 Test removing empty largefiles directories on update
1439 $ test -d sub2 && echo "sub2 exists"
1441 $ test -d sub2 && echo "sub2 exists"
1440 sub2 exists
1442 sub2 exists
1441 $ hg update -q null
1443 $ hg update -q null
1442 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1444 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1443 [1]
1445 [1]
1444 $ hg update -q
1446 $ hg update -q
1445
1447
1446 Test hg remove removes empty largefiles directories
1448 Test hg remove removes empty largefiles directories
1447 $ test -d sub2 && echo "sub2 exists"
1449 $ test -d sub2 && echo "sub2 exists"
1448 sub2 exists
1450 sub2 exists
1449 $ hg remove sub2/*
1451 $ hg remove sub2/*
1450 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1452 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1451 [1]
1453 [1]
1452 $ hg revert sub2/large6 sub2/large7
1454 $ hg revert sub2/large6 sub2/large7
1453
1455
1454 "revert" works on largefiles (and normal files too).
1456 "revert" works on largefiles (and normal files too).
1455 $ echo hack3 >> normal3
1457 $ echo hack3 >> normal3
1456 $ echo hack4 >> sub/normal4
1458 $ echo hack4 >> sub/normal4
1457 $ echo hack4 >> sub/large4
1459 $ echo hack4 >> sub/large4
1458 $ rm sub2/large6
1460 $ rm sub2/large6
1459 $ hg revert sub2/large6
1461 $ hg revert sub2/large6
1460 $ hg rm sub2/large6
1462 $ hg rm sub2/large6
1461 $ echo new >> sub2/large8
1463 $ echo new >> sub2/large8
1462 $ hg add --large sub2/large8
1464 $ hg add --large sub2/large8
1463 # XXX we don't really want to report that we're reverting the standin;
1465 # XXX we don't really want to report that we're reverting the standin;
1464 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1466 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1465 $ hg revert sub
1467 $ hg revert sub
1466 reverting .hglf/sub/large4 (glob)
1468 reverting .hglf/sub/large4 (glob)
1467 reverting sub/normal4 (glob)
1469 reverting sub/normal4 (glob)
1468 $ hg status
1470 $ hg status
1469 M normal3
1471 M normal3
1470 A sub2/large8
1472 A sub2/large8
1471 R sub2/large6
1473 R sub2/large6
1472 ? sub/large4.orig
1474 ? sub/large4.orig
1473 ? sub/normal4.orig
1475 ? sub/normal4.orig
1474 $ cat sub/normal4
1476 $ cat sub/normal4
1475 normal4-modified
1477 normal4-modified
1476 $ cat sub/large4
1478 $ cat sub/large4
1477 large4-modified
1479 large4-modified
1478 $ hg revert -a --no-backup
1480 $ hg revert -a --no-backup
1479 undeleting .hglf/sub2/large6 (glob)
1481 undeleting .hglf/sub2/large6 (glob)
1480 forgetting .hglf/sub2/large8 (glob)
1482 forgetting .hglf/sub2/large8 (glob)
1481 reverting normal3
1483 reverting normal3
1482 $ hg status
1484 $ hg status
1483 ? sub/large4.orig
1485 ? sub/large4.orig
1484 ? sub/normal4.orig
1486 ? sub/normal4.orig
1485 ? sub2/large8
1487 ? sub2/large8
1486 $ cat normal3
1488 $ cat normal3
1487 normal3-modified
1489 normal3-modified
1488 $ cat sub2/large6
1490 $ cat sub2/large6
1489 large6-modified
1491 large6-modified
1490 $ rm sub/*.orig sub2/large8
1492 $ rm sub/*.orig sub2/large8
1491
1493
1492 revert some files to an older revision
1494 revert some files to an older revision
1493 $ hg revert --no-backup -r 8 sub2
1495 $ hg revert --no-backup -r 8 sub2
1494 reverting .hglf/sub2/large6 (glob)
1496 reverting .hglf/sub2/large6 (glob)
1495 $ cat sub2/large6
1497 $ cat sub2/large6
1496 large6
1498 large6
1497 $ hg revert --no-backup -C -r '.^' sub2
1499 $ hg revert --no-backup -C -r '.^' sub2
1498 $ hg revert --no-backup sub2
1500 $ hg revert --no-backup sub2
1499 reverting .hglf/sub2/large6 (glob)
1501 reverting .hglf/sub2/large6 (glob)
1500 $ hg status
1502 $ hg status
1501
1503
1502 "verify --large" actually verifies largefiles
1504 "verify --large" actually verifies largefiles
1503
1505
1504 - Where Do We Come From? What Are We? Where Are We Going?
1506 - Where Do We Come From? What Are We? Where Are We Going?
1505 $ pwd
1507 $ pwd
1506 $TESTTMP/e
1508 $TESTTMP/e
1507 $ hg paths
1509 $ hg paths
1508 default = $TESTTMP/d (glob)
1510 default = $TESTTMP/d (glob)
1509
1511
1510 $ hg verify --large
1512 $ hg verify --large
1511 checking changesets
1513 checking changesets
1512 checking manifests
1514 checking manifests
1513 crosschecking files in changesets and manifests
1515 crosschecking files in changesets and manifests
1514 checking files
1516 checking files
1515 10 files, 10 changesets, 28 total revisions
1517 10 files, 10 changesets, 28 total revisions
1516 searching 1 changesets for largefiles
1518 searching 1 changesets for largefiles
1517 verified existence of 3 revisions of 3 largefiles
1519 verified existence of 3 revisions of 3 largefiles
1518
1520
1519 - introduce missing blob in local store repo and make sure that this is caught:
1521 - introduce missing blob in local store repo and make sure that this is caught:
1520 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1522 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1521 $ hg verify --large
1523 $ hg verify --large
1522 checking changesets
1524 checking changesets
1523 checking manifests
1525 checking manifests
1524 crosschecking files in changesets and manifests
1526 crosschecking files in changesets and manifests
1525 checking files
1527 checking files
1526 10 files, 10 changesets, 28 total revisions
1528 10 files, 10 changesets, 28 total revisions
1527 searching 1 changesets for largefiles
1529 searching 1 changesets for largefiles
1528 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1530 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1529 verified existence of 3 revisions of 3 largefiles
1531 verified existence of 3 revisions of 3 largefiles
1530 [1]
1532 [1]
1531
1533
1532 - introduce corruption and make sure that it is caught when checking content:
1534 - introduce corruption and make sure that it is caught when checking content:
1533 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1535 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1534 $ hg verify -q --large --lfc
1536 $ hg verify -q --large --lfc
1535 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1537 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1536 [1]
1538 [1]
1537
1539
1538 - cleanup
1540 - cleanup
1539 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1541 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1540
1542
1541 - verifying all revisions will fail because we didn't clone all largefiles to d:
1543 - verifying all revisions will fail because we didn't clone all largefiles to d:
1542 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1544 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1543 $ hg verify -q --lfa --lfc
1545 $ hg verify -q --lfa --lfc
1544 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1546 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1545 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1547 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1546 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1548 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1547 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1549 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1548 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1550 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1549 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1551 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1550 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1552 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1551 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1553 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1552 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1554 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1553 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1555 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1554 [1]
1556 [1]
1555
1557
1556 - cleanup
1558 - cleanup
1557 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1559 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1558 $ rm -f .hglf/sub/*.orig
1560 $ rm -f .hglf/sub/*.orig
1559
1561
1560 Update to revision with missing largefile - and make sure it really is missing
1562 Update to revision with missing largefile - and make sure it really is missing
1561
1563
1562 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1564 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1563 $ hg up -r 6
1565 $ hg up -r 6
1564 getting changed largefiles
1566 getting changed largefiles
1565 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1567 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1566 1 largefiles updated, 2 removed
1568 1 largefiles updated, 2 removed
1567 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1569 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1568 $ rm normal3
1570 $ rm normal3
1569 $ echo >> sub/normal4
1571 $ echo >> sub/normal4
1570 $ hg ci -m 'commit with missing files'
1572 $ hg ci -m 'commit with missing files'
1571 Invoking status precommit hook
1573 Invoking status precommit hook
1572 M sub/normal4
1574 M sub/normal4
1573 ! large3
1575 ! large3
1574 ! normal3
1576 ! normal3
1575 created new head
1577 created new head
1576 $ hg st
1578 $ hg st
1577 ! large3
1579 ! large3
1578 ! normal3
1580 ! normal3
1579 $ hg up -r.
1581 $ hg up -r.
1580 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1582 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1581 $ hg st
1583 $ hg st
1582 ! large3
1584 ! large3
1583 ! normal3
1585 ! normal3
1584 $ hg up -Cr.
1586 $ hg up -Cr.
1585 getting changed largefiles
1587 getting changed largefiles
1586 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1588 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1587 0 largefiles updated, 0 removed
1589 0 largefiles updated, 0 removed
1588 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1590 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1589 $ hg st
1591 $ hg st
1590 ! large3
1592 ! large3
1591 $ hg rollback
1593 $ hg rollback
1592 repository tip rolled back to revision 9 (undo commit)
1594 repository tip rolled back to revision 9 (undo commit)
1593 working directory now based on revision 6
1595 working directory now based on revision 6
1594
1596
1595 Merge with revision with missing largefile - and make sure it tries to fetch it.
1597 Merge with revision with missing largefile - and make sure it tries to fetch it.
1596
1598
1597 $ hg up -Cqr null
1599 $ hg up -Cqr null
1598 $ echo f > f
1600 $ echo f > f
1599 $ hg ci -Am branch
1601 $ hg ci -Am branch
1600 adding f
1602 adding f
1601 Invoking status precommit hook
1603 Invoking status precommit hook
1602 A f
1604 A f
1603 created new head
1605 created new head
1604 $ hg merge -r 6
1606 $ hg merge -r 6
1605 getting changed largefiles
1607 getting changed largefiles
1606 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1608 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1607 1 largefiles updated, 0 removed
1609 1 largefiles updated, 0 removed
1608 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1610 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1609 (branch merge, don't forget to commit)
1611 (branch merge, don't forget to commit)
1610
1612
1611 $ hg rollback -q
1613 $ hg rollback -q
1612 $ hg up -Cq
1614 $ hg up -Cq
1613
1615
1614 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1616 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1615
1617
1616 $ hg pull --all-largefiles
1618 $ hg pull --all-largefiles
1617 pulling from $TESTTMP/d (glob)
1619 pulling from $TESTTMP/d (glob)
1618 searching for changes
1620 searching for changes
1619 no changes found
1621 no changes found
1620
1622
1621 Merging does not revert to old versions of largefiles and also check
1623 Merging does not revert to old versions of largefiles and also check
1622 that merging after having pulled from a non-default remote works
1624 that merging after having pulled from a non-default remote works
1623 correctly.
1625 correctly.
1624
1626
1625 $ cd ..
1627 $ cd ..
1626 $ hg clone -r 7 e temp
1628 $ hg clone -r 7 e temp
1627 adding changesets
1629 adding changesets
1628 adding manifests
1630 adding manifests
1629 adding file changes
1631 adding file changes
1630 added 8 changesets with 24 changes to 10 files
1632 added 8 changesets with 24 changes to 10 files
1631 updating to branch default
1633 updating to branch default
1632 getting changed largefiles
1634 getting changed largefiles
1633 3 largefiles updated, 0 removed
1635 3 largefiles updated, 0 removed
1634 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1636 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1635 $ hg clone temp f
1637 $ hg clone temp f
1636 updating to branch default
1638 updating to branch default
1637 getting changed largefiles
1639 getting changed largefiles
1638 3 largefiles updated, 0 removed
1640 3 largefiles updated, 0 removed
1639 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1641 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1640 # Delete the largefiles in the largefiles system cache so that we have an
1642 # Delete the largefiles in the largefiles system cache so that we have an
1641 # opportunity to test that caching after a pull works.
1643 # opportunity to test that caching after a pull works.
1642 $ rm "${USERCACHE}"/*
1644 $ rm "${USERCACHE}"/*
1643 $ cd f
1645 $ cd f
1644 $ echo "large4-merge-test" > sub/large4
1646 $ echo "large4-merge-test" > sub/large4
1645 $ hg commit -m "Modify large4 to test merge"
1647 $ hg commit -m "Modify large4 to test merge"
1646 Invoking status precommit hook
1648 Invoking status precommit hook
1647 M sub/large4
1649 M sub/large4
1648 # Test --cache-largefiles flag
1650 # Test --cache-largefiles flag
1649 $ hg pull --lfrev 'heads(pulled())' ../e
1651 $ hg pull --lfrev 'heads(pulled())' ../e
1650 pulling from ../e
1652 pulling from ../e
1651 searching for changes
1653 searching for changes
1652 adding changesets
1654 adding changesets
1653 adding manifests
1655 adding manifests
1654 adding file changes
1656 adding file changes
1655 added 2 changesets with 4 changes to 4 files (+1 heads)
1657 added 2 changesets with 4 changes to 4 files (+1 heads)
1656 (run 'hg heads' to see heads, 'hg merge' to merge)
1658 (run 'hg heads' to see heads, 'hg merge' to merge)
1657 2 largefiles cached
1659 2 largefiles cached
1658 $ hg merge
1660 $ hg merge
1659 largefile sub/large4 has a merge conflict
1661 largefile sub/large4 has a merge conflict
1660 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1662 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1661 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1663 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1662 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1664 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1663 getting changed largefiles
1665 getting changed largefiles
1664 1 largefiles updated, 0 removed
1666 1 largefiles updated, 0 removed
1665 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1667 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1666 (branch merge, don't forget to commit)
1668 (branch merge, don't forget to commit)
1667 $ hg commit -m "Merge repos e and f"
1669 $ hg commit -m "Merge repos e and f"
1668 Invoking status precommit hook
1670 Invoking status precommit hook
1669 M normal3
1671 M normal3
1670 M sub/normal4
1672 M sub/normal4
1671 M sub2/large6
1673 M sub2/large6
1672 $ cat normal3
1674 $ cat normal3
1673 normal3-modified
1675 normal3-modified
1674 $ cat sub/normal4
1676 $ cat sub/normal4
1675 normal4-modified
1677 normal4-modified
1676 $ cat sub/large4
1678 $ cat sub/large4
1677 large4-merge-test
1679 large4-merge-test
1678 $ cat sub2/large6
1680 $ cat sub2/large6
1679 large6-modified
1681 large6-modified
1680 $ cat sub2/large7
1682 $ cat sub2/large7
1681 large7
1683 large7
1682
1684
1683 Test status after merging with a branch that introduces a new largefile:
1685 Test status after merging with a branch that introduces a new largefile:
1684
1686
1685 $ echo large > large
1687 $ echo large > large
1686 $ hg add --large large
1688 $ hg add --large large
1687 $ hg commit -m 'add largefile'
1689 $ hg commit -m 'add largefile'
1688 Invoking status precommit hook
1690 Invoking status precommit hook
1689 A large
1691 A large
1690 $ hg update -q ".^"
1692 $ hg update -q ".^"
1691 $ echo change >> normal3
1693 $ echo change >> normal3
1692 $ hg commit -m 'some change'
1694 $ hg commit -m 'some change'
1693 Invoking status precommit hook
1695 Invoking status precommit hook
1694 M normal3
1696 M normal3
1695 created new head
1697 created new head
1696 $ hg merge
1698 $ hg merge
1697 getting changed largefiles
1699 getting changed largefiles
1698 1 largefiles updated, 0 removed
1700 1 largefiles updated, 0 removed
1699 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1701 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1700 (branch merge, don't forget to commit)
1702 (branch merge, don't forget to commit)
1701 $ hg status
1703 $ hg status
1702 M large
1704 M large
1703
1705
1704 - make sure update of merge with removed largefiles fails as expected
1706 - make sure update of merge with removed largefiles fails as expected
1705 $ hg rm sub2/large6
1707 $ hg rm sub2/large6
1706 $ hg up -r.
1708 $ hg up -r.
1707 abort: outstanding uncommitted merge
1709 abort: outstanding uncommitted merge
1708 [255]
1710 [255]
1709
1711
1710 - revert should be able to revert files introduced in a pending merge
1712 - revert should be able to revert files introduced in a pending merge
1711 $ hg revert --all -r .
1713 $ hg revert --all -r .
1712 removing .hglf/large (glob)
1714 removing .hglf/large (glob)
1713 undeleting .hglf/sub2/large6 (glob)
1715 undeleting .hglf/sub2/large6 (glob)
1714
1716
1715 Test that a normal file and a largefile with the same name and path cannot
1717 Test that a normal file and a largefile with the same name and path cannot
1716 coexist.
1718 coexist.
1717
1719
1718 $ rm sub2/large7
1720 $ rm sub2/large7
1719 $ echo "largeasnormal" > sub2/large7
1721 $ echo "largeasnormal" > sub2/large7
1720 $ hg add sub2/large7
1722 $ hg add sub2/large7
1721 sub2/large7 already a largefile
1723 sub2/large7 already a largefile
1722
1724
1723 Test that transplanting a largefile change works correctly.
1725 Test that transplanting a largefile change works correctly.
1724
1726
1725 $ cd ..
1727 $ cd ..
1726 $ hg clone -r 8 d g
1728 $ hg clone -r 8 d g
1727 adding changesets
1729 adding changesets
1728 adding manifests
1730 adding manifests
1729 adding file changes
1731 adding file changes
1730 added 9 changesets with 26 changes to 10 files
1732 added 9 changesets with 26 changes to 10 files
1731 updating to branch default
1733 updating to branch default
1732 getting changed largefiles
1734 getting changed largefiles
1733 3 largefiles updated, 0 removed
1735 3 largefiles updated, 0 removed
1734 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1736 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1735 $ cd g
1737 $ cd g
1736 $ hg transplant -s ../d 598410d3eb9a
1738 $ hg transplant -s ../d 598410d3eb9a
1737 searching for changes
1739 searching for changes
1738 searching for changes
1740 searching for changes
1739 adding changesets
1741 adding changesets
1740 adding manifests
1742 adding manifests
1741 adding file changes
1743 adding file changes
1742 added 1 changesets with 2 changes to 2 files
1744 added 1 changesets with 2 changes to 2 files
1743 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1745 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1744 9:598410d3eb9a modify normal file largefile in repo d
1746 9:598410d3eb9a modify normal file largefile in repo d
1745 8:a381d2c8c80e modify normal file and largefile in repo b
1747 8:a381d2c8c80e modify normal file and largefile in repo b
1746 7:daea875e9014 add/edit more largefiles
1748 7:daea875e9014 add/edit more largefiles
1747 6:4355d653f84f edit files yet again
1749 6:4355d653f84f edit files yet again
1748 5:9d5af5072dbd edit files again
1750 5:9d5af5072dbd edit files again
1749 4:74c02385b94c move files
1751 4:74c02385b94c move files
1750 3:9e8fbc4bce62 copy files
1752 3:9e8fbc4bce62 copy files
1751 2:51a0ae4d5864 remove files
1753 2:51a0ae4d5864 remove files
1752 1:ce8896473775 edit files
1754 1:ce8896473775 edit files
1753 0:30d30fe6a5be add files
1755 0:30d30fe6a5be add files
1754 $ cat normal3
1756 $ cat normal3
1755 normal3-modified
1757 normal3-modified
1756 $ cat sub/normal4
1758 $ cat sub/normal4
1757 normal4-modified
1759 normal4-modified
1758 $ cat sub/large4
1760 $ cat sub/large4
1759 large4-modified
1761 large4-modified
1760 $ cat sub2/large6
1762 $ cat sub2/large6
1761 large6-modified
1763 large6-modified
1762 $ cat sub2/large7
1764 $ cat sub2/large7
1763 large7
1765 large7
1764
1766
1765 Cat a largefile
1767 Cat a largefile
1766 $ hg cat normal3
1768 $ hg cat normal3
1767 normal3-modified
1769 normal3-modified
1768 $ hg cat sub/large4
1770 $ hg cat sub/large4
1769 large4-modified
1771 large4-modified
1770 $ rm "${USERCACHE}"/*
1772 $ rm "${USERCACHE}"/*
1771 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1773 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1772 $ cat cat.out
1774 $ cat cat.out
1773 large4-modified
1775 large4-modified
1774 $ rm cat.out
1776 $ rm cat.out
1775 $ hg cat -r a381d2c8c80e normal3
1777 $ hg cat -r a381d2c8c80e normal3
1776 normal3-modified
1778 normal3-modified
1777 $ hg cat -r '.^' normal3
1779 $ hg cat -r '.^' normal3
1778 normal3-modified
1780 normal3-modified
1779 $ hg cat -r '.^' sub/large4 doesntexist
1781 $ hg cat -r '.^' sub/large4 doesntexist
1780 large4-modified
1782 large4-modified
1781 doesntexist: no such file in rev a381d2c8c80e
1783 doesntexist: no such file in rev a381d2c8c80e
1782 $ hg --cwd sub cat -r '.^' large4
1784 $ hg --cwd sub cat -r '.^' large4
1783 large4-modified
1785 large4-modified
1784 $ hg --cwd sub cat -r '.^' ../normal3
1786 $ hg --cwd sub cat -r '.^' ../normal3
1785 normal3-modified
1787 normal3-modified
1786 Cat a standin
1788 Cat a standin
1787 $ hg cat .hglf/sub/large4
1789 $ hg cat .hglf/sub/large4
1788 e166e74c7303192238d60af5a9c4ce9bef0b7928
1790 e166e74c7303192238d60af5a9c4ce9bef0b7928
1789 $ hg cat .hglf/normal3
1791 $ hg cat .hglf/normal3
1790 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1792 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1791 [1]
1793 [1]
1792
1794
1793 Test that renaming a largefile results in correct output for status
1795 Test that renaming a largefile results in correct output for status
1794
1796
1795 $ hg rename sub/large4 large4-renamed
1797 $ hg rename sub/large4 large4-renamed
1796 $ hg commit -m "test rename output"
1798 $ hg commit -m "test rename output"
1797 Invoking status precommit hook
1799 Invoking status precommit hook
1798 A large4-renamed
1800 A large4-renamed
1799 R sub/large4
1801 R sub/large4
1800 $ cat large4-renamed
1802 $ cat large4-renamed
1801 large4-modified
1803 large4-modified
1802 $ cd sub2
1804 $ cd sub2
1803 $ hg rename large6 large6-renamed
1805 $ hg rename large6 large6-renamed
1804 $ hg st
1806 $ hg st
1805 A sub2/large6-renamed
1807 A sub2/large6-renamed
1806 R sub2/large6
1808 R sub2/large6
1807 $ cd ..
1809 $ cd ..
1808
1810
1809 Test --normal flag
1811 Test --normal flag
1810
1812
1811 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1813 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1812 $ hg add --normal --large new-largefile
1814 $ hg add --normal --large new-largefile
1813 abort: --normal cannot be used with --large
1815 abort: --normal cannot be used with --large
1814 [255]
1816 [255]
1815 $ hg add --normal new-largefile
1817 $ hg add --normal new-largefile
1816 new-largefile: up to 69 MB of RAM may be required to manage this file
1818 new-largefile: up to 69 MB of RAM may be required to manage this file
1817 (use 'hg revert new-largefile' to cancel the pending addition)
1819 (use 'hg revert new-largefile' to cancel the pending addition)
1818 $ cd ..
1820 $ cd ..
1819
1821
1820
1822
1821
1823
@@ -1,235 +1,242 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}:{phase} '{desc}' {branches}\n"
9 > tglog = log -G --template "{rev}:{phase} '{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
15
16 $ touch .hg/rebasestate
16 $ touch .hg/rebasestate
17 $ hg sum
17 $ hg sum
18 parent: -1:000000000000 tip (empty repository)
18 parent: -1:000000000000 tip (empty repository)
19 branch: default
19 branch: default
20 commit: (clean)
20 commit: (clean)
21 update: (current)
21 update: (current)
22 abort: .hg/rebasestate is incomplete
22 abort: .hg/rebasestate is incomplete
23 [255]
23 [255]
24 $ rm .hg/rebasestate
24 $ rm .hg/rebasestate
25
25
26 $ echo c1 > common
26 $ echo c1 > common
27 $ hg add common
27 $ hg add common
28 $ hg ci -m C1
28 $ hg ci -m C1
29
29
30 $ echo c2 >> common
30 $ echo c2 >> common
31 $ hg ci -m C2
31 $ hg ci -m C2
32
32
33 $ echo c3 >> common
33 $ echo c3 >> common
34 $ hg ci -m C3
34 $ hg ci -m C3
35
35
36 $ hg up -q -C 1
36 $ hg up -q -C 1
37
37
38 $ echo l1 >> extra
38 $ echo l1 >> extra
39 $ hg add extra
39 $ hg add extra
40 $ hg ci -m L1
40 $ hg ci -m L1
41 created new head
41 created new head
42
42
43 $ sed -e 's/c2/l2/' common > common.new
43 $ sed -e 's/c2/l2/' common > common.new
44 $ mv common.new common
44 $ mv common.new common
45 $ hg ci -m L2
45 $ hg ci -m L2
46
46
47 $ hg phase --force --secret 2
47 $ hg phase --force --secret 2
48
48
49 $ hg tglog
49 $ hg tglog
50 @ 4:draft 'L2'
50 @ 4:draft 'L2'
51 |
51 |
52 o 3:draft 'L1'
52 o 3:draft 'L1'
53 |
53 |
54 | o 2:secret 'C3'
54 | o 2:secret 'C3'
55 |/
55 |/
56 o 1:draft 'C2'
56 o 1:draft 'C2'
57 |
57 |
58 o 0:draft 'C1'
58 o 0:draft 'C1'
59
59
60
60
61 Conflicting rebase:
61 Conflicting rebase:
62
62
63 $ hg rebase -s 3 -d 2
63 $ hg rebase -s 3 -d 2
64 rebasing 3:3163e20567cc "L1"
65 rebasing 4:46f0b057b5c0 "L2" (tip)
64 merging common
66 merging common
65 warning: conflicts during merge.
67 warning: conflicts during merge.
66 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
68 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
67 unresolved conflicts (see hg resolve, then hg rebase --continue)
69 unresolved conflicts (see hg resolve, then hg rebase --continue)
68 [1]
70 [1]
69
71
70 Abort:
72 Abort:
71
73
72 $ hg rebase --abort
74 $ hg rebase --abort
73 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-backup.hg (glob)
75 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-backup.hg (glob)
74 rebase aborted
76 rebase aborted
75
77
76 $ hg tglog
78 $ hg tglog
77 @ 4:draft 'L2'
79 @ 4:draft 'L2'
78 |
80 |
79 o 3:draft 'L1'
81 o 3:draft 'L1'
80 |
82 |
81 | o 2:secret 'C3'
83 | o 2:secret 'C3'
82 |/
84 |/
83 o 1:draft 'C2'
85 o 1:draft 'C2'
84 |
86 |
85 o 0:draft 'C1'
87 o 0:draft 'C1'
86
88
87 Test safety for inconsistent rebase state, which may be created (and
89 Test safety for inconsistent rebase state, which may be created (and
88 forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
90 forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
89 earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
91 earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
90
92
91 $ hg rebase -s 3 -d 2
93 $ hg rebase -s 3 -d 2
94 rebasing 3:3163e20567cc "L1"
95 rebasing 4:46f0b057b5c0 "L2" (tip)
92 merging common
96 merging common
93 warning: conflicts during merge.
97 warning: conflicts during merge.
94 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
98 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
95 unresolved conflicts (see hg resolve, then hg rebase --continue)
99 unresolved conflicts (see hg resolve, then hg rebase --continue)
96 [1]
100 [1]
97
101
98 $ mv .hg/rebasestate .hg/rebasestate.back
102 $ mv .hg/rebasestate .hg/rebasestate.back
99 $ hg update --quiet --clean 2
103 $ hg update --quiet --clean 2
100 $ hg --config extensions.mq= strip --quiet "destination()"
104 $ hg --config extensions.mq= strip --quiet "destination()"
101 $ mv .hg/rebasestate.back .hg/rebasestate
105 $ mv .hg/rebasestate.back .hg/rebasestate
102
106
103 $ hg rebase --continue
107 $ hg rebase --continue
104 abort: cannot continue inconsistent rebase
108 abort: cannot continue inconsistent rebase
105 (use "hg rebase --abort" to clear broken state)
109 (use "hg rebase --abort" to clear broken state)
106 [255]
110 [255]
107 $ hg summary | grep '^rebase: '
111 $ hg summary | grep '^rebase: '
108 rebase: (use "hg rebase --abort" to clear broken state)
112 rebase: (use "hg rebase --abort" to clear broken state)
109 $ hg rebase --abort
113 $ hg rebase --abort
110 rebase aborted (no revision is removed, only broken state is cleared)
114 rebase aborted (no revision is removed, only broken state is cleared)
111
115
112 $ cd ..
116 $ cd ..
113
117
114
118
115 Construct new repo:
119 Construct new repo:
116
120
117 $ hg init b
121 $ hg init b
118 $ cd b
122 $ cd b
119
123
120 $ echo a > a
124 $ echo a > a
121 $ hg ci -Am A
125 $ hg ci -Am A
122 adding a
126 adding a
123
127
124 $ echo b > b
128 $ echo b > b
125 $ hg ci -Am B
129 $ hg ci -Am B
126 adding b
130 adding b
127
131
128 $ echo c > c
132 $ echo c > c
129 $ hg ci -Am C
133 $ hg ci -Am C
130 adding c
134 adding c
131
135
132 $ hg up -q 0
136 $ hg up -q 0
133
137
134 $ echo b > b
138 $ echo b > b
135 $ hg ci -Am 'B bis'
139 $ hg ci -Am 'B bis'
136 adding b
140 adding b
137 created new head
141 created new head
138
142
139 $ echo c1 > c
143 $ echo c1 > c
140 $ hg ci -Am C1
144 $ hg ci -Am C1
141 adding c
145 adding c
142
146
143 $ hg phase --force --secret 1
147 $ hg phase --force --secret 1
144 $ hg phase --public 1
148 $ hg phase --public 1
145
149
146 Rebase and abort without generating new changesets:
150 Rebase and abort without generating new changesets:
147
151
148 $ hg tglog
152 $ hg tglog
149 @ 4:draft 'C1'
153 @ 4:draft 'C1'
150 |
154 |
151 o 3:draft 'B bis'
155 o 3:draft 'B bis'
152 |
156 |
153 | o 2:secret 'C'
157 | o 2:secret 'C'
154 | |
158 | |
155 | o 1:public 'B'
159 | o 1:public 'B'
156 |/
160 |/
157 o 0:public 'A'
161 o 0:public 'A'
158
162
159 $ hg rebase -b 4 -d 2
163 $ hg rebase -b 4 -d 2
164 rebasing 3:a6484957d6b9 "B bis"
165 rebasing 4:145842775fec "C1" (tip)
160 merging c
166 merging c
161 warning: conflicts during merge.
167 warning: conflicts during merge.
162 merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
168 merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
163 unresolved conflicts (see hg resolve, then hg rebase --continue)
169 unresolved conflicts (see hg resolve, then hg rebase --continue)
164 [1]
170 [1]
165
171
166 $ hg tglog
172 $ hg tglog
167 @ 4:draft 'C1'
173 @ 4:draft 'C1'
168 |
174 |
169 o 3:draft 'B bis'
175 o 3:draft 'B bis'
170 |
176 |
171 | @ 2:secret 'C'
177 | @ 2:secret 'C'
172 | |
178 | |
173 | o 1:public 'B'
179 | o 1:public 'B'
174 |/
180 |/
175 o 0:public 'A'
181 o 0:public 'A'
176
182
177 $ hg rebase -a
183 $ hg rebase -a
178 rebase aborted
184 rebase aborted
179
185
180 $ hg tglog
186 $ hg tglog
181 @ 4:draft 'C1'
187 @ 4:draft 'C1'
182 |
188 |
183 o 3:draft 'B bis'
189 o 3:draft 'B bis'
184 |
190 |
185 | o 2:secret 'C'
191 | o 2:secret 'C'
186 | |
192 | |
187 | o 1:public 'B'
193 | o 1:public 'B'
188 |/
194 |/
189 o 0:public 'A'
195 o 0:public 'A'
190
196
191
197
192 $ cd ..
198 $ cd ..
193
199
194 rebase abort should not leave working copy in a merge state if tip-1 is public
200 rebase abort should not leave working copy in a merge state if tip-1 is public
195 (issue4082)
201 (issue4082)
196
202
197 $ hg init abortpublic
203 $ hg init abortpublic
198 $ cd abortpublic
204 $ cd abortpublic
199 $ echo a > a && hg ci -Aqm a
205 $ echo a > a && hg ci -Aqm a
200 $ hg book master
206 $ hg book master
201 $ hg book foo
207 $ hg book foo
202 $ echo b > b && hg ci -Aqm b
208 $ echo b > b && hg ci -Aqm b
203 $ hg up -q master
209 $ hg up -q master
204 $ echo c > c && hg ci -Aqm c
210 $ echo c > c && hg ci -Aqm c
205 $ hg phase -p -r .
211 $ hg phase -p -r .
206 $ hg up -q foo
212 $ hg up -q foo
207 $ echo C > c && hg ci -Aqm C
213 $ echo C > c && hg ci -Aqm C
208 $ hg log -G --template "{rev} {desc} {bookmarks}"
214 $ hg log -G --template "{rev} {desc} {bookmarks}"
209 @ 3 C foo
215 @ 3 C foo
210 |
216 |
211 | o 2 c master
217 | o 2 c master
212 | |
218 | |
213 o | 1 b
219 o | 1 b
214 |/
220 |/
215 o 0 a
221 o 0 a
216
222
217
223
218 $ hg rebase -d master -r foo
224 $ hg rebase -d master -r foo
225 rebasing 3:6c0f977a22d8 "C" (tip foo)
219 merging c
226 merging c
220 warning: conflicts during merge.
227 warning: conflicts during merge.
221 merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
228 merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
222 unresolved conflicts (see hg resolve, then hg rebase --continue)
229 unresolved conflicts (see hg resolve, then hg rebase --continue)
223 [1]
230 [1]
224 $ hg rebase --abort
231 $ hg rebase --abort
225 rebase aborted
232 rebase aborted
226 $ hg log -G --template "{rev} {desc} {bookmarks}"
233 $ hg log -G --template "{rev} {desc} {bookmarks}"
227 @ 3 C foo
234 @ 3 C foo
228 |
235 |
229 | o 2 c master
236 | o 2 c master
230 | |
237 | |
231 o | 1 b
238 o | 1 b
232 |/
239 |/
233 o 0 a
240 o 0 a
234
241
235 $ cd ..
242 $ cd ..
@@ -1,201 +1,212 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}' bookmarks: {bookmarks}\n"
9 > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
10 > EOF
10 > EOF
11
11
12 Create a repo with several bookmarks
12 Create a repo with several bookmarks
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15
15
16 $ echo a > a
16 $ echo a > a
17 $ hg ci -Am A
17 $ hg ci -Am A
18 adding a
18 adding a
19
19
20 $ echo b > b
20 $ echo b > b
21 $ hg ci -Am B
21 $ hg ci -Am B
22 adding b
22 adding b
23 $ hg book 'X'
23 $ hg book 'X'
24 $ hg book 'Y'
24 $ hg book 'Y'
25
25
26 $ echo c > c
26 $ echo c > c
27 $ hg ci -Am C
27 $ hg ci -Am C
28 adding c
28 adding c
29 $ hg book 'Z'
29 $ hg book 'Z'
30
30
31 $ hg up -q 0
31 $ hg up -q 0
32
32
33 $ echo d > d
33 $ echo d > d
34 $ hg ci -Am D
34 $ hg ci -Am D
35 adding d
35 adding d
36 created new head
36 created new head
37
37
38 $ hg book W
38 $ hg book W
39
39
40 $ hg tglog
40 $ hg tglog
41 @ 3: 'D' bookmarks: W
41 @ 3: 'D' bookmarks: W
42 |
42 |
43 | o 2: 'C' bookmarks: Y Z
43 | o 2: 'C' bookmarks: Y Z
44 | |
44 | |
45 | o 1: 'B' bookmarks: X
45 | o 1: 'B' bookmarks: X
46 |/
46 |/
47 o 0: 'A' bookmarks:
47 o 0: 'A' bookmarks:
48
48
49
49
50 Move only rebased bookmarks
50 Move only rebased bookmarks
51
51
52 $ cd ..
52 $ cd ..
53 $ hg clone -q a a1
53 $ hg clone -q a a1
54
54
55 $ cd a1
55 $ cd a1
56 $ hg up -q Z
56 $ hg up -q Z
57
57
58 Test deleting divergent bookmarks from dest (issue3685)
58 Test deleting divergent bookmarks from dest (issue3685)
59
59
60 $ hg book -r 3 Z@diverge
60 $ hg book -r 3 Z@diverge
61
61
62 ... and also test that bookmarks not on dest or not being moved aren't deleted
62 ... and also test that bookmarks not on dest or not being moved aren't deleted
63
63
64 $ hg book -r 3 X@diverge
64 $ hg book -r 3 X@diverge
65 $ hg book -r 0 Y@diverge
65 $ hg book -r 0 Y@diverge
66
66
67 $ hg tglog
67 $ hg tglog
68 o 3: 'D' bookmarks: W X@diverge Z@diverge
68 o 3: 'D' bookmarks: W X@diverge Z@diverge
69 |
69 |
70 | @ 2: 'C' bookmarks: Y Z
70 | @ 2: 'C' bookmarks: Y Z
71 | |
71 | |
72 | o 1: 'B' bookmarks: X
72 | o 1: 'B' bookmarks: X
73 |/
73 |/
74 o 0: 'A' bookmarks: Y@diverge
74 o 0: 'A' bookmarks: Y@diverge
75
75
76 $ hg rebase -s Y -d 3
76 $ hg rebase -s Y -d 3
77 rebasing 2:49cb3485fa0c "C" (Y Z)
77 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/49cb3485fa0c-backup.hg (glob)
78 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/49cb3485fa0c-backup.hg (glob)
78
79
79 $ hg tglog
80 $ hg tglog
80 @ 3: 'C' bookmarks: Y Z
81 @ 3: 'C' bookmarks: Y Z
81 |
82 |
82 o 2: 'D' bookmarks: W X@diverge
83 o 2: 'D' bookmarks: W X@diverge
83 |
84 |
84 | o 1: 'B' bookmarks: X
85 | o 1: 'B' bookmarks: X
85 |/
86 |/
86 o 0: 'A' bookmarks: Y@diverge
87 o 0: 'A' bookmarks: Y@diverge
87
88
88 Do not try to keep active but deleted divergent bookmark
89 Do not try to keep active but deleted divergent bookmark
89
90
90 $ cd ..
91 $ cd ..
91 $ hg clone -q a a4
92 $ hg clone -q a a4
92
93
93 $ cd a4
94 $ cd a4
94 $ hg up -q 2
95 $ hg up -q 2
95 $ hg book W@diverge
96 $ hg book W@diverge
96
97
97 $ hg rebase -s W -d .
98 $ hg rebase -s W -d .
99 rebasing 3:41acb9dca9eb "D" (tip W)
98 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/41acb9dca9eb-backup.hg (glob)
100 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/41acb9dca9eb-backup.hg (glob)
99
101
100 $ hg bookmarks
102 $ hg bookmarks
101 W 3:0d3554f74897
103 W 3:0d3554f74897
102 X 1:6c81ed0049f8
104 X 1:6c81ed0049f8
103 Y 2:49cb3485fa0c
105 Y 2:49cb3485fa0c
104 Z 2:49cb3485fa0c
106 Z 2:49cb3485fa0c
105
107
106 Keep bookmarks to the correct rebased changeset
108 Keep bookmarks to the correct rebased changeset
107
109
108 $ cd ..
110 $ cd ..
109 $ hg clone -q a a2
111 $ hg clone -q a a2
110
112
111 $ cd a2
113 $ cd a2
112 $ hg up -q Z
114 $ hg up -q Z
113
115
114 $ hg rebase -s 1 -d 3
116 $ hg rebase -s 1 -d 3
117 rebasing 1:6c81ed0049f8 "B" (X)
118 rebasing 2:49cb3485fa0c "C" (Y Z)
115 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/6c81ed0049f8-backup.hg (glob)
119 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/6c81ed0049f8-backup.hg (glob)
116
120
117 $ hg tglog
121 $ hg tglog
118 @ 3: 'C' bookmarks: Y Z
122 @ 3: 'C' bookmarks: Y Z
119 |
123 |
120 o 2: 'B' bookmarks: X
124 o 2: 'B' bookmarks: X
121 |
125 |
122 o 1: 'D' bookmarks: W
126 o 1: 'D' bookmarks: W
123 |
127 |
124 o 0: 'A' bookmarks:
128 o 0: 'A' bookmarks:
125
129
126
130
127 Keep active bookmark on the correct changeset
131 Keep active bookmark on the correct changeset
128
132
129 $ cd ..
133 $ cd ..
130 $ hg clone -q a a3
134 $ hg clone -q a a3
131
135
132 $ cd a3
136 $ cd a3
133 $ hg up -q X
137 $ hg up -q X
134
138
135 $ hg rebase -d W
139 $ hg rebase -d W
140 rebasing 1:6c81ed0049f8 "B" (X)
141 rebasing 2:49cb3485fa0c "C" (Y Z)
136 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/6c81ed0049f8-backup.hg (glob)
142 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/6c81ed0049f8-backup.hg (glob)
137
143
138 $ hg tglog
144 $ hg tglog
139 o 3: 'C' bookmarks: Y Z
145 o 3: 'C' bookmarks: Y Z
140 |
146 |
141 @ 2: 'B' bookmarks: X
147 @ 2: 'B' bookmarks: X
142 |
148 |
143 o 1: 'D' bookmarks: W
149 o 1: 'D' bookmarks: W
144 |
150 |
145 o 0: 'A' bookmarks:
151 o 0: 'A' bookmarks:
146
152
147 $ hg bookmarks
153 $ hg bookmarks
148 W 1:41acb9dca9eb
154 W 1:41acb9dca9eb
149 * X 2:e926fccfa8ec
155 * X 2:e926fccfa8ec
150 Y 3:3d5fa227f4b5
156 Y 3:3d5fa227f4b5
151 Z 3:3d5fa227f4b5
157 Z 3:3d5fa227f4b5
152
158
153 rebase --continue with bookmarks present (issue3802)
159 rebase --continue with bookmarks present (issue3802)
154
160
155 $ hg up 2
161 $ hg up 2
156 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 (leaving bookmark X)
163 (leaving bookmark X)
158 $ echo 'C' > c
164 $ echo 'C' > c
159 $ hg add c
165 $ hg add c
160 $ hg ci -m 'other C'
166 $ hg ci -m 'other C'
161 created new head
167 created new head
162 $ hg up 3
168 $ hg up 3
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 $ hg rebase
170 $ hg rebase
171 rebasing 3:3d5fa227f4b5 "C" (Y Z)
165 merging c
172 merging c
166 warning: conflicts during merge.
173 warning: conflicts during merge.
167 merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
174 merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
168 unresolved conflicts (see hg resolve, then hg rebase --continue)
175 unresolved conflicts (see hg resolve, then hg rebase --continue)
169 [1]
176 [1]
170 $ echo 'c' > c
177 $ echo 'c' > c
171 $ hg resolve --mark c
178 $ hg resolve --mark c
172 (no more unresolved files)
179 (no more unresolved files)
173 $ hg rebase --continue
180 $ hg rebase --continue
181 rebasing 3:3d5fa227f4b5 "C" (Y Z)
174 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-backup.hg (glob)
182 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/3d5fa227f4b5-backup.hg (glob)
175 $ hg tglog
183 $ hg tglog
176 @ 4: 'C' bookmarks: Y Z
184 @ 4: 'C' bookmarks: Y Z
177 |
185 |
178 o 3: 'other C' bookmarks:
186 o 3: 'other C' bookmarks:
179 |
187 |
180 o 2: 'B' bookmarks: X
188 o 2: 'B' bookmarks: X
181 |
189 |
182 o 1: 'D' bookmarks: W
190 o 1: 'D' bookmarks: W
183 |
191 |
184 o 0: 'A' bookmarks:
192 o 0: 'A' bookmarks:
185
193
186
194
187 ensure that bookmarks given the names of revset functions can be used
195 ensure that bookmarks given the names of revset functions can be used
188 as --rev arguments (issue3950)
196 as --rev arguments (issue3950)
189
197
190 $ hg update -q 3
198 $ hg update -q 3
191 $ echo bimble > bimble
199 $ echo bimble > bimble
192 $ hg add bimble
200 $ hg add bimble
193 $ hg commit -q -m 'bisect'
201 $ hg commit -q -m 'bisect'
194 $ echo e >> bimble
202 $ echo e >> bimble
195 $ hg ci -m bisect2
203 $ hg ci -m bisect2
196 $ echo e >> bimble
204 $ echo e >> bimble
197 $ hg ci -m bisect3
205 $ hg ci -m bisect3
198 $ hg book bisect
206 $ hg book bisect
199 $ hg update -q Y
207 $ hg update -q Y
200 $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z
208 $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z
209 rebasing 5:345c90f326a4 "bisect"
210 rebasing 6:f677a2907404 "bisect2"
211 rebasing 7:325c16001345 "bisect3" (tip bisect)
201 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-backup.hg (glob)
212 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-backup.hg (glob)
@@ -1,480 +1,487 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > mq=
4 > mq=
5 >
5 >
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
11 > theads = heads --template "{rev}: '{desc}' {branches}\n"
11 > theads = heads --template "{rev}: '{desc}' {branches}\n"
12 > EOF
12 > EOF
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16
16
17 $ echo a > a
17 $ echo a > a
18 $ hg ci -Am A
18 $ hg ci -Am A
19 adding a
19 adding a
20
20
21 $ hg branch branch1
21 $ hg branch branch1
22 marked working directory as branch branch1
22 marked working directory as branch branch1
23 (branches are permanent and global, did you want a bookmark?)
23 (branches are permanent and global, did you want a bookmark?)
24 $ hg ci -m 'branch1'
24 $ hg ci -m 'branch1'
25
25
26 $ echo b > b
26 $ echo b > b
27 $ hg ci -Am B
27 $ hg ci -Am B
28 adding b
28 adding b
29
29
30 $ hg up -q 0
30 $ hg up -q 0
31
31
32 $ hg branch branch2
32 $ hg branch branch2
33 marked working directory as branch branch2
33 marked working directory as branch branch2
34 (branches are permanent and global, did you want a bookmark?)
34 (branches are permanent and global, did you want a bookmark?)
35 $ hg ci -m 'branch2'
35 $ hg ci -m 'branch2'
36
36
37 $ echo c > C
37 $ echo c > C
38 $ hg ci -Am C
38 $ hg ci -Am C
39 adding C
39 adding C
40
40
41 $ hg up -q 2
41 $ hg up -q 2
42
42
43 $ hg branch -f branch2
43 $ hg branch -f branch2
44 marked working directory as branch branch2
44 marked working directory as branch branch2
45 (branches are permanent and global, did you want a bookmark?)
45 (branches are permanent and global, did you want a bookmark?)
46 $ echo d > d
46 $ echo d > d
47 $ hg ci -Am D
47 $ hg ci -Am D
48 adding d
48 adding d
49 created new head
49 created new head
50
50
51 $ echo e > e
51 $ echo e > e
52 $ hg ci -Am E
52 $ hg ci -Am E
53 adding e
53 adding e
54
54
55 $ hg update default
55 $ hg update default
56 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
56 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
57
57
58 $ hg branch branch3
58 $ hg branch branch3
59 marked working directory as branch branch3
59 marked working directory as branch branch3
60 (branches are permanent and global, did you want a bookmark?)
60 (branches are permanent and global, did you want a bookmark?)
61 $ hg ci -m 'branch3'
61 $ hg ci -m 'branch3'
62
62
63 $ echo f > f
63 $ echo f > f
64 $ hg ci -Am F
64 $ hg ci -Am F
65 adding f
65 adding f
66
66
67 $ cd ..
67 $ cd ..
68
68
69
69
70 Rebase part of branch2 (5-6) onto branch3 (8):
70 Rebase part of branch2 (5-6) onto branch3 (8):
71
71
72 $ hg clone -q -u . a a1
72 $ hg clone -q -u . a a1
73 $ cd a1
73 $ cd a1
74
74
75 $ hg tglog
75 $ hg tglog
76 @ 8: 'F' branch3
76 @ 8: 'F' branch3
77 |
77 |
78 o 7: 'branch3' branch3
78 o 7: 'branch3' branch3
79 |
79 |
80 | o 6: 'E' branch2
80 | o 6: 'E' branch2
81 | |
81 | |
82 | o 5: 'D' branch2
82 | o 5: 'D' branch2
83 | |
83 | |
84 | | o 4: 'C' branch2
84 | | o 4: 'C' branch2
85 | | |
85 | | |
86 +---o 3: 'branch2' branch2
86 +---o 3: 'branch2' branch2
87 | |
87 | |
88 | o 2: 'B' branch1
88 | o 2: 'B' branch1
89 | |
89 | |
90 | o 1: 'branch1' branch1
90 | o 1: 'branch1' branch1
91 |/
91 |/
92 o 0: 'A'
92 o 0: 'A'
93
93
94 $ hg branches
94 $ hg branches
95 branch3 8:4666b71e8e32
95 branch3 8:4666b71e8e32
96 branch2 6:5097051d331d
96 branch2 6:5097051d331d
97 branch1 2:0a03079c47fd (inactive)
97 branch1 2:0a03079c47fd (inactive)
98 default 0:1994f17a630e (inactive)
98 default 0:1994f17a630e (inactive)
99
99
100 $ hg theads
100 $ hg theads
101 8: 'F' branch3
101 8: 'F' branch3
102 6: 'E' branch2
102 6: 'E' branch2
103 4: 'C' branch2
103 4: 'C' branch2
104 2: 'B' branch1
104 2: 'B' branch1
105 0: 'A'
105 0: 'A'
106
106
107 $ hg rebase -s 5 -d 8
107 $ hg rebase -s 5 -d 8
108 rebasing 5:635859577d0b "D"
109 rebasing 6:5097051d331d "E"
108 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/635859577d0b-backup.hg (glob)
110 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/635859577d0b-backup.hg (glob)
109
111
110 $ hg branches
112 $ hg branches
111 branch3 8:466cdfb14b62
113 branch3 8:466cdfb14b62
112 branch2 4:e4fdb121d036
114 branch2 4:e4fdb121d036
113 branch1 2:0a03079c47fd
115 branch1 2:0a03079c47fd
114 default 0:1994f17a630e (inactive)
116 default 0:1994f17a630e (inactive)
115
117
116 $ hg theads
118 $ hg theads
117 8: 'E' branch3
119 8: 'E' branch3
118 4: 'C' branch2
120 4: 'C' branch2
119 2: 'B' branch1
121 2: 'B' branch1
120 0: 'A'
122 0: 'A'
121
123
122 $ hg tglog
124 $ hg tglog
123 o 8: 'E' branch3
125 o 8: 'E' branch3
124 |
126 |
125 o 7: 'D' branch3
127 o 7: 'D' branch3
126 |
128 |
127 @ 6: 'F' branch3
129 @ 6: 'F' branch3
128 |
130 |
129 o 5: 'branch3' branch3
131 o 5: 'branch3' branch3
130 |
132 |
131 | o 4: 'C' branch2
133 | o 4: 'C' branch2
132 | |
134 | |
133 | o 3: 'branch2' branch2
135 | o 3: 'branch2' branch2
134 |/
136 |/
135 | o 2: 'B' branch1
137 | o 2: 'B' branch1
136 | |
138 | |
137 | o 1: 'branch1' branch1
139 | o 1: 'branch1' branch1
138 |/
140 |/
139 o 0: 'A'
141 o 0: 'A'
140
142
141 $ cd ..
143 $ cd ..
142
144
143
145
144 Rebase head of branch3 (8) onto branch2 (6):
146 Rebase head of branch3 (8) onto branch2 (6):
145
147
146 $ hg clone -q -u . a a2
148 $ hg clone -q -u . a a2
147 $ cd a2
149 $ cd a2
148
150
149 $ hg tglog
151 $ hg tglog
150 @ 8: 'F' branch3
152 @ 8: 'F' branch3
151 |
153 |
152 o 7: 'branch3' branch3
154 o 7: 'branch3' branch3
153 |
155 |
154 | o 6: 'E' branch2
156 | o 6: 'E' branch2
155 | |
157 | |
156 | o 5: 'D' branch2
158 | o 5: 'D' branch2
157 | |
159 | |
158 | | o 4: 'C' branch2
160 | | o 4: 'C' branch2
159 | | |
161 | | |
160 +---o 3: 'branch2' branch2
162 +---o 3: 'branch2' branch2
161 | |
163 | |
162 | o 2: 'B' branch1
164 | o 2: 'B' branch1
163 | |
165 | |
164 | o 1: 'branch1' branch1
166 | o 1: 'branch1' branch1
165 |/
167 |/
166 o 0: 'A'
168 o 0: 'A'
167
169
168 $ hg rebase -s 8 -d 6
170 $ hg rebase -s 8 -d 6
171 rebasing 8:4666b71e8e32 "F" (tip)
169 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/4666b71e8e32-backup.hg (glob)
172 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/4666b71e8e32-backup.hg (glob)
170
173
171 $ hg branches
174 $ hg branches
172 branch2 8:6b4bdc1b5ac0
175 branch2 8:6b4bdc1b5ac0
173 branch3 7:653b9feb4616
176 branch3 7:653b9feb4616
174 branch1 2:0a03079c47fd (inactive)
177 branch1 2:0a03079c47fd (inactive)
175 default 0:1994f17a630e (inactive)
178 default 0:1994f17a630e (inactive)
176
179
177 $ hg theads
180 $ hg theads
178 8: 'F' branch2
181 8: 'F' branch2
179 7: 'branch3' branch3
182 7: 'branch3' branch3
180 4: 'C' branch2
183 4: 'C' branch2
181 2: 'B' branch1
184 2: 'B' branch1
182 0: 'A'
185 0: 'A'
183
186
184 $ hg tglog
187 $ hg tglog
185 @ 8: 'F' branch2
188 @ 8: 'F' branch2
186 |
189 |
187 | o 7: 'branch3' branch3
190 | o 7: 'branch3' branch3
188 | |
191 | |
189 o | 6: 'E' branch2
192 o | 6: 'E' branch2
190 | |
193 | |
191 o | 5: 'D' branch2
194 o | 5: 'D' branch2
192 | |
195 | |
193 | | o 4: 'C' branch2
196 | | o 4: 'C' branch2
194 | | |
197 | | |
195 | | o 3: 'branch2' branch2
198 | | o 3: 'branch2' branch2
196 | |/
199 | |/
197 o | 2: 'B' branch1
200 o | 2: 'B' branch1
198 | |
201 | |
199 o | 1: 'branch1' branch1
202 o | 1: 'branch1' branch1
200 |/
203 |/
201 o 0: 'A'
204 o 0: 'A'
202
205
203 $ hg verify -q
206 $ hg verify -q
204
207
205 $ cd ..
208 $ cd ..
206
209
207
210
208 Rebase entire branch3 (7-8) onto branch2 (6):
211 Rebase entire branch3 (7-8) onto branch2 (6):
209
212
210 $ hg clone -q -u . a a3
213 $ hg clone -q -u . a a3
211 $ cd a3
214 $ cd a3
212
215
213 $ hg tglog
216 $ hg tglog
214 @ 8: 'F' branch3
217 @ 8: 'F' branch3
215 |
218 |
216 o 7: 'branch3' branch3
219 o 7: 'branch3' branch3
217 |
220 |
218 | o 6: 'E' branch2
221 | o 6: 'E' branch2
219 | |
222 | |
220 | o 5: 'D' branch2
223 | o 5: 'D' branch2
221 | |
224 | |
222 | | o 4: 'C' branch2
225 | | o 4: 'C' branch2
223 | | |
226 | | |
224 +---o 3: 'branch2' branch2
227 +---o 3: 'branch2' branch2
225 | |
228 | |
226 | o 2: 'B' branch1
229 | o 2: 'B' branch1
227 | |
230 | |
228 | o 1: 'branch1' branch1
231 | o 1: 'branch1' branch1
229 |/
232 |/
230 o 0: 'A'
233 o 0: 'A'
231
234
232 $ hg rebase -s 7 -d 6
235 $ hg rebase -s 7 -d 6
236 rebasing 7:653b9feb4616 "branch3"
237 rebasing 8:4666b71e8e32 "F" (tip)
233 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/653b9feb4616-backup.hg (glob)
238 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/653b9feb4616-backup.hg (glob)
234
239
235 $ hg branches
240 $ hg branches
236 branch2 7:6b4bdc1b5ac0
241 branch2 7:6b4bdc1b5ac0
237 branch1 2:0a03079c47fd (inactive)
242 branch1 2:0a03079c47fd (inactive)
238 default 0:1994f17a630e (inactive)
243 default 0:1994f17a630e (inactive)
239
244
240 $ hg theads
245 $ hg theads
241 7: 'F' branch2
246 7: 'F' branch2
242 4: 'C' branch2
247 4: 'C' branch2
243 2: 'B' branch1
248 2: 'B' branch1
244 0: 'A'
249 0: 'A'
245
250
246 $ hg tglog
251 $ hg tglog
247 @ 7: 'F' branch2
252 @ 7: 'F' branch2
248 |
253 |
249 o 6: 'E' branch2
254 o 6: 'E' branch2
250 |
255 |
251 o 5: 'D' branch2
256 o 5: 'D' branch2
252 |
257 |
253 | o 4: 'C' branch2
258 | o 4: 'C' branch2
254 | |
259 | |
255 | o 3: 'branch2' branch2
260 | o 3: 'branch2' branch2
256 | |
261 | |
257 o | 2: 'B' branch1
262 o | 2: 'B' branch1
258 | |
263 | |
259 o | 1: 'branch1' branch1
264 o | 1: 'branch1' branch1
260 |/
265 |/
261 o 0: 'A'
266 o 0: 'A'
262
267
263 $ hg verify -q
268 $ hg verify -q
264
269
265 Stripping multiple branches in one go bypasses the fast-case code to
270 Stripping multiple branches in one go bypasses the fast-case code to
266 update the branch cache.
271 update the branch cache.
267
272
268 $ hg strip 2
273 $ hg strip 2
269 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
274 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
270 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/0a03079c47fd-backup.hg (glob)
275 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/0a03079c47fd-backup.hg (glob)
271
276
272 $ hg tglog
277 $ hg tglog
273 o 3: 'C' branch2
278 o 3: 'C' branch2
274 |
279 |
275 o 2: 'branch2' branch2
280 o 2: 'branch2' branch2
276 |
281 |
277 | @ 1: 'branch1' branch1
282 | @ 1: 'branch1' branch1
278 |/
283 |/
279 o 0: 'A'
284 o 0: 'A'
280
285
281
286
282 $ hg branches
287 $ hg branches
283 branch2 3:e4fdb121d036
288 branch2 3:e4fdb121d036
284 branch1 1:63379ac49655
289 branch1 1:63379ac49655
285 default 0:1994f17a630e (inactive)
290 default 0:1994f17a630e (inactive)
286
291
287 $ hg theads
292 $ hg theads
288 3: 'C' branch2
293 3: 'C' branch2
289 1: 'branch1' branch1
294 1: 'branch1' branch1
290 0: 'A'
295 0: 'A'
291
296
292 Fast path branchcache code should not be invoked if branches stripped is not
297 Fast path branchcache code should not be invoked if branches stripped is not
293 the same as branches remaining.
298 the same as branches remaining.
294
299
295 $ hg init b
300 $ hg init b
296 $ cd b
301 $ cd b
297
302
298 $ hg branch branch1
303 $ hg branch branch1
299 marked working directory as branch branch1
304 marked working directory as branch branch1
300 (branches are permanent and global, did you want a bookmark?)
305 (branches are permanent and global, did you want a bookmark?)
301 $ hg ci -m 'branch1'
306 $ hg ci -m 'branch1'
302
307
303 $ hg branch branch2
308 $ hg branch branch2
304 marked working directory as branch branch2
309 marked working directory as branch branch2
305 (branches are permanent and global, did you want a bookmark?)
310 (branches are permanent and global, did you want a bookmark?)
306 $ hg ci -m 'branch2'
311 $ hg ci -m 'branch2'
307
312
308 $ hg branch -f branch1
313 $ hg branch -f branch1
309 marked working directory as branch branch1
314 marked working directory as branch branch1
310 (branches are permanent and global, did you want a bookmark?)
315 (branches are permanent and global, did you want a bookmark?)
311
316
312 $ echo a > A
317 $ echo a > A
313 $ hg ci -Am A
318 $ hg ci -Am A
314 adding A
319 adding A
315 created new head
320 created new head
316
321
317 $ hg tglog
322 $ hg tglog
318 @ 2: 'A' branch1
323 @ 2: 'A' branch1
319 |
324 |
320 o 1: 'branch2' branch2
325 o 1: 'branch2' branch2
321 |
326 |
322 o 0: 'branch1' branch1
327 o 0: 'branch1' branch1
323
328
324
329
325 $ hg theads
330 $ hg theads
326 2: 'A' branch1
331 2: 'A' branch1
327 1: 'branch2' branch2
332 1: 'branch2' branch2
328
333
329 $ hg strip 2
334 $ hg strip 2
330 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
335 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
331 saved backup bundle to $TESTTMP/a3/b/.hg/strip-backup/a5b4b27ed7b4-backup.hg (glob)
336 saved backup bundle to $TESTTMP/a3/b/.hg/strip-backup/a5b4b27ed7b4-backup.hg (glob)
332
337
333 $ hg theads
338 $ hg theads
334 1: 'branch2' branch2
339 1: 'branch2' branch2
335 0: 'branch1' branch1
340 0: 'branch1' branch1
336
341
337
342
338 Make sure requesting to strip a revision already stripped does not confuse things.
343 Make sure requesting to strip a revision already stripped does not confuse things.
339 Try both orders.
344 Try both orders.
340
345
341 $ cd ..
346 $ cd ..
342
347
343 $ hg init c
348 $ hg init c
344 $ cd c
349 $ cd c
345
350
346 $ echo a > a
351 $ echo a > a
347 $ hg ci -Am A
352 $ hg ci -Am A
348 adding a
353 adding a
349 $ echo b > b
354 $ echo b > b
350 $ hg ci -Am B
355 $ hg ci -Am B
351 adding b
356 adding b
352 $ echo c > c
357 $ echo c > c
353 $ hg ci -Am C
358 $ hg ci -Am C
354 adding c
359 adding c
355 $ echo d > d
360 $ echo d > d
356 $ hg ci -Am D
361 $ hg ci -Am D
357 adding d
362 adding d
358 $ echo e > e
363 $ echo e > e
359 $ hg ci -Am E
364 $ hg ci -Am E
360 adding e
365 adding e
361
366
362 $ hg tglog
367 $ hg tglog
363 @ 4: 'E'
368 @ 4: 'E'
364 |
369 |
365 o 3: 'D'
370 o 3: 'D'
366 |
371 |
367 o 2: 'C'
372 o 2: 'C'
368 |
373 |
369 o 1: 'B'
374 o 1: 'B'
370 |
375 |
371 o 0: 'A'
376 o 0: 'A'
372
377
373
378
374 $ hg strip 3 4
379 $ hg strip 3 4
375 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
380 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
376 saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/67a385d4e6f2-backup.hg (glob)
381 saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/67a385d4e6f2-backup.hg (glob)
377
382
378 $ hg theads
383 $ hg theads
379 2: 'C'
384 2: 'C'
380
385
381 $ hg strip 2 1
386 $ hg strip 2 1
382 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
387 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
383 saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/6c81ed0049f8-backup.hg (glob)
388 saved backup bundle to $TESTTMP/a3/c/.hg/strip-backup/6c81ed0049f8-backup.hg (glob)
384
389
385 $ hg theads
390 $ hg theads
386 0: 'A'
391 0: 'A'
387
392
388 Make sure rebase does not break for phase/filter related reason
393 Make sure rebase does not break for phase/filter related reason
389 ----------------------------------------------------------------
394 ----------------------------------------------------------------
390 (issue3858)
395 (issue3858)
391
396
392 $ cd ..
397 $ cd ..
393
398
394 $ cat >> $HGRCPATH << EOF
399 $ cat >> $HGRCPATH << EOF
395 > [ui]
400 > [ui]
396 > logtemplate={rev} {desc} {phase}\n
401 > logtemplate={rev} {desc} {phase}\n
397 > EOF
402 > EOF
398
403
399
404
400 $ hg init c4
405 $ hg init c4
401 $ cd c4
406 $ cd c4
402
407
403 $ echo a > a
408 $ echo a > a
404 $ hg ci -Am A
409 $ hg ci -Am A
405 adding a
410 adding a
406 $ echo b > b
411 $ echo b > b
407 $ hg ci -Am B
412 $ hg ci -Am B
408 adding b
413 adding b
409 $ hg up 0
414 $ hg up 0
410 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
415 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
411 $ echo c > c
416 $ echo c > c
412 $ hg ci -Am C
417 $ hg ci -Am C
413 adding c
418 adding c
414 created new head
419 created new head
415 $ hg up 1
420 $ hg up 1
416 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
421 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
417 $ hg merge
422 $ hg merge
418 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
423 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
419 (branch merge, don't forget to commit)
424 (branch merge, don't forget to commit)
420 $ hg ci -m d
425 $ hg ci -m d
421 $ hg up 2
426 $ hg up 2
422 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
427 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
423 $ echo e > e
428 $ echo e > e
424 $ hg ci -Am E
429 $ hg ci -Am E
425 adding e
430 adding e
426 created new head
431 created new head
427 $ hg merge 3
432 $ hg merge 3
428 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
433 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 (branch merge, don't forget to commit)
434 (branch merge, don't forget to commit)
430 $ hg ci -m F
435 $ hg ci -m F
431 $ hg up 3
436 $ hg up 3
432 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
437 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
433 $ echo g > g
438 $ echo g > g
434 $ hg ci -Am G
439 $ hg ci -Am G
435 adding g
440 adding g
436 created new head
441 created new head
437 $ echo h > h
442 $ echo h > h
438 $ hg ci -Am H
443 $ hg ci -Am H
439 adding h
444 adding h
440 $ hg up 5
445 $ hg up 5
441 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
446 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
442 $ echo i > i
447 $ echo i > i
443 $ hg ci -Am I
448 $ hg ci -Am I
444 adding i
449 adding i
445
450
446 Turn most changeset public
451 Turn most changeset public
447
452
448 $ hg ph -p 7
453 $ hg ph -p 7
449
454
450 $ hg heads
455 $ hg heads
451 8 I draft
456 8 I draft
452 7 H public
457 7 H public
453 $ hg log -G
458 $ hg log -G
454 @ 8 I draft
459 @ 8 I draft
455 |
460 |
456 | o 7 H public
461 | o 7 H public
457 | |
462 | |
458 | o 6 G public
463 | o 6 G public
459 | |
464 | |
460 o | 5 F draft
465 o | 5 F draft
461 |\|
466 |\|
462 o | 4 E draft
467 o | 4 E draft
463 | |
468 | |
464 | o 3 d public
469 | o 3 d public
465 |/|
470 |/|
466 o | 2 C public
471 o | 2 C public
467 | |
472 | |
468 | o 1 B public
473 | o 1 B public
469 |/
474 |/
470 o 0 A public
475 o 0 A public
471
476
472
477
473 $ cat > $TESTTMP/checkeditform.sh <<EOF
478 $ cat > $TESTTMP/checkeditform.sh <<EOF
474 > env | grep HGEDITFORM
479 > env | grep HGEDITFORM
475 > true
480 > true
476 > EOF
481 > EOF
477 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --dest 7 --source 5 -e
482 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --dest 7 --source 5 -e
483 rebasing 5:361a99976cc9 "F"
478 HGEDITFORM=rebase.merge
484 HGEDITFORM=rebase.merge
485 rebasing 8:326cfedc031c "I" (tip)
479 HGEDITFORM=rebase.normal
486 HGEDITFORM=rebase.normal
480 saved backup bundle to $TESTTMP/a3/c4/.hg/strip-backup/361a99976cc9-backup.hg (glob)
487 saved backup bundle to $TESTTMP/a3/c4/.hg/strip-backup/361a99976cc9-backup.hg (glob)
@@ -1,151 +1,157 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}:{phase} '{desc}' {branches}\n"
9 > tglog = log -G --template "{rev}:{phase} '{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
15
16 $ echo A > A
16 $ echo A > A
17 $ hg add A
17 $ hg add A
18 $ hg ci -m A
18 $ hg ci -m A
19
19
20 $ echo 'B' > B
20 $ echo 'B' > B
21 $ hg add B
21 $ hg add B
22 $ hg ci -m B
22 $ hg ci -m B
23
23
24 $ echo C >> A
24 $ echo C >> A
25 $ hg ci -m C
25 $ hg ci -m C
26
26
27 $ hg up -q -C 0
27 $ hg up -q -C 0
28
28
29 $ echo D >> A
29 $ echo D >> A
30 $ hg ci -m D
30 $ hg ci -m D
31 created new head
31 created new head
32
32
33 $ echo E > E
33 $ echo E > E
34 $ hg add E
34 $ hg add E
35 $ hg ci -m E
35 $ hg ci -m E
36
36
37 $ hg up -q -C 0
37 $ hg up -q -C 0
38
38
39 $ hg branch 'notdefault'
39 $ hg branch 'notdefault'
40 marked working directory as branch notdefault
40 marked working directory as branch notdefault
41 (branches are permanent and global, did you want a bookmark?)
41 (branches are permanent and global, did you want a bookmark?)
42 $ echo F >> A
42 $ echo F >> A
43 $ hg ci -m F
43 $ hg ci -m F
44
44
45 $ cd ..
45 $ cd ..
46
46
47
47
48 Rebasing B onto E - check keep: and phases
48 Rebasing B onto E - check keep: and phases
49
49
50 $ hg clone -q -u . a a1
50 $ hg clone -q -u . a a1
51 $ cd a1
51 $ cd a1
52 $ hg phase --force --secret 2
52 $ hg phase --force --secret 2
53
53
54 $ hg tglog
54 $ hg tglog
55 @ 5:draft 'F' notdefault
55 @ 5:draft 'F' notdefault
56 |
56 |
57 | o 4:draft 'E'
57 | o 4:draft 'E'
58 | |
58 | |
59 | o 3:draft 'D'
59 | o 3:draft 'D'
60 |/
60 |/
61 | o 2:secret 'C'
61 | o 2:secret 'C'
62 | |
62 | |
63 | o 1:draft 'B'
63 | o 1:draft 'B'
64 |/
64 |/
65 o 0:draft 'A'
65 o 0:draft 'A'
66
66
67 $ hg rebase -s 1 -d 4 --keep
67 $ hg rebase -s 1 -d 4 --keep
68 rebasing 1:27547f69f254 "B"
69 rebasing 2:965c486023db "C"
68 merging A
70 merging A
69 warning: conflicts during merge.
71 warning: conflicts during merge.
70 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
72 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
71 unresolved conflicts (see hg resolve, then hg rebase --continue)
73 unresolved conflicts (see hg resolve, then hg rebase --continue)
72 [1]
74 [1]
73
75
74 Solve the conflict and go on:
76 Solve the conflict and go on:
75
77
76 $ echo 'conflict solved' > A
78 $ echo 'conflict solved' > A
77 $ rm A.orig
79 $ rm A.orig
78 $ hg resolve -m A
80 $ hg resolve -m A
79 (no more unresolved files)
81 (no more unresolved files)
80 $ hg rebase --continue
82 $ hg rebase --continue
83 already rebased 1:27547f69f254 "B" as 45396c49d53b
84 rebasing 2:965c486023db "C"
81
85
82 $ hg tglog
86 $ hg tglog
83 o 7:secret 'C'
87 o 7:secret 'C'
84 |
88 |
85 o 6:draft 'B'
89 o 6:draft 'B'
86 |
90 |
87 | @ 5:draft 'F' notdefault
91 | @ 5:draft 'F' notdefault
88 | |
92 | |
89 o | 4:draft 'E'
93 o | 4:draft 'E'
90 | |
94 | |
91 o | 3:draft 'D'
95 o | 3:draft 'D'
92 |/
96 |/
93 | o 2:secret 'C'
97 | o 2:secret 'C'
94 | |
98 | |
95 | o 1:draft 'B'
99 | o 1:draft 'B'
96 |/
100 |/
97 o 0:draft 'A'
101 o 0:draft 'A'
98
102
99 $ cd ..
103 $ cd ..
100
104
101
105
102 Rebase F onto E - check keepbranches:
106 Rebase F onto E - check keepbranches:
103
107
104 $ hg clone -q -u . a a2
108 $ hg clone -q -u . a a2
105 $ cd a2
109 $ cd a2
106 $ hg phase --force --secret 2
110 $ hg phase --force --secret 2
107
111
108 $ hg tglog
112 $ hg tglog
109 @ 5:draft 'F' notdefault
113 @ 5:draft 'F' notdefault
110 |
114 |
111 | o 4:draft 'E'
115 | o 4:draft 'E'
112 | |
116 | |
113 | o 3:draft 'D'
117 | o 3:draft 'D'
114 |/
118 |/
115 | o 2:secret 'C'
119 | o 2:secret 'C'
116 | |
120 | |
117 | o 1:draft 'B'
121 | o 1:draft 'B'
118 |/
122 |/
119 o 0:draft 'A'
123 o 0:draft 'A'
120
124
121 $ hg rebase -s 5 -d 4 --keepbranches
125 $ hg rebase -s 5 -d 4 --keepbranches
126 rebasing 5:01e6ebbd8272 "F" (tip)
122 merging A
127 merging A
123 warning: conflicts during merge.
128 warning: conflicts during merge.
124 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
129 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
125 unresolved conflicts (see hg resolve, then hg rebase --continue)
130 unresolved conflicts (see hg resolve, then hg rebase --continue)
126 [1]
131 [1]
127
132
128 Solve the conflict and go on:
133 Solve the conflict and go on:
129
134
130 $ echo 'conflict solved' > A
135 $ echo 'conflict solved' > A
131 $ rm A.orig
136 $ rm A.orig
132 $ hg resolve -m A
137 $ hg resolve -m A
133 (no more unresolved files)
138 (no more unresolved files)
134 $ hg rebase --continue
139 $ hg rebase --continue
140 rebasing 5:01e6ebbd8272 "F" (tip)
135 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/01e6ebbd8272-backup.hg (glob)
141 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/01e6ebbd8272-backup.hg (glob)
136
142
137 $ hg tglog
143 $ hg tglog
138 @ 5:draft 'F' notdefault
144 @ 5:draft 'F' notdefault
139 |
145 |
140 o 4:draft 'E'
146 o 4:draft 'E'
141 |
147 |
142 o 3:draft 'D'
148 o 3:draft 'D'
143 |
149 |
144 | o 2:secret 'C'
150 | o 2:secret 'C'
145 | |
151 | |
146 | o 1:draft 'B'
152 | o 1:draft 'B'
147 |/
153 |/
148 o 0:draft 'A'
154 o 0:draft 'A'
149
155
150
156
151 $ cd ..
157 $ cd ..
@@ -1,781 +1,806 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > mq=
4 > mq=
5 >
5 >
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
11 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
11 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
12 > EOF
12 > EOF
13
13
14 Create repo a:
14 Create repo a:
15
15
16 $ hg init a
16 $ hg init a
17 $ cd a
17 $ cd a
18 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
18 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
19 adding changesets
19 adding changesets
20 adding manifests
20 adding manifests
21 adding file changes
21 adding file changes
22 added 8 changesets with 7 changes to 7 files (+2 heads)
22 added 8 changesets with 7 changes to 7 files (+2 heads)
23 (run 'hg heads' to see heads, 'hg merge' to merge)
23 (run 'hg heads' to see heads, 'hg merge' to merge)
24 $ hg up tip
24 $ hg up tip
25 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
26
26
27 $ hg tglog
27 $ hg tglog
28 @ 7: 'H'
28 @ 7: 'H'
29 |
29 |
30 | o 6: 'G'
30 | o 6: 'G'
31 |/|
31 |/|
32 o | 5: 'F'
32 o | 5: 'F'
33 | |
33 | |
34 | o 4: 'E'
34 | o 4: 'E'
35 |/
35 |/
36 | o 3: 'D'
36 | o 3: 'D'
37 | |
37 | |
38 | o 2: 'C'
38 | o 2: 'C'
39 | |
39 | |
40 | o 1: 'B'
40 | o 1: 'B'
41 |/
41 |/
42 o 0: 'A'
42 o 0: 'A'
43
43
44 $ cd ..
44 $ cd ..
45
45
46
46
47 Rebasing B onto H and collapsing changesets with different phases:
47 Rebasing B onto H and collapsing changesets with different phases:
48
48
49
49
50 $ hg clone -q -u 3 a a1
50 $ hg clone -q -u 3 a a1
51 $ cd a1
51 $ cd a1
52
52
53 $ hg phase --force --secret 3
53 $ hg phase --force --secret 3
54
54
55 $ cat > $TESTTMP/editor.sh <<EOF
55 $ cat > $TESTTMP/editor.sh <<EOF
56 > echo "==== before editing"
56 > echo "==== before editing"
57 > cat \$1
57 > cat \$1
58 > echo "===="
58 > echo "===="
59 > echo "edited manually" >> \$1
59 > echo "edited manually" >> \$1
60 > EOF
60 > EOF
61 $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e
61 $ HGEDITOR="sh $TESTTMP/editor.sh" hg rebase --collapse --keepbranches -e
62 rebasing 1:42ccdea3bb16 "B"
63 rebasing 2:5fddd98957c8 "C"
64 rebasing 3:32af7686d403 "D"
62 ==== before editing
65 ==== before editing
63 Collapsed revision
66 Collapsed revision
64 * B
67 * B
65 * C
68 * C
66 * D
69 * D
67
70
68
71
69 HG: Enter commit message. Lines beginning with 'HG:' are removed.
72 HG: Enter commit message. Lines beginning with 'HG:' are removed.
70 HG: Leave message empty to abort commit.
73 HG: Leave message empty to abort commit.
71 HG: --
74 HG: --
72 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
75 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
73 HG: branch 'default'
76 HG: branch 'default'
74 HG: added B
77 HG: added B
75 HG: added C
78 HG: added C
76 HG: added D
79 HG: added D
77 ====
80 ====
78 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
81 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
79
82
80 $ hg tglogp
83 $ hg tglogp
81 @ 5:secret 'Collapsed revision
84 @ 5:secret 'Collapsed revision
82 | * B
85 | * B
83 | * C
86 | * C
84 | * D
87 | * D
85 |
88 |
86 |
89 |
87 | edited manually'
90 | edited manually'
88 o 4:draft 'H'
91 o 4:draft 'H'
89 |
92 |
90 | o 3:draft 'G'
93 | o 3:draft 'G'
91 |/|
94 |/|
92 o | 2:draft 'F'
95 o | 2:draft 'F'
93 | |
96 | |
94 | o 1:draft 'E'
97 | o 1:draft 'E'
95 |/
98 |/
96 o 0:draft 'A'
99 o 0:draft 'A'
97
100
98 $ hg manifest --rev tip
101 $ hg manifest --rev tip
99 A
102 A
100 B
103 B
101 C
104 C
102 D
105 D
103 F
106 F
104 H
107 H
105
108
106 $ cd ..
109 $ cd ..
107
110
108
111
109 Rebasing E onto H:
112 Rebasing E onto H:
110
113
111 $ hg clone -q -u . a a2
114 $ hg clone -q -u . a a2
112 $ cd a2
115 $ cd a2
113
116
114 $ hg phase --force --secret 6
117 $ hg phase --force --secret 6
115 $ hg rebase --source 4 --collapse
118 $ hg rebase --source 4 --collapse
119 rebasing 4:9520eea781bc "E"
120 rebasing 6:eea13746799a "G"
116 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/9520eea781bc-backup.hg (glob)
121 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/9520eea781bc-backup.hg (glob)
117
122
118 $ hg tglog
123 $ hg tglog
119 o 6: 'Collapsed revision
124 o 6: 'Collapsed revision
120 | * E
125 | * E
121 | * G'
126 | * G'
122 @ 5: 'H'
127 @ 5: 'H'
123 |
128 |
124 o 4: 'F'
129 o 4: 'F'
125 |
130 |
126 | o 3: 'D'
131 | o 3: 'D'
127 | |
132 | |
128 | o 2: 'C'
133 | o 2: 'C'
129 | |
134 | |
130 | o 1: 'B'
135 | o 1: 'B'
131 |/
136 |/
132 o 0: 'A'
137 o 0: 'A'
133
138
134 $ hg manifest --rev tip
139 $ hg manifest --rev tip
135 A
140 A
136 E
141 E
137 F
142 F
138 H
143 H
139
144
140 $ cd ..
145 $ cd ..
141
146
142 Rebasing G onto H with custom message:
147 Rebasing G onto H with custom message:
143
148
144 $ hg clone -q -u . a a3
149 $ hg clone -q -u . a a3
145 $ cd a3
150 $ cd a3
146
151
147 $ hg rebase --base 6 -m 'custom message'
152 $ hg rebase --base 6 -m 'custom message'
148 abort: message can only be specified with collapse
153 abort: message can only be specified with collapse
149 [255]
154 [255]
150
155
151 $ cat > $TESTTMP/checkeditform.sh <<EOF
156 $ cat > $TESTTMP/checkeditform.sh <<EOF
152 > env | grep HGEDITFORM
157 > env | grep HGEDITFORM
153 > true
158 > true
154 > EOF
159 > EOF
155 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source 4 --collapse -m 'custom message' -e
160 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg rebase --source 4 --collapse -m 'custom message' -e
161 rebasing 4:9520eea781bc "E"
162 rebasing 6:eea13746799a "G"
156 HGEDITFORM=rebase.collapse
163 HGEDITFORM=rebase.collapse
157 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-backup.hg (glob)
164 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-backup.hg (glob)
158
165
159 $ hg tglog
166 $ hg tglog
160 o 6: 'custom message'
167 o 6: 'custom message'
161 |
168 |
162 @ 5: 'H'
169 @ 5: 'H'
163 |
170 |
164 o 4: 'F'
171 o 4: 'F'
165 |
172 |
166 | o 3: 'D'
173 | o 3: 'D'
167 | |
174 | |
168 | o 2: 'C'
175 | o 2: 'C'
169 | |
176 | |
170 | o 1: 'B'
177 | o 1: 'B'
171 |/
178 |/
172 o 0: 'A'
179 o 0: 'A'
173
180
174 $ hg manifest --rev tip
181 $ hg manifest --rev tip
175 A
182 A
176 E
183 E
177 F
184 F
178 H
185 H
179
186
180 $ cd ..
187 $ cd ..
181
188
182 Create repo b:
189 Create repo b:
183
190
184 $ hg init b
191 $ hg init b
185 $ cd b
192 $ cd b
186
193
187 $ echo A > A
194 $ echo A > A
188 $ hg ci -Am A
195 $ hg ci -Am A
189 adding A
196 adding A
190 $ echo B > B
197 $ echo B > B
191 $ hg ci -Am B
198 $ hg ci -Am B
192 adding B
199 adding B
193
200
194 $ hg up -q 0
201 $ hg up -q 0
195
202
196 $ echo C > C
203 $ echo C > C
197 $ hg ci -Am C
204 $ hg ci -Am C
198 adding C
205 adding C
199 created new head
206 created new head
200
207
201 $ hg merge
208 $ hg merge
202 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 (branch merge, don't forget to commit)
210 (branch merge, don't forget to commit)
204
211
205 $ echo D > D
212 $ echo D > D
206 $ hg ci -Am D
213 $ hg ci -Am D
207 adding D
214 adding D
208
215
209 $ hg up -q 1
216 $ hg up -q 1
210
217
211 $ echo E > E
218 $ echo E > E
212 $ hg ci -Am E
219 $ hg ci -Am E
213 adding E
220 adding E
214 created new head
221 created new head
215
222
216 $ echo F > F
223 $ echo F > F
217 $ hg ci -Am F
224 $ hg ci -Am F
218 adding F
225 adding F
219
226
220 $ hg merge
227 $ hg merge
221 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 (branch merge, don't forget to commit)
229 (branch merge, don't forget to commit)
223 $ hg ci -m G
230 $ hg ci -m G
224
231
225 $ hg up -q 0
232 $ hg up -q 0
226
233
227 $ echo H > H
234 $ echo H > H
228 $ hg ci -Am H
235 $ hg ci -Am H
229 adding H
236 adding H
230 created new head
237 created new head
231
238
232 $ hg tglog
239 $ hg tglog
233 @ 7: 'H'
240 @ 7: 'H'
234 |
241 |
235 | o 6: 'G'
242 | o 6: 'G'
236 | |\
243 | |\
237 | | o 5: 'F'
244 | | o 5: 'F'
238 | | |
245 | | |
239 | | o 4: 'E'
246 | | o 4: 'E'
240 | | |
247 | | |
241 | o | 3: 'D'
248 | o | 3: 'D'
242 | |\|
249 | |\|
243 | o | 2: 'C'
250 | o | 2: 'C'
244 |/ /
251 |/ /
245 | o 1: 'B'
252 | o 1: 'B'
246 |/
253 |/
247 o 0: 'A'
254 o 0: 'A'
248
255
249 $ cd ..
256 $ cd ..
250
257
251
258
252 Rebase and collapse - more than one external (fail):
259 Rebase and collapse - more than one external (fail):
253
260
254 $ hg clone -q -u . b b1
261 $ hg clone -q -u . b b1
255 $ cd b1
262 $ cd b1
256
263
257 $ hg rebase -s 2 --collapse
264 $ hg rebase -s 2 --collapse
258 abort: unable to collapse on top of 7, there is more than one external parent: 1, 5
265 abort: unable to collapse on top of 7, there is more than one external parent: 1, 5
259 [255]
266 [255]
260
267
261 Rebase and collapse - E onto H:
268 Rebase and collapse - E onto H:
262
269
263 $ hg rebase -s 4 --collapse # root (4) is not a merge
270 $ hg rebase -s 4 --collapse # root (4) is not a merge
271 rebasing 4:8a5212ebc852 "E"
272 rebasing 5:7f219660301f "F"
273 rebasing 6:c772a8b2dc17 "G"
264 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
274 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
265
275
266 $ hg tglog
276 $ hg tglog
267 o 5: 'Collapsed revision
277 o 5: 'Collapsed revision
268 |\ * E
278 |\ * E
269 | | * F
279 | | * F
270 | | * G'
280 | | * G'
271 | @ 4: 'H'
281 | @ 4: 'H'
272 | |
282 | |
273 o | 3: 'D'
283 o | 3: 'D'
274 |\ \
284 |\ \
275 | o | 2: 'C'
285 | o | 2: 'C'
276 | |/
286 | |/
277 o / 1: 'B'
287 o / 1: 'B'
278 |/
288 |/
279 o 0: 'A'
289 o 0: 'A'
280
290
281 $ hg manifest --rev tip
291 $ hg manifest --rev tip
282 A
292 A
283 C
293 C
284 D
294 D
285 E
295 E
286 F
296 F
287 H
297 H
288
298
289 $ cd ..
299 $ cd ..
290
300
291
301
292
302
293
303
294 Test that branchheads cache is updated correctly when doing a strip in which
304 Test that branchheads cache is updated correctly when doing a strip in which
295 the parent of the ancestor node to be stripped does not become a head and also,
305 the parent of the ancestor node to be stripped does not become a head and also,
296 the parent of a node that is a child of the node stripped becomes a head (node
306 the parent of a node that is a child of the node stripped becomes a head (node
297 3). The code is now much simpler and we could just test a simpler scenario
307 3). The code is now much simpler and we could just test a simpler scenario
298 We keep it the test this way in case new complexity is injected.
308 We keep it the test this way in case new complexity is injected.
299
309
300 $ hg clone -q -u . b b2
310 $ hg clone -q -u . b b2
301 $ cd b2
311 $ cd b2
302
312
303 $ hg heads --template="{rev}:{node} {branch}\n"
313 $ hg heads --template="{rev}:{node} {branch}\n"
304 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
314 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default
305 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
315 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default
306
316
307 $ cat $TESTTMP/b2/.hg/cache/branch2-served
317 $ cat $TESTTMP/b2/.hg/cache/branch2-served
308 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
318 c65502d4178782309ce0574c5ae6ee9485a9bafa 7
309 c772a8b2dc17629cec88a19d09c926c4814b12c7 o default
319 c772a8b2dc17629cec88a19d09c926c4814b12c7 o default
310 c65502d4178782309ce0574c5ae6ee9485a9bafa o default
320 c65502d4178782309ce0574c5ae6ee9485a9bafa o default
311
321
312 $ hg strip 4
322 $ hg strip 4
313 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
323 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
314
324
315 $ cat $TESTTMP/b2/.hg/cache/branch2-served
325 $ cat $TESTTMP/b2/.hg/cache/branch2-served
316 c65502d4178782309ce0574c5ae6ee9485a9bafa 4
326 c65502d4178782309ce0574c5ae6ee9485a9bafa 4
317 2870ad076e541e714f3c2bc32826b5c6a6e5b040 o default
327 2870ad076e541e714f3c2bc32826b5c6a6e5b040 o default
318 c65502d4178782309ce0574c5ae6ee9485a9bafa o default
328 c65502d4178782309ce0574c5ae6ee9485a9bafa o default
319
329
320 $ hg heads --template="{rev}:{node} {branch}\n"
330 $ hg heads --template="{rev}:{node} {branch}\n"
321 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default
331 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default
322 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
332 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default
323
333
324 $ cd ..
334 $ cd ..
325
335
326
336
327
337
328
338
329
339
330
340
331 Create repo c:
341 Create repo c:
332
342
333 $ hg init c
343 $ hg init c
334 $ cd c
344 $ cd c
335
345
336 $ echo A > A
346 $ echo A > A
337 $ hg ci -Am A
347 $ hg ci -Am A
338 adding A
348 adding A
339 $ echo B > B
349 $ echo B > B
340 $ hg ci -Am B
350 $ hg ci -Am B
341 adding B
351 adding B
342
352
343 $ hg up -q 0
353 $ hg up -q 0
344
354
345 $ echo C > C
355 $ echo C > C
346 $ hg ci -Am C
356 $ hg ci -Am C
347 adding C
357 adding C
348 created new head
358 created new head
349
359
350 $ hg merge
360 $ hg merge
351 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 (branch merge, don't forget to commit)
362 (branch merge, don't forget to commit)
353
363
354 $ echo D > D
364 $ echo D > D
355 $ hg ci -Am D
365 $ hg ci -Am D
356 adding D
366 adding D
357
367
358 $ hg up -q 1
368 $ hg up -q 1
359
369
360 $ echo E > E
370 $ echo E > E
361 $ hg ci -Am E
371 $ hg ci -Am E
362 adding E
372 adding E
363 created new head
373 created new head
364 $ echo F > E
374 $ echo F > E
365 $ hg ci -m 'F'
375 $ hg ci -m 'F'
366
376
367 $ echo G > G
377 $ echo G > G
368 $ hg ci -Am G
378 $ hg ci -Am G
369 adding G
379 adding G
370
380
371 $ hg merge
381 $ hg merge
372 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
373 (branch merge, don't forget to commit)
383 (branch merge, don't forget to commit)
374
384
375 $ hg ci -m H
385 $ hg ci -m H
376
386
377 $ hg up -q 0
387 $ hg up -q 0
378
388
379 $ echo I > I
389 $ echo I > I
380 $ hg ci -Am I
390 $ hg ci -Am I
381 adding I
391 adding I
382 created new head
392 created new head
383
393
384 $ hg tglog
394 $ hg tglog
385 @ 8: 'I'
395 @ 8: 'I'
386 |
396 |
387 | o 7: 'H'
397 | o 7: 'H'
388 | |\
398 | |\
389 | | o 6: 'G'
399 | | o 6: 'G'
390 | | |
400 | | |
391 | | o 5: 'F'
401 | | o 5: 'F'
392 | | |
402 | | |
393 | | o 4: 'E'
403 | | o 4: 'E'
394 | | |
404 | | |
395 | o | 3: 'D'
405 | o | 3: 'D'
396 | |\|
406 | |\|
397 | o | 2: 'C'
407 | o | 2: 'C'
398 |/ /
408 |/ /
399 | o 1: 'B'
409 | o 1: 'B'
400 |/
410 |/
401 o 0: 'A'
411 o 0: 'A'
402
412
403 $ cd ..
413 $ cd ..
404
414
405
415
406 Rebase and collapse - E onto I:
416 Rebase and collapse - E onto I:
407
417
408 $ hg clone -q -u . c c1
418 $ hg clone -q -u . c c1
409 $ cd c1
419 $ cd c1
410
420
411 $ hg rebase -s 4 --collapse # root (4) is not a merge
421 $ hg rebase -s 4 --collapse # root (4) is not a merge
422 rebasing 4:8a5212ebc852 "E"
423 rebasing 5:dca5924bb570 "F"
412 merging E
424 merging E
425 rebasing 6:55a44ad28289 "G"
426 rebasing 7:417d3b648079 "H"
413 saved backup bundle to $TESTTMP/c1/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
427 saved backup bundle to $TESTTMP/c1/.hg/strip-backup/8a5212ebc852-backup.hg (glob)
414
428
415 $ hg tglog
429 $ hg tglog
416 o 5: 'Collapsed revision
430 o 5: 'Collapsed revision
417 |\ * E
431 |\ * E
418 | | * F
432 | | * F
419 | | * G
433 | | * G
420 | | * H'
434 | | * H'
421 | @ 4: 'I'
435 | @ 4: 'I'
422 | |
436 | |
423 o | 3: 'D'
437 o | 3: 'D'
424 |\ \
438 |\ \
425 | o | 2: 'C'
439 | o | 2: 'C'
426 | |/
440 | |/
427 o / 1: 'B'
441 o / 1: 'B'
428 |/
442 |/
429 o 0: 'A'
443 o 0: 'A'
430
444
431 $ hg manifest --rev tip
445 $ hg manifest --rev tip
432 A
446 A
433 C
447 C
434 D
448 D
435 E
449 E
436 G
450 G
437 I
451 I
438
452
439 $ hg up tip -q
453 $ hg up tip -q
440 $ cat E
454 $ cat E
441 F
455 F
442
456
443 $ cd ..
457 $ cd ..
444
458
445
459
446 Create repo d:
460 Create repo d:
447
461
448 $ hg init d
462 $ hg init d
449 $ cd d
463 $ cd d
450
464
451 $ echo A > A
465 $ echo A > A
452 $ hg ci -Am A
466 $ hg ci -Am A
453 adding A
467 adding A
454 $ echo B > B
468 $ echo B > B
455 $ hg ci -Am B
469 $ hg ci -Am B
456 adding B
470 adding B
457 $ echo C > C
471 $ echo C > C
458 $ hg ci -Am C
472 $ hg ci -Am C
459 adding C
473 adding C
460
474
461 $ hg up -q 1
475 $ hg up -q 1
462
476
463 $ echo D > D
477 $ echo D > D
464 $ hg ci -Am D
478 $ hg ci -Am D
465 adding D
479 adding D
466 created new head
480 created new head
467 $ hg merge
481 $ hg merge
468 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
482 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
469 (branch merge, don't forget to commit)
483 (branch merge, don't forget to commit)
470
484
471 $ hg ci -m E
485 $ hg ci -m E
472
486
473 $ hg up -q 0
487 $ hg up -q 0
474
488
475 $ echo F > F
489 $ echo F > F
476 $ hg ci -Am F
490 $ hg ci -Am F
477 adding F
491 adding F
478 created new head
492 created new head
479
493
480 $ hg tglog
494 $ hg tglog
481 @ 5: 'F'
495 @ 5: 'F'
482 |
496 |
483 | o 4: 'E'
497 | o 4: 'E'
484 | |\
498 | |\
485 | | o 3: 'D'
499 | | o 3: 'D'
486 | | |
500 | | |
487 | o | 2: 'C'
501 | o | 2: 'C'
488 | |/
502 | |/
489 | o 1: 'B'
503 | o 1: 'B'
490 |/
504 |/
491 o 0: 'A'
505 o 0: 'A'
492
506
493 $ cd ..
507 $ cd ..
494
508
495
509
496 Rebase and collapse - B onto F:
510 Rebase and collapse - B onto F:
497
511
498 $ hg clone -q -u . d d1
512 $ hg clone -q -u . d d1
499 $ cd d1
513 $ cd d1
500
514
501 $ hg rebase -s 1 --collapse
515 $ hg rebase -s 1 --collapse
516 rebasing 1:27547f69f254 "B"
517 rebasing 2:f838bfaca5c7 "C"
518 rebasing 3:7bbcd6078bcc "D"
519 rebasing 4:0a42590ed746 "E"
502 saved backup bundle to $TESTTMP/d1/.hg/strip-backup/27547f69f254-backup.hg (glob)
520 saved backup bundle to $TESTTMP/d1/.hg/strip-backup/27547f69f254-backup.hg (glob)
503
521
504 $ hg tglog
522 $ hg tglog
505 o 2: 'Collapsed revision
523 o 2: 'Collapsed revision
506 | * B
524 | * B
507 | * C
525 | * C
508 | * D
526 | * D
509 | * E'
527 | * E'
510 @ 1: 'F'
528 @ 1: 'F'
511 |
529 |
512 o 0: 'A'
530 o 0: 'A'
513
531
514 $ hg manifest --rev tip
532 $ hg manifest --rev tip
515 A
533 A
516 B
534 B
517 C
535 C
518 D
536 D
519 F
537 F
520
538
521 Interactions between collapse and keepbranches
539 Interactions between collapse and keepbranches
522 $ cd ..
540 $ cd ..
523 $ hg init e
541 $ hg init e
524 $ cd e
542 $ cd e
525 $ echo 'a' > a
543 $ echo 'a' > a
526 $ hg ci -Am 'A'
544 $ hg ci -Am 'A'
527 adding a
545 adding a
528
546
529 $ hg branch 'one'
547 $ hg branch 'one'
530 marked working directory as branch one
548 marked working directory as branch one
531 (branches are permanent and global, did you want a bookmark?)
549 (branches are permanent and global, did you want a bookmark?)
532 $ echo 'b' > b
550 $ echo 'b' > b
533 $ hg ci -Am 'B'
551 $ hg ci -Am 'B'
534 adding b
552 adding b
535
553
536 $ hg branch 'two'
554 $ hg branch 'two'
537 marked working directory as branch two
555 marked working directory as branch two
538 (branches are permanent and global, did you want a bookmark?)
556 (branches are permanent and global, did you want a bookmark?)
539 $ echo 'c' > c
557 $ echo 'c' > c
540 $ hg ci -Am 'C'
558 $ hg ci -Am 'C'
541 adding c
559 adding c
542
560
543 $ hg up -q 0
561 $ hg up -q 0
544 $ echo 'd' > d
562 $ echo 'd' > d
545 $ hg ci -Am 'D'
563 $ hg ci -Am 'D'
546 adding d
564 adding d
547
565
548 $ hg tglog
566 $ hg tglog
549 @ 3: 'D'
567 @ 3: 'D'
550 |
568 |
551 | o 2: 'C' two
569 | o 2: 'C' two
552 | |
570 | |
553 | o 1: 'B' one
571 | o 1: 'B' one
554 |/
572 |/
555 o 0: 'A'
573 o 0: 'A'
556
574
557 $ hg rebase --keepbranches --collapse -s 1 -d 3
575 $ hg rebase --keepbranches --collapse -s 1 -d 3
558 abort: cannot collapse multiple named branches
576 abort: cannot collapse multiple named branches
559 [255]
577 [255]
560
578
561 $ repeatchange() {
579 $ repeatchange() {
562 > hg checkout $1
580 > hg checkout $1
563 > hg cp d z
581 > hg cp d z
564 > echo blah >> z
582 > echo blah >> z
565 > hg commit -Am "$2" --user "$3"
583 > hg commit -Am "$2" --user "$3"
566 > }
584 > }
567 $ repeatchange 3 "E" "user1"
585 $ repeatchange 3 "E" "user1"
568 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
586 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
569 $ repeatchange 3 "E" "user2"
587 $ repeatchange 3 "E" "user2"
570 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
588 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
571 created new head
589 created new head
572 $ hg tglog
590 $ hg tglog
573 @ 5: 'E'
591 @ 5: 'E'
574 |
592 |
575 | o 4: 'E'
593 | o 4: 'E'
576 |/
594 |/
577 o 3: 'D'
595 o 3: 'D'
578 |
596 |
579 | o 2: 'C' two
597 | o 2: 'C' two
580 | |
598 | |
581 | o 1: 'B' one
599 | o 1: 'B' one
582 |/
600 |/
583 o 0: 'A'
601 o 0: 'A'
584
602
585 $ hg rebase -s 5 -d 4
603 $ hg rebase -s 5 -d 4
604 rebasing 5:fbfb97b1089a "E" (tip)
586 saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-backup.hg (glob)
605 saved backup bundle to $TESTTMP/e/.hg/strip-backup/fbfb97b1089a-backup.hg (glob)
587 $ hg tglog
606 $ hg tglog
588 @ 4: 'E'
607 @ 4: 'E'
589 |
608 |
590 o 3: 'D'
609 o 3: 'D'
591 |
610 |
592 | o 2: 'C' two
611 | o 2: 'C' two
593 | |
612 | |
594 | o 1: 'B' one
613 | o 1: 'B' one
595 |/
614 |/
596 o 0: 'A'
615 o 0: 'A'
597
616
598 $ hg export tip
617 $ hg export tip
599 # HG changeset patch
618 # HG changeset patch
600 # User user1
619 # User user1
601 # Date 0 0
620 # Date 0 0
602 # Thu Jan 01 00:00:00 1970 +0000
621 # Thu Jan 01 00:00:00 1970 +0000
603 # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213
622 # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213
604 # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09
623 # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09
605 E
624 E
606
625
607 diff -r 41acb9dca9eb -r f338eb3c2c7c z
626 diff -r 41acb9dca9eb -r f338eb3c2c7c z
608 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
627 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
609 +++ b/z Thu Jan 01 00:00:00 1970 +0000
628 +++ b/z Thu Jan 01 00:00:00 1970 +0000
610 @@ -0,0 +1,2 @@
629 @@ -0,0 +1,2 @@
611 +d
630 +d
612 +blah
631 +blah
613
632
614 $ cd ..
633 $ cd ..
615
634
616 Rebase, collapse and copies
635 Rebase, collapse and copies
617
636
618 $ hg init copies
637 $ hg init copies
619 $ cd copies
638 $ cd copies
620 $ hg unbundle "$TESTDIR/bundles/renames.hg"
639 $ hg unbundle "$TESTDIR/bundles/renames.hg"
621 adding changesets
640 adding changesets
622 adding manifests
641 adding manifests
623 adding file changes
642 adding file changes
624 added 4 changesets with 11 changes to 7 files (+1 heads)
643 added 4 changesets with 11 changes to 7 files (+1 heads)
625 (run 'hg heads' to see heads, 'hg merge' to merge)
644 (run 'hg heads' to see heads, 'hg merge' to merge)
626 $ hg up -q tip
645 $ hg up -q tip
627 $ hg tglog
646 $ hg tglog
628 @ 3: 'move2'
647 @ 3: 'move2'
629 |
648 |
630 o 2: 'move1'
649 o 2: 'move1'
631 |
650 |
632 | o 1: 'change'
651 | o 1: 'change'
633 |/
652 |/
634 o 0: 'add'
653 o 0: 'add'
635
654
636 $ hg rebase --collapse -d 1
655 $ hg rebase --collapse -d 1
656 rebasing 2:6e7340ee38c0 "move1"
637 merging a and d to d
657 merging a and d to d
638 merging b and e to e
658 merging b and e to e
639 merging c and f to f
659 merging c and f to f
660 rebasing 3:338e84e2e558 "move2" (tip)
640 merging f and c to c
661 merging f and c to c
641 merging e and g to g
662 merging e and g to g
642 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-backup.hg (glob)
663 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/6e7340ee38c0-backup.hg (glob)
643 $ hg st
664 $ hg st
644 $ hg st --copies --change tip
665 $ hg st --copies --change tip
645 A d
666 A d
646 a
667 a
647 A g
668 A g
648 b
669 b
649 R b
670 R b
650 $ hg up tip -q
671 $ hg up tip -q
651 $ cat c
672 $ cat c
652 c
673 c
653 c
674 c
654 $ cat d
675 $ cat d
655 a
676 a
656 a
677 a
657 $ cat g
678 $ cat g
658 b
679 b
659 b
680 b
660 $ hg log -r . --template "{file_copies}\n"
681 $ hg log -r . --template "{file_copies}\n"
661 d (a)g (b)
682 d (a)g (b)
662
683
663 Test collapsing a middle revision in-place
684 Test collapsing a middle revision in-place
664
685
665 $ hg tglog
686 $ hg tglog
666 @ 2: 'Collapsed revision
687 @ 2: 'Collapsed revision
667 | * move1
688 | * move1
668 | * move2'
689 | * move2'
669 o 1: 'change'
690 o 1: 'change'
670 |
691 |
671 o 0: 'add'
692 o 0: 'add'
672
693
673 $ hg rebase --collapse -r 1 -d 0
694 $ hg rebase --collapse -r 1 -d 0
674 abort: can't remove original changesets with unrebased descendants
695 abort: can't remove original changesets with unrebased descendants
675 (use --keep to keep original changesets)
696 (use --keep to keep original changesets)
676 [255]
697 [255]
677
698
678 Test collapsing in place
699 Test collapsing in place
679
700
680 $ hg rebase --collapse -b . -d 0
701 $ hg rebase --collapse -b . -d 0
702 rebasing 1:1352765a01d4 "change"
703 rebasing 2:64b456429f67 "Collapsed revision" (tip)
681 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-backup.hg (glob)
704 saved backup bundle to $TESTTMP/copies/.hg/strip-backup/1352765a01d4-backup.hg (glob)
682 $ hg st --change tip --copies
705 $ hg st --change tip --copies
683 M a
706 M a
684 M c
707 M c
685 A d
708 A d
686 a
709 a
687 A g
710 A g
688 b
711 b
689 R b
712 R b
690 $ hg up tip -q
713 $ hg up tip -q
691 $ cat a
714 $ cat a
692 a
715 a
693 a
716 a
694 $ cat c
717 $ cat c
695 c
718 c
696 c
719 c
697 $ cat d
720 $ cat d
698 a
721 a
699 a
722 a
700 $ cat g
723 $ cat g
701 b
724 b
702 b
725 b
703 $ cd ..
726 $ cd ..
704
727
705
728
706 Test stripping a revision with another child
729 Test stripping a revision with another child
707
730
708 $ hg init f
731 $ hg init f
709 $ cd f
732 $ cd f
710
733
711 $ echo A > A
734 $ echo A > A
712 $ hg ci -Am A
735 $ hg ci -Am A
713 adding A
736 adding A
714 $ echo B > B
737 $ echo B > B
715 $ hg ci -Am B
738 $ hg ci -Am B
716 adding B
739 adding B
717
740
718 $ hg up -q 0
741 $ hg up -q 0
719
742
720 $ echo C > C
743 $ echo C > C
721 $ hg ci -Am C
744 $ hg ci -Am C
722 adding C
745 adding C
723 created new head
746 created new head
724
747
725 $ hg tglog
748 $ hg tglog
726 @ 2: 'C'
749 @ 2: 'C'
727 |
750 |
728 | o 1: 'B'
751 | o 1: 'B'
729 |/
752 |/
730 o 0: 'A'
753 o 0: 'A'
731
754
732
755
733
756
734 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
757 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
735 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C
758 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C
736 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
759 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
737
760
738 $ hg strip 2
761 $ hg strip 2
739 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
762 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
740 saved backup bundle to $TESTTMP/f/.hg/strip-backup/c5cefa58fd55-backup.hg (glob)
763 saved backup bundle to $TESTTMP/f/.hg/strip-backup/c5cefa58fd55-backup.hg (glob)
741
764
742 $ hg tglog
765 $ hg tglog
743 o 1: 'B'
766 o 1: 'B'
744 |
767 |
745 @ 0: 'A'
768 @ 0: 'A'
746
769
747
770
748
771
749 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
772 $ hg heads --template="{rev}:{node} {branch}: {desc}\n"
750 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
773 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B
751
774
752 $ cd ..
775 $ cd ..
753
776
754 Test collapsing changes that add then remove a file
777 Test collapsing changes that add then remove a file
755
778
756 $ hg init collapseaddremove
779 $ hg init collapseaddremove
757 $ cd collapseaddremove
780 $ cd collapseaddremove
758
781
759 $ touch base
782 $ touch base
760 $ hg commit -Am base
783 $ hg commit -Am base
761 adding base
784 adding base
762 $ touch a
785 $ touch a
763 $ hg commit -Am a
786 $ hg commit -Am a
764 adding a
787 adding a
765 $ hg rm a
788 $ hg rm a
766 $ touch b
789 $ touch b
767 $ hg commit -Am b
790 $ hg commit -Am b
768 adding b
791 adding b
769 $ hg book foo
792 $ hg book foo
770 $ hg rebase -d 0 -r "1::2" --collapse -m collapsed
793 $ hg rebase -d 0 -r "1::2" --collapse -m collapsed
794 rebasing 1:6d8d9f24eec3 "a"
795 rebasing 2:1cc73eca5ecc "b" (tip foo)
771 saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-backup.hg (glob)
796 saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/6d8d9f24eec3-backup.hg (glob)
772 $ hg log -G --template "{rev}: '{desc}' {bookmarks}"
797 $ hg log -G --template "{rev}: '{desc}' {bookmarks}"
773 @ 1: 'collapsed' foo
798 @ 1: 'collapsed' foo
774 |
799 |
775 o 0: 'base'
800 o 0: 'base'
776
801
777 $ hg manifest --rev tip
802 $ hg manifest --rev tip
778 b
803 b
779 base
804 base
780
805
781 $ cd ..
806 $ cd ..
@@ -1,307 +1,316 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}:{phase} '{desc}' {branches} {bookmarks}\n"
9 > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n"
10 > EOF
10 > EOF
11
11
12 $ hg init a
12 $ hg init a
13 $ cd a
13 $ cd a
14 $ echo c1 >common
14 $ echo c1 >common
15 $ hg add common
15 $ hg add common
16 $ hg ci -m C1
16 $ hg ci -m C1
17
17
18 $ echo c2 >>common
18 $ echo c2 >>common
19 $ hg ci -m C2
19 $ hg ci -m C2
20
20
21 $ echo c3 >>common
21 $ echo c3 >>common
22 $ hg ci -m C3
22 $ hg ci -m C3
23
23
24 $ hg up -q -C 1
24 $ hg up -q -C 1
25
25
26 $ echo l1 >>extra
26 $ echo l1 >>extra
27 $ hg add extra
27 $ hg add extra
28 $ hg ci -m L1
28 $ hg ci -m L1
29 created new head
29 created new head
30
30
31 $ sed -e 's/c2/l2/' common > common.new
31 $ sed -e 's/c2/l2/' common > common.new
32 $ mv common.new common
32 $ mv common.new common
33 $ hg ci -m L2
33 $ hg ci -m L2
34
34
35 $ echo l3 >> extra2
35 $ echo l3 >> extra2
36 $ hg add extra2
36 $ hg add extra2
37 $ hg ci -m L3
37 $ hg ci -m L3
38 $ hg bookmark mybook
38 $ hg bookmark mybook
39
39
40 $ hg phase --force --secret 4
40 $ hg phase --force --secret 4
41
41
42 $ hg tglog
42 $ hg tglog
43 @ 5:secret 'L3' mybook
43 @ 5:secret 'L3' mybook
44 |
44 |
45 o 4:secret 'L2'
45 o 4:secret 'L2'
46 |
46 |
47 o 3:draft 'L1'
47 o 3:draft 'L1'
48 |
48 |
49 | o 2:draft 'C3'
49 | o 2:draft 'C3'
50 |/
50 |/
51 o 1:draft 'C2'
51 o 1:draft 'C2'
52 |
52 |
53 o 0:draft 'C1'
53 o 0:draft 'C1'
54
54
55 Try to call --continue:
55 Try to call --continue:
56
56
57 $ hg rebase --continue
57 $ hg rebase --continue
58 abort: no rebase in progress
58 abort: no rebase in progress
59 [255]
59 [255]
60
60
61 Conflicting rebase:
61 Conflicting rebase:
62
62
63 $ hg rebase -s 3 -d 2
63 $ hg rebase -s 3 -d 2
64 rebasing 3:3163e20567cc "L1"
65 rebasing 4:46f0b057b5c0 "L2"
64 merging common
66 merging common
65 warning: conflicts during merge.
67 warning: conflicts during merge.
66 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
68 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
67 unresolved conflicts (see hg resolve, then hg rebase --continue)
69 unresolved conflicts (see hg resolve, then hg rebase --continue)
68 [1]
70 [1]
69
71
70 Try to continue without solving the conflict:
72 Try to continue without solving the conflict:
71
73
72 $ hg rebase --continue
74 $ hg rebase --continue
75 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
76 rebasing 4:46f0b057b5c0 "L2"
73 abort: unresolved merge conflicts (see hg help resolve)
77 abort: unresolved merge conflicts (see hg help resolve)
74 [255]
78 [255]
75
79
76 Conclude rebase:
80 Conclude rebase:
77
81
78 $ echo 'resolved merge' >common
82 $ echo 'resolved merge' >common
79 $ hg resolve -m common
83 $ hg resolve -m common
80 (no more unresolved files)
84 (no more unresolved files)
81 $ hg rebase --continue
85 $ hg rebase --continue
86 already rebased 3:3163e20567cc "L1" as 3e046f2ecedb
87 rebasing 4:46f0b057b5c0 "L2"
88 rebasing 5:8029388f38dc "L3" (mybook)
82 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-backup.hg (glob)
89 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-backup.hg (glob)
83
90
84 $ hg tglog
91 $ hg tglog
85 @ 5:secret 'L3' mybook
92 @ 5:secret 'L3' mybook
86 |
93 |
87 o 4:secret 'L2'
94 o 4:secret 'L2'
88 |
95 |
89 o 3:draft 'L1'
96 o 3:draft 'L1'
90 |
97 |
91 o 2:draft 'C3'
98 o 2:draft 'C3'
92 |
99 |
93 o 1:draft 'C2'
100 o 1:draft 'C2'
94 |
101 |
95 o 0:draft 'C1'
102 o 0:draft 'C1'
96
103
97 Check correctness:
104 Check correctness:
98
105
99 $ hg cat -r 0 common
106 $ hg cat -r 0 common
100 c1
107 c1
101
108
102 $ hg cat -r 1 common
109 $ hg cat -r 1 common
103 c1
110 c1
104 c2
111 c2
105
112
106 $ hg cat -r 2 common
113 $ hg cat -r 2 common
107 c1
114 c1
108 c2
115 c2
109 c3
116 c3
110
117
111 $ hg cat -r 3 common
118 $ hg cat -r 3 common
112 c1
119 c1
113 c2
120 c2
114 c3
121 c3
115
122
116 $ hg cat -r 4 common
123 $ hg cat -r 4 common
117 resolved merge
124 resolved merge
118
125
119 $ hg cat -r 5 common
126 $ hg cat -r 5 common
120 resolved merge
127 resolved merge
121
128
122 Bookmark stays active after --continue
129 Bookmark stays active after --continue
123 $ hg bookmarks
130 $ hg bookmarks
124 * mybook 5:d67b21408fc0
131 * mybook 5:d67b21408fc0
125
132
126 $ cd ..
133 $ cd ..
127
134
128 Check that the right ancestors is used while rebasing a merge (issue4041)
135 Check that the right ancestors is used while rebasing a merge (issue4041)
129
136
130 $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041
137 $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041
131 requesting all changes
138 requesting all changes
132 adding changesets
139 adding changesets
133 adding manifests
140 adding manifests
134 adding file changes
141 adding file changes
135 added 11 changesets with 8 changes to 3 files (+1 heads)
142 added 11 changesets with 8 changes to 3 files (+1 heads)
136 updating to branch default
143 updating to branch default
137 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
138 $ cd issue4041
145 $ cd issue4041
139 $ hg phase --draft --force 9
146 $ hg phase --draft --force 9
140 $ hg log -G
147 $ hg log -G
141 o changeset: 10:2f2496ddf49d
148 o changeset: 10:2f2496ddf49d
142 |\ branch: f1
149 |\ branch: f1
143 | | tag: tip
150 | | tag: tip
144 | | parent: 7:4c9fbe56a16f
151 | | parent: 7:4c9fbe56a16f
145 | | parent: 9:e31216eec445
152 | | parent: 9:e31216eec445
146 | | user: szhang
153 | | user: szhang
147 | | date: Thu Sep 05 12:59:39 2013 -0400
154 | | date: Thu Sep 05 12:59:39 2013 -0400
148 | | summary: merge
155 | | summary: merge
149 | |
156 | |
150 | o changeset: 9:e31216eec445
157 | o changeset: 9:e31216eec445
151 | | branch: f1
158 | | branch: f1
152 | | user: szhang
159 | | user: szhang
153 | | date: Thu Sep 05 12:59:10 2013 -0400
160 | | date: Thu Sep 05 12:59:10 2013 -0400
154 | | summary: more changes to f1
161 | | summary: more changes to f1
155 | |
162 | |
156 | o changeset: 8:8e4e2c1a07ae
163 | o changeset: 8:8e4e2c1a07ae
157 | |\ branch: f1
164 | |\ branch: f1
158 | | | parent: 2:4bc80088dc6b
165 | | | parent: 2:4bc80088dc6b
159 | | | parent: 6:400110238667
166 | | | parent: 6:400110238667
160 | | | user: szhang
167 | | | user: szhang
161 | | | date: Thu Sep 05 12:57:59 2013 -0400
168 | | | date: Thu Sep 05 12:57:59 2013 -0400
162 | | | summary: bad merge
169 | | | summary: bad merge
163 | | |
170 | | |
164 o | | changeset: 7:4c9fbe56a16f
171 o | | changeset: 7:4c9fbe56a16f
165 |/ / branch: f1
172 |/ / branch: f1
166 | | parent: 2:4bc80088dc6b
173 | | parent: 2:4bc80088dc6b
167 | | user: szhang
174 | | user: szhang
168 | | date: Thu Sep 05 12:54:00 2013 -0400
175 | | date: Thu Sep 05 12:54:00 2013 -0400
169 | | summary: changed f1
176 | | summary: changed f1
170 | |
177 | |
171 | o changeset: 6:400110238667
178 | o changeset: 6:400110238667
172 | | branch: f2
179 | | branch: f2
173 | | parent: 4:12e8ec6bb010
180 | | parent: 4:12e8ec6bb010
174 | | user: szhang
181 | | user: szhang
175 | | date: Tue Sep 03 13:58:02 2013 -0400
182 | | date: Tue Sep 03 13:58:02 2013 -0400
176 | | summary: changed f2 on f2
183 | | summary: changed f2 on f2
177 | |
184 | |
178 | | @ changeset: 5:d79e2059b5c0
185 | | @ changeset: 5:d79e2059b5c0
179 | | | parent: 3:8a951942e016
186 | | | parent: 3:8a951942e016
180 | | | user: szhang
187 | | | user: szhang
181 | | | date: Tue Sep 03 13:57:39 2013 -0400
188 | | | date: Tue Sep 03 13:57:39 2013 -0400
182 | | | summary: changed f2 on default
189 | | | summary: changed f2 on default
183 | | |
190 | | |
184 | o | changeset: 4:12e8ec6bb010
191 | o | changeset: 4:12e8ec6bb010
185 | |/ branch: f2
192 | |/ branch: f2
186 | | user: szhang
193 | | user: szhang
187 | | date: Tue Sep 03 13:57:18 2013 -0400
194 | | date: Tue Sep 03 13:57:18 2013 -0400
188 | | summary: created f2 branch
195 | | summary: created f2 branch
189 | |
196 | |
190 | o changeset: 3:8a951942e016
197 | o changeset: 3:8a951942e016
191 | | parent: 0:24797d4f68de
198 | | parent: 0:24797d4f68de
192 | | user: szhang
199 | | user: szhang
193 | | date: Tue Sep 03 13:57:11 2013 -0400
200 | | date: Tue Sep 03 13:57:11 2013 -0400
194 | | summary: added f2.txt
201 | | summary: added f2.txt
195 | |
202 | |
196 o | changeset: 2:4bc80088dc6b
203 o | changeset: 2:4bc80088dc6b
197 | | branch: f1
204 | | branch: f1
198 | | user: szhang
205 | | user: szhang
199 | | date: Tue Sep 03 13:56:20 2013 -0400
206 | | date: Tue Sep 03 13:56:20 2013 -0400
200 | | summary: added f1.txt
207 | | summary: added f1.txt
201 | |
208 | |
202 o | changeset: 1:ef53c9e6b608
209 o | changeset: 1:ef53c9e6b608
203 |/ branch: f1
210 |/ branch: f1
204 | user: szhang
211 | user: szhang
205 | date: Tue Sep 03 13:55:26 2013 -0400
212 | date: Tue Sep 03 13:55:26 2013 -0400
206 | summary: created f1 branch
213 | summary: created f1 branch
207 |
214 |
208 o changeset: 0:24797d4f68de
215 o changeset: 0:24797d4f68de
209 user: szhang
216 user: szhang
210 date: Tue Sep 03 13:55:08 2013 -0400
217 date: Tue Sep 03 13:55:08 2013 -0400
211 summary: added default.txt
218 summary: added default.txt
212
219
213 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
220 $ hg rebase -s9 -d2 --debug # use debug to really check merge base used
214 rebase onto 2 starting from e31216eec445
221 rebase onto 2 starting from e31216eec445
222 rebasing 9:e31216eec445 "more changes to f1"
215 rebasing: 9:e31216eec445 5/6 changesets (83.33%)
223 rebasing: 9:e31216eec445 5/6 changesets (83.33%)
216 future parents are 2 and -1
224 future parents are 2 and -1
217 rebase status stored
225 rebase status stored
218 update to 2:4bc80088dc6b
226 update to 2:4bc80088dc6b
219 resolving manifests
227 resolving manifests
220 branchmerge: False, force: True, partial: False
228 branchmerge: False, force: True, partial: False
221 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
229 ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b
222 f2.txt: other deleted -> r
230 f2.txt: other deleted -> r
223 removing f2.txt
231 removing f2.txt
224 updating: f2.txt 1/2 files (50.00%)
232 updating: f2.txt 1/2 files (50.00%)
225 f1.txt: remote created -> g
233 f1.txt: remote created -> g
226 getting f1.txt
234 getting f1.txt
227 updating: f1.txt 2/2 files (100.00%)
235 updating: f1.txt 2/2 files (100.00%)
228 merge against 9:e31216eec445
236 merge against 9:e31216eec445
229 detach base 8:8e4e2c1a07ae
237 detach base 8:8e4e2c1a07ae
230 searching for copies back to rev 3
238 searching for copies back to rev 3
231 resolving manifests
239 resolving manifests
232 branchmerge: True, force: True, partial: False
240 branchmerge: True, force: True, partial: False
233 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
241 ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445
234 f1.txt: remote is newer -> g
242 f1.txt: remote is newer -> g
235 getting f1.txt
243 getting f1.txt
236 updating: f1.txt 1/1 files (100.00%)
244 updating: f1.txt 1/1 files (100.00%)
237 f1.txt
245 f1.txt
246 rebasing 10:2f2496ddf49d "merge" (tip)
238 rebasing: 10:2f2496ddf49d 6/6 changesets (100.00%)
247 rebasing: 10:2f2496ddf49d 6/6 changesets (100.00%)
239 future parents are 11 and 7
248 future parents are 11 and 7
240 rebase status stored
249 rebase status stored
241 already in target
250 already in target
242 merge against 10:2f2496ddf49d
251 merge against 10:2f2496ddf49d
243 detach base 9:e31216eec445
252 detach base 9:e31216eec445
244 searching for copies back to rev 3
253 searching for copies back to rev 3
245 resolving manifests
254 resolving manifests
246 branchmerge: True, force: True, partial: False
255 branchmerge: True, force: True, partial: False
247 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
256 ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d
248 f1.txt: remote is newer -> g
257 f1.txt: remote is newer -> g
249 getting f1.txt
258 getting f1.txt
250 updating: f1.txt 1/1 files (100.00%)
259 updating: f1.txt 1/1 files (100.00%)
251 f1.txt
260 f1.txt
252 rebase merging completed
261 rebase merging completed
253 update back to initial working directory parent
262 update back to initial working directory parent
254 resolving manifests
263 resolving manifests
255 branchmerge: False, force: False, partial: False
264 branchmerge: False, force: False, partial: False
256 ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0
265 ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0
257 f1.txt: other deleted -> r
266 f1.txt: other deleted -> r
258 removing f1.txt
267 removing f1.txt
259 updating: f1.txt 1/2 files (50.00%)
268 updating: f1.txt 1/2 files (50.00%)
260 f2.txt: remote created -> g
269 f2.txt: remote created -> g
261 getting f2.txt
270 getting f2.txt
262 updating: f2.txt 2/2 files (100.00%)
271 updating: f2.txt 2/2 files (100.00%)
263 3 changesets found
272 3 changesets found
264 list of changesets:
273 list of changesets:
265 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
274 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
266 e31216eec445e44352c5f01588856059466a24c9
275 e31216eec445e44352c5f01588856059466a24c9
267 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
276 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2
268 bundling: 1/3 changesets (33.33%)
277 bundling: 1/3 changesets (33.33%)
269 bundling: 2/3 changesets (66.67%)
278 bundling: 2/3 changesets (66.67%)
270 bundling: 3/3 changesets (100.00%)
279 bundling: 3/3 changesets (100.00%)
271 bundling: 1/3 manifests (33.33%)
280 bundling: 1/3 manifests (33.33%)
272 bundling: 2/3 manifests (66.67%)
281 bundling: 2/3 manifests (66.67%)
273 bundling: 3/3 manifests (100.00%)
282 bundling: 3/3 manifests (100.00%)
274 bundling: f1.txt 1/1 files (100.00%)
283 bundling: f1.txt 1/1 files (100.00%)
275 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-backup.hg (glob)
284 saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-backup.hg (glob)
276 3 changesets found
285 3 changesets found
277 list of changesets:
286 list of changesets:
278 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
287 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c
279 19c888675e133ab5dff84516926a65672eaf04d9
288 19c888675e133ab5dff84516926a65672eaf04d9
280 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
289 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf
281 bundling: 1/3 changesets (33.33%)
290 bundling: 1/3 changesets (33.33%)
282 bundling: 2/3 changesets (66.67%)
291 bundling: 2/3 changesets (66.67%)
283 bundling: 3/3 changesets (100.00%)
292 bundling: 3/3 changesets (100.00%)
284 bundling: 1/3 manifests (33.33%)
293 bundling: 1/3 manifests (33.33%)
285 bundling: 2/3 manifests (66.67%)
294 bundling: 2/3 manifests (66.67%)
286 bundling: 3/3 manifests (100.00%)
295 bundling: 3/3 manifests (100.00%)
287 bundling: f1.txt 1/1 files (100.00%)
296 bundling: f1.txt 1/1 files (100.00%)
288 adding branch
297 adding branch
289 adding changesets
298 adding changesets
290 changesets: 1 chunks
299 changesets: 1 chunks
291 add changeset 4c9fbe56a16f
300 add changeset 4c9fbe56a16f
292 changesets: 2 chunks
301 changesets: 2 chunks
293 add changeset 19c888675e13
302 add changeset 19c888675e13
294 changesets: 3 chunks
303 changesets: 3 chunks
295 add changeset 2a7f09cac94c
304 add changeset 2a7f09cac94c
296 adding manifests
305 adding manifests
297 manifests: 1/2 chunks (50.00%)
306 manifests: 1/2 chunks (50.00%)
298 manifests: 2/2 chunks (100.00%)
307 manifests: 2/2 chunks (100.00%)
299 manifests: 3/2 chunks (150.00%)
308 manifests: 3/2 chunks (150.00%)
300 adding file changes
309 adding file changes
301 adding f1.txt revisions
310 adding f1.txt revisions
302 files: 1/1 chunks (100.00%)
311 files: 1/1 chunks (100.00%)
303 added 2 changesets with 2 changes to 1 files
312 added 2 changesets with 2 changes to 1 files
304 removing unknown node e31216eec445 from 1-phase boundary
313 removing unknown node e31216eec445 from 1-phase boundary
305 invalid branchheads cache (served): tip differs
314 invalid branchheads cache (served): tip differs
306 rebase completed
315 rebase completed
307 updating the branch cache
316 updating the branch cache
@@ -1,398 +1,416 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 $ cd ..
24 $ cd ..
25
25
26
26
27 Rebasing D onto H detaching from C:
27 Rebasing D onto H detaching from C:
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 $ hg phase --force --secret 3
49 $ hg phase --force --secret 3
50 $ hg rebase -s 3 -d 7
50 $ hg rebase -s 3 -d 7
51 rebasing 3:32af7686d403 "D"
51 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-backup.hg (glob)
52 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-backup.hg (glob)
52
53
53 $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
54 $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
54 o 7:secret 'D'
55 o 7:secret 'D'
55 |
56 |
56 @ 6:draft 'H'
57 @ 6:draft 'H'
57 |
58 |
58 | o 5:draft 'G'
59 | o 5:draft 'G'
59 |/|
60 |/|
60 o | 4:draft 'F'
61 o | 4:draft 'F'
61 | |
62 | |
62 | o 3:draft 'E'
63 | o 3:draft 'E'
63 |/
64 |/
64 | o 2:draft 'C'
65 | o 2:draft 'C'
65 | |
66 | |
66 | o 1:draft 'B'
67 | o 1:draft 'B'
67 |/
68 |/
68 o 0:draft 'A'
69 o 0:draft 'A'
69
70
70 $ hg manifest --rev tip
71 $ hg manifest --rev tip
71 A
72 A
72 D
73 D
73 F
74 F
74 H
75 H
75
76
76 $ cd ..
77 $ cd ..
77
78
78
79
79 Rebasing C onto H detaching from B:
80 Rebasing C onto H detaching from B:
80
81
81 $ hg clone -q -u . a a2
82 $ hg clone -q -u . a a2
82 $ cd a2
83 $ cd a2
83
84
84 $ hg tglog
85 $ hg tglog
85 @ 7: 'H'
86 @ 7: 'H'
86 |
87 |
87 | o 6: 'G'
88 | o 6: 'G'
88 |/|
89 |/|
89 o | 5: 'F'
90 o | 5: 'F'
90 | |
91 | |
91 | o 4: 'E'
92 | o 4: 'E'
92 |/
93 |/
93 | o 3: 'D'
94 | o 3: 'D'
94 | |
95 | |
95 | o 2: 'C'
96 | o 2: 'C'
96 | |
97 | |
97 | o 1: 'B'
98 | o 1: 'B'
98 |/
99 |/
99 o 0: 'A'
100 o 0: 'A'
100
101
101 $ hg rebase -s 2 -d 7
102 $ hg rebase -s 2 -d 7
103 rebasing 2:5fddd98957c8 "C"
104 rebasing 3:32af7686d403 "D"
102 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
105 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
103
106
104 $ hg tglog
107 $ hg tglog
105 o 7: 'D'
108 o 7: 'D'
106 |
109 |
107 o 6: 'C'
110 o 6: 'C'
108 |
111 |
109 @ 5: 'H'
112 @ 5: 'H'
110 |
113 |
111 | o 4: 'G'
114 | o 4: 'G'
112 |/|
115 |/|
113 o | 3: 'F'
116 o | 3: 'F'
114 | |
117 | |
115 | o 2: 'E'
118 | o 2: 'E'
116 |/
119 |/
117 | o 1: 'B'
120 | o 1: 'B'
118 |/
121 |/
119 o 0: 'A'
122 o 0: 'A'
120
123
121 $ hg manifest --rev tip
124 $ hg manifest --rev tip
122 A
125 A
123 C
126 C
124 D
127 D
125 F
128 F
126 H
129 H
127
130
128 $ cd ..
131 $ cd ..
129
132
130
133
131 Rebasing B onto H using detach (same as not using it):
134 Rebasing B onto H using detach (same as not using it):
132
135
133 $ hg clone -q -u . a a3
136 $ hg clone -q -u . a a3
134 $ cd a3
137 $ cd a3
135
138
136 $ hg tglog
139 $ hg tglog
137 @ 7: 'H'
140 @ 7: 'H'
138 |
141 |
139 | o 6: 'G'
142 | o 6: 'G'
140 |/|
143 |/|
141 o | 5: 'F'
144 o | 5: 'F'
142 | |
145 | |
143 | o 4: 'E'
146 | o 4: 'E'
144 |/
147 |/
145 | o 3: 'D'
148 | o 3: 'D'
146 | |
149 | |
147 | o 2: 'C'
150 | o 2: 'C'
148 | |
151 | |
149 | o 1: 'B'
152 | o 1: 'B'
150 |/
153 |/
151 o 0: 'A'
154 o 0: 'A'
152
155
153 $ hg rebase -s 1 -d 7
156 $ hg rebase -s 1 -d 7
157 rebasing 1:42ccdea3bb16 "B"
158 rebasing 2:5fddd98957c8 "C"
159 rebasing 3:32af7686d403 "D"
154 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
160 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
155
161
156 $ hg tglog
162 $ hg tglog
157 o 7: 'D'
163 o 7: 'D'
158 |
164 |
159 o 6: 'C'
165 o 6: 'C'
160 |
166 |
161 o 5: 'B'
167 o 5: 'B'
162 |
168 |
163 @ 4: 'H'
169 @ 4: 'H'
164 |
170 |
165 | o 3: 'G'
171 | o 3: 'G'
166 |/|
172 |/|
167 o | 2: 'F'
173 o | 2: 'F'
168 | |
174 | |
169 | o 1: 'E'
175 | o 1: 'E'
170 |/
176 |/
171 o 0: 'A'
177 o 0: 'A'
172
178
173 $ hg manifest --rev tip
179 $ hg manifest --rev tip
174 A
180 A
175 B
181 B
176 C
182 C
177 D
183 D
178 F
184 F
179 H
185 H
180
186
181 $ cd ..
187 $ cd ..
182
188
183
189
184 Rebasing C onto H detaching from B and collapsing:
190 Rebasing C onto H detaching from B and collapsing:
185
191
186 $ hg clone -q -u . a a4
192 $ hg clone -q -u . a a4
187 $ cd a4
193 $ cd a4
188 $ hg phase --force --secret 3
194 $ hg phase --force --secret 3
189
195
190 $ hg tglog
196 $ hg tglog
191 @ 7: 'H'
197 @ 7: 'H'
192 |
198 |
193 | o 6: 'G'
199 | o 6: 'G'
194 |/|
200 |/|
195 o | 5: 'F'
201 o | 5: 'F'
196 | |
202 | |
197 | o 4: 'E'
203 | o 4: 'E'
198 |/
204 |/
199 | o 3: 'D'
205 | o 3: 'D'
200 | |
206 | |
201 | o 2: 'C'
207 | o 2: 'C'
202 | |
208 | |
203 | o 1: 'B'
209 | o 1: 'B'
204 |/
210 |/
205 o 0: 'A'
211 o 0: 'A'
206
212
207 $ hg rebase --collapse -s 2 -d 7
213 $ hg rebase --collapse -s 2 -d 7
214 rebasing 2:5fddd98957c8 "C"
215 rebasing 3:32af7686d403 "D"
208 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
216 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
209
217
210 $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
218 $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
211 o 6:secret 'Collapsed revision
219 o 6:secret 'Collapsed revision
212 | * C
220 | * C
213 | * D'
221 | * D'
214 @ 5:draft 'H'
222 @ 5:draft 'H'
215 |
223 |
216 | o 4:draft 'G'
224 | o 4:draft 'G'
217 |/|
225 |/|
218 o | 3:draft 'F'
226 o | 3:draft 'F'
219 | |
227 | |
220 | o 2:draft 'E'
228 | o 2:draft 'E'
221 |/
229 |/
222 | o 1:draft 'B'
230 | o 1:draft 'B'
223 |/
231 |/
224 o 0:draft 'A'
232 o 0:draft 'A'
225
233
226 $ hg manifest --rev tip
234 $ hg manifest --rev tip
227 A
235 A
228 C
236 C
229 D
237 D
230 F
238 F
231 H
239 H
232
240
233 $ cd ..
241 $ cd ..
234
242
235 Rebasing across null as ancestor
243 Rebasing across null as ancestor
236 $ hg clone -q -U a a5
244 $ hg clone -q -U a a5
237
245
238 $ cd a5
246 $ cd a5
239
247
240 $ echo x > x
248 $ echo x > x
241
249
242 $ hg add x
250 $ hg add x
243
251
244 $ hg ci -m "extra branch"
252 $ hg ci -m "extra branch"
245 created new head
253 created new head
246
254
247 $ hg tglog
255 $ hg tglog
248 @ 8: 'extra branch'
256 @ 8: 'extra branch'
249
257
250 o 7: 'H'
258 o 7: 'H'
251 |
259 |
252 | o 6: 'G'
260 | o 6: 'G'
253 |/|
261 |/|
254 o | 5: 'F'
262 o | 5: 'F'
255 | |
263 | |
256 | o 4: 'E'
264 | o 4: 'E'
257 |/
265 |/
258 | o 3: 'D'
266 | o 3: 'D'
259 | |
267 | |
260 | o 2: 'C'
268 | o 2: 'C'
261 | |
269 | |
262 | o 1: 'B'
270 | o 1: 'B'
263 |/
271 |/
264 o 0: 'A'
272 o 0: 'A'
265
273
266 $ hg rebase -s 1 -d tip
274 $ hg rebase -s 1 -d tip
275 rebasing 1:42ccdea3bb16 "B"
276 rebasing 2:5fddd98957c8 "C"
277 rebasing 3:32af7686d403 "D"
267 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
278 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-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: 'extra branch'
287 @ 5: 'extra branch'
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
299
289 $ hg rebase -d 5 -s 7
300 $ hg rebase -d 5 -s 7
301 rebasing 7:13547172c9c0 "C"
302 rebasing 8:4e27a76c371a "D" (tip)
290 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg (glob)
303 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg (glob)
291 $ hg tglog
304 $ hg tglog
292 o 8: 'D'
305 o 8: 'D'
293 |
306 |
294 o 7: 'C'
307 o 7: 'C'
295 |
308 |
296 | o 6: 'B'
309 | o 6: 'B'
297 |/
310 |/
298 @ 5: 'extra branch'
311 @ 5: 'extra branch'
299
312
300 o 4: 'H'
313 o 4: 'H'
301 |
314 |
302 | o 3: 'G'
315 | o 3: 'G'
303 |/|
316 |/|
304 o | 2: 'F'
317 o | 2: 'F'
305 | |
318 | |
306 | o 1: 'E'
319 | o 1: 'E'
307 |/
320 |/
308 o 0: 'A'
321 o 0: 'A'
309
322
310 $ cd ..
323 $ cd ..
311
324
312 Verify that target is not selected as external rev (issue3085)
325 Verify that target is not selected as external rev (issue3085)
313
326
314 $ hg clone -q -U a a6
327 $ hg clone -q -U a a6
315 $ cd a6
328 $ cd a6
316 $ hg up -q 6
329 $ hg up -q 6
317
330
318 $ echo "I" >> E
331 $ echo "I" >> E
319 $ hg ci -m "I"
332 $ hg ci -m "I"
320 $ hg merge 7
333 $ hg merge 7
321 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
334 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 (branch merge, don't forget to commit)
335 (branch merge, don't forget to commit)
323 $ hg ci -m "Merge"
336 $ hg ci -m "Merge"
324 $ echo "J" >> F
337 $ echo "J" >> F
325 $ hg ci -m "J"
338 $ hg ci -m "J"
326
339
327 $ hg rebase -s 8 -d 7 --collapse --config ui.merge=internal:other
340 $ hg rebase -s 8 -d 7 --collapse --config ui.merge=internal:other
341 rebasing 8:9790e768172d "I"
342 rebasing 9:5d7b11f5fb97 "Merge"
343 rebasing 10:9427d4d5af81 "J" (tip)
328 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/9790e768172d-backup.hg (glob)
344 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/9790e768172d-backup.hg (glob)
329
345
330 $ hg tglog
346 $ hg tglog
331 @ 8: 'Collapsed revision
347 @ 8: 'Collapsed revision
332 | * I
348 | * I
333 | * Merge
349 | * Merge
334 | * J'
350 | * J'
335 o 7: 'H'
351 o 7: 'H'
336 |
352 |
337 | o 6: 'G'
353 | o 6: 'G'
338 |/|
354 |/|
339 o | 5: 'F'
355 o | 5: 'F'
340 | |
356 | |
341 | o 4: 'E'
357 | o 4: 'E'
342 |/
358 |/
343 | o 3: 'D'
359 | o 3: 'D'
344 | |
360 | |
345 | o 2: 'C'
361 | o 2: 'C'
346 | |
362 | |
347 | o 1: 'B'
363 | o 1: 'B'
348 |/
364 |/
349 o 0: 'A'
365 o 0: 'A'
350
366
351
367
352 $ hg log --rev tip
368 $ hg log --rev tip
353 changeset: 8:9472f4b1d736
369 changeset: 8:9472f4b1d736
354 tag: tip
370 tag: tip
355 user: test
371 user: test
356 date: Thu Jan 01 00:00:00 1970 +0000
372 date: Thu Jan 01 00:00:00 1970 +0000
357 summary: Collapsed revision
373 summary: Collapsed revision
358
374
359
375
360 $ cd ..
376 $ cd ..
361
377
362 Ensure --continue restores a correct state (issue3046) and phase:
378 Ensure --continue restores a correct state (issue3046) and phase:
363 $ hg clone -q a a7
379 $ hg clone -q a a7
364 $ cd a7
380 $ cd a7
365 $ hg up -q 3
381 $ hg up -q 3
366 $ echo 'H2' > H
382 $ echo 'H2' > H
367 $ hg ci -A -m 'H2'
383 $ hg ci -A -m 'H2'
368 adding H
384 adding H
369 $ hg phase --force --secret 8
385 $ hg phase --force --secret 8
370 $ hg rebase -s 8 -d 7 --config ui.merge=internal:fail
386 $ hg rebase -s 8 -d 7 --config ui.merge=internal:fail
387 rebasing 8:6215fafa5447 "H2" (tip)
371 merging H
388 merging H
372 warning: conflicts during merge.
389 warning: conflicts during merge.
373 merging H incomplete! (edit conflicts, then use 'hg resolve --mark')
390 merging H incomplete! (edit conflicts, then use 'hg resolve --mark')
374 unresolved conflicts (see hg resolve, then hg rebase --continue)
391 unresolved conflicts (see hg resolve, then hg rebase --continue)
375 [1]
392 [1]
376 $ hg resolve --all -t internal:local
393 $ hg resolve --all -t internal:local
377 (no more unresolved files)
394 (no more unresolved files)
378 $ hg rebase -c
395 $ hg rebase -c
396 rebasing 8:6215fafa5447 "H2" (tip)
379 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg (glob)
397 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6215fafa5447-backup.hg (glob)
380 $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
398 $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
381 @ 7:draft 'H'
399 @ 7:draft 'H'
382 |
400 |
383 | o 6:draft 'G'
401 | o 6:draft 'G'
384 |/|
402 |/|
385 o | 5:draft 'F'
403 o | 5:draft 'F'
386 | |
404 | |
387 | o 4:draft 'E'
405 | o 4:draft 'E'
388 |/
406 |/
389 | o 3:draft 'D'
407 | o 3:draft 'D'
390 | |
408 | |
391 | o 2:draft 'C'
409 | o 2:draft 'C'
392 | |
410 | |
393 | o 1:draft 'B'
411 | o 1:draft 'B'
394 |/
412 |/
395 o 0:draft 'A'
413 o 0:draft 'A'
396
414
397
415
398 $ cd ..
416 $ cd ..
@@ -1,267 +1,277 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 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
10 > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
11 > EOF
11 > EOF
12
12
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16
16
17 $ echo A > A
17 $ echo A > A
18 $ hg ci -Am A
18 $ hg ci -Am A
19 adding A
19 adding A
20
20
21 $ echo B > B
21 $ echo B > B
22 $ hg ci -Am B
22 $ hg ci -Am B
23 adding B
23 adding B
24
24
25 $ echo C >> A
25 $ echo C >> A
26 $ hg ci -m C
26 $ hg ci -m C
27
27
28 $ hg up -q -C 0
28 $ hg up -q -C 0
29
29
30 $ echo D >> A
30 $ echo D >> A
31 $ hg ci -m D
31 $ hg ci -m D
32 created new head
32 created new head
33
33
34 $ echo E > E
34 $ echo E > E
35 $ hg ci -Am E
35 $ hg ci -Am E
36 adding E
36 adding E
37
37
38 $ cd ..
38 $ cd ..
39
39
40
40
41 Changes during an interruption - continue:
41 Changes during an interruption - continue:
42
42
43 $ hg clone -q -u . a a1
43 $ hg clone -q -u . a a1
44 $ cd a1
44 $ cd a1
45
45
46 $ hg tglog
46 $ hg tglog
47 @ 4: 'E'
47 @ 4: 'E'
48 |
48 |
49 o 3: 'D'
49 o 3: 'D'
50 |
50 |
51 | o 2: 'C'
51 | o 2: 'C'
52 | |
52 | |
53 | o 1: 'B'
53 | o 1: 'B'
54 |/
54 |/
55 o 0: 'A'
55 o 0: 'A'
56
56
57 Rebasing B onto E:
57 Rebasing B onto E:
58
58
59 $ hg rebase -s 1 -d 4
59 $ hg rebase -s 1 -d 4
60 rebasing 1:27547f69f254 "B"
61 rebasing 2:965c486023db "C"
60 merging A
62 merging A
61 warning: conflicts during merge.
63 warning: conflicts during merge.
62 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
64 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
63 unresolved conflicts (see hg resolve, then hg rebase --continue)
65 unresolved conflicts (see hg resolve, then hg rebase --continue)
64 [1]
66 [1]
65
67
66 Force a commit on C during the interruption:
68 Force a commit on C during the interruption:
67
69
68 $ hg up -q -C 2 --config 'extensions.rebase=!'
70 $ hg up -q -C 2 --config 'extensions.rebase=!'
69
71
70 $ echo 'Extra' > Extra
72 $ echo 'Extra' > Extra
71 $ hg add Extra
73 $ hg add Extra
72 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
74 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
73
75
74 Force this commit onto secret phase
76 Force this commit onto secret phase
75
77
76 $ hg phase --force --secret 6
78 $ hg phase --force --secret 6
77
79
78 $ hg tglogp
80 $ hg tglogp
79 @ 6:secret 'Extra'
81 @ 6:secret 'Extra'
80 |
82 |
81 | o 5:draft 'B'
83 | o 5:draft 'B'
82 | |
84 | |
83 | o 4:draft 'E'
85 | o 4:draft 'E'
84 | |
86 | |
85 | o 3:draft 'D'
87 | o 3:draft 'D'
86 | |
88 | |
87 o | 2:draft 'C'
89 o | 2:draft 'C'
88 | |
90 | |
89 o | 1:draft 'B'
91 o | 1:draft 'B'
90 |/
92 |/
91 o 0:draft 'A'
93 o 0:draft 'A'
92
94
93 Resume the rebasing:
95 Resume the rebasing:
94
96
95 $ hg rebase --continue
97 $ hg rebase --continue
98 already rebased 1:27547f69f254 "B" as 45396c49d53b
99 rebasing 2:965c486023db "C"
96 merging A
100 merging A
97 warning: conflicts during merge.
101 warning: conflicts during merge.
98 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
102 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
99 unresolved conflicts (see hg resolve, then hg rebase --continue)
103 unresolved conflicts (see hg resolve, then hg rebase --continue)
100 [1]
104 [1]
101
105
102 Solve the conflict and go on:
106 Solve the conflict and go on:
103
107
104 $ echo 'conflict solved' > A
108 $ echo 'conflict solved' > A
105 $ rm A.orig
109 $ rm A.orig
106 $ hg resolve -m A
110 $ hg resolve -m A
107 (no more unresolved files)
111 (no more unresolved files)
108
112
109 $ hg rebase --continue
113 $ hg rebase --continue
114 already rebased 1:27547f69f254 "B" as 45396c49d53b
115 rebasing 2:965c486023db "C"
110 warning: new changesets detected on source branch, not stripping
116 warning: new changesets detected on source branch, not stripping
111
117
112 $ hg tglogp
118 $ hg tglogp
113 o 7:draft 'C'
119 o 7:draft 'C'
114 |
120 |
115 | o 6:secret 'Extra'
121 | o 6:secret 'Extra'
116 | |
122 | |
117 o | 5:draft 'B'
123 o | 5:draft 'B'
118 | |
124 | |
119 @ | 4:draft 'E'
125 @ | 4:draft 'E'
120 | |
126 | |
121 o | 3:draft 'D'
127 o | 3:draft 'D'
122 | |
128 | |
123 | o 2:draft 'C'
129 | o 2:draft 'C'
124 | |
130 | |
125 | o 1:draft 'B'
131 | o 1:draft 'B'
126 |/
132 |/
127 o 0:draft 'A'
133 o 0:draft 'A'
128
134
129 $ cd ..
135 $ cd ..
130
136
131
137
132 Changes during an interruption - abort:
138 Changes during an interruption - abort:
133
139
134 $ hg clone -q -u . a a2
140 $ hg clone -q -u . a a2
135 $ cd a2
141 $ cd a2
136
142
137 $ hg tglog
143 $ hg tglog
138 @ 4: 'E'
144 @ 4: 'E'
139 |
145 |
140 o 3: 'D'
146 o 3: 'D'
141 |
147 |
142 | o 2: 'C'
148 | o 2: 'C'
143 | |
149 | |
144 | o 1: 'B'
150 | o 1: 'B'
145 |/
151 |/
146 o 0: 'A'
152 o 0: 'A'
147
153
148 Rebasing B onto E:
154 Rebasing B onto E:
149
155
150 $ hg rebase -s 1 -d 4
156 $ hg rebase -s 1 -d 4
157 rebasing 1:27547f69f254 "B"
158 rebasing 2:965c486023db "C"
151 merging A
159 merging A
152 warning: conflicts during merge.
160 warning: conflicts during merge.
153 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
161 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
154 unresolved conflicts (see hg resolve, then hg rebase --continue)
162 unresolved conflicts (see hg resolve, then hg rebase --continue)
155 [1]
163 [1]
156
164
157 Force a commit on B' during the interruption:
165 Force a commit on B' during the interruption:
158
166
159 $ hg up -q -C 5 --config 'extensions.rebase=!'
167 $ hg up -q -C 5 --config 'extensions.rebase=!'
160
168
161 $ echo 'Extra' > Extra
169 $ echo 'Extra' > Extra
162 $ hg add Extra
170 $ hg add Extra
163 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
171 $ hg ci -m 'Extra' --config 'extensions.rebase=!'
164
172
165 $ hg tglog
173 $ hg tglog
166 @ 6: 'Extra'
174 @ 6: 'Extra'
167 |
175 |
168 o 5: 'B'
176 o 5: 'B'
169 |
177 |
170 o 4: 'E'
178 o 4: 'E'
171 |
179 |
172 o 3: 'D'
180 o 3: 'D'
173 |
181 |
174 | o 2: 'C'
182 | o 2: 'C'
175 | |
183 | |
176 | o 1: 'B'
184 | o 1: 'B'
177 |/
185 |/
178 o 0: 'A'
186 o 0: 'A'
179
187
180 Abort the rebasing:
188 Abort the rebasing:
181
189
182 $ hg rebase --abort
190 $ hg rebase --abort
183 warning: new changesets detected on target branch, can't strip
191 warning: new changesets detected on target branch, can't strip
184 rebase aborted
192 rebase aborted
185
193
186 $ hg tglog
194 $ hg tglog
187 @ 6: 'Extra'
195 @ 6: 'Extra'
188 |
196 |
189 o 5: 'B'
197 o 5: 'B'
190 |
198 |
191 o 4: 'E'
199 o 4: 'E'
192 |
200 |
193 o 3: 'D'
201 o 3: 'D'
194 |
202 |
195 | o 2: 'C'
203 | o 2: 'C'
196 | |
204 | |
197 | o 1: 'B'
205 | o 1: 'B'
198 |/
206 |/
199 o 0: 'A'
207 o 0: 'A'
200
208
201 $ cd ..
209 $ cd ..
202
210
203 Changes during an interruption - abort (again):
211 Changes during an interruption - abort (again):
204
212
205 $ hg clone -q -u . a a3
213 $ hg clone -q -u . a a3
206 $ cd a3
214 $ cd a3
207
215
208 $ hg tglogp
216 $ hg tglogp
209 @ 4:draft 'E'
217 @ 4:draft 'E'
210 |
218 |
211 o 3:draft 'D'
219 o 3:draft 'D'
212 |
220 |
213 | o 2:draft 'C'
221 | o 2:draft 'C'
214 | |
222 | |
215 | o 1:draft 'B'
223 | o 1:draft 'B'
216 |/
224 |/
217 o 0:draft 'A'
225 o 0:draft 'A'
218
226
219 Rebasing B onto E:
227 Rebasing B onto E:
220
228
221 $ hg rebase -s 1 -d 4
229 $ hg rebase -s 1 -d 4
230 rebasing 1:27547f69f254 "B"
231 rebasing 2:965c486023db "C"
222 merging A
232 merging A
223 warning: conflicts during merge.
233 warning: conflicts during merge.
224 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
234 merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
225 unresolved conflicts (see hg resolve, then hg rebase --continue)
235 unresolved conflicts (see hg resolve, then hg rebase --continue)
226 [1]
236 [1]
227
237
228 Change phase on B and B'
238 Change phase on B and B'
229
239
230 $ hg up -q -C 5 --config 'extensions.rebase=!'
240 $ hg up -q -C 5 --config 'extensions.rebase=!'
231 $ hg phase --public 1
241 $ hg phase --public 1
232 $ hg phase --public 5
242 $ hg phase --public 5
233 $ hg phase --secret -f 2
243 $ hg phase --secret -f 2
234
244
235 $ hg tglogp
245 $ hg tglogp
236 @ 5:public 'B'
246 @ 5:public 'B'
237 |
247 |
238 o 4:public 'E'
248 o 4:public 'E'
239 |
249 |
240 o 3:public 'D'
250 o 3:public 'D'
241 |
251 |
242 | o 2:secret 'C'
252 | o 2:secret 'C'
243 | |
253 | |
244 | o 1:public 'B'
254 | o 1:public 'B'
245 |/
255 |/
246 o 0:public 'A'
256 o 0:public 'A'
247
257
248 Abort the rebasing:
258 Abort the rebasing:
249
259
250 $ hg rebase --abort
260 $ hg rebase --abort
251 warning: can't clean up immutable changesets 45396c49d53b
261 warning: can't clean up immutable changesets 45396c49d53b
252 rebase aborted
262 rebase aborted
253
263
254 $ hg tglogp
264 $ hg tglogp
255 @ 5:public 'B'
265 @ 5:public 'B'
256 |
266 |
257 o 4:public 'E'
267 o 4:public 'E'
258 |
268 |
259 o 3:public 'D'
269 o 3:public 'D'
260 |
270 |
261 | o 2:secret 'C'
271 | o 2:secret 'C'
262 | |
272 | |
263 | o 1:public 'B'
273 | o 1:public 'B'
264 |/
274 |/
265 o 0:public 'A'
275 o 0:public 'A'
266
276
267 $ cd ..
277 $ cd ..
@@ -1,127 +1,130 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
15
16 $ echo c1 > c1
16 $ echo c1 > c1
17 $ hg ci -Am c1
17 $ hg ci -Am c1
18 adding c1
18 adding c1
19
19
20 $ echo c2 > c2
20 $ echo c2 > c2
21 $ hg ci -Am c2
21 $ hg ci -Am c2
22 adding c2
22 adding c2
23
23
24 $ echo l1 > l1
24 $ echo l1 > l1
25 $ hg ci -Am l1
25 $ hg ci -Am l1
26 adding l1
26 adding l1
27
27
28 $ hg up -q -C 1
28 $ hg up -q -C 1
29
29
30 $ echo r1 > r1
30 $ echo r1 > r1
31 $ hg ci -Am r1
31 $ hg ci -Am r1
32 adding r1
32 adding r1
33 created new head
33 created new head
34
34
35 $ echo r2 > r2
35 $ echo r2 > r2
36 $ hg ci -Am r2
36 $ hg ci -Am r2
37 adding r2
37 adding r2
38
38
39 $ hg tglog
39 $ hg tglog
40 @ 4: 'r2'
40 @ 4: 'r2'
41 |
41 |
42 o 3: 'r1'
42 o 3: 'r1'
43 |
43 |
44 | o 2: 'l1'
44 | o 2: 'l1'
45 |/
45 |/
46 o 1: 'c2'
46 o 1: 'c2'
47 |
47 |
48 o 0: 'c1'
48 o 0: 'c1'
49
49
50 Rebase with no arguments - single revision in source branch:
50 Rebase with no arguments - single revision in source branch:
51
51
52 $ hg up -q -C 2
52 $ hg up -q -C 2
53
53
54 $ hg rebase
54 $ hg rebase
55 rebasing 2:87c180a611f2 "l1"
55 saved backup bundle to $TESTTMP/a/.hg/strip-backup/87c180a611f2-backup.hg (glob)
56 saved backup bundle to $TESTTMP/a/.hg/strip-backup/87c180a611f2-backup.hg (glob)
56
57
57 $ hg tglog
58 $ hg tglog
58 @ 4: 'l1'
59 @ 4: 'l1'
59 |
60 |
60 o 3: 'r2'
61 o 3: 'r2'
61 |
62 |
62 o 2: 'r1'
63 o 2: 'r1'
63 |
64 |
64 o 1: 'c2'
65 o 1: 'c2'
65 |
66 |
66 o 0: 'c1'
67 o 0: 'c1'
67
68
68 $ cd ..
69 $ cd ..
69
70
70
71
71 $ hg init b
72 $ hg init b
72 $ cd b
73 $ cd b
73
74
74 $ echo c1 > c1
75 $ echo c1 > c1
75 $ hg ci -Am c1
76 $ hg ci -Am c1
76 adding c1
77 adding c1
77
78
78 $ echo c2 > c2
79 $ echo c2 > c2
79 $ hg ci -Am c2
80 $ hg ci -Am c2
80 adding c2
81 adding c2
81
82
82 $ echo l1 > l1
83 $ echo l1 > l1
83 $ hg ci -Am l1
84 $ hg ci -Am l1
84 adding l1
85 adding l1
85
86
86 $ echo l2 > l2
87 $ echo l2 > l2
87 $ hg ci -Am l2
88 $ hg ci -Am l2
88 adding l2
89 adding l2
89
90
90 $ hg up -q -C 1
91 $ hg up -q -C 1
91
92
92 $ echo r1 > r1
93 $ echo r1 > r1
93 $ hg ci -Am r1
94 $ hg ci -Am r1
94 adding r1
95 adding r1
95 created new head
96 created new head
96
97
97 $ hg tglog
98 $ hg tglog
98 @ 4: 'r1'
99 @ 4: 'r1'
99 |
100 |
100 | o 3: 'l2'
101 | o 3: 'l2'
101 | |
102 | |
102 | o 2: 'l1'
103 | o 2: 'l1'
103 |/
104 |/
104 o 1: 'c2'
105 o 1: 'c2'
105 |
106 |
106 o 0: 'c1'
107 o 0: 'c1'
107
108
108 Rebase with no arguments - single revision in target branch:
109 Rebase with no arguments - single revision in target branch:
109
110
110 $ hg up -q -C 3
111 $ hg up -q -C 3
111
112
112 $ hg rebase
113 $ hg rebase
114 rebasing 2:87c180a611f2 "l1"
115 rebasing 3:1ac923b736ef "l2"
113 saved backup bundle to $TESTTMP/b/.hg/strip-backup/87c180a611f2-backup.hg (glob)
116 saved backup bundle to $TESTTMP/b/.hg/strip-backup/87c180a611f2-backup.hg (glob)
114
117
115 $ hg tglog
118 $ hg tglog
116 @ 4: 'l2'
119 @ 4: 'l2'
117 |
120 |
118 o 3: 'l1'
121 o 3: 'l1'
119 |
122 |
120 o 2: 'r1'
123 o 2: 'r1'
121 |
124 |
122 o 1: 'c2'
125 o 1: 'c2'
123 |
126 |
124 o 0: 'c1'
127 o 0: 'c1'
125
128
126
129
127 $ cd ..
130 $ cd ..
@@ -1,139 +1,151 b''
1 This emulates the effects of an hg pull --rebase in which the remote repo
1 This emulates the effects of an hg pull --rebase in which the remote repo
2 already has one local mq patch
2 already has one local mq patch
3
3
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [extensions]
5 > [extensions]
6 > rebase=
6 > rebase=
7 > mq=
7 > mq=
8 >
8 >
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 >
11 >
12 > [alias]
12 > [alias]
13 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
13 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
14 > EOF
14 > EOF
15
15
16
16
17 $ hg init a
17 $ hg init a
18 $ cd a
18 $ cd a
19 $ hg qinit -c
19 $ hg qinit -c
20
20
21 $ echo c1 > c1
21 $ echo c1 > c1
22 $ hg add c1
22 $ hg add c1
23 $ hg ci -m C1
23 $ hg ci -m C1
24
24
25 $ echo r1 > r1
25 $ echo r1 > r1
26 $ hg add r1
26 $ hg add r1
27 $ hg ci -m R1
27 $ hg ci -m R1
28
28
29 $ hg up -q 0
29 $ hg up -q 0
30
30
31 $ hg qnew p0.patch -d '1 0'
31 $ hg qnew p0.patch -d '1 0'
32 $ echo p0 > p0
32 $ echo p0 > p0
33 $ hg add p0
33 $ hg add p0
34 $ hg qref -m P0
34 $ hg qref -m P0
35
35
36 $ hg qnew p1.patch -d '2 0'
36 $ hg qnew p1.patch -d '2 0'
37 $ echo p1 > p1
37 $ echo p1 > p1
38 $ hg add p1
38 $ hg add p1
39 $ hg qref -m P1
39 $ hg qref -m P1
40
40
41 $ hg export qtip > p1.patch
41 $ hg export qtip > p1.patch
42
42
43 $ hg up -q -C 1
43 $ hg up -q -C 1
44
44
45 $ hg import p1.patch
45 $ hg import p1.patch
46 applying p1.patch
46 applying p1.patch
47
47
48 $ rm p1.patch
48 $ rm p1.patch
49
49
50 $ hg up -q -C qtip
50 $ hg up -q -C qtip
51
51
52 $ hg rebase
52 $ hg rebase
53 rebasing 2:13a46ce44f60 "P0" (p0.patch qbase)
54 rebasing 3:148775c71080 "P1" (p1.patch qtip)
53 saved backup bundle to $TESTTMP/a/.hg/strip-backup/13a46ce44f60-backup.hg (glob)
55 saved backup bundle to $TESTTMP/a/.hg/strip-backup/13a46ce44f60-backup.hg (glob)
54
56
55 $ hg tglog
57 $ hg tglog
56 @ 3: 'P0' tags: p0.patch qbase qtip tip
58 @ 3: 'P0' tags: p0.patch qbase qtip tip
57 |
59 |
58 o 2: 'P1' tags: qparent
60 o 2: 'P1' tags: qparent
59 |
61 |
60 o 1: 'R1' tags:
62 o 1: 'R1' tags:
61 |
63 |
62 o 0: 'C1' tags:
64 o 0: 'C1' tags:
63
65
64 $ cd ..
66 $ cd ..
65
67
66
68
67 $ hg init b
69 $ hg init b
68 $ cd b
70 $ cd b
69 $ hg qinit -c
71 $ hg qinit -c
70
72
71 $ for i in r0 r1 r2 r3 r4 r5 r6;
73 $ for i in r0 r1 r2 r3 r4 r5 r6;
72 > do
74 > do
73 > echo $i > $i
75 > echo $i > $i
74 > hg ci -Am $i
76 > hg ci -Am $i
75 > done
77 > done
76 adding r0
78 adding r0
77 adding r1
79 adding r1
78 adding r2
80 adding r2
79 adding r3
81 adding r3
80 adding r4
82 adding r4
81 adding r5
83 adding r5
82 adding r6
84 adding r6
83
85
84 $ hg qimport -r 1:tip
86 $ hg qimport -r 1:tip
85
87
86 $ hg up -q 0
88 $ hg up -q 0
87
89
88 $ for i in r1 r3 r7 r8;
90 $ for i in r1 r3 r7 r8;
89 > do
91 > do
90 > echo $i > $i
92 > echo $i > $i
91 > hg ci -Am branch2-$i
93 > hg ci -Am branch2-$i
92 > done
94 > done
93 adding r1
95 adding r1
94 created new head
96 created new head
95 adding r3
97 adding r3
96 adding r7
98 adding r7
97 adding r8
99 adding r8
98
100
99 $ echo somethingelse > r4
101 $ echo somethingelse > r4
100 $ hg ci -Am branch2-r4
102 $ hg ci -Am branch2-r4
101 adding r4
103 adding r4
102
104
103 $ echo r6 > r6
105 $ echo r6 > r6
104 $ hg ci -Am branch2-r6
106 $ hg ci -Am branch2-r6
105 adding r6
107 adding r6
106
108
107 $ hg up -q qtip
109 $ hg up -q qtip
108
110
109 $ HGMERGE=internal:fail hg rebase
111 $ HGMERGE=internal:fail hg rebase
112 rebasing 1:b4bffa6e4776 "r1" (1.diff qbase)
113 rebasing 2:c0fd129beb01 "r2" (2.diff)
114 rebasing 3:6ff5b8feed8e "r3" (3.diff)
115 rebasing 4:094320fec554 "r4" (4.diff)
110 unresolved conflicts (see hg resolve, then hg rebase --continue)
116 unresolved conflicts (see hg resolve, then hg rebase --continue)
111 [1]
117 [1]
112
118
113 $ HGMERGE=internal:local hg resolve --all
119 $ HGMERGE=internal:local hg resolve --all
114 (no more unresolved files)
120 (no more unresolved files)
115
121
116 $ hg rebase --continue
122 $ hg rebase --continue
123 already rebased 1:b4bffa6e4776 "r1" (1.diff qbase) as 057f55ff8f44
124 already rebased 2:c0fd129beb01 "r2" (2.diff) as 1660ab13ce9a
125 already rebased 3:6ff5b8feed8e "r3" (3.diff) as 1660ab13ce9a
126 rebasing 4:094320fec554 "r4" (4.diff)
127 rebasing 5:681a378595ba "r5" (5.diff)
128 rebasing 6:512a1f24768b "r6" (6.diff qtip)
117 saved backup bundle to $TESTTMP/b/.hg/strip-backup/b4bffa6e4776-backup.hg (glob)
129 saved backup bundle to $TESTTMP/b/.hg/strip-backup/b4bffa6e4776-backup.hg (glob)
118
130
119 $ hg tglog
131 $ hg tglog
120 @ 8: 'r5' tags: 5.diff qtip tip
132 @ 8: 'r5' tags: 5.diff qtip tip
121 |
133 |
122 o 7: 'r2' tags: 2.diff qbase
134 o 7: 'r2' tags: 2.diff qbase
123 |
135 |
124 o 6: 'branch2-r6' tags: qparent
136 o 6: 'branch2-r6' tags: qparent
125 |
137 |
126 o 5: 'branch2-r4' tags:
138 o 5: 'branch2-r4' tags:
127 |
139 |
128 o 4: 'branch2-r8' tags:
140 o 4: 'branch2-r8' tags:
129 |
141 |
130 o 3: 'branch2-r7' tags:
142 o 3: 'branch2-r7' tags:
131 |
143 |
132 o 2: 'branch2-r3' tags:
144 o 2: 'branch2-r3' tags:
133 |
145 |
134 o 1: 'branch2-r1' tags:
146 o 1: 'branch2-r1' tags:
135 |
147 |
136 o 0: 'r0' tags:
148 o 0: 'r0' tags:
137
149
138
150
139 $ cd ..
151 $ cd ..
@@ -1,352 +1,359 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > mq=
4 > mq=
5 >
5 >
6 > [mq]
6 > [mq]
7 > plain=true
7 > plain=true
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
10 > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
11 > EOF
11 > EOF
12
12
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16 $ hg qinit -c
16 $ hg qinit -c
17
17
18 $ echo c1 > f
18 $ echo c1 > f
19 $ hg add f
19 $ hg add f
20 $ hg ci -m C1
20 $ hg ci -m C1
21
21
22 $ echo r1 > f
22 $ echo r1 > f
23 $ hg ci -m R1
23 $ hg ci -m R1
24
24
25 $ hg up -q 0
25 $ hg up -q 0
26
26
27 $ hg qnew f.patch -d '1 0'
27 $ hg qnew f.patch -d '1 0'
28 $ echo mq1 > f
28 $ echo mq1 > f
29 $ hg qref -m P0
29 $ hg qref -m P0
30
30
31 $ hg qnew f2.patch
31 $ hg qnew f2.patch
32 $ echo mq2 > f
32 $ echo mq2 > f
33 $ hg qref -m P1 -d '2 0'
33 $ hg qref -m P1 -d '2 0'
34
34
35 $ hg tglog
35 $ hg tglog
36 @ 3: 'P1' tags: f2.patch qtip tip
36 @ 3: 'P1' tags: f2.patch qtip tip
37 |
37 |
38 o 2: 'P0' tags: f.patch qbase
38 o 2: 'P0' tags: f.patch qbase
39 |
39 |
40 | o 1: 'R1' tags:
40 | o 1: 'R1' tags:
41 |/
41 |/
42 o 0: 'C1' tags: qparent
42 o 0: 'C1' tags: qparent
43
43
44
44
45 Rebase - try to rebase on an applied mq patch:
45 Rebase - try to rebase on an applied mq patch:
46
46
47 $ hg rebase -s 1 -d 3
47 $ hg rebase -s 1 -d 3
48 abort: cannot rebase onto an applied mq patch
48 abort: cannot rebase onto an applied mq patch
49 [255]
49 [255]
50
50
51 Rebase - same thing, but mq patch is default dest:
51 Rebase - same thing, but mq patch is default dest:
52
52
53 $ hg up -q 1
53 $ hg up -q 1
54 $ hg rebase
54 $ hg rebase
55 abort: cannot rebase onto an applied mq patch
55 abort: cannot rebase onto an applied mq patch
56 [255]
56 [255]
57 $ hg up -q qtip
57 $ hg up -q qtip
58
58
59 Rebase - generate a conflict:
59 Rebase - generate a conflict:
60
60
61 $ hg rebase -s 2 -d 1
61 $ hg rebase -s 2 -d 1
62 rebasing 2:3504f44bffc0 "P0" (f.patch qbase)
62 merging f
63 merging f
63 warning: conflicts during merge.
64 warning: conflicts during merge.
64 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
65 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
65 unresolved conflicts (see hg resolve, then hg rebase --continue)
66 unresolved conflicts (see hg resolve, then hg rebase --continue)
66 [1]
67 [1]
67
68
68 Fix the 1st conflict:
69 Fix the 1st conflict:
69
70
70 $ echo mq1r1 > f
71 $ echo mq1r1 > f
71 $ hg resolve -m f
72 $ hg resolve -m f
72 (no more unresolved files)
73 (no more unresolved files)
73 $ hg rebase -c
74 $ hg rebase -c
75 rebasing 2:3504f44bffc0 "P0" (f.patch qbase)
76 rebasing 3:929394423cd3 "P1" (f2.patch qtip tip)
74 merging f
77 merging f
75 warning: conflicts during merge.
78 warning: conflicts during merge.
76 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
79 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
77 unresolved conflicts (see hg resolve, then hg rebase --continue)
80 unresolved conflicts (see hg resolve, then hg rebase --continue)
78 [1]
81 [1]
79
82
80 Fix the 2nd conflict:
83 Fix the 2nd conflict:
81
84
82 $ echo mq1r1mq2 > f
85 $ echo mq1r1mq2 > f
83 $ hg resolve -m f
86 $ hg resolve -m f
84 (no more unresolved files)
87 (no more unresolved files)
85 $ hg rebase -c
88 $ hg rebase -c
89 already rebased 2:3504f44bffc0 "P0" (f.patch qbase) as ebe9914c0d1c
90 rebasing 3:929394423cd3 "P1" (f2.patch qtip)
86 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3504f44bffc0-backup.hg (glob)
91 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3504f44bffc0-backup.hg (glob)
87
92
88 $ hg tglog
93 $ hg tglog
89 @ 3: 'P1' tags: f2.patch qtip tip
94 @ 3: 'P1' tags: f2.patch qtip tip
90 |
95 |
91 o 2: 'P0' tags: f.patch qbase
96 o 2: 'P0' tags: f.patch qbase
92 |
97 |
93 o 1: 'R1' tags: qparent
98 o 1: 'R1' tags: qparent
94 |
99 |
95 o 0: 'C1' tags:
100 o 0: 'C1' tags:
96
101
97 $ hg up -q qbase
102 $ hg up -q qbase
98
103
99 $ cat f
104 $ cat f
100 mq1r1
105 mq1r1
101
106
102 $ cat .hg/patches/f.patch
107 $ cat .hg/patches/f.patch
103 # HG changeset patch
108 # HG changeset patch
104 # User test
109 # User test
105 # Date 1 0
110 # Date 1 0
106 # Thu Jan 01 00:00:01 1970 +0000
111 # Thu Jan 01 00:00:01 1970 +0000
107 # Node ID ebe9914c0d1c3f60096e952fa4dbb3d377dea3ab
112 # Node ID ebe9914c0d1c3f60096e952fa4dbb3d377dea3ab
108 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
113 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
109 P0
114 P0
110
115
111 diff -r bac9ed9960d8 -r ebe9914c0d1c f
116 diff -r bac9ed9960d8 -r ebe9914c0d1c f
112 --- a/f Thu Jan 01 00:00:00 1970 +0000
117 --- a/f Thu Jan 01 00:00:00 1970 +0000
113 +++ b/f Thu Jan 01 00:00:01 1970 +0000
118 +++ b/f Thu Jan 01 00:00:01 1970 +0000
114 @@ -1,1 +1,1 @@
119 @@ -1,1 +1,1 @@
115 -r1
120 -r1
116 +mq1r1
121 +mq1r1
117
122
118 Update to qtip:
123 Update to qtip:
119
124
120 $ hg up -q qtip
125 $ hg up -q qtip
121
126
122 $ cat f
127 $ cat f
123 mq1r1mq2
128 mq1r1mq2
124
129
125 $ cat .hg/patches/f2.patch
130 $ cat .hg/patches/f2.patch
126 # HG changeset patch
131 # HG changeset patch
127 # User test
132 # User test
128 # Date 2 0
133 # Date 2 0
129 # Thu Jan 01 00:00:02 1970 +0000
134 # Thu Jan 01 00:00:02 1970 +0000
130 # Node ID 462012cf340c97d44d62377c985a423f6bb82f07
135 # Node ID 462012cf340c97d44d62377c985a423f6bb82f07
131 # Parent ebe9914c0d1c3f60096e952fa4dbb3d377dea3ab
136 # Parent ebe9914c0d1c3f60096e952fa4dbb3d377dea3ab
132 P1
137 P1
133
138
134 diff -r ebe9914c0d1c -r 462012cf340c f
139 diff -r ebe9914c0d1c -r 462012cf340c f
135 --- a/f Thu Jan 01 00:00:01 1970 +0000
140 --- a/f Thu Jan 01 00:00:01 1970 +0000
136 +++ b/f Thu Jan 01 00:00:02 1970 +0000
141 +++ b/f Thu Jan 01 00:00:02 1970 +0000
137 @@ -1,1 +1,1 @@
142 @@ -1,1 +1,1 @@
138 -mq1r1
143 -mq1r1
139 +mq1r1mq2
144 +mq1r1mq2
140
145
141 Adding one git-style patch and one normal:
146 Adding one git-style patch and one normal:
142
147
143 $ hg qpop -a
148 $ hg qpop -a
144 popping f2.patch
149 popping f2.patch
145 popping f.patch
150 popping f.patch
146 patch queue now empty
151 patch queue now empty
147
152
148 $ rm -fr .hg/patches
153 $ rm -fr .hg/patches
149 $ hg qinit -c
154 $ hg qinit -c
150
155
151 $ hg up -q 0
156 $ hg up -q 0
152
157
153 $ hg qnew --git f_git.patch -d '3 0'
158 $ hg qnew --git f_git.patch -d '3 0'
154 $ echo mq1 > p
159 $ echo mq1 > p
155 $ hg add p
160 $ hg add p
156 $ hg qref --git -m 'P0 (git)'
161 $ hg qref --git -m 'P0 (git)'
157
162
158 $ hg qnew f.patch -d '4 0'
163 $ hg qnew f.patch -d '4 0'
159 $ echo mq2 > p
164 $ echo mq2 > p
160 $ hg qref -m P1
165 $ hg qref -m P1
161 $ hg qci -m 'save patch state'
166 $ hg qci -m 'save patch state'
162
167
163 $ hg qseries -s
168 $ hg qseries -s
164 f_git.patch: P0 (git)
169 f_git.patch: P0 (git)
165 f.patch: P1
170 f.patch: P1
166
171
167 $ hg -R .hg/patches manifest
172 $ hg -R .hg/patches manifest
168 .hgignore
173 .hgignore
169 f.patch
174 f.patch
170 f_git.patch
175 f_git.patch
171 series
176 series
172
177
173 $ cat .hg/patches/f_git.patch
178 $ cat .hg/patches/f_git.patch
174 Date: 3 0
179 Date: 3 0
175
180
176 P0 (git)
181 P0 (git)
177
182
178 diff --git a/p b/p
183 diff --git a/p b/p
179 new file mode 100644
184 new file mode 100644
180 --- /dev/null
185 --- /dev/null
181 +++ b/p
186 +++ b/p
182 @@ -0,0 +1,1 @@
187 @@ -0,0 +1,1 @@
183 +mq1
188 +mq1
184
189
185 $ cat .hg/patches/f.patch
190 $ cat .hg/patches/f.patch
186 Date: 4 0
191 Date: 4 0
187
192
188 P1
193 P1
189
194
190 diff -r ???????????? p (glob)
195 diff -r ???????????? p (glob)
191 --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob)
196 --- a/p ??? ??? ?? ??:??:?? ???? ????? (glob)
192 +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob)
197 +++ b/p ??? ??? ?? ??:??:?? ???? ????? (glob)
193 @@ -1,1 +1,1 @@
198 @@ -1,1 +1,1 @@
194 -mq1
199 -mq1
195 +mq2
200 +mq2
196
201
197
202
198 Rebase the applied mq patches:
203 Rebase the applied mq patches:
199
204
200 $ hg rebase -s 2 -d 1
205 $ hg rebase -s 2 -d 1
206 rebasing 2:0c587ffcb480 "P0 (git)" (f_git.patch qbase)
207 rebasing 3:c7f18665e4bc "P1" (f.patch qtip tip)
201 saved backup bundle to $TESTTMP/a/.hg/strip-backup/0c587ffcb480-backup.hg (glob)
208 saved backup bundle to $TESTTMP/a/.hg/strip-backup/0c587ffcb480-backup.hg (glob)
202
209
203 $ hg qci -m 'save patch state'
210 $ hg qci -m 'save patch state'
204
211
205 $ hg qseries -s
212 $ hg qseries -s
206 f_git.patch: P0 (git)
213 f_git.patch: P0 (git)
207 f.patch: P1
214 f.patch: P1
208
215
209 $ hg -R .hg/patches manifest
216 $ hg -R .hg/patches manifest
210 .hgignore
217 .hgignore
211 f.patch
218 f.patch
212 f_git.patch
219 f_git.patch
213 series
220 series
214
221
215 $ cat .hg/patches/f_git.patch
222 $ cat .hg/patches/f_git.patch
216 # HG changeset patch
223 # HG changeset patch
217 # User test
224 # User test
218 # Date 3 0
225 # Date 3 0
219 # Thu Jan 01 00:00:03 1970 +0000
226 # Thu Jan 01 00:00:03 1970 +0000
220 # Node ID 12d9f6a3bbe560dee50c7c454d434add7fb8e837
227 # Node ID 12d9f6a3bbe560dee50c7c454d434add7fb8e837
221 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
228 # Parent bac9ed9960d8992bcad75864a879fa76cadaf1b0
222 P0 (git)
229 P0 (git)
223
230
224 diff --git a/p b/p
231 diff --git a/p b/p
225 new file mode 100644
232 new file mode 100644
226 --- /dev/null
233 --- /dev/null
227 +++ b/p
234 +++ b/p
228 @@ -0,0 +1,1 @@
235 @@ -0,0 +1,1 @@
229 +mq1
236 +mq1
230
237
231 $ cat .hg/patches/f.patch
238 $ cat .hg/patches/f.patch
232 # HG changeset patch
239 # HG changeset patch
233 # User test
240 # User test
234 # Date 4 0
241 # Date 4 0
235 # Thu Jan 01 00:00:04 1970 +0000
242 # Thu Jan 01 00:00:04 1970 +0000
236 # Node ID c77a2661c64c60d82f63c4f7aefd95b3a948a557
243 # Node ID c77a2661c64c60d82f63c4f7aefd95b3a948a557
237 # Parent 12d9f6a3bbe560dee50c7c454d434add7fb8e837
244 # Parent 12d9f6a3bbe560dee50c7c454d434add7fb8e837
238 P1
245 P1
239
246
240 diff -r 12d9f6a3bbe5 -r c77a2661c64c p
247 diff -r 12d9f6a3bbe5 -r c77a2661c64c p
241 --- a/p Thu Jan 01 00:00:03 1970 +0000
248 --- a/p Thu Jan 01 00:00:03 1970 +0000
242 +++ b/p Thu Jan 01 00:00:04 1970 +0000
249 +++ b/p Thu Jan 01 00:00:04 1970 +0000
243 @@ -1,1 +1,1 @@
250 @@ -1,1 +1,1 @@
244 -mq1
251 -mq1
245 +mq2
252 +mq2
246
253
247 $ cd ..
254 $ cd ..
248
255
249 Rebase with guards
256 Rebase with guards
250
257
251 $ hg init foo
258 $ hg init foo
252 $ cd foo
259 $ cd foo
253 $ echo a > a
260 $ echo a > a
254 $ hg ci -Am a
261 $ hg ci -Am a
255 adding a
262 adding a
256
263
257 Create mq repo with guarded patches foo and bar and empty patch:
264 Create mq repo with guarded patches foo and bar and empty patch:
258
265
259 $ hg qinit
266 $ hg qinit
260 $ echo guarded > guarded
267 $ echo guarded > guarded
261 $ hg add guarded
268 $ hg add guarded
262 $ hg qnew guarded
269 $ hg qnew guarded
263 $ hg qnew empty-important -m 'important commit message' -d '1 0'
270 $ hg qnew empty-important -m 'important commit message' -d '1 0'
264 $ echo bar > bar
271 $ echo bar > bar
265 $ hg add bar
272 $ hg add bar
266 $ hg qnew bar -d '2 0'
273 $ hg qnew bar -d '2 0'
267 $ echo foo > foo
274 $ echo foo > foo
268 $ hg add foo
275 $ hg add foo
269 $ hg qnew foo
276 $ hg qnew foo
270 $ hg qpop -a
277 $ hg qpop -a
271 popping foo
278 popping foo
272 popping bar
279 popping bar
273 popping empty-important
280 popping empty-important
274 popping guarded
281 popping guarded
275 patch queue now empty
282 patch queue now empty
276 $ hg qguard guarded +guarded
283 $ hg qguard guarded +guarded
277 $ hg qguard bar +baz
284 $ hg qguard bar +baz
278 $ hg qguard foo +baz
285 $ hg qguard foo +baz
279 $ hg qselect baz
286 $ hg qselect baz
280 number of unguarded, unapplied patches has changed from 1 to 3
287 number of unguarded, unapplied patches has changed from 1 to 3
281 $ hg qpush bar
288 $ hg qpush bar
282 applying empty-important
289 applying empty-important
283 patch empty-important is empty
290 patch empty-important is empty
284 applying bar
291 applying bar
285 now at: bar
292 now at: bar
286
293
287 $ hg qguard -l
294 $ hg qguard -l
288 guarded: +guarded
295 guarded: +guarded
289 empty-important: unguarded
296 empty-important: unguarded
290 bar: +baz
297 bar: +baz
291 foo: +baz
298 foo: +baz
292
299
293 $ hg tglog
300 $ hg tglog
294 @ 2: 'imported patch bar' tags: bar qtip tip
301 @ 2: 'imported patch bar' tags: bar qtip tip
295 |
302 |
296 o 1: 'important commit message' tags: empty-important qbase
303 o 1: 'important commit message' tags: empty-important qbase
297 |
304 |
298 o 0: 'a' tags: qparent
305 o 0: 'a' tags: qparent
299
306
300 Create new head to rebase bar onto:
307 Create new head to rebase bar onto:
301
308
302 $ hg up -C 0
309 $ hg up -C 0
303 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
310 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
304 $ echo b > b
311 $ echo b > b
305 $ hg add b
312 $ hg add b
306 $ hg ci -m b
313 $ hg ci -m b
307 created new head
314 created new head
308 $ hg up -C 2
315 $ hg up -C 2
309 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
316 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
310 $ echo a >> a
317 $ echo a >> a
311 $ hg qref
318 $ hg qref
312
319
313 $ hg tglog
320 $ hg tglog
314 @ 3: '[mq]: bar' tags: bar qtip tip
321 @ 3: '[mq]: bar' tags: bar qtip tip
315 |
322 |
316 | o 2: 'b' tags:
323 | o 2: 'b' tags:
317 | |
324 | |
318 o | 1: 'important commit message' tags: empty-important qbase
325 o | 1: 'important commit message' tags: empty-important qbase
319 |/
326 |/
320 o 0: 'a' tags: qparent
327 o 0: 'a' tags: qparent
321
328
322
329
323 Rebase bar (make sure series order is preserved and empty-important also is
330 Rebase bar (make sure series order is preserved and empty-important also is
324 removed from the series):
331 removed from the series):
325
332
326 $ hg qseries
333 $ hg qseries
327 guarded
334 guarded
328 empty-important
335 empty-important
329 bar
336 bar
330 foo
337 foo
331 $ [ -f .hg/patches/empty-important ]
338 $ [ -f .hg/patches/empty-important ]
332 $ hg -q rebase -d 2
339 $ hg -q rebase -d 2
333 $ hg qseries
340 $ hg qseries
334 guarded
341 guarded
335 bar
342 bar
336 foo
343 foo
337 $ [ -f .hg/patches/empty-important ]
344 $ [ -f .hg/patches/empty-important ]
338 [1]
345 [1]
339
346
340 $ hg qguard -l
347 $ hg qguard -l
341 guarded: +guarded
348 guarded: +guarded
342 bar: +baz
349 bar: +baz
343 foo: +baz
350 foo: +baz
344
351
345 $ hg tglog
352 $ hg tglog
346 @ 2: '[mq]: bar' tags: bar qbase qtip tip
353 @ 2: '[mq]: bar' tags: bar qbase qtip tip
347 |
354 |
348 o 1: 'b' tags: qparent
355 o 1: 'b' tags: qparent
349 |
356 |
350 o 0: 'a' tags:
357 o 0: 'a' tags:
351
358
352 $ cd ..
359 $ cd ..
@@ -1,347 +1,378 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 $ hg init a
12 $ hg init a
13 $ cd a
13 $ cd a
14 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
14 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
15 adding changesets
15 adding changesets
16 adding manifests
16 adding manifests
17 adding file changes
17 adding file changes
18 added 8 changesets with 7 changes to 7 files (+2 heads)
18 added 8 changesets with 7 changes to 7 files (+2 heads)
19 (run 'hg heads' to see heads, 'hg merge' to merge)
19 (run 'hg heads' to see heads, 'hg merge' to merge)
20 $ hg up tip
20 $ hg up tip
21 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 $ cd ..
22 $ cd ..
23
23
24 $ hg clone -q -u . a a1
24 $ hg clone -q -u . a a1
25
25
26 $ cd a1
26 $ cd a1
27
27
28 $ hg update 3
28 $ hg update 3
29 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
30 $ hg branch dev-one
30 $ hg branch dev-one
31 marked working directory as branch dev-one
31 marked working directory as branch dev-one
32 (branches are permanent and global, did you want a bookmark?)
32 (branches are permanent and global, did you want a bookmark?)
33 $ hg ci -m 'dev-one named branch'
33 $ hg ci -m 'dev-one named branch'
34
34
35 $ hg update 7
35 $ hg update 7
36 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
36 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
37 $ hg branch dev-two
37 $ hg branch dev-two
38 marked working directory as branch dev-two
38 marked working directory as branch dev-two
39 (branches are permanent and global, did you want a bookmark?)
39 (branches are permanent and global, did you want a bookmark?)
40
40
41 $ echo x > x
41 $ echo x > x
42
42
43 $ hg add x
43 $ hg add x
44
44
45 $ hg ci -m 'dev-two named branch'
45 $ hg ci -m 'dev-two named branch'
46
46
47 $ hg tglog
47 $ hg tglog
48 @ 9: 'dev-two named branch' dev-two
48 @ 9: 'dev-two named branch' dev-two
49 |
49 |
50 | o 8: 'dev-one named branch' dev-one
50 | o 8: 'dev-one named branch' dev-one
51 | |
51 | |
52 o | 7: 'H'
52 o | 7: 'H'
53 | |
53 | |
54 +---o 6: 'G'
54 +---o 6: 'G'
55 | | |
55 | | |
56 o | | 5: 'F'
56 o | | 5: 'F'
57 | | |
57 | | |
58 +---o 4: 'E'
58 +---o 4: 'E'
59 | |
59 | |
60 | o 3: 'D'
60 | o 3: 'D'
61 | |
61 | |
62 | o 2: 'C'
62 | o 2: 'C'
63 | |
63 | |
64 | o 1: 'B'
64 | o 1: 'B'
65 |/
65 |/
66 o 0: 'A'
66 o 0: 'A'
67
67
68
68
69 Branch name containing a dash (issue3181)
69 Branch name containing a dash (issue3181)
70
70
71 $ hg rebase -b dev-two -d dev-one --keepbranches
71 $ hg rebase -b dev-two -d dev-one --keepbranches
72 rebasing 5:24b6387c8c8c "F"
73 rebasing 6:eea13746799a "G"
74 rebasing 7:02de42196ebe "H"
75 rebasing 9:cb039b7cae8e "dev-two named branch" (tip)
72 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
76 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
73
77
74 $ hg tglog
78 $ hg tglog
75 @ 9: 'dev-two named branch' dev-two
79 @ 9: 'dev-two named branch' dev-two
76 |
80 |
77 o 8: 'H'
81 o 8: 'H'
78 |
82 |
79 | o 7: 'G'
83 | o 7: 'G'
80 |/|
84 |/|
81 o | 6: 'F'
85 o | 6: 'F'
82 | |
86 | |
83 o | 5: 'dev-one named branch' dev-one
87 o | 5: 'dev-one named branch' dev-one
84 | |
88 | |
85 | o 4: 'E'
89 | o 4: 'E'
86 | |
90 | |
87 o | 3: 'D'
91 o | 3: 'D'
88 | |
92 | |
89 o | 2: 'C'
93 o | 2: 'C'
90 | |
94 | |
91 o | 1: 'B'
95 o | 1: 'B'
92 |/
96 |/
93 o 0: 'A'
97 o 0: 'A'
94
98
95 $ hg rebase -s dev-one -d 0 --keepbranches
99 $ hg rebase -s dev-one -d 0 --keepbranches
100 rebasing 5:643fc9128048 "dev-one named branch"
101 rebasing 6:24de4aff8e28 "F"
102 rebasing 7:4b988a958030 "G"
103 rebasing 8:31d0e4ba75e6 "H"
104 rebasing 9:9e70cd31750f "dev-two named branch" (tip)
96 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-backup.hg (glob)
105 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-backup.hg (glob)
97
106
98 $ hg tglog
107 $ hg tglog
99 @ 8: 'dev-two named branch' dev-two
108 @ 8: 'dev-two named branch' dev-two
100 |
109 |
101 o 7: 'H'
110 o 7: 'H'
102 |
111 |
103 | o 6: 'G'
112 | o 6: 'G'
104 |/|
113 |/|
105 o | 5: 'F'
114 o | 5: 'F'
106 | |
115 | |
107 | o 4: 'E'
116 | o 4: 'E'
108 |/
117 |/
109 | o 3: 'D'
118 | o 3: 'D'
110 | |
119 | |
111 | o 2: 'C'
120 | o 2: 'C'
112 | |
121 | |
113 | o 1: 'B'
122 | o 1: 'B'
114 |/
123 |/
115 o 0: 'A'
124 o 0: 'A'
116
125
117 $ hg update 3
126 $ hg update 3
118 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
127 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
119 $ hg branch dev-one
128 $ hg branch dev-one
120 marked working directory as branch dev-one
129 marked working directory as branch dev-one
121 (branches are permanent and global, did you want a bookmark?)
130 (branches are permanent and global, did you want a bookmark?)
122 $ hg ci -m 'dev-one named branch'
131 $ hg ci -m 'dev-one named branch'
123
132
124 $ hg tglog
133 $ hg tglog
125 @ 9: 'dev-one named branch' dev-one
134 @ 9: 'dev-one named branch' dev-one
126 |
135 |
127 | o 8: 'dev-two named branch' dev-two
136 | o 8: 'dev-two named branch' dev-two
128 | |
137 | |
129 | o 7: 'H'
138 | o 7: 'H'
130 | |
139 | |
131 | | o 6: 'G'
140 | | o 6: 'G'
132 | |/|
141 | |/|
133 | o | 5: 'F'
142 | o | 5: 'F'
134 | | |
143 | | |
135 | | o 4: 'E'
144 | | o 4: 'E'
136 | |/
145 | |/
137 o | 3: 'D'
146 o | 3: 'D'
138 | |
147 | |
139 o | 2: 'C'
148 o | 2: 'C'
140 | |
149 | |
141 o | 1: 'B'
150 o | 1: 'B'
142 |/
151 |/
143 o 0: 'A'
152 o 0: 'A'
144
153
145 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
154 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
155 rebasing 5:77854864208c "F"
156 rebasing 6:63b4f9c788a1 "G"
157 rebasing 7:87861e68abd3 "H"
158 rebasing 8:ec00d4e0efca "dev-two named branch"
146 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/77854864208c-backup.hg (glob)
159 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/77854864208c-backup.hg (glob)
147
160
148 $ hg tglog
161 $ hg tglog
149 o 9: 'dev-two named branch' dev-two
162 o 9: 'dev-two named branch' dev-two
150 |
163 |
151 o 8: 'H'
164 o 8: 'H'
152 |
165 |
153 | o 7: 'G'
166 | o 7: 'G'
154 |/|
167 |/|
155 o | 6: 'F'
168 o | 6: 'F'
156 | |
169 | |
157 @ | 5: 'dev-one named branch' dev-one
170 @ | 5: 'dev-one named branch' dev-one
158 | |
171 | |
159 | o 4: 'E'
172 | o 4: 'E'
160 | |
173 | |
161 o | 3: 'D'
174 o | 3: 'D'
162 | |
175 | |
163 o | 2: 'C'
176 o | 2: 'C'
164 | |
177 | |
165 o | 1: 'B'
178 o | 1: 'B'
166 |/
179 |/
167 o 0: 'A'
180 o 0: 'A'
168
181
169 $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
182 $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
183 rebasing 5:643fc9128048 "dev-one named branch"
184 rebasing 6:05584c618d45 "F"
185 rebasing 7:471695f5257d "G"
186 rebasing 8:8382a539a2df "H"
187 rebasing 9:11f718458b32 "dev-two named branch" (tip)
170 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-backup.hg (glob)
188 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/643fc9128048-backup.hg (glob)
171
189
172 $ hg tglog
190 $ hg tglog
173 o 8: 'dev-two named branch' dev-two
191 o 8: 'dev-two named branch' dev-two
174 |
192 |
175 o 7: 'H'
193 o 7: 'H'
176 |
194 |
177 | o 6: 'G'
195 | o 6: 'G'
178 |/|
196 |/|
179 o | 5: 'F'
197 o | 5: 'F'
180 | |
198 | |
181 | o 4: 'E'
199 | o 4: 'E'
182 |/
200 |/
183 | o 3: 'D'
201 | o 3: 'D'
184 | |
202 | |
185 | o 2: 'C'
203 | o 2: 'C'
186 | |
204 | |
187 | o 1: 'B'
205 | o 1: 'B'
188 |/
206 |/
189 @ 0: 'A'
207 @ 0: 'A'
190
208
191
209
192 Rebasing descendant onto ancestor across different named branches
210 Rebasing descendant onto ancestor across different named branches
193
211
194 $ hg rebase -s 1 -d 8 --keepbranches
212 $ hg rebase -s 1 -d 8 --keepbranches
213 rebasing 1:42ccdea3bb16 "B"
214 rebasing 2:5fddd98957c8 "C"
215 rebasing 3:32af7686d403 "D"
195 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
216 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
196
217
197 $ hg tglog
218 $ hg tglog
198 o 8: 'D'
219 o 8: 'D'
199 |
220 |
200 o 7: 'C'
221 o 7: 'C'
201 |
222 |
202 o 6: 'B'
223 o 6: 'B'
203 |
224 |
204 o 5: 'dev-two named branch' dev-two
225 o 5: 'dev-two named branch' dev-two
205 |
226 |
206 o 4: 'H'
227 o 4: 'H'
207 |
228 |
208 | o 3: 'G'
229 | o 3: 'G'
209 |/|
230 |/|
210 o | 2: 'F'
231 o | 2: 'F'
211 | |
232 | |
212 | o 1: 'E'
233 | o 1: 'E'
213 |/
234 |/
214 @ 0: 'A'
235 @ 0: 'A'
215
236
216 $ hg rebase -s 4 -d 5
237 $ hg rebase -s 4 -d 5
217 abort: source is ancestor of destination
238 abort: source is ancestor of destination
218 [255]
239 [255]
219
240
220 $ hg rebase -s 5 -d 4
241 $ hg rebase -s 5 -d 4
242 rebasing 5:32d3b0de7f37 "dev-two named branch"
243 rebasing 6:580fcd9fd48f "B"
244 rebasing 7:32aba0402ed2 "C"
245 rebasing 8:e4787b575338 "D" (tip)
221 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32d3b0de7f37-backup.hg (glob)
246 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32d3b0de7f37-backup.hg (glob)
222
247
223 $ hg tglog
248 $ hg tglog
224 o 8: 'D'
249 o 8: 'D'
225 |
250 |
226 o 7: 'C'
251 o 7: 'C'
227 |
252 |
228 o 6: 'B'
253 o 6: 'B'
229 |
254 |
230 o 5: 'dev-two named branch'
255 o 5: 'dev-two named branch'
231 |
256 |
232 o 4: 'H'
257 o 4: 'H'
233 |
258 |
234 | o 3: 'G'
259 | o 3: 'G'
235 |/|
260 |/|
236 o | 2: 'F'
261 o | 2: 'F'
237 | |
262 | |
238 | o 1: 'E'
263 | o 1: 'E'
239 |/
264 |/
240 @ 0: 'A'
265 @ 0: 'A'
241
266
242
267
243 Reopen branch by rebase
268 Reopen branch by rebase
244
269
245 $ hg up -qr3
270 $ hg up -qr3
246 $ hg branch -q b
271 $ hg branch -q b
247 $ hg ci -m 'create b'
272 $ hg ci -m 'create b'
248 $ hg ci -m 'close b' --close
273 $ hg ci -m 'close b' --close
249 $ hg rebase -b 8 -d b
274 $ hg rebase -b 8 -d b
250 reopening closed branch head ea9de14a36c6
275 reopening closed branch head ea9de14a36c6
276 rebasing 4:86693275b2ef "H"
277 rebasing 5:2149726d0970 "dev-two named branch"
278 rebasing 6:81e55225e95d "B"
279 rebasing 7:09eda3dc3195 "C"
280 rebasing 8:31298fc9d159 "D"
251 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/86693275b2ef-backup.hg (glob)
281 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/86693275b2ef-backup.hg (glob)
252
282
253 $ cd ..
283 $ cd ..
254
284
255 Rebase to other head on branch
285 Rebase to other head on branch
256
286
257 Set up a case:
287 Set up a case:
258
288
259 $ hg init case1
289 $ hg init case1
260 $ cd case1
290 $ cd case1
261 $ touch f
291 $ touch f
262 $ hg ci -qAm0
292 $ hg ci -qAm0
263 $ hg branch -q b
293 $ hg branch -q b
264 $ echo >> f
294 $ echo >> f
265 $ hg ci -qAm 'b1'
295 $ hg ci -qAm 'b1'
266 $ hg up -qr -2
296 $ hg up -qr -2
267 $ hg branch -qf b
297 $ hg branch -qf b
268 $ hg ci -qm 'b2'
298 $ hg ci -qm 'b2'
269 $ hg up -qr -3
299 $ hg up -qr -3
270 $ hg branch -q c
300 $ hg branch -q c
271 $ hg ci -m 'c1'
301 $ hg ci -m 'c1'
272
302
273 $ hg tglog
303 $ hg tglog
274 @ 3: 'c1' c
304 @ 3: 'c1' c
275 |
305 |
276 | o 2: 'b2' b
306 | o 2: 'b2' b
277 |/
307 |/
278 | o 1: 'b1' b
308 | o 1: 'b1' b
279 |/
309 |/
280 o 0: '0'
310 o 0: '0'
281
311
282 $ hg clone -q . ../case2
312 $ hg clone -q . ../case2
283
313
284 rebase 'b2' to another lower branch head
314 rebase 'b2' to another lower branch head
285
315
286 $ hg up -qr 2
316 $ hg up -qr 2
287 $ hg rebase
317 $ hg rebase
288 nothing to rebase - working directory parent is also destination
318 nothing to rebase - working directory parent is also destination
289 [1]
319 [1]
290 $ hg tglog
320 $ hg tglog
291 o 3: 'c1' c
321 o 3: 'c1' c
292 |
322 |
293 | @ 2: 'b2' b
323 | @ 2: 'b2' b
294 |/
324 |/
295 | o 1: 'b1' b
325 | o 1: 'b1' b
296 |/
326 |/
297 o 0: '0'
327 o 0: '0'
298
328
299
329
300 rebase 'b1' on top of the tip of the branch ('b2') - ignoring the tip branch ('c1')
330 rebase 'b1' on top of the tip of the branch ('b2') - ignoring the tip branch ('c1')
301
331
302 $ cd ../case2
332 $ cd ../case2
303 $ hg up -qr 1
333 $ hg up -qr 1
304 $ hg rebase
334 $ hg rebase
335 rebasing 1:40039acb7ca5 "b1"
305 saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-backup.hg (glob)
336 saved backup bundle to $TESTTMP/case2/.hg/strip-backup/40039acb7ca5-backup.hg (glob)
306 $ hg tglog
337 $ hg tglog
307 @ 3: 'b1' b
338 @ 3: 'b1' b
308 |
339 |
309 | o 2: 'c1' c
340 | o 2: 'c1' c
310 | |
341 | |
311 o | 1: 'b2' b
342 o | 1: 'b2' b
312 |/
343 |/
313 o 0: '0'
344 o 0: '0'
314
345
315
346
316 rebase 'c1' to the branch head 'c2' that is closed
347 rebase 'c1' to the branch head 'c2' that is closed
317
348
318 $ hg branch -qf c
349 $ hg branch -qf c
319 $ hg ci -qm 'c2 closed' --close
350 $ hg ci -qm 'c2 closed' --close
320 $ hg up -qr 2
351 $ hg up -qr 2
321 $ hg tglog
352 $ hg tglog
322 o 4: 'c2 closed' c
353 o 4: 'c2 closed' c
323 |
354 |
324 o 3: 'b1' b
355 o 3: 'b1' b
325 |
356 |
326 | @ 2: 'c1' c
357 | @ 2: 'c1' c
327 | |
358 | |
328 o | 1: 'b2' b
359 o | 1: 'b2' b
329 |/
360 |/
330 o 0: '0'
361 o 0: '0'
331
362
332 $ hg rebase
363 $ hg rebase
333 nothing to rebase - working directory parent is also destination
364 nothing to rebase - working directory parent is also destination
334 [1]
365 [1]
335 $ hg tglog
366 $ hg tglog
336 o 4: 'c2 closed' c
367 o 4: 'c2 closed' c
337 |
368 |
338 o 3: 'b1' b
369 o 3: 'b1' b
339 |
370 |
340 | @ 2: 'c1' c
371 | @ 2: 'c1' c
341 | |
372 | |
342 o | 1: 'b2' b
373 o | 1: 'b2' b
343 |/
374 |/
344 o 0: '0'
375 o 0: '0'
345
376
346
377
347 $ cd ..
378 $ cd ..
@@ -1,306 +1,318 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 $ hg init repo
9 $ hg init repo
10 $ cd repo
10 $ cd repo
11
11
12 $ echo A > a
12 $ echo A > a
13 $ echo >> a
13 $ echo >> a
14 $ hg ci -Am A
14 $ hg ci -Am A
15 adding a
15 adding a
16
16
17 $ echo B > a
17 $ echo B > a
18 $ echo >> a
18 $ echo >> a
19 $ hg ci -m B
19 $ hg ci -m B
20
20
21 $ echo C > a
21 $ echo C > a
22 $ echo >> a
22 $ echo >> a
23 $ hg ci -m C
23 $ hg ci -m C
24
24
25 $ hg up -q -C 0
25 $ hg up -q -C 0
26
26
27 $ echo D >> a
27 $ echo D >> a
28 $ hg ci -Am AD
28 $ hg ci -Am AD
29 created new head
29 created new head
30
30
31 $ hg tglog
31 $ hg tglog
32 @ 3: 'AD'
32 @ 3: 'AD'
33 |
33 |
34 | o 2: 'C'
34 | o 2: 'C'
35 | |
35 | |
36 | o 1: 'B'
36 | o 1: 'B'
37 |/
37 |/
38 o 0: 'A'
38 o 0: 'A'
39
39
40 $ hg rebase -s 1 -d 3
40 $ hg rebase -s 1 -d 3
41 rebasing 1:0f4f7cb4f549 "B"
41 merging a
42 merging a
43 rebasing 2:30ae917c0e4f "C"
42 merging a
44 merging a
43 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0f4f7cb4f549-backup.hg (glob)
45 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0f4f7cb4f549-backup.hg (glob)
44
46
45 $ hg tglog
47 $ hg tglog
46 o 3: 'C'
48 o 3: 'C'
47 |
49 |
48 o 2: 'B'
50 o 2: 'B'
49 |
51 |
50 @ 1: 'AD'
52 @ 1: 'AD'
51 |
53 |
52 o 0: 'A'
54 o 0: 'A'
53
55
54
56
55 $ cd ..
57 $ cd ..
56
58
57
59
58 Test rebasing of merges with ancestors of the rebase destination - a situation
60 Test rebasing of merges with ancestors of the rebase destination - a situation
59 that often happens when trying to recover from repeated merging with a mainline
61 that often happens when trying to recover from repeated merging with a mainline
60 branch.
62 branch.
61
63
62 The test case creates a dev branch that contains a couple of merges from the
64 The test case creates a dev branch that contains a couple of merges from the
63 default branch. When rebasing to the default branch, these merges would be
65 default branch. When rebasing to the default branch, these merges would be
64 merges with ancestors on the same branch. The merges _could_ contain some
66 merges with ancestors on the same branch. The merges _could_ contain some
65 interesting conflict resolutions or additional changes in the merge commit, but
67 interesting conflict resolutions or additional changes in the merge commit, but
66 that is mixed up with the actual merge stuff and there is in general no way to
68 that is mixed up with the actual merge stuff and there is in general no way to
67 separate them.
69 separate them.
68
70
69 Note: The dev branch contains _no_ changes to f-default. It might be unclear
71 Note: The dev branch contains _no_ changes to f-default. It might be unclear
70 how rebasing of ancestor merges should be handled, but the current behavior
72 how rebasing of ancestor merges should be handled, but the current behavior
71 with spurious prompts for conflicts in files that didn't change seems very
73 with spurious prompts for conflicts in files that didn't change seems very
72 wrong.
74 wrong.
73
75
74 $ hg init ancestor-merge
76 $ hg init ancestor-merge
75 $ cd ancestor-merge
77 $ cd ancestor-merge
76
78
77 $ touch f-default
79 $ touch f-default
78 $ hg ci -Aqm 'default: create f-default'
80 $ hg ci -Aqm 'default: create f-default'
79
81
80 $ hg branch -q dev
82 $ hg branch -q dev
81 $ hg ci -qm 'dev: create branch'
83 $ hg ci -qm 'dev: create branch'
82
84
83 $ echo stuff > f-dev
85 $ echo stuff > f-dev
84 $ hg ci -Aqm 'dev: f-dev stuff'
86 $ hg ci -Aqm 'dev: f-dev stuff'
85
87
86 $ hg up -q default
88 $ hg up -q default
87 $ echo stuff > f-default
89 $ echo stuff > f-default
88 $ hg ci -m 'default: f-default stuff'
90 $ hg ci -m 'default: f-default stuff'
89
91
90 $ hg up -q dev
92 $ hg up -q dev
91 $ hg merge -q default
93 $ hg merge -q default
92 $ hg ci -m 'dev: merge default'
94 $ hg ci -m 'dev: merge default'
93
95
94 $ hg up -q default
96 $ hg up -q default
95 $ hg rm f-default
97 $ hg rm f-default
96 $ hg ci -m 'default: remove f-default'
98 $ hg ci -m 'default: remove f-default'
97
99
98 $ hg up -q dev
100 $ hg up -q dev
99 $ hg merge -q default
101 $ hg merge -q default
100 $ hg ci -m 'dev: merge default'
102 $ hg ci -m 'dev: merge default'
101
103
102 $ hg up -q default
104 $ hg up -q default
103 $ echo stuff > f-other
105 $ echo stuff > f-other
104 $ hg ci -Aqm 'default: f-other stuff'
106 $ hg ci -Aqm 'default: f-other stuff'
105
107
106 $ hg tglog
108 $ hg tglog
107 @ 7: 'default: f-other stuff'
109 @ 7: 'default: f-other stuff'
108 |
110 |
109 | o 6: 'dev: merge default' dev
111 | o 6: 'dev: merge default' dev
110 |/|
112 |/|
111 o | 5: 'default: remove f-default'
113 o | 5: 'default: remove f-default'
112 | |
114 | |
113 | o 4: 'dev: merge default' dev
115 | o 4: 'dev: merge default' dev
114 |/|
116 |/|
115 o | 3: 'default: f-default stuff'
117 o | 3: 'default: f-default stuff'
116 | |
118 | |
117 | o 2: 'dev: f-dev stuff' dev
119 | o 2: 'dev: f-dev stuff' dev
118 | |
120 | |
119 | o 1: 'dev: create branch' dev
121 | o 1: 'dev: create branch' dev
120 |/
122 |/
121 o 0: 'default: create f-default'
123 o 0: 'default: create f-default'
122
124
123 $ hg clone -qU . ../ancestor-merge-2
125 $ hg clone -qU . ../ancestor-merge-2
124
126
125 Full rebase all the way back from branching point:
127 Full rebase all the way back from branching point:
126
128
127 $ hg rebase -r 'only(dev,default)' -d default
129 $ hg rebase -r 'only(dev,default)' -d default
130 rebasing 1:1d1a643d390e "dev: create branch"
131 rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
132 rebasing 4:4b019212aaf6 "dev: merge default"
128 remote changed f-default which local deleted
133 remote changed f-default which local deleted
129 use (c)hanged version or leave (d)eleted? c
134 use (c)hanged version or leave (d)eleted? c
135 rebasing 6:9455ee510502 "dev: merge default"
130 saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-backup.hg (glob)
136 saved backup bundle to $TESTTMP/ancestor-merge/.hg/strip-backup/1d1a643d390e-backup.hg (glob)
131 $ hg tglog
137 $ hg tglog
132 o 6: 'dev: merge default'
138 o 6: 'dev: merge default'
133 |
139 |
134 o 5: 'dev: merge default'
140 o 5: 'dev: merge default'
135 |
141 |
136 o 4: 'dev: f-dev stuff'
142 o 4: 'dev: f-dev stuff'
137 |
143 |
138 @ 3: 'default: f-other stuff'
144 @ 3: 'default: f-other stuff'
139 |
145 |
140 o 2: 'default: remove f-default'
146 o 2: 'default: remove f-default'
141 |
147 |
142 o 1: 'default: f-default stuff'
148 o 1: 'default: f-default stuff'
143 |
149 |
144 o 0: 'default: create f-default'
150 o 0: 'default: create f-default'
145
151
146 Grafty cherry picking rebasing:
152 Grafty cherry picking rebasing:
147
153
148 $ cd ../ancestor-merge-2
154 $ cd ../ancestor-merge-2
149
155
150 $ hg phase -fdr0:
156 $ hg phase -fdr0:
151 $ hg rebase -r 'children(only(dev,default))' -d default
157 $ hg rebase -r 'children(only(dev,default))' -d default
158 rebasing 2:ec2c14fb2984 "dev: f-dev stuff"
159 rebasing 4:4b019212aaf6 "dev: merge default"
152 remote changed f-default which local deleted
160 remote changed f-default which local deleted
153 use (c)hanged version or leave (d)eleted? c
161 use (c)hanged version or leave (d)eleted? c
162 rebasing 6:9455ee510502 "dev: merge default"
154 saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-backup.hg (glob)
163 saved backup bundle to $TESTTMP/ancestor-merge-2/.hg/strip-backup/ec2c14fb2984-backup.hg (glob)
155 $ hg tglog
164 $ hg tglog
156 o 7: 'dev: merge default'
165 o 7: 'dev: merge default'
157 |
166 |
158 o 6: 'dev: merge default'
167 o 6: 'dev: merge default'
159 |
168 |
160 o 5: 'dev: f-dev stuff'
169 o 5: 'dev: f-dev stuff'
161 |
170 |
162 o 4: 'default: f-other stuff'
171 o 4: 'default: f-other stuff'
163 |
172 |
164 o 3: 'default: remove f-default'
173 o 3: 'default: remove f-default'
165 |
174 |
166 o 2: 'default: f-default stuff'
175 o 2: 'default: f-default stuff'
167 |
176 |
168 | o 1: 'dev: create branch' dev
177 | o 1: 'dev: create branch' dev
169 |/
178 |/
170 o 0: 'default: create f-default'
179 o 0: 'default: create f-default'
171
180
172 $ cd ..
181 $ cd ..
173
182
174
183
175 Test order of parents of rebased merged with un-rebased changes as p1.
184 Test order of parents of rebased merged with un-rebased changes as p1.
176
185
177 $ hg init parentorder
186 $ hg init parentorder
178 $ cd parentorder
187 $ cd parentorder
179 $ touch f
188 $ touch f
180 $ hg ci -Aqm common
189 $ hg ci -Aqm common
181 $ touch change
190 $ touch change
182 $ hg ci -Aqm change
191 $ hg ci -Aqm change
183 $ touch target
192 $ touch target
184 $ hg ci -Aqm target
193 $ hg ci -Aqm target
185 $ hg up -qr 0
194 $ hg up -qr 0
186 $ touch outside
195 $ touch outside
187 $ hg ci -Aqm outside
196 $ hg ci -Aqm outside
188 $ hg merge -qr 1
197 $ hg merge -qr 1
189 $ hg ci -m 'merge p1 3=outside p2 1=ancestor'
198 $ hg ci -m 'merge p1 3=outside p2 1=ancestor'
190 $ hg par
199 $ hg par
191 changeset: 4:6990226659be
200 changeset: 4:6990226659be
192 tag: tip
201 tag: tip
193 parent: 3:f59da8fc0fcf
202 parent: 3:f59da8fc0fcf
194 parent: 1:dd40c13f7a6f
203 parent: 1:dd40c13f7a6f
195 user: test
204 user: test
196 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
197 summary: merge p1 3=outside p2 1=ancestor
206 summary: merge p1 3=outside p2 1=ancestor
198
207
199 $ hg up -qr 1
208 $ hg up -qr 1
200 $ hg merge -qr 3
209 $ hg merge -qr 3
201 $ hg ci -qm 'merge p1 1=ancestor p2 3=outside'
210 $ hg ci -qm 'merge p1 1=ancestor p2 3=outside'
202 $ hg par
211 $ hg par
203 changeset: 5:a57575f79074
212 changeset: 5:a57575f79074
204 tag: tip
213 tag: tip
205 parent: 1:dd40c13f7a6f
214 parent: 1:dd40c13f7a6f
206 parent: 3:f59da8fc0fcf
215 parent: 3:f59da8fc0fcf
207 user: test
216 user: test
208 date: Thu Jan 01 00:00:00 1970 +0000
217 date: Thu Jan 01 00:00:00 1970 +0000
209 summary: merge p1 1=ancestor p2 3=outside
218 summary: merge p1 1=ancestor p2 3=outside
210
219
211 $ hg tglog
220 $ hg tglog
212 @ 5: 'merge p1 1=ancestor p2 3=outside'
221 @ 5: 'merge p1 1=ancestor p2 3=outside'
213 |\
222 |\
214 +---o 4: 'merge p1 3=outside p2 1=ancestor'
223 +---o 4: 'merge p1 3=outside p2 1=ancestor'
215 | |/
224 | |/
216 | o 3: 'outside'
225 | o 3: 'outside'
217 | |
226 | |
218 +---o 2: 'target'
227 +---o 2: 'target'
219 | |
228 | |
220 o | 1: 'change'
229 o | 1: 'change'
221 |/
230 |/
222 o 0: 'common'
231 o 0: 'common'
223
232
224 $ hg rebase -r 4 -d 2
233 $ hg rebase -r 4 -d 2
234 rebasing 4:6990226659be "merge p1 3=outside p2 1=ancestor"
225 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/6990226659be-backup.hg (glob)
235 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/6990226659be-backup.hg (glob)
226 $ hg tip
236 $ hg tip
227 changeset: 5:cca50676b1c5
237 changeset: 5:cca50676b1c5
228 tag: tip
238 tag: tip
229 parent: 2:a60552eb93fb
239 parent: 2:a60552eb93fb
230 parent: 3:f59da8fc0fcf
240 parent: 3:f59da8fc0fcf
231 user: test
241 user: test
232 date: Thu Jan 01 00:00:00 1970 +0000
242 date: Thu Jan 01 00:00:00 1970 +0000
233 summary: merge p1 3=outside p2 1=ancestor
243 summary: merge p1 3=outside p2 1=ancestor
234
244
235 $ hg rebase -r 4 -d 2
245 $ hg rebase -r 4 -d 2
246 rebasing 4:a57575f79074 "merge p1 1=ancestor p2 3=outside"
236 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/a57575f79074-backup.hg (glob)
247 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/a57575f79074-backup.hg (glob)
237 $ hg tip
248 $ hg tip
238 changeset: 5:f9daf77ffe76
249 changeset: 5:f9daf77ffe76
239 tag: tip
250 tag: tip
240 parent: 2:a60552eb93fb
251 parent: 2:a60552eb93fb
241 parent: 3:f59da8fc0fcf
252 parent: 3:f59da8fc0fcf
242 user: test
253 user: test
243 date: Thu Jan 01 00:00:00 1970 +0000
254 date: Thu Jan 01 00:00:00 1970 +0000
244 summary: merge p1 1=ancestor p2 3=outside
255 summary: merge p1 1=ancestor p2 3=outside
245
256
246 $ hg tglog
257 $ hg tglog
247 @ 5: 'merge p1 1=ancestor p2 3=outside'
258 @ 5: 'merge p1 1=ancestor p2 3=outside'
248 |\
259 |\
249 +---o 4: 'merge p1 3=outside p2 1=ancestor'
260 +---o 4: 'merge p1 3=outside p2 1=ancestor'
250 | |/
261 | |/
251 | o 3: 'outside'
262 | o 3: 'outside'
252 | |
263 | |
253 o | 2: 'target'
264 o | 2: 'target'
254 | |
265 | |
255 o | 1: 'change'
266 o | 1: 'change'
256 |/
267 |/
257 o 0: 'common'
268 o 0: 'common'
258
269
259 rebase of merge of ancestors
270 rebase of merge of ancestors
260
271
261 $ hg up -qr 2
272 $ hg up -qr 2
262 $ hg merge -qr 3
273 $ hg merge -qr 3
263 $ echo 'other change while merging future "rebase ancestors"' > other
274 $ echo 'other change while merging future "rebase ancestors"' > other
264 $ hg ci -Aqm 'merge rebase ancestors'
275 $ hg ci -Aqm 'merge rebase ancestors'
265 $ hg rebase -d 5 -v
276 $ hg rebase -d 5 -v
277 rebasing 6:4c5f12f25ebe "merge rebase ancestors" (tip)
266 resolving manifests
278 resolving manifests
267 removing other
279 removing other
268 note: merging f9daf77ffe76+ and 4c5f12f25ebe using bids from ancestors a60552eb93fb and f59da8fc0fcf
280 note: merging f9daf77ffe76+ and 4c5f12f25ebe using bids from ancestors a60552eb93fb and f59da8fc0fcf
269
281
270 calculating bids for ancestor a60552eb93fb
282 calculating bids for ancestor a60552eb93fb
271 resolving manifests
283 resolving manifests
272
284
273 calculating bids for ancestor f59da8fc0fcf
285 calculating bids for ancestor f59da8fc0fcf
274 resolving manifests
286 resolving manifests
275
287
276 auction for merging merge bids
288 auction for merging merge bids
277 other: consensus for g
289 other: consensus for g
278 end of auction
290 end of auction
279
291
280 getting other
292 getting other
281 other
293 other
282 rebase merging completed
294 rebase merging completed
283 1 changesets found
295 1 changesets found
284 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/4c5f12f25ebe-backup.hg (glob)
296 saved backup bundle to $TESTTMP/parentorder/.hg/strip-backup/4c5f12f25ebe-backup.hg (glob)
285 1 changesets found
297 1 changesets found
286 adding branch
298 adding branch
287 adding changesets
299 adding changesets
288 adding manifests
300 adding manifests
289 adding file changes
301 adding file changes
290 added 1 changesets with 1 changes to 1 files
302 added 1 changesets with 1 changes to 1 files
291 rebase completed
303 rebase completed
292 $ hg tglog
304 $ hg tglog
293 @ 6: 'merge rebase ancestors'
305 @ 6: 'merge rebase ancestors'
294 |
306 |
295 o 5: 'merge p1 1=ancestor p2 3=outside'
307 o 5: 'merge p1 1=ancestor p2 3=outside'
296 |\
308 |\
297 +---o 4: 'merge p1 3=outside p2 1=ancestor'
309 +---o 4: 'merge p1 3=outside p2 1=ancestor'
298 | |/
310 | |/
299 | o 3: 'outside'
311 | o 3: 'outside'
300 | |
312 | |
301 o | 2: 'target'
313 o | 2: 'target'
302 | |
314 | |
303 o | 1: 'change'
315 o | 1: 'change'
304 |/
316 |/
305 o 0: 'common'
317 o 0: 'common'
306
318
@@ -1,469 +1,494 b''
1 ==========================
1 ==========================
2 Test rebase with obsolete
2 Test rebase with obsolete
3 ==========================
3 ==========================
4
4
5 Enable obsolete
5 Enable obsolete
6
6
7 $ cat >> $HGRCPATH << EOF
7 $ cat >> $HGRCPATH << EOF
8 > [ui]
8 > [ui]
9 > logtemplate= {rev}:{node|short} {desc|firstline}
9 > logtemplate= {rev}:{node|short} {desc|firstline}
10 > [experimental]
10 > [experimental]
11 > evolution=createmarkers,allowunstable
11 > evolution=createmarkers,allowunstable
12 > [phases]
12 > [phases]
13 > publish=False
13 > publish=False
14 > [extensions]'
14 > [extensions]'
15 > rebase=
15 > rebase=
16 > EOF
16 > EOF
17
17
18 Setup rebase canonical repo
18 Setup rebase canonical repo
19
19
20 $ hg init base
20 $ hg init base
21 $ cd base
21 $ cd base
22 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
22 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
23 adding changesets
23 adding changesets
24 adding manifests
24 adding manifests
25 adding file changes
25 adding file changes
26 added 8 changesets with 7 changes to 7 files (+2 heads)
26 added 8 changesets with 7 changes to 7 files (+2 heads)
27 (run 'hg heads' to see heads, 'hg merge' to merge)
27 (run 'hg heads' to see heads, 'hg merge' to merge)
28 $ hg up tip
28 $ hg up tip
29 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 $ hg log -G
30 $ hg log -G
31 @ 7:02de42196ebe H
31 @ 7:02de42196ebe H
32 |
32 |
33 | o 6:eea13746799a G
33 | o 6:eea13746799a G
34 |/|
34 |/|
35 o | 5:24b6387c8c8c F
35 o | 5:24b6387c8c8c F
36 | |
36 | |
37 | o 4:9520eea781bc E
37 | o 4:9520eea781bc E
38 |/
38 |/
39 | o 3:32af7686d403 D
39 | o 3:32af7686d403 D
40 | |
40 | |
41 | o 2:5fddd98957c8 C
41 | o 2:5fddd98957c8 C
42 | |
42 | |
43 | o 1:42ccdea3bb16 B
43 | o 1:42ccdea3bb16 B
44 |/
44 |/
45 o 0:cd010b8cd998 A
45 o 0:cd010b8cd998 A
46
46
47 $ cd ..
47 $ cd ..
48
48
49 simple rebase
49 simple rebase
50 ---------------------------------
50 ---------------------------------
51
51
52 $ hg clone base simple
52 $ hg clone base simple
53 updating to branch default
53 updating to branch default
54 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 $ cd simple
55 $ cd simple
56 $ hg up 32af7686d403
56 $ hg up 32af7686d403
57 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
57 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
58 $ hg rebase -d eea13746799a
58 $ hg rebase -d eea13746799a
59 rebasing 1:42ccdea3bb16 "B"
60 rebasing 2:5fddd98957c8 "C"
61 rebasing 3:32af7686d403 "D"
59 $ hg log -G
62 $ hg log -G
60 @ 10:8eeb3c33ad33 D
63 @ 10:8eeb3c33ad33 D
61 |
64 |
62 o 9:2327fea05063 C
65 o 9:2327fea05063 C
63 |
66 |
64 o 8:e4e5be0395b2 B
67 o 8:e4e5be0395b2 B
65 |
68 |
66 | o 7:02de42196ebe H
69 | o 7:02de42196ebe H
67 | |
70 | |
68 o | 6:eea13746799a G
71 o | 6:eea13746799a G
69 |\|
72 |\|
70 | o 5:24b6387c8c8c F
73 | o 5:24b6387c8c8c F
71 | |
74 | |
72 o | 4:9520eea781bc E
75 o | 4:9520eea781bc E
73 |/
76 |/
74 o 0:cd010b8cd998 A
77 o 0:cd010b8cd998 A
75
78
76 $ hg log --hidden -G
79 $ hg log --hidden -G
77 @ 10:8eeb3c33ad33 D
80 @ 10:8eeb3c33ad33 D
78 |
81 |
79 o 9:2327fea05063 C
82 o 9:2327fea05063 C
80 |
83 |
81 o 8:e4e5be0395b2 B
84 o 8:e4e5be0395b2 B
82 |
85 |
83 | o 7:02de42196ebe H
86 | o 7:02de42196ebe H
84 | |
87 | |
85 o | 6:eea13746799a G
88 o | 6:eea13746799a G
86 |\|
89 |\|
87 | o 5:24b6387c8c8c F
90 | o 5:24b6387c8c8c F
88 | |
91 | |
89 o | 4:9520eea781bc E
92 o | 4:9520eea781bc E
90 |/
93 |/
91 | x 3:32af7686d403 D
94 | x 3:32af7686d403 D
92 | |
95 | |
93 | x 2:5fddd98957c8 C
96 | x 2:5fddd98957c8 C
94 | |
97 | |
95 | x 1:42ccdea3bb16 B
98 | x 1:42ccdea3bb16 B
96 |/
99 |/
97 o 0:cd010b8cd998 A
100 o 0:cd010b8cd998 A
98
101
99 $ hg debugobsolete
102 $ hg debugobsolete
100 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (*) {'user': 'test'} (glob)
103 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (*) {'user': 'test'} (glob)
101 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (*) {'user': 'test'} (glob)
104 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (*) {'user': 'test'} (glob)
102 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (*) {'user': 'test'} (glob)
105 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (*) {'user': 'test'} (glob)
103
106
104
107
105 $ cd ..
108 $ cd ..
106
109
107 empty changeset
110 empty changeset
108 ---------------------------------
111 ---------------------------------
109
112
110 $ hg clone base empty
113 $ hg clone base empty
111 updating to branch default
114 updating to branch default
112 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 $ cd empty
116 $ cd empty
114 $ hg up eea13746799a
117 $ hg up eea13746799a
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
116
119
117 We make a copy of both the first changeset in the rebased and some other in the
120 We make a copy of both the first changeset in the rebased and some other in the
118 set.
121 set.
119
122
120 $ hg graft 42ccdea3bb16 32af7686d403
123 $ hg graft 42ccdea3bb16 32af7686d403
121 grafting 1:42ccdea3bb16 "B"
124 grafting 1:42ccdea3bb16 "B"
122 grafting 3:32af7686d403 "D"
125 grafting 3:32af7686d403 "D"
123 $ hg rebase -s 42ccdea3bb16 -d .
126 $ hg rebase -s 42ccdea3bb16 -d .
127 rebasing 1:42ccdea3bb16 "B"
128 rebasing 2:5fddd98957c8 "C"
129 rebasing 3:32af7686d403 "D"
124 $ hg log -G
130 $ hg log -G
125 o 10:5ae4c968c6ac C
131 o 10:5ae4c968c6ac C
126 |
132 |
127 @ 9:08483444fef9 D
133 @ 9:08483444fef9 D
128 |
134 |
129 o 8:8877864f1edb B
135 o 8:8877864f1edb B
130 |
136 |
131 | o 7:02de42196ebe H
137 | o 7:02de42196ebe H
132 | |
138 | |
133 o | 6:eea13746799a G
139 o | 6:eea13746799a G
134 |\|
140 |\|
135 | o 5:24b6387c8c8c F
141 | o 5:24b6387c8c8c F
136 | |
142 | |
137 o | 4:9520eea781bc E
143 o | 4:9520eea781bc E
138 |/
144 |/
139 o 0:cd010b8cd998 A
145 o 0:cd010b8cd998 A
140
146
141 $ hg log --hidden -G
147 $ hg log --hidden -G
142 o 10:5ae4c968c6ac C
148 o 10:5ae4c968c6ac C
143 |
149 |
144 @ 9:08483444fef9 D
150 @ 9:08483444fef9 D
145 |
151 |
146 o 8:8877864f1edb B
152 o 8:8877864f1edb B
147 |
153 |
148 | o 7:02de42196ebe H
154 | o 7:02de42196ebe H
149 | |
155 | |
150 o | 6:eea13746799a G
156 o | 6:eea13746799a G
151 |\|
157 |\|
152 | o 5:24b6387c8c8c F
158 | o 5:24b6387c8c8c F
153 | |
159 | |
154 o | 4:9520eea781bc E
160 o | 4:9520eea781bc E
155 |/
161 |/
156 | x 3:32af7686d403 D
162 | x 3:32af7686d403 D
157 | |
163 | |
158 | x 2:5fddd98957c8 C
164 | x 2:5fddd98957c8 C
159 | |
165 | |
160 | x 1:42ccdea3bb16 B
166 | x 1:42ccdea3bb16 B
161 |/
167 |/
162 o 0:cd010b8cd998 A
168 o 0:cd010b8cd998 A
163
169
164 $ hg debugobsolete
170 $ hg debugobsolete
165 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
171 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
166 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
172 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
167 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
173 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
168
174
169
175
170 More complex case were part of the rebase set were already rebased
176 More complex case were part of the rebase set were already rebased
171
177
172 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
178 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
179 rebasing 9:08483444fef9 "D"
173 $ hg debugobsolete
180 $ hg debugobsolete
174 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
181 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
175 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
182 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
176 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
183 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
177 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
184 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
178 $ hg log -G
185 $ hg log -G
179 @ 11:4596109a6a43 D
186 @ 11:4596109a6a43 D
180 |
187 |
181 | o 10:5ae4c968c6ac C
188 | o 10:5ae4c968c6ac C
182 | |
189 | |
183 | x 9:08483444fef9 D
190 | x 9:08483444fef9 D
184 | |
191 | |
185 | o 8:8877864f1edb B
192 | o 8:8877864f1edb B
186 | |
193 | |
187 o | 7:02de42196ebe H
194 o | 7:02de42196ebe H
188 | |
195 | |
189 | o 6:eea13746799a G
196 | o 6:eea13746799a G
190 |/|
197 |/|
191 o | 5:24b6387c8c8c F
198 o | 5:24b6387c8c8c F
192 | |
199 | |
193 | o 4:9520eea781bc E
200 | o 4:9520eea781bc E
194 |/
201 |/
195 o 0:cd010b8cd998 A
202 o 0:cd010b8cd998 A
196
203
197 $ hg rebase --source 'desc(B)' --dest 'tip'
204 $ hg rebase --source 'desc(B)' --dest 'tip'
205 rebasing 8:8877864f1edb "B"
206 rebasing 9:08483444fef9 "D"
207 rebasing 10:5ae4c968c6ac "C"
198 $ hg debugobsolete
208 $ hg debugobsolete
199 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
209 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
200 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
210 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
201 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
211 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
202 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
212 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
203 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob)
213 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob)
204 08483444fef91d6224f6655ee586a65d263ad34c 0 {8877864f1edb05d0e07dc4ba77b67a80a7b86672} (*) {'user': 'test'} (glob)
214 08483444fef91d6224f6655ee586a65d263ad34c 0 {8877864f1edb05d0e07dc4ba77b67a80a7b86672} (*) {'user': 'test'} (glob)
205 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob)
215 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob)
206 $ hg log --rev 'divergent()'
216 $ hg log --rev 'divergent()'
207 $ hg log -G
217 $ hg log -G
208 o 13:98f6af4ee953 C
218 o 13:98f6af4ee953 C
209 |
219 |
210 o 12:462a34d07e59 B
220 o 12:462a34d07e59 B
211 |
221 |
212 @ 11:4596109a6a43 D
222 @ 11:4596109a6a43 D
213 |
223 |
214 o 7:02de42196ebe H
224 o 7:02de42196ebe H
215 |
225 |
216 | o 6:eea13746799a G
226 | o 6:eea13746799a G
217 |/|
227 |/|
218 o | 5:24b6387c8c8c F
228 o | 5:24b6387c8c8c F
219 | |
229 | |
220 | o 4:9520eea781bc E
230 | o 4:9520eea781bc E
221 |/
231 |/
222 o 0:cd010b8cd998 A
232 o 0:cd010b8cd998 A
223
233
224 $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003
234 $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003
225 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003
235 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003
226 phase: draft
236 phase: draft
227 parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6
237 parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6
228 parent: -1:0000000000000000000000000000000000000000
238 parent: -1:0000000000000000000000000000000000000000
229 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905
239 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905
230 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
240 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
231 date: Sat Apr 30 15:24:48 2011 +0200
241 date: Sat Apr 30 15:24:48 2011 +0200
232 files+: D
242 files+: D
233 extra: branch=default
243 extra: branch=default
234 extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c
244 extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c
235 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
245 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
236 description:
246 description:
237 D
247 D
238
248
239
249
240 $ cd ..
250 $ cd ..
241
251
242 collapse rebase
252 collapse rebase
243 ---------------------------------
253 ---------------------------------
244
254
245 $ hg clone base collapse
255 $ hg clone base collapse
246 updating to branch default
256 updating to branch default
247 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 $ cd collapse
258 $ cd collapse
249 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
259 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
260 rebasing 1:42ccdea3bb16 "B"
261 rebasing 2:5fddd98957c8 "C"
262 rebasing 3:32af7686d403 "D"
250 $ hg log -G
263 $ hg log -G
251 o 8:4dc2197e807b Collapsed revision
264 o 8:4dc2197e807b Collapsed revision
252 |
265 |
253 | @ 7:02de42196ebe H
266 | @ 7:02de42196ebe H
254 | |
267 | |
255 o | 6:eea13746799a G
268 o | 6:eea13746799a G
256 |\|
269 |\|
257 | o 5:24b6387c8c8c F
270 | o 5:24b6387c8c8c F
258 | |
271 | |
259 o | 4:9520eea781bc E
272 o | 4:9520eea781bc E
260 |/
273 |/
261 o 0:cd010b8cd998 A
274 o 0:cd010b8cd998 A
262
275
263 $ hg log --hidden -G
276 $ hg log --hidden -G
264 o 8:4dc2197e807b Collapsed revision
277 o 8:4dc2197e807b Collapsed revision
265 |
278 |
266 | @ 7:02de42196ebe H
279 | @ 7:02de42196ebe H
267 | |
280 | |
268 o | 6:eea13746799a G
281 o | 6:eea13746799a G
269 |\|
282 |\|
270 | o 5:24b6387c8c8c F
283 | o 5:24b6387c8c8c F
271 | |
284 | |
272 o | 4:9520eea781bc E
285 o | 4:9520eea781bc E
273 |/
286 |/
274 | x 3:32af7686d403 D
287 | x 3:32af7686d403 D
275 | |
288 | |
276 | x 2:5fddd98957c8 C
289 | x 2:5fddd98957c8 C
277 | |
290 | |
278 | x 1:42ccdea3bb16 B
291 | x 1:42ccdea3bb16 B
279 |/
292 |/
280 o 0:cd010b8cd998 A
293 o 0:cd010b8cd998 A
281
294
282 $ hg id --debug -r tip
295 $ hg id --debug -r tip
283 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
296 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
284 $ hg debugobsolete
297 $ hg debugobsolete
285 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
298 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
286 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
299 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
287 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
300 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
288
301
289 $ cd ..
302 $ cd ..
290
303
291 Rebase set has hidden descendants
304 Rebase set has hidden descendants
292 ---------------------------------
305 ---------------------------------
293
306
294 We rebase a changeset which has a hidden changeset. The hidden changeset must
307 We rebase a changeset which has a hidden changeset. The hidden changeset must
295 not be rebased.
308 not be rebased.
296
309
297 $ hg clone base hidden
310 $ hg clone base hidden
298 updating to branch default
311 updating to branch default
299 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
312 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
300 $ cd hidden
313 $ cd hidden
301 $ hg rebase -s 5fddd98957c8 -d eea13746799a
314 $ hg rebase -s 5fddd98957c8 -d eea13746799a
315 rebasing 2:5fddd98957c8 "C"
316 rebasing 3:32af7686d403 "D"
302 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
317 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
318 rebasing 1:42ccdea3bb16 "B"
303 $ hg log -G
319 $ hg log -G
304 o 10:7c6027df6a99 B
320 o 10:7c6027df6a99 B
305 |
321 |
306 | o 9:cf44d2f5a9f4 D
322 | o 9:cf44d2f5a9f4 D
307 | |
323 | |
308 | o 8:e273c5e7d2d2 C
324 | o 8:e273c5e7d2d2 C
309 | |
325 | |
310 @ | 7:02de42196ebe H
326 @ | 7:02de42196ebe H
311 | |
327 | |
312 | o 6:eea13746799a G
328 | o 6:eea13746799a G
313 |/|
329 |/|
314 o | 5:24b6387c8c8c F
330 o | 5:24b6387c8c8c F
315 | |
331 | |
316 | o 4:9520eea781bc E
332 | o 4:9520eea781bc E
317 |/
333 |/
318 o 0:cd010b8cd998 A
334 o 0:cd010b8cd998 A
319
335
320 $ hg log --hidden -G
336 $ hg log --hidden -G
321 o 10:7c6027df6a99 B
337 o 10:7c6027df6a99 B
322 |
338 |
323 | o 9:cf44d2f5a9f4 D
339 | o 9:cf44d2f5a9f4 D
324 | |
340 | |
325 | o 8:e273c5e7d2d2 C
341 | o 8:e273c5e7d2d2 C
326 | |
342 | |
327 @ | 7:02de42196ebe H
343 @ | 7:02de42196ebe H
328 | |
344 | |
329 | o 6:eea13746799a G
345 | o 6:eea13746799a G
330 |/|
346 |/|
331 o | 5:24b6387c8c8c F
347 o | 5:24b6387c8c8c F
332 | |
348 | |
333 | o 4:9520eea781bc E
349 | o 4:9520eea781bc E
334 |/
350 |/
335 | x 3:32af7686d403 D
351 | x 3:32af7686d403 D
336 | |
352 | |
337 | x 2:5fddd98957c8 C
353 | x 2:5fddd98957c8 C
338 | |
354 | |
339 | x 1:42ccdea3bb16 B
355 | x 1:42ccdea3bb16 B
340 |/
356 |/
341 o 0:cd010b8cd998 A
357 o 0:cd010b8cd998 A
342
358
343 $ hg debugobsolete
359 $ hg debugobsolete
344 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (*) {'user': 'test'} (glob)
360 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (*) {'user': 'test'} (glob)
345 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (*) {'user': 'test'} (glob)
361 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (*) {'user': 'test'} (glob)
346 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (*) {'user': 'test'} (glob)
362 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (*) {'user': 'test'} (glob)
347
363
348 Test that rewriting leaving instability behind is allowed
364 Test that rewriting leaving instability behind is allowed
349 ---------------------------------------------------------------------
365 ---------------------------------------------------------------------
350
366
351 $ hg log -r 'children(8)'
367 $ hg log -r 'children(8)'
352 9:cf44d2f5a9f4 D (no-eol)
368 9:cf44d2f5a9f4 D (no-eol)
353 $ hg rebase -r 8
369 $ hg rebase -r 8
370 rebasing 8:e273c5e7d2d2 "C"
354 $ hg log -G
371 $ hg log -G
355 o 11:0d8f238b634c C
372 o 11:0d8f238b634c C
356 |
373 |
357 o 10:7c6027df6a99 B
374 o 10:7c6027df6a99 B
358 |
375 |
359 | o 9:cf44d2f5a9f4 D
376 | o 9:cf44d2f5a9f4 D
360 | |
377 | |
361 | x 8:e273c5e7d2d2 C
378 | x 8:e273c5e7d2d2 C
362 | |
379 | |
363 @ | 7:02de42196ebe H
380 @ | 7:02de42196ebe H
364 | |
381 | |
365 | o 6:eea13746799a G
382 | o 6:eea13746799a G
366 |/|
383 |/|
367 o | 5:24b6387c8c8c F
384 o | 5:24b6387c8c8c F
368 | |
385 | |
369 | o 4:9520eea781bc E
386 | o 4:9520eea781bc E
370 |/
387 |/
371 o 0:cd010b8cd998 A
388 o 0:cd010b8cd998 A
372
389
373
390
374
391
375 Test multiple root handling
392 Test multiple root handling
376 ------------------------------------
393 ------------------------------------
377
394
378 $ hg rebase --dest 4 --rev '7+11+9'
395 $ hg rebase --dest 4 --rev '7+11+9'
396 rebasing 7:02de42196ebe "H"
397 rebasing 9:cf44d2f5a9f4 "D"
398 not rebasing ignored 10:7c6027df6a99 "B"
399 rebasing 11:0d8f238b634c "C" (tip)
379 $ hg log -G
400 $ hg log -G
380 o 14:1e8370e38cca C
401 o 14:1e8370e38cca C
381 |
402 |
382 | o 13:102b4c1d889b D
403 | o 13:102b4c1d889b D
383 | |
404 | |
384 @ | 12:bfe264faf697 H
405 @ | 12:bfe264faf697 H
385 |/
406 |/
386 | o 10:7c6027df6a99 B
407 | o 10:7c6027df6a99 B
387 | |
408 | |
388 | x 7:02de42196ebe H
409 | x 7:02de42196ebe H
389 | |
410 | |
390 +---o 6:eea13746799a G
411 +---o 6:eea13746799a G
391 | |/
412 | |/
392 | o 5:24b6387c8c8c F
413 | o 5:24b6387c8c8c F
393 | |
414 | |
394 o | 4:9520eea781bc E
415 o | 4:9520eea781bc E
395 |/
416 |/
396 o 0:cd010b8cd998 A
417 o 0:cd010b8cd998 A
397
418
398 $ cd ..
419 $ cd ..
399
420
400 test on rebase dropping a merge
421 test on rebase dropping a merge
401
422
402 (setup)
423 (setup)
403
424
404 $ hg init dropmerge
425 $ hg init dropmerge
405 $ cd dropmerge
426 $ cd dropmerge
406 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
427 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
407 adding changesets
428 adding changesets
408 adding manifests
429 adding manifests
409 adding file changes
430 adding file changes
410 added 8 changesets with 7 changes to 7 files (+2 heads)
431 added 8 changesets with 7 changes to 7 files (+2 heads)
411 (run 'hg heads' to see heads, 'hg merge' to merge)
432 (run 'hg heads' to see heads, 'hg merge' to merge)
412 $ hg up 3
433 $ hg up 3
413 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 $ hg merge 7
435 $ hg merge 7
415 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 (branch merge, don't forget to commit)
437 (branch merge, don't forget to commit)
417 $ hg ci -m 'M'
438 $ hg ci -m 'M'
418 $ echo I > I
439 $ echo I > I
419 $ hg add I
440 $ hg add I
420 $ hg ci -m I
441 $ hg ci -m I
421 $ hg log -G
442 $ hg log -G
422 @ 9:4bde274eefcf I
443 @ 9:4bde274eefcf I
423 |
444 |
424 o 8:53a6a128b2b7 M
445 o 8:53a6a128b2b7 M
425 |\
446 |\
426 | o 7:02de42196ebe H
447 | o 7:02de42196ebe H
427 | |
448 | |
428 | | o 6:eea13746799a G
449 | | o 6:eea13746799a G
429 | |/|
450 | |/|
430 | o | 5:24b6387c8c8c F
451 | o | 5:24b6387c8c8c F
431 | | |
452 | | |
432 | | o 4:9520eea781bc E
453 | | o 4:9520eea781bc E
433 | |/
454 | |/
434 o | 3:32af7686d403 D
455 o | 3:32af7686d403 D
435 | |
456 | |
436 o | 2:5fddd98957c8 C
457 o | 2:5fddd98957c8 C
437 | |
458 | |
438 o | 1:42ccdea3bb16 B
459 o | 1:42ccdea3bb16 B
439 |/
460 |/
440 o 0:cd010b8cd998 A
461 o 0:cd010b8cd998 A
441
462
442 (actual test)
463 (actual test)
443
464
444 $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
465 $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
466 rebasing 3:32af7686d403 "D"
467 rebasing 7:02de42196ebe "H"
468 not rebasing ignored 8:53a6a128b2b7 "M"
469 rebasing 9:4bde274eefcf "I" (tip)
445 $ hg log -G
470 $ hg log -G
446 @ 12:acd174b7ab39 I
471 @ 12:acd174b7ab39 I
447 |
472 |
448 o 11:6c11a6218c97 H
473 o 11:6c11a6218c97 H
449 |
474 |
450 | o 10:b5313c85b22e D
475 | o 10:b5313c85b22e D
451 |/
476 |/
452 | o 8:53a6a128b2b7 M
477 | o 8:53a6a128b2b7 M
453 | |\
478 | |\
454 | | x 7:02de42196ebe H
479 | | x 7:02de42196ebe H
455 | | |
480 | | |
456 o---+ 6:eea13746799a G
481 o---+ 6:eea13746799a G
457 | | |
482 | | |
458 | | o 5:24b6387c8c8c F
483 | | o 5:24b6387c8c8c F
459 | | |
484 | | |
460 o---+ 4:9520eea781bc E
485 o---+ 4:9520eea781bc E
461 / /
486 / /
462 x | 3:32af7686d403 D
487 x | 3:32af7686d403 D
463 | |
488 | |
464 o | 2:5fddd98957c8 C
489 o | 2:5fddd98957c8 C
465 | |
490 | |
466 o | 1:42ccdea3bb16 B
491 o | 1:42ccdea3bb16 B
467 |/
492 |/
468 o 0:cd010b8cd998 A
493 o 0:cd010b8cd998 A
469
494
@@ -1,484 +1,512 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 empty "rev" revision set - nothing to rebase
83 empty "rev" revision set - nothing to rebase
84 [1]
84 [1]
85
85
86 $ hg rebase --source '1 & !1'
86 $ hg rebase --source '1 & !1'
87 empty "source" revision set - nothing to rebase
87 empty "source" revision set - nothing to rebase
88 [1]
88 [1]
89
89
90 $ hg rebase --base '1 & !1'
90 $ hg rebase --base '1 & !1'
91 empty "base" revision set - can't compute rebase set
91 empty "base" revision set - can't compute rebase set
92 [1]
92 [1]
93
93
94 $ hg rebase
94 $ hg rebase
95 nothing to rebase - working directory parent is also destination
95 nothing to rebase - working directory parent is also destination
96 [1]
96 [1]
97
97
98 $ hg rebase -b.
98 $ hg rebase -b.
99 nothing to rebase - e7ec4e813ba6 is both "base" and destination
99 nothing to rebase - e7ec4e813ba6 is both "base" and destination
100 [1]
100 [1]
101
101
102 $ hg up -q 7
102 $ hg up -q 7
103
103
104 $ hg rebase --traceback
104 $ hg rebase --traceback
105 nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6
105 nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6
106 [1]
106 [1]
107
107
108 $ hg rebase -b.
108 $ hg rebase -b.
109 nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6
109 nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6
110 [1]
110 [1]
111
111
112 $ hg rebase --dest '1 & !1'
112 $ hg rebase --dest '1 & !1'
113 abort: empty revision set
113 abort: empty revision set
114 [255]
114 [255]
115
115
116 These work:
116 These work:
117
117
118 Rebase with no arguments (from 3 onto 8):
118 Rebase with no arguments (from 3 onto 8):
119
119
120 $ hg up -q -C 3
120 $ hg up -q -C 3
121
121
122 $ hg rebase
122 $ hg rebase
123 rebasing 1:42ccdea3bb16 "B"
124 rebasing 2:5fddd98957c8 "C"
125 rebasing 3:32af7686d403 "D"
123 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
126 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
124
127
125 $ hg tglog
128 $ hg tglog
126 @ 8: 'D'
129 @ 8: 'D'
127 |
130 |
128 o 7: 'C'
131 o 7: 'C'
129 |
132 |
130 o 6: 'B'
133 o 6: 'B'
131 |
134 |
132 o 5: 'I'
135 o 5: 'I'
133 |
136 |
134 o 4: 'H'
137 o 4: 'H'
135 |
138 |
136 | o 3: 'G'
139 | o 3: 'G'
137 |/|
140 |/|
138 o | 2: 'F'
141 o | 2: 'F'
139 | |
142 | |
140 | o 1: 'E'
143 | o 1: 'E'
141 |/
144 |/
142 o 0: 'A'
145 o 0: 'A'
143
146
144 Try to rollback after a rebase (fail):
147 Try to rollback after a rebase (fail):
145
148
146 $ hg rollback
149 $ hg rollback
147 no rollback information available
150 no rollback information available
148 [1]
151 [1]
149
152
150 $ cd ..
153 $ cd ..
151
154
152 Rebase with base == '.' => same as no arguments (from 3 onto 8):
155 Rebase with base == '.' => same as no arguments (from 3 onto 8):
153
156
154 $ hg clone -q -u 3 a a2
157 $ hg clone -q -u 3 a a2
155 $ cd a2
158 $ cd a2
156
159
157 $ hg rebase --base .
160 $ hg rebase --base .
161 rebasing 1:42ccdea3bb16 "B"
162 rebasing 2:5fddd98957c8 "C"
163 rebasing 3:32af7686d403 "D"
158 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
164 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
159
165
160 $ hg tglog
166 $ hg tglog
161 @ 8: 'D'
167 @ 8: 'D'
162 |
168 |
163 o 7: 'C'
169 o 7: 'C'
164 |
170 |
165 o 6: 'B'
171 o 6: 'B'
166 |
172 |
167 o 5: 'I'
173 o 5: 'I'
168 |
174 |
169 o 4: 'H'
175 o 4: 'H'
170 |
176 |
171 | o 3: 'G'
177 | o 3: 'G'
172 |/|
178 |/|
173 o | 2: 'F'
179 o | 2: 'F'
174 | |
180 | |
175 | o 1: 'E'
181 | o 1: 'E'
176 |/
182 |/
177 o 0: 'A'
183 o 0: 'A'
178
184
179 $ cd ..
185 $ cd ..
180
186
181
187
182 Rebase with dest == branch(.) => same as no arguments (from 3 onto 8):
188 Rebase with dest == branch(.) => same as no arguments (from 3 onto 8):
183
189
184 $ hg clone -q -u 3 a a3
190 $ hg clone -q -u 3 a a3
185 $ cd a3
191 $ cd a3
186
192
187 $ hg rebase --dest 'branch(.)'
193 $ hg rebase --dest 'branch(.)'
194 rebasing 1:42ccdea3bb16 "B"
195 rebasing 2:5fddd98957c8 "C"
196 rebasing 3:32af7686d403 "D"
188 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
197 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
189
198
190 $ hg tglog
199 $ hg tglog
191 @ 8: 'D'
200 @ 8: 'D'
192 |
201 |
193 o 7: 'C'
202 o 7: 'C'
194 |
203 |
195 o 6: 'B'
204 o 6: 'B'
196 |
205 |
197 o 5: 'I'
206 o 5: 'I'
198 |
207 |
199 o 4: 'H'
208 o 4: 'H'
200 |
209 |
201 | o 3: 'G'
210 | o 3: 'G'
202 |/|
211 |/|
203 o | 2: 'F'
212 o | 2: 'F'
204 | |
213 | |
205 | o 1: 'E'
214 | o 1: 'E'
206 |/
215 |/
207 o 0: 'A'
216 o 0: 'A'
208
217
209 $ cd ..
218 $ cd ..
210
219
211
220
212 Specify only source (from 2 onto 8):
221 Specify only source (from 2 onto 8):
213
222
214 $ hg clone -q -u . a a4
223 $ hg clone -q -u . a a4
215 $ cd a4
224 $ cd a4
216
225
217 $ hg rebase --source 'desc("C")'
226 $ hg rebase --source 'desc("C")'
227 rebasing 2:5fddd98957c8 "C"
228 rebasing 3:32af7686d403 "D"
218 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
229 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
219
230
220 $ hg tglog
231 $ hg tglog
221 o 8: 'D'
232 o 8: 'D'
222 |
233 |
223 o 7: 'C'
234 o 7: 'C'
224 |
235 |
225 @ 6: 'I'
236 @ 6: 'I'
226 |
237 |
227 o 5: 'H'
238 o 5: 'H'
228 |
239 |
229 | o 4: 'G'
240 | o 4: 'G'
230 |/|
241 |/|
231 o | 3: 'F'
242 o | 3: 'F'
232 | |
243 | |
233 | o 2: 'E'
244 | o 2: 'E'
234 |/
245 |/
235 | o 1: 'B'
246 | o 1: 'B'
236 |/
247 |/
237 o 0: 'A'
248 o 0: 'A'
238
249
239 $ cd ..
250 $ cd ..
240
251
241
252
242 Specify only dest (from 3 onto 6):
253 Specify only dest (from 3 onto 6):
243
254
244 $ hg clone -q -u 3 a a5
255 $ hg clone -q -u 3 a a5
245 $ cd a5
256 $ cd a5
246
257
247 $ hg rebase --dest 6
258 $ hg rebase --dest 6
259 rebasing 1:42ccdea3bb16 "B"
260 rebasing 2:5fddd98957c8 "C"
261 rebasing 3:32af7686d403 "D"
248 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
262 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
249
263
250 $ hg tglog
264 $ hg tglog
251 @ 8: 'D'
265 @ 8: 'D'
252 |
266 |
253 o 7: 'C'
267 o 7: 'C'
254 |
268 |
255 o 6: 'B'
269 o 6: 'B'
256 |
270 |
257 | o 5: 'I'
271 | o 5: 'I'
258 | |
272 | |
259 | o 4: 'H'
273 | o 4: 'H'
260 | |
274 | |
261 o | 3: 'G'
275 o | 3: 'G'
262 |\|
276 |\|
263 | o 2: 'F'
277 | o 2: 'F'
264 | |
278 | |
265 o | 1: 'E'
279 o | 1: 'E'
266 |/
280 |/
267 o 0: 'A'
281 o 0: 'A'
268
282
269 $ cd ..
283 $ cd ..
270
284
271
285
272 Specify only base (from 1 onto 8):
286 Specify only base (from 1 onto 8):
273
287
274 $ hg clone -q -u . a a6
288 $ hg clone -q -u . a a6
275 $ cd a6
289 $ cd a6
276
290
277 $ hg rebase --base 'desc("D")'
291 $ hg rebase --base 'desc("D")'
292 rebasing 1:42ccdea3bb16 "B"
293 rebasing 2:5fddd98957c8 "C"
294 rebasing 3:32af7686d403 "D"
278 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
295 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
279
296
280 $ hg tglog
297 $ hg tglog
281 o 8: 'D'
298 o 8: 'D'
282 |
299 |
283 o 7: 'C'
300 o 7: 'C'
284 |
301 |
285 o 6: 'B'
302 o 6: 'B'
286 |
303 |
287 @ 5: 'I'
304 @ 5: 'I'
288 |
305 |
289 o 4: 'H'
306 o 4: 'H'
290 |
307 |
291 | o 3: 'G'
308 | o 3: 'G'
292 |/|
309 |/|
293 o | 2: 'F'
310 o | 2: 'F'
294 | |
311 | |
295 | o 1: 'E'
312 | o 1: 'E'
296 |/
313 |/
297 o 0: 'A'
314 o 0: 'A'
298
315
299 $ cd ..
316 $ cd ..
300
317
301
318
302 Specify source and dest (from 2 onto 7):
319 Specify source and dest (from 2 onto 7):
303
320
304 $ hg clone -q -u . a a7
321 $ hg clone -q -u . a a7
305 $ cd a7
322 $ cd a7
306
323
307 $ hg rebase --source 2 --dest 7
324 $ hg rebase --source 2 --dest 7
325 rebasing 2:5fddd98957c8 "C"
326 rebasing 3:32af7686d403 "D"
308 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
327 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
309
328
310 $ hg tglog
329 $ hg tglog
311 o 8: 'D'
330 o 8: 'D'
312 |
331 |
313 o 7: 'C'
332 o 7: 'C'
314 |
333 |
315 | @ 6: 'I'
334 | @ 6: 'I'
316 |/
335 |/
317 o 5: 'H'
336 o 5: 'H'
318 |
337 |
319 | o 4: 'G'
338 | o 4: 'G'
320 |/|
339 |/|
321 o | 3: 'F'
340 o | 3: 'F'
322 | |
341 | |
323 | o 2: 'E'
342 | o 2: 'E'
324 |/
343 |/
325 | o 1: 'B'
344 | o 1: 'B'
326 |/
345 |/
327 o 0: 'A'
346 o 0: 'A'
328
347
329 $ cd ..
348 $ cd ..
330
349
331
350
332 Specify base and dest (from 1 onto 7):
351 Specify base and dest (from 1 onto 7):
333
352
334 $ hg clone -q -u . a a8
353 $ hg clone -q -u . a a8
335 $ cd a8
354 $ cd a8
336
355
337 $ hg rebase --base 3 --dest 7
356 $ hg rebase --base 3 --dest 7
357 rebasing 1:42ccdea3bb16 "B"
358 rebasing 2:5fddd98957c8 "C"
359 rebasing 3:32af7686d403 "D"
338 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
360 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-backup.hg (glob)
339
361
340 $ hg tglog
362 $ hg tglog
341 o 8: 'D'
363 o 8: 'D'
342 |
364 |
343 o 7: 'C'
365 o 7: 'C'
344 |
366 |
345 o 6: 'B'
367 o 6: 'B'
346 |
368 |
347 | @ 5: 'I'
369 | @ 5: 'I'
348 |/
370 |/
349 o 4: 'H'
371 o 4: 'H'
350 |
372 |
351 | o 3: 'G'
373 | o 3: 'G'
352 |/|
374 |/|
353 o | 2: 'F'
375 o | 2: 'F'
354 | |
376 | |
355 | o 1: 'E'
377 | o 1: 'E'
356 |/
378 |/
357 o 0: 'A'
379 o 0: 'A'
358
380
359 $ cd ..
381 $ cd ..
360
382
361
383
362 Specify only revs (from 2 onto 8)
384 Specify only revs (from 2 onto 8)
363
385
364 $ hg clone -q -u . a a9
386 $ hg clone -q -u . a a9
365 $ cd a9
387 $ cd a9
366
388
367 $ hg rebase --rev 'desc("C")::'
389 $ hg rebase --rev 'desc("C")::'
390 rebasing 2:5fddd98957c8 "C"
391 rebasing 3:32af7686d403 "D"
368 saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
392 saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
369
393
370 $ hg tglog
394 $ hg tglog
371 o 8: 'D'
395 o 8: 'D'
372 |
396 |
373 o 7: 'C'
397 o 7: 'C'
374 |
398 |
375 @ 6: 'I'
399 @ 6: 'I'
376 |
400 |
377 o 5: 'H'
401 o 5: 'H'
378 |
402 |
379 | o 4: 'G'
403 | o 4: 'G'
380 |/|
404 |/|
381 o | 3: 'F'
405 o | 3: 'F'
382 | |
406 | |
383 | o 2: 'E'
407 | o 2: 'E'
384 |/
408 |/
385 | o 1: 'B'
409 | o 1: 'B'
386 |/
410 |/
387 o 0: 'A'
411 o 0: 'A'
388
412
389 $ cd ..
413 $ cd ..
390
414
391 Test --tool parameter:
415 Test --tool parameter:
392
416
393 $ hg init b
417 $ hg init b
394 $ cd b
418 $ cd b
395
419
396 $ echo c1 > c1
420 $ echo c1 > c1
397 $ hg ci -Am c1
421 $ hg ci -Am c1
398 adding c1
422 adding c1
399
423
400 $ echo c2 > c2
424 $ echo c2 > c2
401 $ hg ci -Am c2
425 $ hg ci -Am c2
402 adding c2
426 adding c2
403
427
404 $ hg up -q 0
428 $ hg up -q 0
405 $ echo c2b > c2
429 $ echo c2b > c2
406 $ hg ci -Am c2b
430 $ hg ci -Am c2b
407 adding c2
431 adding c2
408 created new head
432 created new head
409
433
410 $ cd ..
434 $ cd ..
411
435
412 $ hg clone -q -u . b b1
436 $ hg clone -q -u . b b1
413 $ cd b1
437 $ cd b1
414
438
415 $ hg rebase -s 2 -d 1 --tool internal:local
439 $ hg rebase -s 2 -d 1 --tool internal:local
440 rebasing 2:e4e3f3546619 "c2b" (tip)
416 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
441 saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
417
442
418 $ hg cat c2
443 $ hg cat c2
419 c2
444 c2
420
445
421 $ cd ..
446 $ cd ..
422
447
423
448
424 $ hg clone -q -u . b b2
449 $ hg clone -q -u . b b2
425 $ cd b2
450 $ cd b2
426
451
427 $ hg rebase -s 2 -d 1 --tool internal:other
452 $ hg rebase -s 2 -d 1 --tool internal:other
453 rebasing 2:e4e3f3546619 "c2b" (tip)
428 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
454 saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
429
455
430 $ hg cat c2
456 $ hg cat c2
431 c2b
457 c2b
432
458
433 $ cd ..
459 $ cd ..
434
460
435
461
436 $ hg clone -q -u . b b3
462 $ hg clone -q -u . b b3
437 $ cd b3
463 $ cd b3
438
464
439 $ hg rebase -s 2 -d 1 --tool internal:fail
465 $ hg rebase -s 2 -d 1 --tool internal:fail
466 rebasing 2:e4e3f3546619 "c2b" (tip)
440 unresolved conflicts (see hg resolve, then hg rebase --continue)
467 unresolved conflicts (see hg resolve, then hg rebase --continue)
441 [1]
468 [1]
442
469
443 $ hg summary
470 $ hg summary
444 parent: 1:56daeba07f4b
471 parent: 1:56daeba07f4b
445 c2
472 c2
446 parent: 2:e4e3f3546619 tip
473 parent: 2:e4e3f3546619 tip
447 c2b
474 c2b
448 branch: default
475 branch: default
449 commit: 1 modified, 1 unresolved (merge)
476 commit: 1 modified, 1 unresolved (merge)
450 update: (current)
477 update: (current)
451 rebase: 0 rebased, 1 remaining (rebase --continue)
478 rebase: 0 rebased, 1 remaining (rebase --continue)
452
479
453 $ hg resolve -l
480 $ hg resolve -l
454 U c2
481 U c2
455
482
456 $ hg resolve -m c2
483 $ hg resolve -m c2
457 (no more unresolved files)
484 (no more unresolved files)
458 $ hg rebase -c --tool internal:fail
485 $ hg rebase -c --tool internal:fail
459 tool option will be ignored
486 tool option will be ignored
487 rebasing 2:e4e3f3546619 "c2b" (tip)
460 saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
488 saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-backup.hg (glob)
461
489
462 $ hg rebase -i
490 $ hg rebase -i
463 abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')
491 abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')
464 [255]
492 [255]
465
493
466 $ hg rebase --interactive
494 $ hg rebase --interactive
467 abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')
495 abort: interactive history editing is supported by the 'histedit' extension (see 'hg help histedit')
468 [255]
496 [255]
469
497
470 $ cd ..
498 $ cd ..
471
499
472 No common ancestor
500 No common ancestor
473
501
474 $ hg init separaterepo
502 $ hg init separaterepo
475 $ cd separaterepo
503 $ cd separaterepo
476 $ touch a
504 $ touch a
477 $ hg commit -Aqm a
505 $ hg commit -Aqm a
478 $ hg up -q null
506 $ hg up -q null
479 $ touch b
507 $ touch b
480 $ hg commit -Aqm b
508 $ hg commit -Aqm b
481 $ hg rebase -d 0
509 $ hg rebase -d 0
482 nothing to rebase from d7486e00c6f1 to 3903775176ed
510 nothing to rebase from d7486e00c6f1 to 3903775176ed
483 [1]
511 [1]
484 $ cd ..
512 $ cd ..
@@ -1,167 +1,169 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 rebasing 2:ff8d69a621f9 "L1"
56 saved backup bundle to $TESTTMP/b/.hg/strip-backup/ff8d69a621f9-backup.hg (glob)
57 saved backup bundle to $TESTTMP/b/.hg/strip-backup/ff8d69a621f9-backup.hg (glob)
57
58
58 $ hg tglog
59 $ hg tglog
59 @ 3: 'L1'
60 @ 3: 'L1'
60 |
61 |
61 o 2: 'R1'
62 o 2: 'R1'
62 |
63 |
63 o 1: 'C2'
64 o 1: 'C2'
64 |
65 |
65 o 0: 'C1'
66 o 0: 'C1'
66
67
67 Re-run:
68 Re-run:
68
69
69 $ hg pull --rebase
70 $ hg pull --rebase
70 pulling from $TESTTMP/a (glob)
71 pulling from $TESTTMP/a (glob)
71 searching for changes
72 searching for changes
72 no changes found
73 no changes found
73
74
74
75
75 Invoke pull --rebase and nothing to rebase:
76 Invoke pull --rebase and nothing to rebase:
76
77
77 $ cd ../c
78 $ cd ../c
78
79
79 $ hg book norebase
80 $ hg book norebase
80 $ hg pull --rebase
81 $ hg pull --rebase
81 pulling from $TESTTMP/a (glob)
82 pulling from $TESTTMP/a (glob)
82 searching for changes
83 searching for changes
83 adding changesets
84 adding changesets
84 adding manifests
85 adding manifests
85 adding file changes
86 adding file changes
86 added 1 changesets with 1 changes to 1 files
87 added 1 changesets with 1 changes to 1 files
87 nothing to rebase - working directory parent is already an ancestor of destination 77ae9631bcca
88 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
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 updating bookmark norebase
90 updating bookmark norebase
90
91
91 $ hg tglog -l 1
92 $ hg tglog -l 1
92 @ 2: 'R1'
93 @ 2: 'R1'
93 |
94 |
94
95
95 pull --rebase --update should ignore --update:
96 pull --rebase --update should ignore --update:
96
97
97 $ hg pull --rebase --update
98 $ hg pull --rebase --update
98 pulling from $TESTTMP/a (glob)
99 pulling from $TESTTMP/a (glob)
99 searching for changes
100 searching for changes
100 no changes found
101 no changes found
101
102
102 pull --rebase doesn't update if nothing has been pulled:
103 pull --rebase doesn't update if nothing has been pulled:
103
104
104 $ hg up -q 1
105 $ hg up -q 1
105
106
106 $ hg pull --rebase
107 $ hg pull --rebase
107 pulling from $TESTTMP/a (glob)
108 pulling from $TESTTMP/a (glob)
108 searching for changes
109 searching for changes
109 no changes found
110 no changes found
110
111
111 $ hg tglog -l 1
112 $ hg tglog -l 1
112 o 2: 'R1'
113 o 2: 'R1'
113 |
114 |
114
115
115 $ cd ..
116 $ cd ..
116
117
117 pull --rebase works when a specific revision is pulled (issue3619)
118 pull --rebase works when a specific revision is pulled (issue3619)
118
119
119 $ cd a
120 $ cd a
120 $ hg tglog
121 $ hg tglog
121 @ 2: 'R1'
122 @ 2: 'R1'
122 |
123 |
123 o 1: 'C2'
124 o 1: 'C2'
124 |
125 |
125 o 0: 'C1'
126 o 0: 'C1'
126
127
127 $ echo R2 > R2
128 $ echo R2 > R2
128 $ hg ci -Am R2
129 $ hg ci -Am R2
129 adding R2
130 adding R2
130 $ echo R3 > R3
131 $ echo R3 > R3
131 $ hg ci -Am R3
132 $ hg ci -Am R3
132 adding R3
133 adding R3
133 $ cd ../c
134 $ cd ../c
134 $ hg tglog
135 $ hg tglog
135 o 2: 'R1'
136 o 2: 'R1'
136 |
137 |
137 @ 1: 'C2'
138 @ 1: 'C2'
138 |
139 |
139 o 0: 'C1'
140 o 0: 'C1'
140
141
141 $ echo L1 > L1
142 $ echo L1 > L1
142 $ hg ci -Am L1
143 $ hg ci -Am L1
143 adding L1
144 adding L1
144 created new head
145 created new head
145 $ hg pull --rev tip --rebase
146 $ hg pull --rev tip --rebase
146 pulling from $TESTTMP/a (glob)
147 pulling from $TESTTMP/a (glob)
147 searching for changes
148 searching for changes
148 adding changesets
149 adding changesets
149 adding manifests
150 adding manifests
150 adding file changes
151 adding file changes
151 added 2 changesets with 2 changes to 2 files
152 added 2 changesets with 2 changes to 2 files
153 rebasing 3:ff8d69a621f9 "L1"
152 saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-backup.hg (glob)
154 saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-backup.hg (glob)
153 $ hg tglog
155 $ hg tglog
154 @ 5: 'L1'
156 @ 5: 'L1'
155 |
157 |
156 o 4: 'R3'
158 o 4: 'R3'
157 |
159 |
158 o 3: 'R2'
160 o 3: 'R2'
159 |
161 |
160 o 2: 'R1'
162 o 2: 'R1'
161 |
163 |
162 o 1: 'C2'
164 o 1: 'C2'
163 |
165 |
164 o 0: 'C1'
166 o 0: 'C1'
165
167
166
168
167
169
@@ -1,323 +1,332 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 >
4 >
5 > [alias]
5 > [alias]
6 > tlog = log --template "{rev}: '{desc}' {branches}\n"
6 > tlog = log --template "{rev}: '{desc}' {branches}\n"
7 > tglog = tlog --graph
7 > tglog = tlog --graph
8 > EOF
8 > EOF
9
9
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13
14 $ mkdir d
14 $ mkdir d
15 $ echo a > a
15 $ echo a > a
16 $ hg ci -Am A
16 $ hg ci -Am A
17 adding a
17 adding a
18
18
19 $ echo b > d/b
19 $ echo b > d/b
20 $ hg ci -Am B
20 $ hg ci -Am B
21 adding d/b
21 adding d/b
22
22
23 $ hg mv d d-renamed
23 $ hg mv d d-renamed
24 moving d/b to d-renamed/b (glob)
24 moving d/b to d-renamed/b (glob)
25 $ hg ci -m 'rename B'
25 $ hg ci -m 'rename B'
26
26
27 $ hg up -q -C 1
27 $ hg up -q -C 1
28
28
29 $ hg mv a a-renamed
29 $ hg mv a a-renamed
30 $ echo x > d/x
30 $ echo x > d/x
31 $ hg add d/x
31 $ hg add d/x
32
32
33 $ hg ci -m 'rename A'
33 $ hg ci -m 'rename A'
34 created new head
34 created new head
35
35
36 $ hg tglog
36 $ hg tglog
37 @ 3: 'rename A'
37 @ 3: 'rename A'
38 |
38 |
39 | o 2: 'rename B'
39 | o 2: 'rename B'
40 |/
40 |/
41 o 1: 'B'
41 o 1: 'B'
42 |
42 |
43 o 0: 'A'
43 o 0: 'A'
44
44
45
45
46 Rename is tracked:
46 Rename is tracked:
47
47
48 $ hg tlog -p --git -r tip
48 $ hg tlog -p --git -r tip
49 3: 'rename A'
49 3: 'rename A'
50 diff --git a/a b/a-renamed
50 diff --git a/a b/a-renamed
51 rename from a
51 rename from a
52 rename to a-renamed
52 rename to a-renamed
53 diff --git a/d/x b/d/x
53 diff --git a/d/x b/d/x
54 new file mode 100644
54 new file mode 100644
55 --- /dev/null
55 --- /dev/null
56 +++ b/d/x
56 +++ b/d/x
57 @@ -0,0 +1,1 @@
57 @@ -0,0 +1,1 @@
58 +x
58 +x
59
59
60 Rebase the revision containing the rename:
60 Rebase the revision containing the rename:
61
61
62 $ hg rebase -s 3 -d 2
62 $ hg rebase -s 3 -d 2
63 rebasing 3:73a3ee40125d "rename A" (tip)
63 saved backup bundle to $TESTTMP/a/.hg/strip-backup/73a3ee40125d-backup.hg (glob)
64 saved backup bundle to $TESTTMP/a/.hg/strip-backup/73a3ee40125d-backup.hg (glob)
64
65
65 $ hg tglog
66 $ hg tglog
66 @ 3: 'rename A'
67 @ 3: 'rename A'
67 |
68 |
68 o 2: 'rename B'
69 o 2: 'rename B'
69 |
70 |
70 o 1: 'B'
71 o 1: 'B'
71 |
72 |
72 o 0: 'A'
73 o 0: 'A'
73
74
74
75
75 Rename is not lost:
76 Rename is not lost:
76
77
77 $ hg tlog -p --git -r tip
78 $ hg tlog -p --git -r tip
78 3: 'rename A'
79 3: 'rename A'
79 diff --git a/a b/a-renamed
80 diff --git a/a b/a-renamed
80 rename from a
81 rename from a
81 rename to a-renamed
82 rename to a-renamed
82 diff --git a/d-renamed/x b/d-renamed/x
83 diff --git a/d-renamed/x b/d-renamed/x
83 new file mode 100644
84 new file mode 100644
84 --- /dev/null
85 --- /dev/null
85 +++ b/d-renamed/x
86 +++ b/d-renamed/x
86 @@ -0,0 +1,1 @@
87 @@ -0,0 +1,1 @@
87 +x
88 +x
88
89
89
90
90 Rebased revision does not contain information about b (issue3739)
91 Rebased revision does not contain information about b (issue3739)
91
92
92 $ hg log -r 3 --debug
93 $ hg log -r 3 --debug
93 changeset: 3:032a9b75e83bff1dcfb6cbfa4ef50a704bf1b569
94 changeset: 3:032a9b75e83bff1dcfb6cbfa4ef50a704bf1b569
94 tag: tip
95 tag: tip
95 phase: draft
96 phase: draft
96 parent: 2:220d0626d185f372d9d8f69d9c73b0811d7725f7
97 parent: 2:220d0626d185f372d9d8f69d9c73b0811d7725f7
97 parent: -1:0000000000000000000000000000000000000000
98 parent: -1:0000000000000000000000000000000000000000
98 manifest: 3:035d66b27a1b06b2d12b46d41a39adb7a200c370
99 manifest: 3:035d66b27a1b06b2d12b46d41a39adb7a200c370
99 user: test
100 user: test
100 date: Thu Jan 01 00:00:00 1970 +0000
101 date: Thu Jan 01 00:00:00 1970 +0000
101 files+: a-renamed d-renamed/x
102 files+: a-renamed d-renamed/x
102 files-: a
103 files-: a
103 extra: branch=default
104 extra: branch=default
104 extra: rebase_source=73a3ee40125d6f0f347082e5831ceccb3f005f8a
105 extra: rebase_source=73a3ee40125d6f0f347082e5831ceccb3f005f8a
105 description:
106 description:
106 rename A
107 rename A
107
108
108
109
109
110
110 $ cd ..
111 $ cd ..
111
112
112
113
113 $ hg init b
114 $ hg init b
114 $ cd b
115 $ cd b
115
116
116 $ echo a > a
117 $ echo a > a
117 $ hg ci -Am A
118 $ hg ci -Am A
118 adding a
119 adding a
119
120
120 $ echo b > b
121 $ echo b > b
121 $ hg ci -Am B
122 $ hg ci -Am B
122 adding b
123 adding b
123
124
124 $ hg cp b b-copied
125 $ hg cp b b-copied
125 $ hg ci -Am 'copy B'
126 $ hg ci -Am 'copy B'
126
127
127 $ hg up -q -C 1
128 $ hg up -q -C 1
128
129
129 $ hg cp a a-copied
130 $ hg cp a a-copied
130 $ hg ci -m 'copy A'
131 $ hg ci -m 'copy A'
131 created new head
132 created new head
132
133
133 $ hg tglog
134 $ hg tglog
134 @ 3: 'copy A'
135 @ 3: 'copy A'
135 |
136 |
136 | o 2: 'copy B'
137 | o 2: 'copy B'
137 |/
138 |/
138 o 1: 'B'
139 o 1: 'B'
139 |
140 |
140 o 0: 'A'
141 o 0: 'A'
141
142
142 Copy is tracked:
143 Copy is tracked:
143
144
144 $ hg tlog -p --git -r tip
145 $ hg tlog -p --git -r tip
145 3: 'copy A'
146 3: 'copy A'
146 diff --git a/a b/a-copied
147 diff --git a/a b/a-copied
147 copy from a
148 copy from a
148 copy to a-copied
149 copy to a-copied
149
150
150 Rebase the revision containing the copy:
151 Rebase the revision containing the copy:
151
152
152 $ hg rebase -s 3 -d 2
153 $ hg rebase -s 3 -d 2
154 rebasing 3:0a8162ff18a8 "copy A" (tip)
153 saved backup bundle to $TESTTMP/b/.hg/strip-backup/0a8162ff18a8-backup.hg (glob)
155 saved backup bundle to $TESTTMP/b/.hg/strip-backup/0a8162ff18a8-backup.hg (glob)
154
156
155 $ hg tglog
157 $ hg tglog
156 @ 3: 'copy A'
158 @ 3: 'copy A'
157 |
159 |
158 o 2: 'copy B'
160 o 2: 'copy B'
159 |
161 |
160 o 1: 'B'
162 o 1: 'B'
161 |
163 |
162 o 0: 'A'
164 o 0: 'A'
163
165
164
166
165 Copy is not lost:
167 Copy is not lost:
166
168
167 $ hg tlog -p --git -r tip
169 $ hg tlog -p --git -r tip
168 3: 'copy A'
170 3: 'copy A'
169 diff --git a/a b/a-copied
171 diff --git a/a b/a-copied
170 copy from a
172 copy from a
171 copy to a-copied
173 copy to a-copied
172
174
173
175
174 Rebased revision does not contain information about b (issue3739)
176 Rebased revision does not contain information about b (issue3739)
175
177
176 $ hg log -r 3 --debug
178 $ hg log -r 3 --debug
177 changeset: 3:98f6e6dbf45ab54079c2237fbd11066a5c41a11d
179 changeset: 3:98f6e6dbf45ab54079c2237fbd11066a5c41a11d
178 tag: tip
180 tag: tip
179 phase: draft
181 phase: draft
180 parent: 2:39e588434882ff77d01229d169cdc77f29e8855e
182 parent: 2:39e588434882ff77d01229d169cdc77f29e8855e
181 parent: -1:0000000000000000000000000000000000000000
183 parent: -1:0000000000000000000000000000000000000000
182 manifest: 3:2232f329d66fffe3930d43479ae624f66322b04d
184 manifest: 3:2232f329d66fffe3930d43479ae624f66322b04d
183 user: test
185 user: test
184 date: Thu Jan 01 00:00:00 1970 +0000
186 date: Thu Jan 01 00:00:00 1970 +0000
185 files+: a-copied
187 files+: a-copied
186 extra: branch=default
188 extra: branch=default
187 extra: rebase_source=0a8162ff18a8900df8df8ef7ac0046955205613e
189 extra: rebase_source=0a8162ff18a8900df8df8ef7ac0046955205613e
188 description:
190 description:
189 copy A
191 copy A
190
192
191
193
192
194
193 $ cd ..
195 $ cd ..
194
196
195
197
196 Test rebase across repeating renames:
198 Test rebase across repeating renames:
197
199
198 $ hg init repo
200 $ hg init repo
199
201
200 $ cd repo
202 $ cd repo
201
203
202 $ echo testing > file1.txt
204 $ echo testing > file1.txt
203 $ hg add file1.txt
205 $ hg add file1.txt
204 $ hg ci -m "Adding file1"
206 $ hg ci -m "Adding file1"
205
207
206 $ hg rename file1.txt file2.txt
208 $ hg rename file1.txt file2.txt
207 $ hg ci -m "Rename file1 to file2"
209 $ hg ci -m "Rename file1 to file2"
208
210
209 $ echo Unrelated change > unrelated.txt
211 $ echo Unrelated change > unrelated.txt
210 $ hg add unrelated.txt
212 $ hg add unrelated.txt
211 $ hg ci -m "Unrelated change"
213 $ hg ci -m "Unrelated change"
212
214
213 $ hg rename file2.txt file1.txt
215 $ hg rename file2.txt file1.txt
214 $ hg ci -m "Rename file2 back to file1"
216 $ hg ci -m "Rename file2 back to file1"
215
217
216 $ hg update -r -2
218 $ hg update -r -2
217 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
219 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
218
220
219 $ echo Another unrelated change >> unrelated.txt
221 $ echo Another unrelated change >> unrelated.txt
220 $ hg ci -m "Another unrelated change"
222 $ hg ci -m "Another unrelated change"
221 created new head
223 created new head
222
224
223 $ hg tglog
225 $ hg tglog
224 @ 4: 'Another unrelated change'
226 @ 4: 'Another unrelated change'
225 |
227 |
226 | o 3: 'Rename file2 back to file1'
228 | o 3: 'Rename file2 back to file1'
227 |/
229 |/
228 o 2: 'Unrelated change'
230 o 2: 'Unrelated change'
229 |
231 |
230 o 1: 'Rename file1 to file2'
232 o 1: 'Rename file1 to file2'
231 |
233 |
232 o 0: 'Adding file1'
234 o 0: 'Adding file1'
233
235
234
236
235 $ hg rebase -s 4 -d 3
237 $ hg rebase -s 4 -d 3
238 rebasing 4:b918d683b091 "Another unrelated change" (tip)
236 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/b918d683b091-backup.hg (glob)
239 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/b918d683b091-backup.hg (glob)
237
240
238 $ hg diff --stat -c .
241 $ hg diff --stat -c .
239 unrelated.txt | 1 +
242 unrelated.txt | 1 +
240 1 files changed, 1 insertions(+), 0 deletions(-)
243 1 files changed, 1 insertions(+), 0 deletions(-)
241
244
242 $ cd ..
245 $ cd ..
243
246
244 Verify that copies get preserved (issue4192).
247 Verify that copies get preserved (issue4192).
245 $ hg init copy-gets-preserved
248 $ hg init copy-gets-preserved
246 $ cd copy-gets-preserved
249 $ cd copy-gets-preserved
247
250
248 $ echo a > a
251 $ echo a > a
249 $ hg add a
252 $ hg add a
250 $ hg commit --message "File a created"
253 $ hg commit --message "File a created"
251 $ hg copy a b
254 $ hg copy a b
252 $ echo b > b
255 $ echo b > b
253 $ hg commit --message "File b created as copy of a and modified"
256 $ hg commit --message "File b created as copy of a and modified"
254 $ hg copy b c
257 $ hg copy b c
255 $ echo c > c
258 $ echo c > c
256 $ hg commit --message "File c created as copy of b and modified"
259 $ hg commit --message "File c created as copy of b and modified"
257 $ hg copy c d
260 $ hg copy c d
258 $ echo d > d
261 $ echo d > d
259 $ hg commit --message "File d created as copy of c and modified"
262 $ hg commit --message "File d created as copy of c and modified"
260
263
261 Note that there are four entries in the log for d
264 Note that there are four entries in the log for d
262 $ hg tglog --follow d
265 $ hg tglog --follow d
263 @ 3: 'File d created as copy of c and modified'
266 @ 3: 'File d created as copy of c and modified'
264 |
267 |
265 o 2: 'File c created as copy of b and modified'
268 o 2: 'File c created as copy of b and modified'
266 |
269 |
267 o 1: 'File b created as copy of a and modified'
270 o 1: 'File b created as copy of a and modified'
268 |
271 |
269 o 0: 'File a created'
272 o 0: 'File a created'
270
273
271 Update back to before we performed copies, and inject an unrelated change.
274 Update back to before we performed copies, and inject an unrelated change.
272 $ hg update 0
275 $ hg update 0
273 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
276 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
274
277
275 $ echo unrelated > unrelated
278 $ echo unrelated > unrelated
276 $ hg add unrelated
279 $ hg add unrelated
277 $ hg commit --message "Unrelated file created"
280 $ hg commit --message "Unrelated file created"
278 created new head
281 created new head
279 $ hg update 4
282 $ hg update 4
280 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
283 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
281
284
282 Rebase the copies on top of the unrelated change.
285 Rebase the copies on top of the unrelated change.
283 $ hg rebase --source 1 --dest 4
286 $ hg rebase --source 1 --dest 4
287 rebasing 1:79d255d24ad2 "File b created as copy of a and modified"
288 rebasing 2:327f772bc074 "File c created as copy of b and modified"
289 rebasing 3:421b7e82bb85 "File d created as copy of c and modified"
284 saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/79d255d24ad2-backup.hg (glob)
290 saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/79d255d24ad2-backup.hg (glob)
285 $ hg update 4
291 $ hg update 4
286 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
287
293
288 There should still be four entries in the log for d
294 There should still be four entries in the log for d
289 $ hg tglog --follow d
295 $ hg tglog --follow d
290 @ 4: 'File d created as copy of c and modified'
296 @ 4: 'File d created as copy of c and modified'
291 |
297 |
292 o 3: 'File c created as copy of b and modified'
298 o 3: 'File c created as copy of b and modified'
293 |
299 |
294 o 2: 'File b created as copy of a and modified'
300 o 2: 'File b created as copy of a and modified'
295 |
301 |
296 o 0: 'File a created'
302 o 0: 'File a created'
297
303
298 Same steps as above, but with --collapse on rebase to make sure the
304 Same steps as above, but with --collapse on rebase to make sure the
299 copy records collapse correctly.
305 copy records collapse correctly.
300 $ hg co 1
306 $ hg co 1
301 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
307 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
302 $ echo more >> unrelated
308 $ echo more >> unrelated
303 $ hg ci -m 'unrelated commit is unrelated'
309 $ hg ci -m 'unrelated commit is unrelated'
304 created new head
310 created new head
305 $ hg rebase -s 2 --dest 5 --collapse
311 $ hg rebase -s 2 --dest 5 --collapse
312 rebasing 2:68bf06433839 "File b created as copy of a and modified"
313 rebasing 3:af74b229bc02 "File c created as copy of b and modified"
306 merging b and c to c
314 merging b and c to c
315 rebasing 4:dbb9ba033561 "File d created as copy of c and modified"
307 merging c and d to d
316 merging c and d to d
308 saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/68bf06433839-backup.hg (glob)
317 saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/strip-backup/68bf06433839-backup.hg (glob)
309 $ hg co tip
318 $ hg co tip
310 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
319 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
311
320
312 This should show both revision 3 and 0 since 'd' was transitively a
321 This should show both revision 3 and 0 since 'd' was transitively a
313 copy of 'a'.
322 copy of 'a'.
314
323
315 $ hg tglog --follow d
324 $ hg tglog --follow d
316 @ 3: 'Collapsed revision
325 @ 3: 'Collapsed revision
317 | * File b created as copy of a and modified
326 | * File b created as copy of a and modified
318 | * File c created as copy of b and modified
327 | * File c created as copy of b and modified
319 | * File d created as copy of c and modified'
328 | * File d created as copy of c and modified'
320 o 0: 'File a created'
329 o 0: 'File a created'
321
330
322
331
323 $ cd ..
332 $ cd ..
@@ -1,693 +1,743 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 (this also tests that editor is invoked if '--edit' is specified)
28 (this also tests that editor is invoked if '--edit' is specified)
29
29
30 $ hg clone -q -u . a a1
30 $ hg clone -q -u . a a1
31 $ cd a1
31 $ cd a1
32
32
33 $ hg tglog
33 $ hg tglog
34 @ 7: 'H'
34 @ 7: 'H'
35 |
35 |
36 | o 6: 'G'
36 | o 6: 'G'
37 |/|
37 |/|
38 o | 5: 'F'
38 o | 5: 'F'
39 | |
39 | |
40 | o 4: 'E'
40 | o 4: 'E'
41 |/
41 |/
42 | o 3: 'D'
42 | o 3: 'D'
43 | |
43 | |
44 | o 2: 'C'
44 | o 2: 'C'
45 | |
45 | |
46 | o 1: 'B'
46 | o 1: 'B'
47 |/
47 |/
48 o 0: 'A'
48 o 0: 'A'
49
49
50
50
51 $ hg status --rev "3^1" --rev 3
51 $ hg status --rev "3^1" --rev 3
52 A D
52 A D
53 $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit
53 $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit
54 rebasing 3:32af7686d403 "D"
54 D
55 D
55
56
56
57
57 HG: Enter commit message. Lines beginning with 'HG:' are removed.
58 HG: Enter commit message. Lines beginning with 'HG:' are removed.
58 HG: Leave message empty to abort commit.
59 HG: Leave message empty to abort commit.
59 HG: --
60 HG: --
60 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
61 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
61 HG: branch 'default'
62 HG: branch 'default'
62 HG: added D
63 HG: added D
63 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-backup.hg (glob)
64 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-backup.hg (glob)
64
65
65 $ hg tglog
66 $ hg tglog
66 o 7: 'D'
67 o 7: 'D'
67 |
68 |
68 @ 6: 'H'
69 @ 6: 'H'
69 |
70 |
70 | o 5: 'G'
71 | o 5: 'G'
71 |/|
72 |/|
72 o | 4: 'F'
73 o | 4: 'F'
73 | |
74 | |
74 | o 3: 'E'
75 | o 3: 'E'
75 |/
76 |/
76 | o 2: 'C'
77 | o 2: 'C'
77 | |
78 | |
78 | o 1: 'B'
79 | o 1: 'B'
79 |/
80 |/
80 o 0: 'A'
81 o 0: 'A'
81
82
82 $ cd ..
83 $ cd ..
83
84
84
85
85 D onto F - intermediate point:
86 D onto F - intermediate point:
86 (this also tests that editor is not invoked if '--edit' is not specified)
87 (this also tests that editor is not invoked if '--edit' is not specified)
87
88
88 $ hg clone -q -u . a a2
89 $ hg clone -q -u . a a2
89 $ cd a2
90 $ cd a2
90
91
91 $ HGEDITOR=cat hg rebase -s 3 -d 5
92 $ HGEDITOR=cat hg rebase -s 3 -d 5
93 rebasing 3:32af7686d403 "D"
92 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-backup.hg (glob)
94 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-backup.hg (glob)
93
95
94 $ hg tglog
96 $ hg tglog
95 o 7: 'D'
97 o 7: 'D'
96 |
98 |
97 | @ 6: 'H'
99 | @ 6: 'H'
98 |/
100 |/
99 | o 5: 'G'
101 | o 5: 'G'
100 |/|
102 |/|
101 o | 4: 'F'
103 o | 4: 'F'
102 | |
104 | |
103 | o 3: 'E'
105 | o 3: 'E'
104 |/
106 |/
105 | o 2: 'C'
107 | o 2: 'C'
106 | |
108 | |
107 | o 1: 'B'
109 | o 1: 'B'
108 |/
110 |/
109 o 0: 'A'
111 o 0: 'A'
110
112
111 $ cd ..
113 $ cd ..
112
114
113
115
114 E onto H - skip of G:
116 E onto H - skip of G:
115
117
116 $ hg clone -q -u . a a3
118 $ hg clone -q -u . a a3
117 $ cd a3
119 $ cd a3
118
120
119 $ hg rebase -s 4 -d 7
121 $ hg rebase -s 4 -d 7
122 rebasing 4:9520eea781bc "E"
123 rebasing 6:eea13746799a "G"
120 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-backup.hg (glob)
124 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-backup.hg (glob)
121
125
122 $ hg tglog
126 $ hg tglog
123 o 6: 'E'
127 o 6: 'E'
124 |
128 |
125 @ 5: 'H'
129 @ 5: 'H'
126 |
130 |
127 o 4: 'F'
131 o 4: 'F'
128 |
132 |
129 | o 3: 'D'
133 | o 3: 'D'
130 | |
134 | |
131 | o 2: 'C'
135 | o 2: 'C'
132 | |
136 | |
133 | o 1: 'B'
137 | o 1: 'B'
134 |/
138 |/
135 o 0: 'A'
139 o 0: 'A'
136
140
137 $ cd ..
141 $ cd ..
138
142
139
143
140 F onto E - rebase of a branching point (skip G):
144 F onto E - rebase of a branching point (skip G):
141
145
142 $ hg clone -q -u . a a4
146 $ hg clone -q -u . a a4
143 $ cd a4
147 $ cd a4
144
148
145 $ hg rebase -s 5 -d 4
149 $ hg rebase -s 5 -d 4
150 rebasing 5:24b6387c8c8c "F"
151 rebasing 6:eea13746799a "G"
152 rebasing 7:02de42196ebe "H" (tip)
146 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
153 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
147
154
148 $ hg tglog
155 $ hg tglog
149 @ 6: 'H'
156 @ 6: 'H'
150 |
157 |
151 o 5: 'F'
158 o 5: 'F'
152 |
159 |
153 o 4: 'E'
160 o 4: 'E'
154 |
161 |
155 | o 3: 'D'
162 | o 3: 'D'
156 | |
163 | |
157 | o 2: 'C'
164 | o 2: 'C'
158 | |
165 | |
159 | o 1: 'B'
166 | o 1: 'B'
160 |/
167 |/
161 o 0: 'A'
168 o 0: 'A'
162
169
163 $ cd ..
170 $ cd ..
164
171
165
172
166 G onto H - merged revision having a parent in ancestors of target:
173 G onto H - merged revision having a parent in ancestors of target:
167
174
168 $ hg clone -q -u . a a5
175 $ hg clone -q -u . a a5
169 $ cd a5
176 $ cd a5
170
177
171 $ hg rebase -s 6 -d 7
178 $ hg rebase -s 6 -d 7
179 rebasing 6:eea13746799a "G"
172 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-backup.hg (glob)
180 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-backup.hg (glob)
173
181
174 $ hg tglog
182 $ hg tglog
175 o 7: 'G'
183 o 7: 'G'
176 |\
184 |\
177 | @ 6: 'H'
185 | @ 6: 'H'
178 | |
186 | |
179 | o 5: 'F'
187 | o 5: 'F'
180 | |
188 | |
181 o | 4: 'E'
189 o | 4: 'E'
182 |/
190 |/
183 | o 3: 'D'
191 | o 3: 'D'
184 | |
192 | |
185 | o 2: 'C'
193 | o 2: 'C'
186 | |
194 | |
187 | o 1: 'B'
195 | o 1: 'B'
188 |/
196 |/
189 o 0: 'A'
197 o 0: 'A'
190
198
191 $ cd ..
199 $ cd ..
192
200
193
201
194 F onto B - G maintains E as parent:
202 F onto B - G maintains E as parent:
195
203
196 $ hg clone -q -u . a a6
204 $ hg clone -q -u . a a6
197 $ cd a6
205 $ cd a6
198
206
199 $ hg rebase -s 5 -d 1
207 $ hg rebase -s 5 -d 1
208 rebasing 5:24b6387c8c8c "F"
209 rebasing 6:eea13746799a "G"
210 rebasing 7:02de42196ebe "H" (tip)
200 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
211 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-backup.hg (glob)
201
212
202 $ hg tglog
213 $ hg tglog
203 @ 7: 'H'
214 @ 7: 'H'
204 |
215 |
205 | o 6: 'G'
216 | o 6: 'G'
206 |/|
217 |/|
207 o | 5: 'F'
218 o | 5: 'F'
208 | |
219 | |
209 | o 4: 'E'
220 | o 4: 'E'
210 | |
221 | |
211 | | o 3: 'D'
222 | | o 3: 'D'
212 | | |
223 | | |
213 +---o 2: 'C'
224 +---o 2: 'C'
214 | |
225 | |
215 o | 1: 'B'
226 o | 1: 'B'
216 |/
227 |/
217 o 0: 'A'
228 o 0: 'A'
218
229
219 $ cd ..
230 $ cd ..
220
231
221
232
222 These will fail (using --source):
233 These will fail (using --source):
223
234
224 G onto F - rebase onto an ancestor:
235 G onto F - rebase onto an ancestor:
225
236
226 $ hg clone -q -u . a a7
237 $ hg clone -q -u . a a7
227 $ cd a7
238 $ cd a7
228
239
229 $ hg rebase -s 6 -d 5
240 $ hg rebase -s 6 -d 5
230 nothing to rebase
241 nothing to rebase
231 [1]
242 [1]
232
243
233 F onto G - rebase onto a descendant:
244 F onto G - rebase onto a descendant:
234
245
235 $ hg rebase -s 5 -d 6
246 $ hg rebase -s 5 -d 6
236 abort: source is ancestor of destination
247 abort: source is ancestor of destination
237 [255]
248 [255]
238
249
239 G onto B - merge revision with both parents not in ancestors of target:
250 G onto B - merge revision with both parents not in ancestors of target:
240
251
241 $ hg rebase -s 6 -d 1
252 $ hg rebase -s 6 -d 1
253 rebasing 6:eea13746799a "G"
242 abort: cannot use revision 6 as base, result would have 3 parents
254 abort: cannot use revision 6 as base, result would have 3 parents
243 [255]
255 [255]
244
256
245
257
246 These will abort gracefully (using --base):
258 These will abort gracefully (using --base):
247
259
248 G onto G - rebase onto same changeset:
260 G onto G - rebase onto same changeset:
249
261
250 $ hg rebase -b 6 -d 6
262 $ hg rebase -b 6 -d 6
251 nothing to rebase - eea13746799a is both "base" and destination
263 nothing to rebase - eea13746799a is both "base" and destination
252 [1]
264 [1]
253
265
254 G onto F - rebase onto an ancestor:
266 G onto F - rebase onto an ancestor:
255
267
256 $ hg rebase -b 6 -d 5
268 $ hg rebase -b 6 -d 5
257 nothing to rebase
269 nothing to rebase
258 [1]
270 [1]
259
271
260 F onto G - rebase onto a descendant:
272 F onto G - rebase onto a descendant:
261
273
262 $ hg rebase -b 5 -d 6
274 $ hg rebase -b 5 -d 6
263 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
275 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
264 [1]
276 [1]
265
277
266 C onto A - rebase onto an ancestor:
278 C onto A - rebase onto an ancestor:
267
279
268 $ hg rebase -d 0 -s 2
280 $ hg rebase -d 0 -s 2
281 rebasing 2:5fddd98957c8 "C"
282 rebasing 3:32af7686d403 "D"
269 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
283 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
270 $ hg tglog
284 $ hg tglog
271 o 7: 'D'
285 o 7: 'D'
272 |
286 |
273 o 6: 'C'
287 o 6: 'C'
274 |
288 |
275 | @ 5: 'H'
289 | @ 5: 'H'
276 | |
290 | |
277 | | o 4: 'G'
291 | | o 4: 'G'
278 | |/|
292 | |/|
279 | o | 3: 'F'
293 | o | 3: 'F'
280 |/ /
294 |/ /
281 | o 2: 'E'
295 | o 2: 'E'
282 |/
296 |/
283 | o 1: 'B'
297 | o 1: 'B'
284 |/
298 |/
285 o 0: 'A'
299 o 0: 'A'
286
300
287
301
288 Check rebasing public changeset
302 Check rebasing public changeset
289
303
290 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
304 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
291 $ hg rebase -d 0 -b 6
305 $ hg rebase -d 0 -b 6
292 nothing to rebase
306 nothing to rebase
293 [1]
307 [1]
294 $ hg rebase -d 5 -b 6
308 $ hg rebase -d 5 -b 6
295 abort: can't rebase immutable changeset e1c4361dd923
309 abort: can't rebase immutable changeset e1c4361dd923
296 (see hg help phases for details)
310 (see hg help phases for details)
297 [255]
311 [255]
298
312
299 $ hg rebase -d 5 -b 6 --keep
313 $ hg rebase -d 5 -b 6 --keep
314 rebasing 6:e1c4361dd923 "C"
315 rebasing 7:c9659aac0000 "D" (tip)
300
316
301 Check rebasing mutable changeset
317 Check rebasing mutable changeset
302 Source phase greater or equal to destination phase: new changeset get the phase of source:
318 Source phase greater or equal to destination phase: new changeset get the phase of source:
303 $ hg id -n
319 $ hg id -n
304 5
320 5
305 $ hg rebase -s9 -d0
321 $ hg rebase -s9 -d0
322 rebasing 9:2b23e52411f4 "D" (tip)
306 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg (glob)
323 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg (glob)
307 $ hg id -n # check we updated back to parent
324 $ hg id -n # check we updated back to parent
308 5
325 5
309 $ hg log --template "{phase}\n" -r 9
326 $ hg log --template "{phase}\n" -r 9
310 draft
327 draft
311 $ hg rebase -s9 -d1
328 $ hg rebase -s9 -d1
329 rebasing 9:2cb10d0cfc6c "D" (tip)
312 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg (glob)
330 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg (glob)
313 $ hg log --template "{phase}\n" -r 9
331 $ hg log --template "{phase}\n" -r 9
314 draft
332 draft
315 $ hg phase --force --secret 9
333 $ hg phase --force --secret 9
316 $ hg rebase -s9 -d0
334 $ hg rebase -s9 -d0
335 rebasing 9:c5b12b67163a "D" (tip)
317 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-backup.hg (glob)
336 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-backup.hg (glob)
318 $ hg log --template "{phase}\n" -r 9
337 $ hg log --template "{phase}\n" -r 9
319 secret
338 secret
320 $ hg rebase -s9 -d1
339 $ hg rebase -s9 -d1
340 rebasing 9:2a0524f868ac "D" (tip)
321 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg (glob)
341 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg (glob)
322 $ hg log --template "{phase}\n" -r 9
342 $ hg log --template "{phase}\n" -r 9
323 secret
343 secret
324 Source phase lower than destination phase: new changeset get the phase of destination:
344 Source phase lower than destination phase: new changeset get the phase of destination:
325 $ hg rebase -s8 -d9
345 $ hg rebase -s8 -d9
346 rebasing 8:6d4f22462821 "C"
326 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-backup.hg (glob)
347 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-backup.hg (glob)
327 $ hg log --template "{phase}\n" -r 'rev(9)'
348 $ hg log --template "{phase}\n" -r 'rev(9)'
328 secret
349 secret
329
350
330 $ cd ..
351 $ cd ..
331
352
332 Test for revset
353 Test for revset
333
354
334 We need a bit different graph
355 We need a bit different graph
335 All destination are B
356 All destination are B
336
357
337 $ hg init ah
358 $ hg init ah
338 $ cd ah
359 $ cd ah
339 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
360 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
340 adding changesets
361 adding changesets
341 adding manifests
362 adding manifests
342 adding file changes
363 adding file changes
343 added 9 changesets with 9 changes to 9 files (+2 heads)
364 added 9 changesets with 9 changes to 9 files (+2 heads)
344 (run 'hg heads' to see heads, 'hg merge' to merge)
365 (run 'hg heads' to see heads, 'hg merge' to merge)
345 $ hg tglog
366 $ hg tglog
346 o 8: 'I'
367 o 8: 'I'
347 |
368 |
348 o 7: 'H'
369 o 7: 'H'
349 |
370 |
350 o 6: 'G'
371 o 6: 'G'
351 |
372 |
352 | o 5: 'F'
373 | o 5: 'F'
353 | |
374 | |
354 | o 4: 'E'
375 | o 4: 'E'
355 |/
376 |/
356 o 3: 'D'
377 o 3: 'D'
357 |
378 |
358 o 2: 'C'
379 o 2: 'C'
359 |
380 |
360 | o 1: 'B'
381 | o 1: 'B'
361 |/
382 |/
362 o 0: 'A'
383 o 0: 'A'
363
384
364 $ cd ..
385 $ cd ..
365
386
366
387
367 Simple case with keep:
388 Simple case with keep:
368
389
369 Source on have two descendant heads but ask for one
390 Source on have two descendant heads but ask for one
370
391
371 $ hg clone -q -u . ah ah1
392 $ hg clone -q -u . ah ah1
372 $ cd ah1
393 $ cd ah1
373 $ hg rebase -r '2::8' -d 1
394 $ hg rebase -r '2::8' -d 1
374 abort: can't remove original changesets with unrebased descendants
395 abort: can't remove original changesets with unrebased descendants
375 (use --keep to keep original changesets)
396 (use --keep to keep original changesets)
376 [255]
397 [255]
377 $ hg rebase -r '2::8' -d 1 --keep
398 $ hg rebase -r '2::8' -d 1 --keep
399 rebasing 2:c9e50f6cdc55 "C"
400 rebasing 3:ffd453c31098 "D"
401 rebasing 6:3d8a618087a7 "G"
402 rebasing 7:72434a4e60b0 "H"
403 rebasing 8:479ddb54a924 "I" (tip)
378 $ hg tglog
404 $ hg tglog
379 o 13: 'I'
405 o 13: 'I'
380 |
406 |
381 o 12: 'H'
407 o 12: 'H'
382 |
408 |
383 o 11: 'G'
409 o 11: 'G'
384 |
410 |
385 o 10: 'D'
411 o 10: 'D'
386 |
412 |
387 o 9: 'C'
413 o 9: 'C'
388 |
414 |
389 | o 8: 'I'
415 | o 8: 'I'
390 | |
416 | |
391 | o 7: 'H'
417 | o 7: 'H'
392 | |
418 | |
393 | o 6: 'G'
419 | o 6: 'G'
394 | |
420 | |
395 | | o 5: 'F'
421 | | o 5: 'F'
396 | | |
422 | | |
397 | | o 4: 'E'
423 | | o 4: 'E'
398 | |/
424 | |/
399 | o 3: 'D'
425 | o 3: 'D'
400 | |
426 | |
401 | o 2: 'C'
427 | o 2: 'C'
402 | |
428 | |
403 o | 1: 'B'
429 o | 1: 'B'
404 |/
430 |/
405 o 0: 'A'
431 o 0: 'A'
406
432
407
433
408 $ cd ..
434 $ cd ..
409
435
410 Base on have one descendant heads we ask for but common ancestor have two
436 Base on have one descendant heads we ask for but common ancestor have two
411
437
412 $ hg clone -q -u . ah ah2
438 $ hg clone -q -u . ah ah2
413 $ cd ah2
439 $ cd ah2
414 $ hg rebase -r '3::8' -d 1
440 $ hg rebase -r '3::8' -d 1
415 abort: can't remove original changesets with unrebased descendants
441 abort: can't remove original changesets with unrebased descendants
416 (use --keep to keep original changesets)
442 (use --keep to keep original changesets)
417 [255]
443 [255]
418 $ hg rebase -r '3::8' -d 1 --keep
444 $ hg rebase -r '3::8' -d 1 --keep
445 rebasing 3:ffd453c31098 "D"
446 rebasing 6:3d8a618087a7 "G"
447 rebasing 7:72434a4e60b0 "H"
448 rebasing 8:479ddb54a924 "I" (tip)
419 $ hg tglog
449 $ hg tglog
420 o 12: 'I'
450 o 12: 'I'
421 |
451 |
422 o 11: 'H'
452 o 11: 'H'
423 |
453 |
424 o 10: 'G'
454 o 10: 'G'
425 |
455 |
426 o 9: 'D'
456 o 9: 'D'
427 |
457 |
428 | o 8: 'I'
458 | o 8: 'I'
429 | |
459 | |
430 | o 7: 'H'
460 | o 7: 'H'
431 | |
461 | |
432 | o 6: 'G'
462 | o 6: 'G'
433 | |
463 | |
434 | | o 5: 'F'
464 | | o 5: 'F'
435 | | |
465 | | |
436 | | o 4: 'E'
466 | | o 4: 'E'
437 | |/
467 | |/
438 | o 3: 'D'
468 | o 3: 'D'
439 | |
469 | |
440 | o 2: 'C'
470 | o 2: 'C'
441 | |
471 | |
442 o | 1: 'B'
472 o | 1: 'B'
443 |/
473 |/
444 o 0: 'A'
474 o 0: 'A'
445
475
446
476
447 $ cd ..
477 $ cd ..
448
478
449 rebase subset
479 rebase subset
450
480
451 $ hg clone -q -u . ah ah3
481 $ hg clone -q -u . ah ah3
452 $ cd ah3
482 $ cd ah3
453 $ hg rebase -r '3::7' -d 1
483 $ hg rebase -r '3::7' -d 1
454 abort: can't remove original changesets with unrebased descendants
484 abort: can't remove original changesets with unrebased descendants
455 (use --keep to keep original changesets)
485 (use --keep to keep original changesets)
456 [255]
486 [255]
457 $ hg rebase -r '3::7' -d 1 --keep
487 $ hg rebase -r '3::7' -d 1 --keep
488 rebasing 3:ffd453c31098 "D"
489 rebasing 6:3d8a618087a7 "G"
490 rebasing 7:72434a4e60b0 "H"
458 $ hg tglog
491 $ hg tglog
459 o 11: 'H'
492 o 11: 'H'
460 |
493 |
461 o 10: 'G'
494 o 10: 'G'
462 |
495 |
463 o 9: 'D'
496 o 9: 'D'
464 |
497 |
465 | o 8: 'I'
498 | o 8: 'I'
466 | |
499 | |
467 | o 7: 'H'
500 | o 7: 'H'
468 | |
501 | |
469 | o 6: 'G'
502 | o 6: 'G'
470 | |
503 | |
471 | | o 5: 'F'
504 | | o 5: 'F'
472 | | |
505 | | |
473 | | o 4: 'E'
506 | | o 4: 'E'
474 | |/
507 | |/
475 | o 3: 'D'
508 | o 3: 'D'
476 | |
509 | |
477 | o 2: 'C'
510 | o 2: 'C'
478 | |
511 | |
479 o | 1: 'B'
512 o | 1: 'B'
480 |/
513 |/
481 o 0: 'A'
514 o 0: 'A'
482
515
483
516
484 $ cd ..
517 $ cd ..
485
518
486 rebase subset with multiple head
519 rebase subset with multiple head
487
520
488 $ hg clone -q -u . ah ah4
521 $ hg clone -q -u . ah ah4
489 $ cd ah4
522 $ cd ah4
490 $ hg rebase -r '3::(7+5)' -d 1
523 $ hg rebase -r '3::(7+5)' -d 1
491 abort: can't remove original changesets with unrebased descendants
524 abort: can't remove original changesets with unrebased descendants
492 (use --keep to keep original changesets)
525 (use --keep to keep original changesets)
493 [255]
526 [255]
494 $ hg rebase -r '3::(7+5)' -d 1 --keep
527 $ hg rebase -r '3::(7+5)' -d 1 --keep
528 rebasing 3:ffd453c31098 "D"
529 rebasing 4:c01897464e7f "E"
530 rebasing 5:41bfcc75ed73 "F"
531 rebasing 6:3d8a618087a7 "G"
532 rebasing 7:72434a4e60b0 "H"
495 $ hg tglog
533 $ hg tglog
496 o 13: 'H'
534 o 13: 'H'
497 |
535 |
498 o 12: 'G'
536 o 12: 'G'
499 |
537 |
500 | o 11: 'F'
538 | o 11: 'F'
501 | |
539 | |
502 | o 10: 'E'
540 | o 10: 'E'
503 |/
541 |/
504 o 9: 'D'
542 o 9: 'D'
505 |
543 |
506 | o 8: 'I'
544 | o 8: 'I'
507 | |
545 | |
508 | o 7: 'H'
546 | o 7: 'H'
509 | |
547 | |
510 | o 6: 'G'
548 | o 6: 'G'
511 | |
549 | |
512 | | o 5: 'F'
550 | | o 5: 'F'
513 | | |
551 | | |
514 | | o 4: 'E'
552 | | o 4: 'E'
515 | |/
553 | |/
516 | o 3: 'D'
554 | o 3: 'D'
517 | |
555 | |
518 | o 2: 'C'
556 | o 2: 'C'
519 | |
557 | |
520 o | 1: 'B'
558 o | 1: 'B'
521 |/
559 |/
522 o 0: 'A'
560 o 0: 'A'
523
561
524
562
525 $ cd ..
563 $ cd ..
526
564
527 More advanced tests
565 More advanced tests
528
566
529 rebase on ancestor with revset
567 rebase on ancestor with revset
530
568
531 $ hg clone -q -u . ah ah5
569 $ hg clone -q -u . ah ah5
532 $ cd ah5
570 $ cd ah5
533 $ hg rebase -r '6::' -d 2
571 $ hg rebase -r '6::' -d 2
572 rebasing 6:3d8a618087a7 "G"
573 rebasing 7:72434a4e60b0 "H"
574 rebasing 8:479ddb54a924 "I" (tip)
534 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
575 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
535 $ hg tglog
576 $ hg tglog
536 o 8: 'I'
577 o 8: 'I'
537 |
578 |
538 o 7: 'H'
579 o 7: 'H'
539 |
580 |
540 o 6: 'G'
581 o 6: 'G'
541 |
582 |
542 | o 5: 'F'
583 | o 5: 'F'
543 | |
584 | |
544 | o 4: 'E'
585 | o 4: 'E'
545 | |
586 | |
546 | o 3: 'D'
587 | o 3: 'D'
547 |/
588 |/
548 o 2: 'C'
589 o 2: 'C'
549 |
590 |
550 | o 1: 'B'
591 | o 1: 'B'
551 |/
592 |/
552 o 0: 'A'
593 o 0: 'A'
553
594
554 $ cd ..
595 $ cd ..
555
596
556
597
557 rebase with multiple root.
598 rebase with multiple root.
558 We rebase E and G on B
599 We rebase E and G on B
559 We would expect heads are I, F if it was supported
600 We would expect heads are I, F if it was supported
560
601
561 $ hg clone -q -u . ah ah6
602 $ hg clone -q -u . ah ah6
562 $ cd ah6
603 $ cd ah6
563 $ hg rebase -r '(4+6)::' -d 1
604 $ hg rebase -r '(4+6)::' -d 1
605 rebasing 4:c01897464e7f "E"
606 rebasing 5:41bfcc75ed73 "F"
607 rebasing 6:3d8a618087a7 "G"
608 rebasing 7:72434a4e60b0 "H"
609 rebasing 8:479ddb54a924 "I" (tip)
564 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
610 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
565 $ hg tglog
611 $ hg tglog
566 o 8: 'I'
612 o 8: 'I'
567 |
613 |
568 o 7: 'H'
614 o 7: 'H'
569 |
615 |
570 o 6: 'G'
616 o 6: 'G'
571 |
617 |
572 | o 5: 'F'
618 | o 5: 'F'
573 | |
619 | |
574 | o 4: 'E'
620 | o 4: 'E'
575 |/
621 |/
576 | o 3: 'D'
622 | o 3: 'D'
577 | |
623 | |
578 | o 2: 'C'
624 | o 2: 'C'
579 | |
625 | |
580 o | 1: 'B'
626 o | 1: 'B'
581 |/
627 |/
582 o 0: 'A'
628 o 0: 'A'
583
629
584 $ cd ..
630 $ cd ..
585
631
586 More complex rebase with multiple roots
632 More complex rebase with multiple roots
587 each root have a different common ancestor with the destination and this is a detach
633 each root have a different common ancestor with the destination and this is a detach
588
634
589 (setup)
635 (setup)
590
636
591 $ hg clone -q -u . a a8
637 $ hg clone -q -u . a a8
592 $ cd a8
638 $ cd a8
593 $ echo I > I
639 $ echo I > I
594 $ hg add I
640 $ hg add I
595 $ hg commit -m I
641 $ hg commit -m I
596 $ hg up 4
642 $ hg up 4
597 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
643 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
598 $ echo I > J
644 $ echo I > J
599 $ hg add J
645 $ hg add J
600 $ hg commit -m J
646 $ hg commit -m J
601 created new head
647 created new head
602 $ echo I > K
648 $ echo I > K
603 $ hg add K
649 $ hg add K
604 $ hg commit -m K
650 $ hg commit -m K
605 $ hg tglog
651 $ hg tglog
606 @ 10: 'K'
652 @ 10: 'K'
607 |
653 |
608 o 9: 'J'
654 o 9: 'J'
609 |
655 |
610 | o 8: 'I'
656 | o 8: 'I'
611 | |
657 | |
612 | o 7: 'H'
658 | o 7: 'H'
613 | |
659 | |
614 +---o 6: 'G'
660 +---o 6: 'G'
615 | |/
661 | |/
616 | o 5: 'F'
662 | o 5: 'F'
617 | |
663 | |
618 o | 4: 'E'
664 o | 4: 'E'
619 |/
665 |/
620 | o 3: 'D'
666 | o 3: 'D'
621 | |
667 | |
622 | o 2: 'C'
668 | o 2: 'C'
623 | |
669 | |
624 | o 1: 'B'
670 | o 1: 'B'
625 |/
671 |/
626 o 0: 'A'
672 o 0: 'A'
627
673
628 (actual test)
674 (actual test)
629
675
630 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
676 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
677 rebasing 8:e7ec4e813ba6 "I"
678 rebasing 10:23a4ace37988 "K" (tip)
631 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-backup.hg (glob)
679 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-backup.hg (glob)
632 $ hg log --rev 'children(desc(G))'
680 $ hg log --rev 'children(desc(G))'
633 changeset: 9:adb617877056
681 changeset: 9:adb617877056
634 parent: 6:eea13746799a
682 parent: 6:eea13746799a
635 user: test
683 user: test
636 date: Thu Jan 01 00:00:00 1970 +0000
684 date: Thu Jan 01 00:00:00 1970 +0000
637 summary: I
685 summary: I
638
686
639 changeset: 10:882431a34a0e
687 changeset: 10:882431a34a0e
640 tag: tip
688 tag: tip
641 parent: 6:eea13746799a
689 parent: 6:eea13746799a
642 user: test
690 user: test
643 date: Thu Jan 01 00:00:00 1970 +0000
691 date: Thu Jan 01 00:00:00 1970 +0000
644 summary: K
692 summary: K
645
693
646 $ hg tglog
694 $ hg tglog
647 @ 10: 'K'
695 @ 10: 'K'
648 |
696 |
649 | o 9: 'I'
697 | o 9: 'I'
650 |/
698 |/
651 | o 8: 'J'
699 | o 8: 'J'
652 | |
700 | |
653 | | o 7: 'H'
701 | | o 7: 'H'
654 | | |
702 | | |
655 o---+ 6: 'G'
703 o---+ 6: 'G'
656 |/ /
704 |/ /
657 | o 5: 'F'
705 | o 5: 'F'
658 | |
706 | |
659 o | 4: 'E'
707 o | 4: 'E'
660 |/
708 |/
661 | o 3: 'D'
709 | o 3: 'D'
662 | |
710 | |
663 | o 2: 'C'
711 | o 2: 'C'
664 | |
712 | |
665 | o 1: 'B'
713 | o 1: 'B'
666 |/
714 |/
667 o 0: 'A'
715 o 0: 'A'
668
716
669
717
670 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
718 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
671
719
672 $ cd ..
720 $ cd ..
673 $ hg init cwd-vanish
721 $ hg init cwd-vanish
674 $ cd cwd-vanish
722 $ cd cwd-vanish
675 $ touch initial-file
723 $ touch initial-file
676 $ hg add initial-file
724 $ hg add initial-file
677 $ hg commit -m 'initial commit'
725 $ hg commit -m 'initial commit'
678 $ touch dest-file
726 $ touch dest-file
679 $ hg add dest-file
727 $ hg add dest-file
680 $ hg commit -m 'dest commit'
728 $ hg commit -m 'dest commit'
681 $ hg up 0
729 $ hg up 0
682 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
730 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
683 $ touch other-file
731 $ touch other-file
684 $ hg add other-file
732 $ hg add other-file
685 $ hg commit -m 'first source commit'
733 $ hg commit -m 'first source commit'
686 created new head
734 created new head
687 $ mkdir subdir
735 $ mkdir subdir
688 $ cd subdir
736 $ cd subdir
689 $ touch subfile
737 $ touch subfile
690 $ hg add subfile
738 $ hg add subfile
691 $ hg commit -m 'second source with subdir'
739 $ hg commit -m 'second source with subdir'
692 $ hg rebase -b . -d 1 --traceback
740 $ hg rebase -b . -d 1 --traceback
741 rebasing 2:779a07b1b7a0 "first source commit"
742 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
693 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-backup.hg (glob)
743 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-backup.hg (glob)
@@ -1,734 +1,747 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > mq =
3 > mq =
4 > shelve =
4 > shelve =
5 > [defaults]
5 > [defaults]
6 > diff = --nodates --git
6 > diff = --nodates --git
7 > qnew = --date '0 0'
7 > qnew = --date '0 0'
8 > EOF
8 > EOF
9
9
10 $ hg init repo
10 $ hg init repo
11 $ cd repo
11 $ cd repo
12 $ mkdir a b
12 $ mkdir a b
13 $ echo a > a/a
13 $ echo a > a/a
14 $ echo b > b/b
14 $ echo b > b/b
15 $ echo c > c
15 $ echo c > c
16 $ echo d > d
16 $ echo d > d
17 $ echo x > x
17 $ echo x > x
18 $ hg addremove -q
18 $ hg addremove -q
19
19
20 shelving in an empty repo should be possible
20 shelving in an empty repo should be possible
21 (this tests also that editor is not invoked, if '--edit' is not
21 (this tests also that editor is not invoked, if '--edit' is not
22 specified)
22 specified)
23
23
24 $ HGEDITOR=cat hg shelve
24 $ HGEDITOR=cat hg shelve
25 shelved as default
25 shelved as default
26 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
27
27
28 $ hg unshelve
28 $ hg unshelve
29 unshelving change 'default'
29 unshelving change 'default'
30
30
31 $ hg commit -q -m 'initial commit'
31 $ hg commit -q -m 'initial commit'
32
32
33 $ hg shelve
33 $ hg shelve
34 nothing changed
34 nothing changed
35 [1]
35 [1]
36
36
37 create an mq patch - shelving should work fine with a patch applied
37 create an mq patch - shelving should work fine with a patch applied
38
38
39 $ echo n > n
39 $ echo n > n
40 $ hg add n
40 $ hg add n
41 $ hg commit n -m second
41 $ hg commit n -m second
42 $ hg qnew second.patch
42 $ hg qnew second.patch
43
43
44 shelve a change that we will delete later
44 shelve a change that we will delete later
45
45
46 $ echo a >> a/a
46 $ echo a >> a/a
47 $ hg shelve
47 $ hg shelve
48 shelved as default
48 shelved as default
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50
50
51 set up some more complex changes to shelve
51 set up some more complex changes to shelve
52
52
53 $ echo a >> a/a
53 $ echo a >> a/a
54 $ hg mv b b.rename
54 $ hg mv b b.rename
55 moving b/b to b.rename/b (glob)
55 moving b/b to b.rename/b (glob)
56 $ hg cp c c.copy
56 $ hg cp c c.copy
57 $ hg status -C
57 $ hg status -C
58 M a/a
58 M a/a
59 A b.rename/b
59 A b.rename/b
60 b/b
60 b/b
61 A c.copy
61 A c.copy
62 c
62 c
63 R b/b
63 R b/b
64
64
65 prevent some foot-shooting
65 prevent some foot-shooting
66
66
67 $ hg shelve -n foo/bar
67 $ hg shelve -n foo/bar
68 abort: shelved change names may not contain slashes
68 abort: shelved change names may not contain slashes
69 [255]
69 [255]
70 $ hg shelve -n .baz
70 $ hg shelve -n .baz
71 abort: shelved change names may not start with '.'
71 abort: shelved change names may not start with '.'
72 [255]
72 [255]
73
73
74 the common case - no options or filenames
74 the common case - no options or filenames
75
75
76 $ hg shelve
76 $ hg shelve
77 shelved as default-01
77 shelved as default-01
78 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
78 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
79 $ hg status -C
79 $ hg status -C
80
80
81 ensure that our shelved changes exist
81 ensure that our shelved changes exist
82
82
83 $ hg shelve -l
83 $ hg shelve -l
84 default-01 (*) changes to '[mq]: second.patch' (glob)
84 default-01 (*) changes to '[mq]: second.patch' (glob)
85 default (*) changes to '[mq]: second.patch' (glob)
85 default (*) changes to '[mq]: second.patch' (glob)
86
86
87 $ hg shelve -l -p default
87 $ hg shelve -l -p default
88 default (*) changes to '[mq]: second.patch' (glob)
88 default (*) changes to '[mq]: second.patch' (glob)
89
89
90 diff --git a/a/a b/a/a
90 diff --git a/a/a b/a/a
91 --- a/a/a
91 --- a/a/a
92 +++ b/a/a
92 +++ b/a/a
93 @@ -1,1 +1,2 @@
93 @@ -1,1 +1,2 @@
94 a
94 a
95 +a
95 +a
96
96
97 $ hg shelve --list --addremove
97 $ hg shelve --list --addremove
98 abort: options '--list' and '--addremove' may not be used together
98 abort: options '--list' and '--addremove' may not be used together
99 [255]
99 [255]
100
100
101 delete our older shelved change
101 delete our older shelved change
102
102
103 $ hg shelve -d default
103 $ hg shelve -d default
104 $ hg qfinish -a -q
104 $ hg qfinish -a -q
105
105
106 local edits should not prevent a shelved change from applying
106 local edits should not prevent a shelved change from applying
107
107
108 $ printf "z\na\n" > a/a
108 $ printf "z\na\n" > a/a
109 $ hg unshelve --keep
109 $ hg unshelve --keep
110 unshelving change 'default-01'
110 unshelving change 'default-01'
111 temporarily committing pending changes (restore with 'hg unshelve --abort')
111 temporarily committing pending changes (restore with 'hg unshelve --abort')
112 rebasing shelved changes
112 rebasing shelved changes
113 rebasing 4:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
113 merging a/a
114 merging a/a
114
115
115 $ hg revert --all -q
116 $ hg revert --all -q
116 $ rm a/a.orig b.rename/b c.copy
117 $ rm a/a.orig b.rename/b c.copy
117
118
118 apply it and make sure our state is as expected
119 apply it and make sure our state is as expected
119
120
120 $ hg unshelve
121 $ hg unshelve
121 unshelving change 'default-01'
122 unshelving change 'default-01'
122 $ hg status -C
123 $ hg status -C
123 M a/a
124 M a/a
124 A b.rename/b
125 A b.rename/b
125 b/b
126 b/b
126 A c.copy
127 A c.copy
127 c
128 c
128 R b/b
129 R b/b
129 $ hg shelve -l
130 $ hg shelve -l
130
131
131 $ hg unshelve
132 $ hg unshelve
132 abort: no shelved changes to apply!
133 abort: no shelved changes to apply!
133 [255]
134 [255]
134 $ hg unshelve foo
135 $ hg unshelve foo
135 abort: shelved change 'foo' not found
136 abort: shelved change 'foo' not found
136 [255]
137 [255]
137
138
138 named shelves, specific filenames, and "commit messages" should all work
139 named shelves, specific filenames, and "commit messages" should all work
139 (this tests also that editor is invoked, if '--edit' is specified)
140 (this tests also that editor is invoked, if '--edit' is specified)
140
141
141 $ hg status -C
142 $ hg status -C
142 M a/a
143 M a/a
143 A b.rename/b
144 A b.rename/b
144 b/b
145 b/b
145 A c.copy
146 A c.copy
146 c
147 c
147 R b/b
148 R b/b
148 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
149 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
149 wat
150 wat
150
151
151
152
152 HG: Enter commit message. Lines beginning with 'HG:' are removed.
153 HG: Enter commit message. Lines beginning with 'HG:' are removed.
153 HG: Leave message empty to abort commit.
154 HG: Leave message empty to abort commit.
154 HG: --
155 HG: --
155 HG: user: shelve@localhost
156 HG: user: shelve@localhost
156 HG: branch 'default'
157 HG: branch 'default'
157 HG: changed a/a
158 HG: changed a/a
158
159
159 expect "a" to no longer be present, but status otherwise unchanged
160 expect "a" to no longer be present, but status otherwise unchanged
160
161
161 $ hg status -C
162 $ hg status -C
162 A b.rename/b
163 A b.rename/b
163 b/b
164 b/b
164 A c.copy
165 A c.copy
165 c
166 c
166 R b/b
167 R b/b
167 $ hg shelve -l --stat
168 $ hg shelve -l --stat
168 wibble (*) wat (glob)
169 wibble (*) wat (glob)
169 a/a | 1 +
170 a/a | 1 +
170 1 files changed, 1 insertions(+), 0 deletions(-)
171 1 files changed, 1 insertions(+), 0 deletions(-)
171
172
172 and now "a/a" should reappear
173 and now "a/a" should reappear
173
174
174 $ cd a
175 $ cd a
175 $ hg unshelve -q wibble
176 $ hg unshelve -q wibble
176 $ cd ..
177 $ cd ..
177 $ hg status -C
178 $ hg status -C
178 M a/a
179 M a/a
179 A b.rename/b
180 A b.rename/b
180 b/b
181 b/b
181 A c.copy
182 A c.copy
182 c
183 c
183 R b/b
184 R b/b
184
185
185 cause unshelving to result in a merge with 'a' conflicting
186 cause unshelving to result in a merge with 'a' conflicting
186
187
187 $ hg shelve -q
188 $ hg shelve -q
188 $ echo c>>a/a
189 $ echo c>>a/a
189 $ hg commit -m second
190 $ hg commit -m second
190 $ hg tip --template '{files}\n'
191 $ hg tip --template '{files}\n'
191 a/a
192 a/a
192
193
193 add an unrelated change that should be preserved
194 add an unrelated change that should be preserved
194
195
195 $ mkdir foo
196 $ mkdir foo
196 $ echo foo > foo/foo
197 $ echo foo > foo/foo
197 $ hg add foo/foo
198 $ hg add foo/foo
198
199
199 force a conflicted merge to occur
200 force a conflicted merge to occur
200
201
201 $ hg unshelve
202 $ hg unshelve
202 unshelving change 'default'
203 unshelving change 'default'
203 temporarily committing pending changes (restore with 'hg unshelve --abort')
204 temporarily committing pending changes (restore with 'hg unshelve --abort')
204 rebasing shelved changes
205 rebasing shelved changes
206 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
205 merging a/a
207 merging a/a
206 warning: conflicts during merge.
208 warning: conflicts during merge.
207 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
209 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
208 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
210 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
209 [1]
211 [1]
210
212
211 ensure that we have a merge with unresolved conflicts
213 ensure that we have a merge with unresolved conflicts
212
214
213 $ hg heads -q --template '{rev}\n'
215 $ hg heads -q --template '{rev}\n'
214 5
216 5
215 4
217 4
216 $ hg parents -q --template '{rev}\n'
218 $ hg parents -q --template '{rev}\n'
217 4
219 4
218 5
220 5
219 $ hg status
221 $ hg status
220 M a/a
222 M a/a
221 M b.rename/b
223 M b.rename/b
222 M c.copy
224 M c.copy
223 R b/b
225 R b/b
224 ? a/a.orig
226 ? a/a.orig
225 $ hg diff
227 $ hg diff
226 diff --git a/a/a b/a/a
228 diff --git a/a/a b/a/a
227 --- a/a/a
229 --- a/a/a
228 +++ b/a/a
230 +++ b/a/a
229 @@ -1,2 +1,6 @@
231 @@ -1,2 +1,6 @@
230 a
232 a
231 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
233 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
232 c
234 c
233 +=======
235 +=======
234 +a
236 +a
235 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
237 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
236 diff --git a/b/b b/b.rename/b
238 diff --git a/b/b b/b.rename/b
237 rename from b/b
239 rename from b/b
238 rename to b.rename/b
240 rename to b.rename/b
239 diff --git a/b/b b/b/b
241 diff --git a/b/b b/b/b
240 deleted file mode 100644
242 deleted file mode 100644
241 --- a/b/b
243 --- a/b/b
242 +++ /dev/null
244 +++ /dev/null
243 @@ -1,1 +0,0 @@
245 @@ -1,1 +0,0 @@
244 -b
246 -b
245 diff --git a/c b/c.copy
247 diff --git a/c b/c.copy
246 copy from c
248 copy from c
247 copy to c.copy
249 copy to c.copy
248 $ hg resolve -l
250 $ hg resolve -l
249 U a/a
251 U a/a
250
252
251 $ hg shelve
253 $ hg shelve
252 abort: unshelve already in progress
254 abort: unshelve already in progress
253 (use 'hg unshelve --continue' or 'hg unshelve --abort')
255 (use 'hg unshelve --continue' or 'hg unshelve --abort')
254 [255]
256 [255]
255
257
256 abort the unshelve and be happy
258 abort the unshelve and be happy
257
259
258 $ hg status
260 $ hg status
259 M a/a
261 M a/a
260 M b.rename/b
262 M b.rename/b
261 M c.copy
263 M c.copy
262 R b/b
264 R b/b
263 ? a/a.orig
265 ? a/a.orig
264 $ hg unshelve -a
266 $ hg unshelve -a
265 rebase aborted
267 rebase aborted
266 unshelve of 'default' aborted
268 unshelve of 'default' aborted
267 $ hg heads -q
269 $ hg heads -q
268 3:2e69b451d1ea
270 3:2e69b451d1ea
269 $ hg parents
271 $ hg parents
270 changeset: 3:2e69b451d1ea
272 changeset: 3:2e69b451d1ea
271 tag: tip
273 tag: tip
272 user: test
274 user: test
273 date: Thu Jan 01 00:00:00 1970 +0000
275 date: Thu Jan 01 00:00:00 1970 +0000
274 summary: second
276 summary: second
275
277
276 $ hg resolve -l
278 $ hg resolve -l
277 $ hg status
279 $ hg status
278 A foo/foo
280 A foo/foo
279 ? a/a.orig
281 ? a/a.orig
280
282
281 try to continue with no unshelve underway
283 try to continue with no unshelve underway
282
284
283 $ hg unshelve -c
285 $ hg unshelve -c
284 abort: no unshelve operation underway
286 abort: no unshelve operation underway
285 [255]
287 [255]
286 $ hg status
288 $ hg status
287 A foo/foo
289 A foo/foo
288 ? a/a.orig
290 ? a/a.orig
289
291
290 redo the unshelve to get a conflict
292 redo the unshelve to get a conflict
291
293
292 $ hg unshelve -q
294 $ hg unshelve -q
293 warning: conflicts during merge.
295 warning: conflicts during merge.
294 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
296 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
295 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
297 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
296 [1]
298 [1]
297
299
298 attempt to continue
300 attempt to continue
299
301
300 $ hg unshelve -c
302 $ hg unshelve -c
301 abort: unresolved conflicts, can't continue
303 abort: unresolved conflicts, can't continue
302 (see 'hg resolve', then 'hg unshelve --continue')
304 (see 'hg resolve', then 'hg unshelve --continue')
303 [255]
305 [255]
304
306
305 $ hg revert -r . a/a
307 $ hg revert -r . a/a
306 $ hg resolve -m a/a
308 $ hg resolve -m a/a
307 (no more unresolved files)
309 (no more unresolved files)
308
310
309 $ hg commit -m 'commit while unshelve in progress'
311 $ hg commit -m 'commit while unshelve in progress'
310 abort: unshelve already in progress
312 abort: unshelve already in progress
311 (use 'hg unshelve --continue' or 'hg unshelve --abort')
313 (use 'hg unshelve --continue' or 'hg unshelve --abort')
312 [255]
314 [255]
313
315
314 $ hg unshelve -c
316 $ hg unshelve -c
317 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
315 unshelve of 'default' complete
318 unshelve of 'default' complete
316
319
317 ensure the repo is as we hope
320 ensure the repo is as we hope
318
321
319 $ hg parents
322 $ hg parents
320 changeset: 3:2e69b451d1ea
323 changeset: 3:2e69b451d1ea
321 tag: tip
324 tag: tip
322 user: test
325 user: test
323 date: Thu Jan 01 00:00:00 1970 +0000
326 date: Thu Jan 01 00:00:00 1970 +0000
324 summary: second
327 summary: second
325
328
326 $ hg heads -q
329 $ hg heads -q
327 3:2e69b451d1ea
330 3:2e69b451d1ea
328
331
329 $ hg status -C
332 $ hg status -C
330 A b.rename/b
333 A b.rename/b
331 b/b
334 b/b
332 A c.copy
335 A c.copy
333 c
336 c
334 A foo/foo
337 A foo/foo
335 R b/b
338 R b/b
336 ? a/a.orig
339 ? a/a.orig
337
340
338 there should be no shelves left
341 there should be no shelves left
339
342
340 $ hg shelve -l
343 $ hg shelve -l
341
344
342 #if execbit
345 #if execbit
343
346
344 ensure that metadata-only changes are shelved
347 ensure that metadata-only changes are shelved
345
348
346 $ chmod +x a/a
349 $ chmod +x a/a
347 $ hg shelve -q -n execbit a/a
350 $ hg shelve -q -n execbit a/a
348 $ hg status a/a
351 $ hg status a/a
349 $ hg unshelve -q execbit
352 $ hg unshelve -q execbit
350 $ hg status a/a
353 $ hg status a/a
351 M a/a
354 M a/a
352 $ hg revert a/a
355 $ hg revert a/a
353
356
354 #endif
357 #endif
355
358
356 #if symlink
359 #if symlink
357
360
358 $ rm a/a
361 $ rm a/a
359 $ ln -s foo a/a
362 $ ln -s foo a/a
360 $ hg shelve -q -n symlink a/a
363 $ hg shelve -q -n symlink a/a
361 $ hg status a/a
364 $ hg status a/a
362 $ hg unshelve -q symlink
365 $ hg unshelve -q symlink
363 $ hg status a/a
366 $ hg status a/a
364 M a/a
367 M a/a
365 $ hg revert a/a
368 $ hg revert a/a
366
369
367 #endif
370 #endif
368
371
369 set up another conflict between a commit and a shelved change
372 set up another conflict between a commit and a shelved change
370
373
371 $ hg revert -q -C -a
374 $ hg revert -q -C -a
372 $ rm a/a.orig b.rename/b c.copy
375 $ rm a/a.orig b.rename/b c.copy
373 $ echo a >> a/a
376 $ echo a >> a/a
374 $ hg shelve -q
377 $ hg shelve -q
375 $ echo x >> a/a
378 $ echo x >> a/a
376 $ hg ci -m 'create conflict'
379 $ hg ci -m 'create conflict'
377 $ hg add foo/foo
380 $ hg add foo/foo
378
381
379 if we resolve a conflict while unshelving, the unshelve should succeed
382 if we resolve a conflict while unshelving, the unshelve should succeed
380
383
381 $ HGMERGE=true hg unshelve
384 $ HGMERGE=true hg unshelve
382 unshelving change 'default'
385 unshelving change 'default'
383 temporarily committing pending changes (restore with 'hg unshelve --abort')
386 temporarily committing pending changes (restore with 'hg unshelve --abort')
384 rebasing shelved changes
387 rebasing shelved changes
388 rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
385 merging a/a
389 merging a/a
386 $ hg parents -q
390 $ hg parents -q
387 4:33f7f61e6c5e
391 4:33f7f61e6c5e
388 $ hg shelve -l
392 $ hg shelve -l
389 $ hg status
393 $ hg status
390 A foo/foo
394 A foo/foo
391 $ cat a/a
395 $ cat a/a
392 a
396 a
393 c
397 c
394 x
398 x
395
399
396 test keep and cleanup
400 test keep and cleanup
397
401
398 $ hg shelve
402 $ hg shelve
399 shelved as default
403 shelved as default
400 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
404 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
401 $ hg shelve --list
405 $ hg shelve --list
402 default (*) changes to 'create conflict' (glob)
406 default (*) changes to 'create conflict' (glob)
403 $ hg unshelve --keep
407 $ hg unshelve --keep
404 unshelving change 'default'
408 unshelving change 'default'
405 $ hg shelve --list
409 $ hg shelve --list
406 default (*) changes to 'create conflict' (glob)
410 default (*) changes to 'create conflict' (glob)
407 $ hg shelve --cleanup
411 $ hg shelve --cleanup
408 $ hg shelve --list
412 $ hg shelve --list
409
413
410 $ hg shelve --cleanup --delete
414 $ hg shelve --cleanup --delete
411 abort: options '--cleanup' and '--delete' may not be used together
415 abort: options '--cleanup' and '--delete' may not be used together
412 [255]
416 [255]
413 $ hg shelve --cleanup --patch
417 $ hg shelve --cleanup --patch
414 abort: options '--cleanup' and '--patch' may not be used together
418 abort: options '--cleanup' and '--patch' may not be used together
415 [255]
419 [255]
416 $ hg shelve --cleanup --message MESSAGE
420 $ hg shelve --cleanup --message MESSAGE
417 abort: options '--cleanup' and '--message' may not be used together
421 abort: options '--cleanup' and '--message' may not be used together
418 [255]
422 [255]
419
423
420 test bookmarks
424 test bookmarks
421
425
422 $ hg bookmark test
426 $ hg bookmark test
423 $ hg bookmark
427 $ hg bookmark
424 * test 4:33f7f61e6c5e
428 * test 4:33f7f61e6c5e
425 $ hg shelve
429 $ hg shelve
426 shelved as test
430 shelved as test
427 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
431 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
428 $ hg bookmark
432 $ hg bookmark
429 * test 4:33f7f61e6c5e
433 * test 4:33f7f61e6c5e
430 $ hg unshelve
434 $ hg unshelve
431 unshelving change 'test'
435 unshelving change 'test'
432 $ hg bookmark
436 $ hg bookmark
433 * test 4:33f7f61e6c5e
437 * test 4:33f7f61e6c5e
434
438
435 shelve should still work even if mq is disabled
439 shelve should still work even if mq is disabled
436
440
437 $ hg --config extensions.mq=! shelve
441 $ hg --config extensions.mq=! shelve
438 shelved as test
442 shelved as test
439 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
443 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
440 $ hg --config extensions.mq=! shelve --list
444 $ hg --config extensions.mq=! shelve --list
441 test (*) changes to 'create conflict' (glob)
445 test (*) changes to 'create conflict' (glob)
442 $ hg --config extensions.mq=! unshelve
446 $ hg --config extensions.mq=! unshelve
443 unshelving change 'test'
447 unshelving change 'test'
444
448
445 shelve should leave dirstate clean (issue4055)
449 shelve should leave dirstate clean (issue4055)
446
450
447 $ cd ..
451 $ cd ..
448 $ hg init shelverebase
452 $ hg init shelverebase
449 $ cd shelverebase
453 $ cd shelverebase
450 $ printf 'x\ny\n' > x
454 $ printf 'x\ny\n' > x
451 $ echo z > z
455 $ echo z > z
452 $ hg commit -Aqm xy
456 $ hg commit -Aqm xy
453 $ echo z >> x
457 $ echo z >> x
454 $ hg commit -Aqm z
458 $ hg commit -Aqm z
455 $ hg up 0
459 $ hg up 0
456 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 $ printf 'a\nx\ny\nz\n' > x
461 $ printf 'a\nx\ny\nz\n' > x
458 $ hg commit -Aqm xyz
462 $ hg commit -Aqm xyz
459 $ echo c >> z
463 $ echo c >> z
460 $ hg shelve
464 $ hg shelve
461 shelved as default
465 shelved as default
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 $ hg rebase -d 1 --config extensions.rebase=
467 $ hg rebase -d 1 --config extensions.rebase=
468 rebasing 2:323bfa07f744 "xyz" (tip)
464 merging x
469 merging x
465 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-backup.hg (glob)
470 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-backup.hg (glob)
466 $ hg unshelve
471 $ hg unshelve
467 unshelving change 'default'
472 unshelving change 'default'
468 rebasing shelved changes
473 rebasing shelved changes
474 rebasing 4:b8fefe789ed0 "changes to 'xyz'" (tip)
469 $ hg status
475 $ hg status
470 M z
476 M z
471
477
472 $ cd ..
478 $ cd ..
473
479
474 shelve should only unshelve pending changes (issue4068)
480 shelve should only unshelve pending changes (issue4068)
475
481
476 $ hg init onlypendingchanges
482 $ hg init onlypendingchanges
477 $ cd onlypendingchanges
483 $ cd onlypendingchanges
478 $ touch a
484 $ touch a
479 $ hg ci -Aqm a
485 $ hg ci -Aqm a
480 $ touch b
486 $ touch b
481 $ hg ci -Aqm b
487 $ hg ci -Aqm b
482 $ hg up -q 0
488 $ hg up -q 0
483 $ touch c
489 $ touch c
484 $ hg ci -Aqm c
490 $ hg ci -Aqm c
485
491
486 $ touch d
492 $ touch d
487 $ hg add d
493 $ hg add d
488 $ hg shelve
494 $ hg shelve
489 shelved as default
495 shelved as default
490 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
496 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
491 $ hg up -q 1
497 $ hg up -q 1
492 $ hg unshelve
498 $ hg unshelve
493 unshelving change 'default'
499 unshelving change 'default'
494 rebasing shelved changes
500 rebasing shelved changes
501 rebasing 3:0cae6656c016 "changes to 'c'" (tip)
495 $ hg status
502 $ hg status
496 A d
503 A d
497
504
498 unshelve should work on an ancestor of the original commit
505 unshelve should work on an ancestor of the original commit
499
506
500 $ hg shelve
507 $ hg shelve
501 shelved as default
508 shelved as default
502 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
509 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
503 $ hg up 0
510 $ hg up 0
504 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
511 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
505 $ hg unshelve
512 $ hg unshelve
506 unshelving change 'default'
513 unshelving change 'default'
507 rebasing shelved changes
514 rebasing shelved changes
515 rebasing 3:be58f65f55fb "changes to 'b'" (tip)
508 $ hg status
516 $ hg status
509 A d
517 A d
510
518
511 test bug 4073 we need to enable obsolete markers for it
519 test bug 4073 we need to enable obsolete markers for it
512
520
513 $ cat >> $HGRCPATH << EOF
521 $ cat >> $HGRCPATH << EOF
514 > [experimental]
522 > [experimental]
515 > evolution=createmarkers
523 > evolution=createmarkers
516 > EOF
524 > EOF
517 $ hg shelve
525 $ hg shelve
518 shelved as default
526 shelved as default
519 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
527 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
520 $ hg debugobsolete `hg --debug id -i -r 1`
528 $ hg debugobsolete `hg --debug id -i -r 1`
521 $ hg unshelve
529 $ hg unshelve
522 unshelving change 'default'
530 unshelving change 'default'
523
531
524 unshelve should leave unknown files alone (issue4113)
532 unshelve should leave unknown files alone (issue4113)
525
533
526 $ echo e > e
534 $ echo e > e
527 $ hg shelve
535 $ hg shelve
528 shelved as default
536 shelved as default
529 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
537 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
530 $ hg status
538 $ hg status
531 ? e
539 ? e
532 $ hg unshelve
540 $ hg unshelve
533 unshelving change 'default'
541 unshelving change 'default'
534 $ hg status
542 $ hg status
535 A d
543 A d
536 ? e
544 ? e
537 $ cat e
545 $ cat e
538 e
546 e
539
547
540 unshelve should keep a copy of unknown files
548 unshelve should keep a copy of unknown files
541
549
542 $ hg add e
550 $ hg add e
543 $ hg shelve
551 $ hg shelve
544 shelved as default
552 shelved as default
545 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
553 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
546 $ echo z > e
554 $ echo z > e
547 $ hg unshelve
555 $ hg unshelve
548 unshelving change 'default'
556 unshelving change 'default'
549 $ cat e
557 $ cat e
550 e
558 e
551 $ cat e.orig
559 $ cat e.orig
552 z
560 z
553
561
554
562
555 unshelve and conflicts with tracked and untracked files
563 unshelve and conflicts with tracked and untracked files
556
564
557 preparing:
565 preparing:
558
566
559 $ rm *.orig
567 $ rm *.orig
560 $ hg ci -qm 'commit stuff'
568 $ hg ci -qm 'commit stuff'
561 $ hg phase -p null:
569 $ hg phase -p null:
562
570
563 no other changes - no merge:
571 no other changes - no merge:
564
572
565 $ echo f > f
573 $ echo f > f
566 $ hg add f
574 $ hg add f
567 $ hg shelve
575 $ hg shelve
568 shelved as default
576 shelved as default
569 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
577 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
570 $ echo g > f
578 $ echo g > f
571 $ hg unshelve
579 $ hg unshelve
572 unshelving change 'default'
580 unshelving change 'default'
573 $ hg st
581 $ hg st
574 A f
582 A f
575 ? f.orig
583 ? f.orig
576 $ cat f
584 $ cat f
577 f
585 f
578 $ cat f.orig
586 $ cat f.orig
579 g
587 g
580
588
581 other uncommitted changes - merge:
589 other uncommitted changes - merge:
582
590
583 $ hg st
591 $ hg st
584 A f
592 A f
585 ? f.orig
593 ? f.orig
586 $ hg shelve
594 $ hg shelve
587 shelved as default
595 shelved as default
588 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
596 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
589 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
597 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
590 o 4 changes to 'commit stuff' shelve@localhost
598 o 4 changes to 'commit stuff' shelve@localhost
591 |
599 |
592 $ hg log -G --template '{rev} {desc|firstline} {author}'
600 $ hg log -G --template '{rev} {desc|firstline} {author}'
593 @ 3 commit stuff test
601 @ 3 commit stuff test
594 |
602 |
595 | o 2 c test
603 | o 2 c test
596 |/
604 |/
597 o 0 a test
605 o 0 a test
598
606
599 $ mv f.orig f
607 $ mv f.orig f
600 $ echo 1 > a
608 $ echo 1 > a
601 $ hg unshelve --date '1073741824 0'
609 $ hg unshelve --date '1073741824 0'
602 unshelving change 'default'
610 unshelving change 'default'
603 temporarily committing pending changes (restore with 'hg unshelve --abort')
611 temporarily committing pending changes (restore with 'hg unshelve --abort')
604 rebasing shelved changes
612 rebasing shelved changes
613 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
605 merging f
614 merging f
606 warning: conflicts during merge.
615 warning: conflicts during merge.
607 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
616 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
608 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
617 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
609 [1]
618 [1]
610 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
619 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
611 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
620 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
612 |
621 |
613 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
622 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
614 |/
623 |/
615 o 3 commit stuff test 1970-01-01 00:00 +0000
624 o 3 commit stuff test 1970-01-01 00:00 +0000
616 |
625 |
617 | o 2 c test 1970-01-01 00:00 +0000
626 | o 2 c test 1970-01-01 00:00 +0000
618 |/
627 |/
619 o 0 a test 1970-01-01 00:00 +0000
628 o 0 a test 1970-01-01 00:00 +0000
620
629
621 $ hg st
630 $ hg st
622 M f
631 M f
623 ? f.orig
632 ? f.orig
624 $ cat f
633 $ cat f
625 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
634 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
626 g
635 g
627 =======
636 =======
628 f
637 f
629 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
638 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
630 $ cat f.orig
639 $ cat f.orig
631 g
640 g
632 $ hg unshelve --abort
641 $ hg unshelve --abort
633 rebase aborted
642 rebase aborted
634 unshelve of 'default' aborted
643 unshelve of 'default' aborted
635 $ hg st
644 $ hg st
636 M a
645 M a
637 ? f.orig
646 ? f.orig
638 $ cat f.orig
647 $ cat f.orig
639 g
648 g
640 $ hg unshelve
649 $ hg unshelve
641 unshelving change 'default'
650 unshelving change 'default'
642 temporarily committing pending changes (restore with 'hg unshelve --abort')
651 temporarily committing pending changes (restore with 'hg unshelve --abort')
643 rebasing shelved changes
652 rebasing shelved changes
653 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
644 $ hg st
654 $ hg st
645 M a
655 M a
646 A f
656 A f
647 ? f.orig
657 ? f.orig
648
658
649 other committed changes - merge:
659 other committed changes - merge:
650
660
651 $ hg shelve f
661 $ hg shelve f
652 shelved as default
662 shelved as default
653 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
663 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
654 $ hg ci a -m 'intermediate other change'
664 $ hg ci a -m 'intermediate other change'
655 $ mv f.orig f
665 $ mv f.orig f
656 $ hg unshelve
666 $ hg unshelve
657 unshelving change 'default'
667 unshelving change 'default'
658 rebasing shelved changes
668 rebasing shelved changes
669 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
659 merging f
670 merging f
660 warning: conflicts during merge.
671 warning: conflicts during merge.
661 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
672 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
662 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
673 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
663 [1]
674 [1]
664 $ hg st
675 $ hg st
665 M f
676 M f
666 ? f.orig
677 ? f.orig
667 $ cat f
678 $ cat f
668 <<<<<<< dest: * - test: intermediate other change (glob)
679 <<<<<<< dest: * - test: intermediate other change (glob)
669 g
680 g
670 =======
681 =======
671 f
682 f
672 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
683 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
673 $ cat f.orig
684 $ cat f.orig
674 g
685 g
675 $ hg unshelve --abort
686 $ hg unshelve --abort
676 rebase aborted
687 rebase aborted
677 unshelve of 'default' aborted
688 unshelve of 'default' aborted
678 $ hg st
689 $ hg st
679 ? f.orig
690 ? f.orig
680 $ cat f.orig
691 $ cat f.orig
681 g
692 g
682 $ hg shelve --delete default
693 $ hg shelve --delete default
683
694
684 Recreate some conflict again
695 Recreate some conflict again
685
696
686 $ cd ../repo
697 $ cd ../repo
687 $ hg up -C -r 3
698 $ hg up -C -r 3
688 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
699 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
689 (leaving bookmark test)
700 (leaving bookmark test)
690 $ echo y >> a/a
701 $ echo y >> a/a
691 $ hg shelve
702 $ hg shelve
692 shelved as default
703 shelved as default
693 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
704 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 $ hg up test
705 $ hg up test
695 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
706 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
696 (activating bookmark test)
707 (activating bookmark test)
697 $ hg unshelve
708 $ hg unshelve
698 unshelving change 'default'
709 unshelving change 'default'
699 rebasing shelved changes
710 rebasing shelved changes
711 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
700 merging a/a
712 merging a/a
701 warning: conflicts during merge.
713 warning: conflicts during merge.
702 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
714 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
703 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
715 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
704 [1]
716 [1]
705
717
706 Test that resolving all conflicts in one direction (so that the rebase
718 Test that resolving all conflicts in one direction (so that the rebase
707 is a no-op), works (issue4398)
719 is a no-op), works (issue4398)
708
720
709 $ hg revert -a -r .
721 $ hg revert -a -r .
710 reverting a/a (glob)
722 reverting a/a (glob)
711 $ hg resolve -m a/a
723 $ hg resolve -m a/a
712 (no more unresolved files)
724 (no more unresolved files)
713 $ hg unshelve -c
725 $ hg unshelve -c
726 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
714 unshelve of 'default' complete
727 unshelve of 'default' complete
715 $ hg diff
728 $ hg diff
716 $ hg status
729 $ hg status
717 ? a/a.orig
730 ? a/a.orig
718 ? foo/foo
731 ? foo/foo
719 $ hg summary
732 $ hg summary
720 parent: 4:33f7f61e6c5e tip
733 parent: 4:33f7f61e6c5e tip
721 create conflict
734 create conflict
722 branch: default
735 branch: default
723 bookmarks: *test
736 bookmarks: *test
724 commit: 2 unknown (clean)
737 commit: 2 unknown (clean)
725 update: (current)
738 update: (current)
726
739
727 $ hg shelve --delete --stat
740 $ hg shelve --delete --stat
728 abort: options '--delete' and '--stat' may not be used together
741 abort: options '--delete' and '--stat' may not be used together
729 [255]
742 [255]
730 $ hg shelve --delete --name NAME
743 $ hg shelve --delete --name NAME
731 abort: options '--delete' and '--name' may not be used together
744 abort: options '--delete' and '--name' may not be used together
732 [255]
745 [255]
733
746
734 $ cd ..
747 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now