##// END OF EJS Templates
update: show the commit to which we updated in case of multiple heads (BC)...
Pulkit Goyal -
r32698:1b5c61d3 default
parent child Browse files
Show More
@@ -1,405 +1,408
1 # destutil.py - Mercurial utility function for command destination
1 # destutil.py - Mercurial utility function for command destination
2 #
2 #
3 # Copyright Matt Mackall <mpm@selenic.com> and other
3 # Copyright Matt Mackall <mpm@selenic.com> and other
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from . import (
11 from . import (
12 bookmarks,
12 bookmarks,
13 error,
13 error,
14 obsolete,
14 obsolete,
15 scmutil,
15 scmutil,
16 )
16 )
17
17
18 def _destupdateobs(repo, clean):
18 def _destupdateobs(repo, clean):
19 """decide of an update destination from obsolescence markers"""
19 """decide of an update destination from obsolescence markers"""
20 node = None
20 node = None
21 wc = repo[None]
21 wc = repo[None]
22 p1 = wc.p1()
22 p1 = wc.p1()
23 movemark = None
23 movemark = None
24
24
25 if p1.obsolete() and not p1.children():
25 if p1.obsolete() and not p1.children():
26 # allow updating to successors
26 # allow updating to successors
27 successors = obsolete.successorssets(repo, p1.node())
27 successors = obsolete.successorssets(repo, p1.node())
28
28
29 # behavior of certain cases is as follows,
29 # behavior of certain cases is as follows,
30 #
30 #
31 # divergent changesets: update to highest rev, similar to what
31 # divergent changesets: update to highest rev, similar to what
32 # is currently done when there are more than one head
32 # is currently done when there are more than one head
33 # (i.e. 'tip')
33 # (i.e. 'tip')
34 #
34 #
35 # replaced changesets: same as divergent except we know there
35 # replaced changesets: same as divergent except we know there
36 # is no conflict
36 # is no conflict
37 #
37 #
38 # pruned changeset: no update is done; though, we could
38 # pruned changeset: no update is done; though, we could
39 # consider updating to the first non-obsolete parent,
39 # consider updating to the first non-obsolete parent,
40 # similar to what is current done for 'hg prune'
40 # similar to what is current done for 'hg prune'
41
41
42 if successors:
42 if successors:
43 # flatten the list here handles both divergent (len > 1)
43 # flatten the list here handles both divergent (len > 1)
44 # and the usual case (len = 1)
44 # and the usual case (len = 1)
45 successors = [n for sub in successors for n in sub]
45 successors = [n for sub in successors for n in sub]
46
46
47 # get the max revision for the given successors set,
47 # get the max revision for the given successors set,
48 # i.e. the 'tip' of a set
48 # i.e. the 'tip' of a set
49 node = repo.revs('max(%ln)', successors).first()
49 node = repo.revs('max(%ln)', successors).first()
50 if bookmarks.isactivewdirparent(repo):
50 if bookmarks.isactivewdirparent(repo):
51 movemark = repo['.'].node()
51 movemark = repo['.'].node()
52 return node, movemark, None
52 return node, movemark, None
53
53
54 def _destupdatebook(repo, clean):
54 def _destupdatebook(repo, clean):
55 """decide on an update destination from active bookmark"""
55 """decide on an update destination from active bookmark"""
56 # we also move the active bookmark, if any
56 # we also move the active bookmark, if any
57 activemark = None
57 activemark = None
58 node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
58 node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
59 if node is not None:
59 if node is not None:
60 activemark = node
60 activemark = node
61 return node, movemark, activemark
61 return node, movemark, activemark
62
62
63 def _destupdatebranch(repo, clean):
63 def _destupdatebranch(repo, clean):
64 """decide on an update destination from current branch
64 """decide on an update destination from current branch
65
65
66 This ignores closed branch heads.
66 This ignores closed branch heads.
67 """
67 """
68 wc = repo[None]
68 wc = repo[None]
69 movemark = node = None
69 movemark = node = None
70 currentbranch = wc.branch()
70 currentbranch = wc.branch()
71
71
72 if clean:
72 if clean:
73 currentbranch = repo['.'].branch()
73 currentbranch = repo['.'].branch()
74
74
75 if currentbranch in repo.branchmap():
75 if currentbranch in repo.branchmap():
76 heads = repo.branchheads(currentbranch)
76 heads = repo.branchheads(currentbranch)
77 if heads:
77 if heads:
78 node = repo.revs('max(.::(%ln))', heads).first()
78 node = repo.revs('max(.::(%ln))', heads).first()
79 if bookmarks.isactivewdirparent(repo):
79 if bookmarks.isactivewdirparent(repo):
80 movemark = repo['.'].node()
80 movemark = repo['.'].node()
81 elif currentbranch == 'default' and not wc.p1():
81 elif currentbranch == 'default' and not wc.p1():
82 # "null" parent belongs to "default" branch, but it doesn't exist, so
82 # "null" parent belongs to "default" branch, but it doesn't exist, so
83 # update to the tipmost non-closed branch head
83 # update to the tipmost non-closed branch head
84 node = repo.revs('max(head() and not closed())').first()
84 node = repo.revs('max(head() and not closed())').first()
85 else:
85 else:
86 node = repo['.'].node()
86 node = repo['.'].node()
87 return node, movemark, None
87 return node, movemark, None
88
88
89 def _destupdatebranchfallback(repo, clean):
89 def _destupdatebranchfallback(repo, clean):
90 """decide on an update destination from closed heads in current branch"""
90 """decide on an update destination from closed heads in current branch"""
91 wc = repo[None]
91 wc = repo[None]
92 currentbranch = wc.branch()
92 currentbranch = wc.branch()
93 movemark = None
93 movemark = None
94 if currentbranch in repo.branchmap():
94 if currentbranch in repo.branchmap():
95 # here, all descendant branch heads are closed
95 # here, all descendant branch heads are closed
96 heads = repo.branchheads(currentbranch, closed=True)
96 heads = repo.branchheads(currentbranch, closed=True)
97 assert heads, "any branch has at least one head"
97 assert heads, "any branch has at least one head"
98 node = repo.revs('max(.::(%ln))', heads).first()
98 node = repo.revs('max(.::(%ln))', heads).first()
99 assert node is not None, ("any revision has at least "
99 assert node is not None, ("any revision has at least "
100 "one descendant branch head")
100 "one descendant branch head")
101 if bookmarks.isactivewdirparent(repo):
101 if bookmarks.isactivewdirparent(repo):
102 movemark = repo['.'].node()
102 movemark = repo['.'].node()
103 else:
103 else:
104 # here, no "default" branch, and all branches are closed
104 # here, no "default" branch, and all branches are closed
105 node = repo.lookup('tip')
105 node = repo.lookup('tip')
106 assert node is not None, "'tip' exists even in empty repository"
106 assert node is not None, "'tip' exists even in empty repository"
107 return node, movemark, None
107 return node, movemark, None
108
108
109 # order in which each step should be evaluated
109 # order in which each step should be evaluated
110 # steps are run until one finds a destination
110 # steps are run until one finds a destination
111 destupdatesteps = ['evolution', 'bookmark', 'branch', 'branchfallback']
111 destupdatesteps = ['evolution', 'bookmark', 'branch', 'branchfallback']
112 # mapping to ease extension overriding steps.
112 # mapping to ease extension overriding steps.
113 destupdatestepmap = {'evolution': _destupdateobs,
113 destupdatestepmap = {'evolution': _destupdateobs,
114 'bookmark': _destupdatebook,
114 'bookmark': _destupdatebook,
115 'branch': _destupdatebranch,
115 'branch': _destupdatebranch,
116 'branchfallback': _destupdatebranchfallback,
116 'branchfallback': _destupdatebranchfallback,
117 }
117 }
118
118
119 def destupdate(repo, clean=False):
119 def destupdate(repo, clean=False):
120 """destination for bare update operation
120 """destination for bare update operation
121
121
122 return (rev, movemark, activemark)
122 return (rev, movemark, activemark)
123
123
124 - rev: the revision to update to,
124 - rev: the revision to update to,
125 - movemark: node to move the active bookmark from
125 - movemark: node to move the active bookmark from
126 (cf bookmark.calculate update),
126 (cf bookmark.calculate update),
127 - activemark: a bookmark to activate at the end of the update.
127 - activemark: a bookmark to activate at the end of the update.
128 """
128 """
129 node = movemark = activemark = None
129 node = movemark = activemark = None
130
130
131 for step in destupdatesteps:
131 for step in destupdatesteps:
132 node, movemark, activemark = destupdatestepmap[step](repo, clean)
132 node, movemark, activemark = destupdatestepmap[step](repo, clean)
133 if node is not None:
133 if node is not None:
134 break
134 break
135 rev = repo[node].rev()
135 rev = repo[node].rev()
136
136
137 return rev, movemark, activemark
137 return rev, movemark, activemark
138
138
139 msgdestmerge = {
139 msgdestmerge = {
140 # too many matching divergent bookmark
140 # too many matching divergent bookmark
141 'toomanybookmarks':
141 'toomanybookmarks':
142 {'merge':
142 {'merge':
143 (_("multiple matching bookmarks to merge -"
143 (_("multiple matching bookmarks to merge -"
144 " please merge with an explicit rev or bookmark"),
144 " please merge with an explicit rev or bookmark"),
145 _("run 'hg heads' to see all heads")),
145 _("run 'hg heads' to see all heads")),
146 'rebase':
146 'rebase':
147 (_("multiple matching bookmarks to rebase -"
147 (_("multiple matching bookmarks to rebase -"
148 " please rebase to an explicit rev or bookmark"),
148 " please rebase to an explicit rev or bookmark"),
149 _("run 'hg heads' to see all heads")),
149 _("run 'hg heads' to see all heads")),
150 },
150 },
151 # no other matching divergent bookmark
151 # no other matching divergent bookmark
152 'nootherbookmarks':
152 'nootherbookmarks':
153 {'merge':
153 {'merge':
154 (_("no matching bookmark to merge - "
154 (_("no matching bookmark to merge - "
155 "please merge with an explicit rev or bookmark"),
155 "please merge with an explicit rev or bookmark"),
156 _("run 'hg heads' to see all heads")),
156 _("run 'hg heads' to see all heads")),
157 'rebase':
157 'rebase':
158 (_("no matching bookmark to rebase - "
158 (_("no matching bookmark to rebase - "
159 "please rebase to an explicit rev or bookmark"),
159 "please rebase to an explicit rev or bookmark"),
160 _("run 'hg heads' to see all heads")),
160 _("run 'hg heads' to see all heads")),
161 },
161 },
162 # branch have too many unbookmarked heads, no obvious destination
162 # branch have too many unbookmarked heads, no obvious destination
163 'toomanyheads':
163 'toomanyheads':
164 {'merge':
164 {'merge':
165 (_("branch '%s' has %d heads - please merge with an explicit rev"),
165 (_("branch '%s' has %d heads - please merge with an explicit rev"),
166 _("run 'hg heads .' to see heads")),
166 _("run 'hg heads .' to see heads")),
167 'rebase':
167 'rebase':
168 (_("branch '%s' has %d heads - please rebase to an explicit rev"),
168 (_("branch '%s' has %d heads - please rebase to an explicit rev"),
169 _("run 'hg heads .' to see heads")),
169 _("run 'hg heads .' to see heads")),
170 },
170 },
171 # branch have no other unbookmarked heads
171 # branch have no other unbookmarked heads
172 'bookmarkedheads':
172 'bookmarkedheads':
173 {'merge':
173 {'merge':
174 (_("heads are bookmarked - please merge with an explicit rev"),
174 (_("heads are bookmarked - please merge with an explicit rev"),
175 _("run 'hg heads' to see all heads")),
175 _("run 'hg heads' to see all heads")),
176 'rebase':
176 'rebase':
177 (_("heads are bookmarked - please rebase to an explicit rev"),
177 (_("heads are bookmarked - please rebase to an explicit rev"),
178 _("run 'hg heads' to see all heads")),
178 _("run 'hg heads' to see all heads")),
179 },
179 },
180 # branch have just a single heads, but there is other branches
180 # branch have just a single heads, but there is other branches
181 'nootherbranchheads':
181 'nootherbranchheads':
182 {'merge':
182 {'merge':
183 (_("branch '%s' has one head - please merge with an explicit rev"),
183 (_("branch '%s' has one head - please merge with an explicit rev"),
184 _("run 'hg heads' to see all heads")),
184 _("run 'hg heads' to see all heads")),
185 'rebase':
185 'rebase':
186 (_("branch '%s' has one head - please rebase to an explicit rev"),
186 (_("branch '%s' has one head - please rebase to an explicit rev"),
187 _("run 'hg heads' to see all heads")),
187 _("run 'hg heads' to see all heads")),
188 },
188 },
189 # repository have a single head
189 # repository have a single head
190 'nootherheads':
190 'nootherheads':
191 {'merge':
191 {'merge':
192 (_('nothing to merge'),
192 (_('nothing to merge'),
193 None),
193 None),
194 'rebase':
194 'rebase':
195 (_('nothing to rebase'),
195 (_('nothing to rebase'),
196 None),
196 None),
197 },
197 },
198 # repository have a single head and we are not on it
198 # repository have a single head and we are not on it
199 'nootherheadsbehind':
199 'nootherheadsbehind':
200 {'merge':
200 {'merge':
201 (_('nothing to merge'),
201 (_('nothing to merge'),
202 _("use 'hg update' instead")),
202 _("use 'hg update' instead")),
203 'rebase':
203 'rebase':
204 (_('nothing to rebase'),
204 (_('nothing to rebase'),
205 _("use 'hg update' instead")),
205 _("use 'hg update' instead")),
206 },
206 },
207 # We are not on a head
207 # We are not on a head
208 'notatheads':
208 'notatheads':
209 {'merge':
209 {'merge':
210 (_('working directory not at a head revision'),
210 (_('working directory not at a head revision'),
211 _("use 'hg update' or merge with an explicit revision")),
211 _("use 'hg update' or merge with an explicit revision")),
212 'rebase':
212 'rebase':
213 (_('working directory not at a head revision'),
213 (_('working directory not at a head revision'),
214 _("use 'hg update' or rebase to an explicit revision"))
214 _("use 'hg update' or rebase to an explicit revision"))
215 },
215 },
216 'emptysourceset':
216 'emptysourceset':
217 {'merge':
217 {'merge':
218 (_('source set is empty'),
218 (_('source set is empty'),
219 None),
219 None),
220 'rebase':
220 'rebase':
221 (_('source set is empty'),
221 (_('source set is empty'),
222 None),
222 None),
223 },
223 },
224 'multiplebranchessourceset':
224 'multiplebranchessourceset':
225 {'merge':
225 {'merge':
226 (_('source set is rooted in multiple branches'),
226 (_('source set is rooted in multiple branches'),
227 None),
227 None),
228 'rebase':
228 'rebase':
229 (_('rebaseset is rooted in multiple named branches'),
229 (_('rebaseset is rooted in multiple named branches'),
230 _('specify an explicit destination with --dest')),
230 _('specify an explicit destination with --dest')),
231 },
231 },
232 }
232 }
233
233
234 def _destmergebook(repo, action='merge', sourceset=None, destspace=None):
234 def _destmergebook(repo, action='merge', sourceset=None, destspace=None):
235 """find merge destination in the active bookmark case"""
235 """find merge destination in the active bookmark case"""
236 node = None
236 node = None
237 bmheads = bookmarks.headsforactive(repo)
237 bmheads = bookmarks.headsforactive(repo)
238 curhead = repo[repo._activebookmark].node()
238 curhead = repo[repo._activebookmark].node()
239 if len(bmheads) == 2:
239 if len(bmheads) == 2:
240 if curhead == bmheads[0]:
240 if curhead == bmheads[0]:
241 node = bmheads[1]
241 node = bmheads[1]
242 else:
242 else:
243 node = bmheads[0]
243 node = bmheads[0]
244 elif len(bmheads) > 2:
244 elif len(bmheads) > 2:
245 msg, hint = msgdestmerge['toomanybookmarks'][action]
245 msg, hint = msgdestmerge['toomanybookmarks'][action]
246 raise error.ManyMergeDestAbort(msg, hint=hint)
246 raise error.ManyMergeDestAbort(msg, hint=hint)
247 elif len(bmheads) <= 1:
247 elif len(bmheads) <= 1:
248 msg, hint = msgdestmerge['nootherbookmarks'][action]
248 msg, hint = msgdestmerge['nootherbookmarks'][action]
249 raise error.NoMergeDestAbort(msg, hint=hint)
249 raise error.NoMergeDestAbort(msg, hint=hint)
250 assert node is not None
250 assert node is not None
251 return node
251 return node
252
252
253 def _destmergebranch(repo, action='merge', sourceset=None, onheadcheck=True,
253 def _destmergebranch(repo, action='merge', sourceset=None, onheadcheck=True,
254 destspace=None):
254 destspace=None):
255 """find merge destination based on branch heads"""
255 """find merge destination based on branch heads"""
256 node = None
256 node = None
257
257
258 if sourceset is None:
258 if sourceset is None:
259 sourceset = [repo[repo.dirstate.p1()].rev()]
259 sourceset = [repo[repo.dirstate.p1()].rev()]
260 branch = repo.dirstate.branch()
260 branch = repo.dirstate.branch()
261 elif not sourceset:
261 elif not sourceset:
262 msg, hint = msgdestmerge['emptysourceset'][action]
262 msg, hint = msgdestmerge['emptysourceset'][action]
263 raise error.NoMergeDestAbort(msg, hint=hint)
263 raise error.NoMergeDestAbort(msg, hint=hint)
264 else:
264 else:
265 branch = None
265 branch = None
266 for ctx in repo.set('roots(%ld::%ld)', sourceset, sourceset):
266 for ctx in repo.set('roots(%ld::%ld)', sourceset, sourceset):
267 if branch is not None and ctx.branch() != branch:
267 if branch is not None and ctx.branch() != branch:
268 msg, hint = msgdestmerge['multiplebranchessourceset'][action]
268 msg, hint = msgdestmerge['multiplebranchessourceset'][action]
269 raise error.ManyMergeDestAbort(msg, hint=hint)
269 raise error.ManyMergeDestAbort(msg, hint=hint)
270 branch = ctx.branch()
270 branch = ctx.branch()
271
271
272 bheads = repo.branchheads(branch)
272 bheads = repo.branchheads(branch)
273 onhead = repo.revs('%ld and %ln', sourceset, bheads)
273 onhead = repo.revs('%ld and %ln', sourceset, bheads)
274 if onheadcheck and not onhead:
274 if onheadcheck and not onhead:
275 # Case A: working copy if not on a head. (merge only)
275 # Case A: working copy if not on a head. (merge only)
276 #
276 #
277 # This is probably a user mistake We bailout pointing at 'hg update'
277 # This is probably a user mistake We bailout pointing at 'hg update'
278 if len(repo.heads()) <= 1:
278 if len(repo.heads()) <= 1:
279 msg, hint = msgdestmerge['nootherheadsbehind'][action]
279 msg, hint = msgdestmerge['nootherheadsbehind'][action]
280 else:
280 else:
281 msg, hint = msgdestmerge['notatheads'][action]
281 msg, hint = msgdestmerge['notatheads'][action]
282 raise error.Abort(msg, hint=hint)
282 raise error.Abort(msg, hint=hint)
283 # remove heads descendants of source from the set
283 # remove heads descendants of source from the set
284 bheads = list(repo.revs('%ln - (%ld::)', bheads, sourceset))
284 bheads = list(repo.revs('%ln - (%ld::)', bheads, sourceset))
285 # filters out bookmarked heads
285 # filters out bookmarked heads
286 nbhs = list(repo.revs('%ld - bookmark()', bheads))
286 nbhs = list(repo.revs('%ld - bookmark()', bheads))
287
287
288 if destspace is not None:
288 if destspace is not None:
289 # restrict search space
289 # restrict search space
290 # used in the 'hg pull --rebase' case, see issue 5214.
290 # used in the 'hg pull --rebase' case, see issue 5214.
291 nbhs = list(repo.revs('%ld and %ld', destspace, nbhs))
291 nbhs = list(repo.revs('%ld and %ld', destspace, nbhs))
292
292
293 if len(nbhs) > 1:
293 if len(nbhs) > 1:
294 # Case B: There is more than 1 other anonymous heads
294 # Case B: There is more than 1 other anonymous heads
295 #
295 #
296 # This means that there will be more than 1 candidate. This is
296 # This means that there will be more than 1 candidate. This is
297 # ambiguous. We abort asking the user to pick as explicit destination
297 # ambiguous. We abort asking the user to pick as explicit destination
298 # instead.
298 # instead.
299 msg, hint = msgdestmerge['toomanyheads'][action]
299 msg, hint = msgdestmerge['toomanyheads'][action]
300 msg %= (branch, len(bheads) + 1)
300 msg %= (branch, len(bheads) + 1)
301 raise error.ManyMergeDestAbort(msg, hint=hint)
301 raise error.ManyMergeDestAbort(msg, hint=hint)
302 elif not nbhs:
302 elif not nbhs:
303 # Case B: There is no other anonymous heads
303 # Case B: There is no other anonymous heads
304 #
304 #
305 # This means that there is no natural candidate to merge with.
305 # This means that there is no natural candidate to merge with.
306 # We abort, with various messages for various cases.
306 # We abort, with various messages for various cases.
307 if bheads:
307 if bheads:
308 msg, hint = msgdestmerge['bookmarkedheads'][action]
308 msg, hint = msgdestmerge['bookmarkedheads'][action]
309 elif len(repo.heads()) > 1:
309 elif len(repo.heads()) > 1:
310 msg, hint = msgdestmerge['nootherbranchheads'][action]
310 msg, hint = msgdestmerge['nootherbranchheads'][action]
311 msg %= branch
311 msg %= branch
312 elif not onhead:
312 elif not onhead:
313 # if 'onheadcheck == False' (rebase case),
313 # if 'onheadcheck == False' (rebase case),
314 # this was not caught in Case A.
314 # this was not caught in Case A.
315 msg, hint = msgdestmerge['nootherheadsbehind'][action]
315 msg, hint = msgdestmerge['nootherheadsbehind'][action]
316 else:
316 else:
317 msg, hint = msgdestmerge['nootherheads'][action]
317 msg, hint = msgdestmerge['nootherheads'][action]
318 raise error.NoMergeDestAbort(msg, hint=hint)
318 raise error.NoMergeDestAbort(msg, hint=hint)
319 else:
319 else:
320 node = nbhs[0]
320 node = nbhs[0]
321 assert node is not None
321 assert node is not None
322 return node
322 return node
323
323
324 def destmerge(repo, action='merge', sourceset=None, onheadcheck=True,
324 def destmerge(repo, action='merge', sourceset=None, onheadcheck=True,
325 destspace=None):
325 destspace=None):
326 """return the default destination for a merge
326 """return the default destination for a merge
327
327
328 (or raise exception about why it can't pick one)
328 (or raise exception about why it can't pick one)
329
329
330 :action: the action being performed, controls emitted error message
330 :action: the action being performed, controls emitted error message
331 """
331 """
332 # destspace is here to work around issues with `hg pull --rebase` see
332 # destspace is here to work around issues with `hg pull --rebase` see
333 # issue5214 for details
333 # issue5214 for details
334 if repo._activebookmark:
334 if repo._activebookmark:
335 node = _destmergebook(repo, action=action, sourceset=sourceset,
335 node = _destmergebook(repo, action=action, sourceset=sourceset,
336 destspace=destspace)
336 destspace=destspace)
337 else:
337 else:
338 node = _destmergebranch(repo, action=action, sourceset=sourceset,
338 node = _destmergebranch(repo, action=action, sourceset=sourceset,
339 onheadcheck=onheadcheck, destspace=destspace)
339 onheadcheck=onheadcheck, destspace=destspace)
340 return repo[node].rev()
340 return repo[node].rev()
341
341
342 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())'
342 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())'
343
343
344 def desthistedit(ui, repo):
344 def desthistedit(ui, repo):
345 """Default base revision to edit for `hg histedit`."""
345 """Default base revision to edit for `hg histedit`."""
346 default = ui.config('histedit', 'defaultrev', histeditdefaultrevset)
346 default = ui.config('histedit', 'defaultrev', histeditdefaultrevset)
347 if default:
347 if default:
348 revs = scmutil.revrange(repo, [default])
348 revs = scmutil.revrange(repo, [default])
349 if revs:
349 if revs:
350 # The revset supplied by the user may not be in ascending order nor
350 # The revset supplied by the user may not be in ascending order nor
351 # take the first revision. So do this manually.
351 # take the first revision. So do this manually.
352 revs.sort()
352 revs.sort()
353 return revs.first()
353 return revs.first()
354
354
355 return None
355 return None
356
356
357 def _statusotherbook(ui, repo):
357 def _statusotherbook(ui, repo):
358 bmheads = bookmarks.headsforactive(repo)
358 bmheads = bookmarks.headsforactive(repo)
359 curhead = repo[repo._activebookmark].node()
359 curhead = repo[repo._activebookmark].node()
360 if repo.revs('%n and parents()', curhead):
360 if repo.revs('%n and parents()', curhead):
361 # we are on the active bookmark
361 # we are on the active bookmark
362 bmheads = [b for b in bmheads if curhead != b]
362 bmheads = [b for b in bmheads if curhead != b]
363 if bmheads:
363 if bmheads:
364 msg = _('%i other divergent bookmarks for "%s"\n')
364 msg = _('%i other divergent bookmarks for "%s"\n')
365 ui.status(msg % (len(bmheads), repo._activebookmark))
365 ui.status(msg % (len(bmheads), repo._activebookmark))
366
366
367 def _statusotherbranchheads(ui, repo):
367 def _statusotherbranchheads(ui, repo):
368 currentbranch = repo.dirstate.branch()
368 currentbranch = repo.dirstate.branch()
369 allheads = repo.branchheads(currentbranch, closed=True)
369 allheads = repo.branchheads(currentbranch, closed=True)
370 heads = repo.branchheads(currentbranch)
370 heads = repo.branchheads(currentbranch)
371 if repo.revs('%ln and parents()', allheads):
371 if repo.revs('%ln and parents()', allheads):
372 # we are on a head, even though it might be closed
372 # we are on a head, even though it might be closed
373 #
373 #
374 # on closed otherheads
374 # on closed otherheads
375 # ========= ==========
375 # ========= ==========
376 # o 0 all heads for current branch are closed
376 # o 0 all heads for current branch are closed
377 # N only descendant branch heads are closed
377 # N only descendant branch heads are closed
378 # x 0 there is only one non-closed branch head
378 # x 0 there is only one non-closed branch head
379 # N there are some non-closed branch heads
379 # N there are some non-closed branch heads
380 # ========= ==========
380 # ========= ==========
381 otherheads = repo.revs('%ln - parents()', heads)
381 otherheads = repo.revs('%ln - parents()', heads)
382 if repo['.'].closesbranch():
382 if repo['.'].closesbranch():
383 ui.warn(_('no open descendant heads on branch "%s", '
383 ui.warn(_('no open descendant heads on branch "%s", '
384 'updating to a closed head\n') %
384 'updating to a closed head\n') %
385 (currentbranch))
385 (currentbranch))
386 if otherheads:
386 if otherheads:
387 ui.warn(_("(committing will reopen the head, "
387 ui.warn(_("(committing will reopen the head, "
388 "use 'hg heads .' to see %i other heads)\n") %
388 "use 'hg heads .' to see %i other heads)\n") %
389 (len(otherheads)))
389 (len(otherheads)))
390 else:
390 else:
391 ui.warn(_('(committing will reopen branch "%s")\n') %
391 ui.warn(_('(committing will reopen branch "%s")\n') %
392 (currentbranch))
392 (currentbranch))
393 elif otherheads:
393 elif otherheads:
394 curhead = repo['.']
395 ui.status(_('updated to "%s: %s"\n') % (curhead,
396 curhead.description().split('\n')[0]))
394 ui.status(_('%i other heads for branch "%s"\n') %
397 ui.status(_('%i other heads for branch "%s"\n') %
395 (len(otherheads), currentbranch))
398 (len(otherheads), currentbranch))
396
399
397 def statusotherdests(ui, repo):
400 def statusotherdests(ui, repo):
398 """Print message about other head"""
401 """Print message about other head"""
399 # XXX we should probably include a hint:
402 # XXX we should probably include a hint:
400 # - about what to do
403 # - about what to do
401 # - how to see such heads
404 # - how to see such heads
402 if repo._activebookmark:
405 if repo._activebookmark:
403 _statusotherbook(ui, repo)
406 _statusotherbook(ui, repo)
404 else:
407 else:
405 _statusotherbranchheads(ui, repo)
408 _statusotherbranchheads(ui, repo)
@@ -1,796 +1,797
1 # The tests in test-bisect are done on a linear history. Here the
1 # The tests in test-bisect are done on a linear history. Here the
2 # following repository history is used for testing:
2 # following repository history is used for testing:
3 #
3 #
4 # 17
4 # 17
5 # |
5 # |
6 # 18 16
6 # 18 16
7 # \ /
7 # \ /
8 # 15
8 # 15
9 # / \
9 # / \
10 # / \
10 # / \
11 # 10 13
11 # 10 13
12 # / \ |
12 # / \ |
13 # / \ | 14
13 # / \ | 14
14 # 7 6 9 12 /
14 # 7 6 9 12 /
15 # \ / \ | |/
15 # \ / \ | |/
16 # 4 \ | 11
16 # 4 \ | 11
17 # \ \ | /
17 # \ \ | /
18 # 3 5 | /
18 # 3 5 | /
19 # \ / |/
19 # \ / |/
20 # 2 8
20 # 2 8
21 # \ /
21 # \ /
22 # 1
22 # 1
23 # |
23 # |
24 # 0
24 # 0
25
25
26 init
26 init
27
27
28 $ hg init
28 $ hg init
29
29
30 committing changes
30 committing changes
31
31
32 $ echo > a
32 $ echo > a
33 $ echo '0' >> a
33 $ echo '0' >> a
34 $ hg add a
34 $ hg add a
35 $ hg ci -m "0" -d "0 0"
35 $ hg ci -m "0" -d "0 0"
36 $ echo '1' >> a
36 $ echo '1' >> a
37 $ hg ci -m "1" -d "1 0"
37 $ hg ci -m "1" -d "1 0"
38 $ echo '2' >> a
38 $ echo '2' >> a
39 $ hg ci -m "2" -d "2 0"
39 $ hg ci -m "2" -d "2 0"
40 $ echo '3' >> a
40 $ echo '3' >> a
41 $ hg ci -m "3" -d "3 0"
41 $ hg ci -m "3" -d "3 0"
42 $ echo '4' >> a
42 $ echo '4' >> a
43 $ hg ci -m "4" -d "4 0"
43 $ hg ci -m "4" -d "4 0"
44
44
45 create branch
45 create branch
46
46
47 $ hg up -r 2
47 $ hg up -r 2
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ echo '5' >> b
49 $ echo '5' >> b
50 $ hg add b
50 $ hg add b
51 $ hg ci -m "5" -d "5 0"
51 $ hg ci -m "5" -d "5 0"
52 created new head
52 created new head
53
53
54 merge
54 merge
55
55
56 $ hg merge
56 $ hg merge
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 (branch merge, don't forget to commit)
58 (branch merge, don't forget to commit)
59 $ hg ci -m "merge 4,5" -d "6 0"
59 $ hg ci -m "merge 4,5" -d "6 0"
60
60
61 create branch
61 create branch
62
62
63 $ hg up -r 4
63 $ hg up -r 4
64 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
64 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
65 $ echo '7' > c
65 $ echo '7' > c
66 $ hg add c
66 $ hg add c
67 $ hg ci -m "7" -d "7 0"
67 $ hg ci -m "7" -d "7 0"
68 created new head
68 created new head
69
69
70 create branch
70 create branch
71
71
72 $ hg up -r 1
72 $ hg up -r 1
73 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
73 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
74 $ echo '8' > d
74 $ echo '8' > d
75 $ hg add d
75 $ hg add d
76 $ hg ci -m "8" -d "8 0"
76 $ hg ci -m "8" -d "8 0"
77 created new head
77 created new head
78 $ echo '9' >> d
78 $ echo '9' >> d
79 $ hg ci -m "9" -d "9 0"
79 $ hg ci -m "9" -d "9 0"
80
80
81 merge
81 merge
82
82
83 $ hg merge -r 6
83 $ hg merge -r 6
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 (branch merge, don't forget to commit)
85 (branch merge, don't forget to commit)
86 $ hg ci -m "merge 6,9" -d "10 0"
86 $ hg ci -m "merge 6,9" -d "10 0"
87
87
88 create branch
88 create branch
89
89
90 $ hg up -r 8
90 $ hg up -r 8
91 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
91 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
92 $ echo '11' > e
92 $ echo '11' > e
93 $ hg add e
93 $ hg add e
94 $ hg ci -m "11" -d "11 0"
94 $ hg ci -m "11" -d "11 0"
95 created new head
95 created new head
96 $ echo '12' >> e
96 $ echo '12' >> e
97 $ hg ci -m "12" -d "12 0"
97 $ hg ci -m "12" -d "12 0"
98 $ echo '13' >> e
98 $ echo '13' >> e
99 $ hg ci -m "13" -d "13 0"
99 $ hg ci -m "13" -d "13 0"
100
100
101 create branch
101 create branch
102
102
103 $ hg up -r 11
103 $ hg up -r 11
104 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 $ echo '14' > f
105 $ echo '14' > f
106 $ hg add f
106 $ hg add f
107 $ hg ci -m "14" -d "14 0"
107 $ hg ci -m "14" -d "14 0"
108 created new head
108 created new head
109
109
110 merge
110 merge
111
111
112 $ hg up -r 13 -C
112 $ hg up -r 13 -C
113 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
113 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
114 $ hg merge -r 10
114 $ hg merge -r 10
115 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
116 (branch merge, don't forget to commit)
116 (branch merge, don't forget to commit)
117 $ hg ci -m "merge 10,13" -d "15 0"
117 $ hg ci -m "merge 10,13" -d "15 0"
118 $ echo '16' >> e
118 $ echo '16' >> e
119 $ hg ci -m "16" -d "16 0"
119 $ hg ci -m "16" -d "16 0"
120 $ echo '17' >> e
120 $ echo '17' >> e
121 $ hg ci -m "17" -d "17 0"
121 $ hg ci -m "17" -d "17 0"
122
122
123 create branch
123 create branch
124
124
125 $ hg up -r 15
125 $ hg up -r 15
126 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
127 $ echo '18' >> e
127 $ echo '18' >> e
128 $ hg ci -m "18" -d "18 0"
128 $ hg ci -m "18" -d "18 0"
129 created new head
129 created new head
130
130
131 log
131 log
132
132
133 $ hg log
133 $ hg log
134 changeset: 18:d42e18c7bc9b
134 changeset: 18:d42e18c7bc9b
135 tag: tip
135 tag: tip
136 parent: 15:857b178a7cf3
136 parent: 15:857b178a7cf3
137 user: test
137 user: test
138 date: Thu Jan 01 00:00:18 1970 +0000
138 date: Thu Jan 01 00:00:18 1970 +0000
139 summary: 18
139 summary: 18
140
140
141 changeset: 17:228c06deef46
141 changeset: 17:228c06deef46
142 user: test
142 user: test
143 date: Thu Jan 01 00:00:17 1970 +0000
143 date: Thu Jan 01 00:00:17 1970 +0000
144 summary: 17
144 summary: 17
145
145
146 changeset: 16:609d82a7ebae
146 changeset: 16:609d82a7ebae
147 user: test
147 user: test
148 date: Thu Jan 01 00:00:16 1970 +0000
148 date: Thu Jan 01 00:00:16 1970 +0000
149 summary: 16
149 summary: 16
150
150
151 changeset: 15:857b178a7cf3
151 changeset: 15:857b178a7cf3
152 parent: 13:b0a32c86eb31
152 parent: 13:b0a32c86eb31
153 parent: 10:429fcd26f52d
153 parent: 10:429fcd26f52d
154 user: test
154 user: test
155 date: Thu Jan 01 00:00:15 1970 +0000
155 date: Thu Jan 01 00:00:15 1970 +0000
156 summary: merge 10,13
156 summary: merge 10,13
157
157
158 changeset: 14:faa450606157
158 changeset: 14:faa450606157
159 parent: 11:82ca6f06eccd
159 parent: 11:82ca6f06eccd
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:14 1970 +0000
161 date: Thu Jan 01 00:00:14 1970 +0000
162 summary: 14
162 summary: 14
163
163
164 changeset: 13:b0a32c86eb31
164 changeset: 13:b0a32c86eb31
165 user: test
165 user: test
166 date: Thu Jan 01 00:00:13 1970 +0000
166 date: Thu Jan 01 00:00:13 1970 +0000
167 summary: 13
167 summary: 13
168
168
169 changeset: 12:9f259202bbe7
169 changeset: 12:9f259202bbe7
170 user: test
170 user: test
171 date: Thu Jan 01 00:00:12 1970 +0000
171 date: Thu Jan 01 00:00:12 1970 +0000
172 summary: 12
172 summary: 12
173
173
174 changeset: 11:82ca6f06eccd
174 changeset: 11:82ca6f06eccd
175 parent: 8:dab8161ac8fc
175 parent: 8:dab8161ac8fc
176 user: test
176 user: test
177 date: Thu Jan 01 00:00:11 1970 +0000
177 date: Thu Jan 01 00:00:11 1970 +0000
178 summary: 11
178 summary: 11
179
179
180 changeset: 10:429fcd26f52d
180 changeset: 10:429fcd26f52d
181 parent: 9:3c77083deb4a
181 parent: 9:3c77083deb4a
182 parent: 6:a214d5d3811a
182 parent: 6:a214d5d3811a
183 user: test
183 user: test
184 date: Thu Jan 01 00:00:10 1970 +0000
184 date: Thu Jan 01 00:00:10 1970 +0000
185 summary: merge 6,9
185 summary: merge 6,9
186
186
187 changeset: 9:3c77083deb4a
187 changeset: 9:3c77083deb4a
188 user: test
188 user: test
189 date: Thu Jan 01 00:00:09 1970 +0000
189 date: Thu Jan 01 00:00:09 1970 +0000
190 summary: 9
190 summary: 9
191
191
192 changeset: 8:dab8161ac8fc
192 changeset: 8:dab8161ac8fc
193 parent: 1:4ca5088da217
193 parent: 1:4ca5088da217
194 user: test
194 user: test
195 date: Thu Jan 01 00:00:08 1970 +0000
195 date: Thu Jan 01 00:00:08 1970 +0000
196 summary: 8
196 summary: 8
197
197
198 changeset: 7:50c76098bbf2
198 changeset: 7:50c76098bbf2
199 parent: 4:5c668c22234f
199 parent: 4:5c668c22234f
200 user: test
200 user: test
201 date: Thu Jan 01 00:00:07 1970 +0000
201 date: Thu Jan 01 00:00:07 1970 +0000
202 summary: 7
202 summary: 7
203
203
204 changeset: 6:a214d5d3811a
204 changeset: 6:a214d5d3811a
205 parent: 5:385a529b6670
205 parent: 5:385a529b6670
206 parent: 4:5c668c22234f
206 parent: 4:5c668c22234f
207 user: test
207 user: test
208 date: Thu Jan 01 00:00:06 1970 +0000
208 date: Thu Jan 01 00:00:06 1970 +0000
209 summary: merge 4,5
209 summary: merge 4,5
210
210
211 changeset: 5:385a529b6670
211 changeset: 5:385a529b6670
212 parent: 2:051e12f87bf1
212 parent: 2:051e12f87bf1
213 user: test
213 user: test
214 date: Thu Jan 01 00:00:05 1970 +0000
214 date: Thu Jan 01 00:00:05 1970 +0000
215 summary: 5
215 summary: 5
216
216
217 changeset: 4:5c668c22234f
217 changeset: 4:5c668c22234f
218 user: test
218 user: test
219 date: Thu Jan 01 00:00:04 1970 +0000
219 date: Thu Jan 01 00:00:04 1970 +0000
220 summary: 4
220 summary: 4
221
221
222 changeset: 3:0950834f0a9c
222 changeset: 3:0950834f0a9c
223 user: test
223 user: test
224 date: Thu Jan 01 00:00:03 1970 +0000
224 date: Thu Jan 01 00:00:03 1970 +0000
225 summary: 3
225 summary: 3
226
226
227 changeset: 2:051e12f87bf1
227 changeset: 2:051e12f87bf1
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:02 1970 +0000
229 date: Thu Jan 01 00:00:02 1970 +0000
230 summary: 2
230 summary: 2
231
231
232 changeset: 1:4ca5088da217
232 changeset: 1:4ca5088da217
233 user: test
233 user: test
234 date: Thu Jan 01 00:00:01 1970 +0000
234 date: Thu Jan 01 00:00:01 1970 +0000
235 summary: 1
235 summary: 1
236
236
237 changeset: 0:33b1f9bc8bc5
237 changeset: 0:33b1f9bc8bc5
238 user: test
238 user: test
239 date: Thu Jan 01 00:00:00 1970 +0000
239 date: Thu Jan 01 00:00:00 1970 +0000
240 summary: 0
240 summary: 0
241
241
242
242
243 hg up -C
243 hg up -C
244
244
245 $ hg up -C
245 $ hg up -C
246 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 updated to "d42e18c7bc9b: 18"
247 3 other heads for branch "default"
248 3 other heads for branch "default"
248
249
249 complex bisect test 1 # first bad rev is 9
250 complex bisect test 1 # first bad rev is 9
250
251
251 $ hg bisect -r
252 $ hg bisect -r
252 $ hg bisect -g 0
253 $ hg bisect -g 0
253 $ hg bisect -b 17 # -> update to rev 6
254 $ hg bisect -b 17 # -> update to rev 6
254 Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests)
255 Testing changeset 6:a214d5d3811a (15 changesets remaining, ~3 tests)
255 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
256 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
256 $ hg log -q -r 'bisect(pruned)'
257 $ hg log -q -r 'bisect(pruned)'
257 0:33b1f9bc8bc5
258 0:33b1f9bc8bc5
258 17:228c06deef46
259 17:228c06deef46
259 $ hg log -q -r 'bisect(untested)'
260 $ hg log -q -r 'bisect(untested)'
260 1:4ca5088da217
261 1:4ca5088da217
261 2:051e12f87bf1
262 2:051e12f87bf1
262 3:0950834f0a9c
263 3:0950834f0a9c
263 4:5c668c22234f
264 4:5c668c22234f
264 5:385a529b6670
265 5:385a529b6670
265 6:a214d5d3811a
266 6:a214d5d3811a
266 8:dab8161ac8fc
267 8:dab8161ac8fc
267 9:3c77083deb4a
268 9:3c77083deb4a
268 10:429fcd26f52d
269 10:429fcd26f52d
269 11:82ca6f06eccd
270 11:82ca6f06eccd
270 12:9f259202bbe7
271 12:9f259202bbe7
271 13:b0a32c86eb31
272 13:b0a32c86eb31
272 15:857b178a7cf3
273 15:857b178a7cf3
273 16:609d82a7ebae
274 16:609d82a7ebae
274 $ hg log -q -r 'bisect(ignored)'
275 $ hg log -q -r 'bisect(ignored)'
275 $ hg bisect -g # -> update to rev 13
276 $ hg bisect -g # -> update to rev 13
276 Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests)
277 Testing changeset 13:b0a32c86eb31 (9 changesets remaining, ~3 tests)
277 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
278 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
278 $ hg bisect -s # -> update to rev 10
279 $ hg bisect -s # -> update to rev 10
279 Testing changeset 10:429fcd26f52d (9 changesets remaining, ~3 tests)
280 Testing changeset 10:429fcd26f52d (9 changesets remaining, ~3 tests)
280 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
281 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
281 $ hg bisect -b # -> update to rev 8
282 $ hg bisect -b # -> update to rev 8
282 Testing changeset 8:dab8161ac8fc (3 changesets remaining, ~1 tests)
283 Testing changeset 8:dab8161ac8fc (3 changesets remaining, ~1 tests)
283 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
284 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
284 $ hg bisect -g # -> update to rev 9
285 $ hg bisect -g # -> update to rev 9
285 Testing changeset 9:3c77083deb4a (2 changesets remaining, ~1 tests)
286 Testing changeset 9:3c77083deb4a (2 changesets remaining, ~1 tests)
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 $ hg bisect -b
288 $ hg bisect -b
288 The first bad revision is:
289 The first bad revision is:
289 changeset: 9:3c77083deb4a
290 changeset: 9:3c77083deb4a
290 user: test
291 user: test
291 date: Thu Jan 01 00:00:09 1970 +0000
292 date: Thu Jan 01 00:00:09 1970 +0000
292 summary: 9
293 summary: 9
293
294
294 $ hg log -q -r 'bisect(range)'
295 $ hg log -q -r 'bisect(range)'
295 0:33b1f9bc8bc5
296 0:33b1f9bc8bc5
296 1:4ca5088da217
297 1:4ca5088da217
297 2:051e12f87bf1
298 2:051e12f87bf1
298 3:0950834f0a9c
299 3:0950834f0a9c
299 4:5c668c22234f
300 4:5c668c22234f
300 5:385a529b6670
301 5:385a529b6670
301 6:a214d5d3811a
302 6:a214d5d3811a
302 8:dab8161ac8fc
303 8:dab8161ac8fc
303 9:3c77083deb4a
304 9:3c77083deb4a
304 10:429fcd26f52d
305 10:429fcd26f52d
305 11:82ca6f06eccd
306 11:82ca6f06eccd
306 12:9f259202bbe7
307 12:9f259202bbe7
307 13:b0a32c86eb31
308 13:b0a32c86eb31
308 15:857b178a7cf3
309 15:857b178a7cf3
309 16:609d82a7ebae
310 16:609d82a7ebae
310 17:228c06deef46
311 17:228c06deef46
311 $ hg log -q -r 'bisect(pruned)'
312 $ hg log -q -r 'bisect(pruned)'
312 0:33b1f9bc8bc5
313 0:33b1f9bc8bc5
313 1:4ca5088da217
314 1:4ca5088da217
314 2:051e12f87bf1
315 2:051e12f87bf1
315 3:0950834f0a9c
316 3:0950834f0a9c
316 4:5c668c22234f
317 4:5c668c22234f
317 5:385a529b6670
318 5:385a529b6670
318 6:a214d5d3811a
319 6:a214d5d3811a
319 8:dab8161ac8fc
320 8:dab8161ac8fc
320 9:3c77083deb4a
321 9:3c77083deb4a
321 10:429fcd26f52d
322 10:429fcd26f52d
322 13:b0a32c86eb31
323 13:b0a32c86eb31
323 15:857b178a7cf3
324 15:857b178a7cf3
324 16:609d82a7ebae
325 16:609d82a7ebae
325 17:228c06deef46
326 17:228c06deef46
326 18:d42e18c7bc9b
327 18:d42e18c7bc9b
327 $ hg log -q -r 'bisect(untested)'
328 $ hg log -q -r 'bisect(untested)'
328 11:82ca6f06eccd
329 11:82ca6f06eccd
329 12:9f259202bbe7
330 12:9f259202bbe7
330 $ hg log -q -r 'bisect(goods)'
331 $ hg log -q -r 'bisect(goods)'
331 0:33b1f9bc8bc5
332 0:33b1f9bc8bc5
332 1:4ca5088da217
333 1:4ca5088da217
333 2:051e12f87bf1
334 2:051e12f87bf1
334 3:0950834f0a9c
335 3:0950834f0a9c
335 4:5c668c22234f
336 4:5c668c22234f
336 5:385a529b6670
337 5:385a529b6670
337 6:a214d5d3811a
338 6:a214d5d3811a
338 8:dab8161ac8fc
339 8:dab8161ac8fc
339 $ hg log -q -r 'bisect(bads)'
340 $ hg log -q -r 'bisect(bads)'
340 9:3c77083deb4a
341 9:3c77083deb4a
341 10:429fcd26f52d
342 10:429fcd26f52d
342 15:857b178a7cf3
343 15:857b178a7cf3
343 16:609d82a7ebae
344 16:609d82a7ebae
344 17:228c06deef46
345 17:228c06deef46
345 18:d42e18c7bc9b
346 18:d42e18c7bc9b
346
347
347 complex bisect test 2 # first good rev is 13
348 complex bisect test 2 # first good rev is 13
348
349
349 $ hg bisect -r
350 $ hg bisect -r
350 $ hg bisect -g 18
351 $ hg bisect -g 18
351 $ hg bisect -b 1 # -> update to rev 6
352 $ hg bisect -b 1 # -> update to rev 6
352 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
353 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
353 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
354 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
354 $ hg bisect -s # -> update to rev 10
355 $ hg bisect -s # -> update to rev 10
355 Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests)
356 Testing changeset 10:429fcd26f52d (13 changesets remaining, ~3 tests)
356 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
357 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
357 $ hg log -q -r 'bisect(pruned)'
358 $ hg log -q -r 'bisect(pruned)'
358 0:33b1f9bc8bc5
359 0:33b1f9bc8bc5
359 1:4ca5088da217
360 1:4ca5088da217
360 6:a214d5d3811a
361 6:a214d5d3811a
361 18:d42e18c7bc9b
362 18:d42e18c7bc9b
362 $ hg bisect -b # -> update to rev 12
363 $ hg bisect -b # -> update to rev 12
363 Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests)
364 Testing changeset 12:9f259202bbe7 (5 changesets remaining, ~2 tests)
364 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
365 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
365 $ hg log -q -r 'bisect(pruned)'
366 $ hg log -q -r 'bisect(pruned)'
366 0:33b1f9bc8bc5
367 0:33b1f9bc8bc5
367 1:4ca5088da217
368 1:4ca5088da217
368 2:051e12f87bf1
369 2:051e12f87bf1
369 3:0950834f0a9c
370 3:0950834f0a9c
370 4:5c668c22234f
371 4:5c668c22234f
371 5:385a529b6670
372 5:385a529b6670
372 6:a214d5d3811a
373 6:a214d5d3811a
373 8:dab8161ac8fc
374 8:dab8161ac8fc
374 9:3c77083deb4a
375 9:3c77083deb4a
375 10:429fcd26f52d
376 10:429fcd26f52d
376 18:d42e18c7bc9b
377 18:d42e18c7bc9b
377 $ hg log -q -r 'bisect(untested)'
378 $ hg log -q -r 'bisect(untested)'
378 11:82ca6f06eccd
379 11:82ca6f06eccd
379 12:9f259202bbe7
380 12:9f259202bbe7
380 13:b0a32c86eb31
381 13:b0a32c86eb31
381 15:857b178a7cf3
382 15:857b178a7cf3
382 $ hg bisect -b # -> update to rev 13
383 $ hg bisect -b # -> update to rev 13
383 Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests)
384 Testing changeset 13:b0a32c86eb31 (3 changesets remaining, ~1 tests)
384 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 $ hg bisect -g
386 $ hg bisect -g
386 The first good revision is:
387 The first good revision is:
387 changeset: 13:b0a32c86eb31
388 changeset: 13:b0a32c86eb31
388 user: test
389 user: test
389 date: Thu Jan 01 00:00:13 1970 +0000
390 date: Thu Jan 01 00:00:13 1970 +0000
390 summary: 13
391 summary: 13
391
392
392 $ hg log -q -r 'bisect(range)'
393 $ hg log -q -r 'bisect(range)'
393 1:4ca5088da217
394 1:4ca5088da217
394 2:051e12f87bf1
395 2:051e12f87bf1
395 3:0950834f0a9c
396 3:0950834f0a9c
396 4:5c668c22234f
397 4:5c668c22234f
397 5:385a529b6670
398 5:385a529b6670
398 6:a214d5d3811a
399 6:a214d5d3811a
399 8:dab8161ac8fc
400 8:dab8161ac8fc
400 9:3c77083deb4a
401 9:3c77083deb4a
401 10:429fcd26f52d
402 10:429fcd26f52d
402 11:82ca6f06eccd
403 11:82ca6f06eccd
403 12:9f259202bbe7
404 12:9f259202bbe7
404 13:b0a32c86eb31
405 13:b0a32c86eb31
405 15:857b178a7cf3
406 15:857b178a7cf3
406 18:d42e18c7bc9b
407 18:d42e18c7bc9b
407
408
408 complex bisect test 3
409 complex bisect test 3
409
410
410 first bad rev is 15
411 first bad rev is 15
411 10,9,13 are skipped an might be the first bad revisions as well
412 10,9,13 are skipped an might be the first bad revisions as well
412
413
413 $ hg bisect -r
414 $ hg bisect -r
414 $ hg bisect -g 1
415 $ hg bisect -g 1
415 $ hg bisect -b 16 # -> update to rev 6
416 $ hg bisect -b 16 # -> update to rev 6
416 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
417 Testing changeset 6:a214d5d3811a (13 changesets remaining, ~3 tests)
417 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
418 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
418 $ hg log -q -r 'bisect(pruned)'
419 $ hg log -q -r 'bisect(pruned)'
419 0:33b1f9bc8bc5
420 0:33b1f9bc8bc5
420 1:4ca5088da217
421 1:4ca5088da217
421 16:609d82a7ebae
422 16:609d82a7ebae
422 17:228c06deef46
423 17:228c06deef46
423 $ hg bisect -g # -> update to rev 13
424 $ hg bisect -g # -> update to rev 13
424 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
425 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
425 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
426 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
426 $ hg bisect -s # -> update to rev 10
427 $ hg bisect -s # -> update to rev 10
427 Testing changeset 10:429fcd26f52d (8 changesets remaining, ~3 tests)
428 Testing changeset 10:429fcd26f52d (8 changesets remaining, ~3 tests)
428 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
429 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
429 $ hg bisect -s # -> update to rev 12
430 $ hg bisect -s # -> update to rev 12
430 Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests)
431 Testing changeset 12:9f259202bbe7 (8 changesets remaining, ~3 tests)
431 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
432 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
432 $ hg log -q -r 'bisect(pruned)'
433 $ hg log -q -r 'bisect(pruned)'
433 0:33b1f9bc8bc5
434 0:33b1f9bc8bc5
434 1:4ca5088da217
435 1:4ca5088da217
435 2:051e12f87bf1
436 2:051e12f87bf1
436 3:0950834f0a9c
437 3:0950834f0a9c
437 4:5c668c22234f
438 4:5c668c22234f
438 5:385a529b6670
439 5:385a529b6670
439 6:a214d5d3811a
440 6:a214d5d3811a
440 10:429fcd26f52d
441 10:429fcd26f52d
441 13:b0a32c86eb31
442 13:b0a32c86eb31
442 16:609d82a7ebae
443 16:609d82a7ebae
443 17:228c06deef46
444 17:228c06deef46
444 $ hg bisect -g # -> update to rev 9
445 $ hg bisect -g # -> update to rev 9
445 Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests)
446 Testing changeset 9:3c77083deb4a (5 changesets remaining, ~2 tests)
446 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
447 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
447 $ hg bisect -s # -> update to rev 15
448 $ hg bisect -s # -> update to rev 15
448 Testing changeset 15:857b178a7cf3 (5 changesets remaining, ~2 tests)
449 Testing changeset 15:857b178a7cf3 (5 changesets remaining, ~2 tests)
449 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 $ hg log -q -r 'bisect(ignored)'
451 $ hg log -q -r 'bisect(ignored)'
451 $ hg bisect -b
452 $ hg bisect -b
452 Due to skipped revisions, the first bad revision could be any of:
453 Due to skipped revisions, the first bad revision could be any of:
453 changeset: 9:3c77083deb4a
454 changeset: 9:3c77083deb4a
454 user: test
455 user: test
455 date: Thu Jan 01 00:00:09 1970 +0000
456 date: Thu Jan 01 00:00:09 1970 +0000
456 summary: 9
457 summary: 9
457
458
458 changeset: 10:429fcd26f52d
459 changeset: 10:429fcd26f52d
459 parent: 9:3c77083deb4a
460 parent: 9:3c77083deb4a
460 parent: 6:a214d5d3811a
461 parent: 6:a214d5d3811a
461 user: test
462 user: test
462 date: Thu Jan 01 00:00:10 1970 +0000
463 date: Thu Jan 01 00:00:10 1970 +0000
463 summary: merge 6,9
464 summary: merge 6,9
464
465
465 changeset: 13:b0a32c86eb31
466 changeset: 13:b0a32c86eb31
466 user: test
467 user: test
467 date: Thu Jan 01 00:00:13 1970 +0000
468 date: Thu Jan 01 00:00:13 1970 +0000
468 summary: 13
469 summary: 13
469
470
470 changeset: 15:857b178a7cf3
471 changeset: 15:857b178a7cf3
471 parent: 13:b0a32c86eb31
472 parent: 13:b0a32c86eb31
472 parent: 10:429fcd26f52d
473 parent: 10:429fcd26f52d
473 user: test
474 user: test
474 date: Thu Jan 01 00:00:15 1970 +0000
475 date: Thu Jan 01 00:00:15 1970 +0000
475 summary: merge 10,13
476 summary: merge 10,13
476
477
477 $ hg log -q -r 'bisect(range)'
478 $ hg log -q -r 'bisect(range)'
478 1:4ca5088da217
479 1:4ca5088da217
479 2:051e12f87bf1
480 2:051e12f87bf1
480 3:0950834f0a9c
481 3:0950834f0a9c
481 4:5c668c22234f
482 4:5c668c22234f
482 5:385a529b6670
483 5:385a529b6670
483 6:a214d5d3811a
484 6:a214d5d3811a
484 8:dab8161ac8fc
485 8:dab8161ac8fc
485 9:3c77083deb4a
486 9:3c77083deb4a
486 10:429fcd26f52d
487 10:429fcd26f52d
487 11:82ca6f06eccd
488 11:82ca6f06eccd
488 12:9f259202bbe7
489 12:9f259202bbe7
489 13:b0a32c86eb31
490 13:b0a32c86eb31
490 15:857b178a7cf3
491 15:857b178a7cf3
491 16:609d82a7ebae
492 16:609d82a7ebae
492 $ hg log -q -r 'bisect(ignored)'
493 $ hg log -q -r 'bisect(ignored)'
493
494
494 complex bisect test 4
495 complex bisect test 4
495
496
496 first good revision is 17
497 first good revision is 17
497 15,16 are skipped an might be the first good revisions as well
498 15,16 are skipped an might be the first good revisions as well
498
499
499 $ hg bisect -r
500 $ hg bisect -r
500 $ hg bisect -g 17
501 $ hg bisect -g 17
501 $ hg bisect -b 8 # -> update to rev 10
502 $ hg bisect -b 8 # -> update to rev 10
502 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
503 Testing changeset 13:b0a32c86eb31 (8 changesets remaining, ~3 tests)
503 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
504 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
504 $ hg bisect -b # -> update to rev 13
505 $ hg bisect -b # -> update to rev 13
505 Testing changeset 10:429fcd26f52d (5 changesets remaining, ~2 tests)
506 Testing changeset 10:429fcd26f52d (5 changesets remaining, ~2 tests)
506 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
507 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
507 $ hg bisect -b # -> update to rev 15
508 $ hg bisect -b # -> update to rev 15
508 Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
509 Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
509 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
510 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
510 $ hg log -q -r 'bisect(pruned)'
511 $ hg log -q -r 'bisect(pruned)'
511 0:33b1f9bc8bc5
512 0:33b1f9bc8bc5
512 1:4ca5088da217
513 1:4ca5088da217
513 2:051e12f87bf1
514 2:051e12f87bf1
514 3:0950834f0a9c
515 3:0950834f0a9c
515 4:5c668c22234f
516 4:5c668c22234f
516 5:385a529b6670
517 5:385a529b6670
517 6:a214d5d3811a
518 6:a214d5d3811a
518 8:dab8161ac8fc
519 8:dab8161ac8fc
519 9:3c77083deb4a
520 9:3c77083deb4a
520 10:429fcd26f52d
521 10:429fcd26f52d
521 11:82ca6f06eccd
522 11:82ca6f06eccd
522 12:9f259202bbe7
523 12:9f259202bbe7
523 13:b0a32c86eb31
524 13:b0a32c86eb31
524 17:228c06deef46
525 17:228c06deef46
525 $ hg bisect -s # -> update to rev 16
526 $ hg bisect -s # -> update to rev 16
526 Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests)
527 Testing changeset 16:609d82a7ebae (3 changesets remaining, ~1 tests)
527 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
528 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
528 $ hg log -q -r 'bisect(pruned)'
529 $ hg log -q -r 'bisect(pruned)'
529 0:33b1f9bc8bc5
530 0:33b1f9bc8bc5
530 1:4ca5088da217
531 1:4ca5088da217
531 2:051e12f87bf1
532 2:051e12f87bf1
532 3:0950834f0a9c
533 3:0950834f0a9c
533 4:5c668c22234f
534 4:5c668c22234f
534 5:385a529b6670
535 5:385a529b6670
535 6:a214d5d3811a
536 6:a214d5d3811a
536 8:dab8161ac8fc
537 8:dab8161ac8fc
537 9:3c77083deb4a
538 9:3c77083deb4a
538 10:429fcd26f52d
539 10:429fcd26f52d
539 11:82ca6f06eccd
540 11:82ca6f06eccd
540 12:9f259202bbe7
541 12:9f259202bbe7
541 13:b0a32c86eb31
542 13:b0a32c86eb31
542 15:857b178a7cf3
543 15:857b178a7cf3
543 17:228c06deef46
544 17:228c06deef46
544 $ hg bisect -s
545 $ hg bisect -s
545 Due to skipped revisions, the first good revision could be any of:
546 Due to skipped revisions, the first good revision could be any of:
546 changeset: 15:857b178a7cf3
547 changeset: 15:857b178a7cf3
547 parent: 13:b0a32c86eb31
548 parent: 13:b0a32c86eb31
548 parent: 10:429fcd26f52d
549 parent: 10:429fcd26f52d
549 user: test
550 user: test
550 date: Thu Jan 01 00:00:15 1970 +0000
551 date: Thu Jan 01 00:00:15 1970 +0000
551 summary: merge 10,13
552 summary: merge 10,13
552
553
553 changeset: 16:609d82a7ebae
554 changeset: 16:609d82a7ebae
554 user: test
555 user: test
555 date: Thu Jan 01 00:00:16 1970 +0000
556 date: Thu Jan 01 00:00:16 1970 +0000
556 summary: 16
557 summary: 16
557
558
558 changeset: 17:228c06deef46
559 changeset: 17:228c06deef46
559 user: test
560 user: test
560 date: Thu Jan 01 00:00:17 1970 +0000
561 date: Thu Jan 01 00:00:17 1970 +0000
561 summary: 17
562 summary: 17
562
563
563 $ hg log -q -r 'bisect(range)'
564 $ hg log -q -r 'bisect(range)'
564 8:dab8161ac8fc
565 8:dab8161ac8fc
565 9:3c77083deb4a
566 9:3c77083deb4a
566 10:429fcd26f52d
567 10:429fcd26f52d
567 11:82ca6f06eccd
568 11:82ca6f06eccd
568 12:9f259202bbe7
569 12:9f259202bbe7
569 13:b0a32c86eb31
570 13:b0a32c86eb31
570 15:857b178a7cf3
571 15:857b178a7cf3
571 16:609d82a7ebae
572 16:609d82a7ebae
572 17:228c06deef46
573 17:228c06deef46
573 $ hg log -q -r 'bisect(pruned)'
574 $ hg log -q -r 'bisect(pruned)'
574 0:33b1f9bc8bc5
575 0:33b1f9bc8bc5
575 1:4ca5088da217
576 1:4ca5088da217
576 2:051e12f87bf1
577 2:051e12f87bf1
577 3:0950834f0a9c
578 3:0950834f0a9c
578 4:5c668c22234f
579 4:5c668c22234f
579 5:385a529b6670
580 5:385a529b6670
580 6:a214d5d3811a
581 6:a214d5d3811a
581 8:dab8161ac8fc
582 8:dab8161ac8fc
582 9:3c77083deb4a
583 9:3c77083deb4a
583 10:429fcd26f52d
584 10:429fcd26f52d
584 11:82ca6f06eccd
585 11:82ca6f06eccd
585 12:9f259202bbe7
586 12:9f259202bbe7
586 13:b0a32c86eb31
587 13:b0a32c86eb31
587 15:857b178a7cf3
588 15:857b178a7cf3
588 16:609d82a7ebae
589 16:609d82a7ebae
589 17:228c06deef46
590 17:228c06deef46
590
591
591 test unrelated revs:
592 test unrelated revs:
592
593
593 $ hg bisect --reset
594 $ hg bisect --reset
594 $ hg bisect -b 7
595 $ hg bisect -b 7
595 $ hg bisect -g 14
596 $ hg bisect -g 14
596 abort: starting revisions are not directly related
597 abort: starting revisions are not directly related
597 [255]
598 [255]
598 $ hg log -q -r 'bisect(range)'
599 $ hg log -q -r 'bisect(range)'
599 $ hg log -q -r 'bisect(pruned)'
600 $ hg log -q -r 'bisect(pruned)'
600 0:33b1f9bc8bc5
601 0:33b1f9bc8bc5
601 1:4ca5088da217
602 1:4ca5088da217
602 2:051e12f87bf1
603 2:051e12f87bf1
603 3:0950834f0a9c
604 3:0950834f0a9c
604 4:5c668c22234f
605 4:5c668c22234f
605 7:50c76098bbf2
606 7:50c76098bbf2
606 14:faa450606157
607 14:faa450606157
607 $ hg bisect --reset
608 $ hg bisect --reset
608
609
609 end at merge: 17 bad, 11 good (but 9 is first bad)
610 end at merge: 17 bad, 11 good (but 9 is first bad)
610
611
611 $ hg bisect -r
612 $ hg bisect -r
612 $ hg bisect -b 17
613 $ hg bisect -b 17
613 $ hg bisect -g 11
614 $ hg bisect -g 11
614 Testing changeset 13:b0a32c86eb31 (5 changesets remaining, ~2 tests)
615 Testing changeset 13:b0a32c86eb31 (5 changesets remaining, ~2 tests)
615 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
616 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
616 $ hg log -q -r 'bisect(ignored)'
617 $ hg log -q -r 'bisect(ignored)'
617 2:051e12f87bf1
618 2:051e12f87bf1
618 3:0950834f0a9c
619 3:0950834f0a9c
619 4:5c668c22234f
620 4:5c668c22234f
620 5:385a529b6670
621 5:385a529b6670
621 6:a214d5d3811a
622 6:a214d5d3811a
622 9:3c77083deb4a
623 9:3c77083deb4a
623 10:429fcd26f52d
624 10:429fcd26f52d
624 $ hg bisect -g
625 $ hg bisect -g
625 Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
626 Testing changeset 15:857b178a7cf3 (3 changesets remaining, ~1 tests)
626 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 $ hg bisect -b
628 $ hg bisect -b
628 The first bad revision is:
629 The first bad revision is:
629 changeset: 15:857b178a7cf3
630 changeset: 15:857b178a7cf3
630 parent: 13:b0a32c86eb31
631 parent: 13:b0a32c86eb31
631 parent: 10:429fcd26f52d
632 parent: 10:429fcd26f52d
632 user: test
633 user: test
633 date: Thu Jan 01 00:00:15 1970 +0000
634 date: Thu Jan 01 00:00:15 1970 +0000
634 summary: merge 10,13
635 summary: merge 10,13
635
636
636 Not all ancestors of this changeset have been checked.
637 Not all ancestors of this changeset have been checked.
637 Use bisect --extend to continue the bisection from
638 Use bisect --extend to continue the bisection from
638 the common ancestor, dab8161ac8fc.
639 the common ancestor, dab8161ac8fc.
639 $ hg log -q -r 'bisect(range)'
640 $ hg log -q -r 'bisect(range)'
640 11:82ca6f06eccd
641 11:82ca6f06eccd
641 12:9f259202bbe7
642 12:9f259202bbe7
642 13:b0a32c86eb31
643 13:b0a32c86eb31
643 15:857b178a7cf3
644 15:857b178a7cf3
644 16:609d82a7ebae
645 16:609d82a7ebae
645 17:228c06deef46
646 17:228c06deef46
646 $ hg log -q -r 'bisect(pruned)'
647 $ hg log -q -r 'bisect(pruned)'
647 0:33b1f9bc8bc5
648 0:33b1f9bc8bc5
648 1:4ca5088da217
649 1:4ca5088da217
649 8:dab8161ac8fc
650 8:dab8161ac8fc
650 11:82ca6f06eccd
651 11:82ca6f06eccd
651 12:9f259202bbe7
652 12:9f259202bbe7
652 13:b0a32c86eb31
653 13:b0a32c86eb31
653 15:857b178a7cf3
654 15:857b178a7cf3
654 16:609d82a7ebae
655 16:609d82a7ebae
655 17:228c06deef46
656 17:228c06deef46
656 18:d42e18c7bc9b
657 18:d42e18c7bc9b
657 $ hg log -q -r 'bisect(untested)'
658 $ hg log -q -r 'bisect(untested)'
658 $ hg log -q -r 'bisect(ignored)'
659 $ hg log -q -r 'bisect(ignored)'
659 2:051e12f87bf1
660 2:051e12f87bf1
660 3:0950834f0a9c
661 3:0950834f0a9c
661 4:5c668c22234f
662 4:5c668c22234f
662 5:385a529b6670
663 5:385a529b6670
663 6:a214d5d3811a
664 6:a214d5d3811a
664 9:3c77083deb4a
665 9:3c77083deb4a
665 10:429fcd26f52d
666 10:429fcd26f52d
666 $ hg bisect --extend
667 $ hg bisect --extend
667 Extending search to changeset 8:dab8161ac8fc
668 Extending search to changeset 8:dab8161ac8fc
668 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
669 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
669 $ hg log -q -r 'bisect(untested)'
670 $ hg log -q -r 'bisect(untested)'
670 $ hg log -q -r 'bisect(ignored)'
671 $ hg log -q -r 'bisect(ignored)'
671 2:051e12f87bf1
672 2:051e12f87bf1
672 3:0950834f0a9c
673 3:0950834f0a9c
673 4:5c668c22234f
674 4:5c668c22234f
674 5:385a529b6670
675 5:385a529b6670
675 6:a214d5d3811a
676 6:a214d5d3811a
676 9:3c77083deb4a
677 9:3c77083deb4a
677 10:429fcd26f52d
678 10:429fcd26f52d
678 $ hg bisect -g # dab8161ac8fc
679 $ hg bisect -g # dab8161ac8fc
679 Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests)
680 Testing changeset 9:3c77083deb4a (3 changesets remaining, ~1 tests)
680 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
681 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
681 $ hg log -q -r 'bisect(untested)'
682 $ hg log -q -r 'bisect(untested)'
682 9:3c77083deb4a
683 9:3c77083deb4a
683 10:429fcd26f52d
684 10:429fcd26f52d
684 $ hg log -q -r 'bisect(ignored)'
685 $ hg log -q -r 'bisect(ignored)'
685 2:051e12f87bf1
686 2:051e12f87bf1
686 3:0950834f0a9c
687 3:0950834f0a9c
687 4:5c668c22234f
688 4:5c668c22234f
688 5:385a529b6670
689 5:385a529b6670
689 6:a214d5d3811a
690 6:a214d5d3811a
690 $ hg log -q -r 'bisect(goods)'
691 $ hg log -q -r 'bisect(goods)'
691 0:33b1f9bc8bc5
692 0:33b1f9bc8bc5
692 1:4ca5088da217
693 1:4ca5088da217
693 8:dab8161ac8fc
694 8:dab8161ac8fc
694 11:82ca6f06eccd
695 11:82ca6f06eccd
695 12:9f259202bbe7
696 12:9f259202bbe7
696 13:b0a32c86eb31
697 13:b0a32c86eb31
697 $ hg log -q -r 'bisect(bads)'
698 $ hg log -q -r 'bisect(bads)'
698 15:857b178a7cf3
699 15:857b178a7cf3
699 16:609d82a7ebae
700 16:609d82a7ebae
700 17:228c06deef46
701 17:228c06deef46
701 18:d42e18c7bc9b
702 18:d42e18c7bc9b
702 $ hg bisect -b
703 $ hg bisect -b
703 The first bad revision is:
704 The first bad revision is:
704 changeset: 9:3c77083deb4a
705 changeset: 9:3c77083deb4a
705 user: test
706 user: test
706 date: Thu Jan 01 00:00:09 1970 +0000
707 date: Thu Jan 01 00:00:09 1970 +0000
707 summary: 9
708 summary: 9
708
709
709 $ hg log -q -r 'bisect(range)'
710 $ hg log -q -r 'bisect(range)'
710 8:dab8161ac8fc
711 8:dab8161ac8fc
711 9:3c77083deb4a
712 9:3c77083deb4a
712 10:429fcd26f52d
713 10:429fcd26f52d
713 11:82ca6f06eccd
714 11:82ca6f06eccd
714 12:9f259202bbe7
715 12:9f259202bbe7
715 13:b0a32c86eb31
716 13:b0a32c86eb31
716 15:857b178a7cf3
717 15:857b178a7cf3
717 16:609d82a7ebae
718 16:609d82a7ebae
718 17:228c06deef46
719 17:228c06deef46
719 $ hg log -q -r 'bisect(pruned)'
720 $ hg log -q -r 'bisect(pruned)'
720 0:33b1f9bc8bc5
721 0:33b1f9bc8bc5
721 1:4ca5088da217
722 1:4ca5088da217
722 8:dab8161ac8fc
723 8:dab8161ac8fc
723 9:3c77083deb4a
724 9:3c77083deb4a
724 10:429fcd26f52d
725 10:429fcd26f52d
725 11:82ca6f06eccd
726 11:82ca6f06eccd
726 12:9f259202bbe7
727 12:9f259202bbe7
727 13:b0a32c86eb31
728 13:b0a32c86eb31
728 15:857b178a7cf3
729 15:857b178a7cf3
729 16:609d82a7ebae
730 16:609d82a7ebae
730 17:228c06deef46
731 17:228c06deef46
731 18:d42e18c7bc9b
732 18:d42e18c7bc9b
732 $ hg log -q -r 'bisect(untested)'
733 $ hg log -q -r 'bisect(untested)'
733 $ hg log -q -r 'bisect(ignored)'
734 $ hg log -q -r 'bisect(ignored)'
734 2:051e12f87bf1
735 2:051e12f87bf1
735 3:0950834f0a9c
736 3:0950834f0a9c
736 4:5c668c22234f
737 4:5c668c22234f
737 5:385a529b6670
738 5:385a529b6670
738 6:a214d5d3811a
739 6:a214d5d3811a
739 $ hg log -q -r 'bisect(goods)'
740 $ hg log -q -r 'bisect(goods)'
740 0:33b1f9bc8bc5
741 0:33b1f9bc8bc5
741 1:4ca5088da217
742 1:4ca5088da217
742 8:dab8161ac8fc
743 8:dab8161ac8fc
743 11:82ca6f06eccd
744 11:82ca6f06eccd
744 12:9f259202bbe7
745 12:9f259202bbe7
745 13:b0a32c86eb31
746 13:b0a32c86eb31
746 $ hg log -q -r 'bisect(bads)'
747 $ hg log -q -r 'bisect(bads)'
747 9:3c77083deb4a
748 9:3c77083deb4a
748 10:429fcd26f52d
749 10:429fcd26f52d
749 15:857b178a7cf3
750 15:857b178a7cf3
750 16:609d82a7ebae
751 16:609d82a7ebae
751 17:228c06deef46
752 17:228c06deef46
752 18:d42e18c7bc9b
753 18:d42e18c7bc9b
753
754
754 user adds irrelevant but consistent information (here: -g 2) to bisect state
755 user adds irrelevant but consistent information (here: -g 2) to bisect state
755
756
756 $ hg bisect -r
757 $ hg bisect -r
757 $ hg bisect -b 13
758 $ hg bisect -b 13
758 $ hg bisect -g 8
759 $ hg bisect -g 8
759 Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests)
760 Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests)
760 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 $ hg log -q -r 'bisect(untested)'
762 $ hg log -q -r 'bisect(untested)'
762 11:82ca6f06eccd
763 11:82ca6f06eccd
763 12:9f259202bbe7
764 12:9f259202bbe7
764 $ hg bisect -g 2
765 $ hg bisect -g 2
765 Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests)
766 Testing changeset 11:82ca6f06eccd (3 changesets remaining, ~1 tests)
766 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
767 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
767 $ hg log -q -r 'bisect(untested)'
768 $ hg log -q -r 'bisect(untested)'
768 11:82ca6f06eccd
769 11:82ca6f06eccd
769 12:9f259202bbe7
770 12:9f259202bbe7
770 $ hg bisect -b
771 $ hg bisect -b
771 The first bad revision is:
772 The first bad revision is:
772 changeset: 11:82ca6f06eccd
773 changeset: 11:82ca6f06eccd
773 parent: 8:dab8161ac8fc
774 parent: 8:dab8161ac8fc
774 user: test
775 user: test
775 date: Thu Jan 01 00:00:11 1970 +0000
776 date: Thu Jan 01 00:00:11 1970 +0000
776 summary: 11
777 summary: 11
777
778
778 $ hg log -q -r 'bisect(range)'
779 $ hg log -q -r 'bisect(range)'
779 8:dab8161ac8fc
780 8:dab8161ac8fc
780 11:82ca6f06eccd
781 11:82ca6f06eccd
781 12:9f259202bbe7
782 12:9f259202bbe7
782 13:b0a32c86eb31
783 13:b0a32c86eb31
783 $ hg log -q -r 'bisect(pruned)'
784 $ hg log -q -r 'bisect(pruned)'
784 0:33b1f9bc8bc5
785 0:33b1f9bc8bc5
785 1:4ca5088da217
786 1:4ca5088da217
786 2:051e12f87bf1
787 2:051e12f87bf1
787 8:dab8161ac8fc
788 8:dab8161ac8fc
788 11:82ca6f06eccd
789 11:82ca6f06eccd
789 12:9f259202bbe7
790 12:9f259202bbe7
790 13:b0a32c86eb31
791 13:b0a32c86eb31
791 14:faa450606157
792 14:faa450606157
792 15:857b178a7cf3
793 15:857b178a7cf3
793 16:609d82a7ebae
794 16:609d82a7ebae
794 17:228c06deef46
795 17:228c06deef46
795 18:d42e18c7bc9b
796 18:d42e18c7bc9b
796 $ hg log -q -r 'bisect(untested)'
797 $ hg log -q -r 'bisect(untested)'
@@ -1,223 +1,224
1 setup
1 setup
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [extensions]
3 > [extensions]
4 > blackbox=
4 > blackbox=
5 > mock=$TESTDIR/mockblackbox.py
5 > mock=$TESTDIR/mockblackbox.py
6 > mq=
6 > mq=
7 > [alias]
7 > [alias]
8 > confuse = log --limit 3
8 > confuse = log --limit 3
9 > EOF
9 > EOF
10 $ hg init blackboxtest
10 $ hg init blackboxtest
11 $ cd blackboxtest
11 $ cd blackboxtest
12
12
13 command, exit codes, and duration
13 command, exit codes, and duration
14
14
15 $ echo a > a
15 $ echo a > a
16 $ hg add a
16 $ hg add a
17 $ hg blackbox --config blackbox.dirty=True
17 $ hg blackbox --config blackbox.dirty=True
18 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
18 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
19 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
19 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
20 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
20 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
21
21
22 alias expansion is logged
22 alias expansion is logged
23 $ hg confuse
23 $ hg confuse
24 $ hg blackbox
24 $ hg blackbox
25 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
25 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
26 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
26 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
27 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
27 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox
28 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* exited 0 after * seconds (glob)
28 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* exited 0 after * seconds (glob)
29 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse
29 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse
30 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
30 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
31 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
31 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
32 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
32 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
33
33
34 incoming change tracking
34 incoming change tracking
35
35
36 create two heads to verify that we only see one change in the log later
36 create two heads to verify that we only see one change in the log later
37 $ hg commit -ma
37 $ hg commit -ma
38 $ hg up null
38 $ hg up null
39 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
39 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 $ echo b > b
40 $ echo b > b
41 $ hg commit -Amb
41 $ hg commit -Amb
42 adding b
42 adding b
43 created new head
43 created new head
44
44
45 clone, commit, pull
45 clone, commit, pull
46 $ hg clone . ../blackboxtest2
46 $ hg clone . ../blackboxtest2
47 updating to branch default
47 updating to branch default
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 $ echo c > c
49 $ echo c > c
50 $ hg commit -Amc
50 $ hg commit -Amc
51 adding c
51 adding c
52 $ cd ../blackboxtest2
52 $ cd ../blackboxtest2
53 $ hg pull
53 $ hg pull
54 pulling from $TESTTMP/blackboxtest (glob)
54 pulling from $TESTTMP/blackboxtest (glob)
55 searching for changes
55 searching for changes
56 adding changesets
56 adding changesets
57 adding manifests
57 adding manifests
58 adding file changes
58 adding file changes
59 added 1 changesets with 1 changes to 1 files
59 added 1 changesets with 1 changes to 1 files
60 (run 'hg update' to get a working copy)
60 (run 'hg update' to get a working copy)
61 $ hg blackbox -l 6
61 $ hg blackbox -l 6
62 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull
62 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull
63 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob)
63 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob)
64 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes
64 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes
65 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
65 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
66 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
66 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
67 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
67 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
68
68
69 we must not cause a failure if we cannot write to the log
69 we must not cause a failure if we cannot write to the log
70
70
71 $ hg rollback
71 $ hg rollback
72 repository tip rolled back to revision 1 (undo pull)
72 repository tip rolled back to revision 1 (undo pull)
73
73
74 $ mv .hg/blackbox.log .hg/blackbox.log-
74 $ mv .hg/blackbox.log .hg/blackbox.log-
75 $ mkdir .hg/blackbox.log
75 $ mkdir .hg/blackbox.log
76 $ hg --debug incoming
76 $ hg --debug incoming
77 warning: cannot write to blackbox.log: * (glob)
77 warning: cannot write to blackbox.log: * (glob)
78 comparing with $TESTTMP/blackboxtest (glob)
78 comparing with $TESTTMP/blackboxtest (glob)
79 query 1; heads
79 query 1; heads
80 searching for changes
80 searching for changes
81 all local heads known remotely
81 all local heads known remotely
82 changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51
82 changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51
83 tag: tip
83 tag: tip
84 phase: draft
84 phase: draft
85 parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06
85 parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06
86 parent: -1:0000000000000000000000000000000000000000
86 parent: -1:0000000000000000000000000000000000000000
87 manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892
87 manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892
88 user: test
88 user: test
89 date: Thu Jan 01 00:00:00 1970 +0000
89 date: Thu Jan 01 00:00:00 1970 +0000
90 files+: c
90 files+: c
91 extra: branch=default
91 extra: branch=default
92 description:
92 description:
93 c
93 c
94
94
95
95
96 $ hg pull
96 $ hg pull
97 pulling from $TESTTMP/blackboxtest (glob)
97 pulling from $TESTTMP/blackboxtest (glob)
98 searching for changes
98 searching for changes
99 adding changesets
99 adding changesets
100 adding manifests
100 adding manifests
101 adding file changes
101 adding file changes
102 added 1 changesets with 1 changes to 1 files
102 added 1 changesets with 1 changes to 1 files
103 (run 'hg update' to get a working copy)
103 (run 'hg update' to get a working copy)
104
104
105 a failure reading from the log is fatal
105 a failure reading from the log is fatal
106
106
107 $ hg blackbox -l 3
107 $ hg blackbox -l 3
108 abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob)
108 abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob)
109 [255]
109 [255]
110
110
111 $ rmdir .hg/blackbox.log
111 $ rmdir .hg/blackbox.log
112 $ mv .hg/blackbox.log- .hg/blackbox.log
112 $ mv .hg/blackbox.log- .hg/blackbox.log
113
113
114 backup bundles get logged
114 backup bundles get logged
115
115
116 $ touch d
116 $ touch d
117 $ hg commit -Amd
117 $ hg commit -Amd
118 adding d
118 adding d
119 created new head
119 created new head
120 $ hg strip tip
120 $ hg strip tip
121 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
121 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
122 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
123 $ hg blackbox -l 6
123 $ hg blackbox -l 6
124 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
124 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
125 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg (glob)
125 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg (glob)
126 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob)
126 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob)
127 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes
127 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes
128 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
128 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
129 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
129 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
130
130
131 extension and python hooks - use the eol extension for a pythonhook
131 extension and python hooks - use the eol extension for a pythonhook
132
132
133 $ echo '[extensions]' >> .hg/hgrc
133 $ echo '[extensions]' >> .hg/hgrc
134 $ echo 'eol=' >> .hg/hgrc
134 $ echo 'eol=' >> .hg/hgrc
135 $ echo '[hooks]' >> .hg/hgrc
135 $ echo '[hooks]' >> .hg/hgrc
136 $ echo 'update = echo hooked' >> .hg/hgrc
136 $ echo 'update = echo hooked' >> .hg/hgrc
137 $ hg update
137 $ hg update
138 hooked
138 hooked
139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 updated to "d02f48003e62: c"
140 1 other heads for branch "default"
141 1 other heads for branch "default"
141 $ hg blackbox -l 6
142 $ hg blackbox -l 6
142 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update
143 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update
143 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> writing .hg/cache/tags2-visible with 0 tags
144 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> writing .hg/cache/tags2-visible with 0 tags
144 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
145 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
145 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
146 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
146 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
147 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
147 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 6
148 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 6
148
149
149 log rotation
150 log rotation
150
151
151 $ echo '[blackbox]' >> .hg/hgrc
152 $ echo '[blackbox]' >> .hg/hgrc
152 $ echo 'maxsize = 20 b' >> .hg/hgrc
153 $ echo 'maxsize = 20 b' >> .hg/hgrc
153 $ echo 'maxfiles = 3' >> .hg/hgrc
154 $ echo 'maxfiles = 3' >> .hg/hgrc
154 $ hg status
155 $ hg status
155 $ hg status
156 $ hg status
156 $ hg status
157 $ hg status
157 $ hg tip -q
158 $ hg tip -q
158 2:d02f48003e62
159 2:d02f48003e62
159 $ ls .hg/blackbox.log*
160 $ ls .hg/blackbox.log*
160 .hg/blackbox.log
161 .hg/blackbox.log
161 .hg/blackbox.log.1
162 .hg/blackbox.log.1
162 .hg/blackbox.log.2
163 .hg/blackbox.log.2
163 $ cd ..
164 $ cd ..
164
165
165 $ hg init blackboxtest3
166 $ hg init blackboxtest3
166 $ cd blackboxtest3
167 $ cd blackboxtest3
167 $ hg blackbox
168 $ hg blackbox
168 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
169 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
169 $ mv .hg/blackbox.log .hg/blackbox.log-
170 $ mv .hg/blackbox.log .hg/blackbox.log-
170 $ mkdir .hg/blackbox.log
171 $ mkdir .hg/blackbox.log
171 $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\
172 $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\
172 > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\
173 > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\
173 > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py
174 > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py
174 $ python $TESTDIR/blackbox-readonly-dispatch.py
175 $ python $TESTDIR/blackbox-readonly-dispatch.py
175 running: add foo
176 running: add foo
176 result: 0
177 result: 0
177 running: commit -m commit1 -d 2000-01-01 foo
178 running: commit -m commit1 -d 2000-01-01 foo
178 result: None
179 result: None
179 running: commit -m commit2 -d 2000-01-02 foo
180 running: commit -m commit2 -d 2000-01-02 foo
180 result: None
181 result: None
181 running: log -r 0
182 running: log -r 0
182 changeset: 0:0e4634943879
183 changeset: 0:0e4634943879
183 user: test
184 user: test
184 date: Sat Jan 01 00:00:00 2000 +0000
185 date: Sat Jan 01 00:00:00 2000 +0000
185 summary: commit1
186 summary: commit1
186
187
187 result: None
188 result: None
188 running: log -r tip
189 running: log -r tip
189 changeset: 1:45589e459b2e
190 changeset: 1:45589e459b2e
190 tag: tip
191 tag: tip
191 user: test
192 user: test
192 date: Sun Jan 02 00:00:00 2000 +0000
193 date: Sun Jan 02 00:00:00 2000 +0000
193 summary: commit2
194 summary: commit2
194
195
195 result: None
196 result: None
196 $ hg blackbox
197 $ hg blackbox
197 1970/01/01 00:00:00 bob @0e46349438790c460c5c9f7546bfcd39b267bbd2 (5000)> commit -m commit2 -d 2000-01-02 foo
198 1970/01/01 00:00:00 bob @0e46349438790c460c5c9f7546bfcd39b267bbd2 (5000)> commit -m commit2 -d 2000-01-02 foo
198 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob)
199 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob)
199 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes
200 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes
200 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> commit -m commit2 -d 2000-01-02 foo exited 0 after * seconds (glob)
201 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> commit -m commit2 -d 2000-01-02 foo exited 0 after * seconds (glob)
201 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0
202 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0
202 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
203 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
203 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0 exited 0 after * seconds (glob)
204 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0 exited 0 after * seconds (glob)
204 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r tip
205 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r tip
205 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r tip exited 0 after * seconds (glob)
206 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r tip exited 0 after * seconds (glob)
206 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
207 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
207
208
208 Test log recursion from dirty status check
209 Test log recursion from dirty status check
209
210
210 $ cat > ../r.py <<EOF
211 $ cat > ../r.py <<EOF
211 > from mercurial import context, error, extensions
212 > from mercurial import context, error, extensions
212 > x=[False]
213 > x=[False]
213 > def status(orig, *args, **opts):
214 > def status(orig, *args, **opts):
214 > args[0].repo().ui.log("broken", "recursion?")
215 > args[0].repo().ui.log("broken", "recursion?")
215 > return orig(*args, **opts)
216 > return orig(*args, **opts)
216 > def reposetup(ui, repo):
217 > def reposetup(ui, repo):
217 > extensions.wrapfunction(context.basectx, 'status', status)
218 > extensions.wrapfunction(context.basectx, 'status', status)
218 > EOF
219 > EOF
219 $ hg id --config extensions.x=../r.py --config blackbox.dirty=True
220 $ hg id --config extensions.x=../r.py --config blackbox.dirty=True
220 45589e459b2e tip
221 45589e459b2e tip
221
222
222 cleanup
223 cleanup
223 $ cd ..
224 $ cd ..
@@ -1,279 +1,281
1 $ hg init
1 $ hg init
2 $ cat << EOF > a
2 $ cat << EOF > a
3 > Small Mathematical Series.
3 > Small Mathematical Series.
4 > One
4 > One
5 > Two
5 > Two
6 > Three
6 > Three
7 > Four
7 > Four
8 > Five
8 > Five
9 > Hop we are done.
9 > Hop we are done.
10 > EOF
10 > EOF
11 $ hg add a
11 $ hg add a
12 $ hg commit -m ancestor
12 $ hg commit -m ancestor
13 $ cat << EOF > a
13 $ cat << EOF > a
14 > Small Mathematical Series.
14 > Small Mathematical Series.
15 > 1
15 > 1
16 > 2
16 > 2
17 > 3
17 > 3
18 > 4
18 > 4
19 > 5
19 > 5
20 > Hop we are done.
20 > Hop we are done.
21 > EOF
21 > EOF
22 $ hg commit -m branch1
22 $ hg commit -m branch1
23 $ hg co 0
23 $ hg co 0
24 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 $ cat << EOF > a
25 $ cat << EOF > a
26 > Small Mathematical Series.
26 > Small Mathematical Series.
27 > 1
27 > 1
28 > 2
28 > 2
29 > 3
29 > 3
30 > 6
30 > 6
31 > 8
31 > 8
32 > Hop we are done.
32 > Hop we are done.
33 > EOF
33 > EOF
34 $ hg commit -m branch2
34 $ hg commit -m branch2
35 created new head
35 created new head
36
36
37 $ hg merge 1
37 $ hg merge 1
38 merging a
38 merging a
39 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
39 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
40 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
40 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
41 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
41 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
42 [1]
42 [1]
43
43
44 $ hg id
44 $ hg id
45 618808747361+c0c68e4fe667+ tip
45 618808747361+c0c68e4fe667+ tip
46
46
47 $ cat a
47 $ cat a
48 Small Mathematical Series.
48 Small Mathematical Series.
49 1
49 1
50 2
50 2
51 3
51 3
52 <<<<<<< working copy: 618808747361 - test: branch2
52 <<<<<<< working copy: 618808747361 - test: branch2
53 6
53 6
54 8
54 8
55 =======
55 =======
56 4
56 4
57 5
57 5
58 >>>>>>> merge rev: c0c68e4fe667 - test: branch1
58 >>>>>>> merge rev: c0c68e4fe667 - test: branch1
59 Hop we are done.
59 Hop we are done.
60
60
61 $ hg status
61 $ hg status
62 M a
62 M a
63 ? a.orig
63 ? a.orig
64
64
65 Verify custom conflict markers
65 Verify custom conflict markers
66
66
67 $ hg up -q --clean .
67 $ hg up -q --clean .
68 $ cat <<EOF >> .hg/hgrc
68 $ cat <<EOF >> .hg/hgrc
69 > [ui]
69 > [ui]
70 > mergemarkertemplate = '{author} {rev}'
70 > mergemarkertemplate = '{author} {rev}'
71 > EOF
71 > EOF
72
72
73 $ hg merge 1
73 $ hg merge 1
74 merging a
74 merging a
75 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
75 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
76 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
76 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
77 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
77 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
78 [1]
78 [1]
79
79
80 $ cat a
80 $ cat a
81 Small Mathematical Series.
81 Small Mathematical Series.
82 1
82 1
83 2
83 2
84 3
84 3
85 <<<<<<< working copy: test 2
85 <<<<<<< working copy: test 2
86 6
86 6
87 8
87 8
88 =======
88 =======
89 4
89 4
90 5
90 5
91 >>>>>>> merge rev: test 1
91 >>>>>>> merge rev: test 1
92 Hop we are done.
92 Hop we are done.
93
93
94 Verify line splitting of custom conflict marker which causes multiple lines
94 Verify line splitting of custom conflict marker which causes multiple lines
95
95
96 $ hg up -q --clean .
96 $ hg up -q --clean .
97 $ cat >> .hg/hgrc <<EOF
97 $ cat >> .hg/hgrc <<EOF
98 > [ui]
98 > [ui]
99 > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
99 > mergemarkertemplate={author} {rev}\nfoo\nbar\nbaz
100 > EOF
100 > EOF
101
101
102 $ hg -q merge 1
102 $ hg -q merge 1
103 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
103 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
104 [1]
104 [1]
105
105
106 $ cat a
106 $ cat a
107 Small Mathematical Series.
107 Small Mathematical Series.
108 1
108 1
109 2
109 2
110 3
110 3
111 <<<<<<< working copy: test 2
111 <<<<<<< working copy: test 2
112 6
112 6
113 8
113 8
114 =======
114 =======
115 4
115 4
116 5
116 5
117 >>>>>>> merge rev: test 1
117 >>>>>>> merge rev: test 1
118 Hop we are done.
118 Hop we are done.
119
119
120 Verify line trimming of custom conflict marker using multi-byte characters
120 Verify line trimming of custom conflict marker using multi-byte characters
121
121
122 $ hg up -q --clean .
122 $ hg up -q --clean .
123 $ python <<EOF
123 $ python <<EOF
124 > fp = open('logfile', 'w')
124 > fp = open('logfile', 'w')
125 > fp.write('12345678901234567890123456789012345678901234567890' +
125 > fp.write('12345678901234567890123456789012345678901234567890' +
126 > '1234567890') # there are 5 more columns for 80 columns
126 > '1234567890') # there are 5 more columns for 80 columns
127 >
127 >
128 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
128 > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
129 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
129 > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
130 >
130 >
131 > fp.close()
131 > fp.close()
132 > EOF
132 > EOF
133 $ hg add logfile
133 $ hg add logfile
134 $ hg --encoding utf-8 commit --logfile logfile
134 $ hg --encoding utf-8 commit --logfile logfile
135
135
136 $ cat >> .hg/hgrc <<EOF
136 $ cat >> .hg/hgrc <<EOF
137 > [ui]
137 > [ui]
138 > mergemarkertemplate={desc|firstline}
138 > mergemarkertemplate={desc|firstline}
139 > EOF
139 > EOF
140
140
141 $ hg -q --encoding utf-8 merge 1
141 $ hg -q --encoding utf-8 merge 1
142 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
142 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
143 [1]
143 [1]
144
144
145 $ cat a
145 $ cat a
146 Small Mathematical Series.
146 Small Mathematical Series.
147 1
147 1
148 2
148 2
149 3
149 3
150 <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345...
150 <<<<<<< working copy: 1234567890123456789012345678901234567890123456789012345...
151 6
151 6
152 8
152 8
153 =======
153 =======
154 4
154 4
155 5
155 5
156 >>>>>>> merge rev: branch1
156 >>>>>>> merge rev: branch1
157 Hop we are done.
157 Hop we are done.
158
158
159 Verify basic conflict markers
159 Verify basic conflict markers
160
160
161 $ hg up -q --clean 2
161 $ hg up -q --clean 2
162 $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
162 $ printf "\n[ui]\nmergemarkers=basic\n" >> .hg/hgrc
163
163
164 $ hg merge 1
164 $ hg merge 1
165 merging a
165 merging a
166 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
166 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
167 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
167 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
168 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
168 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
169 [1]
169 [1]
170
170
171 $ cat a
171 $ cat a
172 Small Mathematical Series.
172 Small Mathematical Series.
173 1
173 1
174 2
174 2
175 3
175 3
176 <<<<<<< working copy
176 <<<<<<< working copy
177 6
177 6
178 8
178 8
179 =======
179 =======
180 4
180 4
181 5
181 5
182 >>>>>>> merge rev
182 >>>>>>> merge rev
183 Hop we are done.
183 Hop we are done.
184
184
185 internal:merge3
185 internal:merge3
186
186
187 $ hg up -q --clean .
187 $ hg up -q --clean .
188
188
189 $ hg merge 1 --tool internal:merge3
189 $ hg merge 1 --tool internal:merge3
190 merging a
190 merging a
191 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
191 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
192 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
192 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
193 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
193 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
194 [1]
194 [1]
195 $ cat a
195 $ cat a
196 Small Mathematical Series.
196 Small Mathematical Series.
197 <<<<<<< working copy
197 <<<<<<< working copy
198 1
198 1
199 2
199 2
200 3
200 3
201 6
201 6
202 8
202 8
203 ||||||| base
203 ||||||| base
204 One
204 One
205 Two
205 Two
206 Three
206 Three
207 Four
207 Four
208 Five
208 Five
209 =======
209 =======
210 1
210 1
211 2
211 2
212 3
212 3
213 4
213 4
214 5
214 5
215 >>>>>>> merge rev
215 >>>>>>> merge rev
216 Hop we are done.
216 Hop we are done.
217
217
218 Add some unconflicting changes on each head, to make sure we really
218 Add some unconflicting changes on each head, to make sure we really
219 are merging, unlike :local and :other
219 are merging, unlike :local and :other
220
220
221 $ hg up -C
221 $ hg up -C
222 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 updated to "e0693e20f496: 123456789012345678901234567890123456789012345678901234567890????"
223 1 other heads for branch "default"
224 1 other heads for branch "default"
224 $ printf "\n\nEnd of file\n" >> a
225 $ printf "\n\nEnd of file\n" >> a
225 $ hg ci -m "Add some stuff at the end"
226 $ hg ci -m "Add some stuff at the end"
226 $ hg up -r 1
227 $ hg up -r 1
227 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
228 $ printf "Start of file\n\n\n" > tmp
229 $ printf "Start of file\n\n\n" > tmp
229 $ cat a >> tmp
230 $ cat a >> tmp
230 $ mv tmp a
231 $ mv tmp a
231 $ hg ci -m "Add some stuff at the beginning"
232 $ hg ci -m "Add some stuff at the beginning"
232
233
233 Now test :merge-other and :merge-local
234 Now test :merge-other and :merge-local
234
235
235 $ hg merge
236 $ hg merge
236 merging a
237 merging a
237 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
238 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
238 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
239 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
239 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
240 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
240 [1]
241 [1]
241 $ hg resolve --tool :merge-other a
242 $ hg resolve --tool :merge-other a
242 merging a
243 merging a
243 (no more unresolved files)
244 (no more unresolved files)
244 $ cat a
245 $ cat a
245 Start of file
246 Start of file
246
247
247
248
248 Small Mathematical Series.
249 Small Mathematical Series.
249 1
250 1
250 2
251 2
251 3
252 3
252 6
253 6
253 8
254 8
254 Hop we are done.
255 Hop we are done.
255
256
256
257
257 End of file
258 End of file
258
259
259 $ hg up -C
260 $ hg up -C
260 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
261 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
262 updated to "18b51d585961: Add some stuff at the beginning"
261 1 other heads for branch "default"
263 1 other heads for branch "default"
262 $ hg merge --tool :merge-local
264 $ hg merge --tool :merge-local
263 merging a
265 merging a
264 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 (branch merge, don't forget to commit)
267 (branch merge, don't forget to commit)
266 $ cat a
268 $ cat a
267 Start of file
269 Start of file
268
270
269
271
270 Small Mathematical Series.
272 Small Mathematical Series.
271 1
273 1
272 2
274 2
273 3
275 3
274 4
276 4
275 5
277 5
276 Hop we are done.
278 Hop we are done.
277
279
278
280
279 End of file
281 End of file
@@ -1,258 +1,259
1 Create user cache directory
1 Create user cache directory
2
2
3 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ USERCACHE=`pwd`/cache; export USERCACHE
4 $ cat <<EOF >> ${HGRCPATH}
4 $ cat <<EOF >> ${HGRCPATH}
5 > [extensions]
5 > [extensions]
6 > hgext.largefiles=
6 > hgext.largefiles=
7 > [largefiles]
7 > [largefiles]
8 > usercache=${USERCACHE}
8 > usercache=${USERCACHE}
9 > EOF
9 > EOF
10 $ mkdir -p ${USERCACHE}
10 $ mkdir -p ${USERCACHE}
11
11
12 Create source repo, and commit adding largefile.
12 Create source repo, and commit adding largefile.
13
13
14 $ hg init src
14 $ hg init src
15 $ cd src
15 $ cd src
16 $ echo large > large
16 $ echo large > large
17 $ hg add --large large
17 $ hg add --large large
18 $ hg commit -m 'add largefile'
18 $ hg commit -m 'add largefile'
19 $ hg rm large
19 $ hg rm large
20 $ hg commit -m 'branchhead without largefile' large
20 $ hg commit -m 'branchhead without largefile' large
21 $ hg up -qr 0
21 $ hg up -qr 0
22 $ rm large
22 $ rm large
23 $ echo "0000000000000000000000000000000000000000" > .hglf/large
23 $ echo "0000000000000000000000000000000000000000" > .hglf/large
24 $ hg commit -m 'commit missing file with corrupt standin' large
24 $ hg commit -m 'commit missing file with corrupt standin' large
25 abort: large: file not found!
25 abort: large: file not found!
26 [255]
26 [255]
27 $ hg up -Cqr 0
27 $ hg up -Cqr 0
28 $ cd ..
28 $ cd ..
29
29
30 Discard all cached largefiles in USERCACHE
30 Discard all cached largefiles in USERCACHE
31
31
32 $ rm -rf ${USERCACHE}
32 $ rm -rf ${USERCACHE}
33
33
34 Create mirror repo, and pull from source without largefile:
34 Create mirror repo, and pull from source without largefile:
35 "pull" is used instead of "clone" for suppression of (1) updating to
35 "pull" is used instead of "clone" for suppression of (1) updating to
36 tip (= caching largefile from source repo), and (2) recording source
36 tip (= caching largefile from source repo), and (2) recording source
37 repo as "default" path in .hg/hgrc.
37 repo as "default" path in .hg/hgrc.
38
38
39 $ hg init mirror
39 $ hg init mirror
40 $ cd mirror
40 $ cd mirror
41 $ hg pull ../src
41 $ hg pull ../src
42 pulling from ../src
42 pulling from ../src
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 1 changes to 1 files
47 added 2 changesets with 1 changes to 1 files
48 (run 'hg update' to get a working copy)
48 (run 'hg update' to get a working copy)
49
49
50 Update working directory to "tip", which requires largefile("large"),
50 Update working directory to "tip", which requires largefile("large"),
51 but there is no cache file for it. So, hg must treat it as
51 but there is no cache file for it. So, hg must treat it as
52 "missing"(!) file.
52 "missing"(!) file.
53
53
54 $ hg update -r0
54 $ hg update -r0
55 getting changed largefiles
55 getting changed largefiles
56 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
56 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
57 0 largefiles updated, 0 removed
57 0 largefiles updated, 0 removed
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ hg status
59 $ hg status
60 ! large
60 ! large
61
61
62 Update working directory to null: this cleanup .hg/largefiles/dirstate
62 Update working directory to null: this cleanup .hg/largefiles/dirstate
63
63
64 $ hg update null
64 $ hg update null
65 getting changed largefiles
65 getting changed largefiles
66 0 largefiles updated, 0 removed
66 0 largefiles updated, 0 removed
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
67 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68
68
69 Update working directory to tip, again.
69 Update working directory to tip, again.
70
70
71 $ hg update -r0
71 $ hg update -r0
72 getting changed largefiles
72 getting changed largefiles
73 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
73 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:/*/$TESTTMP/mirror (glob)
74 0 largefiles updated, 0 removed
74 0 largefiles updated, 0 removed
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76 $ hg status
76 $ hg status
77 ! large
77 ! large
78 $ cd ..
78 $ cd ..
79
79
80 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
80 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
81
81
82 $ hg init mirror2
82 $ hg init mirror2
83 $ hg -R mirror2 pull src -r0
83 $ hg -R mirror2 pull src -r0
84 pulling from src
84 pulling from src
85 adding changesets
85 adding changesets
86 adding manifests
86 adding manifests
87 adding file changes
87 adding file changes
88 added 1 changesets with 1 changes to 1 files
88 added 1 changesets with 1 changes to 1 files
89 (run 'hg update' to get a working copy)
89 (run 'hg update' to get a working copy)
90
90
91 #if unix-permissions
91 #if unix-permissions
92
92
93 Portable way to print file permissions:
93 Portable way to print file permissions:
94
94
95 $ cat > ls-l.py <<EOF
95 $ cat > ls-l.py <<EOF
96 > #!/usr/bin/env python
96 > #!/usr/bin/env python
97 > import sys, os
97 > import sys, os
98 > path = sys.argv[1]
98 > path = sys.argv[1]
99 > print '%03o' % (os.lstat(path).st_mode & 0777)
99 > print '%03o' % (os.lstat(path).st_mode & 0777)
100 > EOF
100 > EOF
101 $ chmod +x ls-l.py
101 $ chmod +x ls-l.py
102
102
103 Test that files in .hg/largefiles inherit mode from .hg/store, not
103 Test that files in .hg/largefiles inherit mode from .hg/store, not
104 from file in working copy:
104 from file in working copy:
105
105
106 $ cd src
106 $ cd src
107 $ chmod 750 .hg/store
107 $ chmod 750 .hg/store
108 $ chmod 660 large
108 $ chmod 660 large
109 $ echo change >> large
109 $ echo change >> large
110 $ hg commit -m change
110 $ hg commit -m change
111 created new head
111 created new head
112 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
112 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
113 640
113 640
114
114
115 Test permission of with files in .hg/largefiles created by update:
115 Test permission of with files in .hg/largefiles created by update:
116
116
117 $ cd ../mirror
117 $ cd ../mirror
118 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
118 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
119 $ chmod 750 .hg/store
119 $ chmod 750 .hg/store
120 $ hg pull ../src --update -q
120 $ hg pull ../src --update -q
121 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
121 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
122 640
122 640
123
123
124 Test permission of files created by push:
124 Test permission of files created by push:
125
125
126 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
126 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
127 > --config "web.allow_push=*" --config web.push_ssl=no
127 > --config "web.allow_push=*" --config web.push_ssl=no
128 $ cat hg.pid >> $DAEMON_PIDS
128 $ cat hg.pid >> $DAEMON_PIDS
129
129
130 $ echo change >> large
130 $ echo change >> large
131 $ hg commit -m change
131 $ hg commit -m change
132
132
133 $ rm -r "$USERCACHE"
133 $ rm -r "$USERCACHE"
134
134
135 $ hg push -q http://localhost:$HGPORT/
135 $ hg push -q http://localhost:$HGPORT/
136
136
137 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
137 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
138 640
138 640
139
139
140 $ cd ..
140 $ cd ..
141
141
142 #endif
142 #endif
143
143
144 Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say
144 Test issue 4053 (remove --after on a deleted, uncommitted file shouldn't say
145 it is missing, but a remove on a nonexistent unknown file still should. Same
145 it is missing, but a remove on a nonexistent unknown file still should. Same
146 for a forget.)
146 for a forget.)
147
147
148 $ cd src
148 $ cd src
149 $ touch x
149 $ touch x
150 $ hg add x
150 $ hg add x
151 $ mv x y
151 $ mv x y
152 $ hg remove -A x y ENOENT
152 $ hg remove -A x y ENOENT
153 ENOENT: * (glob)
153 ENOENT: * (glob)
154 not removing y: file is untracked
154 not removing y: file is untracked
155 [1]
155 [1]
156 $ hg add y
156 $ hg add y
157 $ mv y z
157 $ mv y z
158 $ hg forget y z ENOENT
158 $ hg forget y z ENOENT
159 ENOENT: * (glob)
159 ENOENT: * (glob)
160 not removing z: file is already untracked
160 not removing z: file is already untracked
161 [1]
161 [1]
162
162
163 Largefiles are accessible from the share's store
163 Largefiles are accessible from the share's store
164 $ cd ..
164 $ cd ..
165 $ hg share -q src share_dst --config extensions.share=
165 $ hg share -q src share_dst --config extensions.share=
166 $ hg -R share_dst update -r0
166 $ hg -R share_dst update -r0
167 getting changed largefiles
167 getting changed largefiles
168 1 largefiles updated, 0 removed
168 1 largefiles updated, 0 removed
169 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
170
170
171 $ echo modified > share_dst/large
171 $ echo modified > share_dst/large
172 $ hg -R share_dst ci -m modified
172 $ hg -R share_dst ci -m modified
173 created new head
173 created new head
174
174
175 Only dirstate is in the local store for the share, and the largefile is in the
175 Only dirstate is in the local store for the share, and the largefile is in the
176 share source's local store. Avoid the extra largefiles added in the unix
176 share source's local store. Avoid the extra largefiles added in the unix
177 conditional above.
177 conditional above.
178 $ hash=`hg -R share_dst cat share_dst/.hglf/large`
178 $ hash=`hg -R share_dst cat share_dst/.hglf/large`
179 $ echo $hash
179 $ echo $hash
180 e2fb5f2139d086ded2cb600d5a91a196e76bf020
180 e2fb5f2139d086ded2cb600d5a91a196e76bf020
181
181
182 $ find share_dst/.hg/largefiles/* | sort
182 $ find share_dst/.hg/largefiles/* | sort
183 share_dst/.hg/largefiles/dirstate
183 share_dst/.hg/largefiles/dirstate
184
184
185 $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort
185 $ find src/.hg/largefiles/* | egrep "(dirstate|$hash)" | sort
186 src/.hg/largefiles/dirstate
186 src/.hg/largefiles/dirstate
187 src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
187 src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
188
188
189 Verify that backwards compatibility is maintained for old storage layout
189 Verify that backwards compatibility is maintained for old storage layout
190 $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles
190 $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles
191 $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache=
191 $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache=
192
192
193 Inject corruption into the largefiles store and see how update handles that:
193 Inject corruption into the largefiles store and see how update handles that:
194
194
195 $ cd src
195 $ cd src
196 $ hg up -qC tip
196 $ hg up -qC tip
197 $ cat large
197 $ cat large
198 modified
198 modified
199 $ rm large
199 $ rm large
200 $ cat .hglf/large
200 $ cat .hglf/large
201 e2fb5f2139d086ded2cb600d5a91a196e76bf020
201 e2fb5f2139d086ded2cb600d5a91a196e76bf020
202 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
202 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
203 $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
203 $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
204 $ hg up -C
204 $ hg up -C
205 getting changed largefiles
205 getting changed largefiles
206 large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
206 large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
207 0 largefiles updated, 0 removed
207 0 largefiles updated, 0 removed
208 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
209 updated to "cd24c147f45c: modified"
209 [12] other heads for branch "default" (re)
210 [12] other heads for branch "default" (re)
210 $ hg st
211 $ hg st
211 ! large
212 ! large
212 ? z
213 ? z
213 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
214 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
214
215
215 #if serve
216 #if serve
216
217
217 Test coverage of error handling from putlfile:
218 Test coverage of error handling from putlfile:
218
219
219 $ mkdir $TESTTMP/mirrorcache
220 $ mkdir $TESTTMP/mirrorcache
220 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
221 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
221 $ cat hg.pid >> $DAEMON_PIDS
222 $ cat hg.pid >> $DAEMON_PIDS
222
223
223 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
224 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
224 pushing to http://localhost:$HGPORT1/
225 pushing to http://localhost:$HGPORT1/
225 searching for changes
226 searching for changes
226 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required (glob)
227 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required (glob)
227 [255]
228 [255]
228
229
229 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
230 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
230
231
231 Test coverage of 'missing from store':
232 Test coverage of 'missing from store':
232
233
233 $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no
234 $ hg serve -R ../mirror -d -p $HGPORT2 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache --config "web.allow_push=*" --config web.push_ssl=no
234 $ cat hg.pid >> $DAEMON_PIDS
235 $ cat hg.pid >> $DAEMON_PIDS
235
236
236 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
237 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
237 pushing to http://localhost:$HGPORT2/
238 pushing to http://localhost:$HGPORT2/
238 searching for changes
239 searching for changes
239 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
240 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
240 [255]
241 [255]
241
242
242 Verify that --lfrev controls which revisions are checked for largefiles to push
243 Verify that --lfrev controls which revisions are checked for largefiles to push
243
244
244 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev tip
245 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev tip
245 pushing to http://localhost:$HGPORT2/
246 pushing to http://localhost:$HGPORT2/
246 searching for changes
247 searching for changes
247 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
248 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
248 [255]
249 [255]
249
250
250 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev null
251 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache --lfrev null
251 pushing to http://localhost:$HGPORT2/
252 pushing to http://localhost:$HGPORT2/
252 searching for changes
253 searching for changes
253 remote: adding changesets
254 remote: adding changesets
254 remote: adding manifests
255 remote: adding manifests
255 remote: adding file changes
256 remote: adding file changes
256 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
257 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
257
258
258 #endif
259 #endif
@@ -1,784 +1,788
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 > [extdiff]
9 > [extdiff]
10 > # for portability:
10 > # for portability:
11 > pdiff = sh "$RUNTESTDIR/pdiff"
11 > pdiff = sh "$RUNTESTDIR/pdiff"
12 > EOF
12 > EOF
13
13
14 $ hg init repo
14 $ hg init repo
15 $ cd repo
15 $ cd repo
16
16
17 $ echo large1 > large1
17 $ echo large1 > large1
18 $ echo large2 > large2
18 $ echo large2 > large2
19 $ hg add --large large1 large2
19 $ hg add --large large1 large2
20 $ echo normal1 > normal1
20 $ echo normal1 > normal1
21 $ hg add normal1
21 $ hg add normal1
22 $ hg commit -m '#0'
22 $ hg commit -m '#0'
23 $ echo 'large1 in #1' > large1
23 $ echo 'large1 in #1' > large1
24 $ echo 'normal1 in #1' > normal1
24 $ echo 'normal1 in #1' > normal1
25 $ hg commit -m '#1'
25 $ hg commit -m '#1'
26 $ hg pdiff -r '.^' --config extensions.extdiff=
26 $ hg pdiff -r '.^' --config extensions.extdiff=
27 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
27 diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1
28 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
28 --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob)
29 +++ repo/.hglf/large1 * (glob)
29 +++ repo/.hglf/large1 * (glob)
30 @@ -1* +1* @@ (glob)
30 @@ -1* +1* @@ (glob)
31 -4669e532d5b2c093a78eca010077e708a071bb64
31 -4669e532d5b2c093a78eca010077e708a071bb64
32 +58e24f733a964da346e2407a2bee99d9001184f5
32 +58e24f733a964da346e2407a2bee99d9001184f5
33 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
33 diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1
34 --- repo.0d9d9b8dc9a3/normal1 * (glob)
34 --- repo.0d9d9b8dc9a3/normal1 * (glob)
35 +++ repo/normal1 * (glob)
35 +++ repo/normal1 * (glob)
36 @@ -1* +1* @@ (glob)
36 @@ -1* +1* @@ (glob)
37 -normal1
37 -normal1
38 +normal1 in #1
38 +normal1 in #1
39 [1]
39 [1]
40 $ hg update -q -C 0
40 $ hg update -q -C 0
41 $ echo 'large2 in #2' > large2
41 $ echo 'large2 in #2' > large2
42 $ hg commit -m '#2'
42 $ hg commit -m '#2'
43 created new head
43 created new head
44
44
45 Test that update also updates the lfdirstate of 'unsure' largefiles after
45 Test that update also updates the lfdirstate of 'unsure' largefiles after
46 hashing them:
46 hashing them:
47
47
48 The previous operations will usually have left us with largefiles with a mtime
48 The previous operations will usually have left us with largefiles with a mtime
49 within the same second as the dirstate was written.
49 within the same second as the dirstate was written.
50 The lfdirstate entries will thus have been written with an invalidated/unset
50 The lfdirstate entries will thus have been written with an invalidated/unset
51 mtime to make sure further changes within the same second is detected.
51 mtime to make sure further changes within the same second is detected.
52 We will however occasionally be "lucky" and get a tick between writing
52 We will however occasionally be "lucky" and get a tick between writing
53 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
53 largefiles and writing dirstate so we get valid lfdirstate timestamps. The
54 following verification is thus disabled but can be verified manually.
54 following verification is thus disabled but can be verified manually.
55
55
56 #if false
56 #if false
57 $ hg debugdirstate --large --nodate
57 $ hg debugdirstate --large --nodate
58 n 644 7 unset large1
58 n 644 7 unset large1
59 n 644 13 unset large2
59 n 644 13 unset large2
60 #endif
60 #endif
61
61
62 Wait to make sure we get a tick so the mtime of the largefiles become valid.
62 Wait to make sure we get a tick so the mtime of the largefiles become valid.
63
63
64 $ sleep 1
64 $ sleep 1
65
65
66 A linear merge will update standins before performing the actual merge. It will
66 A linear merge will update standins before performing the actual merge. It will
67 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
67 do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and
68 update the corresponding standins.
68 update the corresponding standins.
69 Verify that it actually marks the clean files as clean in lfdirstate so
69 Verify that it actually marks the clean files as clean in lfdirstate so
70 we don't have to hash them again next time we update.
70 we don't have to hash them again next time we update.
71
71
72 $ hg up
72 $ hg up
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 updated to "f74e50bd9e55: #2"
74 1 other heads for branch "default"
75 1 other heads for branch "default"
75 $ hg debugdirstate --large --nodate
76 $ hg debugdirstate --large --nodate
76 n 644 7 set large1
77 n 644 7 set large1
77 n 644 13 set large2
78 n 644 13 set large2
78
79
79 Test that lfdirstate keeps track of last modification of largefiles and
80 Test that lfdirstate keeps track of last modification of largefiles and
80 prevents unnecessary hashing of content - also after linear/noop update
81 prevents unnecessary hashing of content - also after linear/noop update
81
82
82 $ sleep 1
83 $ sleep 1
83 $ hg st
84 $ hg st
84 $ hg debugdirstate --large --nodate
85 $ hg debugdirstate --large --nodate
85 n 644 7 set large1
86 n 644 7 set large1
86 n 644 13 set large2
87 n 644 13 set large2
87 $ hg up
88 $ hg up
88 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 updated to "f74e50bd9e55: #2"
89 1 other heads for branch "default"
91 1 other heads for branch "default"
90 $ hg debugdirstate --large --nodate
92 $ hg debugdirstate --large --nodate
91 n 644 7 set large1
93 n 644 7 set large1
92 n 644 13 set large2
94 n 644 13 set large2
93
95
94 Test that "hg merge" updates largefiles from "other" correctly
96 Test that "hg merge" updates largefiles from "other" correctly
95
97
96 (getting largefiles from "other" normally)
98 (getting largefiles from "other" normally)
97
99
98 $ hg status -A large1
100 $ hg status -A large1
99 C large1
101 C large1
100 $ cat large1
102 $ cat large1
101 large1
103 large1
102 $ cat .hglf/large1
104 $ cat .hglf/large1
103 4669e532d5b2c093a78eca010077e708a071bb64
105 4669e532d5b2c093a78eca010077e708a071bb64
104 $ hg merge --config debug.dirstate.delaywrite=2
106 $ hg merge --config debug.dirstate.delaywrite=2
105 getting changed largefiles
107 getting changed largefiles
106 1 largefiles updated, 0 removed
108 1 largefiles updated, 0 removed
107 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 (branch merge, don't forget to commit)
110 (branch merge, don't forget to commit)
109 $ hg status -A large1
111 $ hg status -A large1
110 M large1
112 M large1
111 $ cat large1
113 $ cat large1
112 large1 in #1
114 large1 in #1
113 $ cat .hglf/large1
115 $ cat .hglf/large1
114 58e24f733a964da346e2407a2bee99d9001184f5
116 58e24f733a964da346e2407a2bee99d9001184f5
115 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
117 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
116 -4669e532d5b2c093a78eca010077e708a071bb64
118 -4669e532d5b2c093a78eca010077e708a071bb64
117 +58e24f733a964da346e2407a2bee99d9001184f5
119 +58e24f733a964da346e2407a2bee99d9001184f5
118
120
119 (getting largefiles from "other" via conflict prompt)
121 (getting largefiles from "other" via conflict prompt)
120
122
121 $ hg update -q -C 2
123 $ hg update -q -C 2
122 $ echo 'large1 in #3' > large1
124 $ echo 'large1 in #3' > large1
123 $ echo 'normal1 in #3' > normal1
125 $ echo 'normal1 in #3' > normal1
124 $ hg commit -m '#3'
126 $ hg commit -m '#3'
125 $ cat .hglf/large1
127 $ cat .hglf/large1
126 e5bb990443d6a92aaf7223813720f7566c9dd05b
128 e5bb990443d6a92aaf7223813720f7566c9dd05b
127 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
129 $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF
128 > o
130 > o
129 > EOF
131 > EOF
130 largefile large1 has a merge conflict
132 largefile large1 has a merge conflict
131 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
133 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
132 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
134 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
133 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
135 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
134 merging normal1
136 merging normal1
135 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
137 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
136 getting changed largefiles
138 getting changed largefiles
137 1 largefiles updated, 0 removed
139 1 largefiles updated, 0 removed
138 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
140 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
139 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
141 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
140 [1]
142 [1]
141 $ hg status -A large1
143 $ hg status -A large1
142 M large1
144 M large1
143 $ cat large1
145 $ cat large1
144 large1 in #1
146 large1 in #1
145 $ cat .hglf/large1
147 $ cat .hglf/large1
146 58e24f733a964da346e2407a2bee99d9001184f5
148 58e24f733a964da346e2407a2bee99d9001184f5
147 $ rm normal1.orig
149 $ rm normal1.orig
148
150
149 (merge non-existing largefiles from "other" via conflict prompt -
151 (merge non-existing largefiles from "other" via conflict prompt -
150 make sure the following commit doesn't abort in a confusing way when trying to
152 make sure the following commit doesn't abort in a confusing way when trying to
151 mark the non-existing file as normal in lfdirstate)
153 mark the non-existing file as normal in lfdirstate)
152
154
153 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
155 $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 .
154 $ hg update -q -C 3
156 $ hg update -q -C 3
155 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
157 $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF
156 > o
158 > o
157 > EOF
159 > EOF
158 largefile large1 has a merge conflict
160 largefile large1 has a merge conflict
159 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
161 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
160 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
162 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
161 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
163 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
162 getting changed largefiles
164 getting changed largefiles
163 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
165 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
164 0 largefiles updated, 0 removed
166 0 largefiles updated, 0 removed
165 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
167 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
166 (branch merge, don't forget to commit)
168 (branch merge, don't forget to commit)
167 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
169 $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not
168 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
170 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store
169 $ hg up -C . --config largefiles.usercache=not
171 $ hg up -C . --config largefiles.usercache=not
170 getting changed largefiles
172 getting changed largefiles
171 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
173 large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob)
172 0 largefiles updated, 0 removed
174 0 largefiles updated, 0 removed
173 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 $ hg st large1
176 $ hg st large1
175 ! large1
177 ! large1
176 $ hg rollback -q
178 $ hg rollback -q
177 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
179 $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/
178
180
179 Test that "hg revert -r REV" updates largefiles from "REV" correctly
181 Test that "hg revert -r REV" updates largefiles from "REV" correctly
180
182
181 $ hg update -q -C 3
183 $ hg update -q -C 3
182 $ hg status -A large1
184 $ hg status -A large1
183 C large1
185 C large1
184 $ cat large1
186 $ cat large1
185 large1 in #3
187 large1 in #3
186 $ cat .hglf/large1
188 $ cat .hglf/large1
187 e5bb990443d6a92aaf7223813720f7566c9dd05b
189 e5bb990443d6a92aaf7223813720f7566c9dd05b
188 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
190 $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
189 -4669e532d5b2c093a78eca010077e708a071bb64
191 -4669e532d5b2c093a78eca010077e708a071bb64
190 +58e24f733a964da346e2407a2bee99d9001184f5
192 +58e24f733a964da346e2407a2bee99d9001184f5
191 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
193 $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1
192 $ hg status -A large1
194 $ hg status -A large1
193 M large1
195 M large1
194 $ cat large1
196 $ cat large1
195 large1 in #1
197 large1 in #1
196 $ cat .hglf/large1
198 $ cat .hglf/large1
197 58e24f733a964da346e2407a2bee99d9001184f5
199 58e24f733a964da346e2407a2bee99d9001184f5
198
200
199 Test that "hg rollback" restores status of largefiles correctly
201 Test that "hg rollback" restores status of largefiles correctly
200
202
201 $ hg update -C -q
203 $ hg update -C -q
202 $ hg remove large1
204 $ hg remove large1
203 $ test -f .hglf/large1
205 $ test -f .hglf/large1
204 [1]
206 [1]
205 $ hg forget large2
207 $ hg forget large2
206 $ test -f .hglf/large2
208 $ test -f .hglf/large2
207 [1]
209 [1]
208 $ echo largeX > largeX
210 $ echo largeX > largeX
209 $ hg add --large largeX
211 $ hg add --large largeX
210 $ cat .hglf/largeX
212 $ cat .hglf/largeX
211
213
212 $ hg commit -m 'will be rollback-ed soon'
214 $ hg commit -m 'will be rollback-ed soon'
213 $ echo largeY > largeY
215 $ echo largeY > largeY
214 $ hg add --large largeY
216 $ hg add --large largeY
215 #if windows
217 #if windows
216 $ hg status -A large1
218 $ hg status -A large1
217 large1: * (glob)
219 large1: * (glob)
218 #else
220 #else
219 $ hg status -A large1
221 $ hg status -A large1
220 large1: No such file or directory
222 large1: No such file or directory
221 #endif
223 #endif
222 $ hg status -A large2
224 $ hg status -A large2
223 ? large2
225 ? large2
224 $ hg status -A largeX
226 $ hg status -A largeX
225 C largeX
227 C largeX
226 $ hg status -A largeY
228 $ hg status -A largeY
227 A largeY
229 A largeY
228 $ hg rollback
230 $ hg rollback
229 repository tip rolled back to revision 3 (undo commit)
231 repository tip rolled back to revision 3 (undo commit)
230 working directory now based on revision 3
232 working directory now based on revision 3
231 $ hg status -A large1
233 $ hg status -A large1
232 R large1
234 R large1
233 $ test -f .hglf/large1
235 $ test -f .hglf/large1
234 [1]
236 [1]
235 $ hg status -A large2
237 $ hg status -A large2
236 R large2
238 R large2
237 $ test -f .hglf/large2
239 $ test -f .hglf/large2
238 [1]
240 [1]
239 $ hg status -A largeX
241 $ hg status -A largeX
240 A largeX
242 A largeX
241 $ cat .hglf/largeX
243 $ cat .hglf/largeX
242
244
243 $ hg status -A largeY
245 $ hg status -A largeY
244 ? largeY
246 ? largeY
245 $ test -f .hglf/largeY
247 $ test -f .hglf/largeY
246 [1]
248 [1]
247 $ rm largeY
249 $ rm largeY
248
250
249 Test that "hg rollback" restores standins correctly
251 Test that "hg rollback" restores standins correctly
250
252
251 $ hg commit -m 'will be rollback-ed soon'
253 $ hg commit -m 'will be rollback-ed soon'
252 $ hg update -q -C 2
254 $ hg update -q -C 2
253 $ cat large1
255 $ cat large1
254 large1
256 large1
255 $ cat .hglf/large1
257 $ cat .hglf/large1
256 4669e532d5b2c093a78eca010077e708a071bb64
258 4669e532d5b2c093a78eca010077e708a071bb64
257 $ cat large2
259 $ cat large2
258 large2 in #2
260 large2 in #2
259 $ cat .hglf/large2
261 $ cat .hglf/large2
260 3cfce6277e7668985707b6887ce56f9f62f6ccd9
262 3cfce6277e7668985707b6887ce56f9f62f6ccd9
261
263
262 $ hg rollback -q -f
264 $ hg rollback -q -f
263 $ cat large1
265 $ cat large1
264 large1
266 large1
265 $ cat .hglf/large1
267 $ cat .hglf/large1
266 4669e532d5b2c093a78eca010077e708a071bb64
268 4669e532d5b2c093a78eca010077e708a071bb64
267 $ cat large2
269 $ cat large2
268 large2 in #2
270 large2 in #2
269 $ cat .hglf/large2
271 $ cat .hglf/large2
270 3cfce6277e7668985707b6887ce56f9f62f6ccd9
272 3cfce6277e7668985707b6887ce56f9f62f6ccd9
271
273
272 (rollback the parent of the working directory, when the parent of it
274 (rollback the parent of the working directory, when the parent of it
273 is not branch-tip)
275 is not branch-tip)
274
276
275 $ hg update -q -C 1
277 $ hg update -q -C 1
276 $ cat .hglf/large1
278 $ cat .hglf/large1
277 58e24f733a964da346e2407a2bee99d9001184f5
279 58e24f733a964da346e2407a2bee99d9001184f5
278 $ cat .hglf/large2
280 $ cat .hglf/large2
279 1deebade43c8c498a3c8daddac0244dc55d1331d
281 1deebade43c8c498a3c8daddac0244dc55d1331d
280
282
281 $ echo normalX > normalX
283 $ echo normalX > normalX
282 $ hg add normalX
284 $ hg add normalX
283 $ hg commit -m 'will be rollback-ed soon'
285 $ hg commit -m 'will be rollback-ed soon'
284 $ hg rollback -q
286 $ hg rollback -q
285
287
286 $ cat .hglf/large1
288 $ cat .hglf/large1
287 58e24f733a964da346e2407a2bee99d9001184f5
289 58e24f733a964da346e2407a2bee99d9001184f5
288 $ cat .hglf/large2
290 $ cat .hglf/large2
289 1deebade43c8c498a3c8daddac0244dc55d1331d
291 1deebade43c8c498a3c8daddac0244dc55d1331d
290 $ rm normalX
292 $ rm normalX
291
293
292 Test that "hg status" shows status of largefiles correctly just after
294 Test that "hg status" shows status of largefiles correctly just after
293 automated commit like rebase/transplant
295 automated commit like rebase/transplant
294
296
295 $ cat >> .hg/hgrc <<EOF
297 $ cat >> .hg/hgrc <<EOF
296 > [extensions]
298 > [extensions]
297 > rebase =
299 > rebase =
298 > strip =
300 > strip =
299 > transplant =
301 > transplant =
300 > EOF
302 > EOF
301 $ hg update -q -C 1
303 $ hg update -q -C 1
302 $ hg remove large1
304 $ hg remove large1
303 $ echo largeX > largeX
305 $ echo largeX > largeX
304 $ hg add --large largeX
306 $ hg add --large largeX
305 $ hg commit -m '#4'
307 $ hg commit -m '#4'
306
308
307 $ hg rebase -s 1 -d 2 --keep
309 $ hg rebase -s 1 -d 2 --keep
308 rebasing 1:72518492caa6 "#1"
310 rebasing 1:72518492caa6 "#1"
309 rebasing 4:07d6153b5c04 "#4" (tip)
311 rebasing 4:07d6153b5c04 "#4" (tip)
310 #if windows
312 #if windows
311 $ hg status -A large1
313 $ hg status -A large1
312 large1: * (glob)
314 large1: * (glob)
313 #else
315 #else
314 $ hg status -A large1
316 $ hg status -A large1
315 large1: No such file or directory
317 large1: No such file or directory
316 #endif
318 #endif
317 $ hg status -A largeX
319 $ hg status -A largeX
318 C largeX
320 C largeX
319 $ hg strip -q 5
321 $ hg strip -q 5
320
322
321 $ hg update -q -C 2
323 $ hg update -q -C 2
322 $ hg transplant -q 1 4
324 $ hg transplant -q 1 4
323 #if windows
325 #if windows
324 $ hg status -A large1
326 $ hg status -A large1
325 large1: * (glob)
327 large1: * (glob)
326 #else
328 #else
327 $ hg status -A large1
329 $ hg status -A large1
328 large1: No such file or directory
330 large1: No such file or directory
329 #endif
331 #endif
330 $ hg status -A largeX
332 $ hg status -A largeX
331 C largeX
333 C largeX
332 $ hg strip -q 5
334 $ hg strip -q 5
333
335
334 $ hg update -q -C 2
336 $ hg update -q -C 2
335 $ hg transplant -q --merge 1 --merge 4
337 $ hg transplant -q --merge 1 --merge 4
336 #if windows
338 #if windows
337 $ hg status -A large1
339 $ hg status -A large1
338 large1: * (glob)
340 large1: * (glob)
339 #else
341 #else
340 $ hg status -A large1
342 $ hg status -A large1
341 large1: No such file or directory
343 large1: No such file or directory
342 #endif
344 #endif
343 $ hg status -A largeX
345 $ hg status -A largeX
344 C largeX
346 C largeX
345 $ hg strip -q 5
347 $ hg strip -q 5
346
348
347 Test that linear merge can detect modification (and conflict) correctly
349 Test that linear merge can detect modification (and conflict) correctly
348
350
349 (linear merge without conflict)
351 (linear merge without conflict)
350
352
351 $ echo 'large2 for linear merge (no conflict)' > large2
353 $ echo 'large2 for linear merge (no conflict)' > large2
352 $ hg update 3 --config debug.dirstate.delaywrite=2
354 $ hg update 3 --config debug.dirstate.delaywrite=2
353 getting changed largefiles
355 getting changed largefiles
354 1 largefiles updated, 0 removed
356 1 largefiles updated, 0 removed
355 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
357 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
356 $ hg status -A large2
358 $ hg status -A large2
357 M large2
359 M large2
358 $ cat large2
360 $ cat large2
359 large2 for linear merge (no conflict)
361 large2 for linear merge (no conflict)
360 $ cat .hglf/large2
362 $ cat .hglf/large2
361 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
363 9c4bf8f1b33536d6e5f89447e10620cfe52ea710
362
364
363 (linear merge with conflict, choosing "other")
365 (linear merge with conflict, choosing "other")
364
366
365 $ hg update -q -C 2
367 $ hg update -q -C 2
366 $ echo 'large1 for linear merge (conflict)' > large1
368 $ echo 'large1 for linear merge (conflict)' > large1
367 $ hg update 3 --config ui.interactive=True <<EOF
369 $ hg update 3 --config ui.interactive=True <<EOF
368 > o
370 > o
369 > EOF
371 > EOF
370 largefile large1 has a merge conflict
372 largefile large1 has a merge conflict
371 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
373 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
372 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
374 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
373 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
375 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o
374 getting changed largefiles
376 getting changed largefiles
375 1 largefiles updated, 0 removed
377 1 largefiles updated, 0 removed
376 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
378 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
377 $ hg status -A large1
379 $ hg status -A large1
378 C large1
380 C large1
379 $ cat large1
381 $ cat large1
380 large1 in #3
382 large1 in #3
381 $ cat .hglf/large1
383 $ cat .hglf/large1
382 e5bb990443d6a92aaf7223813720f7566c9dd05b
384 e5bb990443d6a92aaf7223813720f7566c9dd05b
383
385
384 (linear merge with conflict, choosing "local")
386 (linear merge with conflict, choosing "local")
385
387
386 $ hg update -q -C 2
388 $ hg update -q -C 2
387 $ echo 'large1 for linear merge (conflict)' > large1
389 $ echo 'large1 for linear merge (conflict)' > large1
388 $ hg update 3 --config debug.dirstate.delaywrite=2
390 $ hg update 3 --config debug.dirstate.delaywrite=2
389 largefile large1 has a merge conflict
391 largefile large1 has a merge conflict
390 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
392 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
391 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
393 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
392 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
394 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
393 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
395 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
394 $ hg status -A large1
396 $ hg status -A large1
395 M large1
397 M large1
396 $ cat large1
398 $ cat large1
397 large1 for linear merge (conflict)
399 large1 for linear merge (conflict)
398 $ cat .hglf/large1
400 $ cat .hglf/large1
399 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
401 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
400
402
401 Test a linear merge to a revision containing same-name normal file
403 Test a linear merge to a revision containing same-name normal file
402
404
403 $ hg update -q -C 3
405 $ hg update -q -C 3
404 $ hg remove large2
406 $ hg remove large2
405 $ echo 'large2 as normal file' > large2
407 $ echo 'large2 as normal file' > large2
406 $ hg add large2
408 $ hg add large2
407 $ echo 'large3 as normal file' > large3
409 $ echo 'large3 as normal file' > large3
408 $ hg add large3
410 $ hg add large3
409 $ hg commit -m '#5'
411 $ hg commit -m '#5'
410 $ hg manifest
412 $ hg manifest
411 .hglf/large1
413 .hglf/large1
412 large2
414 large2
413 large3
415 large3
414 normal1
416 normal1
415
417
416 (modified largefile is already switched to normal)
418 (modified largefile is already switched to normal)
417
419
418 $ hg update -q -C 2
420 $ hg update -q -C 2
419 $ echo 'modified large2 for linear merge' > large2
421 $ echo 'modified large2 for linear merge' > large2
420 $ hg update -q 5
422 $ hg update -q 5
421 remote turned local largefile large2 into a normal file
423 remote turned local largefile large2 into a normal file
422 keep (l)argefile or use (n)ormal file? l
424 keep (l)argefile or use (n)ormal file? l
423 $ hg debugdirstate --nodates | grep large2
425 $ hg debugdirstate --nodates | grep large2
424 a 0 -1 unset .hglf/large2
426 a 0 -1 unset .hglf/large2
425 r 0 0 set large2
427 r 0 0 set large2
426 $ hg status -A large2
428 $ hg status -A large2
427 A large2
429 A large2
428 $ cat large2
430 $ cat large2
429 modified large2 for linear merge
431 modified large2 for linear merge
430
432
431 (added largefile is already committed as normal)
433 (added largefile is already committed as normal)
432
434
433 $ hg update -q -C 2
435 $ hg update -q -C 2
434 $ echo 'large3 as large file for linear merge' > large3
436 $ echo 'large3 as large file for linear merge' > large3
435 $ hg add --large large3
437 $ hg add --large large3
436 $ hg update -q 5
438 $ hg update -q 5
437 remote turned local largefile large3 into a normal file
439 remote turned local largefile large3 into a normal file
438 keep (l)argefile or use (n)ormal file? l
440 keep (l)argefile or use (n)ormal file? l
439 $ hg debugdirstate --nodates | grep large3
441 $ hg debugdirstate --nodates | grep large3
440 a 0 -1 unset .hglf/large3
442 a 0 -1 unset .hglf/large3
441 r 0 0 set large3
443 r 0 0 set large3
442 $ hg status -A large3
444 $ hg status -A large3
443 A large3
445 A large3
444 $ cat large3
446 $ cat large3
445 large3 as large file for linear merge
447 large3 as large file for linear merge
446 $ rm -f large3 .hglf/large3
448 $ rm -f large3 .hglf/large3
447
449
448 Test that the internal linear merging works correctly
450 Test that the internal linear merging works correctly
449 (both heads are stripped to keep pairing of revision number and commit log)
451 (both heads are stripped to keep pairing of revision number and commit log)
450
452
451 $ hg update -q -C 2
453 $ hg update -q -C 2
452 $ hg strip 3 4
454 $ hg strip 3 4
453 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
455 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg (glob)
454 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
456 $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP
455
457
456 (internal linear merging at "hg pull --update")
458 (internal linear merging at "hg pull --update")
457
459
458 $ echo 'large1 for linear merge (conflict)' > large1
460 $ echo 'large1 for linear merge (conflict)' > large1
459 $ echo 'large2 for linear merge (conflict with normal file)' > large2
461 $ echo 'large2 for linear merge (conflict with normal file)' > large2
460 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
462 $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
461 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
463 pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg (glob)
462 searching for changes
464 searching for changes
463 adding changesets
465 adding changesets
464 adding manifests
466 adding manifests
465 adding file changes
467 adding file changes
466 added 3 changesets with 5 changes to 5 files
468 added 3 changesets with 5 changes to 5 files
467 remote turned local largefile large2 into a normal file
469 remote turned local largefile large2 into a normal file
468 keep (l)argefile or use (n)ormal file? l
470 keep (l)argefile or use (n)ormal file? l
469 largefile large1 has a merge conflict
471 largefile large1 has a merge conflict
470 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
472 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
471 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
473 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
472 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
474 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
473 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
475 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
476 updated to "d65e59e952a9: #5"
474 1 other heads for branch "default"
477 1 other heads for branch "default"
475
478
476 $ hg status -A large1
479 $ hg status -A large1
477 M large1
480 M large1
478 $ cat large1
481 $ cat large1
479 large1 for linear merge (conflict)
482 large1 for linear merge (conflict)
480 $ cat .hglf/large1
483 $ cat .hglf/large1
481 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
484 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
482 $ hg status -A large2
485 $ hg status -A large2
483 A large2
486 A large2
484 $ cat large2
487 $ cat large2
485 large2 for linear merge (conflict with normal file)
488 large2 for linear merge (conflict with normal file)
486 $ cat .hglf/large2
489 $ cat .hglf/large2
487 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
490 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
488
491
489 (internal linear merging at "hg unbundle --update")
492 (internal linear merging at "hg unbundle --update")
490
493
491 $ hg update -q -C 2
494 $ hg update -q -C 2
492 $ hg rollback -q
495 $ hg rollback -q
493
496
494 $ echo 'large1 for linear merge (conflict)' > large1
497 $ echo 'large1 for linear merge (conflict)' > large1
495 $ echo 'large2 for linear merge (conflict with normal file)' > large2
498 $ echo 'large2 for linear merge (conflict with normal file)' > large2
496 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
499 $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg
497 adding changesets
500 adding changesets
498 adding manifests
501 adding manifests
499 adding file changes
502 adding file changes
500 added 3 changesets with 5 changes to 5 files
503 added 3 changesets with 5 changes to 5 files
501 remote turned local largefile large2 into a normal file
504 remote turned local largefile large2 into a normal file
502 keep (l)argefile or use (n)ormal file? l
505 keep (l)argefile or use (n)ormal file? l
503 largefile large1 has a merge conflict
506 largefile large1 has a merge conflict
504 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
507 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
505 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
508 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
506 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
509 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
507 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
510 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
511 updated to "d65e59e952a9: #5"
508 1 other heads for branch "default"
512 1 other heads for branch "default"
509
513
510 $ hg status -A large1
514 $ hg status -A large1
511 M large1
515 M large1
512 $ cat large1
516 $ cat large1
513 large1 for linear merge (conflict)
517 large1 for linear merge (conflict)
514 $ cat .hglf/large1
518 $ cat .hglf/large1
515 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
519 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
516 $ hg status -A large2
520 $ hg status -A large2
517 A large2
521 A large2
518 $ cat large2
522 $ cat large2
519 large2 for linear merge (conflict with normal file)
523 large2 for linear merge (conflict with normal file)
520 $ cat .hglf/large2
524 $ cat .hglf/large2
521 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
525 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
522
526
523 (internal linear merging in subrepo at "hg update")
527 (internal linear merging in subrepo at "hg update")
524
528
525 $ cd ..
529 $ cd ..
526 $ hg init subparent
530 $ hg init subparent
527 $ cd subparent
531 $ cd subparent
528
532
529 $ hg clone -q -u 2 ../repo sub
533 $ hg clone -q -u 2 ../repo sub
530 $ cat > .hgsub <<EOF
534 $ cat > .hgsub <<EOF
531 > sub = sub
535 > sub = sub
532 > EOF
536 > EOF
533 $ hg add .hgsub
537 $ hg add .hgsub
534 $ hg commit -m '#0@parent'
538 $ hg commit -m '#0@parent'
535 $ cat .hgsubstate
539 $ cat .hgsubstate
536 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
540 f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub
537 $ hg -R sub update -q
541 $ hg -R sub update -q
538 $ hg commit -m '#1@parent'
542 $ hg commit -m '#1@parent'
539 $ cat .hgsubstate
543 $ cat .hgsubstate
540 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
544 d65e59e952a9638e2ce863b41a420ca723dd3e8d sub
541 $ hg update -q 0
545 $ hg update -q 0
542
546
543 $ echo 'large1 for linear merge (conflict)' > sub/large1
547 $ echo 'large1 for linear merge (conflict)' > sub/large1
544 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
548 $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2
545 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
549 $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF
546 > m
550 > m
547 > r
551 > r
548 > l
552 > l
549 > l
553 > l
550 > EOF
554 > EOF
551 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
555 subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
552 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
556 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
553 subrepository sources for sub differ (in checked out version)
557 subrepository sources for sub differ (in checked out version)
554 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
558 use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
555 remote turned local largefile large2 into a normal file
559 remote turned local largefile large2 into a normal file
556 keep (l)argefile or use (n)ormal file? l
560 keep (l)argefile or use (n)ormal file? l
557 largefile large1 has a merge conflict
561 largefile large1 has a merge conflict
558 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
562 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
559 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
563 keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or
560 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
564 take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l
561 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
565 2 files updated, 1 files merged, 0 files removed, 0 files unresolved
562 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
563
567
564 $ hg -R sub status -A sub/large1
568 $ hg -R sub status -A sub/large1
565 M sub/large1
569 M sub/large1
566 $ cat sub/large1
570 $ cat sub/large1
567 large1 for linear merge (conflict)
571 large1 for linear merge (conflict)
568 $ cat sub/.hglf/large1
572 $ cat sub/.hglf/large1
569 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
573 ba94c2efe5b7c5e0af8d189295ce00553b0612b7
570 $ hg -R sub status -A sub/large2
574 $ hg -R sub status -A sub/large2
571 A sub/large2
575 A sub/large2
572 $ cat sub/large2
576 $ cat sub/large2
573 large2 for linear merge (conflict with normal file)
577 large2 for linear merge (conflict with normal file)
574 $ cat sub/.hglf/large2
578 $ cat sub/.hglf/large2
575 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
579 d7591fe9be0f6227d90bddf3e4f52ff41fc1f544
576
580
577 $ cd ..
581 $ cd ..
578 $ cd repo
582 $ cd repo
579
583
580 Test that rebase updates largefiles in the working directory even if
584 Test that rebase updates largefiles in the working directory even if
581 it is aborted by conflict.
585 it is aborted by conflict.
582
586
583 $ hg update -q -C 3
587 $ hg update -q -C 3
584 $ cat .hglf/large1
588 $ cat .hglf/large1
585 e5bb990443d6a92aaf7223813720f7566c9dd05b
589 e5bb990443d6a92aaf7223813720f7566c9dd05b
586 $ cat large1
590 $ cat large1
587 large1 in #3
591 large1 in #3
588 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
592 $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF
589 > o
593 > o
590 > EOF
594 > EOF
591 rebasing 1:72518492caa6 "#1"
595 rebasing 1:72518492caa6 "#1"
592 largefile large1 has a merge conflict
596 largefile large1 has a merge conflict
593 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
597 ancestor was 4669e532d5b2c093a78eca010077e708a071bb64
594 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
598 keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or
595 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
599 take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o
596 merging normal1
600 merging normal1
597 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
601 warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark')
598 unresolved conflicts (see hg resolve, then hg rebase --continue)
602 unresolved conflicts (see hg resolve, then hg rebase --continue)
599 [1]
603 [1]
600 $ cat .hglf/large1
604 $ cat .hglf/large1
601 58e24f733a964da346e2407a2bee99d9001184f5
605 58e24f733a964da346e2407a2bee99d9001184f5
602 $ cat large1
606 $ cat large1
603 large1 in #1
607 large1 in #1
604 $ rm normal1.orig
608 $ rm normal1.orig
605
609
606 Test that rebase updates standins for manually modified largefiles at
610 Test that rebase updates standins for manually modified largefiles at
607 the 1st commit of resuming.
611 the 1st commit of resuming.
608
612
609 $ echo "manually modified before 'hg rebase --continue'" > large1
613 $ echo "manually modified before 'hg rebase --continue'" > large1
610 $ hg resolve -m normal1
614 $ hg resolve -m normal1
611 (no more unresolved files)
615 (no more unresolved files)
612 continue: hg rebase --continue
616 continue: hg rebase --continue
613 $ hg rebase --continue --config ui.interactive=True <<EOF
617 $ hg rebase --continue --config ui.interactive=True <<EOF
614 > c
618 > c
615 > EOF
619 > EOF
616 rebasing 1:72518492caa6 "#1"
620 rebasing 1:72518492caa6 "#1"
617 rebasing 4:07d6153b5c04 "#4"
621 rebasing 4:07d6153b5c04 "#4"
618 local [dest] changed .hglf/large1 which other [source] deleted
622 local [dest] changed .hglf/large1 which other [source] deleted
619 use (c)hanged version, (d)elete, or leave (u)nresolved? c
623 use (c)hanged version, (d)elete, or leave (u)nresolved? c
620
624
621 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
625 $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]'
622 -e5bb990443d6a92aaf7223813720f7566c9dd05b
626 -e5bb990443d6a92aaf7223813720f7566c9dd05b
623 +8a4f783556e7dea21139ca0466eafce954c75c13
627 +8a4f783556e7dea21139ca0466eafce954c75c13
624 $ rm -f large1
628 $ rm -f large1
625 $ hg update -q -C tip
629 $ hg update -q -C tip
626 $ cat large1
630 $ cat large1
627 manually modified before 'hg rebase --continue'
631 manually modified before 'hg rebase --continue'
628
632
629 Test that transplant updates largefiles, of which standins are safely
633 Test that transplant updates largefiles, of which standins are safely
630 changed, even if it is aborted by conflict of other.
634 changed, even if it is aborted by conflict of other.
631
635
632 $ hg update -q -C 5
636 $ hg update -q -C 5
633 $ cat .hglf/large1
637 $ cat .hglf/large1
634 e5bb990443d6a92aaf7223813720f7566c9dd05b
638 e5bb990443d6a92aaf7223813720f7566c9dd05b
635 $ cat large1
639 $ cat large1
636 large1 in #3
640 large1 in #3
637 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
641 $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]'
638 +fa44618ea25181aff4f48b70428294790cec9f61
642 +fa44618ea25181aff4f48b70428294790cec9f61
639 $ hg transplant 4
643 $ hg transplant 4
640 applying 07d6153b5c04
644 applying 07d6153b5c04
641 patching file .hglf/large1
645 patching file .hglf/large1
642 Hunk #1 FAILED at 0
646 Hunk #1 FAILED at 0
643 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
647 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej
644 patch failed to apply
648 patch failed to apply
645 abort: fix up the working directory and run hg transplant --continue
649 abort: fix up the working directory and run hg transplant --continue
646 [255]
650 [255]
647 $ hg status -A large1
651 $ hg status -A large1
648 C large1
652 C large1
649 $ cat .hglf/large1
653 $ cat .hglf/large1
650 e5bb990443d6a92aaf7223813720f7566c9dd05b
654 e5bb990443d6a92aaf7223813720f7566c9dd05b
651 $ cat large1
655 $ cat large1
652 large1 in #3
656 large1 in #3
653 $ hg status -A largeX
657 $ hg status -A largeX
654 A largeX
658 A largeX
655 $ cat .hglf/largeX
659 $ cat .hglf/largeX
656 fa44618ea25181aff4f48b70428294790cec9f61
660 fa44618ea25181aff4f48b70428294790cec9f61
657 $ cat largeX
661 $ cat largeX
658 largeX
662 largeX
659
663
660 Test that transplant updates standins for manually modified largefiles
664 Test that transplant updates standins for manually modified largefiles
661 at the 1st commit of resuming.
665 at the 1st commit of resuming.
662
666
663 $ echo "manually modified before 'hg transplant --continue'" > large1
667 $ echo "manually modified before 'hg transplant --continue'" > large1
664 $ hg transplant --continue
668 $ hg transplant --continue
665 07d6153b5c04 transplanted as f1bf30eb88cc
669 07d6153b5c04 transplanted as f1bf30eb88cc
666 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
670 $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]'
667 -e5bb990443d6a92aaf7223813720f7566c9dd05b
671 -e5bb990443d6a92aaf7223813720f7566c9dd05b
668 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
672 +6a4f36d4075fbe0f30ec1d26ca44e63c05903671
669 $ rm -f large1
673 $ rm -f large1
670 $ hg update -q -C tip
674 $ hg update -q -C tip
671 $ cat large1
675 $ cat large1
672 manually modified before 'hg transplant --continue'
676 manually modified before 'hg transplant --continue'
673
677
674 Test that "hg status" doesn't show removal of largefiles not managed
678 Test that "hg status" doesn't show removal of largefiles not managed
675 in the target context.
679 in the target context.
676
680
677 $ hg update -q -C 4
681 $ hg update -q -C 4
678 $ hg remove largeX
682 $ hg remove largeX
679 $ hg status -A largeX
683 $ hg status -A largeX
680 R largeX
684 R largeX
681 $ hg status -A --rev '.^1' largeX
685 $ hg status -A --rev '.^1' largeX
682
686
683 #if execbit
687 #if execbit
684
688
685 Test that "hg status" against revisions other than parent notices exec
689 Test that "hg status" against revisions other than parent notices exec
686 bit changes of largefiles.
690 bit changes of largefiles.
687
691
688 $ hg update -q -C 4
692 $ hg update -q -C 4
689
693
690 (the case that large2 doesn't have exec bit in the target context but
694 (the case that large2 doesn't have exec bit in the target context but
691 in the working context)
695 in the working context)
692
696
693 $ chmod +x large2
697 $ chmod +x large2
694 $ hg status -A --rev 0 large2
698 $ hg status -A --rev 0 large2
695 M large2
699 M large2
696 $ hg commit -m 'chmod +x large2'
700 $ hg commit -m 'chmod +x large2'
697
701
698 (the case that large2 has exec bit in the target context but not in
702 (the case that large2 has exec bit in the target context but not in
699 the working context)
703 the working context)
700
704
701 $ echo dummy > dummy
705 $ echo dummy > dummy
702 $ hg add dummy
706 $ hg add dummy
703 $ hg commit -m 'revision for separation'
707 $ hg commit -m 'revision for separation'
704 $ chmod -x large2
708 $ chmod -x large2
705 $ hg status -A --rev '.^1' large2
709 $ hg status -A --rev '.^1' large2
706 M large2
710 M large2
707
711
708 #else
712 #else
709
713
710 Test that "hg status" against revisions other than parent ignores exec
714 Test that "hg status" against revisions other than parent ignores exec
711 bit correctly on the platform being unaware of it.
715 bit correctly on the platform being unaware of it.
712
716
713 $ hg update -q -C 4
717 $ hg update -q -C 4
714
718
715 $ cat > ../exec-bit.patch <<EOF
719 $ cat > ../exec-bit.patch <<EOF
716 > # HG changeset patch
720 > # HG changeset patch
717 > # User test
721 > # User test
718 > # Date 0 0
722 > # Date 0 0
719 > # Thu Jan 01 00:00:00 1970 +0000
723 > # Thu Jan 01 00:00:00 1970 +0000
720 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
724 > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90
721 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
725 > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727
722 > chmod +x large2
726 > chmod +x large2
723 >
727 >
724 > diff --git a/.hglf/large2 b/.hglf/large2
728 > diff --git a/.hglf/large2 b/.hglf/large2
725 > old mode 100644
729 > old mode 100644
726 > new mode 100755
730 > new mode 100755
727 > EOF
731 > EOF
728 $ hg import --exact --bypass ../exec-bit.patch
732 $ hg import --exact --bypass ../exec-bit.patch
729 applying ../exec-bit.patch
733 applying ../exec-bit.patch
730 $ hg status -A --rev tip large2
734 $ hg status -A --rev tip large2
731 C large2
735 C large2
732
736
733 #endif
737 #endif
734
738
735 Test a fatal error interrupting an update. Verify that status report dirty
739 Test a fatal error interrupting an update. Verify that status report dirty
736 files correctly after an interrupted update. Also verify that checking all
740 files correctly after an interrupted update. Also verify that checking all
737 hashes reveals it isn't clean.
741 hashes reveals it isn't clean.
738
742
739 Start with clean dirstates:
743 Start with clean dirstates:
740 $ hg up --quiet --clean --rev "8^"
744 $ hg up --quiet --clean --rev "8^"
741 $ sleep 1
745 $ sleep 1
742 $ hg st
746 $ hg st
743 Update standins without updating largefiles - large1 is modified and largeX is
747 Update standins without updating largefiles - large1 is modified and largeX is
744 added:
748 added:
745 $ cat << EOF > ../crashupdatelfiles.py
749 $ cat << EOF > ../crashupdatelfiles.py
746 > import hgext.largefiles.lfutil
750 > import hgext.largefiles.lfutil
747 > def getlfilestoupdate(oldstandins, newstandins):
751 > def getlfilestoupdate(oldstandins, newstandins):
748 > raise SystemExit(7)
752 > raise SystemExit(7)
749 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
753 > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate
750 > EOF
754 > EOF
751 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
755 $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py
752 [7]
756 [7]
753 Check large1 content and status ... and that update will undo modifications:
757 Check large1 content and status ... and that update will undo modifications:
754 $ cat large1
758 $ cat large1
755 large1 in #3
759 large1 in #3
756 $ hg st
760 $ hg st
757 M large1
761 M large1
758 ! largeX
762 ! largeX
759 $ hg up -Cr .
763 $ hg up -Cr .
760 getting changed largefiles
764 getting changed largefiles
761 2 largefiles updated, 0 removed
765 2 largefiles updated, 0 removed
762 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
766 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
763 $ cat large1
767 $ cat large1
764 manually modified before 'hg transplant --continue'
768 manually modified before 'hg transplant --continue'
765 $ hg st
769 $ hg st
766 Force largefiles rehashing and check that all changes have been caught by
770 Force largefiles rehashing and check that all changes have been caught by
767 status and update:
771 status and update:
768 $ rm .hg/largefiles/dirstate
772 $ rm .hg/largefiles/dirstate
769 $ hg st
773 $ hg st
770
774
771 $ cd ..
775 $ cd ..
772
776
773 Test that "hg convert" avoids copying largefiles from the working
777 Test that "hg convert" avoids copying largefiles from the working
774 directory into store, because "hg convert" doesn't update largefiles
778 directory into store, because "hg convert" doesn't update largefiles
775 in the working directory (removing files under ".cache/largefiles"
779 in the working directory (removing files under ".cache/largefiles"
776 forces "hg convert" to copy corresponding largefiles)
780 forces "hg convert" to copy corresponding largefiles)
777
781
778 $ cat >> $HGRCPATH <<EOF
782 $ cat >> $HGRCPATH <<EOF
779 > [extensions]
783 > [extensions]
780 > convert =
784 > convert =
781 > EOF
785 > EOF
782
786
783 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
787 $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671
784 $ hg convert -q repo repo.converted
788 $ hg convert -q repo repo.converted
@@ -1,1086 +1,1095
1 Tests for change/delete conflicts, including:
1 Tests for change/delete conflicts, including:
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 (issue897)
3 (issue897)
4
4
5 840e2b315c1f: Fix misleading error and prompts during update/merge
5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 (issue556)
6 (issue556)
7
7
8 Make sure HGMERGE doesn't interfere with the test
8 Make sure HGMERGE doesn't interfere with the test
9 $ unset HGMERGE
9 $ unset HGMERGE
10
10
11 $ status() {
11 $ status() {
12 > echo "--- status ---"
12 > echo "--- status ---"
13 > hg st -A file1 file2 file3
13 > hg st -A file1 file2 file3
14 > echo "--- resolve --list ---"
14 > echo "--- resolve --list ---"
15 > hg resolve --list file1 file2 file3
15 > hg resolve --list file1 file2 file3
16 > echo "--- debugmergestate ---"
16 > echo "--- debugmergestate ---"
17 > hg debugmergestate
17 > hg debugmergestate
18 > for file in file1 file2 file3; do
18 > for file in file1 file2 file3; do
19 > if [ -f $file ]; then
19 > if [ -f $file ]; then
20 > echo "--- $file ---"
20 > echo "--- $file ---"
21 > cat $file
21 > cat $file
22 > else
22 > else
23 > echo "*** $file does not exist"
23 > echo "*** $file does not exist"
24 > fi
24 > fi
25 > done
25 > done
26 > }
26 > }
27
27
28 $ hg init repo
28 $ hg init repo
29 $ cd repo
29 $ cd repo
30
30
31 $ echo 1 > file1
31 $ echo 1 > file1
32 $ echo 2 > file2
32 $ echo 2 > file2
33 $ echo 3 > file3
33 $ echo 3 > file3
34 $ hg ci -Am 'added files'
34 $ hg ci -Am 'added files'
35 adding file1
35 adding file1
36 adding file2
36 adding file2
37 adding file3
37 adding file3
38
38
39 $ hg rm file1
39 $ hg rm file1
40 $ echo changed >> file2
40 $ echo changed >> file2
41 $ echo changed1 >> file3
41 $ echo changed1 >> file3
42 $ hg ci -m 'removed file1, changed file2, changed file3'
42 $ hg ci -m 'removed file1, changed file2, changed file3'
43
43
44 $ hg co 0
44 $ hg co 0
45 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
46
46
47 $ echo changed >> file1
47 $ echo changed >> file1
48 $ hg rm file2
48 $ hg rm file2
49 $ echo changed2 >> file3
49 $ echo changed2 >> file3
50 $ hg ci -m 'changed file1, removed file2, changed file3'
50 $ hg ci -m 'changed file1, removed file2, changed file3'
51 created new head
51 created new head
52
52
53
53
54 Non-interactive merge:
54 Non-interactive merge:
55
55
56 $ hg merge -y
56 $ hg merge -y
57 local [working copy] changed file1 which other [merge rev] deleted
57 local [working copy] changed file1 which other [merge rev] deleted
58 use (c)hanged version, (d)elete, or leave (u)nresolved? u
58 use (c)hanged version, (d)elete, or leave (u)nresolved? u
59 other [merge rev] changed file2 which local [working copy] deleted
59 other [merge rev] changed file2 which local [working copy] deleted
60 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
60 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
61 merging file3
61 merging file3
62 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
62 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
63 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
63 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
64 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
64 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
65 [1]
65 [1]
66
66
67 $ status
67 $ status
68 --- status ---
68 --- status ---
69 M file2
69 M file2
70 M file3
70 M file3
71 C file1
71 C file1
72 --- resolve --list ---
72 --- resolve --list ---
73 U file1
73 U file1
74 U file2
74 U file2
75 U file3
75 U file3
76 --- debugmergestate ---
76 --- debugmergestate ---
77 * version 2 records
77 * version 2 records
78 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
78 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
79 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
79 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
80 labels:
80 labels:
81 local: working copy
81 local: working copy
82 other: merge rev
82 other: merge rev
83 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
83 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
84 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
84 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
85 local path: file1 (flags "")
85 local path: file1 (flags "")
86 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
86 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
87 other path: file1 (node null)
87 other path: file1 (node null)
88 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
88 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
89 file: file2 (record type "C", state "u", hash null)
89 file: file2 (record type "C", state "u", hash null)
90 local path: file2 (flags "")
90 local path: file2 (flags "")
91 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
91 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
92 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
92 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
93 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
93 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
94 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
94 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
95 local path: file3 (flags "")
95 local path: file3 (flags "")
96 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
96 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
97 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
97 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
98 --- file1 ---
98 --- file1 ---
99 1
99 1
100 changed
100 changed
101 --- file2 ---
101 --- file2 ---
102 2
102 2
103 changed
103 changed
104 --- file3 ---
104 --- file3 ---
105 3
105 3
106 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
106 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
107 changed2
107 changed2
108 =======
108 =======
109 changed1
109 changed1
110 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
110 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
111
111
112
112
113 Interactive merge:
113 Interactive merge:
114
114
115 $ hg co -C
115 $ hg co -C
116 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
116 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
117 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
117 1 other heads for branch "default"
118 1 other heads for branch "default"
118
119
119 $ hg merge --config ui.interactive=true <<EOF
120 $ hg merge --config ui.interactive=true <<EOF
120 > c
121 > c
121 > d
122 > d
122 > EOF
123 > EOF
123 local [working copy] changed file1 which other [merge rev] deleted
124 local [working copy] changed file1 which other [merge rev] deleted
124 use (c)hanged version, (d)elete, or leave (u)nresolved? c
125 use (c)hanged version, (d)elete, or leave (u)nresolved? c
125 other [merge rev] changed file2 which local [working copy] deleted
126 other [merge rev] changed file2 which local [working copy] deleted
126 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
127 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
127 merging file3
128 merging file3
128 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
129 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
129 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
130 0 files updated, 2 files merged, 0 files removed, 1 files unresolved
130 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
131 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
131 [1]
132 [1]
132
133
133 $ status
134 $ status
134 --- status ---
135 --- status ---
135 file2: * (glob)
136 file2: * (glob)
136 M file3
137 M file3
137 C file1
138 C file1
138 --- resolve --list ---
139 --- resolve --list ---
139 R file1
140 R file1
140 R file2
141 R file2
141 U file3
142 U file3
142 --- debugmergestate ---
143 --- debugmergestate ---
143 * version 2 records
144 * version 2 records
144 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
145 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
145 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
146 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
146 labels:
147 labels:
147 local: working copy
148 local: working copy
148 other: merge rev
149 other: merge rev
149 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
150 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
150 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
151 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
151 local path: file1 (flags "")
152 local path: file1 (flags "")
152 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
153 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
153 other path: file1 (node null)
154 other path: file1 (node null)
154 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
155 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
155 file: file2 (record type "C", state "r", hash null)
156 file: file2 (record type "C", state "r", hash null)
156 local path: file2 (flags "")
157 local path: file2 (flags "")
157 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
158 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
158 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
159 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
159 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
160 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
160 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
161 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
161 local path: file3 (flags "")
162 local path: file3 (flags "")
162 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
163 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
163 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
164 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
164 --- file1 ---
165 --- file1 ---
165 1
166 1
166 changed
167 changed
167 *** file2 does not exist
168 *** file2 does not exist
168 --- file3 ---
169 --- file3 ---
169 3
170 3
170 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
171 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
171 changed2
172 changed2
172 =======
173 =======
173 changed1
174 changed1
174 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
175 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
175
176
176
177
177 Interactive merge with bad input:
178 Interactive merge with bad input:
178
179
179 $ hg co -C
180 $ hg co -C
180 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
181 1 other heads for branch "default"
183 1 other heads for branch "default"
182
184
183 $ hg merge --config ui.interactive=true <<EOF
185 $ hg merge --config ui.interactive=true <<EOF
184 > foo
186 > foo
185 > bar
187 > bar
186 > d
188 > d
187 > baz
189 > baz
188 > c
190 > c
189 > EOF
191 > EOF
190 local [working copy] changed file1 which other [merge rev] deleted
192 local [working copy] changed file1 which other [merge rev] deleted
191 use (c)hanged version, (d)elete, or leave (u)nresolved? foo
193 use (c)hanged version, (d)elete, or leave (u)nresolved? foo
192 unrecognized response
194 unrecognized response
193 local [working copy] changed file1 which other [merge rev] deleted
195 local [working copy] changed file1 which other [merge rev] deleted
194 use (c)hanged version, (d)elete, or leave (u)nresolved? bar
196 use (c)hanged version, (d)elete, or leave (u)nresolved? bar
195 unrecognized response
197 unrecognized response
196 local [working copy] changed file1 which other [merge rev] deleted
198 local [working copy] changed file1 which other [merge rev] deleted
197 use (c)hanged version, (d)elete, or leave (u)nresolved? d
199 use (c)hanged version, (d)elete, or leave (u)nresolved? d
198 other [merge rev] changed file2 which local [working copy] deleted
200 other [merge rev] changed file2 which local [working copy] deleted
199 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz
201 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? baz
200 unrecognized response
202 unrecognized response
201 other [merge rev] changed file2 which local [working copy] deleted
203 other [merge rev] changed file2 which local [working copy] deleted
202 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
204 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? c
203 merging file3
205 merging file3
204 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
206 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
205 0 files updated, 1 files merged, 1 files removed, 1 files unresolved
207 0 files updated, 1 files merged, 1 files removed, 1 files unresolved
206 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
208 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
207 [1]
209 [1]
208
210
209 $ status
211 $ status
210 --- status ---
212 --- status ---
211 M file2
213 M file2
212 M file3
214 M file3
213 R file1
215 R file1
214 --- resolve --list ---
216 --- resolve --list ---
215 R file1
217 R file1
216 R file2
218 R file2
217 U file3
219 U file3
218 --- debugmergestate ---
220 --- debugmergestate ---
219 * version 2 records
221 * version 2 records
220 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
222 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
221 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
223 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
222 labels:
224 labels:
223 local: working copy
225 local: working copy
224 other: merge rev
226 other: merge rev
225 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
227 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
226 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
228 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
227 local path: file1 (flags "")
229 local path: file1 (flags "")
228 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
230 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
229 other path: file1 (node null)
231 other path: file1 (node null)
230 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
232 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
231 file: file2 (record type "C", state "r", hash null)
233 file: file2 (record type "C", state "r", hash null)
232 local path: file2 (flags "")
234 local path: file2 (flags "")
233 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
235 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
234 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
236 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
235 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
237 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
236 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
238 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
237 local path: file3 (flags "")
239 local path: file3 (flags "")
238 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
240 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
239 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
241 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
240 *** file1 does not exist
242 *** file1 does not exist
241 --- file2 ---
243 --- file2 ---
242 2
244 2
243 changed
245 changed
244 --- file3 ---
246 --- file3 ---
245 3
247 3
246 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
248 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
247 changed2
249 changed2
248 =======
250 =======
249 changed1
251 changed1
250 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
252 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
251
253
252
254
253 Interactive merge with not enough input:
255 Interactive merge with not enough input:
254
256
255 $ hg co -C
257 $ hg co -C
256 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
258 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
259 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
257 1 other heads for branch "default"
260 1 other heads for branch "default"
258
261
259 $ hg merge --config ui.interactive=true <<EOF
262 $ hg merge --config ui.interactive=true <<EOF
260 > d
263 > d
261 > EOF
264 > EOF
262 local [working copy] changed file1 which other [merge rev] deleted
265 local [working copy] changed file1 which other [merge rev] deleted
263 use (c)hanged version, (d)elete, or leave (u)nresolved? d
266 use (c)hanged version, (d)elete, or leave (u)nresolved? d
264 other [merge rev] changed file2 which local [working copy] deleted
267 other [merge rev] changed file2 which local [working copy] deleted
265 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
268 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
266 merging file3
269 merging file3
267 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
270 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
268 0 files updated, 0 files merged, 1 files removed, 2 files unresolved
271 0 files updated, 0 files merged, 1 files removed, 2 files unresolved
269 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
272 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
270 [1]
273 [1]
271
274
272 $ status
275 $ status
273 --- status ---
276 --- status ---
274 M file2
277 M file2
275 M file3
278 M file3
276 R file1
279 R file1
277 --- resolve --list ---
280 --- resolve --list ---
278 R file1
281 R file1
279 U file2
282 U file2
280 U file3
283 U file3
281 --- debugmergestate ---
284 --- debugmergestate ---
282 * version 2 records
285 * version 2 records
283 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
286 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
284 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
287 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
285 labels:
288 labels:
286 local: working copy
289 local: working copy
287 other: merge rev
290 other: merge rev
288 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
291 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
289 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
292 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
290 local path: file1 (flags "")
293 local path: file1 (flags "")
291 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
294 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
292 other path: file1 (node null)
295 other path: file1 (node null)
293 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
296 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
294 file: file2 (record type "C", state "u", hash null)
297 file: file2 (record type "C", state "u", hash null)
295 local path: file2 (flags "")
298 local path: file2 (flags "")
296 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
299 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
297 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
300 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
298 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
301 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
299 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
302 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
300 local path: file3 (flags "")
303 local path: file3 (flags "")
301 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
304 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
302 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
305 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
303 *** file1 does not exist
306 *** file1 does not exist
304 --- file2 ---
307 --- file2 ---
305 2
308 2
306 changed
309 changed
307 --- file3 ---
310 --- file3 ---
308 3
311 3
309 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
312 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
310 changed2
313 changed2
311 =======
314 =======
312 changed1
315 changed1
313 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
316 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
314
317
315 Choose local versions of files
318 Choose local versions of files
316
319
317 $ hg co -C
320 $ hg co -C
318 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
321 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
322 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
319 1 other heads for branch "default"
323 1 other heads for branch "default"
320
324
321 $ hg merge --tool :local
325 $ hg merge --tool :local
322 0 files updated, 3 files merged, 0 files removed, 0 files unresolved
326 0 files updated, 3 files merged, 0 files removed, 0 files unresolved
323 (branch merge, don't forget to commit)
327 (branch merge, don't forget to commit)
324 $ status 2>&1 | tee $TESTTMP/local.status
328 $ status 2>&1 | tee $TESTTMP/local.status
325 --- status ---
329 --- status ---
326 file2: * (glob)
330 file2: * (glob)
327 M file3
331 M file3
328 C file1
332 C file1
329 --- resolve --list ---
333 --- resolve --list ---
330 R file1
334 R file1
331 R file2
335 R file2
332 R file3
336 R file3
333 --- debugmergestate ---
337 --- debugmergestate ---
334 * version 2 records
338 * version 2 records
335 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
339 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
336 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
340 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
337 labels:
341 labels:
338 local: working copy
342 local: working copy
339 other: merge rev
343 other: merge rev
340 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
344 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
341 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
345 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
342 local path: file1 (flags "")
346 local path: file1 (flags "")
343 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
347 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
344 other path: file1 (node null)
348 other path: file1 (node null)
345 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
349 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
346 file: file2 (record type "C", state "r", hash null)
350 file: file2 (record type "C", state "r", hash null)
347 local path: file2 (flags "")
351 local path: file2 (flags "")
348 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
352 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
349 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
353 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
350 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
354 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
351 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
355 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
352 local path: file3 (flags "")
356 local path: file3 (flags "")
353 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
357 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
354 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
358 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
355 --- file1 ---
359 --- file1 ---
356 1
360 1
357 changed
361 changed
358 *** file2 does not exist
362 *** file2 does not exist
359 --- file3 ---
363 --- file3 ---
360 3
364 3
361 changed2
365 changed2
362
366
363 Choose other versions of files
367 Choose other versions of files
364
368
365 $ hg co -C
369 $ hg co -C
366 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
370 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
367 1 other heads for branch "default"
372 1 other heads for branch "default"
368
373
369 $ hg merge --tool :other
374 $ hg merge --tool :other
370 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
375 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
371 (branch merge, don't forget to commit)
376 (branch merge, don't forget to commit)
372 $ status 2>&1 | tee $TESTTMP/other.status
377 $ status 2>&1 | tee $TESTTMP/other.status
373 --- status ---
378 --- status ---
374 M file2
379 M file2
375 M file3
380 M file3
376 R file1
381 R file1
377 --- resolve --list ---
382 --- resolve --list ---
378 R file1
383 R file1
379 R file2
384 R file2
380 R file3
385 R file3
381 --- debugmergestate ---
386 --- debugmergestate ---
382 * version 2 records
387 * version 2 records
383 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
388 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
384 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
389 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
385 labels:
390 labels:
386 local: working copy
391 local: working copy
387 other: merge rev
392 other: merge rev
388 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
393 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
389 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
394 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
390 local path: file1 (flags "")
395 local path: file1 (flags "")
391 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
396 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
392 other path: file1 (node null)
397 other path: file1 (node null)
393 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
398 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
394 file: file2 (record type "C", state "r", hash null)
399 file: file2 (record type "C", state "r", hash null)
395 local path: file2 (flags "")
400 local path: file2 (flags "")
396 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
401 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
397 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
402 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
398 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
403 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
399 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
404 file: file3 (record type "F", state "r", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
400 local path: file3 (flags "")
405 local path: file3 (flags "")
401 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
406 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
402 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
407 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
403 *** file1 does not exist
408 *** file1 does not exist
404 --- file2 ---
409 --- file2 ---
405 2
410 2
406 changed
411 changed
407 --- file3 ---
412 --- file3 ---
408 3
413 3
409 changed1
414 changed1
410
415
411 Fail
416 Fail
412
417
413 $ hg co -C
418 $ hg co -C
414 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
419 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
420 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
415 1 other heads for branch "default"
421 1 other heads for branch "default"
416
422
417 $ hg merge --tool :fail
423 $ hg merge --tool :fail
418 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
424 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
419 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
425 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
420 [1]
426 [1]
421 $ status 2>&1 | tee $TESTTMP/fail.status
427 $ status 2>&1 | tee $TESTTMP/fail.status
422 --- status ---
428 --- status ---
423 M file2
429 M file2
424 M file3
430 M file3
425 C file1
431 C file1
426 --- resolve --list ---
432 --- resolve --list ---
427 U file1
433 U file1
428 U file2
434 U file2
429 U file3
435 U file3
430 --- debugmergestate ---
436 --- debugmergestate ---
431 * version 2 records
437 * version 2 records
432 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
438 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
433 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
439 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
434 labels:
440 labels:
435 local: working copy
441 local: working copy
436 other: merge rev
442 other: merge rev
437 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
443 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
438 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
444 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
439 local path: file1 (flags "")
445 local path: file1 (flags "")
440 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
446 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
441 other path: file1 (node null)
447 other path: file1 (node null)
442 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
448 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
443 file: file2 (record type "C", state "u", hash null)
449 file: file2 (record type "C", state "u", hash null)
444 local path: file2 (flags "")
450 local path: file2 (flags "")
445 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
451 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
446 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
452 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
447 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
453 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
448 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
454 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
449 local path: file3 (flags "")
455 local path: file3 (flags "")
450 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
456 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
451 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
457 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
452 --- file1 ---
458 --- file1 ---
453 1
459 1
454 changed
460 changed
455 --- file2 ---
461 --- file2 ---
456 2
462 2
457 changed
463 changed
458 --- file3 ---
464 --- file3 ---
459 3
465 3
460 changed2
466 changed2
461
467
462 Force prompts with no input (should be similar to :fail)
468 Force prompts with no input (should be similar to :fail)
463
469
464 $ hg co -C
470 $ hg co -C
465 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
471 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
472 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
466 1 other heads for branch "default"
473 1 other heads for branch "default"
467
474
468 $ hg merge --config ui.interactive=True --tool :prompt
475 $ hg merge --config ui.interactive=True --tool :prompt
469 local [working copy] changed file1 which other [merge rev] deleted
476 local [working copy] changed file1 which other [merge rev] deleted
470 use (c)hanged version, (d)elete, or leave (u)nresolved?
477 use (c)hanged version, (d)elete, or leave (u)nresolved?
471 other [merge rev] changed file2 which local [working copy] deleted
478 other [merge rev] changed file2 which local [working copy] deleted
472 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
479 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
473 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
480 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
474 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
481 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
475 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
482 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
476 [1]
483 [1]
477 $ status 2>&1 | tee $TESTTMP/prompt.status
484 $ status 2>&1 | tee $TESTTMP/prompt.status
478 --- status ---
485 --- status ---
479 M file2
486 M file2
480 M file3
487 M file3
481 C file1
488 C file1
482 --- resolve --list ---
489 --- resolve --list ---
483 U file1
490 U file1
484 U file2
491 U file2
485 U file3
492 U file3
486 --- debugmergestate ---
493 --- debugmergestate ---
487 * version 2 records
494 * version 2 records
488 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
495 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
489 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
496 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
490 labels:
497 labels:
491 local: working copy
498 local: working copy
492 other: merge rev
499 other: merge rev
493 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
500 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
494 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
501 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
495 local path: file1 (flags "")
502 local path: file1 (flags "")
496 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
503 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
497 other path: file1 (node null)
504 other path: file1 (node null)
498 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
505 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
499 file: file2 (record type "C", state "u", hash null)
506 file: file2 (record type "C", state "u", hash null)
500 local path: file2 (flags "")
507 local path: file2 (flags "")
501 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
508 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
502 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
509 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
503 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
510 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
504 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
511 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
505 local path: file3 (flags "")
512 local path: file3 (flags "")
506 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
513 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
507 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
514 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
508 --- file1 ---
515 --- file1 ---
509 1
516 1
510 changed
517 changed
511 --- file2 ---
518 --- file2 ---
512 2
519 2
513 changed
520 changed
514 --- file3 ---
521 --- file3 ---
515 3
522 3
516 changed2
523 changed2
517 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
524 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
518
525
519
526
520 Force prompts
527 Force prompts
521
528
522 $ hg co -C
529 $ hg co -C
523 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
530 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
531 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
524 1 other heads for branch "default"
532 1 other heads for branch "default"
525
533
526 $ hg merge --tool :prompt
534 $ hg merge --tool :prompt
527 local [working copy] changed file1 which other [merge rev] deleted
535 local [working copy] changed file1 which other [merge rev] deleted
528 use (c)hanged version, (d)elete, or leave (u)nresolved? u
536 use (c)hanged version, (d)elete, or leave (u)nresolved? u
529 other [merge rev] changed file2 which local [working copy] deleted
537 other [merge rev] changed file2 which local [working copy] deleted
530 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
538 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
531 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? u
539 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3? u
532 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
540 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
533 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
541 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
534 [1]
542 [1]
535 $ status
543 $ status
536 --- status ---
544 --- status ---
537 M file2
545 M file2
538 M file3
546 M file3
539 C file1
547 C file1
540 --- resolve --list ---
548 --- resolve --list ---
541 U file1
549 U file1
542 U file2
550 U file2
543 U file3
551 U file3
544 --- debugmergestate ---
552 --- debugmergestate ---
545 * version 2 records
553 * version 2 records
546 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
554 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
547 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
555 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
548 labels:
556 labels:
549 local: working copy
557 local: working copy
550 other: merge rev
558 other: merge rev
551 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
559 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
552 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
560 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
553 local path: file1 (flags "")
561 local path: file1 (flags "")
554 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
562 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
555 other path: file1 (node null)
563 other path: file1 (node null)
556 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
564 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
557 file: file2 (record type "C", state "u", hash null)
565 file: file2 (record type "C", state "u", hash null)
558 local path: file2 (flags "")
566 local path: file2 (flags "")
559 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
567 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
560 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
568 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
561 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
569 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
562 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
570 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
563 local path: file3 (flags "")
571 local path: file3 (flags "")
564 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
572 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
565 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
573 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
566 --- file1 ---
574 --- file1 ---
567 1
575 1
568 changed
576 changed
569 --- file2 ---
577 --- file2 ---
570 2
578 2
571 changed
579 changed
572 --- file3 ---
580 --- file3 ---
573 3
581 3
574 changed2
582 changed2
575
583
576 Choose to merge all files
584 Choose to merge all files
577
585
578 $ hg co -C
586 $ hg co -C
579 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
587 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
588 updated to "13910f48cf7b: changed file1, removed file2, changed file3"
580 1 other heads for branch "default"
589 1 other heads for branch "default"
581
590
582 $ hg merge --tool :merge3
591 $ hg merge --tool :merge3
583 local [working copy] changed file1 which other [merge rev] deleted
592 local [working copy] changed file1 which other [merge rev] deleted
584 use (c)hanged version, (d)elete, or leave (u)nresolved? u
593 use (c)hanged version, (d)elete, or leave (u)nresolved? u
585 other [merge rev] changed file2 which local [working copy] deleted
594 other [merge rev] changed file2 which local [working copy] deleted
586 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
595 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
587 merging file3
596 merging file3
588 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
597 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
589 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
598 0 files updated, 0 files merged, 0 files removed, 3 files unresolved
590 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
599 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
591 [1]
600 [1]
592 $ status
601 $ status
593 --- status ---
602 --- status ---
594 M file2
603 M file2
595 M file3
604 M file3
596 C file1
605 C file1
597 --- resolve --list ---
606 --- resolve --list ---
598 U file1
607 U file1
599 U file2
608 U file2
600 U file3
609 U file3
601 --- debugmergestate ---
610 --- debugmergestate ---
602 * version 2 records
611 * version 2 records
603 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
612 local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4
604 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
613 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
605 labels:
614 labels:
606 local: working copy
615 local: working copy
607 other: merge rev
616 other: merge rev
608 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
617 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
609 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
618 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
610 local path: file1 (flags "")
619 local path: file1 (flags "")
611 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
620 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
612 other path: file1 (node null)
621 other path: file1 (node null)
613 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
622 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
614 file: file2 (record type "C", state "u", hash null)
623 file: file2 (record type "C", state "u", hash null)
615 local path: file2 (flags "")
624 local path: file2 (flags "")
616 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
625 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
617 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
626 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
618 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
627 file extras: file3 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
619 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
628 file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11)
620 local path: file3 (flags "")
629 local path: file3 (flags "")
621 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
630 ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4)
622 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
631 other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb)
623 --- file1 ---
632 --- file1 ---
624 1
633 1
625 changed
634 changed
626 --- file2 ---
635 --- file2 ---
627 2
636 2
628 changed
637 changed
629 --- file3 ---
638 --- file3 ---
630 3
639 3
631 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
640 <<<<<<< working copy: 13910f48cf7b - test: changed file1, removed file2, chan...
632 changed2
641 changed2
633 ||||||| base
642 ||||||| base
634 =======
643 =======
635 changed1
644 changed1
636 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
645 >>>>>>> merge rev: 10f9a0a634e8 - test: removed file1, changed file2, chan...
637
646
638 Exercise transitions between local, other, fail and prompt, and make sure the
647 Exercise transitions between local, other, fail and prompt, and make sure the
639 dirstate stays consistent. (Compare with each other and to the above
648 dirstate stays consistent. (Compare with each other and to the above
640 invocations.)
649 invocations.)
641
650
642 $ testtransitions() {
651 $ testtransitions() {
643 > # this traversal order covers every transition
652 > # this traversal order covers every transition
644 > tools="local other prompt local fail other local prompt other fail prompt fail local"
653 > tools="local other prompt local fail other local prompt other fail prompt fail local"
645 > lasttool="merge3"
654 > lasttool="merge3"
646 > for tool in $tools; do
655 > for tool in $tools; do
647 > echo "=== :$lasttool -> :$tool ==="
656 > echo "=== :$lasttool -> :$tool ==="
648 > ref="$TESTTMP/$tool.status"
657 > ref="$TESTTMP/$tool.status"
649 > hg resolve --unmark --all
658 > hg resolve --unmark --all
650 > hg resolve --tool ":$tool" --all --config ui.interactive=True
659 > hg resolve --tool ":$tool" --all --config ui.interactive=True
651 > status > "$TESTTMP/compare.status" 2>&1
660 > status > "$TESTTMP/compare.status" 2>&1
652 > echo '--- diff of status ---'
661 > echo '--- diff of status ---'
653 > if cmp "$TESTTMP/$tool.status" "$TESTTMP/compare.status" || diff -U8 "$TESTTMP/$tool.status" "$TESTTMP/compare.status"; then
662 > if cmp "$TESTTMP/$tool.status" "$TESTTMP/compare.status" || diff -U8 "$TESTTMP/$tool.status" "$TESTTMP/compare.status"; then
654 > echo '(status identical)'
663 > echo '(status identical)'
655 > fi
664 > fi
656 > lasttool="$tool"
665 > lasttool="$tool"
657 > echo
666 > echo
658 > done
667 > done
659 > }
668 > }
660
669
661 $ testtransitions
670 $ testtransitions
662 === :merge3 -> :local ===
671 === :merge3 -> :local ===
663 (no more unresolved files)
672 (no more unresolved files)
664 --- diff of status ---
673 --- diff of status ---
665 (status identical)
674 (status identical)
666
675
667 === :local -> :other ===
676 === :local -> :other ===
668 (no more unresolved files)
677 (no more unresolved files)
669 --- diff of status ---
678 --- diff of status ---
670 (status identical)
679 (status identical)
671
680
672 === :other -> :prompt ===
681 === :other -> :prompt ===
673 local [working copy] changed file1 which other [merge rev] deleted
682 local [working copy] changed file1 which other [merge rev] deleted
674 use (c)hanged version, (d)elete, or leave (u)nresolved?
683 use (c)hanged version, (d)elete, or leave (u)nresolved?
675 other [merge rev] changed file2 which local [working copy] deleted
684 other [merge rev] changed file2 which local [working copy] deleted
676 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
685 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
677 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
686 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
678 --- diff of status ---
687 --- diff of status ---
679 (status identical)
688 (status identical)
680
689
681 === :prompt -> :local ===
690 === :prompt -> :local ===
682 (no more unresolved files)
691 (no more unresolved files)
683 --- diff of status ---
692 --- diff of status ---
684 (status identical)
693 (status identical)
685
694
686 === :local -> :fail ===
695 === :local -> :fail ===
687 --- diff of status ---
696 --- diff of status ---
688 (status identical)
697 (status identical)
689
698
690 === :fail -> :other ===
699 === :fail -> :other ===
691 (no more unresolved files)
700 (no more unresolved files)
692 --- diff of status ---
701 --- diff of status ---
693 (status identical)
702 (status identical)
694
703
695 === :other -> :local ===
704 === :other -> :local ===
696 (no more unresolved files)
705 (no more unresolved files)
697 --- diff of status ---
706 --- diff of status ---
698 (status identical)
707 (status identical)
699
708
700 === :local -> :prompt ===
709 === :local -> :prompt ===
701 local [working copy] changed file1 which other [merge rev] deleted
710 local [working copy] changed file1 which other [merge rev] deleted
702 use (c)hanged version, (d)elete, or leave (u)nresolved?
711 use (c)hanged version, (d)elete, or leave (u)nresolved?
703 other [merge rev] changed file2 which local [working copy] deleted
712 other [merge rev] changed file2 which local [working copy] deleted
704 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
713 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
705 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
714 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
706 --- diff of status ---
715 --- diff of status ---
707 (status identical)
716 (status identical)
708
717
709 === :prompt -> :other ===
718 === :prompt -> :other ===
710 (no more unresolved files)
719 (no more unresolved files)
711 --- diff of status ---
720 --- diff of status ---
712 (status identical)
721 (status identical)
713
722
714 === :other -> :fail ===
723 === :other -> :fail ===
715 --- diff of status ---
724 --- diff of status ---
716 (status identical)
725 (status identical)
717
726
718 === :fail -> :prompt ===
727 === :fail -> :prompt ===
719 local [working copy] changed file1 which other [merge rev] deleted
728 local [working copy] changed file1 which other [merge rev] deleted
720 use (c)hanged version, (d)elete, or leave (u)nresolved?
729 use (c)hanged version, (d)elete, or leave (u)nresolved?
721 other [merge rev] changed file2 which local [working copy] deleted
730 other [merge rev] changed file2 which local [working copy] deleted
722 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
731 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
723 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
732 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for file3?
724 --- diff of status ---
733 --- diff of status ---
725 (status identical)
734 (status identical)
726
735
727 === :prompt -> :fail ===
736 === :prompt -> :fail ===
728 --- diff of status ---
737 --- diff of status ---
729 (status identical)
738 (status identical)
730
739
731 === :fail -> :local ===
740 === :fail -> :local ===
732 (no more unresolved files)
741 (no more unresolved files)
733 --- diff of status ---
742 --- diff of status ---
734 (status identical)
743 (status identical)
735
744
736
745
737
746
738 Non-interactive linear update
747 Non-interactive linear update
739
748
740 $ hg co -C 0
749 $ hg co -C 0
741 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
750 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
742 $ echo changed >> file1
751 $ echo changed >> file1
743 $ hg rm file2
752 $ hg rm file2
744 $ hg update 1 -y
753 $ hg update 1 -y
745 local [working copy] changed file1 which other [destination] deleted
754 local [working copy] changed file1 which other [destination] deleted
746 use (c)hanged version, (d)elete, or leave (u)nresolved? u
755 use (c)hanged version, (d)elete, or leave (u)nresolved? u
747 other [destination] changed file2 which local [working copy] deleted
756 other [destination] changed file2 which local [working copy] deleted
748 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
757 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
749 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
758 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
750 use 'hg resolve' to retry unresolved file merges
759 use 'hg resolve' to retry unresolved file merges
751 [1]
760 [1]
752 $ status
761 $ status
753 --- status ---
762 --- status ---
754 A file1
763 A file1
755 C file2
764 C file2
756 C file3
765 C file3
757 --- resolve --list ---
766 --- resolve --list ---
758 U file1
767 U file1
759 U file2
768 U file2
760 --- debugmergestate ---
769 --- debugmergestate ---
761 * version 2 records
770 * version 2 records
762 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
771 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
763 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
772 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
764 labels:
773 labels:
765 local: working copy
774 local: working copy
766 other: destination
775 other: destination
767 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
776 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
768 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
777 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
769 local path: file1 (flags "")
778 local path: file1 (flags "")
770 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
779 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
771 other path: file1 (node null)
780 other path: file1 (node null)
772 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
781 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
773 file: file2 (record type "C", state "u", hash null)
782 file: file2 (record type "C", state "u", hash null)
774 local path: file2 (flags "")
783 local path: file2 (flags "")
775 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
784 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
776 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
785 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
777 --- file1 ---
786 --- file1 ---
778 1
787 1
779 changed
788 changed
780 --- file2 ---
789 --- file2 ---
781 2
790 2
782 changed
791 changed
783 --- file3 ---
792 --- file3 ---
784 3
793 3
785 changed1
794 changed1
786
795
787 Choose local versions of files
796 Choose local versions of files
788
797
789 $ hg co -C 0
798 $ hg co -C 0
790 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
799 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
791 $ echo changed >> file1
800 $ echo changed >> file1
792 $ hg rm file2
801 $ hg rm file2
793 $ hg update 1 --tool :local
802 $ hg update 1 --tool :local
794 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
803 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
795 $ status 2>&1 | tee $TESTTMP/local.status
804 $ status 2>&1 | tee $TESTTMP/local.status
796 --- status ---
805 --- status ---
797 file2: * (glob)
806 file2: * (glob)
798 A file1
807 A file1
799 C file3
808 C file3
800 --- resolve --list ---
809 --- resolve --list ---
801 R file1
810 R file1
802 R file2
811 R file2
803 --- debugmergestate ---
812 --- debugmergestate ---
804 * version 2 records
813 * version 2 records
805 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
814 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
806 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
815 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
807 labels:
816 labels:
808 local: working copy
817 local: working copy
809 other: destination
818 other: destination
810 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
819 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
811 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
820 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
812 local path: file1 (flags "")
821 local path: file1 (flags "")
813 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
822 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
814 other path: file1 (node null)
823 other path: file1 (node null)
815 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
824 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
816 file: file2 (record type "C", state "r", hash null)
825 file: file2 (record type "C", state "r", hash null)
817 local path: file2 (flags "")
826 local path: file2 (flags "")
818 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
827 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
819 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
828 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
820 --- file1 ---
829 --- file1 ---
821 1
830 1
822 changed
831 changed
823 *** file2 does not exist
832 *** file2 does not exist
824 --- file3 ---
833 --- file3 ---
825 3
834 3
826 changed1
835 changed1
827
836
828 Choose other versions of files
837 Choose other versions of files
829
838
830 $ hg co -C 0
839 $ hg co -C 0
831 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
832 $ echo changed >> file1
841 $ echo changed >> file1
833 $ hg rm file2
842 $ hg rm file2
834 $ hg update 1 --tool :other
843 $ hg update 1 --tool :other
835 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
844 1 files updated, 1 files merged, 1 files removed, 0 files unresolved
836 $ status 2>&1 | tee $TESTTMP/other.status
845 $ status 2>&1 | tee $TESTTMP/other.status
837 --- status ---
846 --- status ---
838 file1: * (glob)
847 file1: * (glob)
839 C file2
848 C file2
840 C file3
849 C file3
841 --- resolve --list ---
850 --- resolve --list ---
842 R file1
851 R file1
843 R file2
852 R file2
844 --- debugmergestate ---
853 --- debugmergestate ---
845 * version 2 records
854 * version 2 records
846 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
855 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
847 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
856 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
848 labels:
857 labels:
849 local: working copy
858 local: working copy
850 other: destination
859 other: destination
851 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
860 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
852 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
861 file: file1 (record type "C", state "r", hash 60b27f004e454aca81b0480209cce5081ec52390)
853 local path: file1 (flags "")
862 local path: file1 (flags "")
854 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
863 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
855 other path: file1 (node null)
864 other path: file1 (node null)
856 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
865 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
857 file: file2 (record type "C", state "r", hash null)
866 file: file2 (record type "C", state "r", hash null)
858 local path: file2 (flags "")
867 local path: file2 (flags "")
859 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
868 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
860 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
869 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
861 *** file1 does not exist
870 *** file1 does not exist
862 --- file2 ---
871 --- file2 ---
863 2
872 2
864 changed
873 changed
865 --- file3 ---
874 --- file3 ---
866 3
875 3
867 changed1
876 changed1
868
877
869 Fail
878 Fail
870
879
871 $ hg co -C 0
880 $ hg co -C 0
872 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
881 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
873 $ echo changed >> file1
882 $ echo changed >> file1
874 $ hg rm file2
883 $ hg rm file2
875 $ hg update 1 --tool :fail
884 $ hg update 1 --tool :fail
876 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
885 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
877 use 'hg resolve' to retry unresolved file merges
886 use 'hg resolve' to retry unresolved file merges
878 [1]
887 [1]
879 $ status 2>&1 | tee $TESTTMP/fail.status
888 $ status 2>&1 | tee $TESTTMP/fail.status
880 --- status ---
889 --- status ---
881 A file1
890 A file1
882 C file2
891 C file2
883 C file3
892 C file3
884 --- resolve --list ---
893 --- resolve --list ---
885 U file1
894 U file1
886 U file2
895 U file2
887 --- debugmergestate ---
896 --- debugmergestate ---
888 * version 2 records
897 * version 2 records
889 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
898 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
890 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
899 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
891 labels:
900 labels:
892 local: working copy
901 local: working copy
893 other: destination
902 other: destination
894 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
903 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
895 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
904 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
896 local path: file1 (flags "")
905 local path: file1 (flags "")
897 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
906 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
898 other path: file1 (node null)
907 other path: file1 (node null)
899 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
908 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
900 file: file2 (record type "C", state "u", hash null)
909 file: file2 (record type "C", state "u", hash null)
901 local path: file2 (flags "")
910 local path: file2 (flags "")
902 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
911 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
903 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
912 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
904 --- file1 ---
913 --- file1 ---
905 1
914 1
906 changed
915 changed
907 --- file2 ---
916 --- file2 ---
908 2
917 2
909 changed
918 changed
910 --- file3 ---
919 --- file3 ---
911 3
920 3
912 changed1
921 changed1
913
922
914 Force prompts with no input
923 Force prompts with no input
915
924
916 $ hg co -C 0
925 $ hg co -C 0
917 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
926 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
918 $ echo changed >> file1
927 $ echo changed >> file1
919 $ hg rm file2
928 $ hg rm file2
920 $ hg update 1 --config ui.interactive=True --tool :prompt
929 $ hg update 1 --config ui.interactive=True --tool :prompt
921 local [working copy] changed file1 which other [destination] deleted
930 local [working copy] changed file1 which other [destination] deleted
922 use (c)hanged version, (d)elete, or leave (u)nresolved?
931 use (c)hanged version, (d)elete, or leave (u)nresolved?
923 other [destination] changed file2 which local [working copy] deleted
932 other [destination] changed file2 which local [working copy] deleted
924 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
933 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
925 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
934 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
926 use 'hg resolve' to retry unresolved file merges
935 use 'hg resolve' to retry unresolved file merges
927 [1]
936 [1]
928 $ status 2>&1 | tee $TESTTMP/prompt.status
937 $ status 2>&1 | tee $TESTTMP/prompt.status
929 --- status ---
938 --- status ---
930 A file1
939 A file1
931 C file2
940 C file2
932 C file3
941 C file3
933 --- resolve --list ---
942 --- resolve --list ---
934 U file1
943 U file1
935 U file2
944 U file2
936 --- debugmergestate ---
945 --- debugmergestate ---
937 * version 2 records
946 * version 2 records
938 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
947 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
939 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
948 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
940 labels:
949 labels:
941 local: working copy
950 local: working copy
942 other: destination
951 other: destination
943 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
952 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
944 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
953 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
945 local path: file1 (flags "")
954 local path: file1 (flags "")
946 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
955 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
947 other path: file1 (node null)
956 other path: file1 (node null)
948 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
957 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
949 file: file2 (record type "C", state "u", hash null)
958 file: file2 (record type "C", state "u", hash null)
950 local path: file2 (flags "")
959 local path: file2 (flags "")
951 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
960 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
952 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
961 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
953 --- file1 ---
962 --- file1 ---
954 1
963 1
955 changed
964 changed
956 --- file2 ---
965 --- file2 ---
957 2
966 2
958 changed
967 changed
959 --- file3 ---
968 --- file3 ---
960 3
969 3
961 changed1
970 changed1
962 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
971 $ cmp $TESTTMP/fail.status $TESTTMP/prompt.status || diff -U8 $TESTTMP/fail.status $TESTTMP/prompt.status
963
972
964 Choose to merge all files
973 Choose to merge all files
965
974
966 $ hg co -C 0
975 $ hg co -C 0
967 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
976 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
968 $ echo changed >> file1
977 $ echo changed >> file1
969 $ hg rm file2
978 $ hg rm file2
970 $ hg update 1 --tool :merge3
979 $ hg update 1 --tool :merge3
971 local [working copy] changed file1 which other [destination] deleted
980 local [working copy] changed file1 which other [destination] deleted
972 use (c)hanged version, (d)elete, or leave (u)nresolved? u
981 use (c)hanged version, (d)elete, or leave (u)nresolved? u
973 other [destination] changed file2 which local [working copy] deleted
982 other [destination] changed file2 which local [working copy] deleted
974 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
983 use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
975 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
984 1 files updated, 0 files merged, 0 files removed, 2 files unresolved
976 use 'hg resolve' to retry unresolved file merges
985 use 'hg resolve' to retry unresolved file merges
977 [1]
986 [1]
978 $ status
987 $ status
979 --- status ---
988 --- status ---
980 A file1
989 A file1
981 C file2
990 C file2
982 C file3
991 C file3
983 --- resolve --list ---
992 --- resolve --list ---
984 U file1
993 U file1
985 U file2
994 U file2
986 --- debugmergestate ---
995 --- debugmergestate ---
987 * version 2 records
996 * version 2 records
988 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
997 local: ab57bf49aa276a22d35a473592d4c34b5abc3eff
989 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
998 other: 10f9a0a634e82080907e62f075ab119cbc565ea6
990 labels:
999 labels:
991 local: working copy
1000 local: working copy
992 other: destination
1001 other: destination
993 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
1002 file extras: file1 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
994 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
1003 file: file1 (record type "C", state "u", hash 60b27f004e454aca81b0480209cce5081ec52390)
995 local path: file1 (flags "")
1004 local path: file1 (flags "")
996 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
1005 ancestor path: file1 (node b8e02f6433738021a065f94175c7cd23db5f05be)
997 other path: file1 (node null)
1006 other path: file1 (node null)
998 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
1007 file extras: file2 (ancestorlinknode = ab57bf49aa276a22d35a473592d4c34b5abc3eff)
999 file: file2 (record type "C", state "u", hash null)
1008 file: file2 (record type "C", state "u", hash null)
1000 local path: file2 (flags "")
1009 local path: file2 (flags "")
1001 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
1010 ancestor path: file2 (node 5d9299349fc01ddd25d0070d149b124d8f10411e)
1002 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
1011 other path: file2 (node e7c1328648519852e723de86c0c0525acd779257)
1003 --- file1 ---
1012 --- file1 ---
1004 1
1013 1
1005 changed
1014 changed
1006 --- file2 ---
1015 --- file2 ---
1007 2
1016 2
1008 changed
1017 changed
1009 --- file3 ---
1018 --- file3 ---
1010 3
1019 3
1011 changed1
1020 changed1
1012
1021
1013 Test transitions between different merge tools
1022 Test transitions between different merge tools
1014
1023
1015 $ testtransitions
1024 $ testtransitions
1016 === :merge3 -> :local ===
1025 === :merge3 -> :local ===
1017 (no more unresolved files)
1026 (no more unresolved files)
1018 --- diff of status ---
1027 --- diff of status ---
1019 (status identical)
1028 (status identical)
1020
1029
1021 === :local -> :other ===
1030 === :local -> :other ===
1022 (no more unresolved files)
1031 (no more unresolved files)
1023 --- diff of status ---
1032 --- diff of status ---
1024 (status identical)
1033 (status identical)
1025
1034
1026 === :other -> :prompt ===
1035 === :other -> :prompt ===
1027 local [working copy] changed file1 which other [destination] deleted
1036 local [working copy] changed file1 which other [destination] deleted
1028 use (c)hanged version, (d)elete, or leave (u)nresolved?
1037 use (c)hanged version, (d)elete, or leave (u)nresolved?
1029 other [destination] changed file2 which local [working copy] deleted
1038 other [destination] changed file2 which local [working copy] deleted
1030 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1039 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1031 --- diff of status ---
1040 --- diff of status ---
1032 (status identical)
1041 (status identical)
1033
1042
1034 === :prompt -> :local ===
1043 === :prompt -> :local ===
1035 (no more unresolved files)
1044 (no more unresolved files)
1036 --- diff of status ---
1045 --- diff of status ---
1037 (status identical)
1046 (status identical)
1038
1047
1039 === :local -> :fail ===
1048 === :local -> :fail ===
1040 --- diff of status ---
1049 --- diff of status ---
1041 (status identical)
1050 (status identical)
1042
1051
1043 === :fail -> :other ===
1052 === :fail -> :other ===
1044 (no more unresolved files)
1053 (no more unresolved files)
1045 --- diff of status ---
1054 --- diff of status ---
1046 (status identical)
1055 (status identical)
1047
1056
1048 === :other -> :local ===
1057 === :other -> :local ===
1049 (no more unresolved files)
1058 (no more unresolved files)
1050 --- diff of status ---
1059 --- diff of status ---
1051 (status identical)
1060 (status identical)
1052
1061
1053 === :local -> :prompt ===
1062 === :local -> :prompt ===
1054 local [working copy] changed file1 which other [destination] deleted
1063 local [working copy] changed file1 which other [destination] deleted
1055 use (c)hanged version, (d)elete, or leave (u)nresolved?
1064 use (c)hanged version, (d)elete, or leave (u)nresolved?
1056 other [destination] changed file2 which local [working copy] deleted
1065 other [destination] changed file2 which local [working copy] deleted
1057 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1066 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1058 --- diff of status ---
1067 --- diff of status ---
1059 (status identical)
1068 (status identical)
1060
1069
1061 === :prompt -> :other ===
1070 === :prompt -> :other ===
1062 (no more unresolved files)
1071 (no more unresolved files)
1063 --- diff of status ---
1072 --- diff of status ---
1064 (status identical)
1073 (status identical)
1065
1074
1066 === :other -> :fail ===
1075 === :other -> :fail ===
1067 --- diff of status ---
1076 --- diff of status ---
1068 (status identical)
1077 (status identical)
1069
1078
1070 === :fail -> :prompt ===
1079 === :fail -> :prompt ===
1071 local [working copy] changed file1 which other [destination] deleted
1080 local [working copy] changed file1 which other [destination] deleted
1072 use (c)hanged version, (d)elete, or leave (u)nresolved?
1081 use (c)hanged version, (d)elete, or leave (u)nresolved?
1073 other [destination] changed file2 which local [working copy] deleted
1082 other [destination] changed file2 which local [working copy] deleted
1074 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1083 use (c)hanged version, leave (d)eleted, or leave (u)nresolved?
1075 --- diff of status ---
1084 --- diff of status ---
1076 (status identical)
1085 (status identical)
1077
1086
1078 === :prompt -> :fail ===
1087 === :prompt -> :fail ===
1079 --- diff of status ---
1088 --- diff of status ---
1080 (status identical)
1089 (status identical)
1081
1090
1082 === :fail -> :local ===
1091 === :fail -> :local ===
1083 (no more unresolved files)
1092 (no more unresolved files)
1084 --- diff of status ---
1093 --- diff of status ---
1085 (status identical)
1094 (status identical)
1086
1095
@@ -1,151 +1,152
1 $ hg init
1 $ hg init
2 $ echo a > a
2 $ echo a > a
3 $ hg commit -A -ma
3 $ hg commit -A -ma
4 adding a
4 adding a
5
5
6 $ echo b >> a
6 $ echo b >> a
7 $ hg commit -mb
7 $ hg commit -mb
8
8
9 $ echo c >> a
9 $ echo c >> a
10 $ hg commit -mc
10 $ hg commit -mc
11
11
12 $ hg up 1
12 $ hg up 1
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14 $ echo d >> a
14 $ echo d >> a
15 $ hg commit -md
15 $ hg commit -md
16 created new head
16 created new head
17
17
18 $ hg up 1
18 $ hg up 1
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ echo e >> a
20 $ echo e >> a
21 $ hg commit -me
21 $ hg commit -me
22 created new head
22 created new head
23
23
24 $ hg up 1
24 $ hg up 1
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
26
26
27 Should fail because not at a head:
27 Should fail because not at a head:
28
28
29 $ hg merge
29 $ hg merge
30 abort: working directory not at a head revision
30 abort: working directory not at a head revision
31 (use 'hg update' or merge with an explicit revision)
31 (use 'hg update' or merge with an explicit revision)
32 [255]
32 [255]
33
33
34 $ hg up
34 $ hg up
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 updated to "f25cbe84d8b3: e"
36 2 other heads for branch "default"
37 2 other heads for branch "default"
37
38
38 Should fail because > 2 heads:
39 Should fail because > 2 heads:
39
40
40 $ HGMERGE=internal:other; export HGMERGE
41 $ HGMERGE=internal:other; export HGMERGE
41 $ hg merge
42 $ hg merge
42 abort: branch 'default' has 3 heads - please merge with an explicit rev
43 abort: branch 'default' has 3 heads - please merge with an explicit rev
43 (run 'hg heads .' to see heads)
44 (run 'hg heads .' to see heads)
44 [255]
45 [255]
45
46
46 Should succeed:
47 Should succeed:
47
48
48 $ hg merge 2
49 $ hg merge 2
49 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
50 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
50 (branch merge, don't forget to commit)
51 (branch merge, don't forget to commit)
51 $ hg commit -mm1
52 $ hg commit -mm1
52
53
53 Should succeed - 2 heads:
54 Should succeed - 2 heads:
54
55
55 $ hg merge -P
56 $ hg merge -P
56 changeset: 3:ea9ff125ff88
57 changeset: 3:ea9ff125ff88
57 parent: 1:1846eede8b68
58 parent: 1:1846eede8b68
58 user: test
59 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
60 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: d
61 summary: d
61
62
62 $ hg merge
63 $ hg merge
63 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 (branch merge, don't forget to commit)
65 (branch merge, don't forget to commit)
65 $ hg commit -mm2
66 $ hg commit -mm2
66
67
67 Should fail because at tip:
68 Should fail because at tip:
68
69
69 $ hg merge
70 $ hg merge
70 abort: nothing to merge
71 abort: nothing to merge
71 [255]
72 [255]
72
73
73 $ hg up 0
74 $ hg up 0
74 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75
76
76 Should fail because there is only one head:
77 Should fail because there is only one head:
77
78
78 $ hg merge
79 $ hg merge
79 abort: nothing to merge
80 abort: nothing to merge
80 (use 'hg update' instead)
81 (use 'hg update' instead)
81 [255]
82 [255]
82
83
83 $ hg up 3
84 $ hg up 3
84 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85
86
86 $ echo f >> a
87 $ echo f >> a
87 $ hg branch foobranch
88 $ hg branch foobranch
88 marked working directory as branch foobranch
89 marked working directory as branch foobranch
89 (branches are permanent and global, did you want a bookmark?)
90 (branches are permanent and global, did you want a bookmark?)
90 $ hg commit -mf
91 $ hg commit -mf
91
92
92 Should fail because merge with other branch:
93 Should fail because merge with other branch:
93
94
94 $ hg merge
95 $ hg merge
95 abort: branch 'foobranch' has one head - please merge with an explicit rev
96 abort: branch 'foobranch' has one head - please merge with an explicit rev
96 (run 'hg heads' to see all heads)
97 (run 'hg heads' to see all heads)
97 [255]
98 [255]
98
99
99
100
100 Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
101 Test for issue2043: ensure that 'merge -P' shows ancestors of 6 that
101 are not ancestors of 7, regardless of where their common ancestors are.
102 are not ancestors of 7, regardless of where their common ancestors are.
102
103
103 Merge preview not affected by common ancestor:
104 Merge preview not affected by common ancestor:
104
105
105 $ hg up -q 7
106 $ hg up -q 7
106 $ hg merge -q -P 6
107 $ hg merge -q -P 6
107 2:2d95304fed5d
108 2:2d95304fed5d
108 4:f25cbe84d8b3
109 4:f25cbe84d8b3
109 5:a431fabd6039
110 5:a431fabd6039
110 6:e88e33f3bf62
111 6:e88e33f3bf62
111
112
112 Test experimental destination revset
113 Test experimental destination revset
113
114
114 $ hg log -r '_destmerge()'
115 $ hg log -r '_destmerge()'
115 abort: branch 'foobranch' has one head - please merge with an explicit rev
116 abort: branch 'foobranch' has one head - please merge with an explicit rev
116 (run 'hg heads' to see all heads)
117 (run 'hg heads' to see all heads)
117 [255]
118 [255]
118
119
119 (on a branch with a two heads)
120 (on a branch with a two heads)
120
121
121 $ hg up 5
122 $ hg up 5
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 $ echo f >> a
124 $ echo f >> a
124 $ hg commit -mf
125 $ hg commit -mf
125 created new head
126 created new head
126 $ hg log -r '_destmerge()'
127 $ hg log -r '_destmerge()'
127 changeset: 6:e88e33f3bf62
128 changeset: 6:e88e33f3bf62
128 parent: 5:a431fabd6039
129 parent: 5:a431fabd6039
129 parent: 3:ea9ff125ff88
130 parent: 3:ea9ff125ff88
130 user: test
131 user: test
131 date: Thu Jan 01 00:00:00 1970 +0000
132 date: Thu Jan 01 00:00:00 1970 +0000
132 summary: m2
133 summary: m2
133
134
134
135
135 (from the other head)
136 (from the other head)
136
137
137 $ hg log -r '_destmerge(e88e33f3bf62)'
138 $ hg log -r '_destmerge(e88e33f3bf62)'
138 changeset: 8:b613918999e2
139 changeset: 8:b613918999e2
139 tag: tip
140 tag: tip
140 parent: 5:a431fabd6039
141 parent: 5:a431fabd6039
141 user: test
142 user: test
142 date: Thu Jan 01 00:00:00 1970 +0000
143 date: Thu Jan 01 00:00:00 1970 +0000
143 summary: f
144 summary: f
144
145
145
146
146 (from unrelated branch)
147 (from unrelated branch)
147
148
148 $ hg log -r '_destmerge(foobranch)'
149 $ hg log -r '_destmerge(foobranch)'
149 abort: branch 'foobranch' has one head - please merge with an explicit rev
150 abort: branch 'foobranch' has one head - please merge with an explicit rev
150 (run 'hg heads' to see all heads)
151 (run 'hg heads' to see all heads)
151 [255]
152 [255]
@@ -1,452 +1,454
1 #require symlink execbit
1 #require symlink execbit
2
2
3 $ tellmeabout() {
3 $ tellmeabout() {
4 > if [ -h $1 ]; then
4 > if [ -h $1 ]; then
5 > echo $1 is a symlink:
5 > echo $1 is a symlink:
6 > $TESTDIR/readlink.py $1
6 > $TESTDIR/readlink.py $1
7 > elif [ -x $1 ]; then
7 > elif [ -x $1 ]; then
8 > echo $1 is an executable file with content:
8 > echo $1 is an executable file with content:
9 > cat $1
9 > cat $1
10 > else
10 > else
11 > echo $1 is a plain file with content:
11 > echo $1 is a plain file with content:
12 > cat $1
12 > cat $1
13 > fi
13 > fi
14 > }
14 > }
15
15
16 $ hg init test1
16 $ hg init test1
17 $ cd test1
17 $ cd test1
18
18
19 $ echo a > a
19 $ echo a > a
20 $ hg ci -Aqmadd
20 $ hg ci -Aqmadd
21 $ chmod +x a
21 $ chmod +x a
22 $ hg ci -mexecutable
22 $ hg ci -mexecutable
23
23
24 $ hg up -q 0
24 $ hg up -q 0
25 $ rm a
25 $ rm a
26 $ ln -s symlink a
26 $ ln -s symlink a
27 $ hg ci -msymlink
27 $ hg ci -msymlink
28 created new head
28 created new head
29
29
30 Symlink is local parent, executable is other:
30 Symlink is local parent, executable is other:
31
31
32 $ hg merge --debug
32 $ hg merge --debug
33 searching for copies back to rev 1
33 searching for copies back to rev 1
34 resolving manifests
34 resolving manifests
35 branchmerge: True, force: False, partial: False
35 branchmerge: True, force: False, partial: False
36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
36 ancestor: c334dc3be0da, local: 521a1e40188f+, remote: 3574f3e69b1c
37 preserving a for resolve of a
37 preserving a for resolve of a
38 a: versions differ -> m (premerge)
38 a: versions differ -> m (premerge)
39 picked tool ':merge' for a (binary False symlink True changedelete False)
39 picked tool ':merge' for a (binary False symlink True changedelete False)
40 merging a
40 merging a
41 my a@521a1e40188f+ other a@3574f3e69b1c ancestor a@c334dc3be0da
41 my a@521a1e40188f+ other a@3574f3e69b1c ancestor a@c334dc3be0da
42 warning: internal :merge cannot merge symlinks for a
42 warning: internal :merge cannot merge symlinks for a
43 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
43 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
46 [1]
46 [1]
47
47
48 $ tellmeabout a
48 $ tellmeabout a
49 a is a symlink:
49 a is a symlink:
50 a -> symlink
50 a -> symlink
51 $ hg resolve a --tool internal:other
51 $ hg resolve a --tool internal:other
52 (no more unresolved files)
52 (no more unresolved files)
53 $ tellmeabout a
53 $ tellmeabout a
54 a is an executable file with content:
54 a is an executable file with content:
55 a
55 a
56 $ hg st
56 $ hg st
57 M a
57 M a
58 ? a.orig
58 ? a.orig
59
59
60 Symlink is other parent, executable is local:
60 Symlink is other parent, executable is local:
61
61
62 $ hg update -C 1
62 $ hg update -C 1
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64
64
65 $ hg merge --debug --tool :union
65 $ hg merge --debug --tool :union
66 searching for copies back to rev 1
66 searching for copies back to rev 1
67 resolving manifests
67 resolving manifests
68 branchmerge: True, force: False, partial: False
68 branchmerge: True, force: False, partial: False
69 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
69 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
70 preserving a for resolve of a
70 preserving a for resolve of a
71 a: versions differ -> m (premerge)
71 a: versions differ -> m (premerge)
72 picked tool ':union' for a (binary False symlink True changedelete False)
72 picked tool ':union' for a (binary False symlink True changedelete False)
73 merging a
73 merging a
74 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
74 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
75 warning: internal :union cannot merge symlinks for a
75 warning: internal :union cannot merge symlinks for a
76 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
76 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
77 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
78 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
78 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
79 [1]
79 [1]
80
80
81 $ tellmeabout a
81 $ tellmeabout a
82 a is an executable file with content:
82 a is an executable file with content:
83 a
83 a
84
84
85 $ hg update -C 1
85 $ hg update -C 1
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87
87
88 $ hg merge --debug --tool :merge3
88 $ hg merge --debug --tool :merge3
89 searching for copies back to rev 1
89 searching for copies back to rev 1
90 resolving manifests
90 resolving manifests
91 branchmerge: True, force: False, partial: False
91 branchmerge: True, force: False, partial: False
92 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
92 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
93 preserving a for resolve of a
93 preserving a for resolve of a
94 a: versions differ -> m (premerge)
94 a: versions differ -> m (premerge)
95 picked tool ':merge3' for a (binary False symlink True changedelete False)
95 picked tool ':merge3' for a (binary False symlink True changedelete False)
96 merging a
96 merging a
97 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
97 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
98 warning: internal :merge3 cannot merge symlinks for a
98 warning: internal :merge3 cannot merge symlinks for a
99 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
99 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
100 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
100 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
101 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
101 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
102 [1]
102 [1]
103
103
104 $ tellmeabout a
104 $ tellmeabout a
105 a is an executable file with content:
105 a is an executable file with content:
106 a
106 a
107
107
108 $ hg update -C 1
108 $ hg update -C 1
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110
110
111 $ hg merge --debug --tool :merge-local
111 $ hg merge --debug --tool :merge-local
112 searching for copies back to rev 1
112 searching for copies back to rev 1
113 resolving manifests
113 resolving manifests
114 branchmerge: True, force: False, partial: False
114 branchmerge: True, force: False, partial: False
115 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
115 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
116 preserving a for resolve of a
116 preserving a for resolve of a
117 a: versions differ -> m (premerge)
117 a: versions differ -> m (premerge)
118 picked tool ':merge-local' for a (binary False symlink True changedelete False)
118 picked tool ':merge-local' for a (binary False symlink True changedelete False)
119 merging a
119 merging a
120 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
120 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
121 warning: internal :merge-local cannot merge symlinks for a
121 warning: internal :merge-local cannot merge symlinks for a
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
123 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
123 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
124 [1]
124 [1]
125
125
126 $ tellmeabout a
126 $ tellmeabout a
127 a is an executable file with content:
127 a is an executable file with content:
128 a
128 a
129
129
130 $ hg update -C 1
130 $ hg update -C 1
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132
132
133 $ hg merge --debug --tool :merge-other
133 $ hg merge --debug --tool :merge-other
134 searching for copies back to rev 1
134 searching for copies back to rev 1
135 resolving manifests
135 resolving manifests
136 branchmerge: True, force: False, partial: False
136 branchmerge: True, force: False, partial: False
137 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
137 ancestor: c334dc3be0da, local: 3574f3e69b1c+, remote: 521a1e40188f
138 preserving a for resolve of a
138 preserving a for resolve of a
139 a: versions differ -> m (premerge)
139 a: versions differ -> m (premerge)
140 picked tool ':merge-other' for a (binary False symlink True changedelete False)
140 picked tool ':merge-other' for a (binary False symlink True changedelete False)
141 merging a
141 merging a
142 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
142 my a@3574f3e69b1c+ other a@521a1e40188f ancestor a@c334dc3be0da
143 warning: internal :merge-other cannot merge symlinks for a
143 warning: internal :merge-other cannot merge symlinks for a
144 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
144 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
145 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
145 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
146 [1]
146 [1]
147
147
148 $ tellmeabout a
148 $ tellmeabout a
149 a is an executable file with content:
149 a is an executable file with content:
150 a
150 a
151
151
152 Update to link without local change should get us a symlink (issue3316):
152 Update to link without local change should get us a symlink (issue3316):
153
153
154 $ hg up -C 0
154 $ hg up -C 0
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 $ hg up
156 $ hg up
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 updated to "521a1e40188f: symlink"
158 1 other heads for branch "default"
159 1 other heads for branch "default"
159 $ hg st
160 $ hg st
160 ? a.orig
161 ? a.orig
161
162
162 Update to link with local change should cause a merge prompt (issue3200):
163 Update to link with local change should cause a merge prompt (issue3200):
163
164
164 $ hg up -Cq 0
165 $ hg up -Cq 0
165 $ echo data > a
166 $ echo data > a
166 $ HGMERGE= hg up -y --debug
167 $ HGMERGE= hg up -y --debug
167 searching for copies back to rev 2
168 searching for copies back to rev 2
168 resolving manifests
169 resolving manifests
169 branchmerge: False, force: False, partial: False
170 branchmerge: False, force: False, partial: False
170 ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
171 ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
171 preserving a for resolve of a
172 preserving a for resolve of a
172 a: versions differ -> m (premerge)
173 a: versions differ -> m (premerge)
173 (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
174 (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
174 no tool found to merge a
175 no tool found to merge a
175 picked tool ':prompt' for a (binary False symlink True changedelete False)
176 picked tool ':prompt' for a (binary False symlink True changedelete False)
176 keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved for a? u
177 keep (l)ocal [working copy], take (o)ther [destination], or leave (u)nresolved for a? u
177 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
178 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
178 use 'hg resolve' to retry unresolved file merges
179 use 'hg resolve' to retry unresolved file merges
180 updated to "521a1e40188f: symlink"
179 1 other heads for branch "default"
181 1 other heads for branch "default"
180 [1]
182 [1]
181 $ hg diff --git
183 $ hg diff --git
182 diff --git a/a b/a
184 diff --git a/a b/a
183 old mode 120000
185 old mode 120000
184 new mode 100644
186 new mode 100644
185 --- a/a
187 --- a/a
186 +++ b/a
188 +++ b/a
187 @@ -1,1 +1,1 @@
189 @@ -1,1 +1,1 @@
188 -symlink
190 -symlink
189 \ No newline at end of file
191 \ No newline at end of file
190 +data
192 +data
191
193
192
194
193 Test only 'l' change - happens rarely, except when recovering from situations
195 Test only 'l' change - happens rarely, except when recovering from situations
194 where that was what happened.
196 where that was what happened.
195
197
196 $ hg init test2
198 $ hg init test2
197 $ cd test2
199 $ cd test2
198 $ printf base > f
200 $ printf base > f
199 $ hg ci -Aqm0
201 $ hg ci -Aqm0
200 $ echo file > f
202 $ echo file > f
201 $ echo content >> f
203 $ echo content >> f
202 $ hg ci -qm1
204 $ hg ci -qm1
203 $ hg up -qr0
205 $ hg up -qr0
204 $ rm f
206 $ rm f
205 $ ln -s base f
207 $ ln -s base f
206 $ hg ci -qm2
208 $ hg ci -qm2
207 $ hg merge
209 $ hg merge
208 merging f
210 merging f
209 warning: internal :merge cannot merge symlinks for f
211 warning: internal :merge cannot merge symlinks for f
210 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
212 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
211 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
213 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
212 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
214 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
213 [1]
215 [1]
214 $ tellmeabout f
216 $ tellmeabout f
215 f is a symlink:
217 f is a symlink:
216 f -> base
218 f -> base
217
219
218 $ hg up -Cqr1
220 $ hg up -Cqr1
219 $ hg merge
221 $ hg merge
220 merging f
222 merging f
221 warning: internal :merge cannot merge symlinks for f
223 warning: internal :merge cannot merge symlinks for f
222 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
224 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
223 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
225 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
224 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
226 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
225 [1]
227 [1]
226 $ tellmeabout f
228 $ tellmeabout f
227 f is a plain file with content:
229 f is a plain file with content:
228 file
230 file
229 content
231 content
230
232
231 $ cd ..
233 $ cd ..
232
234
233 Test removed 'x' flag merged with change to symlink
235 Test removed 'x' flag merged with change to symlink
234
236
235 $ hg init test3
237 $ hg init test3
236 $ cd test3
238 $ cd test3
237 $ echo f > f
239 $ echo f > f
238 $ chmod +x f
240 $ chmod +x f
239 $ hg ci -Aqm0
241 $ hg ci -Aqm0
240 $ chmod -x f
242 $ chmod -x f
241 $ hg ci -qm1
243 $ hg ci -qm1
242 $ hg up -qr0
244 $ hg up -qr0
243 $ rm f
245 $ rm f
244 $ ln -s dangling f
246 $ ln -s dangling f
245 $ hg ci -qm2
247 $ hg ci -qm2
246 $ hg merge
248 $ hg merge
247 merging f
249 merging f
248 warning: internal :merge cannot merge symlinks for f
250 warning: internal :merge cannot merge symlinks for f
249 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
251 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
250 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
252 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
251 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
253 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
252 [1]
254 [1]
253 $ tellmeabout f
255 $ tellmeabout f
254 f is a symlink:
256 f is a symlink:
255 f -> dangling
257 f -> dangling
256
258
257 $ hg up -Cqr1
259 $ hg up -Cqr1
258 $ hg merge
260 $ hg merge
259 merging f
261 merging f
260 warning: internal :merge cannot merge symlinks for f
262 warning: internal :merge cannot merge symlinks for f
261 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
263 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
262 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
264 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
263 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
265 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
264 [1]
266 [1]
265 $ tellmeabout f
267 $ tellmeabout f
266 f is a plain file with content:
268 f is a plain file with content:
267 f
269 f
268
270
269 Test removed 'x' flag merged with content change - both ways
271 Test removed 'x' flag merged with content change - both ways
270
272
271 $ hg up -Cqr0
273 $ hg up -Cqr0
272 $ echo change > f
274 $ echo change > f
273 $ hg ci -qm3
275 $ hg ci -qm3
274 $ hg merge -r1
276 $ hg merge -r1
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 (branch merge, don't forget to commit)
278 (branch merge, don't forget to commit)
277 $ tellmeabout f
279 $ tellmeabout f
278 f is a plain file with content:
280 f is a plain file with content:
279 change
281 change
280
282
281 $ hg up -qCr1
283 $ hg up -qCr1
282 $ hg merge -r3
284 $ hg merge -r3
283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
285 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 (branch merge, don't forget to commit)
286 (branch merge, don't forget to commit)
285 $ tellmeabout f
287 $ tellmeabout f
286 f is a plain file with content:
288 f is a plain file with content:
287 change
289 change
288
290
289 $ cd ..
291 $ cd ..
290
292
291 Test merge with no common ancestor:
293 Test merge with no common ancestor:
292 a: just different
294 a: just different
293 b: x vs -, different (cannot calculate x, cannot ask merge tool)
295 b: x vs -, different (cannot calculate x, cannot ask merge tool)
294 c: x vs -, same (cannot calculate x, merge tool is no good)
296 c: x vs -, same (cannot calculate x, merge tool is no good)
295 d: x vs l, different
297 d: x vs l, different
296 e: x vs l, same
298 e: x vs l, same
297 f: - vs l, different
299 f: - vs l, different
298 g: - vs l, same
300 g: - vs l, same
299 h: l vs l, different
301 h: l vs l, different
300 (where same means the filelog entry is shared and there thus is an ancestor!)
302 (where same means the filelog entry is shared and there thus is an ancestor!)
301
303
302 $ hg init test4
304 $ hg init test4
303 $ cd test4
305 $ cd test4
304 $ echo 0 > 0
306 $ echo 0 > 0
305 $ hg ci -Aqm0
307 $ hg ci -Aqm0
306
308
307 $ echo 1 > a
309 $ echo 1 > a
308 $ echo 1 > b
310 $ echo 1 > b
309 $ chmod +x b
311 $ chmod +x b
310 $ echo 1 > bx
312 $ echo 1 > bx
311 $ chmod +x bx
313 $ chmod +x bx
312 $ echo x > c
314 $ echo x > c
313 $ chmod +x c
315 $ chmod +x c
314 $ echo 1 > d
316 $ echo 1 > d
315 $ chmod +x d
317 $ chmod +x d
316 $ printf x > e
318 $ printf x > e
317 $ chmod +x e
319 $ chmod +x e
318 $ echo 1 > f
320 $ echo 1 > f
319 $ printf x > g
321 $ printf x > g
320 $ ln -s 1 h
322 $ ln -s 1 h
321 $ hg ci -qAm1
323 $ hg ci -qAm1
322
324
323 $ hg up -qr0
325 $ hg up -qr0
324 $ echo 2 > a
326 $ echo 2 > a
325 $ echo 2 > b
327 $ echo 2 > b
326 $ echo 2 > bx
328 $ echo 2 > bx
327 $ chmod +x bx
329 $ chmod +x bx
328 $ echo x > c
330 $ echo x > c
329 $ ln -s 2 d
331 $ ln -s 2 d
330 $ ln -s x e
332 $ ln -s x e
331 $ ln -s 2 f
333 $ ln -s 2 f
332 $ ln -s x g
334 $ ln -s x g
333 $ ln -s 2 h
335 $ ln -s 2 h
334 $ hg ci -Aqm2
336 $ hg ci -Aqm2
335
337
336 $ hg merge
338 $ hg merge
337 merging a
339 merging a
338 warning: cannot merge flags for b without common ancestor - keeping local flags
340 warning: cannot merge flags for b without common ancestor - keeping local flags
339 merging b
341 merging b
340 merging bx
342 merging bx
341 warning: cannot merge flags for c without common ancestor - keeping local flags
343 warning: cannot merge flags for c without common ancestor - keeping local flags
342 merging d
344 merging d
343 warning: internal :merge cannot merge symlinks for d
345 warning: internal :merge cannot merge symlinks for d
344 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
346 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
345 merging f
347 merging f
346 warning: internal :merge cannot merge symlinks for f
348 warning: internal :merge cannot merge symlinks for f
347 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
349 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
348 merging h
350 merging h
349 warning: internal :merge cannot merge symlinks for h
351 warning: internal :merge cannot merge symlinks for h
350 warning: conflicts while merging h! (edit, then use 'hg resolve --mark')
352 warning: conflicts while merging h! (edit, then use 'hg resolve --mark')
351 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
353 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
352 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
354 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
353 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
355 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
354 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
356 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
355 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
357 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
356 [1]
358 [1]
357 $ hg resolve -l
359 $ hg resolve -l
358 U a
360 U a
359 U b
361 U b
360 U bx
362 U bx
361 U d
363 U d
362 U f
364 U f
363 U h
365 U h
364 $ tellmeabout a
366 $ tellmeabout a
365 a is a plain file with content:
367 a is a plain file with content:
366 <<<<<<< working copy: 0c617753b41b - test: 2
368 <<<<<<< working copy: 0c617753b41b - test: 2
367 2
369 2
368 =======
370 =======
369 1
371 1
370 >>>>>>> merge rev: 2e60aa20b912 - test: 1
372 >>>>>>> merge rev: 2e60aa20b912 - test: 1
371 $ tellmeabout b
373 $ tellmeabout b
372 b is a plain file with content:
374 b is a plain file with content:
373 <<<<<<< working copy: 0c617753b41b - test: 2
375 <<<<<<< working copy: 0c617753b41b - test: 2
374 2
376 2
375 =======
377 =======
376 1
378 1
377 >>>>>>> merge rev: 2e60aa20b912 - test: 1
379 >>>>>>> merge rev: 2e60aa20b912 - test: 1
378 $ tellmeabout c
380 $ tellmeabout c
379 c is a plain file with content:
381 c is a plain file with content:
380 x
382 x
381 $ tellmeabout d
383 $ tellmeabout d
382 d is a symlink:
384 d is a symlink:
383 d -> 2
385 d -> 2
384 $ tellmeabout e
386 $ tellmeabout e
385 e is a symlink:
387 e is a symlink:
386 e -> x
388 e -> x
387 $ tellmeabout f
389 $ tellmeabout f
388 f is a symlink:
390 f is a symlink:
389 f -> 2
391 f -> 2
390 $ tellmeabout g
392 $ tellmeabout g
391 g is a symlink:
393 g is a symlink:
392 g -> x
394 g -> x
393 $ tellmeabout h
395 $ tellmeabout h
394 h is a symlink:
396 h is a symlink:
395 h -> 2
397 h -> 2
396
398
397 $ hg up -Cqr1
399 $ hg up -Cqr1
398 $ hg merge
400 $ hg merge
399 merging a
401 merging a
400 warning: cannot merge flags for b without common ancestor - keeping local flags
402 warning: cannot merge flags for b without common ancestor - keeping local flags
401 merging b
403 merging b
402 merging bx
404 merging bx
403 warning: cannot merge flags for c without common ancestor - keeping local flags
405 warning: cannot merge flags for c without common ancestor - keeping local flags
404 merging d
406 merging d
405 warning: internal :merge cannot merge symlinks for d
407 warning: internal :merge cannot merge symlinks for d
406 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
408 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
407 merging f
409 merging f
408 warning: internal :merge cannot merge symlinks for f
410 warning: internal :merge cannot merge symlinks for f
409 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
411 warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
410 merging h
412 merging h
411 warning: internal :merge cannot merge symlinks for h
413 warning: internal :merge cannot merge symlinks for h
412 warning: conflicts while merging h! (edit, then use 'hg resolve --mark')
414 warning: conflicts while merging h! (edit, then use 'hg resolve --mark')
413 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
415 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
414 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
416 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
415 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
417 warning: conflicts while merging bx! (edit, then use 'hg resolve --mark')
416 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
418 3 files updated, 0 files merged, 0 files removed, 6 files unresolved
417 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
419 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
418 [1]
420 [1]
419 $ tellmeabout a
421 $ tellmeabout a
420 a is a plain file with content:
422 a is a plain file with content:
421 <<<<<<< working copy: 2e60aa20b912 - test: 1
423 <<<<<<< working copy: 2e60aa20b912 - test: 1
422 1
424 1
423 =======
425 =======
424 2
426 2
425 >>>>>>> merge rev: 0c617753b41b - test: 2
427 >>>>>>> merge rev: 0c617753b41b - test: 2
426 $ tellmeabout b
428 $ tellmeabout b
427 b is an executable file with content:
429 b is an executable file with content:
428 <<<<<<< working copy: 2e60aa20b912 - test: 1
430 <<<<<<< working copy: 2e60aa20b912 - test: 1
429 1
431 1
430 =======
432 =======
431 2
433 2
432 >>>>>>> merge rev: 0c617753b41b - test: 2
434 >>>>>>> merge rev: 0c617753b41b - test: 2
433 $ tellmeabout c
435 $ tellmeabout c
434 c is an executable file with content:
436 c is an executable file with content:
435 x
437 x
436 $ tellmeabout d
438 $ tellmeabout d
437 d is an executable file with content:
439 d is an executable file with content:
438 1
440 1
439 $ tellmeabout e
441 $ tellmeabout e
440 e is an executable file with content:
442 e is an executable file with content:
441 x (no-eol)
443 x (no-eol)
442 $ tellmeabout f
444 $ tellmeabout f
443 f is a plain file with content:
445 f is a plain file with content:
444 1
446 1
445 $ tellmeabout g
447 $ tellmeabout g
446 g is a plain file with content:
448 g is a plain file with content:
447 x (no-eol)
449 x (no-eol)
448 $ tellmeabout h
450 $ tellmeabout h
449 h is a symlink:
451 h is a symlink:
450 h -> 1
452 h -> 1
451
453
452 $ cd ..
454 $ cd ..
@@ -1,215 +1,216
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3 $ echo 1 > foo
3 $ echo 1 > foo
4 $ hg ci -Am1 # 0
4 $ hg ci -Am1 # 0
5 adding foo
5 adding foo
6 $ hg branch branchA
6 $ hg branch branchA
7 marked working directory as branch branchA
7 marked working directory as branch branchA
8 (branches are permanent and global, did you want a bookmark?)
8 (branches are permanent and global, did you want a bookmark?)
9 $ echo a1 > foo
9 $ echo a1 > foo
10 $ hg ci -ma1 # 1
10 $ hg ci -ma1 # 1
11
11
12 $ cd ..
12 $ cd ..
13 $ hg init tt
13 $ hg init tt
14 $ cd tt
14 $ cd tt
15 $ hg pull ../t
15 $ hg pull ../t
16 pulling from ../t
16 pulling from ../t
17 requesting all changes
17 requesting all changes
18 adding changesets
18 adding changesets
19 adding manifests
19 adding manifests
20 adding file changes
20 adding file changes
21 added 2 changesets with 2 changes to 1 files
21 added 2 changesets with 2 changes to 1 files
22 (run 'hg update' to get a working copy)
22 (run 'hg update' to get a working copy)
23 $ hg up branchA
23 $ hg up branchA
24 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
25
25
26 $ cd ../t
26 $ cd ../t
27 $ echo a2 > foo
27 $ echo a2 > foo
28 $ hg ci -ma2 # 2
28 $ hg ci -ma2 # 2
29
29
30 Create branch B:
30 Create branch B:
31
31
32 $ hg up 0
32 $ hg up 0
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ hg branch branchB
34 $ hg branch branchB
35 marked working directory as branch branchB
35 marked working directory as branch branchB
36 $ echo b1 > foo
36 $ echo b1 > foo
37 $ hg ci -mb1 # 3
37 $ hg ci -mb1 # 3
38
38
39 $ cd ../tt
39 $ cd ../tt
40
40
41 A new branch is there
41 A new branch is there
42
42
43 $ hg pull -u ../t
43 $ hg pull -u ../t
44 pulling from ../t
44 pulling from ../t
45 searching for changes
45 searching for changes
46 adding changesets
46 adding changesets
47 adding manifests
47 adding manifests
48 adding file changes
48 adding file changes
49 added 2 changesets with 2 changes to 1 files (+1 heads)
49 added 2 changesets with 2 changes to 1 files (+1 heads)
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51
51
52 Develop both branches:
52 Develop both branches:
53
53
54 $ cd ../t
54 $ cd ../t
55 $ hg up branchA
55 $ hg up branchA
56 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 $ echo a3 > foo
57 $ echo a3 > foo
58 $ hg ci -ma3 # 4
58 $ hg ci -ma3 # 4
59 $ hg up branchB
59 $ hg up branchB
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 $ echo b2 > foo
61 $ echo b2 > foo
62 $ hg ci -mb2 # 5
62 $ hg ci -mb2 # 5
63
63
64 $ cd ../tt
64 $ cd ../tt
65
65
66 Should succeed, no new heads:
66 Should succeed, no new heads:
67
67
68 $ hg pull -u ../t
68 $ hg pull -u ../t
69 pulling from ../t
69 pulling from ../t
70 searching for changes
70 searching for changes
71 adding changesets
71 adding changesets
72 adding manifests
72 adding manifests
73 adding file changes
73 adding file changes
74 added 2 changesets with 2 changes to 1 files
74 added 2 changesets with 2 changes to 1 files
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
76
76
77 Add a head on other branch:
77 Add a head on other branch:
78
78
79 $ cd ../t
79 $ cd ../t
80 $ hg up branchA
80 $ hg up branchA
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ echo a4 > foo
82 $ echo a4 > foo
83 $ hg ci -ma4 # 6
83 $ hg ci -ma4 # 6
84 $ hg up branchB
84 $ hg up branchB
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 $ echo b3.1 > foo
86 $ echo b3.1 > foo
87 $ hg ci -m b3.1 # 7
87 $ hg ci -m b3.1 # 7
88 $ hg up 5
88 $ hg up 5
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 $ echo b3.2 > foo
90 $ echo b3.2 > foo
91 $ hg ci -m b3.2 # 8
91 $ hg ci -m b3.2 # 8
92 created new head
92 created new head
93
93
94 $ cd ../tt
94 $ cd ../tt
95
95
96 Should succeed because there is only one head on our branch:
96 Should succeed because there is only one head on our branch:
97
97
98 $ hg pull -u ../t
98 $ hg pull -u ../t
99 pulling from ../t
99 pulling from ../t
100 searching for changes
100 searching for changes
101 adding changesets
101 adding changesets
102 adding manifests
102 adding manifests
103 adding file changes
103 adding file changes
104 added 3 changesets with 3 changes to 1 files (+1 heads)
104 added 3 changesets with 3 changes to 1 files (+1 heads)
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106
106
107 $ cd ../t
107 $ cd ../t
108 $ hg up -C branchA
108 $ hg up -C branchA
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 $ echo a5.1 > foo
110 $ echo a5.1 > foo
111 $ hg ci -ma5.1 # 9
111 $ hg ci -ma5.1 # 9
112 $ hg up 6
112 $ hg up 6
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 $ echo a5.2 > foo
114 $ echo a5.2 > foo
115 $ hg ci -ma5.2 # 10
115 $ hg ci -ma5.2 # 10
116 created new head
116 created new head
117 $ hg up 7
117 $ hg up 7
118 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 $ echo b4.1 > foo
119 $ echo b4.1 > foo
120 $ hg ci -m b4.1 # 11
120 $ hg ci -m b4.1 # 11
121 $ hg up -C 8
121 $ hg up -C 8
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 $ echo b4.2 > foo
123 $ echo b4.2 > foo
124 $ hg ci -m b4.2 # 12
124 $ hg ci -m b4.2 # 12
125
125
126 $ cd ../tt
126 $ cd ../tt
127
127
128 $ hg pull -u ../t
128 $ hg pull -u ../t
129 pulling from ../t
129 pulling from ../t
130 searching for changes
130 searching for changes
131 adding changesets
131 adding changesets
132 adding manifests
132 adding manifests
133 adding file changes
133 adding file changes
134 added 4 changesets with 4 changes to 1 files (+1 heads)
134 added 4 changesets with 4 changes to 1 files (+1 heads)
135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 updated to "d740e1a584e7: a5.2"
136 1 other heads for branch "branchA"
137 1 other heads for branch "branchA"
137
138
138 Make changes on new branch on tt
139 Make changes on new branch on tt
139
140
140 $ hg up 6
141 $ hg up 6
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 $ hg branch branchC
143 $ hg branch branchC
143 marked working directory as branch branchC
144 marked working directory as branch branchC
144 $ echo b1 > bar
145 $ echo b1 > bar
145 $ hg ci -Am "commit on branchC on tt"
146 $ hg ci -Am "commit on branchC on tt"
146 adding bar
147 adding bar
147
148
148 Make changes on default branch on t
149 Make changes on default branch on t
149
150
150 $ cd ../t
151 $ cd ../t
151 $ hg up -C default
152 $ hg up -C default
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 $ echo a1 > bar
154 $ echo a1 > bar
154 $ hg ci -Am "commit on default on t"
155 $ hg ci -Am "commit on default on t"
155 adding bar
156 adding bar
156
157
157 Pull branchC from tt
158 Pull branchC from tt
158
159
159 $ hg pull ../tt
160 $ hg pull ../tt
160 pulling from ../tt
161 pulling from ../tt
161 searching for changes
162 searching for changes
162 adding changesets
163 adding changesets
163 adding manifests
164 adding manifests
164 adding file changes
165 adding file changes
165 added 1 changesets with 1 changes to 1 files (+1 heads)
166 added 1 changesets with 1 changes to 1 files (+1 heads)
166 (run 'hg heads' to see heads)
167 (run 'hg heads' to see heads)
167
168
168 Make changes on default and branchC on tt
169 Make changes on default and branchC on tt
169
170
170 $ cd ../tt
171 $ cd ../tt
171 $ hg pull ../t
172 $ hg pull ../t
172 pulling from ../t
173 pulling from ../t
173 searching for changes
174 searching for changes
174 adding changesets
175 adding changesets
175 adding manifests
176 adding manifests
176 adding file changes
177 adding file changes
177 added 1 changesets with 1 changes to 1 files (+1 heads)
178 added 1 changesets with 1 changes to 1 files (+1 heads)
178 (run 'hg heads' to see heads)
179 (run 'hg heads' to see heads)
179 $ hg up -C default
180 $ hg up -C default
180 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 $ echo a1 > bar1
182 $ echo a1 > bar1
182 $ hg ci -Am "commit on default on tt"
183 $ hg ci -Am "commit on default on tt"
183 adding bar1
184 adding bar1
184 $ hg up branchC
185 $ hg up branchC
185 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
186 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
186 $ echo a1 > bar2
187 $ echo a1 > bar2
187 $ hg ci -Am "commit on branchC on tt"
188 $ hg ci -Am "commit on branchC on tt"
188 adding bar2
189 adding bar2
189
190
190 Make changes on default and branchC on t
191 Make changes on default and branchC on t
191
192
192 $ cd ../t
193 $ cd ../t
193 $ hg up default
194 $ hg up default
194 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ echo a1 > bar3
196 $ echo a1 > bar3
196 $ hg ci -Am "commit on default on t"
197 $ hg ci -Am "commit on default on t"
197 adding bar3
198 adding bar3
198 $ hg up branchC
199 $ hg up branchC
199 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
200 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
200 $ echo a1 > bar4
201 $ echo a1 > bar4
201 $ hg ci -Am "commit on branchC on tt"
202 $ hg ci -Am "commit on branchC on tt"
202 adding bar4
203 adding bar4
203
204
204 Pull from tt
205 Pull from tt
205
206
206 $ hg pull ../tt
207 $ hg pull ../tt
207 pulling from ../tt
208 pulling from ../tt
208 searching for changes
209 searching for changes
209 adding changesets
210 adding changesets
210 adding manifests
211 adding manifests
211 adding file changes
212 adding file changes
212 added 2 changesets with 2 changes to 2 files (+2 heads)
213 added 2 changesets with 2 changes to 2 files (+2 heads)
213 (run 'hg heads .' to see heads, 'hg merge' to merge)
214 (run 'hg heads .' to see heads, 'hg merge' to merge)
214
215
215 $ cd ..
216 $ cd ..
@@ -1,229 +1,231
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3 $ echo 1 > foo
3 $ echo 1 > foo
4 $ hg ci -Am m
4 $ hg ci -Am m
5 adding foo
5 adding foo
6
6
7 $ cd ..
7 $ cd ..
8 $ hg clone t tt
8 $ hg clone t tt
9 updating to branch default
9 updating to branch default
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 $ cd tt
11 $ cd tt
12 $ echo 1.1 > foo
12 $ echo 1.1 > foo
13 $ hg ci -Am m
13 $ hg ci -Am m
14
14
15 $ cd ../t
15 $ cd ../t
16 $ echo 1.2 > foo
16 $ echo 1.2 > foo
17 $ hg ci -Am m
17 $ hg ci -Am m
18
18
19 Should respect config to disable dirty update
19 Should respect config to disable dirty update
20 $ hg co -qC 0
20 $ hg co -qC 0
21 $ echo 2 > foo
21 $ echo 2 > foo
22 $ hg --config experimental.updatecheck=abort pull -u ../tt
22 $ hg --config experimental.updatecheck=abort pull -u ../tt
23 pulling from ../tt
23 pulling from ../tt
24 searching for changes
24 searching for changes
25 adding changesets
25 adding changesets
26 adding manifests
26 adding manifests
27 adding file changes
27 adding file changes
28 added 1 changesets with 1 changes to 1 files (+1 heads)
28 added 1 changesets with 1 changes to 1 files (+1 heads)
29 abort: uncommitted changes
29 abort: uncommitted changes
30 [255]
30 [255]
31 $ hg --config extensions.strip= strip --no-backup tip
31 $ hg --config extensions.strip= strip --no-backup tip
32 $ hg co -qC tip
32 $ hg co -qC tip
33
33
34 Should not update to the other topological branch:
34 Should not update to the other topological branch:
35
35
36 $ hg pull -u ../tt
36 $ hg pull -u ../tt
37 pulling from ../tt
37 pulling from ../tt
38 searching for changes
38 searching for changes
39 adding changesets
39 adding changesets
40 adding manifests
40 adding manifests
41 adding file changes
41 adding file changes
42 added 1 changesets with 1 changes to 1 files (+1 heads)
42 added 1 changesets with 1 changes to 1 files (+1 heads)
43 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 updated to "800c91d5bfc1: m"
44 1 other heads for branch "default"
45 1 other heads for branch "default"
45
46
46 $ cd ../tt
47 $ cd ../tt
47
48
48 Should not update to the other branch:
49 Should not update to the other branch:
49
50
50 $ hg pull -u ../t
51 $ hg pull -u ../t
51 pulling from ../t
52 pulling from ../t
52 searching for changes
53 searching for changes
53 adding changesets
54 adding changesets
54 adding manifests
55 adding manifests
55 adding file changes
56 adding file changes
56 added 1 changesets with 1 changes to 1 files (+1 heads)
57 added 1 changesets with 1 changes to 1 files (+1 heads)
57 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 updated to "107cefe13e42: m"
58 1 other heads for branch "default"
60 1 other heads for branch "default"
59
61
60 $ HGMERGE=true hg merge
62 $ HGMERGE=true hg merge
61 merging foo
63 merging foo
62 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
63 (branch merge, don't forget to commit)
65 (branch merge, don't forget to commit)
64 $ hg ci -mm
66 $ hg ci -mm
65
67
66 $ cd ../t
68 $ cd ../t
67
69
68 Should work:
70 Should work:
69
71
70 $ hg pull -u ../tt
72 $ hg pull -u ../tt
71 pulling from ../tt
73 pulling from ../tt
72 searching for changes
74 searching for changes
73 adding changesets
75 adding changesets
74 adding manifests
76 adding manifests
75 adding file changes
77 adding file changes
76 added 1 changesets with 1 changes to 1 files (-1 heads)
78 added 1 changesets with 1 changes to 1 files (-1 heads)
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78
80
79 Similarity between "hg update" and "hg pull -u" in handling bookmark
81 Similarity between "hg update" and "hg pull -u" in handling bookmark
80 ====================================================================
82 ====================================================================
81
83
82 Test that updating activates the bookmark, which matches with the
84 Test that updating activates the bookmark, which matches with the
83 explicit destination of the update.
85 explicit destination of the update.
84
86
85 $ echo 4 >> foo
87 $ echo 4 >> foo
86 $ hg commit -m "#4"
88 $ hg commit -m "#4"
87 $ hg bookmark active-after-pull
89 $ hg bookmark active-after-pull
88 $ cd ../tt
90 $ cd ../tt
89
91
90 (1) activating by --rev BOOKMARK
92 (1) activating by --rev BOOKMARK
91
93
92 $ hg bookmark -f active-before-pull
94 $ hg bookmark -f active-before-pull
93 $ hg bookmarks
95 $ hg bookmarks
94 * active-before-pull 3:483b76ad4309
96 * active-before-pull 3:483b76ad4309
95
97
96 $ hg pull -u -r active-after-pull
98 $ hg pull -u -r active-after-pull
97 pulling from $TESTTMP/t (glob)
99 pulling from $TESTTMP/t (glob)
98 searching for changes
100 searching for changes
99 adding changesets
101 adding changesets
100 adding manifests
102 adding manifests
101 adding file changes
103 adding file changes
102 added 1 changesets with 1 changes to 1 files
104 added 1 changesets with 1 changes to 1 files
103 adding remote bookmark active-after-pull
105 adding remote bookmark active-after-pull
104 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 (activating bookmark active-after-pull)
107 (activating bookmark active-after-pull)
106
108
107 $ hg parents -q
109 $ hg parents -q
108 4:f815b3da6163
110 4:f815b3da6163
109 $ hg bookmarks
111 $ hg bookmarks
110 * active-after-pull 4:f815b3da6163
112 * active-after-pull 4:f815b3da6163
111 active-before-pull 3:483b76ad4309
113 active-before-pull 3:483b76ad4309
112
114
113 (discard pulled changes)
115 (discard pulled changes)
114
116
115 $ hg update -q 483b76ad4309
117 $ hg update -q 483b76ad4309
116 $ hg rollback -q
118 $ hg rollback -q
117
119
118 (2) activating by URL#BOOKMARK
120 (2) activating by URL#BOOKMARK
119
121
120 $ hg bookmark -f active-before-pull
122 $ hg bookmark -f active-before-pull
121 $ hg bookmarks
123 $ hg bookmarks
122 * active-before-pull 3:483b76ad4309
124 * active-before-pull 3:483b76ad4309
123
125
124 $ hg pull -u $TESTTMP/t#active-after-pull
126 $ hg pull -u $TESTTMP/t#active-after-pull
125 pulling from $TESTTMP/t (glob)
127 pulling from $TESTTMP/t (glob)
126 searching for changes
128 searching for changes
127 adding changesets
129 adding changesets
128 adding manifests
130 adding manifests
129 adding file changes
131 adding file changes
130 added 1 changesets with 1 changes to 1 files
132 added 1 changesets with 1 changes to 1 files
131 adding remote bookmark active-after-pull
133 adding remote bookmark active-after-pull
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 (activating bookmark active-after-pull)
135 (activating bookmark active-after-pull)
134
136
135 $ hg parents -q
137 $ hg parents -q
136 4:f815b3da6163
138 4:f815b3da6163
137 $ hg bookmarks
139 $ hg bookmarks
138 * active-after-pull 4:f815b3da6163
140 * active-after-pull 4:f815b3da6163
139 active-before-pull 3:483b76ad4309
141 active-before-pull 3:483b76ad4309
140
142
141 (discard pulled changes)
143 (discard pulled changes)
142
144
143 $ hg update -q 483b76ad4309
145 $ hg update -q 483b76ad4309
144 $ hg rollback -q
146 $ hg rollback -q
145
147
146 Test that updating deactivates current active bookmark, if the
148 Test that updating deactivates current active bookmark, if the
147 destination of the update is explicitly specified, and it doesn't
149 destination of the update is explicitly specified, and it doesn't
148 match with the name of any existing bookmarks.
150 match with the name of any existing bookmarks.
149
151
150 $ cd ../t
152 $ cd ../t
151 $ hg bookmark -d active-after-pull
153 $ hg bookmark -d active-after-pull
152 $ hg branch bar -q
154 $ hg branch bar -q
153 $ hg commit -m "#5 (bar #1)"
155 $ hg commit -m "#5 (bar #1)"
154 $ cd ../tt
156 $ cd ../tt
155
157
156 (1) deactivating by --rev REV
158 (1) deactivating by --rev REV
157
159
158 $ hg bookmark -f active-before-pull
160 $ hg bookmark -f active-before-pull
159 $ hg bookmarks
161 $ hg bookmarks
160 * active-before-pull 3:483b76ad4309
162 * active-before-pull 3:483b76ad4309
161
163
162 $ hg pull -u -r b5e4babfaaa7
164 $ hg pull -u -r b5e4babfaaa7
163 pulling from $TESTTMP/t (glob)
165 pulling from $TESTTMP/t (glob)
164 searching for changes
166 searching for changes
165 adding changesets
167 adding changesets
166 adding manifests
168 adding manifests
167 adding file changes
169 adding file changes
168 added 2 changesets with 1 changes to 1 files
170 added 2 changesets with 1 changes to 1 files
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 (leaving bookmark active-before-pull)
172 (leaving bookmark active-before-pull)
171
173
172 $ hg parents -q
174 $ hg parents -q
173 5:b5e4babfaaa7
175 5:b5e4babfaaa7
174 $ hg bookmarks
176 $ hg bookmarks
175 active-before-pull 3:483b76ad4309
177 active-before-pull 3:483b76ad4309
176
178
177 (discard pulled changes)
179 (discard pulled changes)
178
180
179 $ hg update -q 483b76ad4309
181 $ hg update -q 483b76ad4309
180 $ hg rollback -q
182 $ hg rollback -q
181
183
182 (2) deactivating by --branch BRANCH
184 (2) deactivating by --branch BRANCH
183
185
184 $ hg bookmark -f active-before-pull
186 $ hg bookmark -f active-before-pull
185 $ hg bookmarks
187 $ hg bookmarks
186 * active-before-pull 3:483b76ad4309
188 * active-before-pull 3:483b76ad4309
187
189
188 $ hg pull -u -b bar
190 $ hg pull -u -b bar
189 pulling from $TESTTMP/t (glob)
191 pulling from $TESTTMP/t (glob)
190 searching for changes
192 searching for changes
191 adding changesets
193 adding changesets
192 adding manifests
194 adding manifests
193 adding file changes
195 adding file changes
194 added 2 changesets with 1 changes to 1 files
196 added 2 changesets with 1 changes to 1 files
195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
196 (leaving bookmark active-before-pull)
198 (leaving bookmark active-before-pull)
197
199
198 $ hg parents -q
200 $ hg parents -q
199 5:b5e4babfaaa7
201 5:b5e4babfaaa7
200 $ hg bookmarks
202 $ hg bookmarks
201 active-before-pull 3:483b76ad4309
203 active-before-pull 3:483b76ad4309
202
204
203 (discard pulled changes)
205 (discard pulled changes)
204
206
205 $ hg update -q 483b76ad4309
207 $ hg update -q 483b76ad4309
206 $ hg rollback -q
208 $ hg rollback -q
207
209
208 (3) deactivating by URL#ANOTHER-BRANCH
210 (3) deactivating by URL#ANOTHER-BRANCH
209
211
210 $ hg bookmark -f active-before-pull
212 $ hg bookmark -f active-before-pull
211 $ hg bookmarks
213 $ hg bookmarks
212 * active-before-pull 3:483b76ad4309
214 * active-before-pull 3:483b76ad4309
213
215
214 $ hg pull -u $TESTTMP/t#bar
216 $ hg pull -u $TESTTMP/t#bar
215 pulling from $TESTTMP/t (glob)
217 pulling from $TESTTMP/t (glob)
216 searching for changes
218 searching for changes
217 adding changesets
219 adding changesets
218 adding manifests
220 adding manifests
219 adding file changes
221 adding file changes
220 added 2 changesets with 1 changes to 1 files
222 added 2 changesets with 1 changes to 1 files
221 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 (leaving bookmark active-before-pull)
224 (leaving bookmark active-before-pull)
223
225
224 $ hg parents -q
226 $ hg parents -q
225 5:b5e4babfaaa7
227 5:b5e4babfaaa7
226 $ hg bookmarks
228 $ hg bookmarks
227 active-before-pull 3:483b76ad4309
229 active-before-pull 3:483b76ad4309
228
230
229 $ cd ..
231 $ cd ..
@@ -1,451 +1,452
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > histedit=
4 > histedit=
5 >
5 >
6 > [alias]
6 > [alias]
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
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 $ echo C1 > C1
14 $ echo C1 > C1
15 $ hg ci -Am C1
15 $ hg ci -Am C1
16 adding C1
16 adding C1
17
17
18 $ echo C2 > C2
18 $ echo C2 > C2
19 $ hg ci -Am C2
19 $ hg ci -Am C2
20 adding C2
20 adding C2
21
21
22 $ cd ..
22 $ cd ..
23
23
24 $ hg clone a b
24 $ hg clone a b
25 updating to branch default
25 updating to branch default
26 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
27
27
28 $ hg clone a c
28 $ hg clone a c
29 updating to branch default
29 updating to branch default
30 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
31
31
32 $ cd b
32 $ cd b
33
33
34 $ echo L1 > L1
34 $ echo L1 > L1
35 $ hg ci -Am L1
35 $ hg ci -Am L1
36 adding L1
36 adding L1
37
37
38
38
39 $ cd ../a
39 $ cd ../a
40
40
41 $ echo R1 > R1
41 $ echo R1 > R1
42 $ hg ci -Am R1
42 $ hg ci -Am R1
43 adding R1
43 adding R1
44
44
45
45
46 $ cd ../b
46 $ cd ../b
47
47
48 Now b has one revision to be pulled from a:
48 Now b has one revision to be pulled from a:
49
49
50 $ hg pull --rebase
50 $ hg pull --rebase
51 pulling from $TESTTMP/a (glob)
51 pulling from $TESTTMP/a (glob)
52 searching for changes
52 searching for changes
53 adding changesets
53 adding changesets
54 adding manifests
54 adding manifests
55 adding file changes
55 adding file changes
56 added 1 changesets with 1 changes to 1 files (+1 heads)
56 added 1 changesets with 1 changes to 1 files (+1 heads)
57 rebasing 2:ff8d69a621f9 "L1"
57 rebasing 2:ff8d69a621f9 "L1"
58 saved backup bundle to $TESTTMP/b/.hg/strip-backup/ff8d69a621f9-160fa373-backup.hg (glob)
58 saved backup bundle to $TESTTMP/b/.hg/strip-backup/ff8d69a621f9-160fa373-backup.hg (glob)
59
59
60 $ hg tglog
60 $ hg tglog
61 @ 3: 'L1'
61 @ 3: 'L1'
62 |
62 |
63 o 2: 'R1'
63 o 2: 'R1'
64 |
64 |
65 o 1: 'C2'
65 o 1: 'C2'
66 |
66 |
67 o 0: 'C1'
67 o 0: 'C1'
68
68
69 Re-run:
69 Re-run:
70
70
71 $ hg pull --rebase
71 $ hg pull --rebase
72 pulling from $TESTTMP/a (glob)
72 pulling from $TESTTMP/a (glob)
73 searching for changes
73 searching for changes
74 no changes found
74 no changes found
75
75
76 Abort pull early if working dir is not clean:
76 Abort pull early if working dir is not clean:
77
77
78 $ echo L1-mod > L1
78 $ echo L1-mod > L1
79 $ hg pull --rebase
79 $ hg pull --rebase
80 abort: uncommitted changes
80 abort: uncommitted changes
81 (cannot pull with rebase: please commit or shelve your changes first)
81 (cannot pull with rebase: please commit or shelve your changes first)
82 [255]
82 [255]
83 $ hg update --clean --quiet
83 $ hg update --clean --quiet
84
84
85 Abort pull early if another operation (histedit) is in progress:
85 Abort pull early if another operation (histedit) is in progress:
86
86
87 $ hg histedit . -q --commands - << EOF
87 $ hg histedit . -q --commands - << EOF
88 > edit d80cc2da061e histedit: generate unfinished state
88 > edit d80cc2da061e histedit: generate unfinished state
89 > EOF
89 > EOF
90 Editing (d80cc2da061e), you may commit or record as needed now.
90 Editing (d80cc2da061e), you may commit or record as needed now.
91 (hg histedit --continue to resume)
91 (hg histedit --continue to resume)
92 [1]
92 [1]
93 $ hg pull --rebase
93 $ hg pull --rebase
94 abort: histedit in progress
94 abort: histedit in progress
95 (use 'hg histedit --continue' or 'hg histedit --abort')
95 (use 'hg histedit --continue' or 'hg histedit --abort')
96 [255]
96 [255]
97 $ hg histedit --abort --quiet
97 $ hg histedit --abort --quiet
98
98
99 Abort pull early with pending uncommitted merge:
99 Abort pull early with pending uncommitted merge:
100
100
101 $ cd ..
101 $ cd ..
102 $ hg clone --noupdate c d
102 $ hg clone --noupdate c d
103 $ cd d
103 $ cd d
104 $ hg tglog
104 $ hg tglog
105 o 1: 'C2'
105 o 1: 'C2'
106 |
106 |
107 o 0: 'C1'
107 o 0: 'C1'
108
108
109 $ hg update --quiet 0
109 $ hg update --quiet 0
110 $ echo M1 > M1
110 $ echo M1 > M1
111 $ hg commit --quiet -Am M1
111 $ hg commit --quiet -Am M1
112 $ hg update --quiet 1
112 $ hg update --quiet 1
113 $ hg merge 2
113 $ hg merge 2
114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 (branch merge, don't forget to commit)
115 (branch merge, don't forget to commit)
116 $ hg pull --rebase
116 $ hg pull --rebase
117 abort: outstanding uncommitted merge
117 abort: outstanding uncommitted merge
118 (cannot pull with rebase: please commit or shelve your changes first)
118 (cannot pull with rebase: please commit or shelve your changes first)
119 [255]
119 [255]
120 $ hg update --clean --quiet
120 $ hg update --clean --quiet
121
121
122 Abort pull early with unclean subrepo:
122 Abort pull early with unclean subrepo:
123 $ echo s = s > .hgsub
123 $ echo s = s > .hgsub
124 $ hg add .hgsub
124 $ hg add .hgsub
125 $ hg init s
125 $ hg init s
126 $ hg commit -m "generated a subrepo"
126 $ hg commit -m "generated a subrepo"
127 $ echo a > s/a
127 $ echo a > s/a
128 $ hg -R s add s/a
128 $ hg -R s add s/a
129 $ hg pull --rebase
129 $ hg pull --rebase
130 abort: uncommitted changes in subrepository 's'
130 abort: uncommitted changes in subrepository 's'
131 (cannot pull with rebase: please commit or shelve your changes first)
131 (cannot pull with rebase: please commit or shelve your changes first)
132 [255]
132 [255]
133
133
134 Invoke pull --rebase and nothing to rebase:
134 Invoke pull --rebase and nothing to rebase:
135
135
136 $ cd ../c
136 $ cd ../c
137
137
138 $ hg book norebase
138 $ hg book norebase
139 $ hg pull --rebase
139 $ hg pull --rebase
140 pulling from $TESTTMP/a (glob)
140 pulling from $TESTTMP/a (glob)
141 searching for changes
141 searching for changes
142 adding changesets
142 adding changesets
143 adding manifests
143 adding manifests
144 adding file changes
144 adding file changes
145 added 1 changesets with 1 changes to 1 files
145 added 1 changesets with 1 changes to 1 files
146 nothing to rebase - updating instead
146 nothing to rebase - updating instead
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 updating bookmark norebase
148 updating bookmark norebase
149
149
150 $ hg tglog -l 1
150 $ hg tglog -l 1
151 @ 2: 'R1'
151 @ 2: 'R1'
152 |
152 |
153 ~
153 ~
154
154
155 pull --rebase --update should ignore --update:
155 pull --rebase --update should ignore --update:
156
156
157 $ hg pull --rebase --update
157 $ hg pull --rebase --update
158 pulling from $TESTTMP/a (glob)
158 pulling from $TESTTMP/a (glob)
159 searching for changes
159 searching for changes
160 no changes found
160 no changes found
161
161
162 pull --rebase doesn't update if nothing has been pulled:
162 pull --rebase doesn't update if nothing has been pulled:
163
163
164 $ hg up -q 1
164 $ hg up -q 1
165
165
166 $ hg pull --rebase
166 $ hg pull --rebase
167 pulling from $TESTTMP/a (glob)
167 pulling from $TESTTMP/a (glob)
168 searching for changes
168 searching for changes
169 no changes found
169 no changes found
170
170
171 $ hg tglog -l 1
171 $ hg tglog -l 1
172 o 2: 'R1'
172 o 2: 'R1'
173 |
173 |
174 ~
174 ~
175
175
176 $ cd ..
176 $ cd ..
177
177
178 pull --rebase works when a specific revision is pulled (issue3619)
178 pull --rebase works when a specific revision is pulled (issue3619)
179
179
180 $ cd a
180 $ cd a
181 $ hg tglog
181 $ hg tglog
182 @ 2: 'R1'
182 @ 2: 'R1'
183 |
183 |
184 o 1: 'C2'
184 o 1: 'C2'
185 |
185 |
186 o 0: 'C1'
186 o 0: 'C1'
187
187
188 $ echo R2 > R2
188 $ echo R2 > R2
189 $ hg ci -Am R2
189 $ hg ci -Am R2
190 adding R2
190 adding R2
191 $ echo R3 > R3
191 $ echo R3 > R3
192 $ hg ci -Am R3
192 $ hg ci -Am R3
193 adding R3
193 adding R3
194 $ cd ../c
194 $ cd ../c
195 $ hg tglog
195 $ hg tglog
196 o 2: 'R1'
196 o 2: 'R1'
197 |
197 |
198 @ 1: 'C2'
198 @ 1: 'C2'
199 |
199 |
200 o 0: 'C1'
200 o 0: 'C1'
201
201
202 $ echo L1 > L1
202 $ echo L1 > L1
203 $ hg ci -Am L1
203 $ hg ci -Am L1
204 adding L1
204 adding L1
205 created new head
205 created new head
206 $ hg pull --rev tip --rebase
206 $ hg pull --rev tip --rebase
207 pulling from $TESTTMP/a (glob)
207 pulling from $TESTTMP/a (glob)
208 searching for changes
208 searching for changes
209 adding changesets
209 adding changesets
210 adding manifests
210 adding manifests
211 adding file changes
211 adding file changes
212 added 2 changesets with 2 changes to 2 files
212 added 2 changesets with 2 changes to 2 files
213 rebasing 3:ff8d69a621f9 "L1"
213 rebasing 3:ff8d69a621f9 "L1"
214 saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-160fa373-backup.hg (glob)
214 saved backup bundle to $TESTTMP/c/.hg/strip-backup/ff8d69a621f9-160fa373-backup.hg (glob)
215 $ hg tglog
215 $ hg tglog
216 @ 5: 'L1'
216 @ 5: 'L1'
217 |
217 |
218 o 4: 'R3'
218 o 4: 'R3'
219 |
219 |
220 o 3: 'R2'
220 o 3: 'R2'
221 |
221 |
222 o 2: 'R1'
222 o 2: 'R1'
223 |
223 |
224 o 1: 'C2'
224 o 1: 'C2'
225 |
225 |
226 o 0: 'C1'
226 o 0: 'C1'
227
227
228 pull --rebase works with bundle2 turned on
228 pull --rebase works with bundle2 turned on
229
229
230 $ cd ../a
230 $ cd ../a
231 $ echo R4 > R4
231 $ echo R4 > R4
232 $ hg ci -Am R4
232 $ hg ci -Am R4
233 adding R4
233 adding R4
234 $ hg tglog
234 $ hg tglog
235 @ 5: 'R4'
235 @ 5: 'R4'
236 |
236 |
237 o 4: 'R3'
237 o 4: 'R3'
238 |
238 |
239 o 3: 'R2'
239 o 3: 'R2'
240 |
240 |
241 o 2: 'R1'
241 o 2: 'R1'
242 |
242 |
243 o 1: 'C2'
243 o 1: 'C2'
244 |
244 |
245 o 0: 'C1'
245 o 0: 'C1'
246
246
247 $ cd ../c
247 $ cd ../c
248 $ hg pull --rebase
248 $ hg pull --rebase
249 pulling from $TESTTMP/a (glob)
249 pulling from $TESTTMP/a (glob)
250 searching for changes
250 searching for changes
251 adding changesets
251 adding changesets
252 adding manifests
252 adding manifests
253 adding file changes
253 adding file changes
254 added 1 changesets with 1 changes to 1 files (+1 heads)
254 added 1 changesets with 1 changes to 1 files (+1 heads)
255 rebasing 5:518d153c0ba3 "L1"
255 rebasing 5:518d153c0ba3 "L1"
256 saved backup bundle to $TESTTMP/c/.hg/strip-backup/518d153c0ba3-73407f14-backup.hg (glob)
256 saved backup bundle to $TESTTMP/c/.hg/strip-backup/518d153c0ba3-73407f14-backup.hg (glob)
257 $ hg tglog
257 $ hg tglog
258 @ 6: 'L1'
258 @ 6: 'L1'
259 |
259 |
260 o 5: 'R4'
260 o 5: 'R4'
261 |
261 |
262 o 4: 'R3'
262 o 4: 'R3'
263 |
263 |
264 o 3: 'R2'
264 o 3: 'R2'
265 |
265 |
266 o 2: 'R1'
266 o 2: 'R1'
267 |
267 |
268 o 1: 'C2'
268 o 1: 'C2'
269 |
269 |
270 o 0: 'C1'
270 o 0: 'C1'
271
271
272
272
273 pull --rebase only update if there is nothing to rebase
273 pull --rebase only update if there is nothing to rebase
274
274
275 $ cd ../a
275 $ cd ../a
276 $ echo R5 > R5
276 $ echo R5 > R5
277 $ hg ci -Am R5
277 $ hg ci -Am R5
278 adding R5
278 adding R5
279 $ hg tglog
279 $ hg tglog
280 @ 6: 'R5'
280 @ 6: 'R5'
281 |
281 |
282 o 5: 'R4'
282 o 5: 'R4'
283 |
283 |
284 o 4: 'R3'
284 o 4: 'R3'
285 |
285 |
286 o 3: 'R2'
286 o 3: 'R2'
287 |
287 |
288 o 2: 'R1'
288 o 2: 'R1'
289 |
289 |
290 o 1: 'C2'
290 o 1: 'C2'
291 |
291 |
292 o 0: 'C1'
292 o 0: 'C1'
293
293
294 $ cd ../c
294 $ cd ../c
295 $ echo L2 > L2
295 $ echo L2 > L2
296 $ hg ci -Am L2
296 $ hg ci -Am L2
297 adding L2
297 adding L2
298 $ hg up 'desc(L1)'
298 $ hg up 'desc(L1)'
299 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
299 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
300 $ hg pull --rebase
300 $ hg pull --rebase
301 pulling from $TESTTMP/a (glob)
301 pulling from $TESTTMP/a (glob)
302 searching for changes
302 searching for changes
303 adding changesets
303 adding changesets
304 adding manifests
304 adding manifests
305 adding file changes
305 adding file changes
306 added 1 changesets with 1 changes to 1 files (+1 heads)
306 added 1 changesets with 1 changes to 1 files (+1 heads)
307 rebasing 6:0d0727eb7ce0 "L1"
307 rebasing 6:0d0727eb7ce0 "L1"
308 rebasing 7:c1f58876e3bf "L2"
308 rebasing 7:c1f58876e3bf "L2"
309 saved backup bundle to $TESTTMP/c/.hg/strip-backup/0d0727eb7ce0-ef61ccb2-backup.hg (glob)
309 saved backup bundle to $TESTTMP/c/.hg/strip-backup/0d0727eb7ce0-ef61ccb2-backup.hg (glob)
310 $ hg tglog
310 $ hg tglog
311 o 8: 'L2'
311 o 8: 'L2'
312 |
312 |
313 @ 7: 'L1'
313 @ 7: 'L1'
314 |
314 |
315 o 6: 'R5'
315 o 6: 'R5'
316 |
316 |
317 o 5: 'R4'
317 o 5: 'R4'
318 |
318 |
319 o 4: 'R3'
319 o 4: 'R3'
320 |
320 |
321 o 3: 'R2'
321 o 3: 'R2'
322 |
322 |
323 o 2: 'R1'
323 o 2: 'R1'
324 |
324 |
325 o 1: 'C2'
325 o 1: 'C2'
326 |
326 |
327 o 0: 'C1'
327 o 0: 'C1'
328
328
329
329
330 pull --rebase update (no rebase) use proper update:
330 pull --rebase update (no rebase) use proper update:
331
331
332 - warn about other head.
332 - warn about other head.
333
333
334 $ cd ../a
334 $ cd ../a
335 $ echo R6 > R6
335 $ echo R6 > R6
336 $ hg ci -Am R6
336 $ hg ci -Am R6
337 adding R6
337 adding R6
338 $ cd ../c
338 $ cd ../c
339 $ hg up 'desc(R5)'
339 $ hg up 'desc(R5)'
340 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
340 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
341 $ hg pull --rebase
341 $ hg pull --rebase
342 pulling from $TESTTMP/a (glob)
342 pulling from $TESTTMP/a (glob)
343 searching for changes
343 searching for changes
344 adding changesets
344 adding changesets
345 adding manifests
345 adding manifests
346 adding file changes
346 adding file changes
347 added 1 changesets with 1 changes to 1 files (+1 heads)
347 added 1 changesets with 1 changes to 1 files (+1 heads)
348 nothing to rebase - updating instead
348 nothing to rebase - updating instead
349 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
350 updated to "65bc164c1d9b: R6"
350 1 other heads for branch "default"
351 1 other heads for branch "default"
351 $ hg tglog
352 $ hg tglog
352 @ 9: 'R6'
353 @ 9: 'R6'
353 |
354 |
354 | o 8: 'L2'
355 | o 8: 'L2'
355 | |
356 | |
356 | o 7: 'L1'
357 | o 7: 'L1'
357 |/
358 |/
358 o 6: 'R5'
359 o 6: 'R5'
359 |
360 |
360 o 5: 'R4'
361 o 5: 'R4'
361 |
362 |
362 o 4: 'R3'
363 o 4: 'R3'
363 |
364 |
364 o 3: 'R2'
365 o 3: 'R2'
365 |
366 |
366 o 2: 'R1'
367 o 2: 'R1'
367 |
368 |
368 o 1: 'C2'
369 o 1: 'C2'
369 |
370 |
370 o 0: 'C1'
371 o 0: 'C1'
371
372
372
373
373 Multiple pre-existing heads on the branch
374 Multiple pre-existing heads on the branch
374 -----------------------------------------
375 -----------------------------------------
375
376
376 Pull bring content, but nothing on the current branch, we should not consider
377 Pull bring content, but nothing on the current branch, we should not consider
377 pre-existing heads.
378 pre-existing heads.
378
379
379 $ cd ../a
380 $ cd ../a
380 $ hg branch unrelatedbranch
381 $ hg branch unrelatedbranch
381 marked working directory as branch unrelatedbranch
382 marked working directory as branch unrelatedbranch
382 (branches are permanent and global, did you want a bookmark?)
383 (branches are permanent and global, did you want a bookmark?)
383 $ echo B1 > B1
384 $ echo B1 > B1
384 $ hg commit -Am B1
385 $ hg commit -Am B1
385 adding B1
386 adding B1
386 $ cd ../c
387 $ cd ../c
387 $ hg up 'desc(L2)'
388 $ hg up 'desc(L2)'
388 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
389 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
389 $ hg pull --rebase
390 $ hg pull --rebase
390 pulling from $TESTTMP/a (glob)
391 pulling from $TESTTMP/a (glob)
391 searching for changes
392 searching for changes
392 adding changesets
393 adding changesets
393 adding manifests
394 adding manifests
394 adding file changes
395 adding file changes
395 added 1 changesets with 1 changes to 1 files
396 added 1 changesets with 1 changes to 1 files
396 nothing to rebase
397 nothing to rebase
397
398
398 There is two local heads and we pull a third one.
399 There is two local heads and we pull a third one.
399 The second local head should not confuse the `hg pull rebase`.
400 The second local head should not confuse the `hg pull rebase`.
400
401
401 $ hg up 'desc(R6)'
402 $ hg up 'desc(R6)'
402 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
403 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
403 $ echo M1 > M1
404 $ echo M1 > M1
404 $ hg commit -Am M1
405 $ hg commit -Am M1
405 adding M1
406 adding M1
406 $ cd ../a
407 $ cd ../a
407 $ hg up 'desc(R6)'
408 $ hg up 'desc(R6)'
408 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
409 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
409 $ echo R7 > R7
410 $ echo R7 > R7
410 $ hg commit -Am R7
411 $ hg commit -Am R7
411 adding R7
412 adding R7
412 $ cd ../c
413 $ cd ../c
413 $ hg up 'desc(L2)'
414 $ hg up 'desc(L2)'
414 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
415 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
415 $ hg pull --rebase
416 $ hg pull --rebase
416 pulling from $TESTTMP/a (glob)
417 pulling from $TESTTMP/a (glob)
417 searching for changes
418 searching for changes
418 adding changesets
419 adding changesets
419 adding manifests
420 adding manifests
420 adding file changes
421 adding file changes
421 added 1 changesets with 1 changes to 1 files (+1 heads)
422 added 1 changesets with 1 changes to 1 files (+1 heads)
422 rebasing 7:864e0a2d2614 "L1"
423 rebasing 7:864e0a2d2614 "L1"
423 rebasing 8:6dc0ea5dcf55 "L2"
424 rebasing 8:6dc0ea5dcf55 "L2"
424 saved backup bundle to $TESTTMP/c/.hg/strip-backup/864e0a2d2614-2f72c89c-backup.hg (glob)
425 saved backup bundle to $TESTTMP/c/.hg/strip-backup/864e0a2d2614-2f72c89c-backup.hg (glob)
425 $ hg tglog
426 $ hg tglog
426 @ 12: 'L2'
427 @ 12: 'L2'
427 |
428 |
428 o 11: 'L1'
429 o 11: 'L1'
429 |
430 |
430 o 10: 'R7'
431 o 10: 'R7'
431 |
432 |
432 | o 9: 'M1'
433 | o 9: 'M1'
433 |/
434 |/
434 | o 8: 'B1' unrelatedbranch
435 | o 8: 'B1' unrelatedbranch
435 |/
436 |/
436 o 7: 'R6'
437 o 7: 'R6'
437 |
438 |
438 o 6: 'R5'
439 o 6: 'R5'
439 |
440 |
440 o 5: 'R4'
441 o 5: 'R4'
441 |
442 |
442 o 4: 'R3'
443 o 4: 'R3'
443 |
444 |
444 o 3: 'R2'
445 o 3: 'R2'
445 |
446 |
446 o 2: 'R1'
447 o 2: 'R1'
447 |
448 |
448 o 1: 'C2'
449 o 1: 'C2'
449 |
450 |
450 o 0: 'C1'
451 o 0: 'C1'
451
452
@@ -1,939 +1,940
1 $ echo "[format]" >> $HGRCPATH
1 $ echo "[format]" >> $HGRCPATH
2 $ echo "usegeneraldelta=yes" >> $HGRCPATH
2 $ echo "usegeneraldelta=yes" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "strip=" >> $HGRCPATH
4 $ echo "strip=" >> $HGRCPATH
5
5
6 $ restore() {
6 $ restore() {
7 > hg unbundle -q .hg/strip-backup/*
7 > hg unbundle -q .hg/strip-backup/*
8 > rm .hg/strip-backup/*
8 > rm .hg/strip-backup/*
9 > }
9 > }
10 $ teststrip() {
10 $ teststrip() {
11 > hg up -C $1
11 > hg up -C $1
12 > echo % before update $1, strip $2
12 > echo % before update $1, strip $2
13 > hg parents
13 > hg parents
14 > hg --traceback strip $2
14 > hg --traceback strip $2
15 > echo % after update $1, strip $2
15 > echo % after update $1, strip $2
16 > hg parents
16 > hg parents
17 > restore
17 > restore
18 > }
18 > }
19
19
20 $ hg init test
20 $ hg init test
21 $ cd test
21 $ cd test
22
22
23 $ echo foo > bar
23 $ echo foo > bar
24 $ hg ci -Ama
24 $ hg ci -Ama
25 adding bar
25 adding bar
26
26
27 $ echo more >> bar
27 $ echo more >> bar
28 $ hg ci -Amb
28 $ hg ci -Amb
29
29
30 $ echo blah >> bar
30 $ echo blah >> bar
31 $ hg ci -Amc
31 $ hg ci -Amc
32
32
33 $ hg up 1
33 $ hg up 1
34 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 $ echo blah >> bar
35 $ echo blah >> bar
36 $ hg ci -Amd
36 $ hg ci -Amd
37 created new head
37 created new head
38
38
39 $ echo final >> bar
39 $ echo final >> bar
40 $ hg ci -Ame
40 $ hg ci -Ame
41
41
42 $ hg log
42 $ hg log
43 changeset: 4:443431ffac4f
43 changeset: 4:443431ffac4f
44 tag: tip
44 tag: tip
45 user: test
45 user: test
46 date: Thu Jan 01 00:00:00 1970 +0000
46 date: Thu Jan 01 00:00:00 1970 +0000
47 summary: e
47 summary: e
48
48
49 changeset: 3:65bd5f99a4a3
49 changeset: 3:65bd5f99a4a3
50 parent: 1:ef3a871183d7
50 parent: 1:ef3a871183d7
51 user: test
51 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
52 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: d
53 summary: d
54
54
55 changeset: 2:264128213d29
55 changeset: 2:264128213d29
56 user: test
56 user: test
57 date: Thu Jan 01 00:00:00 1970 +0000
57 date: Thu Jan 01 00:00:00 1970 +0000
58 summary: c
58 summary: c
59
59
60 changeset: 1:ef3a871183d7
60 changeset: 1:ef3a871183d7
61 user: test
61 user: test
62 date: Thu Jan 01 00:00:00 1970 +0000
62 date: Thu Jan 01 00:00:00 1970 +0000
63 summary: b
63 summary: b
64
64
65 changeset: 0:9ab35a2d17cb
65 changeset: 0:9ab35a2d17cb
66 user: test
66 user: test
67 date: Thu Jan 01 00:00:00 1970 +0000
67 date: Thu Jan 01 00:00:00 1970 +0000
68 summary: a
68 summary: a
69
69
70
70
71 $ teststrip 4 4
71 $ teststrip 4 4
72 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 % before update 4, strip 4
73 % before update 4, strip 4
74 changeset: 4:443431ffac4f
74 changeset: 4:443431ffac4f
75 tag: tip
75 tag: tip
76 user: test
76 user: test
77 date: Thu Jan 01 00:00:00 1970 +0000
77 date: Thu Jan 01 00:00:00 1970 +0000
78 summary: e
78 summary: e
79
79
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
81 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
82 % after update 4, strip 4
82 % after update 4, strip 4
83 changeset: 3:65bd5f99a4a3
83 changeset: 3:65bd5f99a4a3
84 tag: tip
84 tag: tip
85 parent: 1:ef3a871183d7
85 parent: 1:ef3a871183d7
86 user: test
86 user: test
87 date: Thu Jan 01 00:00:00 1970 +0000
87 date: Thu Jan 01 00:00:00 1970 +0000
88 summary: d
88 summary: d
89
89
90 $ teststrip 4 3
90 $ teststrip 4 3
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 % before update 4, strip 3
92 % before update 4, strip 3
93 changeset: 4:443431ffac4f
93 changeset: 4:443431ffac4f
94 tag: tip
94 tag: tip
95 user: test
95 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
96 date: Thu Jan 01 00:00:00 1970 +0000
97 summary: e
97 summary: e
98
98
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
100 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
101 % after update 4, strip 3
101 % after update 4, strip 3
102 changeset: 1:ef3a871183d7
102 changeset: 1:ef3a871183d7
103 user: test
103 user: test
104 date: Thu Jan 01 00:00:00 1970 +0000
104 date: Thu Jan 01 00:00:00 1970 +0000
105 summary: b
105 summary: b
106
106
107 $ teststrip 1 4
107 $ teststrip 1 4
108 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 % before update 1, strip 4
109 % before update 1, strip 4
110 changeset: 1:ef3a871183d7
110 changeset: 1:ef3a871183d7
111 user: test
111 user: test
112 date: Thu Jan 01 00:00:00 1970 +0000
112 date: Thu Jan 01 00:00:00 1970 +0000
113 summary: b
113 summary: b
114
114
115 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
115 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
116 % after update 1, strip 4
116 % after update 1, strip 4
117 changeset: 1:ef3a871183d7
117 changeset: 1:ef3a871183d7
118 user: test
118 user: test
119 date: Thu Jan 01 00:00:00 1970 +0000
119 date: Thu Jan 01 00:00:00 1970 +0000
120 summary: b
120 summary: b
121
121
122 $ teststrip 4 2
122 $ teststrip 4 2
123 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 % before update 4, strip 2
124 % before update 4, strip 2
125 changeset: 4:443431ffac4f
125 changeset: 4:443431ffac4f
126 tag: tip
126 tag: tip
127 user: test
127 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
128 date: Thu Jan 01 00:00:00 1970 +0000
129 summary: e
129 summary: e
130
130
131 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
131 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
132 % after update 4, strip 2
132 % after update 4, strip 2
133 changeset: 3:443431ffac4f
133 changeset: 3:443431ffac4f
134 tag: tip
134 tag: tip
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: e
137 summary: e
138
138
139 $ teststrip 4 1
139 $ teststrip 4 1
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 % before update 4, strip 1
141 % before update 4, strip 1
142 changeset: 4:264128213d29
142 changeset: 4:264128213d29
143 tag: tip
143 tag: tip
144 parent: 1:ef3a871183d7
144 parent: 1:ef3a871183d7
145 user: test
145 user: test
146 date: Thu Jan 01 00:00:00 1970 +0000
146 date: Thu Jan 01 00:00:00 1970 +0000
147 summary: c
147 summary: c
148
148
149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
150 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
151 % after update 4, strip 1
151 % after update 4, strip 1
152 changeset: 0:9ab35a2d17cb
152 changeset: 0:9ab35a2d17cb
153 tag: tip
153 tag: tip
154 user: test
154 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
155 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: a
156 summary: a
157
157
158 $ teststrip null 4
158 $ teststrip null 4
159 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
159 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
160 % before update null, strip 4
160 % before update null, strip 4
161 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
161 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
162 % after update null, strip 4
162 % after update null, strip 4
163
163
164 $ hg log
164 $ hg log
165 changeset: 4:264128213d29
165 changeset: 4:264128213d29
166 tag: tip
166 tag: tip
167 parent: 1:ef3a871183d7
167 parent: 1:ef3a871183d7
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: c
170 summary: c
171
171
172 changeset: 3:443431ffac4f
172 changeset: 3:443431ffac4f
173 user: test
173 user: test
174 date: Thu Jan 01 00:00:00 1970 +0000
174 date: Thu Jan 01 00:00:00 1970 +0000
175 summary: e
175 summary: e
176
176
177 changeset: 2:65bd5f99a4a3
177 changeset: 2:65bd5f99a4a3
178 user: test
178 user: test
179 date: Thu Jan 01 00:00:00 1970 +0000
179 date: Thu Jan 01 00:00:00 1970 +0000
180 summary: d
180 summary: d
181
181
182 changeset: 1:ef3a871183d7
182 changeset: 1:ef3a871183d7
183 user: test
183 user: test
184 date: Thu Jan 01 00:00:00 1970 +0000
184 date: Thu Jan 01 00:00:00 1970 +0000
185 summary: b
185 summary: b
186
186
187 changeset: 0:9ab35a2d17cb
187 changeset: 0:9ab35a2d17cb
188 user: test
188 user: test
189 date: Thu Jan 01 00:00:00 1970 +0000
189 date: Thu Jan 01 00:00:00 1970 +0000
190 summary: a
190 summary: a
191
191
192 $ hg up -C 4
192 $ hg up -C 4
193 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 $ hg parents
194 $ hg parents
195 changeset: 4:264128213d29
195 changeset: 4:264128213d29
196 tag: tip
196 tag: tip
197 parent: 1:ef3a871183d7
197 parent: 1:ef3a871183d7
198 user: test
198 user: test
199 date: Thu Jan 01 00:00:00 1970 +0000
199 date: Thu Jan 01 00:00:00 1970 +0000
200 summary: c
200 summary: c
201
201
202
202
203 $ hg --traceback strip 4
203 $ hg --traceback strip 4
204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob)
205 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob)
206 $ hg parents
206 $ hg parents
207 changeset: 1:ef3a871183d7
207 changeset: 1:ef3a871183d7
208 user: test
208 user: test
209 date: Thu Jan 01 00:00:00 1970 +0000
209 date: Thu Jan 01 00:00:00 1970 +0000
210 summary: b
210 summary: b
211
211
212 $ hg debugbundle .hg/strip-backup/*
212 $ hg debugbundle .hg/strip-backup/*
213 Stream params: sortdict([('Compression', 'BZ')])
213 Stream params: sortdict([('Compression', 'BZ')])
214 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
214 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
215 264128213d290d868c54642d13aeaa3675551a78
215 264128213d290d868c54642d13aeaa3675551a78
216 $ hg pull .hg/strip-backup/*
216 $ hg pull .hg/strip-backup/*
217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
217 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
218 searching for changes
218 searching for changes
219 adding changesets
219 adding changesets
220 adding manifests
220 adding manifests
221 adding file changes
221 adding file changes
222 added 1 changesets with 0 changes to 0 files (+1 heads)
222 added 1 changesets with 0 changes to 0 files (+1 heads)
223 (run 'hg heads' to see heads, 'hg merge' to merge)
223 (run 'hg heads' to see heads, 'hg merge' to merge)
224 $ rm .hg/strip-backup/*
224 $ rm .hg/strip-backup/*
225 $ hg log --graph
225 $ hg log --graph
226 o changeset: 4:264128213d29
226 o changeset: 4:264128213d29
227 | tag: tip
227 | tag: tip
228 | parent: 1:ef3a871183d7
228 | parent: 1:ef3a871183d7
229 | user: test
229 | user: test
230 | date: Thu Jan 01 00:00:00 1970 +0000
230 | date: Thu Jan 01 00:00:00 1970 +0000
231 | summary: c
231 | summary: c
232 |
232 |
233 | o changeset: 3:443431ffac4f
233 | o changeset: 3:443431ffac4f
234 | | user: test
234 | | user: test
235 | | date: Thu Jan 01 00:00:00 1970 +0000
235 | | date: Thu Jan 01 00:00:00 1970 +0000
236 | | summary: e
236 | | summary: e
237 | |
237 | |
238 | o changeset: 2:65bd5f99a4a3
238 | o changeset: 2:65bd5f99a4a3
239 |/ user: test
239 |/ user: test
240 | date: Thu Jan 01 00:00:00 1970 +0000
240 | date: Thu Jan 01 00:00:00 1970 +0000
241 | summary: d
241 | summary: d
242 |
242 |
243 @ changeset: 1:ef3a871183d7
243 @ changeset: 1:ef3a871183d7
244 | user: test
244 | user: test
245 | date: Thu Jan 01 00:00:00 1970 +0000
245 | date: Thu Jan 01 00:00:00 1970 +0000
246 | summary: b
246 | summary: b
247 |
247 |
248 o changeset: 0:9ab35a2d17cb
248 o changeset: 0:9ab35a2d17cb
249 user: test
249 user: test
250 date: Thu Jan 01 00:00:00 1970 +0000
250 date: Thu Jan 01 00:00:00 1970 +0000
251 summary: a
251 summary: a
252
252
253 $ hg up -C 2
253 $ hg up -C 2
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
254 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 $ hg merge 4
255 $ hg merge 4
256 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 (branch merge, don't forget to commit)
257 (branch merge, don't forget to commit)
258
258
259 before strip of merge parent
259 before strip of merge parent
260
260
261 $ hg parents
261 $ hg parents
262 changeset: 2:65bd5f99a4a3
262 changeset: 2:65bd5f99a4a3
263 user: test
263 user: test
264 date: Thu Jan 01 00:00:00 1970 +0000
264 date: Thu Jan 01 00:00:00 1970 +0000
265 summary: d
265 summary: d
266
266
267 changeset: 4:264128213d29
267 changeset: 4:264128213d29
268 tag: tip
268 tag: tip
269 parent: 1:ef3a871183d7
269 parent: 1:ef3a871183d7
270 user: test
270 user: test
271 date: Thu Jan 01 00:00:00 1970 +0000
271 date: Thu Jan 01 00:00:00 1970 +0000
272 summary: c
272 summary: c
273
273
274 $ hg strip 4
274 $ hg strip 4
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
276 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
277
277
278 after strip of merge parent
278 after strip of merge parent
279
279
280 $ hg parents
280 $ hg parents
281 changeset: 1:ef3a871183d7
281 changeset: 1:ef3a871183d7
282 user: test
282 user: test
283 date: Thu Jan 01 00:00:00 1970 +0000
283 date: Thu Jan 01 00:00:00 1970 +0000
284 summary: b
284 summary: b
285
285
286 $ restore
286 $ restore
287
287
288 $ hg up
288 $ hg up
289 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
289 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 updated to "264128213d29: c"
290 1 other heads for branch "default"
291 1 other heads for branch "default"
291 $ hg log -G
292 $ hg log -G
292 @ changeset: 4:264128213d29
293 @ changeset: 4:264128213d29
293 | tag: tip
294 | tag: tip
294 | parent: 1:ef3a871183d7
295 | parent: 1:ef3a871183d7
295 | user: test
296 | user: test
296 | date: Thu Jan 01 00:00:00 1970 +0000
297 | date: Thu Jan 01 00:00:00 1970 +0000
297 | summary: c
298 | summary: c
298 |
299 |
299 | o changeset: 3:443431ffac4f
300 | o changeset: 3:443431ffac4f
300 | | user: test
301 | | user: test
301 | | date: Thu Jan 01 00:00:00 1970 +0000
302 | | date: Thu Jan 01 00:00:00 1970 +0000
302 | | summary: e
303 | | summary: e
303 | |
304 | |
304 | o changeset: 2:65bd5f99a4a3
305 | o changeset: 2:65bd5f99a4a3
305 |/ user: test
306 |/ user: test
306 | date: Thu Jan 01 00:00:00 1970 +0000
307 | date: Thu Jan 01 00:00:00 1970 +0000
307 | summary: d
308 | summary: d
308 |
309 |
309 o changeset: 1:ef3a871183d7
310 o changeset: 1:ef3a871183d7
310 | user: test
311 | user: test
311 | date: Thu Jan 01 00:00:00 1970 +0000
312 | date: Thu Jan 01 00:00:00 1970 +0000
312 | summary: b
313 | summary: b
313 |
314 |
314 o changeset: 0:9ab35a2d17cb
315 o changeset: 0:9ab35a2d17cb
315 user: test
316 user: test
316 date: Thu Jan 01 00:00:00 1970 +0000
317 date: Thu Jan 01 00:00:00 1970 +0000
317 summary: a
318 summary: a
318
319
319
320
320 2 is parent of 3, only one strip should happen
321 2 is parent of 3, only one strip should happen
321
322
322 $ hg strip "roots(2)" 3
323 $ hg strip "roots(2)" 3
323 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
324 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
324 $ hg log -G
325 $ hg log -G
325 @ changeset: 2:264128213d29
326 @ changeset: 2:264128213d29
326 | tag: tip
327 | tag: tip
327 | user: test
328 | user: test
328 | date: Thu Jan 01 00:00:00 1970 +0000
329 | date: Thu Jan 01 00:00:00 1970 +0000
329 | summary: c
330 | summary: c
330 |
331 |
331 o changeset: 1:ef3a871183d7
332 o changeset: 1:ef3a871183d7
332 | user: test
333 | user: test
333 | date: Thu Jan 01 00:00:00 1970 +0000
334 | date: Thu Jan 01 00:00:00 1970 +0000
334 | summary: b
335 | summary: b
335 |
336 |
336 o changeset: 0:9ab35a2d17cb
337 o changeset: 0:9ab35a2d17cb
337 user: test
338 user: test
338 date: Thu Jan 01 00:00:00 1970 +0000
339 date: Thu Jan 01 00:00:00 1970 +0000
339 summary: a
340 summary: a
340
341
341 $ restore
342 $ restore
342 $ hg log -G
343 $ hg log -G
343 o changeset: 4:443431ffac4f
344 o changeset: 4:443431ffac4f
344 | tag: tip
345 | tag: tip
345 | user: test
346 | user: test
346 | date: Thu Jan 01 00:00:00 1970 +0000
347 | date: Thu Jan 01 00:00:00 1970 +0000
347 | summary: e
348 | summary: e
348 |
349 |
349 o changeset: 3:65bd5f99a4a3
350 o changeset: 3:65bd5f99a4a3
350 | parent: 1:ef3a871183d7
351 | parent: 1:ef3a871183d7
351 | user: test
352 | user: test
352 | date: Thu Jan 01 00:00:00 1970 +0000
353 | date: Thu Jan 01 00:00:00 1970 +0000
353 | summary: d
354 | summary: d
354 |
355 |
355 | @ changeset: 2:264128213d29
356 | @ changeset: 2:264128213d29
356 |/ user: test
357 |/ user: test
357 | date: Thu Jan 01 00:00:00 1970 +0000
358 | date: Thu Jan 01 00:00:00 1970 +0000
358 | summary: c
359 | summary: c
359 |
360 |
360 o changeset: 1:ef3a871183d7
361 o changeset: 1:ef3a871183d7
361 | user: test
362 | user: test
362 | date: Thu Jan 01 00:00:00 1970 +0000
363 | date: Thu Jan 01 00:00:00 1970 +0000
363 | summary: b
364 | summary: b
364 |
365 |
365 o changeset: 0:9ab35a2d17cb
366 o changeset: 0:9ab35a2d17cb
366 user: test
367 user: test
367 date: Thu Jan 01 00:00:00 1970 +0000
368 date: Thu Jan 01 00:00:00 1970 +0000
368 summary: a
369 summary: a
369
370
370 Failed hook while applying "saveheads" bundle.
371 Failed hook while applying "saveheads" bundle.
371
372
372 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
373 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
373 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
375 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
375 transaction abort!
376 transaction abort!
376 rollback completed
377 rollback completed
377 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
378 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
378 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
379 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
379 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
380 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
380 abort: pretxnchangegroup.bad hook exited with status 1
381 abort: pretxnchangegroup.bad hook exited with status 1
381 [255]
382 [255]
382 $ restore
383 $ restore
383 $ hg log -G
384 $ hg log -G
384 o changeset: 4:443431ffac4f
385 o changeset: 4:443431ffac4f
385 | tag: tip
386 | tag: tip
386 | user: test
387 | user: test
387 | date: Thu Jan 01 00:00:00 1970 +0000
388 | date: Thu Jan 01 00:00:00 1970 +0000
388 | summary: e
389 | summary: e
389 |
390 |
390 o changeset: 3:65bd5f99a4a3
391 o changeset: 3:65bd5f99a4a3
391 | parent: 1:ef3a871183d7
392 | parent: 1:ef3a871183d7
392 | user: test
393 | user: test
393 | date: Thu Jan 01 00:00:00 1970 +0000
394 | date: Thu Jan 01 00:00:00 1970 +0000
394 | summary: d
395 | summary: d
395 |
396 |
396 | o changeset: 2:264128213d29
397 | o changeset: 2:264128213d29
397 |/ user: test
398 |/ user: test
398 | date: Thu Jan 01 00:00:00 1970 +0000
399 | date: Thu Jan 01 00:00:00 1970 +0000
399 | summary: c
400 | summary: c
400 |
401 |
401 @ changeset: 1:ef3a871183d7
402 @ changeset: 1:ef3a871183d7
402 | user: test
403 | user: test
403 | date: Thu Jan 01 00:00:00 1970 +0000
404 | date: Thu Jan 01 00:00:00 1970 +0000
404 | summary: b
405 | summary: b
405 |
406 |
406 o changeset: 0:9ab35a2d17cb
407 o changeset: 0:9ab35a2d17cb
407 user: test
408 user: test
408 date: Thu Jan 01 00:00:00 1970 +0000
409 date: Thu Jan 01 00:00:00 1970 +0000
409 summary: a
410 summary: a
410
411
411
412
412 2 different branches: 2 strips
413 2 different branches: 2 strips
413
414
414 $ hg strip 2 4
415 $ hg strip 2 4
415 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
416 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
416 $ hg log -G
417 $ hg log -G
417 o changeset: 2:65bd5f99a4a3
418 o changeset: 2:65bd5f99a4a3
418 | tag: tip
419 | tag: tip
419 | user: test
420 | user: test
420 | date: Thu Jan 01 00:00:00 1970 +0000
421 | date: Thu Jan 01 00:00:00 1970 +0000
421 | summary: d
422 | summary: d
422 |
423 |
423 @ changeset: 1:ef3a871183d7
424 @ changeset: 1:ef3a871183d7
424 | user: test
425 | user: test
425 | date: Thu Jan 01 00:00:00 1970 +0000
426 | date: Thu Jan 01 00:00:00 1970 +0000
426 | summary: b
427 | summary: b
427 |
428 |
428 o changeset: 0:9ab35a2d17cb
429 o changeset: 0:9ab35a2d17cb
429 user: test
430 user: test
430 date: Thu Jan 01 00:00:00 1970 +0000
431 date: Thu Jan 01 00:00:00 1970 +0000
431 summary: a
432 summary: a
432
433
433 $ restore
434 $ restore
434
435
435 2 different branches and a common ancestor: 1 strip
436 2 different branches and a common ancestor: 1 strip
436
437
437 $ hg strip 1 "2|4"
438 $ hg strip 1 "2|4"
438 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
439 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
439 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
440 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
440 $ restore
441 $ restore
441
442
442 verify fncache is kept up-to-date
443 verify fncache is kept up-to-date
443
444
444 $ touch a
445 $ touch a
445 $ hg ci -qAm a
446 $ hg ci -qAm a
446 $ cat .hg/store/fncache | sort
447 $ cat .hg/store/fncache | sort
447 data/a.i
448 data/a.i
448 data/bar.i
449 data/bar.i
449 $ hg strip tip
450 $ hg strip tip
450 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
451 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
451 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
452 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
452 $ cat .hg/store/fncache
453 $ cat .hg/store/fncache
453 data/bar.i
454 data/bar.i
454
455
455 stripping an empty revset
456 stripping an empty revset
456
457
457 $ hg strip "1 and not 1"
458 $ hg strip "1 and not 1"
458 abort: empty revision set
459 abort: empty revision set
459 [255]
460 [255]
460
461
461 remove branchy history for qimport tests
462 remove branchy history for qimport tests
462
463
463 $ hg strip 3
464 $ hg strip 3
464 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
465 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
465
466
466
467
467 strip of applied mq should cleanup status file
468 strip of applied mq should cleanup status file
468
469
469 $ echo "mq=" >> $HGRCPATH
470 $ echo "mq=" >> $HGRCPATH
470 $ hg up -C 3
471 $ hg up -C 3
471 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 $ echo fooagain >> bar
473 $ echo fooagain >> bar
473 $ hg ci -mf
474 $ hg ci -mf
474 $ hg qimport -r tip:2
475 $ hg qimport -r tip:2
475
476
476 applied patches before strip
477 applied patches before strip
477
478
478 $ hg qapplied
479 $ hg qapplied
479 d
480 d
480 e
481 e
481 f
482 f
482
483
483 stripping revision in queue
484 stripping revision in queue
484
485
485 $ hg strip 3
486 $ hg strip 3
486 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
488 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
488
489
489 applied patches after stripping rev in queue
490 applied patches after stripping rev in queue
490
491
491 $ hg qapplied
492 $ hg qapplied
492 d
493 d
493
494
494 stripping ancestor of queue
495 stripping ancestor of queue
495
496
496 $ hg strip 1
497 $ hg strip 1
497 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
499 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
499
500
500 applied patches after stripping ancestor of queue
501 applied patches after stripping ancestor of queue
501
502
502 $ hg qapplied
503 $ hg qapplied
503
504
504 Verify strip protects against stripping wc parent when there are uncommitted mods
505 Verify strip protects against stripping wc parent when there are uncommitted mods
505
506
506 $ echo b > b
507 $ echo b > b
507 $ echo bb > bar
508 $ echo bb > bar
508 $ hg add b
509 $ hg add b
509 $ hg ci -m 'b'
510 $ hg ci -m 'b'
510 $ hg log --graph
511 $ hg log --graph
511 @ changeset: 1:76dcf9fab855
512 @ changeset: 1:76dcf9fab855
512 | tag: tip
513 | tag: tip
513 | user: test
514 | user: test
514 | date: Thu Jan 01 00:00:00 1970 +0000
515 | date: Thu Jan 01 00:00:00 1970 +0000
515 | summary: b
516 | summary: b
516 |
517 |
517 o changeset: 0:9ab35a2d17cb
518 o changeset: 0:9ab35a2d17cb
518 user: test
519 user: test
519 date: Thu Jan 01 00:00:00 1970 +0000
520 date: Thu Jan 01 00:00:00 1970 +0000
520 summary: a
521 summary: a
521
522
522 $ hg up 0
523 $ hg up 0
523 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
524 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
524 $ echo c > bar
525 $ echo c > bar
525 $ hg up -t false
526 $ hg up -t false
526 merging bar
527 merging bar
527 merging bar failed!
528 merging bar failed!
528 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
529 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
529 use 'hg resolve' to retry unresolved file merges
530 use 'hg resolve' to retry unresolved file merges
530 [1]
531 [1]
531 $ hg sum
532 $ hg sum
532 parent: 1:76dcf9fab855 tip
533 parent: 1:76dcf9fab855 tip
533 b
534 b
534 branch: default
535 branch: default
535 commit: 1 modified, 1 unknown, 1 unresolved
536 commit: 1 modified, 1 unknown, 1 unresolved
536 update: (current)
537 update: (current)
537 phases: 2 draft
538 phases: 2 draft
538 mq: 3 unapplied
539 mq: 3 unapplied
539
540
540 $ echo c > b
541 $ echo c > b
541 $ hg strip tip
542 $ hg strip tip
542 abort: local changes found
543 abort: local changes found
543 [255]
544 [255]
544 $ hg strip tip --keep
545 $ hg strip tip --keep
545 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
546 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
546 $ hg log --graph
547 $ hg log --graph
547 @ changeset: 0:9ab35a2d17cb
548 @ changeset: 0:9ab35a2d17cb
548 tag: tip
549 tag: tip
549 user: test
550 user: test
550 date: Thu Jan 01 00:00:00 1970 +0000
551 date: Thu Jan 01 00:00:00 1970 +0000
551 summary: a
552 summary: a
552
553
553 $ hg status
554 $ hg status
554 M bar
555 M bar
555 ? b
556 ? b
556 ? bar.orig
557 ? bar.orig
557
558
558 $ rm bar.orig
559 $ rm bar.orig
559 $ hg sum
560 $ hg sum
560 parent: 0:9ab35a2d17cb tip
561 parent: 0:9ab35a2d17cb tip
561 a
562 a
562 branch: default
563 branch: default
563 commit: 1 modified, 1 unknown
564 commit: 1 modified, 1 unknown
564 update: (current)
565 update: (current)
565 phases: 1 draft
566 phases: 1 draft
566 mq: 3 unapplied
567 mq: 3 unapplied
567
568
568 Strip adds, removes, modifies with --keep
569 Strip adds, removes, modifies with --keep
569
570
570 $ touch b
571 $ touch b
571 $ hg add b
572 $ hg add b
572 $ hg commit -mb
573 $ hg commit -mb
573 $ touch c
574 $ touch c
574
575
575 ... with a clean working dir
576 ... with a clean working dir
576
577
577 $ hg add c
578 $ hg add c
578 $ hg rm bar
579 $ hg rm bar
579 $ hg commit -mc
580 $ hg commit -mc
580 $ hg status
581 $ hg status
581 $ hg strip --keep tip
582 $ hg strip --keep tip
582 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
583 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
583 $ hg status
584 $ hg status
584 ! bar
585 ! bar
585 ? c
586 ? c
586
587
587 ... with a dirty working dir
588 ... with a dirty working dir
588
589
589 $ hg add c
590 $ hg add c
590 $ hg rm bar
591 $ hg rm bar
591 $ hg commit -mc
592 $ hg commit -mc
592 $ hg status
593 $ hg status
593 $ echo b > b
594 $ echo b > b
594 $ echo d > d
595 $ echo d > d
595 $ hg strip --keep tip
596 $ hg strip --keep tip
596 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
597 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
597 $ hg status
598 $ hg status
598 M b
599 M b
599 ! bar
600 ! bar
600 ? c
601 ? c
601 ? d
602 ? d
602
603
603 ... after updating the dirstate
604 ... after updating the dirstate
604 $ hg add c
605 $ hg add c
605 $ hg commit -mc
606 $ hg commit -mc
606 $ hg rm c
607 $ hg rm c
607 $ hg commit -mc
608 $ hg commit -mc
608 $ hg strip --keep '.^' -q
609 $ hg strip --keep '.^' -q
609 $ cd ..
610 $ cd ..
610
611
611 stripping many nodes on a complex graph (issue3299)
612 stripping many nodes on a complex graph (issue3299)
612
613
613 $ hg init issue3299
614 $ hg init issue3299
614 $ cd issue3299
615 $ cd issue3299
615 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
616 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
616 $ hg strip 'not ancestors(x)'
617 $ hg strip 'not ancestors(x)'
617 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
618 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
618
619
619 test hg strip -B bookmark
620 test hg strip -B bookmark
620
621
621 $ cd ..
622 $ cd ..
622 $ hg init bookmarks
623 $ hg init bookmarks
623 $ cd bookmarks
624 $ cd bookmarks
624 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
625 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
625 $ hg bookmark -r 'a' 'todelete'
626 $ hg bookmark -r 'a' 'todelete'
626 $ hg bookmark -r 'b' 'B'
627 $ hg bookmark -r 'b' 'B'
627 $ hg bookmark -r 'b' 'nostrip'
628 $ hg bookmark -r 'b' 'nostrip'
628 $ hg bookmark -r 'c' 'delete'
629 $ hg bookmark -r 'c' 'delete'
629 $ hg bookmark -r 'd' 'multipledelete1'
630 $ hg bookmark -r 'd' 'multipledelete1'
630 $ hg bookmark -r 'e' 'multipledelete2'
631 $ hg bookmark -r 'e' 'multipledelete2'
631 $ hg bookmark -r 'f' 'singlenode1'
632 $ hg bookmark -r 'f' 'singlenode1'
632 $ hg bookmark -r 'f' 'singlenode2'
633 $ hg bookmark -r 'f' 'singlenode2'
633 $ hg up -C todelete
634 $ hg up -C todelete
634 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
635 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
635 (activating bookmark todelete)
636 (activating bookmark todelete)
636 $ hg strip -B nostrip
637 $ hg strip -B nostrip
637 bookmark 'nostrip' deleted
638 bookmark 'nostrip' deleted
638 abort: empty revision set
639 abort: empty revision set
639 [255]
640 [255]
640 $ hg strip -B todelete
641 $ hg strip -B todelete
641 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
642 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
642 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
643 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
643 bookmark 'todelete' deleted
644 bookmark 'todelete' deleted
644 $ hg id -ir dcbb326fdec2
645 $ hg id -ir dcbb326fdec2
645 abort: unknown revision 'dcbb326fdec2'!
646 abort: unknown revision 'dcbb326fdec2'!
646 [255]
647 [255]
647 $ hg id -ir d62d843c9a01
648 $ hg id -ir d62d843c9a01
648 d62d843c9a01
649 d62d843c9a01
649 $ hg bookmarks
650 $ hg bookmarks
650 B 9:ff43616e5d0f
651 B 9:ff43616e5d0f
651 delete 6:2702dd0c91e7
652 delete 6:2702dd0c91e7
652 multipledelete1 11:e46a4836065c
653 multipledelete1 11:e46a4836065c
653 multipledelete2 12:b4594d867745
654 multipledelete2 12:b4594d867745
654 singlenode1 13:43227190fef8
655 singlenode1 13:43227190fef8
655 singlenode2 13:43227190fef8
656 singlenode2 13:43227190fef8
656 $ hg strip -B multipledelete1 -B multipledelete2
657 $ hg strip -B multipledelete1 -B multipledelete2
657 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob)
658 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob)
658 bookmark 'multipledelete1' deleted
659 bookmark 'multipledelete1' deleted
659 bookmark 'multipledelete2' deleted
660 bookmark 'multipledelete2' deleted
660 $ hg id -ir e46a4836065c
661 $ hg id -ir e46a4836065c
661 abort: unknown revision 'e46a4836065c'!
662 abort: unknown revision 'e46a4836065c'!
662 [255]
663 [255]
663 $ hg id -ir b4594d867745
664 $ hg id -ir b4594d867745
664 abort: unknown revision 'b4594d867745'!
665 abort: unknown revision 'b4594d867745'!
665 [255]
666 [255]
666 $ hg strip -B singlenode1 -B singlenode2
667 $ hg strip -B singlenode1 -B singlenode2
667 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob)
668 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob)
668 bookmark 'singlenode1' deleted
669 bookmark 'singlenode1' deleted
669 bookmark 'singlenode2' deleted
670 bookmark 'singlenode2' deleted
670 $ hg id -ir 43227190fef8
671 $ hg id -ir 43227190fef8
671 abort: unknown revision '43227190fef8'!
672 abort: unknown revision '43227190fef8'!
672 [255]
673 [255]
673 $ hg strip -B unknownbookmark
674 $ hg strip -B unknownbookmark
674 abort: bookmark 'unknownbookmark' not found
675 abort: bookmark 'unknownbookmark' not found
675 [255]
676 [255]
676 $ hg strip -B unknownbookmark1 -B unknownbookmark2
677 $ hg strip -B unknownbookmark1 -B unknownbookmark2
677 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
678 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
678 [255]
679 [255]
679 $ hg strip -B delete -B unknownbookmark
680 $ hg strip -B delete -B unknownbookmark
680 abort: bookmark 'unknownbookmark' not found
681 abort: bookmark 'unknownbookmark' not found
681 [255]
682 [255]
682 $ hg strip -B delete
683 $ hg strip -B delete
683 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
684 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
684 bookmark 'delete' deleted
685 bookmark 'delete' deleted
685 $ hg id -ir 6:2702dd0c91e7
686 $ hg id -ir 6:2702dd0c91e7
686 abort: unknown revision '2702dd0c91e7'!
687 abort: unknown revision '2702dd0c91e7'!
687 [255]
688 [255]
688 $ hg update B
689 $ hg update B
689 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 (activating bookmark B)
691 (activating bookmark B)
691 $ echo a > a
692 $ echo a > a
692 $ hg add a
693 $ hg add a
693 $ hg strip -B B
694 $ hg strip -B B
694 abort: local changes found
695 abort: local changes found
695 [255]
696 [255]
696 $ hg bookmarks
697 $ hg bookmarks
697 * B 6:ff43616e5d0f
698 * B 6:ff43616e5d0f
698
699
699 Make sure no one adds back a -b option:
700 Make sure no one adds back a -b option:
700
701
701 $ hg strip -b tip
702 $ hg strip -b tip
702 hg strip: option -b not recognized
703 hg strip: option -b not recognized
703 hg strip [-k] [-f] [-B bookmark] [-r] REV...
704 hg strip [-k] [-f] [-B bookmark] [-r] REV...
704
705
705 strip changesets and all their descendants from the repository
706 strip changesets and all their descendants from the repository
706
707
707 (use 'hg help -e strip' to show help for the strip extension)
708 (use 'hg help -e strip' to show help for the strip extension)
708
709
709 options ([+] can be repeated):
710 options ([+] can be repeated):
710
711
711 -r --rev REV [+] strip specified revision (optional, can specify
712 -r --rev REV [+] strip specified revision (optional, can specify
712 revisions without this option)
713 revisions without this option)
713 -f --force force removal of changesets, discard uncommitted
714 -f --force force removal of changesets, discard uncommitted
714 changes (no backup)
715 changes (no backup)
715 --no-backup no backups
716 --no-backup no backups
716 -k --keep do not modify working directory during strip
717 -k --keep do not modify working directory during strip
717 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
718 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
718 --mq operate on patch repository
719 --mq operate on patch repository
719
720
720 (use 'hg strip -h' to show more help)
721 (use 'hg strip -h' to show more help)
721 [255]
722 [255]
722
723
723 $ cd ..
724 $ cd ..
724
725
725 Verify bundles don't get overwritten:
726 Verify bundles don't get overwritten:
726
727
727 $ hg init doublebundle
728 $ hg init doublebundle
728 $ cd doublebundle
729 $ cd doublebundle
729 $ touch a
730 $ touch a
730 $ hg commit -Aqm a
731 $ hg commit -Aqm a
731 $ touch b
732 $ touch b
732 $ hg commit -Aqm b
733 $ hg commit -Aqm b
733 $ hg strip -r 0
734 $ hg strip -r 0
734 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
735 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
735 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob)
736 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob)
736 $ ls .hg/strip-backup
737 $ ls .hg/strip-backup
737 3903775176ed-e68910bd-backup.hg
738 3903775176ed-e68910bd-backup.hg
738 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
739 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
739 $ hg strip -r 0
740 $ hg strip -r 0
740 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob)
741 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob)
741 $ ls .hg/strip-backup
742 $ ls .hg/strip-backup
742 3903775176ed-54390173-backup.hg
743 3903775176ed-54390173-backup.hg
743 3903775176ed-e68910bd-backup.hg
744 3903775176ed-e68910bd-backup.hg
744 $ cd ..
745 $ cd ..
745
746
746 Test that we only bundle the stripped changesets (issue4736)
747 Test that we only bundle the stripped changesets (issue4736)
747 ------------------------------------------------------------
748 ------------------------------------------------------------
748
749
749 initialization (previous repo is empty anyway)
750 initialization (previous repo is empty anyway)
750
751
751 $ hg init issue4736
752 $ hg init issue4736
752 $ cd issue4736
753 $ cd issue4736
753 $ echo a > a
754 $ echo a > a
754 $ hg add a
755 $ hg add a
755 $ hg commit -m commitA
756 $ hg commit -m commitA
756 $ echo b > b
757 $ echo b > b
757 $ hg add b
758 $ hg add b
758 $ hg commit -m commitB
759 $ hg commit -m commitB
759 $ echo c > c
760 $ echo c > c
760 $ hg add c
761 $ hg add c
761 $ hg commit -m commitC
762 $ hg commit -m commitC
762 $ hg up 'desc(commitB)'
763 $ hg up 'desc(commitB)'
763 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
764 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
764 $ echo d > d
765 $ echo d > d
765 $ hg add d
766 $ hg add d
766 $ hg commit -m commitD
767 $ hg commit -m commitD
767 created new head
768 created new head
768 $ hg up 'desc(commitC)'
769 $ hg up 'desc(commitC)'
769 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
770 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
770 $ hg merge 'desc(commitD)'
771 $ hg merge 'desc(commitD)'
771 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
772 (branch merge, don't forget to commit)
773 (branch merge, don't forget to commit)
773 $ hg ci -m 'mergeCD'
774 $ hg ci -m 'mergeCD'
774 $ hg log -G
775 $ hg log -G
775 @ changeset: 4:d8db9d137221
776 @ changeset: 4:d8db9d137221
776 |\ tag: tip
777 |\ tag: tip
777 | | parent: 2:5c51d8d6557d
778 | | parent: 2:5c51d8d6557d
778 | | parent: 3:6625a5168474
779 | | parent: 3:6625a5168474
779 | | user: test
780 | | user: test
780 | | date: Thu Jan 01 00:00:00 1970 +0000
781 | | date: Thu Jan 01 00:00:00 1970 +0000
781 | | summary: mergeCD
782 | | summary: mergeCD
782 | |
783 | |
783 | o changeset: 3:6625a5168474
784 | o changeset: 3:6625a5168474
784 | | parent: 1:eca11cf91c71
785 | | parent: 1:eca11cf91c71
785 | | user: test
786 | | user: test
786 | | date: Thu Jan 01 00:00:00 1970 +0000
787 | | date: Thu Jan 01 00:00:00 1970 +0000
787 | | summary: commitD
788 | | summary: commitD
788 | |
789 | |
789 o | changeset: 2:5c51d8d6557d
790 o | changeset: 2:5c51d8d6557d
790 |/ user: test
791 |/ user: test
791 | date: Thu Jan 01 00:00:00 1970 +0000
792 | date: Thu Jan 01 00:00:00 1970 +0000
792 | summary: commitC
793 | summary: commitC
793 |
794 |
794 o changeset: 1:eca11cf91c71
795 o changeset: 1:eca11cf91c71
795 | user: test
796 | user: test
796 | date: Thu Jan 01 00:00:00 1970 +0000
797 | date: Thu Jan 01 00:00:00 1970 +0000
797 | summary: commitB
798 | summary: commitB
798 |
799 |
799 o changeset: 0:105141ef12d0
800 o changeset: 0:105141ef12d0
800 user: test
801 user: test
801 date: Thu Jan 01 00:00:00 1970 +0000
802 date: Thu Jan 01 00:00:00 1970 +0000
802 summary: commitA
803 summary: commitA
803
804
804
805
805 Check bundle behavior:
806 Check bundle behavior:
806
807
807 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
808 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
808 2 changesets found
809 2 changesets found
809 $ hg log -r 'bundle()' -R ../issue4736.hg
810 $ hg log -r 'bundle()' -R ../issue4736.hg
810 changeset: 3:6625a5168474
811 changeset: 3:6625a5168474
811 parent: 1:eca11cf91c71
812 parent: 1:eca11cf91c71
812 user: test
813 user: test
813 date: Thu Jan 01 00:00:00 1970 +0000
814 date: Thu Jan 01 00:00:00 1970 +0000
814 summary: commitD
815 summary: commitD
815
816
816 changeset: 4:d8db9d137221
817 changeset: 4:d8db9d137221
817 tag: tip
818 tag: tip
818 parent: 2:5c51d8d6557d
819 parent: 2:5c51d8d6557d
819 parent: 3:6625a5168474
820 parent: 3:6625a5168474
820 user: test
821 user: test
821 date: Thu Jan 01 00:00:00 1970 +0000
822 date: Thu Jan 01 00:00:00 1970 +0000
822 summary: mergeCD
823 summary: mergeCD
823
824
824
825
825 check strip behavior
826 check strip behavior
826
827
827 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
828 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
828 resolving manifests
829 resolving manifests
829 branchmerge: False, force: True, partial: False
830 branchmerge: False, force: True, partial: False
830 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
831 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
831 c: other deleted -> r
832 c: other deleted -> r
832 removing c
833 removing c
833 d: other deleted -> r
834 d: other deleted -> r
834 removing d
835 removing d
835 starting 4 threads for background file closing (?)
836 starting 4 threads for background file closing (?)
836 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
837 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
837 2 changesets found
838 2 changesets found
838 list of changesets:
839 list of changesets:
839 6625a516847449b6f0fa3737b9ba56e9f0f3032c
840 6625a516847449b6f0fa3737b9ba56e9f0f3032c
840 d8db9d1372214336d2b5570f20ee468d2c72fa8b
841 d8db9d1372214336d2b5570f20ee468d2c72fa8b
841 bundle2-output-bundle: "HG20", (1 params) 1 parts total
842 bundle2-output-bundle: "HG20", (1 params) 1 parts total
842 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
843 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
843 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob)
844 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob)
844 updating the branch cache
845 updating the branch cache
845 invalid branchheads cache (served): tip differs
846 invalid branchheads cache (served): tip differs
846 truncating cache/rbc-revs-v1 to 24
847 truncating cache/rbc-revs-v1 to 24
847 $ hg log -G
848 $ hg log -G
848 o changeset: 2:5c51d8d6557d
849 o changeset: 2:5c51d8d6557d
849 | tag: tip
850 | tag: tip
850 | user: test
851 | user: test
851 | date: Thu Jan 01 00:00:00 1970 +0000
852 | date: Thu Jan 01 00:00:00 1970 +0000
852 | summary: commitC
853 | summary: commitC
853 |
854 |
854 @ changeset: 1:eca11cf91c71
855 @ changeset: 1:eca11cf91c71
855 | user: test
856 | user: test
856 | date: Thu Jan 01 00:00:00 1970 +0000
857 | date: Thu Jan 01 00:00:00 1970 +0000
857 | summary: commitB
858 | summary: commitB
858 |
859 |
859 o changeset: 0:105141ef12d0
860 o changeset: 0:105141ef12d0
860 user: test
861 user: test
861 date: Thu Jan 01 00:00:00 1970 +0000
862 date: Thu Jan 01 00:00:00 1970 +0000
862 summary: commitA
863 summary: commitA
863
864
864
865
865 strip backup content
866 strip backup content
866
867
867 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
868 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
868 changeset: 3:6625a5168474
869 changeset: 3:6625a5168474
869 parent: 1:eca11cf91c71
870 parent: 1:eca11cf91c71
870 user: test
871 user: test
871 date: Thu Jan 01 00:00:00 1970 +0000
872 date: Thu Jan 01 00:00:00 1970 +0000
872 summary: commitD
873 summary: commitD
873
874
874 changeset: 4:d8db9d137221
875 changeset: 4:d8db9d137221
875 tag: tip
876 tag: tip
876 parent: 2:5c51d8d6557d
877 parent: 2:5c51d8d6557d
877 parent: 3:6625a5168474
878 parent: 3:6625a5168474
878 user: test
879 user: test
879 date: Thu Jan 01 00:00:00 1970 +0000
880 date: Thu Jan 01 00:00:00 1970 +0000
880 summary: mergeCD
881 summary: mergeCD
881
882
882 Check that the phase cache is properly invalidated after a strip with bookmark.
883 Check that the phase cache is properly invalidated after a strip with bookmark.
883
884
884 $ cat > ../stripstalephasecache.py << EOF
885 $ cat > ../stripstalephasecache.py << EOF
885 > from mercurial import extensions, localrepo
886 > from mercurial import extensions, localrepo
886 > def transactioncallback(orig, repo, desc, *args, **kwargs):
887 > def transactioncallback(orig, repo, desc, *args, **kwargs):
887 > def test(transaction):
888 > def test(transaction):
888 > # observe cache inconsistency
889 > # observe cache inconsistency
889 > try:
890 > try:
890 > [repo.changelog.node(r) for r in repo.revs("not public()")]
891 > [repo.changelog.node(r) for r in repo.revs("not public()")]
891 > except IndexError:
892 > except IndexError:
892 > repo.ui.status("Index error!\n")
893 > repo.ui.status("Index error!\n")
893 > transaction = orig(repo, desc, *args, **kwargs)
894 > transaction = orig(repo, desc, *args, **kwargs)
894 > # warm up the phase cache
895 > # warm up the phase cache
895 > list(repo.revs("not public()"))
896 > list(repo.revs("not public()"))
896 > if desc != 'strip':
897 > if desc != 'strip':
897 > transaction.addpostclose("phase invalidation test", test)
898 > transaction.addpostclose("phase invalidation test", test)
898 > return transaction
899 > return transaction
899 > def extsetup(ui):
900 > def extsetup(ui):
900 > extensions.wrapfunction(localrepo.localrepository, "transaction",
901 > extensions.wrapfunction(localrepo.localrepository, "transaction",
901 > transactioncallback)
902 > transactioncallback)
902 > EOF
903 > EOF
903 $ hg up -C 2
904 $ hg up -C 2
904 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
905 $ echo k > k
906 $ echo k > k
906 $ hg add k
907 $ hg add k
907 $ hg commit -m commitK
908 $ hg commit -m commitK
908 $ echo l > l
909 $ echo l > l
909 $ hg add l
910 $ hg add l
910 $ hg commit -m commitL
911 $ hg commit -m commitL
911 $ hg book -r tip blah
912 $ hg book -r tip blah
912 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
913 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
913 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
914 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
914 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob)
915 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob)
915 $ hg up -C 1
916 $ hg up -C 1
916 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
917 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
917
918
918 Error during post-close callback of the strip transaction
919 Error during post-close callback of the strip transaction
919 (They should be gracefully handled and reported)
920 (They should be gracefully handled and reported)
920
921
921 $ cat > ../crashstrip.py << EOF
922 $ cat > ../crashstrip.py << EOF
922 > from mercurial import error
923 > from mercurial import error
923 > def reposetup(ui, repo):
924 > def reposetup(ui, repo):
924 > class crashstriprepo(repo.__class__):
925 > class crashstriprepo(repo.__class__):
925 > def transaction(self, desc, *args, **kwargs):
926 > def transaction(self, desc, *args, **kwargs):
926 > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs)
927 > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs)
927 > if desc == 'strip':
928 > if desc == 'strip':
928 > def crash(tra): raise error.Abort('boom')
929 > def crash(tra): raise error.Abort('boom')
929 > tr.addpostclose('crash', crash)
930 > tr.addpostclose('crash', crash)
930 > return tr
931 > return tr
931 > repo.__class__ = crashstriprepo
932 > repo.__class__ = crashstriprepo
932 > EOF
933 > EOF
933 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
934 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
934 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob)
935 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob)
935 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob)
936 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob)
936 abort: boom
937 abort: boom
937 [255]
938 [255]
938
939
939
940
@@ -1,1787 +1,1791
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 first revision, no sub
9 first revision, no sub
10
10
11 $ echo a > a
11 $ echo a > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 adding a
13 adding a
14
14
15 add first sub
15 add first sub
16
16
17 $ echo s = s > .hgsub
17 $ echo s = s > .hgsub
18 $ hg add .hgsub
18 $ hg add .hgsub
19 $ hg init s
19 $ hg init s
20 $ echo a > s/a
20 $ echo a > s/a
21
21
22 Issue2232: committing a subrepo without .hgsub
22 Issue2232: committing a subrepo without .hgsub
23
23
24 $ hg ci -mbad s
24 $ hg ci -mbad s
25 abort: can't commit subrepos without .hgsub
25 abort: can't commit subrepos without .hgsub
26 [255]
26 [255]
27
27
28 $ hg -R s add s/a
28 $ hg -R s add s/a
29 $ hg files -S
29 $ hg files -S
30 .hgsub
30 .hgsub
31 a
31 a
32 s/a (glob)
32 s/a (glob)
33
33
34 $ hg -R s ci -Ams0
34 $ hg -R s ci -Ams0
35 $ hg sum
35 $ hg sum
36 parent: 0:f7b1eb17ad24 tip
36 parent: 0:f7b1eb17ad24 tip
37 0
37 0
38 branch: default
38 branch: default
39 commit: 1 added, 1 subrepos
39 commit: 1 added, 1 subrepos
40 update: (current)
40 update: (current)
41 phases: 1 draft
41 phases: 1 draft
42 $ hg ci -m1
42 $ hg ci -m1
43
43
44 test handling .hgsubstate "added" explicitly.
44 test handling .hgsubstate "added" explicitly.
45
45
46 $ hg parents --template '{node}\n{files}\n'
46 $ hg parents --template '{node}\n{files}\n'
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
47 7cf8cfea66e410e8e3336508dfeec07b3192de51
48 .hgsub .hgsubstate
48 .hgsub .hgsubstate
49 $ hg rollback -q
49 $ hg rollback -q
50 $ hg add .hgsubstate
50 $ hg add .hgsubstate
51 $ hg ci -m1
51 $ hg ci -m1
52 $ hg parents --template '{node}\n{files}\n'
52 $ hg parents --template '{node}\n{files}\n'
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
53 7cf8cfea66e410e8e3336508dfeec07b3192de51
54 .hgsub .hgsubstate
54 .hgsub .hgsubstate
55
55
56 Subrepopath which overlaps with filepath, does not change warnings in remove()
56 Subrepopath which overlaps with filepath, does not change warnings in remove()
57
57
58 $ mkdir snot
58 $ mkdir snot
59 $ touch snot/file
59 $ touch snot/file
60 $ hg remove -S snot/file
60 $ hg remove -S snot/file
61 not removing snot/file: file is untracked (glob)
61 not removing snot/file: file is untracked (glob)
62 [1]
62 [1]
63 $ hg cat snot/filenot
63 $ hg cat snot/filenot
64 snot/filenot: no such file in rev 7cf8cfea66e4 (glob)
64 snot/filenot: no such file in rev 7cf8cfea66e4 (glob)
65 [1]
65 [1]
66 $ rm -r snot
66 $ rm -r snot
67
67
68 Revert subrepo and test subrepo fileset keyword:
68 Revert subrepo and test subrepo fileset keyword:
69
69
70 $ echo b > s/a
70 $ echo b > s/a
71 $ hg revert --dry-run "set:subrepo('glob:s*')"
71 $ hg revert --dry-run "set:subrepo('glob:s*')"
72 reverting subrepo s
72 reverting subrepo s
73 reverting s/a (glob)
73 reverting s/a (glob)
74 $ cat s/a
74 $ cat s/a
75 b
75 b
76 $ hg revert "set:subrepo('glob:s*')"
76 $ hg revert "set:subrepo('glob:s*')"
77 reverting subrepo s
77 reverting subrepo s
78 reverting s/a (glob)
78 reverting s/a (glob)
79 $ cat s/a
79 $ cat s/a
80 a
80 a
81 $ rm s/a.orig
81 $ rm s/a.orig
82
82
83 Revert subrepo with no backup. The "reverting s/a" line is gone since
83 Revert subrepo with no backup. The "reverting s/a" line is gone since
84 we're really running 'hg update' in the subrepo:
84 we're really running 'hg update' in the subrepo:
85
85
86 $ echo b > s/a
86 $ echo b > s/a
87 $ hg revert --no-backup s
87 $ hg revert --no-backup s
88 reverting subrepo s
88 reverting subrepo s
89
89
90 Issue2022: update -C
90 Issue2022: update -C
91
91
92 $ echo b > s/a
92 $ echo b > s/a
93 $ hg sum
93 $ hg sum
94 parent: 1:7cf8cfea66e4 tip
94 parent: 1:7cf8cfea66e4 tip
95 1
95 1
96 branch: default
96 branch: default
97 commit: 1 subrepos
97 commit: 1 subrepos
98 update: (current)
98 update: (current)
99 phases: 2 draft
99 phases: 2 draft
100 $ hg co -C 1
100 $ hg co -C 1
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 $ hg sum
102 $ hg sum
103 parent: 1:7cf8cfea66e4 tip
103 parent: 1:7cf8cfea66e4 tip
104 1
104 1
105 branch: default
105 branch: default
106 commit: (clean)
106 commit: (clean)
107 update: (current)
107 update: (current)
108 phases: 2 draft
108 phases: 2 draft
109
109
110 commands that require a clean repo should respect subrepos
110 commands that require a clean repo should respect subrepos
111
111
112 $ echo b >> s/a
112 $ echo b >> s/a
113 $ hg backout tip
113 $ hg backout tip
114 abort: uncommitted changes in subrepository 's'
114 abort: uncommitted changes in subrepository 's'
115 [255]
115 [255]
116 $ hg revert -C -R s s/a
116 $ hg revert -C -R s s/a
117
117
118 add sub sub
118 add sub sub
119
119
120 $ echo ss = ss > s/.hgsub
120 $ echo ss = ss > s/.hgsub
121 $ hg init s/ss
121 $ hg init s/ss
122 $ echo a > s/ss/a
122 $ echo a > s/ss/a
123 $ hg -R s add s/.hgsub
123 $ hg -R s add s/.hgsub
124 $ hg -R s/ss add s/ss/a
124 $ hg -R s/ss add s/ss/a
125 $ hg sum
125 $ hg sum
126 parent: 1:7cf8cfea66e4 tip
126 parent: 1:7cf8cfea66e4 tip
127 1
127 1
128 branch: default
128 branch: default
129 commit: 1 subrepos
129 commit: 1 subrepos
130 update: (current)
130 update: (current)
131 phases: 2 draft
131 phases: 2 draft
132 $ hg ci -m2
132 $ hg ci -m2
133 committing subrepository s
133 committing subrepository s
134 committing subrepository s/ss (glob)
134 committing subrepository s/ss (glob)
135 $ hg sum
135 $ hg sum
136 parent: 2:df30734270ae tip
136 parent: 2:df30734270ae tip
137 2
137 2
138 branch: default
138 branch: default
139 commit: (clean)
139 commit: (clean)
140 update: (current)
140 update: (current)
141 phases: 3 draft
141 phases: 3 draft
142
142
143 test handling .hgsubstate "modified" explicitly.
143 test handling .hgsubstate "modified" explicitly.
144
144
145 $ hg parents --template '{node}\n{files}\n'
145 $ hg parents --template '{node}\n{files}\n'
146 df30734270ae757feb35e643b7018e818e78a9aa
146 df30734270ae757feb35e643b7018e818e78a9aa
147 .hgsubstate
147 .hgsubstate
148 $ hg rollback -q
148 $ hg rollback -q
149 $ hg status -A .hgsubstate
149 $ hg status -A .hgsubstate
150 M .hgsubstate
150 M .hgsubstate
151 $ hg ci -m2
151 $ hg ci -m2
152 $ hg parents --template '{node}\n{files}\n'
152 $ hg parents --template '{node}\n{files}\n'
153 df30734270ae757feb35e643b7018e818e78a9aa
153 df30734270ae757feb35e643b7018e818e78a9aa
154 .hgsubstate
154 .hgsubstate
155
155
156 bump sub rev (and check it is ignored by ui.commitsubrepos)
156 bump sub rev (and check it is ignored by ui.commitsubrepos)
157
157
158 $ echo b > s/a
158 $ echo b > s/a
159 $ hg -R s ci -ms1
159 $ hg -R s ci -ms1
160 $ hg --config ui.commitsubrepos=no ci -m3
160 $ hg --config ui.commitsubrepos=no ci -m3
161
161
162 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
162 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
163
163
164 $ echo c > s/a
164 $ echo c > s/a
165 $ hg --config ui.commitsubrepos=no ci -m4
165 $ hg --config ui.commitsubrepos=no ci -m4
166 abort: uncommitted changes in subrepository 's'
166 abort: uncommitted changes in subrepository 's'
167 (use --subrepos for recursive commit)
167 (use --subrepos for recursive commit)
168 [255]
168 [255]
169 $ hg id
169 $ hg id
170 f6affe3fbfaa+ tip
170 f6affe3fbfaa+ tip
171 $ hg -R s ci -mc
171 $ hg -R s ci -mc
172 $ hg id
172 $ hg id
173 f6affe3fbfaa+ tip
173 f6affe3fbfaa+ tip
174 $ echo d > s/a
174 $ echo d > s/a
175 $ hg ci -m4
175 $ hg ci -m4
176 committing subrepository s
176 committing subrepository s
177 $ hg tip -R s
177 $ hg tip -R s
178 changeset: 4:02dcf1d70411
178 changeset: 4:02dcf1d70411
179 tag: tip
179 tag: tip
180 user: test
180 user: test
181 date: Thu Jan 01 00:00:00 1970 +0000
181 date: Thu Jan 01 00:00:00 1970 +0000
182 summary: 4
182 summary: 4
183
183
184
184
185 check caching
185 check caching
186
186
187 $ hg co 0
187 $ hg co 0
188 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
188 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
189 $ hg debugsub
189 $ hg debugsub
190
190
191 restore
191 restore
192
192
193 $ hg co
193 $ hg co
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ hg debugsub
195 $ hg debugsub
196 path s
196 path s
197 source s
197 source s
198 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
198 revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef
199
199
200 new branch for merge tests
200 new branch for merge tests
201
201
202 $ hg co 1
202 $ hg co 1
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ echo t = t >> .hgsub
204 $ echo t = t >> .hgsub
205 $ hg init t
205 $ hg init t
206 $ echo t > t/t
206 $ echo t > t/t
207 $ hg -R t add t
207 $ hg -R t add t
208 adding t/t (glob)
208 adding t/t (glob)
209
209
210 5
210 5
211
211
212 $ hg ci -m5 # add sub
212 $ hg ci -m5 # add sub
213 committing subrepository t
213 committing subrepository t
214 created new head
214 created new head
215 $ echo t2 > t/t
215 $ echo t2 > t/t
216
216
217 6
217 6
218
218
219 $ hg st -R s
219 $ hg st -R s
220 $ hg ci -m6 # change sub
220 $ hg ci -m6 # change sub
221 committing subrepository t
221 committing subrepository t
222 $ hg debugsub
222 $ hg debugsub
223 path s
223 path s
224 source s
224 source s
225 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
225 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
226 path t
226 path t
227 source t
227 source t
228 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
228 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
229 $ echo t3 > t/t
229 $ echo t3 > t/t
230
230
231 7
231 7
232
232
233 $ hg ci -m7 # change sub again for conflict test
233 $ hg ci -m7 # change sub again for conflict test
234 committing subrepository t
234 committing subrepository t
235 $ hg rm .hgsub
235 $ hg rm .hgsub
236
236
237 8
237 8
238
238
239 $ hg ci -m8 # remove sub
239 $ hg ci -m8 # remove sub
240
240
241 test handling .hgsubstate "removed" explicitly.
241 test handling .hgsubstate "removed" explicitly.
242
242
243 $ hg parents --template '{node}\n{files}\n'
243 $ hg parents --template '{node}\n{files}\n'
244 96615c1dad2dc8e3796d7332c77ce69156f7b78e
244 96615c1dad2dc8e3796d7332c77ce69156f7b78e
245 .hgsub .hgsubstate
245 .hgsub .hgsubstate
246 $ hg rollback -q
246 $ hg rollback -q
247 $ hg remove .hgsubstate
247 $ hg remove .hgsubstate
248 $ hg ci -m8
248 $ hg ci -m8
249 $ hg parents --template '{node}\n{files}\n'
249 $ hg parents --template '{node}\n{files}\n'
250 96615c1dad2dc8e3796d7332c77ce69156f7b78e
250 96615c1dad2dc8e3796d7332c77ce69156f7b78e
251 .hgsub .hgsubstate
251 .hgsub .hgsubstate
252
252
253 merge tests
253 merge tests
254
254
255 $ hg co -C 3
255 $ hg co -C 3
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ hg merge 5 # test adding
257 $ hg merge 5 # test adding
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 (branch merge, don't forget to commit)
259 (branch merge, don't forget to commit)
260 $ hg debugsub
260 $ hg debugsub
261 path s
261 path s
262 source s
262 source s
263 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
263 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
264 path t
264 path t
265 source t
265 source t
266 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
266 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
267 $ hg ci -m9
267 $ hg ci -m9
268 created new head
268 created new head
269 $ hg merge 6 --debug # test change
269 $ hg merge 6 --debug # test change
270 searching for copies back to rev 2
270 searching for copies back to rev 2
271 resolving manifests
271 resolving manifests
272 branchmerge: True, force: False, partial: False
272 branchmerge: True, force: False, partial: False
273 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
273 ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4
274 starting 4 threads for background file closing (?)
274 starting 4 threads for background file closing (?)
275 .hgsubstate: versions differ -> m (premerge)
275 .hgsubstate: versions differ -> m (premerge)
276 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
276 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
277 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
277 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
278 getting subrepo t
278 getting subrepo t
279 resolving manifests
279 resolving manifests
280 branchmerge: False, force: False, partial: False
280 branchmerge: False, force: False, partial: False
281 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
281 ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a
282 t: remote is newer -> g
282 t: remote is newer -> g
283 getting t
283 getting t
284 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
285 (branch merge, don't forget to commit)
285 (branch merge, don't forget to commit)
286 $ hg debugsub
286 $ hg debugsub
287 path s
287 path s
288 source s
288 source s
289 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
289 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
290 path t
290 path t
291 source t
291 source t
292 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
292 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
293 $ echo conflict > t/t
293 $ echo conflict > t/t
294 $ hg ci -m10
294 $ hg ci -m10
295 committing subrepository t
295 committing subrepository t
296 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
296 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
297 searching for copies back to rev 2
297 searching for copies back to rev 2
298 resolving manifests
298 resolving manifests
299 branchmerge: True, force: False, partial: False
299 branchmerge: True, force: False, partial: False
300 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
300 ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf
301 starting 4 threads for background file closing (?)
301 starting 4 threads for background file closing (?)
302 .hgsubstate: versions differ -> m (premerge)
302 .hgsubstate: versions differ -> m (premerge)
303 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
303 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
304 subrepo t: both sides changed
304 subrepo t: both sides changed
305 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
305 subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
306 starting 4 threads for background file closing (?)
306 starting 4 threads for background file closing (?)
307 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
307 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
308 merging subrepo t
308 merging subrepo t
309 searching for copies back to rev 2
309 searching for copies back to rev 2
310 resolving manifests
310 resolving manifests
311 branchmerge: True, force: False, partial: False
311 branchmerge: True, force: False, partial: False
312 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
312 ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
313 preserving t for resolve of t
313 preserving t for resolve of t
314 starting 4 threads for background file closing (?)
314 starting 4 threads for background file closing (?)
315 t: versions differ -> m (premerge)
315 t: versions differ -> m (premerge)
316 picked tool ':merge' for t (binary False symlink False changedelete False)
316 picked tool ':merge' for t (binary False symlink False changedelete False)
317 merging t
317 merging t
318 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
318 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
319 t: versions differ -> m (merge)
319 t: versions differ -> m (merge)
320 picked tool ':merge' for t (binary False symlink False changedelete False)
320 picked tool ':merge' for t (binary False symlink False changedelete False)
321 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
321 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
322 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
322 warning: conflicts while merging t! (edit, then use 'hg resolve --mark')
323 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
323 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
324 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
324 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
325 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
325 subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
326 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
327 (branch merge, don't forget to commit)
327 (branch merge, don't forget to commit)
328
328
329 should conflict
329 should conflict
330
330
331 $ cat t/t
331 $ cat t/t
332 <<<<<<< local: 20a0db6fbf6c - test: 10
332 <<<<<<< local: 20a0db6fbf6c - test: 10
333 conflict
333 conflict
334 =======
334 =======
335 t3
335 t3
336 >>>>>>> other: 7af322bc1198 - test: 7
336 >>>>>>> other: 7af322bc1198 - test: 7
337
337
338 11: remove subrepo t
338 11: remove subrepo t
339
339
340 $ hg co -C 5
340 $ hg co -C 5
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
342 $ hg revert -r 4 .hgsub # remove t
342 $ hg revert -r 4 .hgsub # remove t
343 $ hg ci -m11
343 $ hg ci -m11
344 created new head
344 created new head
345 $ hg debugsub
345 $ hg debugsub
346 path s
346 path s
347 source s
347 source s
348 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
348 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
349
349
350 local removed, remote changed, keep changed
350 local removed, remote changed, keep changed
351
351
352 $ hg merge 6
352 $ hg merge 6
353 remote [merge rev] changed subrepository t which local [working copy] removed
353 remote [merge rev] changed subrepository t which local [working copy] removed
354 use (c)hanged version or (d)elete? c
354 use (c)hanged version or (d)elete? c
355 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
356 (branch merge, don't forget to commit)
356 (branch merge, don't forget to commit)
357 BROKEN: should include subrepo t
357 BROKEN: should include subrepo t
358 $ hg debugsub
358 $ hg debugsub
359 path s
359 path s
360 source s
360 source s
361 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
361 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
362 $ cat .hgsubstate
362 $ cat .hgsubstate
363 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
363 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
364 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
364 6747d179aa9a688023c4b0cad32e4c92bb7f34ad t
365 $ hg ci -m 'local removed, remote changed, keep changed'
365 $ hg ci -m 'local removed, remote changed, keep changed'
366 BROKEN: should include subrepo t
366 BROKEN: should include subrepo t
367 $ hg debugsub
367 $ hg debugsub
368 path s
368 path s
369 source s
369 source s
370 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
370 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
371 BROKEN: should include subrepo t
371 BROKEN: should include subrepo t
372 $ cat .hgsubstate
372 $ cat .hgsubstate
373 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
373 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
374 $ cat t/t
374 $ cat t/t
375 t2
375 t2
376
376
377 local removed, remote changed, keep removed
377 local removed, remote changed, keep removed
378
378
379 $ hg co -C 11
379 $ hg co -C 11
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 $ hg merge --config ui.interactive=true 6 <<EOF
381 $ hg merge --config ui.interactive=true 6 <<EOF
382 > d
382 > d
383 > EOF
383 > EOF
384 remote [merge rev] changed subrepository t which local [working copy] removed
384 remote [merge rev] changed subrepository t which local [working copy] removed
385 use (c)hanged version or (d)elete? d
385 use (c)hanged version or (d)elete? d
386 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
387 (branch merge, don't forget to commit)
387 (branch merge, don't forget to commit)
388 $ hg debugsub
388 $ hg debugsub
389 path s
389 path s
390 source s
390 source s
391 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
391 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
392 $ cat .hgsubstate
392 $ cat .hgsubstate
393 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
393 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
394 $ hg ci -m 'local removed, remote changed, keep removed'
394 $ hg ci -m 'local removed, remote changed, keep removed'
395 created new head
395 created new head
396 $ hg debugsub
396 $ hg debugsub
397 path s
397 path s
398 source s
398 source s
399 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
399 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
400 $ cat .hgsubstate
400 $ cat .hgsubstate
401 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
401 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
402
402
403 local changed, remote removed, keep changed
403 local changed, remote removed, keep changed
404
404
405 $ hg co -C 6
405 $ hg co -C 6
406 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 $ hg merge 11
407 $ hg merge 11
408 local [working copy] changed subrepository t which remote [merge rev] removed
408 local [working copy] changed subrepository t which remote [merge rev] removed
409 use (c)hanged version or (d)elete? c
409 use (c)hanged version or (d)elete? c
410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 (branch merge, don't forget to commit)
411 (branch merge, don't forget to commit)
412 BROKEN: should include subrepo t
412 BROKEN: should include subrepo t
413 $ hg debugsub
413 $ hg debugsub
414 path s
414 path s
415 source s
415 source s
416 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
416 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
417 BROKEN: should include subrepo t
417 BROKEN: should include subrepo t
418 $ cat .hgsubstate
418 $ cat .hgsubstate
419 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
419 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
420 $ hg ci -m 'local changed, remote removed, keep changed'
420 $ hg ci -m 'local changed, remote removed, keep changed'
421 created new head
421 created new head
422 BROKEN: should include subrepo t
422 BROKEN: should include subrepo t
423 $ hg debugsub
423 $ hg debugsub
424 path s
424 path s
425 source s
425 source s
426 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
426 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
427 BROKEN: should include subrepo t
427 BROKEN: should include subrepo t
428 $ cat .hgsubstate
428 $ cat .hgsubstate
429 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
429 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
430 $ cat t/t
430 $ cat t/t
431 t2
431 t2
432
432
433 local changed, remote removed, keep removed
433 local changed, remote removed, keep removed
434
434
435 $ hg co -C 6
435 $ hg co -C 6
436 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
437 $ hg merge --config ui.interactive=true 11 <<EOF
437 $ hg merge --config ui.interactive=true 11 <<EOF
438 > d
438 > d
439 > EOF
439 > EOF
440 local [working copy] changed subrepository t which remote [merge rev] removed
440 local [working copy] changed subrepository t which remote [merge rev] removed
441 use (c)hanged version or (d)elete? d
441 use (c)hanged version or (d)elete? d
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 (branch merge, don't forget to commit)
443 (branch merge, don't forget to commit)
444 $ hg debugsub
444 $ hg debugsub
445 path s
445 path s
446 source s
446 source s
447 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
447 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
448 $ cat .hgsubstate
448 $ cat .hgsubstate
449 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
449 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
450 $ hg ci -m 'local changed, remote removed, keep removed'
450 $ hg ci -m 'local changed, remote removed, keep removed'
451 created new head
451 created new head
452 $ hg debugsub
452 $ hg debugsub
453 path s
453 path s
454 source s
454 source s
455 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
455 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
456 $ cat .hgsubstate
456 $ cat .hgsubstate
457 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
457 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
458
458
459 clean up to avoid having to fix up the tests below
459 clean up to avoid having to fix up the tests below
460
460
461 $ hg co -C 10
461 $ hg co -C 10
462 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 $ cat >> $HGRCPATH <<EOF
463 $ cat >> $HGRCPATH <<EOF
464 > [extensions]
464 > [extensions]
465 > strip=
465 > strip=
466 > EOF
466 > EOF
467 $ hg strip -r 11:15
467 $ hg strip -r 11:15
468 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
468 saved backup bundle to $TESTTMP/t/.hg/strip-backup/*-backup.hg (glob)
469
469
470 clone
470 clone
471
471
472 $ cd ..
472 $ cd ..
473 $ hg clone t tc
473 $ hg clone t tc
474 updating to branch default
474 updating to branch default
475 cloning subrepo s from $TESTTMP/t/s
475 cloning subrepo s from $TESTTMP/t/s
476 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
476 cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
477 cloning subrepo t from $TESTTMP/t/t
477 cloning subrepo t from $TESTTMP/t/t
478 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
479 $ cd tc
479 $ cd tc
480 $ hg debugsub
480 $ hg debugsub
481 path s
481 path s
482 source s
482 source s
483 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
483 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
484 path t
484 path t
485 source t
485 source t
486 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
486 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
487
487
488 push
488 push
489
489
490 $ echo bah > t/t
490 $ echo bah > t/t
491 $ hg ci -m11
491 $ hg ci -m11
492 committing subrepository t
492 committing subrepository t
493 $ hg push
493 $ hg push
494 pushing to $TESTTMP/t (glob)
494 pushing to $TESTTMP/t (glob)
495 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
495 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
496 no changes made to subrepo s since last push to $TESTTMP/t/s
496 no changes made to subrepo s since last push to $TESTTMP/t/s
497 pushing subrepo t to $TESTTMP/t/t
497 pushing subrepo t to $TESTTMP/t/t
498 searching for changes
498 searching for changes
499 adding changesets
499 adding changesets
500 adding manifests
500 adding manifests
501 adding file changes
501 adding file changes
502 added 1 changesets with 1 changes to 1 files
502 added 1 changesets with 1 changes to 1 files
503 searching for changes
503 searching for changes
504 adding changesets
504 adding changesets
505 adding manifests
505 adding manifests
506 adding file changes
506 adding file changes
507 added 1 changesets with 1 changes to 1 files
507 added 1 changesets with 1 changes to 1 files
508
508
509 push -f
509 push -f
510
510
511 $ echo bah > s/a
511 $ echo bah > s/a
512 $ hg ci -m12
512 $ hg ci -m12
513 committing subrepository s
513 committing subrepository s
514 $ hg push
514 $ hg push
515 pushing to $TESTTMP/t (glob)
515 pushing to $TESTTMP/t (glob)
516 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
516 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
517 pushing subrepo s to $TESTTMP/t/s
517 pushing subrepo s to $TESTTMP/t/s
518 searching for changes
518 searching for changes
519 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
519 abort: push creates new remote head 12a213df6fa9! (in subrepo s)
520 (merge or see 'hg help push' for details about pushing new heads)
520 (merge or see 'hg help push' for details about pushing new heads)
521 [255]
521 [255]
522 $ hg push -f
522 $ hg push -f
523 pushing to $TESTTMP/t (glob)
523 pushing to $TESTTMP/t (glob)
524 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
524 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
525 searching for changes
525 searching for changes
526 no changes found
526 no changes found
527 pushing subrepo s to $TESTTMP/t/s
527 pushing subrepo s to $TESTTMP/t/s
528 searching for changes
528 searching for changes
529 adding changesets
529 adding changesets
530 adding manifests
530 adding manifests
531 adding file changes
531 adding file changes
532 added 1 changesets with 1 changes to 1 files (+1 heads)
532 added 1 changesets with 1 changes to 1 files (+1 heads)
533 pushing subrepo t to $TESTTMP/t/t
533 pushing subrepo t to $TESTTMP/t/t
534 searching for changes
534 searching for changes
535 no changes found
535 no changes found
536 searching for changes
536 searching for changes
537 adding changesets
537 adding changesets
538 adding manifests
538 adding manifests
539 adding file changes
539 adding file changes
540 added 1 changesets with 1 changes to 1 files
540 added 1 changesets with 1 changes to 1 files
541
541
542 check that unmodified subrepos are not pushed
542 check that unmodified subrepos are not pushed
543
543
544 $ hg clone . ../tcc
544 $ hg clone . ../tcc
545 updating to branch default
545 updating to branch default
546 cloning subrepo s from $TESTTMP/tc/s
546 cloning subrepo s from $TESTTMP/tc/s
547 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
547 cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob)
548 cloning subrepo t from $TESTTMP/tc/t
548 cloning subrepo t from $TESTTMP/tc/t
549 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
549 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
550
550
551 the subrepos on the new clone have nothing to push to its source
551 the subrepos on the new clone have nothing to push to its source
552
552
553 $ hg push -R ../tcc .
553 $ hg push -R ../tcc .
554 pushing to .
554 pushing to .
555 no changes made to subrepo s/ss since last push to s/ss (glob)
555 no changes made to subrepo s/ss since last push to s/ss (glob)
556 no changes made to subrepo s since last push to s
556 no changes made to subrepo s since last push to s
557 no changes made to subrepo t since last push to t
557 no changes made to subrepo t since last push to t
558 searching for changes
558 searching for changes
559 no changes found
559 no changes found
560 [1]
560 [1]
561
561
562 the subrepos on the source do not have a clean store versus the clone target
562 the subrepos on the source do not have a clean store versus the clone target
563 because they were never explicitly pushed to the source
563 because they were never explicitly pushed to the source
564
564
565 $ hg push ../tcc
565 $ hg push ../tcc
566 pushing to ../tcc
566 pushing to ../tcc
567 pushing subrepo s/ss to ../tcc/s/ss (glob)
567 pushing subrepo s/ss to ../tcc/s/ss (glob)
568 searching for changes
568 searching for changes
569 no changes found
569 no changes found
570 pushing subrepo s to ../tcc/s
570 pushing subrepo s to ../tcc/s
571 searching for changes
571 searching for changes
572 no changes found
572 no changes found
573 pushing subrepo t to ../tcc/t
573 pushing subrepo t to ../tcc/t
574 searching for changes
574 searching for changes
575 no changes found
575 no changes found
576 searching for changes
576 searching for changes
577 no changes found
577 no changes found
578 [1]
578 [1]
579
579
580 after push their stores become clean
580 after push their stores become clean
581
581
582 $ hg push ../tcc
582 $ hg push ../tcc
583 pushing to ../tcc
583 pushing to ../tcc
584 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
584 no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob)
585 no changes made to subrepo s since last push to ../tcc/s
585 no changes made to subrepo s since last push to ../tcc/s
586 no changes made to subrepo t since last push to ../tcc/t
586 no changes made to subrepo t since last push to ../tcc/t
587 searching for changes
587 searching for changes
588 no changes found
588 no changes found
589 [1]
589 [1]
590
590
591 updating a subrepo to a different revision or changing
591 updating a subrepo to a different revision or changing
592 its working directory does not make its store dirty
592 its working directory does not make its store dirty
593
593
594 $ hg -R s update '.^'
594 $ hg -R s update '.^'
595 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
595 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
596 $ hg push
596 $ hg push
597 pushing to $TESTTMP/t (glob)
597 pushing to $TESTTMP/t (glob)
598 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
598 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
599 no changes made to subrepo s since last push to $TESTTMP/t/s
599 no changes made to subrepo s since last push to $TESTTMP/t/s
600 no changes made to subrepo t since last push to $TESTTMP/t/t
600 no changes made to subrepo t since last push to $TESTTMP/t/t
601 searching for changes
601 searching for changes
602 no changes found
602 no changes found
603 [1]
603 [1]
604 $ echo foo >> s/a
604 $ echo foo >> s/a
605 $ hg push
605 $ hg push
606 pushing to $TESTTMP/t (glob)
606 pushing to $TESTTMP/t (glob)
607 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
607 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
608 no changes made to subrepo s since last push to $TESTTMP/t/s
608 no changes made to subrepo s since last push to $TESTTMP/t/s
609 no changes made to subrepo t since last push to $TESTTMP/t/t
609 no changes made to subrepo t since last push to $TESTTMP/t/t
610 searching for changes
610 searching for changes
611 no changes found
611 no changes found
612 [1]
612 [1]
613 $ hg -R s update -C tip
613 $ hg -R s update -C tip
614 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
614 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
615
615
616 committing into a subrepo makes its store (but not its parent's store) dirty
616 committing into a subrepo makes its store (but not its parent's store) dirty
617
617
618 $ echo foo >> s/ss/a
618 $ echo foo >> s/ss/a
619 $ hg -R s/ss commit -m 'test dirty store detection'
619 $ hg -R s/ss commit -m 'test dirty store detection'
620
620
621 $ hg out -S -r `hg log -r tip -T "{node|short}"`
621 $ hg out -S -r `hg log -r tip -T "{node|short}"`
622 comparing with $TESTTMP/t (glob)
622 comparing with $TESTTMP/t (glob)
623 searching for changes
623 searching for changes
624 no changes found
624 no changes found
625 comparing with $TESTTMP/t/s
625 comparing with $TESTTMP/t/s
626 searching for changes
626 searching for changes
627 no changes found
627 no changes found
628 comparing with $TESTTMP/t/s/ss
628 comparing with $TESTTMP/t/s/ss
629 searching for changes
629 searching for changes
630 changeset: 1:79ea5566a333
630 changeset: 1:79ea5566a333
631 tag: tip
631 tag: tip
632 user: test
632 user: test
633 date: Thu Jan 01 00:00:00 1970 +0000
633 date: Thu Jan 01 00:00:00 1970 +0000
634 summary: test dirty store detection
634 summary: test dirty store detection
635
635
636 comparing with $TESTTMP/t/t
636 comparing with $TESTTMP/t/t
637 searching for changes
637 searching for changes
638 no changes found
638 no changes found
639
639
640 $ hg push
640 $ hg push
641 pushing to $TESTTMP/t (glob)
641 pushing to $TESTTMP/t (glob)
642 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
642 pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
643 searching for changes
643 searching for changes
644 adding changesets
644 adding changesets
645 adding manifests
645 adding manifests
646 adding file changes
646 adding file changes
647 added 1 changesets with 1 changes to 1 files
647 added 1 changesets with 1 changes to 1 files
648 no changes made to subrepo s since last push to $TESTTMP/t/s
648 no changes made to subrepo s since last push to $TESTTMP/t/s
649 no changes made to subrepo t since last push to $TESTTMP/t/t
649 no changes made to subrepo t since last push to $TESTTMP/t/t
650 searching for changes
650 searching for changes
651 no changes found
651 no changes found
652 [1]
652 [1]
653
653
654 a subrepo store may be clean versus one repo but not versus another
654 a subrepo store may be clean versus one repo but not versus another
655
655
656 $ hg push
656 $ hg push
657 pushing to $TESTTMP/t (glob)
657 pushing to $TESTTMP/t (glob)
658 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
658 no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob)
659 no changes made to subrepo s since last push to $TESTTMP/t/s
659 no changes made to subrepo s since last push to $TESTTMP/t/s
660 no changes made to subrepo t since last push to $TESTTMP/t/t
660 no changes made to subrepo t since last push to $TESTTMP/t/t
661 searching for changes
661 searching for changes
662 no changes found
662 no changes found
663 [1]
663 [1]
664 $ hg push ../tcc
664 $ hg push ../tcc
665 pushing to ../tcc
665 pushing to ../tcc
666 pushing subrepo s/ss to ../tcc/s/ss (glob)
666 pushing subrepo s/ss to ../tcc/s/ss (glob)
667 searching for changes
667 searching for changes
668 adding changesets
668 adding changesets
669 adding manifests
669 adding manifests
670 adding file changes
670 adding file changes
671 added 1 changesets with 1 changes to 1 files
671 added 1 changesets with 1 changes to 1 files
672 no changes made to subrepo s since last push to ../tcc/s
672 no changes made to subrepo s since last push to ../tcc/s
673 no changes made to subrepo t since last push to ../tcc/t
673 no changes made to subrepo t since last push to ../tcc/t
674 searching for changes
674 searching for changes
675 no changes found
675 no changes found
676 [1]
676 [1]
677
677
678 update
678 update
679
679
680 $ cd ../t
680 $ cd ../t
681 $ hg up -C # discard our earlier merge
681 $ hg up -C # discard our earlier merge
682 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
682 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
683 updated to "c373c8102e68: 12"
683 2 other heads for branch "default"
684 2 other heads for branch "default"
684 $ echo blah > t/t
685 $ echo blah > t/t
685 $ hg ci -m13
686 $ hg ci -m13
686 committing subrepository t
687 committing subrepository t
687
688
688 backout calls revert internally with minimal opts, which should not raise
689 backout calls revert internally with minimal opts, which should not raise
689 KeyError
690 KeyError
690
691
691 $ hg backout ".^" --no-commit
692 $ hg backout ".^" --no-commit
692 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 changeset c373c8102e68 backed out, don't forget to commit.
694 changeset c373c8102e68 backed out, don't forget to commit.
694
695
695 $ hg up -C # discard changes
696 $ hg up -C # discard changes
696 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
697 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
698 updated to "925c17564ef8: 13"
697 2 other heads for branch "default"
699 2 other heads for branch "default"
698
700
699 pull
701 pull
700
702
701 $ cd ../tc
703 $ cd ../tc
702 $ hg pull
704 $ hg pull
703 pulling from $TESTTMP/t (glob)
705 pulling from $TESTTMP/t (glob)
704 searching for changes
706 searching for changes
705 adding changesets
707 adding changesets
706 adding manifests
708 adding manifests
707 adding file changes
709 adding file changes
708 added 1 changesets with 1 changes to 1 files
710 added 1 changesets with 1 changes to 1 files
709 (run 'hg update' to get a working copy)
711 (run 'hg update' to get a working copy)
710
712
711 should pull t
713 should pull t
712
714
713 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
715 $ hg incoming -S -r `hg log -r tip -T "{node|short}"`
714 comparing with $TESTTMP/t (glob)
716 comparing with $TESTTMP/t (glob)
715 no changes found
717 no changes found
716 comparing with $TESTTMP/t/s
718 comparing with $TESTTMP/t/s
717 searching for changes
719 searching for changes
718 no changes found
720 no changes found
719 comparing with $TESTTMP/t/s/ss
721 comparing with $TESTTMP/t/s/ss
720 searching for changes
722 searching for changes
721 no changes found
723 no changes found
722 comparing with $TESTTMP/t/t
724 comparing with $TESTTMP/t/t
723 searching for changes
725 searching for changes
724 changeset: 5:52c0adc0515a
726 changeset: 5:52c0adc0515a
725 tag: tip
727 tag: tip
726 user: test
728 user: test
727 date: Thu Jan 01 00:00:00 1970 +0000
729 date: Thu Jan 01 00:00:00 1970 +0000
728 summary: 13
730 summary: 13
729
731
730
732
731 $ hg up
733 $ hg up
732 pulling subrepo t from $TESTTMP/t/t
734 pulling subrepo t from $TESTTMP/t/t
733 searching for changes
735 searching for changes
734 adding changesets
736 adding changesets
735 adding manifests
737 adding manifests
736 adding file changes
738 adding file changes
737 added 1 changesets with 1 changes to 1 files
739 added 1 changesets with 1 changes to 1 files
738 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
740 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 updated to "925c17564ef8: 13"
739 2 other heads for branch "default"
742 2 other heads for branch "default"
740 $ cat t/t
743 $ cat t/t
741 blah
744 blah
742
745
743 bogus subrepo path aborts
746 bogus subrepo path aborts
744
747
745 $ echo 'bogus=[boguspath' >> .hgsub
748 $ echo 'bogus=[boguspath' >> .hgsub
746 $ hg ci -m 'bogus subrepo path'
749 $ hg ci -m 'bogus subrepo path'
747 abort: missing ] in subrepo source
750 abort: missing ] in subrepo source
748 [255]
751 [255]
749
752
750 Issue1986: merge aborts when trying to merge a subrepo that
753 Issue1986: merge aborts when trying to merge a subrepo that
751 shouldn't need merging
754 shouldn't need merging
752
755
753 # subrepo layout
756 # subrepo layout
754 #
757 #
755 # o 5 br
758 # o 5 br
756 # /|
759 # /|
757 # o | 4 default
760 # o | 4 default
758 # | |
761 # | |
759 # | o 3 br
762 # | o 3 br
760 # |/|
763 # |/|
761 # o | 2 default
764 # o | 2 default
762 # | |
765 # | |
763 # | o 1 br
766 # | o 1 br
764 # |/
767 # |/
765 # o 0 default
768 # o 0 default
766
769
767 $ cd ..
770 $ cd ..
768 $ rm -rf sub
771 $ rm -rf sub
769 $ hg init main
772 $ hg init main
770 $ cd main
773 $ cd main
771 $ hg init s
774 $ hg init s
772 $ cd s
775 $ cd s
773 $ echo a > a
776 $ echo a > a
774 $ hg ci -Am1
777 $ hg ci -Am1
775 adding a
778 adding a
776 $ hg branch br
779 $ hg branch br
777 marked working directory as branch br
780 marked working directory as branch br
778 (branches are permanent and global, did you want a bookmark?)
781 (branches are permanent and global, did you want a bookmark?)
779 $ echo a >> a
782 $ echo a >> a
780 $ hg ci -m1
783 $ hg ci -m1
781 $ hg up default
784 $ hg up default
782 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
783 $ echo b > b
786 $ echo b > b
784 $ hg ci -Am1
787 $ hg ci -Am1
785 adding b
788 adding b
786 $ hg up br
789 $ hg up br
787 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
790 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
788 $ hg merge tip
791 $ hg merge tip
789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
790 (branch merge, don't forget to commit)
793 (branch merge, don't forget to commit)
791 $ hg ci -m1
794 $ hg ci -m1
792 $ hg up 2
795 $ hg up 2
793 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
794 $ echo c > c
797 $ echo c > c
795 $ hg ci -Am1
798 $ hg ci -Am1
796 adding c
799 adding c
797 $ hg up 3
800 $ hg up 3
798 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
801 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
799 $ hg merge 4
802 $ hg merge 4
800 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
803 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
801 (branch merge, don't forget to commit)
804 (branch merge, don't forget to commit)
802 $ hg ci -m1
805 $ hg ci -m1
803
806
804 # main repo layout:
807 # main repo layout:
805 #
808 #
806 # * <-- try to merge default into br again
809 # * <-- try to merge default into br again
807 # .`|
810 # .`|
808 # . o 5 br --> substate = 5
811 # . o 5 br --> substate = 5
809 # . |
812 # . |
810 # o | 4 default --> substate = 4
813 # o | 4 default --> substate = 4
811 # | |
814 # | |
812 # | o 3 br --> substate = 2
815 # | o 3 br --> substate = 2
813 # |/|
816 # |/|
814 # o | 2 default --> substate = 2
817 # o | 2 default --> substate = 2
815 # | |
818 # | |
816 # | o 1 br --> substate = 3
819 # | o 1 br --> substate = 3
817 # |/
820 # |/
818 # o 0 default --> substate = 2
821 # o 0 default --> substate = 2
819
822
820 $ cd ..
823 $ cd ..
821 $ echo 's = s' > .hgsub
824 $ echo 's = s' > .hgsub
822 $ hg -R s up 2
825 $ hg -R s up 2
823 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
826 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
824 $ hg ci -Am1
827 $ hg ci -Am1
825 adding .hgsub
828 adding .hgsub
826 $ hg branch br
829 $ hg branch br
827 marked working directory as branch br
830 marked working directory as branch br
828 (branches are permanent and global, did you want a bookmark?)
831 (branches are permanent and global, did you want a bookmark?)
829 $ echo b > b
832 $ echo b > b
830 $ hg -R s up 3
833 $ hg -R s up 3
831 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
834 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
832 $ hg ci -Am1
835 $ hg ci -Am1
833 adding b
836 adding b
834 $ hg up default
837 $ hg up default
835 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
838 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
836 $ echo c > c
839 $ echo c > c
837 $ hg ci -Am1
840 $ hg ci -Am1
838 adding c
841 adding c
839 $ hg up 1
842 $ hg up 1
840 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
843 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
841 $ hg merge 2
844 $ hg merge 2
842 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 (branch merge, don't forget to commit)
846 (branch merge, don't forget to commit)
844 $ hg ci -m1
847 $ hg ci -m1
845 $ hg up 2
848 $ hg up 2
846 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
849 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
847 $ hg -R s up 4
850 $ hg -R s up 4
848 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
851 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 $ echo d > d
852 $ echo d > d
850 $ hg ci -Am1
853 $ hg ci -Am1
851 adding d
854 adding d
852 $ hg up 3
855 $ hg up 3
853 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
856 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
854 $ hg -R s up 5
857 $ hg -R s up 5
855 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
858 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
856 $ echo e > e
859 $ echo e > e
857 $ hg ci -Am1
860 $ hg ci -Am1
858 adding e
861 adding e
859
862
860 $ hg up 5
863 $ hg up 5
861 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
864 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
862 $ hg merge 4 # try to merge default into br again
865 $ hg merge 4 # try to merge default into br again
863 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
866 subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
864 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
867 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
865 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
868 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
866 (branch merge, don't forget to commit)
869 (branch merge, don't forget to commit)
867 $ cd ..
870 $ cd ..
868
871
869 test subrepo delete from .hgsubstate
872 test subrepo delete from .hgsubstate
870
873
871 $ hg init testdelete
874 $ hg init testdelete
872 $ mkdir testdelete/nested testdelete/nested2
875 $ mkdir testdelete/nested testdelete/nested2
873 $ hg init testdelete/nested
876 $ hg init testdelete/nested
874 $ hg init testdelete/nested2
877 $ hg init testdelete/nested2
875 $ echo test > testdelete/nested/foo
878 $ echo test > testdelete/nested/foo
876 $ echo test > testdelete/nested2/foo
879 $ echo test > testdelete/nested2/foo
877 $ hg -R testdelete/nested add
880 $ hg -R testdelete/nested add
878 adding testdelete/nested/foo (glob)
881 adding testdelete/nested/foo (glob)
879 $ hg -R testdelete/nested2 add
882 $ hg -R testdelete/nested2 add
880 adding testdelete/nested2/foo (glob)
883 adding testdelete/nested2/foo (glob)
881 $ hg -R testdelete/nested ci -m test
884 $ hg -R testdelete/nested ci -m test
882 $ hg -R testdelete/nested2 ci -m test
885 $ hg -R testdelete/nested2 ci -m test
883 $ echo nested = nested > testdelete/.hgsub
886 $ echo nested = nested > testdelete/.hgsub
884 $ echo nested2 = nested2 >> testdelete/.hgsub
887 $ echo nested2 = nested2 >> testdelete/.hgsub
885 $ hg -R testdelete add
888 $ hg -R testdelete add
886 adding testdelete/.hgsub (glob)
889 adding testdelete/.hgsub (glob)
887 $ hg -R testdelete ci -m "nested 1 & 2 added"
890 $ hg -R testdelete ci -m "nested 1 & 2 added"
888 $ echo nested = nested > testdelete/.hgsub
891 $ echo nested = nested > testdelete/.hgsub
889 $ hg -R testdelete ci -m "nested 2 deleted"
892 $ hg -R testdelete ci -m "nested 2 deleted"
890 $ cat testdelete/.hgsubstate
893 $ cat testdelete/.hgsubstate
891 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
894 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
892 $ hg -R testdelete remove testdelete/.hgsub
895 $ hg -R testdelete remove testdelete/.hgsub
893 $ hg -R testdelete ci -m ".hgsub deleted"
896 $ hg -R testdelete ci -m ".hgsub deleted"
894 $ cat testdelete/.hgsubstate
897 $ cat testdelete/.hgsubstate
895 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
898 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
896
899
897 test repository cloning
900 test repository cloning
898
901
899 $ mkdir mercurial mercurial2
902 $ mkdir mercurial mercurial2
900 $ hg init nested_absolute
903 $ hg init nested_absolute
901 $ echo test > nested_absolute/foo
904 $ echo test > nested_absolute/foo
902 $ hg -R nested_absolute add
905 $ hg -R nested_absolute add
903 adding nested_absolute/foo (glob)
906 adding nested_absolute/foo (glob)
904 $ hg -R nested_absolute ci -mtest
907 $ hg -R nested_absolute ci -mtest
905 $ cd mercurial
908 $ cd mercurial
906 $ hg init nested_relative
909 $ hg init nested_relative
907 $ echo test2 > nested_relative/foo2
910 $ echo test2 > nested_relative/foo2
908 $ hg -R nested_relative add
911 $ hg -R nested_relative add
909 adding nested_relative/foo2 (glob)
912 adding nested_relative/foo2 (glob)
910 $ hg -R nested_relative ci -mtest2
913 $ hg -R nested_relative ci -mtest2
911 $ hg init main
914 $ hg init main
912 $ echo "nested_relative = ../nested_relative" > main/.hgsub
915 $ echo "nested_relative = ../nested_relative" > main/.hgsub
913 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
916 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
914 $ hg -R main add
917 $ hg -R main add
915 adding main/.hgsub (glob)
918 adding main/.hgsub (glob)
916 $ hg -R main ci -m "add subrepos"
919 $ hg -R main ci -m "add subrepos"
917 $ cd ..
920 $ cd ..
918 $ hg clone mercurial/main mercurial2/main
921 $ hg clone mercurial/main mercurial2/main
919 updating to branch default
922 updating to branch default
920 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
923 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
921 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
924 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
922 > mercurial2/main/nested_relative/.hg/hgrc
925 > mercurial2/main/nested_relative/.hg/hgrc
923 [paths]
926 [paths]
924 default = $TESTTMP/mercurial/nested_absolute
927 default = $TESTTMP/mercurial/nested_absolute
925 [paths]
928 [paths]
926 default = $TESTTMP/mercurial/nested_relative
929 default = $TESTTMP/mercurial/nested_relative
927 $ rm -rf mercurial mercurial2
930 $ rm -rf mercurial mercurial2
928
931
929 Issue1977: multirepo push should fail if subrepo push fails
932 Issue1977: multirepo push should fail if subrepo push fails
930
933
931 $ hg init repo
934 $ hg init repo
932 $ hg init repo/s
935 $ hg init repo/s
933 $ echo a > repo/s/a
936 $ echo a > repo/s/a
934 $ hg -R repo/s ci -Am0
937 $ hg -R repo/s ci -Am0
935 adding a
938 adding a
936 $ echo s = s > repo/.hgsub
939 $ echo s = s > repo/.hgsub
937 $ hg -R repo ci -Am1
940 $ hg -R repo ci -Am1
938 adding .hgsub
941 adding .hgsub
939 $ hg clone repo repo2
942 $ hg clone repo repo2
940 updating to branch default
943 updating to branch default
941 cloning subrepo s from $TESTTMP/repo/s
944 cloning subrepo s from $TESTTMP/repo/s
942 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
945 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
943 $ hg -q -R repo2 pull -u
946 $ hg -q -R repo2 pull -u
944 $ echo 1 > repo2/s/a
947 $ echo 1 > repo2/s/a
945 $ hg -R repo2/s ci -m2
948 $ hg -R repo2/s ci -m2
946 $ hg -q -R repo2/s push
949 $ hg -q -R repo2/s push
947 $ hg -R repo2/s up -C 0
950 $ hg -R repo2/s up -C 0
948 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
951 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
949 $ echo 2 > repo2/s/b
952 $ echo 2 > repo2/s/b
950 $ hg -R repo2/s ci -m3 -A
953 $ hg -R repo2/s ci -m3 -A
951 adding b
954 adding b
952 created new head
955 created new head
953 $ hg -R repo2 ci -m3
956 $ hg -R repo2 ci -m3
954 $ hg -q -R repo2 push
957 $ hg -q -R repo2 push
955 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
958 abort: push creates new remote head cc505f09a8b2! (in subrepo s)
956 (merge or see 'hg help push' for details about pushing new heads)
959 (merge or see 'hg help push' for details about pushing new heads)
957 [255]
960 [255]
958 $ hg -R repo update
961 $ hg -R repo update
959 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
962 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
960
963
961 test if untracked file is not overwritten
964 test if untracked file is not overwritten
962
965
963 (this also tests that updated .hgsubstate is treated as "modified",
966 (this also tests that updated .hgsubstate is treated as "modified",
964 when 'merge.update()' is aborted before 'merge.recordupdates()', even
967 when 'merge.update()' is aborted before 'merge.recordupdates()', even
965 if none of mode, size and timestamp of it isn't changed on the
968 if none of mode, size and timestamp of it isn't changed on the
966 filesystem (see also issue4583))
969 filesystem (see also issue4583))
967
970
968 $ echo issue3276_ok > repo/s/b
971 $ echo issue3276_ok > repo/s/b
969 $ hg -R repo2 push -f -q
972 $ hg -R repo2 push -f -q
970 $ touch -t 200001010000 repo/.hgsubstate
973 $ touch -t 200001010000 repo/.hgsubstate
971
974
972 $ cat >> repo/.hg/hgrc <<EOF
975 $ cat >> repo/.hg/hgrc <<EOF
973 > [fakedirstatewritetime]
976 > [fakedirstatewritetime]
974 > # emulate invoking dirstate.write() via repo.status()
977 > # emulate invoking dirstate.write() via repo.status()
975 > # at 2000-01-01 00:00
978 > # at 2000-01-01 00:00
976 > fakenow = 200001010000
979 > fakenow = 200001010000
977 >
980 >
978 > [extensions]
981 > [extensions]
979 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
982 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
980 > EOF
983 > EOF
981 $ hg -R repo update
984 $ hg -R repo update
982 b: untracked file differs
985 b: untracked file differs
983 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
986 abort: untracked files in working directory differ from files in requested revision (in subrepo s)
984 [255]
987 [255]
985 $ cat >> repo/.hg/hgrc <<EOF
988 $ cat >> repo/.hg/hgrc <<EOF
986 > [extensions]
989 > [extensions]
987 > fakedirstatewritetime = !
990 > fakedirstatewritetime = !
988 > EOF
991 > EOF
989
992
990 $ cat repo/s/b
993 $ cat repo/s/b
991 issue3276_ok
994 issue3276_ok
992 $ rm repo/s/b
995 $ rm repo/s/b
993 $ touch -t 200001010000 repo/.hgsubstate
996 $ touch -t 200001010000 repo/.hgsubstate
994 $ hg -R repo revert --all
997 $ hg -R repo revert --all
995 reverting repo/.hgsubstate (glob)
998 reverting repo/.hgsubstate (glob)
996 reverting subrepo s
999 reverting subrepo s
997 $ hg -R repo update
1000 $ hg -R repo update
998 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1001 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
999 $ cat repo/s/b
1002 $ cat repo/s/b
1000 2
1003 2
1001 $ rm -rf repo2 repo
1004 $ rm -rf repo2 repo
1002
1005
1003
1006
1004 Issue1852 subrepos with relative paths always push/pull relative to default
1007 Issue1852 subrepos with relative paths always push/pull relative to default
1005
1008
1006 Prepare a repo with subrepo
1009 Prepare a repo with subrepo
1007
1010
1008 $ hg init issue1852a
1011 $ hg init issue1852a
1009 $ cd issue1852a
1012 $ cd issue1852a
1010 $ hg init sub/repo
1013 $ hg init sub/repo
1011 $ echo test > sub/repo/foo
1014 $ echo test > sub/repo/foo
1012 $ hg -R sub/repo add sub/repo/foo
1015 $ hg -R sub/repo add sub/repo/foo
1013 $ echo sub/repo = sub/repo > .hgsub
1016 $ echo sub/repo = sub/repo > .hgsub
1014 $ hg add .hgsub
1017 $ hg add .hgsub
1015 $ hg ci -mtest
1018 $ hg ci -mtest
1016 committing subrepository sub/repo (glob)
1019 committing subrepository sub/repo (glob)
1017 $ echo test >> sub/repo/foo
1020 $ echo test >> sub/repo/foo
1018 $ hg ci -mtest
1021 $ hg ci -mtest
1019 committing subrepository sub/repo (glob)
1022 committing subrepository sub/repo (glob)
1020 $ hg cat sub/repo/foo
1023 $ hg cat sub/repo/foo
1021 test
1024 test
1022 test
1025 test
1023 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1026 $ hg cat sub/repo/foo -Tjson | sed 's|\\\\|/|g'
1024 [
1027 [
1025 {
1028 {
1026 "abspath": "foo",
1029 "abspath": "foo",
1027 "data": "test\ntest\n",
1030 "data": "test\ntest\n",
1028 "path": "sub/repo/foo"
1031 "path": "sub/repo/foo"
1029 }
1032 }
1030 ]
1033 ]
1031 $ mkdir -p tmp/sub/repo
1034 $ mkdir -p tmp/sub/repo
1032 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1035 $ hg cat -r 0 --output tmp/%p_p sub/repo/foo
1033 $ cat tmp/sub/repo/foo_p
1036 $ cat tmp/sub/repo/foo_p
1034 test
1037 test
1035 $ mv sub/repo sub_
1038 $ mv sub/repo sub_
1036 $ hg cat sub/repo/baz
1039 $ hg cat sub/repo/baz
1037 skipping missing subrepository: sub/repo
1040 skipping missing subrepository: sub/repo
1038 [1]
1041 [1]
1039 $ rm -rf sub/repo
1042 $ rm -rf sub/repo
1040 $ mv sub_ sub/repo
1043 $ mv sub_ sub/repo
1041 $ cd ..
1044 $ cd ..
1042
1045
1043 Create repo without default path, pull top repo, and see what happens on update
1046 Create repo without default path, pull top repo, and see what happens on update
1044
1047
1045 $ hg init issue1852b
1048 $ hg init issue1852b
1046 $ hg -R issue1852b pull issue1852a
1049 $ hg -R issue1852b pull issue1852a
1047 pulling from issue1852a
1050 pulling from issue1852a
1048 requesting all changes
1051 requesting all changes
1049 adding changesets
1052 adding changesets
1050 adding manifests
1053 adding manifests
1051 adding file changes
1054 adding file changes
1052 added 2 changesets with 3 changes to 2 files
1055 added 2 changesets with 3 changes to 2 files
1053 (run 'hg update' to get a working copy)
1056 (run 'hg update' to get a working copy)
1054 $ hg -R issue1852b update
1057 $ hg -R issue1852b update
1055 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
1058 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
1056 [255]
1059 [255]
1057
1060
1058 Ensure a full traceback, not just the SubrepoAbort part
1061 Ensure a full traceback, not just the SubrepoAbort part
1059
1062
1060 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1063 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise error\.Abort'
1061 raise error.Abort(_("default path for subrepository not found"))
1064 raise error.Abort(_("default path for subrepository not found"))
1062
1065
1063 Pull -u now doesn't help
1066 Pull -u now doesn't help
1064
1067
1065 $ hg -R issue1852b pull -u issue1852a
1068 $ hg -R issue1852b pull -u issue1852a
1066 pulling from issue1852a
1069 pulling from issue1852a
1067 searching for changes
1070 searching for changes
1068 no changes found
1071 no changes found
1069
1072
1070 Try the same, but with pull -u
1073 Try the same, but with pull -u
1071
1074
1072 $ hg init issue1852c
1075 $ hg init issue1852c
1073 $ hg -R issue1852c pull -r0 -u issue1852a
1076 $ hg -R issue1852c pull -r0 -u issue1852a
1074 pulling from issue1852a
1077 pulling from issue1852a
1075 adding changesets
1078 adding changesets
1076 adding manifests
1079 adding manifests
1077 adding file changes
1080 adding file changes
1078 added 1 changesets with 2 changes to 2 files
1081 added 1 changesets with 2 changes to 2 files
1079 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1082 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
1080 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1083 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1081
1084
1082 Try to push from the other side
1085 Try to push from the other side
1083
1086
1084 $ hg -R issue1852a push `pwd`/issue1852c
1087 $ hg -R issue1852a push `pwd`/issue1852c
1085 pushing to $TESTTMP/issue1852c (glob)
1088 pushing to $TESTTMP/issue1852c (glob)
1086 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1089 pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob)
1087 searching for changes
1090 searching for changes
1088 no changes found
1091 no changes found
1089 searching for changes
1092 searching for changes
1090 adding changesets
1093 adding changesets
1091 adding manifests
1094 adding manifests
1092 adding file changes
1095 adding file changes
1093 added 1 changesets with 1 changes to 1 files
1096 added 1 changesets with 1 changes to 1 files
1094
1097
1095 Incoming and outgoing should not use the default path:
1098 Incoming and outgoing should not use the default path:
1096
1099
1097 $ hg clone -q issue1852a issue1852d
1100 $ hg clone -q issue1852a issue1852d
1098 $ hg -R issue1852d outgoing --subrepos issue1852c
1101 $ hg -R issue1852d outgoing --subrepos issue1852c
1099 comparing with issue1852c
1102 comparing with issue1852c
1100 searching for changes
1103 searching for changes
1101 no changes found
1104 no changes found
1102 comparing with issue1852c/sub/repo
1105 comparing with issue1852c/sub/repo
1103 searching for changes
1106 searching for changes
1104 no changes found
1107 no changes found
1105 [1]
1108 [1]
1106 $ hg -R issue1852d incoming --subrepos issue1852c
1109 $ hg -R issue1852d incoming --subrepos issue1852c
1107 comparing with issue1852c
1110 comparing with issue1852c
1108 searching for changes
1111 searching for changes
1109 no changes found
1112 no changes found
1110 comparing with issue1852c/sub/repo
1113 comparing with issue1852c/sub/repo
1111 searching for changes
1114 searching for changes
1112 no changes found
1115 no changes found
1113 [1]
1116 [1]
1114
1117
1115 Check that merge of a new subrepo doesn't write the uncommitted state to
1118 Check that merge of a new subrepo doesn't write the uncommitted state to
1116 .hgsubstate (issue4622)
1119 .hgsubstate (issue4622)
1117
1120
1118 $ hg init issue1852a/addedsub
1121 $ hg init issue1852a/addedsub
1119 $ echo zzz > issue1852a/addedsub/zz.txt
1122 $ echo zzz > issue1852a/addedsub/zz.txt
1120 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1123 $ hg -R issue1852a/addedsub ci -Aqm "initial ZZ"
1121
1124
1122 $ hg clone issue1852a/addedsub issue1852d/addedsub
1125 $ hg clone issue1852a/addedsub issue1852d/addedsub
1123 updating to branch default
1126 updating to branch default
1124 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1127 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1125
1128
1126 $ echo def > issue1852a/sub/repo/foo
1129 $ echo def > issue1852a/sub/repo/foo
1127 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1130 $ hg -R issue1852a ci -SAm 'tweaked subrepo'
1128 adding tmp/sub/repo/foo_p
1131 adding tmp/sub/repo/foo_p
1129 committing subrepository sub/repo (glob)
1132 committing subrepository sub/repo (glob)
1130
1133
1131 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1134 $ echo 'addedsub = addedsub' >> issue1852d/.hgsub
1132 $ echo xyz > issue1852d/sub/repo/foo
1135 $ echo xyz > issue1852d/sub/repo/foo
1133 $ hg -R issue1852d pull -u
1136 $ hg -R issue1852d pull -u
1134 pulling from $TESTTMP/issue1852a (glob)
1137 pulling from $TESTTMP/issue1852a (glob)
1135 searching for changes
1138 searching for changes
1136 adding changesets
1139 adding changesets
1137 adding manifests
1140 adding manifests
1138 adding file changes
1141 adding file changes
1139 added 1 changesets with 2 changes to 2 files
1142 added 1 changesets with 2 changes to 2 files
1140 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1143 subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
1141 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1144 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1142 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1145 pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo (glob)
1143 searching for changes
1146 searching for changes
1144 adding changesets
1147 adding changesets
1145 adding manifests
1148 adding manifests
1146 adding file changes
1149 adding file changes
1147 added 1 changesets with 1 changes to 1 files
1150 added 1 changesets with 1 changes to 1 files
1148 subrepository sources for sub/repo differ (glob)
1151 subrepository sources for sub/repo differ (glob)
1149 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1152 use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
1150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1151 $ cat issue1852d/.hgsubstate
1154 $ cat issue1852d/.hgsubstate
1152 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1155 f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
1153
1156
1154 Check status of files when none of them belong to the first
1157 Check status of files when none of them belong to the first
1155 subrepository:
1158 subrepository:
1156
1159
1157 $ hg init subrepo-status
1160 $ hg init subrepo-status
1158 $ cd subrepo-status
1161 $ cd subrepo-status
1159 $ hg init subrepo-1
1162 $ hg init subrepo-1
1160 $ hg init subrepo-2
1163 $ hg init subrepo-2
1161 $ cd subrepo-2
1164 $ cd subrepo-2
1162 $ touch file
1165 $ touch file
1163 $ hg add file
1166 $ hg add file
1164 $ cd ..
1167 $ cd ..
1165 $ echo subrepo-1 = subrepo-1 > .hgsub
1168 $ echo subrepo-1 = subrepo-1 > .hgsub
1166 $ echo subrepo-2 = subrepo-2 >> .hgsub
1169 $ echo subrepo-2 = subrepo-2 >> .hgsub
1167 $ hg add .hgsub
1170 $ hg add .hgsub
1168 $ hg ci -m 'Added subrepos'
1171 $ hg ci -m 'Added subrepos'
1169 committing subrepository subrepo-2
1172 committing subrepository subrepo-2
1170 $ hg st subrepo-2/file
1173 $ hg st subrepo-2/file
1171
1174
1172 Check that share works with subrepo
1175 Check that share works with subrepo
1173 $ hg --config extensions.share= share . ../shared
1176 $ hg --config extensions.share= share . ../shared
1174 updating working directory
1177 updating working directory
1175 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1178 cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2
1176 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1177 $ test -f ../shared/subrepo-1/.hg/sharedpath
1180 $ test -f ../shared/subrepo-1/.hg/sharedpath
1178 [1]
1181 [1]
1179 $ hg -R ../shared in
1182 $ hg -R ../shared in
1180 abort: repository default not found!
1183 abort: repository default not found!
1181 [255]
1184 [255]
1182 $ hg -R ../shared/subrepo-2 showconfig paths
1185 $ hg -R ../shared/subrepo-2 showconfig paths
1183 paths.default=$TESTTMP/subrepo-status/subrepo-2
1186 paths.default=$TESTTMP/subrepo-status/subrepo-2
1184 $ hg -R ../shared/subrepo-1 sum --remote
1187 $ hg -R ../shared/subrepo-1 sum --remote
1185 parent: -1:000000000000 tip (empty repository)
1188 parent: -1:000000000000 tip (empty repository)
1186 branch: default
1189 branch: default
1187 commit: (clean)
1190 commit: (clean)
1188 update: (current)
1191 update: (current)
1189 remote: (synced)
1192 remote: (synced)
1190
1193
1191 Check hg update --clean
1194 Check hg update --clean
1192 $ cd $TESTTMP/t
1195 $ cd $TESTTMP/t
1193 $ rm -r t/t.orig
1196 $ rm -r t/t.orig
1194 $ hg status -S --all
1197 $ hg status -S --all
1195 C .hgsub
1198 C .hgsub
1196 C .hgsubstate
1199 C .hgsubstate
1197 C a
1200 C a
1198 C s/.hgsub
1201 C s/.hgsub
1199 C s/.hgsubstate
1202 C s/.hgsubstate
1200 C s/a
1203 C s/a
1201 C s/ss/a
1204 C s/ss/a
1202 C t/t
1205 C t/t
1203 $ echo c1 > s/a
1206 $ echo c1 > s/a
1204 $ cd s
1207 $ cd s
1205 $ echo c1 > b
1208 $ echo c1 > b
1206 $ echo c1 > c
1209 $ echo c1 > c
1207 $ hg add b
1210 $ hg add b
1208 $ cd ..
1211 $ cd ..
1209 $ hg status -S
1212 $ hg status -S
1210 M s/a
1213 M s/a
1211 A s/b
1214 A s/b
1212 ? s/c
1215 ? s/c
1213 $ hg update -C
1216 $ hg update -C
1214 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1217 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1218 updated to "925c17564ef8: 13"
1215 2 other heads for branch "default"
1219 2 other heads for branch "default"
1216 $ hg status -S
1220 $ hg status -S
1217 ? s/b
1221 ? s/b
1218 ? s/c
1222 ? s/c
1219
1223
1220 Sticky subrepositories, no changes
1224 Sticky subrepositories, no changes
1221 $ cd $TESTTMP/t
1225 $ cd $TESTTMP/t
1222 $ hg id
1226 $ hg id
1223 925c17564ef8 tip
1227 925c17564ef8 tip
1224 $ hg -R s id
1228 $ hg -R s id
1225 12a213df6fa9 tip
1229 12a213df6fa9 tip
1226 $ hg -R t id
1230 $ hg -R t id
1227 52c0adc0515a tip
1231 52c0adc0515a tip
1228 $ hg update 11
1232 $ hg update 11
1229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1230 $ hg id
1234 $ hg id
1231 365661e5936a
1235 365661e5936a
1232 $ hg -R s id
1236 $ hg -R s id
1233 fc627a69481f
1237 fc627a69481f
1234 $ hg -R t id
1238 $ hg -R t id
1235 e95bcfa18a35
1239 e95bcfa18a35
1236
1240
1237 Sticky subrepositories, file changes
1241 Sticky subrepositories, file changes
1238 $ touch s/f1
1242 $ touch s/f1
1239 $ touch t/f1
1243 $ touch t/f1
1240 $ hg add -S s/f1
1244 $ hg add -S s/f1
1241 $ hg add -S t/f1
1245 $ hg add -S t/f1
1242 $ hg id
1246 $ hg id
1243 365661e5936a+
1247 365661e5936a+
1244 $ hg -R s id
1248 $ hg -R s id
1245 fc627a69481f+
1249 fc627a69481f+
1246 $ hg -R t id
1250 $ hg -R t id
1247 e95bcfa18a35+
1251 e95bcfa18a35+
1248 $ hg update tip
1252 $ hg update tip
1249 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1253 subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
1250 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1254 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1251 subrepository sources for s differ
1255 subrepository sources for s differ
1252 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1256 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
1253 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1257 subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
1254 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1258 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1255 subrepository sources for t differ
1259 subrepository sources for t differ
1256 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1260 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
1257 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1261 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1258 $ hg id
1262 $ hg id
1259 925c17564ef8+ tip
1263 925c17564ef8+ tip
1260 $ hg -R s id
1264 $ hg -R s id
1261 fc627a69481f+
1265 fc627a69481f+
1262 $ hg -R t id
1266 $ hg -R t id
1263 e95bcfa18a35+
1267 e95bcfa18a35+
1264 $ hg update --clean tip
1268 $ hg update --clean tip
1265 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1266
1270
1267 Sticky subrepository, revision updates
1271 Sticky subrepository, revision updates
1268 $ hg id
1272 $ hg id
1269 925c17564ef8 tip
1273 925c17564ef8 tip
1270 $ hg -R s id
1274 $ hg -R s id
1271 12a213df6fa9 tip
1275 12a213df6fa9 tip
1272 $ hg -R t id
1276 $ hg -R t id
1273 52c0adc0515a tip
1277 52c0adc0515a tip
1274 $ cd s
1278 $ cd s
1275 $ hg update -r -2
1279 $ hg update -r -2
1276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1280 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1277 $ cd ../t
1281 $ cd ../t
1278 $ hg update -r 2
1282 $ hg update -r 2
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1280 $ cd ..
1284 $ cd ..
1281 $ hg update 10
1285 $ hg update 10
1282 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1286 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1283 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1287 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1284 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1288 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
1285 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1289 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1286 subrepository sources for t differ (in checked out version)
1290 subrepository sources for t differ (in checked out version)
1287 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1291 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
1288 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1292 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1289 $ hg id
1293 $ hg id
1290 e45c8b14af55+
1294 e45c8b14af55+
1291 $ hg -R s id
1295 $ hg -R s id
1292 02dcf1d70411
1296 02dcf1d70411
1293 $ hg -R t id
1297 $ hg -R t id
1294 7af322bc1198
1298 7af322bc1198
1295
1299
1296 Sticky subrepository, file changes and revision updates
1300 Sticky subrepository, file changes and revision updates
1297 $ touch s/f1
1301 $ touch s/f1
1298 $ touch t/f1
1302 $ touch t/f1
1299 $ hg add -S s/f1
1303 $ hg add -S s/f1
1300 $ hg add -S t/f1
1304 $ hg add -S t/f1
1301 $ hg id
1305 $ hg id
1302 e45c8b14af55+
1306 e45c8b14af55+
1303 $ hg -R s id
1307 $ hg -R s id
1304 02dcf1d70411+
1308 02dcf1d70411+
1305 $ hg -R t id
1309 $ hg -R t id
1306 7af322bc1198+
1310 7af322bc1198+
1307 $ hg update tip
1311 $ hg update tip
1308 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1312 subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
1309 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1313 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1310 subrepository sources for s differ
1314 subrepository sources for s differ
1311 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1315 use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
1312 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1316 subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
1313 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1317 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1314 subrepository sources for t differ
1318 subrepository sources for t differ
1315 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1319 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
1316 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1320 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1317 $ hg id
1321 $ hg id
1318 925c17564ef8+ tip
1322 925c17564ef8+ tip
1319 $ hg -R s id
1323 $ hg -R s id
1320 02dcf1d70411+
1324 02dcf1d70411+
1321 $ hg -R t id
1325 $ hg -R t id
1322 7af322bc1198+
1326 7af322bc1198+
1323
1327
1324 Sticky repository, update --clean
1328 Sticky repository, update --clean
1325 $ hg update --clean tip
1329 $ hg update --clean tip
1326 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1330 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1327 $ hg id
1331 $ hg id
1328 925c17564ef8 tip
1332 925c17564ef8 tip
1329 $ hg -R s id
1333 $ hg -R s id
1330 12a213df6fa9 tip
1334 12a213df6fa9 tip
1331 $ hg -R t id
1335 $ hg -R t id
1332 52c0adc0515a tip
1336 52c0adc0515a tip
1333
1337
1334 Test subrepo already at intended revision:
1338 Test subrepo already at intended revision:
1335 $ cd s
1339 $ cd s
1336 $ hg update fc627a69481f
1340 $ hg update fc627a69481f
1337 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1338 $ cd ..
1342 $ cd ..
1339 $ hg update 11
1343 $ hg update 11
1340 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1344 subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
1341 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1345 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
1342 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1346 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1343 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1347 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1344 $ hg id -n
1348 $ hg id -n
1345 11+
1349 11+
1346 $ hg -R s id
1350 $ hg -R s id
1347 fc627a69481f
1351 fc627a69481f
1348 $ hg -R t id
1352 $ hg -R t id
1349 e95bcfa18a35
1353 e95bcfa18a35
1350
1354
1351 Test that removing .hgsubstate doesn't break anything:
1355 Test that removing .hgsubstate doesn't break anything:
1352
1356
1353 $ hg rm -f .hgsubstate
1357 $ hg rm -f .hgsubstate
1354 $ hg ci -mrm
1358 $ hg ci -mrm
1355 nothing changed
1359 nothing changed
1356 [1]
1360 [1]
1357 $ hg log -vr tip
1361 $ hg log -vr tip
1358 changeset: 13:925c17564ef8
1362 changeset: 13:925c17564ef8
1359 tag: tip
1363 tag: tip
1360 user: test
1364 user: test
1361 date: Thu Jan 01 00:00:00 1970 +0000
1365 date: Thu Jan 01 00:00:00 1970 +0000
1362 files: .hgsubstate
1366 files: .hgsubstate
1363 description:
1367 description:
1364 13
1368 13
1365
1369
1366
1370
1367
1371
1368 Test that removing .hgsub removes .hgsubstate:
1372 Test that removing .hgsub removes .hgsubstate:
1369
1373
1370 $ hg rm .hgsub
1374 $ hg rm .hgsub
1371 $ hg ci -mrm2
1375 $ hg ci -mrm2
1372 created new head
1376 created new head
1373 $ hg log -vr tip
1377 $ hg log -vr tip
1374 changeset: 14:2400bccd50af
1378 changeset: 14:2400bccd50af
1375 tag: tip
1379 tag: tip
1376 parent: 11:365661e5936a
1380 parent: 11:365661e5936a
1377 user: test
1381 user: test
1378 date: Thu Jan 01 00:00:00 1970 +0000
1382 date: Thu Jan 01 00:00:00 1970 +0000
1379 files: .hgsub .hgsubstate
1383 files: .hgsub .hgsubstate
1380 description:
1384 description:
1381 rm2
1385 rm2
1382
1386
1383
1387
1384 Test issue3153: diff -S with deleted subrepos
1388 Test issue3153: diff -S with deleted subrepos
1385
1389
1386 $ hg diff --nodates -S -c .
1390 $ hg diff --nodates -S -c .
1387 diff -r 365661e5936a -r 2400bccd50af .hgsub
1391 diff -r 365661e5936a -r 2400bccd50af .hgsub
1388 --- a/.hgsub
1392 --- a/.hgsub
1389 +++ /dev/null
1393 +++ /dev/null
1390 @@ -1,2 +0,0 @@
1394 @@ -1,2 +0,0 @@
1391 -s = s
1395 -s = s
1392 -t = t
1396 -t = t
1393 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1397 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
1394 --- a/.hgsubstate
1398 --- a/.hgsubstate
1395 +++ /dev/null
1399 +++ /dev/null
1396 @@ -1,2 +0,0 @@
1400 @@ -1,2 +0,0 @@
1397 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1401 -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1398 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1402 -e95bcfa18a358dc4936da981ebf4147b4cad1362 t
1399
1403
1400 Test behavior of add for explicit path in subrepo:
1404 Test behavior of add for explicit path in subrepo:
1401 $ cd ..
1405 $ cd ..
1402 $ hg init explicit
1406 $ hg init explicit
1403 $ cd explicit
1407 $ cd explicit
1404 $ echo s = s > .hgsub
1408 $ echo s = s > .hgsub
1405 $ hg add .hgsub
1409 $ hg add .hgsub
1406 $ hg init s
1410 $ hg init s
1407 $ hg ci -m0
1411 $ hg ci -m0
1408 Adding with an explicit path in a subrepo adds the file
1412 Adding with an explicit path in a subrepo adds the file
1409 $ echo c1 > f1
1413 $ echo c1 > f1
1410 $ echo c2 > s/f2
1414 $ echo c2 > s/f2
1411 $ hg st -S
1415 $ hg st -S
1412 ? f1
1416 ? f1
1413 ? s/f2
1417 ? s/f2
1414 $ hg add s/f2
1418 $ hg add s/f2
1415 $ hg st -S
1419 $ hg st -S
1416 A s/f2
1420 A s/f2
1417 ? f1
1421 ? f1
1418 $ hg ci -R s -m0
1422 $ hg ci -R s -m0
1419 $ hg ci -Am1
1423 $ hg ci -Am1
1420 adding f1
1424 adding f1
1421 Adding with an explicit path in a subrepo with -S has the same behavior
1425 Adding with an explicit path in a subrepo with -S has the same behavior
1422 $ echo c3 > f3
1426 $ echo c3 > f3
1423 $ echo c4 > s/f4
1427 $ echo c4 > s/f4
1424 $ hg st -S
1428 $ hg st -S
1425 ? f3
1429 ? f3
1426 ? s/f4
1430 ? s/f4
1427 $ hg add -S s/f4
1431 $ hg add -S s/f4
1428 $ hg st -S
1432 $ hg st -S
1429 A s/f4
1433 A s/f4
1430 ? f3
1434 ? f3
1431 $ hg ci -R s -m1
1435 $ hg ci -R s -m1
1432 $ hg ci -Ama2
1436 $ hg ci -Ama2
1433 adding f3
1437 adding f3
1434 Adding without a path or pattern silently ignores subrepos
1438 Adding without a path or pattern silently ignores subrepos
1435 $ echo c5 > f5
1439 $ echo c5 > f5
1436 $ echo c6 > s/f6
1440 $ echo c6 > s/f6
1437 $ echo c7 > s/f7
1441 $ echo c7 > s/f7
1438 $ hg st -S
1442 $ hg st -S
1439 ? f5
1443 ? f5
1440 ? s/f6
1444 ? s/f6
1441 ? s/f7
1445 ? s/f7
1442 $ hg add
1446 $ hg add
1443 adding f5
1447 adding f5
1444 $ hg st -S
1448 $ hg st -S
1445 A f5
1449 A f5
1446 ? s/f6
1450 ? s/f6
1447 ? s/f7
1451 ? s/f7
1448 $ hg ci -R s -Am2
1452 $ hg ci -R s -Am2
1449 adding f6
1453 adding f6
1450 adding f7
1454 adding f7
1451 $ hg ci -m3
1455 $ hg ci -m3
1452 Adding without a path or pattern with -S also adds files in subrepos
1456 Adding without a path or pattern with -S also adds files in subrepos
1453 $ echo c8 > f8
1457 $ echo c8 > f8
1454 $ echo c9 > s/f9
1458 $ echo c9 > s/f9
1455 $ echo c10 > s/f10
1459 $ echo c10 > s/f10
1456 $ hg st -S
1460 $ hg st -S
1457 ? f8
1461 ? f8
1458 ? s/f10
1462 ? s/f10
1459 ? s/f9
1463 ? s/f9
1460 $ hg add -S
1464 $ hg add -S
1461 adding f8
1465 adding f8
1462 adding s/f10 (glob)
1466 adding s/f10 (glob)
1463 adding s/f9 (glob)
1467 adding s/f9 (glob)
1464 $ hg st -S
1468 $ hg st -S
1465 A f8
1469 A f8
1466 A s/f10
1470 A s/f10
1467 A s/f9
1471 A s/f9
1468 $ hg ci -R s -m3
1472 $ hg ci -R s -m3
1469 $ hg ci -m4
1473 $ hg ci -m4
1470 Adding with a pattern silently ignores subrepos
1474 Adding with a pattern silently ignores subrepos
1471 $ echo c11 > fm11
1475 $ echo c11 > fm11
1472 $ echo c12 > fn12
1476 $ echo c12 > fn12
1473 $ echo c13 > s/fm13
1477 $ echo c13 > s/fm13
1474 $ echo c14 > s/fn14
1478 $ echo c14 > s/fn14
1475 $ hg st -S
1479 $ hg st -S
1476 ? fm11
1480 ? fm11
1477 ? fn12
1481 ? fn12
1478 ? s/fm13
1482 ? s/fm13
1479 ? s/fn14
1483 ? s/fn14
1480 $ hg add 'glob:**fm*'
1484 $ hg add 'glob:**fm*'
1481 adding fm11
1485 adding fm11
1482 $ hg st -S
1486 $ hg st -S
1483 A fm11
1487 A fm11
1484 ? fn12
1488 ? fn12
1485 ? s/fm13
1489 ? s/fm13
1486 ? s/fn14
1490 ? s/fn14
1487 $ hg ci -R s -Am4
1491 $ hg ci -R s -Am4
1488 adding fm13
1492 adding fm13
1489 adding fn14
1493 adding fn14
1490 $ hg ci -Am5
1494 $ hg ci -Am5
1491 adding fn12
1495 adding fn12
1492 Adding with a pattern with -S also adds matches in subrepos
1496 Adding with a pattern with -S also adds matches in subrepos
1493 $ echo c15 > fm15
1497 $ echo c15 > fm15
1494 $ echo c16 > fn16
1498 $ echo c16 > fn16
1495 $ echo c17 > s/fm17
1499 $ echo c17 > s/fm17
1496 $ echo c18 > s/fn18
1500 $ echo c18 > s/fn18
1497 $ hg st -S
1501 $ hg st -S
1498 ? fm15
1502 ? fm15
1499 ? fn16
1503 ? fn16
1500 ? s/fm17
1504 ? s/fm17
1501 ? s/fn18
1505 ? s/fn18
1502 $ hg add -S 'glob:**fm*'
1506 $ hg add -S 'glob:**fm*'
1503 adding fm15
1507 adding fm15
1504 adding s/fm17 (glob)
1508 adding s/fm17 (glob)
1505 $ hg st -S
1509 $ hg st -S
1506 A fm15
1510 A fm15
1507 A s/fm17
1511 A s/fm17
1508 ? fn16
1512 ? fn16
1509 ? s/fn18
1513 ? s/fn18
1510 $ hg ci -R s -Am5
1514 $ hg ci -R s -Am5
1511 adding fn18
1515 adding fn18
1512 $ hg ci -Am6
1516 $ hg ci -Am6
1513 adding fn16
1517 adding fn16
1514
1518
1515 Test behavior of forget for explicit path in subrepo:
1519 Test behavior of forget for explicit path in subrepo:
1516 Forgetting an explicit path in a subrepo untracks the file
1520 Forgetting an explicit path in a subrepo untracks the file
1517 $ echo c19 > s/f19
1521 $ echo c19 > s/f19
1518 $ hg add s/f19
1522 $ hg add s/f19
1519 $ hg st -S
1523 $ hg st -S
1520 A s/f19
1524 A s/f19
1521 $ hg forget s/f19
1525 $ hg forget s/f19
1522 $ hg st -S
1526 $ hg st -S
1523 ? s/f19
1527 ? s/f19
1524 $ rm s/f19
1528 $ rm s/f19
1525 $ cd ..
1529 $ cd ..
1526
1530
1527 Courtesy phases synchronisation to publishing server does not block the push
1531 Courtesy phases synchronisation to publishing server does not block the push
1528 (issue3781)
1532 (issue3781)
1529
1533
1530 $ cp -R main issue3781
1534 $ cp -R main issue3781
1531 $ cp -R main issue3781-dest
1535 $ cp -R main issue3781-dest
1532 $ cd issue3781-dest/s
1536 $ cd issue3781-dest/s
1533 $ hg phase tip # show we have draft changeset
1537 $ hg phase tip # show we have draft changeset
1534 5: draft
1538 5: draft
1535 $ chmod a-w .hg/store/phaseroots # prevent phase push
1539 $ chmod a-w .hg/store/phaseroots # prevent phase push
1536 $ cd ../../issue3781
1540 $ cd ../../issue3781
1537 $ cat >> .hg/hgrc << EOF
1541 $ cat >> .hg/hgrc << EOF
1538 > [paths]
1542 > [paths]
1539 > default=../issue3781-dest/
1543 > default=../issue3781-dest/
1540 > EOF
1544 > EOF
1541 $ hg push --config devel.legacy.exchange=bundle1
1545 $ hg push --config devel.legacy.exchange=bundle1
1542 pushing to $TESTTMP/issue3781-dest (glob)
1546 pushing to $TESTTMP/issue3781-dest (glob)
1543 pushing subrepo s to $TESTTMP/issue3781-dest/s
1547 pushing subrepo s to $TESTTMP/issue3781-dest/s
1544 searching for changes
1548 searching for changes
1545 no changes found
1549 no changes found
1546 searching for changes
1550 searching for changes
1547 no changes found
1551 no changes found
1548 [1]
1552 [1]
1549 # clean the push cache
1553 # clean the push cache
1550 $ rm s/.hg/cache/storehash/*
1554 $ rm s/.hg/cache/storehash/*
1551 $ hg push # bundle2+
1555 $ hg push # bundle2+
1552 pushing to $TESTTMP/issue3781-dest (glob)
1556 pushing to $TESTTMP/issue3781-dest (glob)
1553 pushing subrepo s to $TESTTMP/issue3781-dest/s
1557 pushing subrepo s to $TESTTMP/issue3781-dest/s
1554 searching for changes
1558 searching for changes
1555 no changes found
1559 no changes found
1556 searching for changes
1560 searching for changes
1557 no changes found
1561 no changes found
1558 [1]
1562 [1]
1559 $ cd ..
1563 $ cd ..
1560
1564
1561 Test phase choice for newly created commit with "phases.subrepochecks"
1565 Test phase choice for newly created commit with "phases.subrepochecks"
1562 configuration
1566 configuration
1563
1567
1564 $ cd t
1568 $ cd t
1565 $ hg update -q -r 12
1569 $ hg update -q -r 12
1566
1570
1567 $ cat >> s/ss/.hg/hgrc <<EOF
1571 $ cat >> s/ss/.hg/hgrc <<EOF
1568 > [phases]
1572 > [phases]
1569 > new-commit = secret
1573 > new-commit = secret
1570 > EOF
1574 > EOF
1571 $ cat >> s/.hg/hgrc <<EOF
1575 $ cat >> s/.hg/hgrc <<EOF
1572 > [phases]
1576 > [phases]
1573 > new-commit = draft
1577 > new-commit = draft
1574 > EOF
1578 > EOF
1575 $ echo phasecheck1 >> s/ss/a
1579 $ echo phasecheck1 >> s/ss/a
1576 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1580 $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1
1577 committing subrepository ss
1581 committing subrepository ss
1578 transaction abort!
1582 transaction abort!
1579 rollback completed
1583 rollback completed
1580 abort: can't commit in draft phase conflicting secret from subrepository ss
1584 abort: can't commit in draft phase conflicting secret from subrepository ss
1581 [255]
1585 [255]
1582 $ echo phasecheck2 >> s/ss/a
1586 $ echo phasecheck2 >> s/ss/a
1583 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1587 $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2
1584 committing subrepository ss
1588 committing subrepository ss
1585 $ hg -R s/ss phase tip
1589 $ hg -R s/ss phase tip
1586 3: secret
1590 3: secret
1587 $ hg -R s phase tip
1591 $ hg -R s phase tip
1588 6: draft
1592 6: draft
1589 $ echo phasecheck3 >> s/ss/a
1593 $ echo phasecheck3 >> s/ss/a
1590 $ hg -R s commit -S -m phasecheck3
1594 $ hg -R s commit -S -m phasecheck3
1591 committing subrepository ss
1595 committing subrepository ss
1592 warning: changes are committed in secret phase from subrepository ss
1596 warning: changes are committed in secret phase from subrepository ss
1593 $ hg -R s/ss phase tip
1597 $ hg -R s/ss phase tip
1594 4: secret
1598 4: secret
1595 $ hg -R s phase tip
1599 $ hg -R s phase tip
1596 7: secret
1600 7: secret
1597
1601
1598 $ cat >> t/.hg/hgrc <<EOF
1602 $ cat >> t/.hg/hgrc <<EOF
1599 > [phases]
1603 > [phases]
1600 > new-commit = draft
1604 > new-commit = draft
1601 > EOF
1605 > EOF
1602 $ cat >> .hg/hgrc <<EOF
1606 $ cat >> .hg/hgrc <<EOF
1603 > [phases]
1607 > [phases]
1604 > new-commit = public
1608 > new-commit = public
1605 > EOF
1609 > EOF
1606 $ echo phasecheck4 >> s/ss/a
1610 $ echo phasecheck4 >> s/ss/a
1607 $ echo phasecheck4 >> t/t
1611 $ echo phasecheck4 >> t/t
1608 $ hg commit -S -m phasecheck4
1612 $ hg commit -S -m phasecheck4
1609 committing subrepository s
1613 committing subrepository s
1610 committing subrepository s/ss (glob)
1614 committing subrepository s/ss (glob)
1611 warning: changes are committed in secret phase from subrepository ss
1615 warning: changes are committed in secret phase from subrepository ss
1612 committing subrepository t
1616 committing subrepository t
1613 warning: changes are committed in secret phase from subrepository s
1617 warning: changes are committed in secret phase from subrepository s
1614 created new head
1618 created new head
1615 $ hg -R s/ss phase tip
1619 $ hg -R s/ss phase tip
1616 5: secret
1620 5: secret
1617 $ hg -R s phase tip
1621 $ hg -R s phase tip
1618 8: secret
1622 8: secret
1619 $ hg -R t phase tip
1623 $ hg -R t phase tip
1620 6: draft
1624 6: draft
1621 $ hg phase tip
1625 $ hg phase tip
1622 15: secret
1626 15: secret
1623
1627
1624 $ cd ..
1628 $ cd ..
1625
1629
1626
1630
1627 Test that commit --secret works on both repo and subrepo (issue4182)
1631 Test that commit --secret works on both repo and subrepo (issue4182)
1628
1632
1629 $ cd main
1633 $ cd main
1630 $ echo secret >> b
1634 $ echo secret >> b
1631 $ echo secret >> s/b
1635 $ echo secret >> s/b
1632 $ hg commit --secret --subrepo -m "secret"
1636 $ hg commit --secret --subrepo -m "secret"
1633 committing subrepository s
1637 committing subrepository s
1634 $ hg phase -r .
1638 $ hg phase -r .
1635 6: secret
1639 6: secret
1636 $ cd s
1640 $ cd s
1637 $ hg phase -r .
1641 $ hg phase -r .
1638 6: secret
1642 6: secret
1639 $ cd ../../
1643 $ cd ../../
1640
1644
1641 Test "subrepos" template keyword
1645 Test "subrepos" template keyword
1642
1646
1643 $ cd t
1647 $ cd t
1644 $ hg update -q 15
1648 $ hg update -q 15
1645 $ cat > .hgsub <<EOF
1649 $ cat > .hgsub <<EOF
1646 > s = s
1650 > s = s
1647 > EOF
1651 > EOF
1648 $ hg commit -m "16"
1652 $ hg commit -m "16"
1649 warning: changes are committed in secret phase from subrepository s
1653 warning: changes are committed in secret phase from subrepository s
1650
1654
1651 (addition of ".hgsub" itself)
1655 (addition of ".hgsub" itself)
1652
1656
1653 $ hg diff --nodates -c 1 .hgsubstate
1657 $ hg diff --nodates -c 1 .hgsubstate
1654 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1658 diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate
1655 --- /dev/null
1659 --- /dev/null
1656 +++ b/.hgsubstate
1660 +++ b/.hgsubstate
1657 @@ -0,0 +1,1 @@
1661 @@ -0,0 +1,1 @@
1658 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1662 +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1659 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1663 $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1660 f7b1eb17ad24 000000000000
1664 f7b1eb17ad24 000000000000
1661 s
1665 s
1662
1666
1663 (modification of existing entry)
1667 (modification of existing entry)
1664
1668
1665 $ hg diff --nodates -c 2 .hgsubstate
1669 $ hg diff --nodates -c 2 .hgsubstate
1666 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1670 diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate
1667 --- a/.hgsubstate
1671 --- a/.hgsubstate
1668 +++ b/.hgsubstate
1672 +++ b/.hgsubstate
1669 @@ -1,1 +1,1 @@
1673 @@ -1,1 +1,1 @@
1670 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1674 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1671 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1675 +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s
1672 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1676 $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1673 7cf8cfea66e4 000000000000
1677 7cf8cfea66e4 000000000000
1674 s
1678 s
1675
1679
1676 (addition of entry)
1680 (addition of entry)
1677
1681
1678 $ hg diff --nodates -c 5 .hgsubstate
1682 $ hg diff --nodates -c 5 .hgsubstate
1679 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1683 diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate
1680 --- a/.hgsubstate
1684 --- a/.hgsubstate
1681 +++ b/.hgsubstate
1685 +++ b/.hgsubstate
1682 @@ -1,1 +1,2 @@
1686 @@ -1,1 +1,2 @@
1683 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1687 e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1684 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1688 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1685 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1689 $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1686 7cf8cfea66e4 000000000000
1690 7cf8cfea66e4 000000000000
1687 t
1691 t
1688
1692
1689 (removal of existing entry)
1693 (removal of existing entry)
1690
1694
1691 $ hg diff --nodates -c 16 .hgsubstate
1695 $ hg diff --nodates -c 16 .hgsubstate
1692 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1696 diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate
1693 --- a/.hgsubstate
1697 --- a/.hgsubstate
1694 +++ b/.hgsubstate
1698 +++ b/.hgsubstate
1695 @@ -1,2 +1,1 @@
1699 @@ -1,2 +1,1 @@
1696 0731af8ca9423976d3743119d0865097c07bdc1b s
1700 0731af8ca9423976d3743119d0865097c07bdc1b s
1697 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1701 -e202dc79b04c88a636ea8913d9182a1346d9b3dc t
1698 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1702 $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1699 8bec38d2bd0b 000000000000
1703 8bec38d2bd0b 000000000000
1700 t
1704 t
1701
1705
1702 (merging)
1706 (merging)
1703
1707
1704 $ hg diff --nodates -c 9 .hgsubstate
1708 $ hg diff --nodates -c 9 .hgsubstate
1705 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1709 diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate
1706 --- a/.hgsubstate
1710 --- a/.hgsubstate
1707 +++ b/.hgsubstate
1711 +++ b/.hgsubstate
1708 @@ -1,1 +1,2 @@
1712 @@ -1,1 +1,2 @@
1709 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1713 fc627a69481fcbe5f1135069e8a3881c023e4cf5 s
1710 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1714 +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t
1711 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1715 $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1712 f6affe3fbfaa 1f14a2e2d3ec
1716 f6affe3fbfaa 1f14a2e2d3ec
1713 t
1717 t
1714
1718
1715 (removal of ".hgsub" itself)
1719 (removal of ".hgsub" itself)
1716
1720
1717 $ hg diff --nodates -c 8 .hgsubstate
1721 $ hg diff --nodates -c 8 .hgsubstate
1718 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1722 diff -r f94576341bcf -r 96615c1dad2d .hgsubstate
1719 --- a/.hgsubstate
1723 --- a/.hgsubstate
1720 +++ /dev/null
1724 +++ /dev/null
1721 @@ -1,2 +0,0 @@
1725 @@ -1,2 +0,0 @@
1722 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1726 -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s
1723 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1727 -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t
1724 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1728 $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}"
1725 f94576341bcf 000000000000
1729 f94576341bcf 000000000000
1726
1730
1727 Test that '[paths]' is configured correctly at subrepo creation
1731 Test that '[paths]' is configured correctly at subrepo creation
1728
1732
1729 $ cd $TESTTMP/tc
1733 $ cd $TESTTMP/tc
1730 $ cat > .hgsub <<EOF
1734 $ cat > .hgsub <<EOF
1731 > # to clear bogus subrepo path 'bogus=[boguspath'
1735 > # to clear bogus subrepo path 'bogus=[boguspath'
1732 > s = s
1736 > s = s
1733 > t = t
1737 > t = t
1734 > EOF
1738 > EOF
1735 $ hg update -q --clean null
1739 $ hg update -q --clean null
1736 $ rm -rf s t
1740 $ rm -rf s t
1737 $ cat >> .hg/hgrc <<EOF
1741 $ cat >> .hg/hgrc <<EOF
1738 > [paths]
1742 > [paths]
1739 > default-push = /foo/bar
1743 > default-push = /foo/bar
1740 > EOF
1744 > EOF
1741 $ hg update -q
1745 $ hg update -q
1742 $ cat s/.hg/hgrc
1746 $ cat s/.hg/hgrc
1743 [paths]
1747 [paths]
1744 default = $TESTTMP/t/s
1748 default = $TESTTMP/t/s
1745 default-push = /foo/bar/s
1749 default-push = /foo/bar/s
1746 $ cat s/ss/.hg/hgrc
1750 $ cat s/ss/.hg/hgrc
1747 [paths]
1751 [paths]
1748 default = $TESTTMP/t/s/ss
1752 default = $TESTTMP/t/s/ss
1749 default-push = /foo/bar/s/ss
1753 default-push = /foo/bar/s/ss
1750 $ cat t/.hg/hgrc
1754 $ cat t/.hg/hgrc
1751 [paths]
1755 [paths]
1752 default = $TESTTMP/t/t
1756 default = $TESTTMP/t/t
1753 default-push = /foo/bar/t
1757 default-push = /foo/bar/t
1754
1758
1755 $ cd $TESTTMP/t
1759 $ cd $TESTTMP/t
1756 $ hg up -qC 0
1760 $ hg up -qC 0
1757 $ echo 'bar' > bar.txt
1761 $ echo 'bar' > bar.txt
1758 $ hg ci -Am 'branch before subrepo add'
1762 $ hg ci -Am 'branch before subrepo add'
1759 adding bar.txt
1763 adding bar.txt
1760 created new head
1764 created new head
1761 $ hg merge -r "first(subrepo('s'))"
1765 $ hg merge -r "first(subrepo('s'))"
1762 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1766 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1763 (branch merge, don't forget to commit)
1767 (branch merge, don't forget to commit)
1764 $ hg status -S -X '.hgsub*'
1768 $ hg status -S -X '.hgsub*'
1765 A s/a
1769 A s/a
1766 ? s/b
1770 ? s/b
1767 ? s/c
1771 ? s/c
1768 ? s/f1
1772 ? s/f1
1769 $ hg status -S --rev 'p2()'
1773 $ hg status -S --rev 'p2()'
1770 A bar.txt
1774 A bar.txt
1771 ? s/b
1775 ? s/b
1772 ? s/c
1776 ? s/c
1773 ? s/f1
1777 ? s/f1
1774 $ hg diff -S -X '.hgsub*' --nodates
1778 $ hg diff -S -X '.hgsub*' --nodates
1775 diff -r 000000000000 s/a
1779 diff -r 000000000000 s/a
1776 --- /dev/null
1780 --- /dev/null
1777 +++ b/s/a
1781 +++ b/s/a
1778 @@ -0,0 +1,1 @@
1782 @@ -0,0 +1,1 @@
1779 +a
1783 +a
1780 $ hg diff -S --rev 'p2()' --nodates
1784 $ hg diff -S --rev 'p2()' --nodates
1781 diff -r 7cf8cfea66e4 bar.txt
1785 diff -r 7cf8cfea66e4 bar.txt
1782 --- /dev/null
1786 --- /dev/null
1783 +++ b/bar.txt
1787 +++ b/bar.txt
1784 @@ -0,0 +1,1 @@
1788 @@ -0,0 +1,1 @@
1785 +bar
1789 +bar
1786
1790
1787 $ cd ..
1791 $ cd ..
@@ -1,1002 +1,1003
1 #require killdaemons
1 #require killdaemons
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > transplant=
5 > transplant=
6 > EOF
6 > EOF
7
7
8 $ hg init t
8 $ hg init t
9 $ cd t
9 $ cd t
10 $ hg transplant
10 $ hg transplant
11 abort: no source URL, branch revision, or revision list provided
11 abort: no source URL, branch revision, or revision list provided
12 [255]
12 [255]
13 $ hg transplant --continue --all
13 $ hg transplant --continue --all
14 abort: --continue is incompatible with --branch, --all and --merge
14 abort: --continue is incompatible with --branch, --all and --merge
15 [255]
15 [255]
16 $ hg transplant --all tip
16 $ hg transplant --all tip
17 abort: --all requires a branch revision
17 abort: --all requires a branch revision
18 [255]
18 [255]
19 $ hg transplant --all --branch default tip
19 $ hg transplant --all --branch default tip
20 abort: --all is incompatible with a revision list
20 abort: --all is incompatible with a revision list
21 [255]
21 [255]
22 $ echo r1 > r1
22 $ echo r1 > r1
23 $ hg ci -Amr1 -d'0 0'
23 $ hg ci -Amr1 -d'0 0'
24 adding r1
24 adding r1
25 $ hg co -q null
25 $ hg co -q null
26 $ hg transplant tip
26 $ hg transplant tip
27 abort: no revision checked out
27 abort: no revision checked out
28 [255]
28 [255]
29 $ hg up -q
29 $ hg up -q
30 $ echo r2 > r2
30 $ echo r2 > r2
31 $ hg ci -Amr2 -d'1 0'
31 $ hg ci -Amr2 -d'1 0'
32 adding r2
32 adding r2
33 $ hg up 0
33 $ hg up 0
34 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
34 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35
35
36 $ echo b1 > b1
36 $ echo b1 > b1
37 $ hg ci -Amb1 -d '0 0'
37 $ hg ci -Amb1 -d '0 0'
38 adding b1
38 adding b1
39 created new head
39 created new head
40 $ hg merge 1
40 $ hg merge 1
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 1 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 transplant 1
43 $ hg transplant 1
44 abort: outstanding uncommitted merges
44 abort: outstanding uncommitted merges
45 [255]
45 [255]
46 $ hg up -qC tip
46 $ hg up -qC tip
47 $ echo b0 > b1
47 $ echo b0 > b1
48 $ hg transplant 1
48 $ hg transplant 1
49 abort: outstanding local changes
49 abort: outstanding local changes
50 [255]
50 [255]
51 $ hg up -qC tip
51 $ hg up -qC tip
52 $ echo b2 > b2
52 $ echo b2 > b2
53 $ hg ci -Amb2 -d '1 0'
53 $ hg ci -Amb2 -d '1 0'
54 adding b2
54 adding b2
55 $ echo b3 > b3
55 $ echo b3 > b3
56 $ hg ci -Amb3 -d '2 0'
56 $ hg ci -Amb3 -d '2 0'
57 adding b3
57 adding b3
58
58
59 $ hg log --template '{rev} {parents} {desc}\n'
59 $ hg log --template '{rev} {parents} {desc}\n'
60 4 b3
60 4 b3
61 3 b2
61 3 b2
62 2 0:17ab29e464c6 b1
62 2 0:17ab29e464c6 b1
63 1 r2
63 1 r2
64 0 r1
64 0 r1
65
65
66 $ hg clone . ../rebase
66 $ hg clone . ../rebase
67 updating to branch default
67 updating to branch default
68 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 $ hg init ../emptydest
69 $ hg init ../emptydest
70 $ cd ../emptydest
70 $ cd ../emptydest
71 $ hg transplant --source=../t > /dev/null
71 $ hg transplant --source=../t > /dev/null
72 $ cd ../rebase
72 $ cd ../rebase
73
73
74 $ hg up -C 1
74 $ hg up -C 1
75 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
75 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
76
76
77 rebase b onto r1
77 rebase b onto r1
78 (this also tests that editor is not invoked if '--edit' is not specified)
78 (this also tests that editor is not invoked if '--edit' is not specified)
79
79
80 $ HGEDITOR=cat hg transplant -a -b tip
80 $ HGEDITOR=cat hg transplant -a -b tip
81 applying 37a1297eb21b
81 applying 37a1297eb21b
82 37a1297eb21b transplanted to e234d668f844
82 37a1297eb21b transplanted to e234d668f844
83 applying 722f4667af76
83 applying 722f4667af76
84 722f4667af76 transplanted to 539f377d78df
84 722f4667af76 transplanted to 539f377d78df
85 applying a53251cdf717
85 applying a53251cdf717
86 a53251cdf717 transplanted to ffd6818a3975
86 a53251cdf717 transplanted to ffd6818a3975
87 $ hg log --template '{rev} {parents} {desc}\n'
87 $ hg log --template '{rev} {parents} {desc}\n'
88 7 b3
88 7 b3
89 6 b2
89 6 b2
90 5 1:d11e3596cc1a b1
90 5 1:d11e3596cc1a b1
91 4 b3
91 4 b3
92 3 b2
92 3 b2
93 2 0:17ab29e464c6 b1
93 2 0:17ab29e464c6 b1
94 1 r2
94 1 r2
95 0 r1
95 0 r1
96
96
97 test format of transplant_source
97 test format of transplant_source
98
98
99 $ hg log -r7 --debug | grep transplant_source
99 $ hg log -r7 --debug | grep transplant_source
100 extra: transplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z
100 extra: transplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z
101 $ hg log -r7 -T '{extras}\n'
101 $ hg log -r7 -T '{extras}\n'
102 branch=defaulttransplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z
102 branch=defaulttransplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z
103 $ hg log -r7 -T '{join(extras, " ")}\n'
103 $ hg log -r7 -T '{join(extras, " ")}\n'
104 branch=default transplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z
104 branch=default transplant_source=\xa52Q\xcd\xf7\x17g\x9d\x19\x07\xb2\x89\xf9\x91SK\xe0\\\x99z
105
105
106 test transplanted revset
106 test transplanted revset
107
107
108 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
108 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
109 5 1:d11e3596cc1a b1
109 5 1:d11e3596cc1a b1
110 6 b2
110 6 b2
111 7 b3
111 7 b3
112 $ hg log -r 'transplanted(head())' --template '{rev} {parents} {desc}\n'
112 $ hg log -r 'transplanted(head())' --template '{rev} {parents} {desc}\n'
113 7 b3
113 7 b3
114 $ hg help revisions.transplanted
114 $ hg help revisions.transplanted
115 "transplanted([set])"
115 "transplanted([set])"
116 Transplanted changesets in set, or all transplanted changesets.
116 Transplanted changesets in set, or all transplanted changesets.
117
117
118
118
119 test transplanted keyword
119 test transplanted keyword
120
120
121 $ hg log --template '{rev} {transplanted}\n'
121 $ hg log --template '{rev} {transplanted}\n'
122 7 a53251cdf717679d1907b289f991534be05c997a
122 7 a53251cdf717679d1907b289f991534be05c997a
123 6 722f4667af767100cb15b6a79324bf8abbfe1ef4
123 6 722f4667af767100cb15b6a79324bf8abbfe1ef4
124 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21
124 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21
125 4
125 4
126 3
126 3
127 2
127 2
128 1
128 1
129 0
129 0
130
130
131 test destination() revset predicate with a transplant of a transplant; new
131 test destination() revset predicate with a transplant of a transplant; new
132 clone so subsequent rollback isn't affected
132 clone so subsequent rollback isn't affected
133 (this also tests that editor is invoked if '--edit' is specified)
133 (this also tests that editor is invoked if '--edit' is specified)
134
134
135 $ hg clone -q . ../destination
135 $ hg clone -q . ../destination
136 $ cd ../destination
136 $ cd ../destination
137 $ hg up -Cq 0
137 $ hg up -Cq 0
138 $ hg branch -q b4
138 $ hg branch -q b4
139 $ hg ci -qm "b4"
139 $ hg ci -qm "b4"
140 $ hg status --rev "7^1" --rev 7
140 $ hg status --rev "7^1" --rev 7
141 A b3
141 A b3
142 $ cat > $TESTTMP/checkeditform.sh <<EOF
142 $ cat > $TESTTMP/checkeditform.sh <<EOF
143 > env | grep HGEDITFORM
143 > env | grep HGEDITFORM
144 > true
144 > true
145 > EOF
145 > EOF
146 $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF
146 $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF
147 > env | grep HGEDITFORM
147 > env | grep HGEDITFORM
148 > cat \$*
148 > cat \$*
149 > EOF
149 > EOF
150 $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7
150 $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7
151 applying ffd6818a3975
151 applying ffd6818a3975
152 HGEDITFORM=transplant.normal
152 HGEDITFORM=transplant.normal
153 b3
153 b3
154
154
155
155
156 HG: Enter commit message. Lines beginning with 'HG:' are removed.
156 HG: Enter commit message. Lines beginning with 'HG:' are removed.
157 HG: Leave message empty to abort commit.
157 HG: Leave message empty to abort commit.
158 HG: --
158 HG: --
159 HG: user: test
159 HG: user: test
160 HG: branch 'b4'
160 HG: branch 'b4'
161 HG: added b3
161 HG: added b3
162 ffd6818a3975 transplanted to 502236fa76bb
162 ffd6818a3975 transplanted to 502236fa76bb
163
163
164
164
165 $ hg log -r 'destination()'
165 $ hg log -r 'destination()'
166 changeset: 5:e234d668f844
166 changeset: 5:e234d668f844
167 parent: 1:d11e3596cc1a
167 parent: 1:d11e3596cc1a
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: b1
170 summary: b1
171
171
172 changeset: 6:539f377d78df
172 changeset: 6:539f377d78df
173 user: test
173 user: test
174 date: Thu Jan 01 00:00:01 1970 +0000
174 date: Thu Jan 01 00:00:01 1970 +0000
175 summary: b2
175 summary: b2
176
176
177 changeset: 7:ffd6818a3975
177 changeset: 7:ffd6818a3975
178 user: test
178 user: test
179 date: Thu Jan 01 00:00:02 1970 +0000
179 date: Thu Jan 01 00:00:02 1970 +0000
180 summary: b3
180 summary: b3
181
181
182 changeset: 9:502236fa76bb
182 changeset: 9:502236fa76bb
183 branch: b4
183 branch: b4
184 tag: tip
184 tag: tip
185 user: test
185 user: test
186 date: Thu Jan 01 00:00:02 1970 +0000
186 date: Thu Jan 01 00:00:02 1970 +0000
187 summary: b3
187 summary: b3
188
188
189 $ hg log -r 'destination(a53251cdf717)'
189 $ hg log -r 'destination(a53251cdf717)'
190 changeset: 7:ffd6818a3975
190 changeset: 7:ffd6818a3975
191 user: test
191 user: test
192 date: Thu Jan 01 00:00:02 1970 +0000
192 date: Thu Jan 01 00:00:02 1970 +0000
193 summary: b3
193 summary: b3
194
194
195 changeset: 9:502236fa76bb
195 changeset: 9:502236fa76bb
196 branch: b4
196 branch: b4
197 tag: tip
197 tag: tip
198 user: test
198 user: test
199 date: Thu Jan 01 00:00:02 1970 +0000
199 date: Thu Jan 01 00:00:02 1970 +0000
200 summary: b3
200 summary: b3
201
201
202
202
203 test subset parameter in reverse order
203 test subset parameter in reverse order
204 $ hg log -r 'reverse(all()) and destination(a53251cdf717)'
204 $ hg log -r 'reverse(all()) and destination(a53251cdf717)'
205 changeset: 9:502236fa76bb
205 changeset: 9:502236fa76bb
206 branch: b4
206 branch: b4
207 tag: tip
207 tag: tip
208 user: test
208 user: test
209 date: Thu Jan 01 00:00:02 1970 +0000
209 date: Thu Jan 01 00:00:02 1970 +0000
210 summary: b3
210 summary: b3
211
211
212 changeset: 7:ffd6818a3975
212 changeset: 7:ffd6818a3975
213 user: test
213 user: test
214 date: Thu Jan 01 00:00:02 1970 +0000
214 date: Thu Jan 01 00:00:02 1970 +0000
215 summary: b3
215 summary: b3
216
216
217
217
218 back to the original dir
218 back to the original dir
219 $ cd ../rebase
219 $ cd ../rebase
220
220
221 rollback the transplant
221 rollback the transplant
222 $ hg rollback
222 $ hg rollback
223 repository tip rolled back to revision 4 (undo transplant)
223 repository tip rolled back to revision 4 (undo transplant)
224 working directory now based on revision 1
224 working directory now based on revision 1
225 $ hg tip -q
225 $ hg tip -q
226 4:a53251cdf717
226 4:a53251cdf717
227 $ hg parents -q
227 $ hg parents -q
228 1:d11e3596cc1a
228 1:d11e3596cc1a
229 $ hg status
229 $ hg status
230 ? b1
230 ? b1
231 ? b2
231 ? b2
232 ? b3
232 ? b3
233
233
234 $ hg clone ../t ../prune
234 $ hg clone ../t ../prune
235 updating to branch default
235 updating to branch default
236 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
237 $ cd ../prune
237 $ cd ../prune
238
238
239 $ hg up -C 1
239 $ hg up -C 1
240 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
240 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
241
241
242 rebase b onto r1, skipping b2
242 rebase b onto r1, skipping b2
243
243
244 $ hg transplant -a -b tip -p 3
244 $ hg transplant -a -b tip -p 3
245 applying 37a1297eb21b
245 applying 37a1297eb21b
246 37a1297eb21b transplanted to e234d668f844
246 37a1297eb21b transplanted to e234d668f844
247 applying a53251cdf717
247 applying a53251cdf717
248 a53251cdf717 transplanted to 7275fda4d04f
248 a53251cdf717 transplanted to 7275fda4d04f
249 $ hg log --template '{rev} {parents} {desc}\n'
249 $ hg log --template '{rev} {parents} {desc}\n'
250 6 b3
250 6 b3
251 5 1:d11e3596cc1a b1
251 5 1:d11e3596cc1a b1
252 4 b3
252 4 b3
253 3 b2
253 3 b2
254 2 0:17ab29e464c6 b1
254 2 0:17ab29e464c6 b1
255 1 r2
255 1 r2
256 0 r1
256 0 r1
257
257
258 test same-parent transplant with --log
258 test same-parent transplant with --log
259
259
260 $ hg clone -r 1 ../t ../sameparent
260 $ hg clone -r 1 ../t ../sameparent
261 adding changesets
261 adding changesets
262 adding manifests
262 adding manifests
263 adding file changes
263 adding file changes
264 added 2 changesets with 2 changes to 2 files
264 added 2 changesets with 2 changes to 2 files
265 updating to branch default
265 updating to branch default
266 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 $ cd ../sameparent
267 $ cd ../sameparent
268 $ hg transplant --log -s ../prune 5
268 $ hg transplant --log -s ../prune 5
269 searching for changes
269 searching for changes
270 applying e234d668f844
270 applying e234d668f844
271 e234d668f844 transplanted to e07aea8ecf9c
271 e234d668f844 transplanted to e07aea8ecf9c
272 $ hg log --template '{rev} {parents} {desc}\n'
272 $ hg log --template '{rev} {parents} {desc}\n'
273 2 b1
273 2 b1
274 (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170)
274 (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170)
275 1 r2
275 1 r2
276 0 r1
276 0 r1
277 remote transplant, and also test that transplant doesn't break with
277 remote transplant, and also test that transplant doesn't break with
278 format-breaking diffopts
278 format-breaking diffopts
279
279
280 $ hg clone -r 1 ../t ../remote
280 $ hg clone -r 1 ../t ../remote
281 adding changesets
281 adding changesets
282 adding manifests
282 adding manifests
283 adding file changes
283 adding file changes
284 added 2 changesets with 2 changes to 2 files
284 added 2 changesets with 2 changes to 2 files
285 updating to branch default
285 updating to branch default
286 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 $ cd ../remote
287 $ cd ../remote
288 $ hg --config diff.noprefix=True transplant --log -s ../t 2 4
288 $ hg --config diff.noprefix=True transplant --log -s ../t 2 4
289 searching for changes
289 searching for changes
290 applying 37a1297eb21b
290 applying 37a1297eb21b
291 37a1297eb21b transplanted to c19cf0ccb069
291 37a1297eb21b transplanted to c19cf0ccb069
292 applying a53251cdf717
292 applying a53251cdf717
293 a53251cdf717 transplanted to f7fe5bf98525
293 a53251cdf717 transplanted to f7fe5bf98525
294 $ hg log --template '{rev} {parents} {desc}\n'
294 $ hg log --template '{rev} {parents} {desc}\n'
295 3 b3
295 3 b3
296 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
296 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
297 2 b1
297 2 b1
298 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
298 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
299 1 r2
299 1 r2
300 0 r1
300 0 r1
301
301
302 skip previous transplants
302 skip previous transplants
303
303
304 $ hg transplant -s ../t -a -b 4
304 $ hg transplant -s ../t -a -b 4
305 searching for changes
305 searching for changes
306 applying 722f4667af76
306 applying 722f4667af76
307 722f4667af76 transplanted to 47156cd86c0b
307 722f4667af76 transplanted to 47156cd86c0b
308 $ hg log --template '{rev} {parents} {desc}\n'
308 $ hg log --template '{rev} {parents} {desc}\n'
309 4 b2
309 4 b2
310 3 b3
310 3 b3
311 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
311 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
312 2 b1
312 2 b1
313 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
313 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
314 1 r2
314 1 r2
315 0 r1
315 0 r1
316
316
317 skip local changes transplanted to the source
317 skip local changes transplanted to the source
318
318
319 $ echo b4 > b4
319 $ echo b4 > b4
320 $ hg ci -Amb4 -d '3 0'
320 $ hg ci -Amb4 -d '3 0'
321 adding b4
321 adding b4
322 $ hg clone ../t ../pullback
322 $ hg clone ../t ../pullback
323 updating to branch default
323 updating to branch default
324 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
325 $ cd ../pullback
325 $ cd ../pullback
326 $ hg transplant -s ../remote -a -b tip
326 $ hg transplant -s ../remote -a -b tip
327 searching for changes
327 searching for changes
328 applying 4333daefcb15
328 applying 4333daefcb15
329 4333daefcb15 transplanted to 5f42c04e07cc
329 4333daefcb15 transplanted to 5f42c04e07cc
330
330
331
331
332 remote transplant with pull
332 remote transplant with pull
333
333
334 $ hg serve -R ../t -p $HGPORT -d --pid-file=../t.pid
334 $ hg serve -R ../t -p $HGPORT -d --pid-file=../t.pid
335 $ cat ../t.pid >> $DAEMON_PIDS
335 $ cat ../t.pid >> $DAEMON_PIDS
336
336
337 $ hg clone -r 0 ../t ../rp
337 $ hg clone -r 0 ../t ../rp
338 adding changesets
338 adding changesets
339 adding manifests
339 adding manifests
340 adding file changes
340 adding file changes
341 added 1 changesets with 1 changes to 1 files
341 added 1 changesets with 1 changes to 1 files
342 updating to branch default
342 updating to branch default
343 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
343 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 $ cd ../rp
344 $ cd ../rp
345 $ hg transplant -s http://localhost:$HGPORT/ 37a1297eb21b a53251cdf717
345 $ hg transplant -s http://localhost:$HGPORT/ 37a1297eb21b a53251cdf717
346 searching for changes
346 searching for changes
347 searching for changes
347 searching for changes
348 adding changesets
348 adding changesets
349 adding manifests
349 adding manifests
350 adding file changes
350 adding file changes
351 added 1 changesets with 1 changes to 1 files
351 added 1 changesets with 1 changes to 1 files
352 applying a53251cdf717
352 applying a53251cdf717
353 a53251cdf717 transplanted to 8d9279348abb
353 a53251cdf717 transplanted to 8d9279348abb
354 $ hg log --template '{rev} {parents} {desc}\n'
354 $ hg log --template '{rev} {parents} {desc}\n'
355 2 b3
355 2 b3
356 1 b1
356 1 b1
357 0 r1
357 0 r1
358
358
359 remote transplant without pull
359 remote transplant without pull
360 (It was using "2" and "4" (as the previous transplant used to) which referenced
360 (It was using "2" and "4" (as the previous transplant used to) which referenced
361 revision different from one run to another)
361 revision different from one run to another)
362
362
363 $ hg pull -q http://localhost:$HGPORT/
363 $ hg pull -q http://localhost:$HGPORT/
364 $ hg transplant -s http://localhost:$HGPORT/ 8d9279348abb 722f4667af76
364 $ hg transplant -s http://localhost:$HGPORT/ 8d9279348abb 722f4667af76
365 skipping already applied revision 2:8d9279348abb
365 skipping already applied revision 2:8d9279348abb
366 applying 722f4667af76
366 applying 722f4667af76
367 722f4667af76 transplanted to 76e321915884
367 722f4667af76 transplanted to 76e321915884
368
368
369 transplant --continue
369 transplant --continue
370
370
371 $ hg init ../tc
371 $ hg init ../tc
372 $ cd ../tc
372 $ cd ../tc
373 $ cat <<EOF > foo
373 $ cat <<EOF > foo
374 > foo
374 > foo
375 > bar
375 > bar
376 > baz
376 > baz
377 > EOF
377 > EOF
378 $ echo toremove > toremove
378 $ echo toremove > toremove
379 $ echo baz > baz
379 $ echo baz > baz
380 $ hg ci -Amfoo
380 $ hg ci -Amfoo
381 adding baz
381 adding baz
382 adding foo
382 adding foo
383 adding toremove
383 adding toremove
384 $ cat <<EOF > foo
384 $ cat <<EOF > foo
385 > foo2
385 > foo2
386 > bar2
386 > bar2
387 > baz2
387 > baz2
388 > EOF
388 > EOF
389 $ rm toremove
389 $ rm toremove
390 $ echo added > added
390 $ echo added > added
391 $ hg ci -Amfoo2
391 $ hg ci -Amfoo2
392 adding added
392 adding added
393 removing toremove
393 removing toremove
394 $ echo bar > bar
394 $ echo bar > bar
395 $ cat > baz <<EOF
395 $ cat > baz <<EOF
396 > before baz
396 > before baz
397 > baz
397 > baz
398 > after baz
398 > after baz
399 > EOF
399 > EOF
400 $ hg ci -Ambar
400 $ hg ci -Ambar
401 adding bar
401 adding bar
402 $ echo bar2 >> bar
402 $ echo bar2 >> bar
403 $ hg ci -mbar2
403 $ hg ci -mbar2
404 $ hg up 0
404 $ hg up 0
405 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
405 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
406 $ echo foobar > foo
406 $ echo foobar > foo
407 $ hg ci -mfoobar
407 $ hg ci -mfoobar
408 created new head
408 created new head
409 $ hg transplant 1:3
409 $ hg transplant 1:3
410 applying 46ae92138f3c
410 applying 46ae92138f3c
411 patching file foo
411 patching file foo
412 Hunk #1 FAILED at 0
412 Hunk #1 FAILED at 0
413 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
413 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
414 patch failed to apply
414 patch failed to apply
415 abort: fix up the working directory and run hg transplant --continue
415 abort: fix up the working directory and run hg transplant --continue
416 [255]
416 [255]
417
417
418 transplant -c shouldn't use an old changeset
418 transplant -c shouldn't use an old changeset
419
419
420 $ hg up -C
420 $ hg up -C
421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 updated to "e8643552fde5: foobar"
422 1 other heads for branch "default"
423 1 other heads for branch "default"
423 $ rm added
424 $ rm added
424 $ hg transplant --continue
425 $ hg transplant --continue
425 abort: no transplant to continue
426 abort: no transplant to continue
426 [255]
427 [255]
427 $ hg transplant 1
428 $ hg transplant 1
428 applying 46ae92138f3c
429 applying 46ae92138f3c
429 patching file foo
430 patching file foo
430 Hunk #1 FAILED at 0
431 Hunk #1 FAILED at 0
431 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
432 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
432 patch failed to apply
433 patch failed to apply
433 abort: fix up the working directory and run hg transplant --continue
434 abort: fix up the working directory and run hg transplant --continue
434 [255]
435 [255]
435 $ cp .hg/transplant/journal .hg/transplant/journal.orig
436 $ cp .hg/transplant/journal .hg/transplant/journal.orig
436 $ cat .hg/transplant/journal
437 $ cat .hg/transplant/journal
437 # User test
438 # User test
438 # Date 0 0
439 # Date 0 0
439 # Node ID 46ae92138f3ce0249f6789650403286ead052b6d
440 # Node ID 46ae92138f3ce0249f6789650403286ead052b6d
440 # Parent e8643552fde58f57515e19c4b373a57c96e62af3
441 # Parent e8643552fde58f57515e19c4b373a57c96e62af3
441 foo2
442 foo2
442 $ grep -v 'Date' .hg/transplant/journal.orig > .hg/transplant/journal
443 $ grep -v 'Date' .hg/transplant/journal.orig > .hg/transplant/journal
443 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
444 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
444 abort: filter corrupted changeset (no user or date)
445 abort: filter corrupted changeset (no user or date)
445 [255]
446 [255]
446 $ cp .hg/transplant/journal.orig .hg/transplant/journal
447 $ cp .hg/transplant/journal.orig .hg/transplant/journal
447 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
448 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
448 HGEDITFORM=transplant.normal
449 HGEDITFORM=transplant.normal
449 46ae92138f3c transplanted as 9159dada197d
450 46ae92138f3c transplanted as 9159dada197d
450 $ hg transplant 1:3
451 $ hg transplant 1:3
451 skipping already applied revision 1:46ae92138f3c
452 skipping already applied revision 1:46ae92138f3c
452 applying 9d6d6b5a8275
453 applying 9d6d6b5a8275
453 9d6d6b5a8275 transplanted to 2d17a10c922f
454 9d6d6b5a8275 transplanted to 2d17a10c922f
454 applying 1dab759070cf
455 applying 1dab759070cf
455 1dab759070cf transplanted to e06a69927eb0
456 1dab759070cf transplanted to e06a69927eb0
456 $ hg locate
457 $ hg locate
457 added
458 added
458 bar
459 bar
459 baz
460 baz
460 foo
461 foo
461
462
462 test multiple revisions and --continue
463 test multiple revisions and --continue
463
464
464 $ hg up -qC 0
465 $ hg up -qC 0
465 $ echo bazbaz > baz
466 $ echo bazbaz > baz
466 $ hg ci -Am anotherbaz baz
467 $ hg ci -Am anotherbaz baz
467 created new head
468 created new head
468 $ hg transplant 1:3
469 $ hg transplant 1:3
469 applying 46ae92138f3c
470 applying 46ae92138f3c
470 46ae92138f3c transplanted to 1024233ea0ba
471 46ae92138f3c transplanted to 1024233ea0ba
471 applying 9d6d6b5a8275
472 applying 9d6d6b5a8275
472 patching file baz
473 patching file baz
473 Hunk #1 FAILED at 0
474 Hunk #1 FAILED at 0
474 1 out of 1 hunks FAILED -- saving rejects to file baz.rej
475 1 out of 1 hunks FAILED -- saving rejects to file baz.rej
475 patch failed to apply
476 patch failed to apply
476 abort: fix up the working directory and run hg transplant --continue
477 abort: fix up the working directory and run hg transplant --continue
477 [255]
478 [255]
478 $ hg transplant 1:3
479 $ hg transplant 1:3
479 abort: transplant in progress
480 abort: transplant in progress
480 (use 'hg transplant --continue' or 'hg update' to abort)
481 (use 'hg transplant --continue' or 'hg update' to abort)
481 [255]
482 [255]
482 $ echo fixed > baz
483 $ echo fixed > baz
483 $ hg transplant --continue
484 $ hg transplant --continue
484 9d6d6b5a8275 transplanted as d80c49962290
485 9d6d6b5a8275 transplanted as d80c49962290
485 applying 1dab759070cf
486 applying 1dab759070cf
486 1dab759070cf transplanted to aa0ffe6bd5ae
487 1dab759070cf transplanted to aa0ffe6bd5ae
487
488
488 $ cd ..
489 $ cd ..
489
490
490 Issue1111: Test transplant --merge
491 Issue1111: Test transplant --merge
491
492
492 $ hg init t1111
493 $ hg init t1111
493 $ cd t1111
494 $ cd t1111
494 $ echo a > a
495 $ echo a > a
495 $ hg ci -Am adda
496 $ hg ci -Am adda
496 adding a
497 adding a
497 $ echo b >> a
498 $ echo b >> a
498 $ hg ci -m appendb
499 $ hg ci -m appendb
499 $ echo c >> a
500 $ echo c >> a
500 $ hg ci -m appendc
501 $ hg ci -m appendc
501 $ hg up -C 0
502 $ hg up -C 0
502 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 $ echo d >> a
504 $ echo d >> a
504 $ hg ci -m appendd
505 $ hg ci -m appendd
505 created new head
506 created new head
506
507
507 transplant
508 transplant
508
509
509 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e
510 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e
510 applying 42dc4432fd35
511 applying 42dc4432fd35
511 HGEDITFORM=transplant.merge
512 HGEDITFORM=transplant.merge
512 1:42dc4432fd35 merged at a9f4acbac129
513 1:42dc4432fd35 merged at a9f4acbac129
513 $ hg update -q -C 2
514 $ hg update -q -C 2
514 $ cat > a <<EOF
515 $ cat > a <<EOF
515 > x
516 > x
516 > y
517 > y
517 > z
518 > z
518 > EOF
519 > EOF
519 $ hg commit -m replace
520 $ hg commit -m replace
520 $ hg update -q -C 4
521 $ hg update -q -C 4
521 $ hg transplant -m 5
522 $ hg transplant -m 5
522 applying 600a3cdcb41d
523 applying 600a3cdcb41d
523 patching file a
524 patching file a
524 Hunk #1 FAILED at 0
525 Hunk #1 FAILED at 0
525 1 out of 1 hunks FAILED -- saving rejects to file a.rej
526 1 out of 1 hunks FAILED -- saving rejects to file a.rej
526 patch failed to apply
527 patch failed to apply
527 abort: fix up the working directory and run hg transplant --continue
528 abort: fix up the working directory and run hg transplant --continue
528 [255]
529 [255]
529 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
530 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
530 HGEDITFORM=transplant.merge
531 HGEDITFORM=transplant.merge
531 600a3cdcb41d transplanted as a3f88be652e0
532 600a3cdcb41d transplanted as a3f88be652e0
532
533
533 $ cd ..
534 $ cd ..
534
535
535 test transplant into empty repository
536 test transplant into empty repository
536
537
537 $ hg init empty
538 $ hg init empty
538 $ cd empty
539 $ cd empty
539 $ hg transplant -s ../t -b tip -a
540 $ hg transplant -s ../t -b tip -a
540 adding changesets
541 adding changesets
541 adding manifests
542 adding manifests
542 adding file changes
543 adding file changes
543 added 4 changesets with 4 changes to 4 files
544 added 4 changesets with 4 changes to 4 files
544
545
545 test "--merge" causing pull from source repository on local host
546 test "--merge" causing pull from source repository on local host
546
547
547 $ hg --config extensions.mq= -q strip 2
548 $ hg --config extensions.mq= -q strip 2
548 $ hg transplant -s ../t --merge tip
549 $ hg transplant -s ../t --merge tip
549 searching for changes
550 searching for changes
550 searching for changes
551 searching for changes
551 adding changesets
552 adding changesets
552 adding manifests
553 adding manifests
553 adding file changes
554 adding file changes
554 added 2 changesets with 2 changes to 2 files
555 added 2 changesets with 2 changes to 2 files
555 applying a53251cdf717
556 applying a53251cdf717
556 4:a53251cdf717 merged at 4831f4dc831a
557 4:a53251cdf717 merged at 4831f4dc831a
557
558
558 test interactive transplant
559 test interactive transplant
559
560
560 $ hg --config extensions.strip= -q strip 0
561 $ hg --config extensions.strip= -q strip 0
561 $ hg -R ../t log -G --template "{rev}:{node|short}"
562 $ hg -R ../t log -G --template "{rev}:{node|short}"
562 @ 4:a53251cdf717
563 @ 4:a53251cdf717
563 |
564 |
564 o 3:722f4667af76
565 o 3:722f4667af76
565 |
566 |
566 o 2:37a1297eb21b
567 o 2:37a1297eb21b
567 |
568 |
568 | o 1:d11e3596cc1a
569 | o 1:d11e3596cc1a
569 |/
570 |/
570 o 0:17ab29e464c6
571 o 0:17ab29e464c6
571
572
572 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
573 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
573 > ?
574 > ?
574 > x
575 > x
575 > q
576 > q
576 > EOF
577 > EOF
577 0:17ab29e464c6
578 0:17ab29e464c6
578 apply changeset? [ynmpcq?]: ?
579 apply changeset? [ynmpcq?]: ?
579 y: yes, transplant this changeset
580 y: yes, transplant this changeset
580 n: no, skip this changeset
581 n: no, skip this changeset
581 m: merge at this changeset
582 m: merge at this changeset
582 p: show patch
583 p: show patch
583 c: commit selected changesets
584 c: commit selected changesets
584 q: quit and cancel transplant
585 q: quit and cancel transplant
585 ?: ? (show this help)
586 ?: ? (show this help)
586 apply changeset? [ynmpcq?]: x
587 apply changeset? [ynmpcq?]: x
587 unrecognized response
588 unrecognized response
588 apply changeset? [ynmpcq?]: q
589 apply changeset? [ynmpcq?]: q
589 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
590 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
590 > p
591 > p
591 > y
592 > y
592 > n
593 > n
593 > n
594 > n
594 > m
595 > m
595 > c
596 > c
596 > EOF
597 > EOF
597 0:17ab29e464c6
598 0:17ab29e464c6
598 apply changeset? [ynmpcq?]: p
599 apply changeset? [ynmpcq?]: p
599 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
600 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
600 +++ b/r1 Thu Jan 01 00:00:00 1970 +0000
601 +++ b/r1 Thu Jan 01 00:00:00 1970 +0000
601 @@ -0,0 +1,1 @@
602 @@ -0,0 +1,1 @@
602 +r1
603 +r1
603 apply changeset? [ynmpcq?]: y
604 apply changeset? [ynmpcq?]: y
604 1:d11e3596cc1a
605 1:d11e3596cc1a
605 apply changeset? [ynmpcq?]: n
606 apply changeset? [ynmpcq?]: n
606 2:37a1297eb21b
607 2:37a1297eb21b
607 apply changeset? [ynmpcq?]: n
608 apply changeset? [ynmpcq?]: n
608 3:722f4667af76
609 3:722f4667af76
609 apply changeset? [ynmpcq?]: m
610 apply changeset? [ynmpcq?]: m
610 4:a53251cdf717
611 4:a53251cdf717
611 apply changeset? [ynmpcq?]: c
612 apply changeset? [ynmpcq?]: c
612 $ hg log -G --template "{node|short}"
613 $ hg log -G --template "{node|short}"
613 @ 88be5dde5260
614 @ 88be5dde5260
614 |\
615 |\
615 | o 722f4667af76
616 | o 722f4667af76
616 | |
617 | |
617 | o 37a1297eb21b
618 | o 37a1297eb21b
618 |/
619 |/
619 o 17ab29e464c6
620 o 17ab29e464c6
620
621
621 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
622 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
622 > x
623 > x
623 > ?
624 > ?
624 > y
625 > y
625 > q
626 > q
626 > EOF
627 > EOF
627 1:d11e3596cc1a
628 1:d11e3596cc1a
628 apply changeset? [ynmpcq?]: x
629 apply changeset? [ynmpcq?]: x
629 unrecognized response
630 unrecognized response
630 apply changeset? [ynmpcq?]: ?
631 apply changeset? [ynmpcq?]: ?
631 y: yes, transplant this changeset
632 y: yes, transplant this changeset
632 n: no, skip this changeset
633 n: no, skip this changeset
633 m: merge at this changeset
634 m: merge at this changeset
634 p: show patch
635 p: show patch
635 c: commit selected changesets
636 c: commit selected changesets
636 q: quit and cancel transplant
637 q: quit and cancel transplant
637 ?: ? (show this help)
638 ?: ? (show this help)
638 apply changeset? [ynmpcq?]: y
639 apply changeset? [ynmpcq?]: y
639 4:a53251cdf717
640 4:a53251cdf717
640 apply changeset? [ynmpcq?]: q
641 apply changeset? [ynmpcq?]: q
641 $ hg heads --template "{node|short}\n"
642 $ hg heads --template "{node|short}\n"
642 88be5dde5260
643 88be5dde5260
643
644
644 $ cd ..
645 $ cd ..
645
646
646
647
647 #if unix-permissions system-sh
648 #if unix-permissions system-sh
648
649
649 test filter
650 test filter
650
651
651 $ hg init filter
652 $ hg init filter
652 $ cd filter
653 $ cd filter
653 $ cat <<'EOF' >test-filter
654 $ cat <<'EOF' >test-filter
654 > #!/bin/sh
655 > #!/bin/sh
655 > sed 's/r1/r2/' $1 > $1.new
656 > sed 's/r1/r2/' $1 > $1.new
656 > mv $1.new $1
657 > mv $1.new $1
657 > EOF
658 > EOF
658 $ chmod +x test-filter
659 $ chmod +x test-filter
659 $ hg transplant -s ../t -b tip -a --filter ./test-filter
660 $ hg transplant -s ../t -b tip -a --filter ./test-filter
660 filtering * (glob)
661 filtering * (glob)
661 applying 17ab29e464c6
662 applying 17ab29e464c6
662 17ab29e464c6 transplanted to e9ffc54ea104
663 17ab29e464c6 transplanted to e9ffc54ea104
663 filtering * (glob)
664 filtering * (glob)
664 applying 37a1297eb21b
665 applying 37a1297eb21b
665 37a1297eb21b transplanted to 348b36d0b6a5
666 37a1297eb21b transplanted to 348b36d0b6a5
666 filtering * (glob)
667 filtering * (glob)
667 applying 722f4667af76
668 applying 722f4667af76
668 722f4667af76 transplanted to 0aa6979afb95
669 722f4667af76 transplanted to 0aa6979afb95
669 filtering * (glob)
670 filtering * (glob)
670 applying a53251cdf717
671 applying a53251cdf717
671 a53251cdf717 transplanted to 14f8512272b5
672 a53251cdf717 transplanted to 14f8512272b5
672 $ hg log --template '{rev} {parents} {desc}\n'
673 $ hg log --template '{rev} {parents} {desc}\n'
673 3 b3
674 3 b3
674 2 b2
675 2 b2
675 1 b1
676 1 b1
676 0 r2
677 0 r2
677 $ cd ..
678 $ cd ..
678
679
679
680
680 test filter with failed patch
681 test filter with failed patch
681
682
682 $ cd filter
683 $ cd filter
683 $ hg up 0
684 $ hg up 0
684 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
685 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
685 $ echo foo > b1
686 $ echo foo > b1
686 $ hg ci -Am foo
687 $ hg ci -Am foo
687 adding b1
688 adding b1
688 adding test-filter
689 adding test-filter
689 created new head
690 created new head
690 $ hg transplant 1 --filter ./test-filter
691 $ hg transplant 1 --filter ./test-filter
691 filtering * (glob)
692 filtering * (glob)
692 applying 348b36d0b6a5
693 applying 348b36d0b6a5
693 file b1 already exists
694 file b1 already exists
694 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
695 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
695 patch failed to apply
696 patch failed to apply
696 abort: fix up the working directory and run hg transplant --continue
697 abort: fix up the working directory and run hg transplant --continue
697 [255]
698 [255]
698 $ cd ..
699 $ cd ..
699
700
700 test environment passed to filter
701 test environment passed to filter
701
702
702 $ hg init filter-environment
703 $ hg init filter-environment
703 $ cd filter-environment
704 $ cd filter-environment
704 $ cat <<'EOF' >test-filter-environment
705 $ cat <<'EOF' >test-filter-environment
705 > #!/bin/sh
706 > #!/bin/sh
706 > echo "Transplant by $HGUSER" >> $1
707 > echo "Transplant by $HGUSER" >> $1
707 > echo "Transplant from rev $HGREVISION" >> $1
708 > echo "Transplant from rev $HGREVISION" >> $1
708 > EOF
709 > EOF
709 $ chmod +x test-filter-environment
710 $ chmod +x test-filter-environment
710 $ hg transplant -s ../t --filter ./test-filter-environment 0
711 $ hg transplant -s ../t --filter ./test-filter-environment 0
711 filtering * (glob)
712 filtering * (glob)
712 applying 17ab29e464c6
713 applying 17ab29e464c6
713 17ab29e464c6 transplanted to 5190e68026a0
714 17ab29e464c6 transplanted to 5190e68026a0
714
715
715 $ hg log --template '{rev} {parents} {desc}\n'
716 $ hg log --template '{rev} {parents} {desc}\n'
716 0 r1
717 0 r1
717 Transplant by test
718 Transplant by test
718 Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f
719 Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f
719 $ cd ..
720 $ cd ..
720
721
721 test transplant with filter handles invalid changelog
722 test transplant with filter handles invalid changelog
722
723
723 $ hg init filter-invalid-log
724 $ hg init filter-invalid-log
724 $ cd filter-invalid-log
725 $ cd filter-invalid-log
725 $ cat <<'EOF' >test-filter-invalid-log
726 $ cat <<'EOF' >test-filter-invalid-log
726 > #!/bin/sh
727 > #!/bin/sh
727 > echo "" > $1
728 > echo "" > $1
728 > EOF
729 > EOF
729 $ chmod +x test-filter-invalid-log
730 $ chmod +x test-filter-invalid-log
730 $ hg transplant -s ../t --filter ./test-filter-invalid-log 0
731 $ hg transplant -s ../t --filter ./test-filter-invalid-log 0
731 filtering * (glob)
732 filtering * (glob)
732 abort: filter corrupted changeset (no user or date)
733 abort: filter corrupted changeset (no user or date)
733 [255]
734 [255]
734 $ cd ..
735 $ cd ..
735
736
736 #endif
737 #endif
737
738
738
739
739 test with a win32ext like setup (differing EOLs)
740 test with a win32ext like setup (differing EOLs)
740
741
741 $ hg init twin1
742 $ hg init twin1
742 $ cd twin1
743 $ cd twin1
743 $ echo a > a
744 $ echo a > a
744 $ echo b > b
745 $ echo b > b
745 $ echo b >> b
746 $ echo b >> b
746 $ hg ci -Am t
747 $ hg ci -Am t
747 adding a
748 adding a
748 adding b
749 adding b
749 $ echo a > b
750 $ echo a > b
750 $ echo b >> b
751 $ echo b >> b
751 $ hg ci -m changeb
752 $ hg ci -m changeb
752 $ cd ..
753 $ cd ..
753
754
754 $ hg init twin2
755 $ hg init twin2
755 $ cd twin2
756 $ cd twin2
756 $ echo '[patch]' >> .hg/hgrc
757 $ echo '[patch]' >> .hg/hgrc
757 $ echo 'eol = crlf' >> .hg/hgrc
758 $ echo 'eol = crlf' >> .hg/hgrc
758 $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')"
759 $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')"
759 $ hg ci -Am addb
760 $ hg ci -Am addb
760 adding b
761 adding b
761 $ hg transplant -s ../twin1 tip
762 $ hg transplant -s ../twin1 tip
762 searching for changes
763 searching for changes
763 warning: repository is unrelated
764 warning: repository is unrelated
764 applying 2e849d776c17
765 applying 2e849d776c17
765 2e849d776c17 transplanted to 8e65bebc063e
766 2e849d776c17 transplanted to 8e65bebc063e
766 $ cat b
767 $ cat b
767 a\r (esc)
768 a\r (esc)
768 b\r (esc)
769 b\r (esc)
769 $ cd ..
770 $ cd ..
770
771
771 test transplant with merge changeset is skipped
772 test transplant with merge changeset is skipped
772
773
773 $ hg init merge1a
774 $ hg init merge1a
774 $ cd merge1a
775 $ cd merge1a
775 $ echo a > a
776 $ echo a > a
776 $ hg ci -Am a
777 $ hg ci -Am a
777 adding a
778 adding a
778 $ hg branch b
779 $ hg branch b
779 marked working directory as branch b
780 marked working directory as branch b
780 (branches are permanent and global, did you want a bookmark?)
781 (branches are permanent and global, did you want a bookmark?)
781 $ hg ci -m branchb
782 $ hg ci -m branchb
782 $ echo b > b
783 $ echo b > b
783 $ hg ci -Am b
784 $ hg ci -Am b
784 adding b
785 adding b
785 $ hg update default
786 $ hg update default
786 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
787 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
787 $ hg merge b
788 $ hg merge b
788 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 (branch merge, don't forget to commit)
790 (branch merge, don't forget to commit)
790 $ hg ci -m mergeb
791 $ hg ci -m mergeb
791 $ cd ..
792 $ cd ..
792
793
793 $ hg init merge1b
794 $ hg init merge1b
794 $ cd merge1b
795 $ cd merge1b
795 $ hg transplant -s ../merge1a tip
796 $ hg transplant -s ../merge1a tip
796 $ cd ..
797 $ cd ..
797
798
798 test transplant with merge changeset accepts --parent
799 test transplant with merge changeset accepts --parent
799
800
800 $ hg init merge2a
801 $ hg init merge2a
801 $ cd merge2a
802 $ cd merge2a
802 $ echo a > a
803 $ echo a > a
803 $ hg ci -Am a
804 $ hg ci -Am a
804 adding a
805 adding a
805 $ hg branch b
806 $ hg branch b
806 marked working directory as branch b
807 marked working directory as branch b
807 (branches are permanent and global, did you want a bookmark?)
808 (branches are permanent and global, did you want a bookmark?)
808 $ hg ci -m branchb
809 $ hg ci -m branchb
809 $ echo b > b
810 $ echo b > b
810 $ hg ci -Am b
811 $ hg ci -Am b
811 adding b
812 adding b
812 $ hg update default
813 $ hg update default
813 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
814 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
814 $ hg merge b
815 $ hg merge b
815 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
816 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
816 (branch merge, don't forget to commit)
817 (branch merge, don't forget to commit)
817 $ hg ci -m mergeb
818 $ hg ci -m mergeb
818 $ cd ..
819 $ cd ..
819
820
820 $ hg init merge2b
821 $ hg init merge2b
821 $ cd merge2b
822 $ cd merge2b
822 $ hg transplant -s ../merge2a --parent tip tip
823 $ hg transplant -s ../merge2a --parent tip tip
823 abort: be9f9b39483f is not a parent of be9f9b39483f
824 abort: be9f9b39483f is not a parent of be9f9b39483f
824 [255]
825 [255]
825 $ hg transplant -s ../merge2a --parent 0 tip
826 $ hg transplant -s ../merge2a --parent 0 tip
826 applying be9f9b39483f
827 applying be9f9b39483f
827 be9f9b39483f transplanted to 9959e51f94d1
828 be9f9b39483f transplanted to 9959e51f94d1
828 $ cd ..
829 $ cd ..
829
830
830 test transplanting a patch turning into a no-op
831 test transplanting a patch turning into a no-op
831
832
832 $ hg init binarysource
833 $ hg init binarysource
833 $ cd binarysource
834 $ cd binarysource
834 $ echo a > a
835 $ echo a > a
835 $ hg ci -Am adda a
836 $ hg ci -Am adda a
836 >>> file('b', 'wb').write('\0b1')
837 >>> file('b', 'wb').write('\0b1')
837 $ hg ci -Am addb b
838 $ hg ci -Am addb b
838 >>> file('b', 'wb').write('\0b2')
839 >>> file('b', 'wb').write('\0b2')
839 $ hg ci -m changeb b
840 $ hg ci -m changeb b
840 $ cd ..
841 $ cd ..
841
842
842 $ hg clone -r0 binarysource binarydest
843 $ hg clone -r0 binarysource binarydest
843 adding changesets
844 adding changesets
844 adding manifests
845 adding manifests
845 adding file changes
846 adding file changes
846 added 1 changesets with 1 changes to 1 files
847 added 1 changesets with 1 changes to 1 files
847 updating to branch default
848 updating to branch default
848 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 $ cd binarydest
850 $ cd binarydest
850 $ cp ../binarysource/b b
851 $ cp ../binarysource/b b
851 $ hg ci -Am addb2 b
852 $ hg ci -Am addb2 b
852 $ hg transplant -s ../binarysource 2
853 $ hg transplant -s ../binarysource 2
853 searching for changes
854 searching for changes
854 applying 7a7d57e15850
855 applying 7a7d57e15850
855 skipping emptied changeset 7a7d57e15850
856 skipping emptied changeset 7a7d57e15850
856
857
857 Test empty result in --continue
858 Test empty result in --continue
858
859
859 $ hg transplant -s ../binarysource 1
860 $ hg transplant -s ../binarysource 1
860 searching for changes
861 searching for changes
861 applying 645035761929
862 applying 645035761929
862 file b already exists
863 file b already exists
863 1 out of 1 hunks FAILED -- saving rejects to file b.rej
864 1 out of 1 hunks FAILED -- saving rejects to file b.rej
864 patch failed to apply
865 patch failed to apply
865 abort: fix up the working directory and run hg transplant --continue
866 abort: fix up the working directory and run hg transplant --continue
866 [255]
867 [255]
867 $ hg status
868 $ hg status
868 ? b.rej
869 ? b.rej
869 $ hg transplant --continue
870 $ hg transplant --continue
870 645035761929 skipped due to empty diff
871 645035761929 skipped due to empty diff
871
872
872 $ cd ..
873 $ cd ..
873
874
874 Explicitly kill daemons to let the test exit on Windows
875 Explicitly kill daemons to let the test exit on Windows
875
876
876 $ killdaemons.py
877 $ killdaemons.py
877
878
878 Test that patch-ed files are treated as "modified", when transplant is
879 Test that patch-ed files are treated as "modified", when transplant is
879 aborted by failure of patching, even if none of mode, size and
880 aborted by failure of patching, even if none of mode, size and
880 timestamp of them isn't changed on the filesystem (see also issue4583)
881 timestamp of them isn't changed on the filesystem (see also issue4583)
881
882
882 $ cd t
883 $ cd t
883
884
884 $ cat > $TESTTMP/abort.py <<EOF
885 $ cat > $TESTTMP/abort.py <<EOF
885 > # emulate that patch.patch() is aborted at patching on "abort" file
886 > # emulate that patch.patch() is aborted at patching on "abort" file
886 > from mercurial import extensions, patch as patchmod
887 > from mercurial import extensions, patch as patchmod
887 > def patch(orig, ui, repo, patchname,
888 > def patch(orig, ui, repo, patchname,
888 > strip=1, prefix='', files=None,
889 > strip=1, prefix='', files=None,
889 > eolmode='strict', similarity=0):
890 > eolmode='strict', similarity=0):
890 > if files is None:
891 > if files is None:
891 > files = set()
892 > files = set()
892 > r = orig(ui, repo, patchname,
893 > r = orig(ui, repo, patchname,
893 > strip=strip, prefix=prefix, files=files,
894 > strip=strip, prefix=prefix, files=files,
894 > eolmode=eolmode, similarity=similarity)
895 > eolmode=eolmode, similarity=similarity)
895 > if 'abort' in files:
896 > if 'abort' in files:
896 > raise patchmod.PatchError('intentional error while patching')
897 > raise patchmod.PatchError('intentional error while patching')
897 > return r
898 > return r
898 > def extsetup(ui):
899 > def extsetup(ui):
899 > extensions.wrapfunction(patchmod, 'patch', patch)
900 > extensions.wrapfunction(patchmod, 'patch', patch)
900 > EOF
901 > EOF
901
902
902 $ echo X1 > r1
903 $ echo X1 > r1
903 $ hg diff --nodates r1
904 $ hg diff --nodates r1
904 diff -r a53251cdf717 r1
905 diff -r a53251cdf717 r1
905 --- a/r1
906 --- a/r1
906 +++ b/r1
907 +++ b/r1
907 @@ -1,1 +1,1 @@
908 @@ -1,1 +1,1 @@
908 -r1
909 -r1
909 +X1
910 +X1
910 $ hg commit -m "X1 as r1"
911 $ hg commit -m "X1 as r1"
911
912
912 $ echo 'marking to abort patching' > abort
913 $ echo 'marking to abort patching' > abort
913 $ hg add abort
914 $ hg add abort
914 $ echo Y1 > r1
915 $ echo Y1 > r1
915 $ hg diff --nodates r1
916 $ hg diff --nodates r1
916 diff -r 22c515968f13 r1
917 diff -r 22c515968f13 r1
917 --- a/r1
918 --- a/r1
918 +++ b/r1
919 +++ b/r1
919 @@ -1,1 +1,1 @@
920 @@ -1,1 +1,1 @@
920 -X1
921 -X1
921 +Y1
922 +Y1
922 $ hg commit -m "Y1 as r1"
923 $ hg commit -m "Y1 as r1"
923
924
924 $ hg update -q -C d11e3596cc1a
925 $ hg update -q -C d11e3596cc1a
925 $ cat r1
926 $ cat r1
926 r1
927 r1
927
928
928 $ cat >> .hg/hgrc <<EOF
929 $ cat >> .hg/hgrc <<EOF
929 > [fakedirstatewritetime]
930 > [fakedirstatewritetime]
930 > # emulate invoking dirstate.write() via repo.status() or markcommitted()
931 > # emulate invoking dirstate.write() via repo.status() or markcommitted()
931 > # at 2000-01-01 00:00
932 > # at 2000-01-01 00:00
932 > fakenow = 200001010000
933 > fakenow = 200001010000
933 >
934 >
934 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
935 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
935 > [fakepatchtime]
936 > [fakepatchtime]
936 > fakenow = 200001010000
937 > fakenow = 200001010000
937 >
938 >
938 > [extensions]
939 > [extensions]
939 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
940 > fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
940 > fakepatchtime = $TESTDIR/fakepatchtime.py
941 > fakepatchtime = $TESTDIR/fakepatchtime.py
941 > abort = $TESTTMP/abort.py
942 > abort = $TESTTMP/abort.py
942 > EOF
943 > EOF
943 $ hg transplant "22c515968f13::"
944 $ hg transplant "22c515968f13::"
944 applying 22c515968f13
945 applying 22c515968f13
945 22c515968f13 transplanted to * (glob)
946 22c515968f13 transplanted to * (glob)
946 applying e38700ba9dd3
947 applying e38700ba9dd3
947 intentional error while patching
948 intentional error while patching
948 abort: fix up the working directory and run hg transplant --continue
949 abort: fix up the working directory and run hg transplant --continue
949 [255]
950 [255]
950 $ cat >> .hg/hgrc <<EOF
951 $ cat >> .hg/hgrc <<EOF
951 > [hooks]
952 > [hooks]
952 > fakedirstatewritetime = !
953 > fakedirstatewritetime = !
953 > fakepatchtime = !
954 > fakepatchtime = !
954 > [extensions]
955 > [extensions]
955 > abort = !
956 > abort = !
956 > EOF
957 > EOF
957
958
958 $ cat r1
959 $ cat r1
959 Y1
960 Y1
960 $ hg debugstate | grep ' r1$'
961 $ hg debugstate | grep ' r1$'
961 n 644 3 unset r1
962 n 644 3 unset r1
962 $ hg status -A r1
963 $ hg status -A r1
963 M r1
964 M r1
964
965
965 Test that rollback by unexpected failure after transplanting the first
966 Test that rollback by unexpected failure after transplanting the first
966 revision restores dirstate correctly.
967 revision restores dirstate correctly.
967
968
968 $ hg rollback -q
969 $ hg rollback -q
969 $ rm -f abort
970 $ rm -f abort
970 $ hg update -q -C d11e3596cc1a
971 $ hg update -q -C d11e3596cc1a
971 $ hg parents -T "{node|short}\n"
972 $ hg parents -T "{node|short}\n"
972 d11e3596cc1a
973 d11e3596cc1a
973 $ hg status -A
974 $ hg status -A
974 C r1
975 C r1
975 C r2
976 C r2
976
977
977 $ cat >> .hg/hgrc <<EOF
978 $ cat >> .hg/hgrc <<EOF
978 > [hooks]
979 > [hooks]
979 > # emulate failure at transplanting the 2nd revision
980 > # emulate failure at transplanting the 2nd revision
980 > pretxncommit.abort = test ! -f abort
981 > pretxncommit.abort = test ! -f abort
981 > EOF
982 > EOF
982 $ hg transplant "22c515968f13::"
983 $ hg transplant "22c515968f13::"
983 applying 22c515968f13
984 applying 22c515968f13
984 22c515968f13 transplanted to * (glob)
985 22c515968f13 transplanted to * (glob)
985 applying e38700ba9dd3
986 applying e38700ba9dd3
986 transaction abort!
987 transaction abort!
987 rollback completed
988 rollback completed
988 abort: pretxncommit.abort hook exited with status 1
989 abort: pretxncommit.abort hook exited with status 1
989 [255]
990 [255]
990 $ cat >> .hg/hgrc <<EOF
991 $ cat >> .hg/hgrc <<EOF
991 > [hooks]
992 > [hooks]
992 > pretxncommit.abort = !
993 > pretxncommit.abort = !
993 > EOF
994 > EOF
994
995
995 $ hg parents -T "{node|short}\n"
996 $ hg parents -T "{node|short}\n"
996 d11e3596cc1a
997 d11e3596cc1a
997 $ hg status -A
998 $ hg status -A
998 M r1
999 M r1
999 ? abort
1000 ? abort
1000 C r2
1001 C r2
1001
1002
1002 $ cd ..
1003 $ cd ..
@@ -1,252 +1,253
1 $ HGMERGE=true; export HGMERGE
1 $ HGMERGE=true; export HGMERGE
2
2
3 $ hg init r1
3 $ hg init r1
4 $ cd r1
4 $ cd r1
5 $ echo a > a
5 $ echo a > a
6 $ hg addremove
6 $ hg addremove
7 adding a
7 adding a
8 $ hg commit -m "1"
8 $ hg commit -m "1"
9
9
10 $ hg clone . ../r2
10 $ hg clone . ../r2
11 updating to branch default
11 updating to branch default
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 $ cd ../r2
13 $ cd ../r2
14 $ hg up
14 $ hg up
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo abc > a
16 $ echo abc > a
17 $ hg diff --nodates
17 $ hg diff --nodates
18 diff -r c19d34741b0a a
18 diff -r c19d34741b0a a
19 --- a/a
19 --- a/a
20 +++ b/a
20 +++ b/a
21 @@ -1,1 +1,1 @@
21 @@ -1,1 +1,1 @@
22 -a
22 -a
23 +abc
23 +abc
24
24
25 $ cd ../r1
25 $ cd ../r1
26 $ echo b > b
26 $ echo b > b
27 $ echo a2 > a
27 $ echo a2 > a
28 $ hg addremove
28 $ hg addremove
29 adding b
29 adding b
30 $ hg commit -m "2"
30 $ hg commit -m "2"
31
31
32 $ cd ../r2
32 $ cd ../r2
33 $ hg -q pull ../r1
33 $ hg -q pull ../r1
34 $ hg status
34 $ hg status
35 M a
35 M a
36 $ hg parents
36 $ hg parents
37 changeset: 0:c19d34741b0a
37 changeset: 0:c19d34741b0a
38 user: test
38 user: test
39 date: Thu Jan 01 00:00:00 1970 +0000
39 date: Thu Jan 01 00:00:00 1970 +0000
40 summary: 1
40 summary: 1
41
41
42 $ hg --debug up
42 $ hg --debug up
43 searching for copies back to rev 1
43 searching for copies back to rev 1
44 unmatched files in other:
44 unmatched files in other:
45 b
45 b
46 resolving manifests
46 resolving manifests
47 branchmerge: False, force: False, partial: False
47 branchmerge: False, force: False, partial: False
48 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
48 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
49 preserving a for resolve of a
49 preserving a for resolve of a
50 b: remote created -> g
50 b: remote created -> g
51 getting b
51 getting b
52 a: versions differ -> m (premerge)
52 a: versions differ -> m (premerge)
53 picked tool 'true' for a (binary False symlink False changedelete False)
53 picked tool 'true' for a (binary False symlink False changedelete False)
54 merging a
54 merging a
55 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
55 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
56 a: versions differ -> m (merge)
56 a: versions differ -> m (merge)
57 picked tool 'true' for a (binary False symlink False changedelete False)
57 picked tool 'true' for a (binary False symlink False changedelete False)
58 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
58 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
59 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
59 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
60 merge tool returned: 0
60 merge tool returned: 0
61 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
61 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
62 $ hg parents
62 $ hg parents
63 changeset: 1:1e71731e6fbb
63 changeset: 1:1e71731e6fbb
64 tag: tip
64 tag: tip
65 user: test
65 user: test
66 date: Thu Jan 01 00:00:00 1970 +0000
66 date: Thu Jan 01 00:00:00 1970 +0000
67 summary: 2
67 summary: 2
68
68
69 $ hg --debug up 0
69 $ hg --debug up 0
70 starting 4 threads for background file closing (?)
70 starting 4 threads for background file closing (?)
71 searching for copies back to rev 0
71 searching for copies back to rev 0
72 unmatched files in local (from topological common ancestor):
72 unmatched files in local (from topological common ancestor):
73 b
73 b
74 resolving manifests
74 resolving manifests
75 branchmerge: False, force: False, partial: False
75 branchmerge: False, force: False, partial: False
76 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
76 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
77 preserving a for resolve of a
77 preserving a for resolve of a
78 b: other deleted -> r
78 b: other deleted -> r
79 removing b
79 removing b
80 starting 4 threads for background file closing (?)
80 starting 4 threads for background file closing (?)
81 a: versions differ -> m (premerge)
81 a: versions differ -> m (premerge)
82 picked tool 'true' for a (binary False symlink False changedelete False)
82 picked tool 'true' for a (binary False symlink False changedelete False)
83 merging a
83 merging a
84 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
84 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
85 a: versions differ -> m (merge)
85 a: versions differ -> m (merge)
86 picked tool 'true' for a (binary False symlink False changedelete False)
86 picked tool 'true' for a (binary False symlink False changedelete False)
87 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
87 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
88 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
88 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
89 merge tool returned: 0
89 merge tool returned: 0
90 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
90 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
91 $ hg parents
91 $ hg parents
92 changeset: 0:c19d34741b0a
92 changeset: 0:c19d34741b0a
93 user: test
93 user: test
94 date: Thu Jan 01 00:00:00 1970 +0000
94 date: Thu Jan 01 00:00:00 1970 +0000
95 summary: 1
95 summary: 1
96
96
97 $ hg --debug up
97 $ hg --debug up
98 searching for copies back to rev 1
98 searching for copies back to rev 1
99 unmatched files in other:
99 unmatched files in other:
100 b
100 b
101 resolving manifests
101 resolving manifests
102 branchmerge: False, force: False, partial: False
102 branchmerge: False, force: False, partial: False
103 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
103 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
104 preserving a for resolve of a
104 preserving a for resolve of a
105 b: remote created -> g
105 b: remote created -> g
106 getting b
106 getting b
107 a: versions differ -> m (premerge)
107 a: versions differ -> m (premerge)
108 picked tool 'true' for a (binary False symlink False changedelete False)
108 picked tool 'true' for a (binary False symlink False changedelete False)
109 merging a
109 merging a
110 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
110 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
111 a: versions differ -> m (merge)
111 a: versions differ -> m (merge)
112 picked tool 'true' for a (binary False symlink False changedelete False)
112 picked tool 'true' for a (binary False symlink False changedelete False)
113 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
113 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
114 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
114 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
115 merge tool returned: 0
115 merge tool returned: 0
116 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
116 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
117 $ hg parents
117 $ hg parents
118 changeset: 1:1e71731e6fbb
118 changeset: 1:1e71731e6fbb
119 tag: tip
119 tag: tip
120 user: test
120 user: test
121 date: Thu Jan 01 00:00:00 1970 +0000
121 date: Thu Jan 01 00:00:00 1970 +0000
122 summary: 2
122 summary: 2
123
123
124 $ hg -v history
124 $ hg -v history
125 changeset: 1:1e71731e6fbb
125 changeset: 1:1e71731e6fbb
126 tag: tip
126 tag: tip
127 user: test
127 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
128 date: Thu Jan 01 00:00:00 1970 +0000
129 files: a b
129 files: a b
130 description:
130 description:
131 2
131 2
132
132
133
133
134 changeset: 0:c19d34741b0a
134 changeset: 0:c19d34741b0a
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 files: a
137 files: a
138 description:
138 description:
139 1
139 1
140
140
141
141
142 $ hg diff --nodates
142 $ hg diff --nodates
143 diff -r 1e71731e6fbb a
143 diff -r 1e71731e6fbb a
144 --- a/a
144 --- a/a
145 +++ b/a
145 +++ b/a
146 @@ -1,1 +1,1 @@
146 @@ -1,1 +1,1 @@
147 -a2
147 -a2
148 +abc
148 +abc
149
149
150
150
151 create a second head
151 create a second head
152
152
153 $ cd ../r1
153 $ cd ../r1
154 $ hg up 0
154 $ hg up 0
155 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 $ echo b2 > b
156 $ echo b2 > b
157 $ echo a3 > a
157 $ echo a3 > a
158 $ hg addremove
158 $ hg addremove
159 adding b
159 adding b
160 $ hg commit -m "3"
160 $ hg commit -m "3"
161 created new head
161 created new head
162
162
163 $ cd ../r2
163 $ cd ../r2
164 $ hg -q pull ../r1
164 $ hg -q pull ../r1
165 $ hg status
165 $ hg status
166 M a
166 M a
167 $ hg parents
167 $ hg parents
168 changeset: 1:1e71731e6fbb
168 changeset: 1:1e71731e6fbb
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: 2
171 summary: 2
172
172
173 $ hg --debug up
173 $ hg --debug up
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 updated to "1e71731e6fbb: 2"
175 1 other heads for branch "default"
176 1 other heads for branch "default"
176
177
177 test conflicting untracked files
178 test conflicting untracked files
178
179
179 $ hg up -qC 0
180 $ hg up -qC 0
180 $ echo untracked > b
181 $ echo untracked > b
181 $ hg st
182 $ hg st
182 ? b
183 ? b
183 $ hg up 1
184 $ hg up 1
184 b: untracked file differs
185 b: untracked file differs
185 abort: untracked files in working directory differ from files in requested revision
186 abort: untracked files in working directory differ from files in requested revision
186 [255]
187 [255]
187 $ rm b
188 $ rm b
188
189
189 test conflicting untracked ignored file
190 test conflicting untracked ignored file
190
191
191 $ hg up -qC 0
192 $ hg up -qC 0
192 $ echo ignored > .hgignore
193 $ echo ignored > .hgignore
193 $ hg add .hgignore
194 $ hg add .hgignore
194 $ hg ci -m 'add .hgignore'
195 $ hg ci -m 'add .hgignore'
195 created new head
196 created new head
196 $ echo ignored > ignored
197 $ echo ignored > ignored
197 $ hg add ignored
198 $ hg add ignored
198 $ hg ci -m 'add ignored file'
199 $ hg ci -m 'add ignored file'
199
200
200 $ hg up -q 'desc("add .hgignore")'
201 $ hg up -q 'desc("add .hgignore")'
201 $ echo untracked > ignored
202 $ echo untracked > ignored
202 $ hg st
203 $ hg st
203 $ hg up 'desc("add ignored file")'
204 $ hg up 'desc("add ignored file")'
204 ignored: untracked file differs
205 ignored: untracked file differs
205 abort: untracked files in working directory differ from files in requested revision
206 abort: untracked files in working directory differ from files in requested revision
206 [255]
207 [255]
207
208
208 test a local add
209 test a local add
209
210
210 $ cd ..
211 $ cd ..
211 $ hg init a
212 $ hg init a
212 $ hg init b
213 $ hg init b
213 $ echo a > a/a
214 $ echo a > a/a
214 $ echo a > b/a
215 $ echo a > b/a
215 $ hg --cwd a commit -A -m a
216 $ hg --cwd a commit -A -m a
216 adding a
217 adding a
217 $ cd b
218 $ cd b
218 $ hg add a
219 $ hg add a
219 $ hg pull -u ../a
220 $ hg pull -u ../a
220 pulling from ../a
221 pulling from ../a
221 requesting all changes
222 requesting all changes
222 adding changesets
223 adding changesets
223 adding manifests
224 adding manifests
224 adding file changes
225 adding file changes
225 added 1 changesets with 1 changes to 1 files
226 added 1 changesets with 1 changes to 1 files
226 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 $ hg st
228 $ hg st
228
229
229 test updating backwards through a rename
230 test updating backwards through a rename
230
231
231 $ hg mv a b
232 $ hg mv a b
232 $ hg ci -m b
233 $ hg ci -m b
233 $ echo b > b
234 $ echo b > b
234 $ hg up -q 0
235 $ hg up -q 0
235 $ hg st
236 $ hg st
236 M a
237 M a
237 $ hg diff --nodates
238 $ hg diff --nodates
238 diff -r cb9a9f314b8b a
239 diff -r cb9a9f314b8b a
239 --- a/a
240 --- a/a
240 +++ b/a
241 +++ b/a
241 @@ -1,1 +1,1 @@
242 @@ -1,1 +1,1 @@
242 -a
243 -a
243 +b
244 +b
244
245
245 test for superfluous filemerge of clean files renamed in the past
246 test for superfluous filemerge of clean files renamed in the past
246
247
247 $ hg up -qC tip
248 $ hg up -qC tip
248 $ echo c > c
249 $ echo c > c
249 $ hg add c
250 $ hg add c
250 $ hg up -qt:fail 0
251 $ hg up -qt:fail 0
251
252
252 $ cd ..
253 $ cd ..
@@ -1,565 +1,568
1 # Construct the following history tree:
1 # Construct the following history tree:
2 #
2 #
3 # @ 5:e1bb631146ca b1
3 # @ 5:e1bb631146ca b1
4 # |
4 # |
5 # o 4:a4fdb3b883c4 0:b608b9236435 b1
5 # o 4:a4fdb3b883c4 0:b608b9236435 b1
6 # |
6 # |
7 # | o 3:4b57d2520816 1:44592833ba9f
7 # | o 3:4b57d2520816 1:44592833ba9f
8 # | |
8 # | |
9 # | | o 2:063f31070f65
9 # | | o 2:063f31070f65
10 # | |/
10 # | |/
11 # | o 1:44592833ba9f
11 # | o 1:44592833ba9f
12 # |/
12 # |/
13 # o 0:b608b9236435
13 # o 0:b608b9236435
14
14
15 $ mkdir b1
15 $ mkdir b1
16 $ cd b1
16 $ cd b1
17 $ hg init
17 $ hg init
18 $ echo foo > foo
18 $ echo foo > foo
19 $ echo zero > a
19 $ echo zero > a
20 $ hg init sub
20 $ hg init sub
21 $ echo suba > sub/suba
21 $ echo suba > sub/suba
22 $ hg --cwd sub ci -Am addsuba
22 $ hg --cwd sub ci -Am addsuba
23 adding suba
23 adding suba
24 $ echo 'sub = sub' > .hgsub
24 $ echo 'sub = sub' > .hgsub
25 $ hg ci -qAm0
25 $ hg ci -qAm0
26 $ echo one > a ; hg ci -m1
26 $ echo one > a ; hg ci -m1
27 $ echo two > a ; hg ci -m2
27 $ echo two > a ; hg ci -m2
28 $ hg up -q 1
28 $ hg up -q 1
29 $ echo three > a ; hg ci -qm3
29 $ echo three > a ; hg ci -qm3
30 $ hg up -q 0
30 $ hg up -q 0
31 $ hg branch -q b1
31 $ hg branch -q b1
32 $ echo four > a ; hg ci -qm4
32 $ echo four > a ; hg ci -qm4
33 $ echo five > a ; hg ci -qm5
33 $ echo five > a ; hg ci -qm5
34
34
35 Initial repo state:
35 Initial repo state:
36
36
37 $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n'
37 $ hg log -G --template '{rev}:{node|short} {parents} {branches}\n'
38 @ 5:ff252e8273df b1
38 @ 5:ff252e8273df b1
39 |
39 |
40 o 4:d047485b3896 0:60829823a42a b1
40 o 4:d047485b3896 0:60829823a42a b1
41 |
41 |
42 | o 3:6efa171f091b 1:0786582aa4b1
42 | o 3:6efa171f091b 1:0786582aa4b1
43 | |
43 | |
44 | | o 2:bd10386d478c
44 | | o 2:bd10386d478c
45 | |/
45 | |/
46 | o 1:0786582aa4b1
46 | o 1:0786582aa4b1
47 |/
47 |/
48 o 0:60829823a42a
48 o 0:60829823a42a
49
49
50
50
51 Make sure update doesn't assume b1 is a repository if invoked from outside:
51 Make sure update doesn't assume b1 is a repository if invoked from outside:
52
52
53 $ cd ..
53 $ cd ..
54 $ hg update b1
54 $ hg update b1
55 abort: no repository found in '$TESTTMP' (.hg not found)!
55 abort: no repository found in '$TESTTMP' (.hg not found)!
56 [255]
56 [255]
57 $ cd b1
57 $ cd b1
58
58
59 Test helper functions:
59 Test helper functions:
60
60
61 $ revtest () {
61 $ revtest () {
62 > msg=$1
62 > msg=$1
63 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
63 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
64 > startrev=$3
64 > startrev=$3
65 > targetrev=$4
65 > targetrev=$4
66 > opt=$5
66 > opt=$5
67 > hg up -qC $startrev
67 > hg up -qC $startrev
68 > test $dirtyflag = dirty && echo dirty > foo
68 > test $dirtyflag = dirty && echo dirty > foo
69 > test $dirtyflag = dirtysub && echo dirty > sub/suba
69 > test $dirtyflag = dirtysub && echo dirty > sub/suba
70 > hg up $opt $targetrev
70 > hg up $opt $targetrev
71 > hg parent --template 'parent={rev}\n'
71 > hg parent --template 'parent={rev}\n'
72 > hg stat -S
72 > hg stat -S
73 > }
73 > }
74
74
75 $ norevtest () {
75 $ norevtest () {
76 > msg=$1
76 > msg=$1
77 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
77 > dirtyflag=$2 # 'clean', 'dirty' or 'dirtysub'
78 > startrev=$3
78 > startrev=$3
79 > opt=$4
79 > opt=$4
80 > hg up -qC $startrev
80 > hg up -qC $startrev
81 > test $dirtyflag = dirty && echo dirty > foo
81 > test $dirtyflag = dirty && echo dirty > foo
82 > test $dirtyflag = dirtysub && echo dirty > sub/suba
82 > test $dirtyflag = dirtysub && echo dirty > sub/suba
83 > hg up $opt
83 > hg up $opt
84 > hg parent --template 'parent={rev}\n'
84 > hg parent --template 'parent={rev}\n'
85 > hg stat -S
85 > hg stat -S
86 > }
86 > }
87
87
88 Test cases are documented in a table in the update function of merge.py.
88 Test cases are documented in a table in the update function of merge.py.
89 Cases are run as shown in that table, row by row.
89 Cases are run as shown in that table, row by row.
90
90
91 $ norevtest 'none clean linear' clean 4
91 $ norevtest 'none clean linear' clean 4
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 parent=5
93 parent=5
94
94
95 $ norevtest 'none clean same' clean 2
95 $ norevtest 'none clean same' clean 2
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 updated to "bd10386d478c: 2"
97 1 other heads for branch "default"
98 1 other heads for branch "default"
98 parent=2
99 parent=2
99
100
100
101
101 $ revtest 'none clean linear' clean 1 2
102 $ revtest 'none clean linear' clean 1 2
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 parent=2
104 parent=2
104
105
105 $ revtest 'none clean same' clean 2 3
106 $ revtest 'none clean same' clean 2 3
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 parent=3
108 parent=3
108
109
109 $ revtest 'none clean cross' clean 3 4
110 $ revtest 'none clean cross' clean 3 4
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 parent=4
112 parent=4
112
113
113
114
114 $ revtest 'none dirty linear' dirty 1 2
115 $ revtest 'none dirty linear' dirty 1 2
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 parent=2
117 parent=2
117 M foo
118 M foo
118
119
119 $ revtest 'none dirtysub linear' dirtysub 1 2
120 $ revtest 'none dirtysub linear' dirtysub 1 2
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 parent=2
122 parent=2
122 M sub/suba
123 M sub/suba
123
124
124 $ revtest 'none dirty same' dirty 2 3
125 $ revtest 'none dirty same' dirty 2 3
125 abort: uncommitted changes
126 abort: uncommitted changes
126 (commit or update --clean to discard changes)
127 (commit or update --clean to discard changes)
127 parent=2
128 parent=2
128 M foo
129 M foo
129
130
130 $ revtest 'none dirtysub same' dirtysub 2 3
131 $ revtest 'none dirtysub same' dirtysub 2 3
131 abort: uncommitted changes
132 abort: uncommitted changes
132 (commit or update --clean to discard changes)
133 (commit or update --clean to discard changes)
133 parent=2
134 parent=2
134 M sub/suba
135 M sub/suba
135
136
136 $ revtest 'none dirty cross' dirty 3 4
137 $ revtest 'none dirty cross' dirty 3 4
137 abort: uncommitted changes
138 abort: uncommitted changes
138 (commit or update --clean to discard changes)
139 (commit or update --clean to discard changes)
139 parent=3
140 parent=3
140 M foo
141 M foo
141
142
142 $ norevtest 'none dirty cross' dirty 2
143 $ norevtest 'none dirty cross' dirty 2
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 updated to "bd10386d478c: 2"
144 1 other heads for branch "default"
146 1 other heads for branch "default"
145 parent=2
147 parent=2
146 M foo
148 M foo
147
149
148 $ revtest 'none dirtysub cross' dirtysub 3 4
150 $ revtest 'none dirtysub cross' dirtysub 3 4
149 abort: uncommitted changes
151 abort: uncommitted changes
150 (commit or update --clean to discard changes)
152 (commit or update --clean to discard changes)
151 parent=3
153 parent=3
152 M sub/suba
154 M sub/suba
153
155
154 $ revtest '-C dirty linear' dirty 1 2 -C
156 $ revtest '-C dirty linear' dirty 1 2 -C
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 parent=2
158 parent=2
157
159
158 $ revtest '-c dirty linear' dirty 1 2 -c
160 $ revtest '-c dirty linear' dirty 1 2 -c
159 abort: uncommitted changes
161 abort: uncommitted changes
160 parent=1
162 parent=1
161 M foo
163 M foo
162
164
163 $ revtest '-m dirty linear' dirty 1 2 -m
165 $ revtest '-m dirty linear' dirty 1 2 -m
164 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 parent=2
167 parent=2
166 M foo
168 M foo
167
169
168 $ revtest '-m dirty cross' dirty 3 4 -m
170 $ revtest '-m dirty cross' dirty 3 4 -m
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 parent=4
172 parent=4
171 M foo
173 M foo
172
174
173 $ revtest '-c dirtysub linear' dirtysub 1 2 -c
175 $ revtest '-c dirtysub linear' dirtysub 1 2 -c
174 abort: uncommitted changes in subrepository 'sub'
176 abort: uncommitted changes in subrepository 'sub'
175 parent=1
177 parent=1
176 M sub/suba
178 M sub/suba
177
179
178 $ norevtest '-c clean same' clean 2 -c
180 $ norevtest '-c clean same' clean 2 -c
179 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
182 updated to "bd10386d478c: 2"
180 1 other heads for branch "default"
183 1 other heads for branch "default"
181 parent=2
184 parent=2
182
185
183 $ revtest '-cC dirty linear' dirty 1 2 -cC
186 $ revtest '-cC dirty linear' dirty 1 2 -cC
184 abort: can only specify one of -C/--clean, -c/--check, or -m/merge
187 abort: can only specify one of -C/--clean, -c/--check, or -m/merge
185 parent=1
188 parent=1
186 M foo
189 M foo
187
190
188 $ revtest '-mc dirty linear' dirty 1 2 -mc
191 $ revtest '-mc dirty linear' dirty 1 2 -mc
189 abort: can only specify one of -C/--clean, -c/--check, or -m/merge
192 abort: can only specify one of -C/--clean, -c/--check, or -m/merge
190 parent=1
193 parent=1
191 M foo
194 M foo
192
195
193 $ revtest '-mC dirty linear' dirty 1 2 -mC
196 $ revtest '-mC dirty linear' dirty 1 2 -mC
194 abort: can only specify one of -C/--clean, -c/--check, or -m/merge
197 abort: can only specify one of -C/--clean, -c/--check, or -m/merge
195 parent=1
198 parent=1
196 M foo
199 M foo
197
200
198 $ echo '[experimental]' >> .hg/hgrc
201 $ echo '[experimental]' >> .hg/hgrc
199 $ echo 'updatecheck = abort' >> .hg/hgrc
202 $ echo 'updatecheck = abort' >> .hg/hgrc
200
203
201 $ revtest 'none dirty linear' dirty 1 2
204 $ revtest 'none dirty linear' dirty 1 2
202 abort: uncommitted changes
205 abort: uncommitted changes
203 parent=1
206 parent=1
204 M foo
207 M foo
205
208
206 $ revtest 'none dirty linear' dirty 1 2 -c
209 $ revtest 'none dirty linear' dirty 1 2 -c
207 abort: uncommitted changes
210 abort: uncommitted changes
208 parent=1
211 parent=1
209 M foo
212 M foo
210
213
211 $ revtest 'none dirty linear' dirty 1 2 -C
214 $ revtest 'none dirty linear' dirty 1 2 -C
212 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 parent=2
216 parent=2
214
217
215 $ echo 'updatecheck = none' >> .hg/hgrc
218 $ echo 'updatecheck = none' >> .hg/hgrc
216
219
217 $ revtest 'none dirty cross' dirty 3 4
220 $ revtest 'none dirty cross' dirty 3 4
218 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 parent=4
222 parent=4
220 M foo
223 M foo
221
224
222 $ revtest 'none dirty linear' dirty 1 2
225 $ revtest 'none dirty linear' dirty 1 2
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 parent=2
227 parent=2
225 M foo
228 M foo
226
229
227 $ revtest 'none dirty linear' dirty 1 2 -c
230 $ revtest 'none dirty linear' dirty 1 2 -c
228 abort: uncommitted changes
231 abort: uncommitted changes
229 parent=1
232 parent=1
230 M foo
233 M foo
231
234
232 $ revtest 'none dirty linear' dirty 1 2 -C
235 $ revtest 'none dirty linear' dirty 1 2 -C
233 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 parent=2
237 parent=2
235
238
236 $ hg co -qC 3
239 $ hg co -qC 3
237 $ echo dirty >> a
240 $ echo dirty >> a
238 $ hg co --tool :merge3 4
241 $ hg co --tool :merge3 4
239 merging a
242 merging a
240 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
243 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
241 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
244 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
242 use 'hg resolve' to retry unresolved file merges
245 use 'hg resolve' to retry unresolved file merges
243 [1]
246 [1]
244 $ hg st
247 $ hg st
245 M a
248 M a
246 ? a.orig
249 ? a.orig
247 $ cat a
250 $ cat a
248 <<<<<<< working copy: 6efa171f091b - test: 3
251 <<<<<<< working copy: 6efa171f091b - test: 3
249 three
252 three
250 dirty
253 dirty
251 ||||||| base
254 ||||||| base
252 three
255 three
253 =======
256 =======
254 four
257 four
255 >>>>>>> destination: d047485b3896 b1 - test: 4
258 >>>>>>> destination: d047485b3896 b1 - test: 4
256 $ rm a.orig
259 $ rm a.orig
257
260
258 $ echo 'updatecheck = noconflict' >> .hg/hgrc
261 $ echo 'updatecheck = noconflict' >> .hg/hgrc
259
262
260 $ revtest 'none dirty cross' dirty 3 4
263 $ revtest 'none dirty cross' dirty 3 4
261 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 parent=4
265 parent=4
263 M foo
266 M foo
264
267
265 $ revtest 'none dirty linear' dirty 1 2
268 $ revtest 'none dirty linear' dirty 1 2
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 parent=2
270 parent=2
268 M foo
271 M foo
269
272
270 $ revtest 'none dirty linear' dirty 1 2 -c
273 $ revtest 'none dirty linear' dirty 1 2 -c
271 abort: uncommitted changes
274 abort: uncommitted changes
272 parent=1
275 parent=1
273 M foo
276 M foo
274
277
275 $ revtest 'none dirty linear' dirty 1 2 -C
278 $ revtest 'none dirty linear' dirty 1 2 -C
276 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 parent=2
280 parent=2
278
281
279 Locally added file is allowed
282 Locally added file is allowed
280 $ hg up -qC 3
283 $ hg up -qC 3
281 $ echo a > bar
284 $ echo a > bar
282 $ hg add bar
285 $ hg add bar
283 $ hg up -q 4
286 $ hg up -q 4
284 $ hg st
287 $ hg st
285 A bar
288 A bar
286 $ hg forget bar
289 $ hg forget bar
287 $ rm bar
290 $ rm bar
288
291
289 Locally removed file is allowed
292 Locally removed file is allowed
290 $ hg up -qC 3
293 $ hg up -qC 3
291 $ hg rm foo
294 $ hg rm foo
292 $ hg up -q 4
295 $ hg up -q 4
293
296
294 File conflict is not allowed
297 File conflict is not allowed
295 $ hg up -qC 3
298 $ hg up -qC 3
296 $ echo dirty >> a
299 $ echo dirty >> a
297 $ hg up -q 4
300 $ hg up -q 4
298 abort: conflicting changes
301 abort: conflicting changes
299 (commit or update --clean to discard changes)
302 (commit or update --clean to discard changes)
300 [255]
303 [255]
301 $ hg up -m 4
304 $ hg up -m 4
302 merging a
305 merging a
303 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
306 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
304 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
307 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
305 use 'hg resolve' to retry unresolved file merges
308 use 'hg resolve' to retry unresolved file merges
306 [1]
309 [1]
307 $ rm a.orig
310 $ rm a.orig
308
311
309 Change/delete conflict is not allowed
312 Change/delete conflict is not allowed
310 $ hg up -qC 3
313 $ hg up -qC 3
311 $ hg rm foo
314 $ hg rm foo
312 $ hg up -q 4
315 $ hg up -q 4
313
316
314 Uses default value of "linear" when value is misspelled
317 Uses default value of "linear" when value is misspelled
315 $ echo 'updatecheck = linyar' >> .hg/hgrc
318 $ echo 'updatecheck = linyar' >> .hg/hgrc
316
319
317 $ revtest 'dirty cross' dirty 3 4
320 $ revtest 'dirty cross' dirty 3 4
318 abort: uncommitted changes
321 abort: uncommitted changes
319 (commit or update --clean to discard changes)
322 (commit or update --clean to discard changes)
320 parent=3
323 parent=3
321 M foo
324 M foo
322
325
323 Setup for later tests
326 Setup for later tests
324 $ revtest 'none dirty linear' dirty 1 2 -c
327 $ revtest 'none dirty linear' dirty 1 2 -c
325 abort: uncommitted changes
328 abort: uncommitted changes
326 parent=1
329 parent=1
327 M foo
330 M foo
328
331
329 $ cd ..
332 $ cd ..
330
333
331 Test updating to null revision
334 Test updating to null revision
332
335
333 $ hg init null-repo
336 $ hg init null-repo
334 $ cd null-repo
337 $ cd null-repo
335 $ echo a > a
338 $ echo a > a
336 $ hg add a
339 $ hg add a
337 $ hg ci -m a
340 $ hg ci -m a
338 $ hg up -qC 0
341 $ hg up -qC 0
339 $ echo b > b
342 $ echo b > b
340 $ hg add b
343 $ hg add b
341 $ hg up null
344 $ hg up null
342 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
345 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
343 $ hg st
346 $ hg st
344 A b
347 A b
345 $ hg up -q 0
348 $ hg up -q 0
346 $ hg st
349 $ hg st
347 A b
350 A b
348 $ hg up -qC null
351 $ hg up -qC null
349 $ hg st
352 $ hg st
350 ? b
353 ? b
351 $ cd ..
354 $ cd ..
352
355
353 Test updating with closed head
356 Test updating with closed head
354 ---------------------------------------------------------------------
357 ---------------------------------------------------------------------
355
358
356 $ hg clone -U -q b1 closed-heads
359 $ hg clone -U -q b1 closed-heads
357 $ cd closed-heads
360 $ cd closed-heads
358
361
359 Test updating if at least one non-closed branch head exists
362 Test updating if at least one non-closed branch head exists
360
363
361 if on the closed branch head:
364 if on the closed branch head:
362 - update to "."
365 - update to "."
363 - "updated to a closed branch head ...." message is displayed
366 - "updated to a closed branch head ...." message is displayed
364 - "N other heads for ...." message is displayed
367 - "N other heads for ...." message is displayed
365
368
366 $ hg update -q -C 3
369 $ hg update -q -C 3
367 $ hg commit --close-branch -m 6
370 $ hg commit --close-branch -m 6
368 $ norevtest "on closed branch head" clean 6
371 $ norevtest "on closed branch head" clean 6
369 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
370 no open descendant heads on branch "default", updating to a closed head
373 no open descendant heads on branch "default", updating to a closed head
371 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
374 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
372 parent=6
375 parent=6
373
376
374 if descendant non-closed branch head exists, and it is only one branch head:
377 if descendant non-closed branch head exists, and it is only one branch head:
375 - update to it, even if its revision is less than closed one
378 - update to it, even if its revision is less than closed one
376 - "N other heads for ...." message isn't displayed
379 - "N other heads for ...." message isn't displayed
377
380
378 $ norevtest "non-closed 2 should be chosen" clean 1
381 $ norevtest "non-closed 2 should be chosen" clean 1
379 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 parent=2
383 parent=2
381
384
382 if all descendant branch heads are closed, but there is another branch head:
385 if all descendant branch heads are closed, but there is another branch head:
383 - update to the tipmost descendant head
386 - update to the tipmost descendant head
384 - "updated to a closed branch head ...." message is displayed
387 - "updated to a closed branch head ...." message is displayed
385 - "N other heads for ...." message is displayed
388 - "N other heads for ...." message is displayed
386
389
387 $ norevtest "all descendant branch heads are closed" clean 3
390 $ norevtest "all descendant branch heads are closed" clean 3
388 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
391 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 no open descendant heads on branch "default", updating to a closed head
392 no open descendant heads on branch "default", updating to a closed head
390 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
393 (committing will reopen the head, use 'hg heads .' to see 1 other heads)
391 parent=6
394 parent=6
392
395
393 Test updating if all branch heads are closed
396 Test updating if all branch heads are closed
394
397
395 if on the closed branch head:
398 if on the closed branch head:
396 - update to "."
399 - update to "."
397 - "updated to a closed branch head ...." message is displayed
400 - "updated to a closed branch head ...." message is displayed
398 - "all heads of branch ...." message is displayed
401 - "all heads of branch ...." message is displayed
399
402
400 $ hg update -q -C 2
403 $ hg update -q -C 2
401 $ hg commit --close-branch -m 7
404 $ hg commit --close-branch -m 7
402 $ norevtest "all heads of branch default are closed" clean 6
405 $ norevtest "all heads of branch default are closed" clean 6
403 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
404 no open descendant heads on branch "default", updating to a closed head
407 no open descendant heads on branch "default", updating to a closed head
405 (committing will reopen branch "default")
408 (committing will reopen branch "default")
406 parent=6
409 parent=6
407
410
408 if not on the closed branch head:
411 if not on the closed branch head:
409 - update to the tipmost descendant (closed) head
412 - update to the tipmost descendant (closed) head
410 - "updated to a closed branch head ...." message is displayed
413 - "updated to a closed branch head ...." message is displayed
411 - "all heads of branch ...." message is displayed
414 - "all heads of branch ...." message is displayed
412
415
413 $ norevtest "all heads of branch default are closed" clean 1
416 $ norevtest "all heads of branch default are closed" clean 1
414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
417 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 no open descendant heads on branch "default", updating to a closed head
418 no open descendant heads on branch "default", updating to a closed head
416 (committing will reopen branch "default")
419 (committing will reopen branch "default")
417 parent=7
420 parent=7
418
421
419 $ cd ..
422 $ cd ..
420
423
421 Test updating if "default" branch doesn't exist and no revision is
424 Test updating if "default" branch doesn't exist and no revision is
422 checked out (= "default" is used as current branch)
425 checked out (= "default" is used as current branch)
423
426
424 $ hg init no-default-branch
427 $ hg init no-default-branch
425 $ cd no-default-branch
428 $ cd no-default-branch
426
429
427 $ hg branch foobar
430 $ hg branch foobar
428 marked working directory as branch foobar
431 marked working directory as branch foobar
429 (branches are permanent and global, did you want a bookmark?)
432 (branches are permanent and global, did you want a bookmark?)
430 $ echo a > a
433 $ echo a > a
431 $ hg commit -m "#0" -A
434 $ hg commit -m "#0" -A
432 adding a
435 adding a
433 $ echo 1 >> a
436 $ echo 1 >> a
434 $ hg commit -m "#1"
437 $ hg commit -m "#1"
435 $ hg update -q 0
438 $ hg update -q 0
436 $ echo 3 >> a
439 $ echo 3 >> a
437 $ hg commit -m "#2"
440 $ hg commit -m "#2"
438 created new head
441 created new head
439 $ hg commit --close-branch -m "#3"
442 $ hg commit --close-branch -m "#3"
440
443
441 if there is at least one non-closed branch head:
444 if there is at least one non-closed branch head:
442 - update to the tipmost branch head
445 - update to the tipmost branch head
443
446
444 $ norevtest "non-closed 1 should be chosen" clean null
447 $ norevtest "non-closed 1 should be chosen" clean null
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
448 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
446 parent=1
449 parent=1
447
450
448 if all branch heads are closed
451 if all branch heads are closed
449 - update to "tip"
452 - update to "tip"
450 - "updated to a closed branch head ...." message is displayed
453 - "updated to a closed branch head ...." message is displayed
451 - "all heads for branch "XXXX" are closed" message is displayed
454 - "all heads for branch "XXXX" are closed" message is displayed
452
455
453 $ hg update -q -C 1
456 $ hg update -q -C 1
454 $ hg commit --close-branch -m "#4"
457 $ hg commit --close-branch -m "#4"
455
458
456 $ norevtest "all branches are closed" clean null
459 $ norevtest "all branches are closed" clean null
457 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
458 no open descendant heads on branch "foobar", updating to a closed head
461 no open descendant heads on branch "foobar", updating to a closed head
459 (committing will reopen branch "foobar")
462 (committing will reopen branch "foobar")
460 parent=4
463 parent=4
461
464
462 $ cd ../b1
465 $ cd ../b1
463
466
464 Test obsolescence behavior
467 Test obsolescence behavior
465 ---------------------------------------------------------------------
468 ---------------------------------------------------------------------
466
469
467 successors should be taken in account when checking head destination
470 successors should be taken in account when checking head destination
468
471
469 $ cat << EOF >> $HGRCPATH
472 $ cat << EOF >> $HGRCPATH
470 > [ui]
473 > [ui]
471 > logtemplate={rev}:{node|short} {desc|firstline}
474 > logtemplate={rev}:{node|short} {desc|firstline}
472 > [experimental]
475 > [experimental]
473 > evolution=createmarkers
476 > evolution=createmarkers
474 > EOF
477 > EOF
475
478
476 Test no-argument update to a successor of an obsoleted changeset
479 Test no-argument update to a successor of an obsoleted changeset
477
480
478 $ hg log -G
481 $ hg log -G
479 o 5:ff252e8273df 5
482 o 5:ff252e8273df 5
480 |
483 |
481 o 4:d047485b3896 4
484 o 4:d047485b3896 4
482 |
485 |
483 | o 3:6efa171f091b 3
486 | o 3:6efa171f091b 3
484 | |
487 | |
485 | | o 2:bd10386d478c 2
488 | | o 2:bd10386d478c 2
486 | |/
489 | |/
487 | @ 1:0786582aa4b1 1
490 | @ 1:0786582aa4b1 1
488 |/
491 |/
489 o 0:60829823a42a 0
492 o 0:60829823a42a 0
490
493
491 $ hg book bm -r 3
494 $ hg book bm -r 3
492 $ hg status
495 $ hg status
493 M foo
496 M foo
494
497
495 We add simple obsolescence marker between 3 and 4 (indirect successors)
498 We add simple obsolescence marker between 3 and 4 (indirect successors)
496
499
497 $ hg id --debug -i -r 3
500 $ hg id --debug -i -r 3
498 6efa171f091b00a3c35edc15d48c52a498929953
501 6efa171f091b00a3c35edc15d48c52a498929953
499 $ hg id --debug -i -r 4
502 $ hg id --debug -i -r 4
500 d047485b3896813b2a624e86201983520f003206
503 d047485b3896813b2a624e86201983520f003206
501 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
504 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
502 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
505 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
503
506
504 Test that 5 is detected as a valid destination from 3 and also accepts moving
507 Test that 5 is detected as a valid destination from 3 and also accepts moving
505 the bookmark (issue4015)
508 the bookmark (issue4015)
506
509
507 $ hg up --quiet --hidden 3
510 $ hg up --quiet --hidden 3
508 $ hg up 5
511 $ hg up 5
509 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
510 $ hg book bm
513 $ hg book bm
511 moving bookmark 'bm' forward from 6efa171f091b
514 moving bookmark 'bm' forward from 6efa171f091b
512 $ hg bookmarks
515 $ hg bookmarks
513 * bm 5:ff252e8273df
516 * bm 5:ff252e8273df
514
517
515 Test that 4 is detected as the no-argument destination from 3 and also moves
518 Test that 4 is detected as the no-argument destination from 3 and also moves
516 the bookmark with it
519 the bookmark with it
517 $ hg up --quiet 0 # we should be able to update to 3 directly
520 $ hg up --quiet 0 # we should be able to update to 3 directly
518 $ hg up --quiet --hidden 3 # but not implemented yet.
521 $ hg up --quiet --hidden 3 # but not implemented yet.
519 $ hg book -f bm
522 $ hg book -f bm
520 $ hg up
523 $ hg up
521 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
524 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 updating bookmark bm
525 updating bookmark bm
523 $ hg book
526 $ hg book
524 * bm 4:d047485b3896
527 * bm 4:d047485b3896
525
528
526 Test that 5 is detected as a valid destination from 1
529 Test that 5 is detected as a valid destination from 1
527 $ hg up --quiet 0 # we should be able to update to 3 directly
530 $ hg up --quiet 0 # we should be able to update to 3 directly
528 $ hg up --quiet --hidden 3 # but not implemented yet.
531 $ hg up --quiet --hidden 3 # but not implemented yet.
529 $ hg up 5
532 $ hg up 5
530 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
533 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
531
534
532 Test that 5 is not detected as a valid destination from 2
535 Test that 5 is not detected as a valid destination from 2
533 $ hg up --quiet 0
536 $ hg up --quiet 0
534 $ hg up --quiet 2
537 $ hg up --quiet 2
535 $ hg up 5
538 $ hg up 5
536 abort: uncommitted changes
539 abort: uncommitted changes
537 (commit or update --clean to discard changes)
540 (commit or update --clean to discard changes)
538 [255]
541 [255]
539
542
540 Test that we don't crash when updating from a pruned changeset (i.e. has no
543 Test that we don't crash when updating from a pruned changeset (i.e. has no
541 successors). Behavior should probably be that we update to the first
544 successors). Behavior should probably be that we update to the first
542 non-obsolete parent but that will be decided later.
545 non-obsolete parent but that will be decided later.
543 $ hg id --debug -r 2
546 $ hg id --debug -r 2
544 bd10386d478cd5a9faf2e604114c8e6da62d3889
547 bd10386d478cd5a9faf2e604114c8e6da62d3889
545 $ hg up --quiet 0
548 $ hg up --quiet 0
546 $ hg up --quiet 2
549 $ hg up --quiet 2
547 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
550 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
548 $ hg up
551 $ hg up
549 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
552 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
550
553
551 Test experimental revset support
554 Test experimental revset support
552
555
553 $ hg log -r '_destupdate()'
556 $ hg log -r '_destupdate()'
554 2:bd10386d478c 2 (no-eol)
557 2:bd10386d478c 2 (no-eol)
555
558
556 Test that boolean flags allow --no-flag specification to override [defaults]
559 Test that boolean flags allow --no-flag specification to override [defaults]
557 $ cat >> $HGRCPATH <<EOF
560 $ cat >> $HGRCPATH <<EOF
558 > [defaults]
561 > [defaults]
559 > update = --check
562 > update = --check
560 > EOF
563 > EOF
561 $ hg co 2
564 $ hg co 2
562 abort: uncommitted changes
565 abort: uncommitted changes
563 [255]
566 [255]
564 $ hg co --no-check 2
567 $ hg co --no-check 2
565 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
568 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now