##// END OF EJS Templates
update: change default destination to tipmost descendant (issue4673) (BC)...
Pierre-Yves David -
r28065:6b1fc09c default
parent child Browse files
Show More
@@ -1,251 +1,252 b''
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 )
15 )
16
16
17 def _destupdatevalidate(repo, rev, clean, check):
17 def _destupdatevalidate(repo, rev, clean, check):
18 """validate that the destination comply to various rules
18 """validate that the destination comply to various rules
19
19
20 This exists as its own function to help wrapping from extensions."""
20 This exists as its own function to help wrapping from extensions."""
21 wc = repo[None]
21 wc = repo[None]
22 p1 = wc.p1()
22 p1 = wc.p1()
23 if not clean:
23 if not clean:
24 # Check that the update is linear.
24 # Check that the update is linear.
25 #
25 #
26 # Mercurial do not allow update-merge for non linear pattern
26 # Mercurial do not allow update-merge for non linear pattern
27 # (that would be technically possible but was considered too confusing
27 # (that would be technically possible but was considered too confusing
28 # for user a long time ago)
28 # for user a long time ago)
29 #
29 #
30 # See mercurial.merge.update for details
30 # See mercurial.merge.update for details
31 if p1.rev() not in repo.changelog.ancestors([rev], inclusive=True):
31 if p1.rev() not in repo.changelog.ancestors([rev], inclusive=True):
32 dirty = wc.dirty(missing=True)
32 dirty = wc.dirty(missing=True)
33 foreground = obsolete.foreground(repo, [p1.node()])
33 foreground = obsolete.foreground(repo, [p1.node()])
34 if not repo[rev].node() in foreground:
34 if not repo[rev].node() in foreground:
35 if dirty:
35 if dirty:
36 msg = _("uncommitted changes")
36 msg = _("uncommitted changes")
37 hint = _("commit and merge, or update --clean to"
37 hint = _("commit and merge, or update --clean to"
38 " discard changes")
38 " discard changes")
39 raise error.UpdateAbort(msg, hint=hint)
39 raise error.UpdateAbort(msg, hint=hint)
40 elif not check: # destination is not a descendant.
40 elif not check: # destination is not a descendant.
41 msg = _("not a linear update")
41 msg = _("not a linear update")
42 hint = _("merge or update --check to force update")
42 hint = _("merge or update --check to force update")
43 raise error.UpdateAbort(msg, hint=hint)
43 raise error.UpdateAbort(msg, hint=hint)
44
44
45 def _destupdateobs(repo, clean, check):
45 def _destupdateobs(repo, clean, check):
46 """decide of an update destination from obsolescence markers"""
46 """decide of an update destination from obsolescence markers"""
47 node = None
47 node = None
48 wc = repo[None]
48 wc = repo[None]
49 p1 = wc.p1()
49 p1 = wc.p1()
50 movemark = None
50 movemark = None
51
51
52 if p1.obsolete() and not p1.children():
52 if p1.obsolete() and not p1.children():
53 # allow updating to successors
53 # allow updating to successors
54 successors = obsolete.successorssets(repo, p1.node())
54 successors = obsolete.successorssets(repo, p1.node())
55
55
56 # behavior of certain cases is as follows,
56 # behavior of certain cases is as follows,
57 #
57 #
58 # divergent changesets: update to highest rev, similar to what
58 # divergent changesets: update to highest rev, similar to what
59 # is currently done when there are more than one head
59 # is currently done when there are more than one head
60 # (i.e. 'tip')
60 # (i.e. 'tip')
61 #
61 #
62 # replaced changesets: same as divergent except we know there
62 # replaced changesets: same as divergent except we know there
63 # is no conflict
63 # is no conflict
64 #
64 #
65 # pruned changeset: no update is done; though, we could
65 # pruned changeset: no update is done; though, we could
66 # consider updating to the first non-obsolete parent,
66 # consider updating to the first non-obsolete parent,
67 # similar to what is current done for 'hg prune'
67 # similar to what is current done for 'hg prune'
68
68
69 if successors:
69 if successors:
70 # flatten the list here handles both divergent (len > 1)
70 # flatten the list here handles both divergent (len > 1)
71 # and the usual case (len = 1)
71 # and the usual case (len = 1)
72 successors = [n for sub in successors for n in sub]
72 successors = [n for sub in successors for n in sub]
73
73
74 # get the max revision for the given successors set,
74 # get the max revision for the given successors set,
75 # i.e. the 'tip' of a set
75 # i.e. the 'tip' of a set
76 node = repo.revs('max(%ln)', successors).first()
76 node = repo.revs('max(%ln)', successors).first()
77 if bookmarks.isactivewdirparent(repo):
77 if bookmarks.isactivewdirparent(repo):
78 movemark = repo['.'].node()
78 movemark = repo['.'].node()
79 return node, movemark, None
79 return node, movemark, None
80
80
81 def _destupdatebook(repo, clean, check):
81 def _destupdatebook(repo, clean, check):
82 """decide on an update destination from active bookmark"""
82 """decide on an update destination from active bookmark"""
83 # we also move the active bookmark, if any
83 # we also move the active bookmark, if any
84 activemark = None
84 activemark = None
85 node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
85 node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
86 if node is not None:
86 if node is not None:
87 activemark = node
87 activemark = node
88 return node, movemark, activemark
88 return node, movemark, activemark
89
89
90 def _destupdatebranch(repo, clean, check):
90 def _destupdatebranch(repo, clean, check):
91 """decide on an update destination from current branch"""
91 """decide on an update destination from current branch"""
92 wc = repo[None]
92 wc = repo[None]
93 movemark = node = None
93 movemark = node = None
94 try:
94 try:
95 node = repo.branchtip(wc.branch())
95 node = repo.revs('max(.::(head() and branch(%s)))'
96 , wc.branch()).first()
96 if bookmarks.isactivewdirparent(repo):
97 if bookmarks.isactivewdirparent(repo):
97 movemark = repo['.'].node()
98 movemark = repo['.'].node()
98 except error.RepoLookupError:
99 except error.RepoLookupError:
99 if wc.branch() == 'default': # no default branch!
100 if wc.branch() == 'default': # no default branch!
100 node = repo.lookup('tip') # update to tip
101 node = repo.lookup('tip') # update to tip
101 else:
102 else:
102 raise error.Abort(_("branch %s not found") % wc.branch())
103 raise error.Abort(_("branch %s not found") % wc.branch())
103 return node, movemark, None
104 return node, movemark, None
104
105
105 # order in which each step should be evalutated
106 # order in which each step should be evalutated
106 # steps are run until one finds a destination
107 # steps are run until one finds a destination
107 destupdatesteps = ['evolution', 'bookmark', 'branch']
108 destupdatesteps = ['evolution', 'bookmark', 'branch']
108 # mapping to ease extension overriding steps.
109 # mapping to ease extension overriding steps.
109 destupdatestepmap = {'evolution': _destupdateobs,
110 destupdatestepmap = {'evolution': _destupdateobs,
110 'bookmark': _destupdatebook,
111 'bookmark': _destupdatebook,
111 'branch': _destupdatebranch,
112 'branch': _destupdatebranch,
112 }
113 }
113
114
114 def destupdate(repo, clean=False, check=False):
115 def destupdate(repo, clean=False, check=False):
115 """destination for bare update operation
116 """destination for bare update operation
116
117
117 return (rev, movemark, activemark)
118 return (rev, movemark, activemark)
118
119
119 - rev: the revision to update to,
120 - rev: the revision to update to,
120 - movemark: node to move the active bookmark from
121 - movemark: node to move the active bookmark from
121 (cf bookmark.calculate update),
122 (cf bookmark.calculate update),
122 - activemark: a bookmark to activate at the end of the update.
123 - activemark: a bookmark to activate at the end of the update.
123 """
124 """
124 node = movemark = activemark = None
125 node = movemark = activemark = None
125
126
126 for step in destupdatesteps:
127 for step in destupdatesteps:
127 node, movemark, activemark = destupdatestepmap[step](repo, clean, check)
128 node, movemark, activemark = destupdatestepmap[step](repo, clean, check)
128 if node is not None:
129 if node is not None:
129 break
130 break
130 rev = repo[node].rev()
131 rev = repo[node].rev()
131
132
132 _destupdatevalidate(repo, rev, clean, check)
133 _destupdatevalidate(repo, rev, clean, check)
133
134
134 return rev, movemark, activemark
135 return rev, movemark, activemark
135
136
136 def _destmergebook(repo):
137 def _destmergebook(repo):
137 """find merge destination in the active bookmark case"""
138 """find merge destination in the active bookmark case"""
138 node = None
139 node = None
139 bmheads = repo.bookmarkheads(repo._activebookmark)
140 bmheads = repo.bookmarkheads(repo._activebookmark)
140 curhead = repo[repo._activebookmark].node()
141 curhead = repo[repo._activebookmark].node()
141 if len(bmheads) == 2:
142 if len(bmheads) == 2:
142 if curhead == bmheads[0]:
143 if curhead == bmheads[0]:
143 node = bmheads[1]
144 node = bmheads[1]
144 else:
145 else:
145 node = bmheads[0]
146 node = bmheads[0]
146 elif len(bmheads) > 2:
147 elif len(bmheads) > 2:
147 raise error.Abort(_("multiple matching bookmarks to merge - "
148 raise error.Abort(_("multiple matching bookmarks to merge - "
148 "please merge with an explicit rev or bookmark"),
149 "please merge with an explicit rev or bookmark"),
149 hint=_("run 'hg heads' to see all heads"))
150 hint=_("run 'hg heads' to see all heads"))
150 elif len(bmheads) <= 1:
151 elif len(bmheads) <= 1:
151 raise error.Abort(_("no matching bookmark to merge - "
152 raise error.Abort(_("no matching bookmark to merge - "
152 "please merge with an explicit rev or bookmark"),
153 "please merge with an explicit rev or bookmark"),
153 hint=_("run 'hg heads' to see all heads"))
154 hint=_("run 'hg heads' to see all heads"))
154 assert node is not None
155 assert node is not None
155 return node
156 return node
156
157
157 def _destmergebranch(repo):
158 def _destmergebranch(repo):
158 """find merge destination based on branch heads"""
159 """find merge destination based on branch heads"""
159 node = None
160 node = None
160 branch = repo[None].branch()
161 branch = repo[None].branch()
161 bheads = repo.branchheads(branch)
162 bheads = repo.branchheads(branch)
162 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
163 nbhs = [bh for bh in bheads if not repo[bh].bookmarks()]
163
164
164 if len(nbhs) > 2:
165 if len(nbhs) > 2:
165 raise error.Abort(_("branch '%s' has %d heads - "
166 raise error.Abort(_("branch '%s' has %d heads - "
166 "please merge with an explicit rev")
167 "please merge with an explicit rev")
167 % (branch, len(bheads)),
168 % (branch, len(bheads)),
168 hint=_("run 'hg heads .' to see heads"))
169 hint=_("run 'hg heads .' to see heads"))
169
170
170 parent = repo.dirstate.p1()
171 parent = repo.dirstate.p1()
171 if len(nbhs) <= 1:
172 if len(nbhs) <= 1:
172 if len(bheads) > 1:
173 if len(bheads) > 1:
173 raise error.Abort(_("heads are bookmarked - "
174 raise error.Abort(_("heads are bookmarked - "
174 "please merge with an explicit rev"),
175 "please merge with an explicit rev"),
175 hint=_("run 'hg heads' to see all heads"))
176 hint=_("run 'hg heads' to see all heads"))
176 if len(repo.heads()) > 1:
177 if len(repo.heads()) > 1:
177 raise error.Abort(_("branch '%s' has one head - "
178 raise error.Abort(_("branch '%s' has one head - "
178 "please merge with an explicit rev")
179 "please merge with an explicit rev")
179 % branch,
180 % branch,
180 hint=_("run 'hg heads' to see all heads"))
181 hint=_("run 'hg heads' to see all heads"))
181 msg, hint = _('nothing to merge'), None
182 msg, hint = _('nothing to merge'), None
182 if parent != repo.lookup(branch):
183 if parent != repo.lookup(branch):
183 hint = _("use 'hg update' instead")
184 hint = _("use 'hg update' instead")
184 raise error.Abort(msg, hint=hint)
185 raise error.Abort(msg, hint=hint)
185
186
186 if parent not in bheads:
187 if parent not in bheads:
187 raise error.Abort(_('working directory not at a head revision'),
188 raise error.Abort(_('working directory not at a head revision'),
188 hint=_("use 'hg update' or merge with an "
189 hint=_("use 'hg update' or merge with an "
189 "explicit revision"))
190 "explicit revision"))
190 if parent == nbhs[0]:
191 if parent == nbhs[0]:
191 node = nbhs[-1]
192 node = nbhs[-1]
192 else:
193 else:
193 node = nbhs[0]
194 node = nbhs[0]
194 assert node is not None
195 assert node is not None
195 return node
196 return node
196
197
197 def destmerge(repo):
198 def destmerge(repo):
198 if repo._activebookmark:
199 if repo._activebookmark:
199 node = _destmergebook(repo)
200 node = _destmergebook(repo)
200 else:
201 else:
201 node = _destmergebranch(repo)
202 node = _destmergebranch(repo)
202 return repo[node].rev()
203 return repo[node].rev()
203
204
204 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())'
205 histeditdefaultrevset = 'reverse(only(.) and not public() and not ::merge())'
205
206
206 def desthistedit(ui, repo):
207 def desthistedit(ui, repo):
207 """Default base revision to edit for `hg histedit`."""
208 """Default base revision to edit for `hg histedit`."""
208 # Avoid cycle: scmutil -> revset -> destutil
209 # Avoid cycle: scmutil -> revset -> destutil
209 from . import scmutil
210 from . import scmutil
210
211
211 default = ui.config('histedit', 'defaultrev', histeditdefaultrevset)
212 default = ui.config('histedit', 'defaultrev', histeditdefaultrevset)
212 if default:
213 if default:
213 revs = scmutil.revrange(repo, [default])
214 revs = scmutil.revrange(repo, [default])
214 if revs:
215 if revs:
215 # The revset supplied by the user may not be in ascending order nor
216 # The revset supplied by the user may not be in ascending order nor
216 # take the first revision. So do this manually.
217 # take the first revision. So do this manually.
217 revs.sort()
218 revs.sort()
218 return revs.first()
219 return revs.first()
219
220
220 return None
221 return None
221
222
222 def _statusotherbook(ui, repo):
223 def _statusotherbook(ui, repo):
223 bmheads = repo.bookmarkheads(repo._activebookmark)
224 bmheads = repo.bookmarkheads(repo._activebookmark)
224 curhead = repo[repo._activebookmark].node()
225 curhead = repo[repo._activebookmark].node()
225 if repo.revs('%n and parents()', curhead):
226 if repo.revs('%n and parents()', curhead):
226 # we are on the active bookmark
227 # we are on the active bookmark
227 bmheads = [b for b in bmheads if curhead != b]
228 bmheads = [b for b in bmheads if curhead != b]
228 if bmheads:
229 if bmheads:
229 msg = _('%i other divergent bookmarks for "%s"\n')
230 msg = _('%i other divergent bookmarks for "%s"\n')
230 ui.status(msg % (len(bmheads), repo._activebookmark))
231 ui.status(msg % (len(bmheads), repo._activebookmark))
231
232
232 def _statusotherbranchheads(ui, repo):
233 def _statusotherbranchheads(ui, repo):
233 currentbranch = repo.dirstate.branch()
234 currentbranch = repo.dirstate.branch()
234 heads = repo.branchheads(currentbranch)
235 heads = repo.branchheads(currentbranch)
235 l = len(heads)
236 l = len(heads)
236 if repo.revs('%ln and parents()', heads):
237 if repo.revs('%ln and parents()', heads):
237 # we are on a head
238 # we are on a head
238 heads = repo.revs('%ln - parents()', heads)
239 heads = repo.revs('%ln - parents()', heads)
239 if heads and l != len(heads):
240 if heads and l != len(heads):
240 ui.status(_('%i other heads for branch "%s"\n') %
241 ui.status(_('%i other heads for branch "%s"\n') %
241 (len(heads), currentbranch))
242 (len(heads), currentbranch))
242
243
243 def statusotherdests(ui, repo):
244 def statusotherdests(ui, repo):
244 """Print message about other head"""
245 """Print message about other head"""
245 # XXX we should probably include a hint:
246 # XXX we should probably include a hint:
246 # - about what to do
247 # - about what to do
247 # - how to see such heads
248 # - how to see such heads
248 if repo._activebookmark:
249 if repo._activebookmark:
249 _statusotherbook(ui, repo)
250 _statusotherbook(ui, repo)
250 else:
251 else:
251 _statusotherbranchheads(ui, repo)
252 _statusotherbranchheads(ui, repo)
@@ -1,871 +1,848 b''
1 $ hg init
1 $ hg init
2
2
3 no bookmarks
3 no bookmarks
4
4
5 $ hg bookmarks
5 $ hg bookmarks
6 no bookmarks set
6 no bookmarks set
7
7
8 $ hg bookmarks -Tjson
8 $ hg bookmarks -Tjson
9 [
9 [
10 ]
10 ]
11
11
12 bookmark rev -1
12 bookmark rev -1
13
13
14 $ hg bookmark X
14 $ hg bookmark X
15
15
16 list bookmarks
16 list bookmarks
17
17
18 $ hg bookmarks
18 $ hg bookmarks
19 * X -1:000000000000
19 * X -1:000000000000
20
20
21 list bookmarks with color
21 list bookmarks with color
22
22
23 $ hg --config extensions.color= --config color.mode=ansi \
23 $ hg --config extensions.color= --config color.mode=ansi \
24 > bookmarks --color=always
24 > bookmarks --color=always
25 \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc)
25 \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m -1:000000000000\x1b[0m (esc)
26
26
27 $ echo a > a
27 $ echo a > a
28 $ hg add a
28 $ hg add a
29 $ hg commit -m 0
29 $ hg commit -m 0
30
30
31 bookmark X moved to rev 0
31 bookmark X moved to rev 0
32
32
33 $ hg bookmarks
33 $ hg bookmarks
34 * X 0:f7b1eb17ad24
34 * X 0:f7b1eb17ad24
35
35
36 look up bookmark
36 look up bookmark
37
37
38 $ hg log -r X
38 $ hg log -r X
39 changeset: 0:f7b1eb17ad24
39 changeset: 0:f7b1eb17ad24
40 bookmark: X
40 bookmark: X
41 tag: tip
41 tag: tip
42 user: test
42 user: test
43 date: Thu Jan 01 00:00:00 1970 +0000
43 date: Thu Jan 01 00:00:00 1970 +0000
44 summary: 0
44 summary: 0
45
45
46
46
47 second bookmark for rev 0, command should work even with ui.strict on
47 second bookmark for rev 0, command should work even with ui.strict on
48
48
49 $ hg --config ui.strict=1 bookmark X2
49 $ hg --config ui.strict=1 bookmark X2
50
50
51 bookmark rev -1 again
51 bookmark rev -1 again
52
52
53 $ hg bookmark -r null Y
53 $ hg bookmark -r null Y
54
54
55 list bookmarks
55 list bookmarks
56
56
57 $ hg bookmarks
57 $ hg bookmarks
58 X 0:f7b1eb17ad24
58 X 0:f7b1eb17ad24
59 * X2 0:f7b1eb17ad24
59 * X2 0:f7b1eb17ad24
60 Y -1:000000000000
60 Y -1:000000000000
61
61
62 $ echo b > b
62 $ echo b > b
63 $ hg add b
63 $ hg add b
64 $ hg commit -m 1
64 $ hg commit -m 1
65
65
66 $ hg bookmarks -Tjson
66 $ hg bookmarks -Tjson
67 [
67 [
68 {
68 {
69 "active": false,
69 "active": false,
70 "bookmark": "X",
70 "bookmark": "X",
71 "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac",
71 "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac",
72 "rev": 0
72 "rev": 0
73 },
73 },
74 {
74 {
75 "active": true,
75 "active": true,
76 "bookmark": "X2",
76 "bookmark": "X2",
77 "node": "925d80f479bb026b0fb3deb27503780b13f74123",
77 "node": "925d80f479bb026b0fb3deb27503780b13f74123",
78 "rev": 1
78 "rev": 1
79 },
79 },
80 {
80 {
81 "active": false,
81 "active": false,
82 "bookmark": "Y",
82 "bookmark": "Y",
83 "node": "0000000000000000000000000000000000000000",
83 "node": "0000000000000000000000000000000000000000",
84 "rev": -1
84 "rev": -1
85 }
85 }
86 ]
86 ]
87
87
88 bookmarks revset
88 bookmarks revset
89
89
90 $ hg log -r 'bookmark()'
90 $ hg log -r 'bookmark()'
91 changeset: 0:f7b1eb17ad24
91 changeset: 0:f7b1eb17ad24
92 bookmark: X
92 bookmark: X
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: 0
95 summary: 0
96
96
97 changeset: 1:925d80f479bb
97 changeset: 1:925d80f479bb
98 bookmark: X2
98 bookmark: X2
99 tag: tip
99 tag: tip
100 user: test
100 user: test
101 date: Thu Jan 01 00:00:00 1970 +0000
101 date: Thu Jan 01 00:00:00 1970 +0000
102 summary: 1
102 summary: 1
103
103
104 $ hg log -r 'bookmark(Y)'
104 $ hg log -r 'bookmark(Y)'
105 $ hg log -r 'bookmark(X2)'
105 $ hg log -r 'bookmark(X2)'
106 changeset: 1:925d80f479bb
106 changeset: 1:925d80f479bb
107 bookmark: X2
107 bookmark: X2
108 tag: tip
108 tag: tip
109 user: test
109 user: test
110 date: Thu Jan 01 00:00:00 1970 +0000
110 date: Thu Jan 01 00:00:00 1970 +0000
111 summary: 1
111 summary: 1
112
112
113 $ hg log -r 'bookmark("re:X")'
113 $ hg log -r 'bookmark("re:X")'
114 changeset: 0:f7b1eb17ad24
114 changeset: 0:f7b1eb17ad24
115 bookmark: X
115 bookmark: X
116 user: test
116 user: test
117 date: Thu Jan 01 00:00:00 1970 +0000
117 date: Thu Jan 01 00:00:00 1970 +0000
118 summary: 0
118 summary: 0
119
119
120 changeset: 1:925d80f479bb
120 changeset: 1:925d80f479bb
121 bookmark: X2
121 bookmark: X2
122 tag: tip
122 tag: tip
123 user: test
123 user: test
124 date: Thu Jan 01 00:00:00 1970 +0000
124 date: Thu Jan 01 00:00:00 1970 +0000
125 summary: 1
125 summary: 1
126
126
127 $ hg log -r 'bookmark("literal:X")'
127 $ hg log -r 'bookmark("literal:X")'
128 changeset: 0:f7b1eb17ad24
128 changeset: 0:f7b1eb17ad24
129 bookmark: X
129 bookmark: X
130 user: test
130 user: test
131 date: Thu Jan 01 00:00:00 1970 +0000
131 date: Thu Jan 01 00:00:00 1970 +0000
132 summary: 0
132 summary: 0
133
133
134
134
135 $ hg log -r 'bookmark(unknown)'
135 $ hg log -r 'bookmark(unknown)'
136 abort: bookmark 'unknown' does not exist!
136 abort: bookmark 'unknown' does not exist!
137 [255]
137 [255]
138 $ hg log -r 'bookmark("literal:unknown")'
138 $ hg log -r 'bookmark("literal:unknown")'
139 abort: bookmark 'unknown' does not exist!
139 abort: bookmark 'unknown' does not exist!
140 [255]
140 [255]
141 $ hg log -r 'bookmark("re:unknown")'
141 $ hg log -r 'bookmark("re:unknown")'
142 abort: no bookmarks exist that match 'unknown'!
142 abort: no bookmarks exist that match 'unknown'!
143 [255]
143 [255]
144 $ hg log -r 'present(bookmark("literal:unknown"))'
144 $ hg log -r 'present(bookmark("literal:unknown"))'
145 $ hg log -r 'present(bookmark("re:unknown"))'
145 $ hg log -r 'present(bookmark("re:unknown"))'
146
146
147 $ hg help revsets | grep 'bookmark('
147 $ hg help revsets | grep 'bookmark('
148 "bookmark([name])"
148 "bookmark([name])"
149
149
150 bookmarks X and X2 moved to rev 1, Y at rev -1
150 bookmarks X and X2 moved to rev 1, Y at rev -1
151
151
152 $ hg bookmarks
152 $ hg bookmarks
153 X 0:f7b1eb17ad24
153 X 0:f7b1eb17ad24
154 * X2 1:925d80f479bb
154 * X2 1:925d80f479bb
155 Y -1:000000000000
155 Y -1:000000000000
156
156
157 bookmark rev 0 again
157 bookmark rev 0 again
158
158
159 $ hg bookmark -r 0 Z
159 $ hg bookmark -r 0 Z
160
160
161 $ hg update X
161 $ hg update X
162 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
162 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
163 (activating bookmark X)
163 (activating bookmark X)
164 $ echo c > c
164 $ echo c > c
165 $ hg add c
165 $ hg add c
166 $ hg commit -m 2
166 $ hg commit -m 2
167 created new head
167 created new head
168
168
169 bookmarks X moved to rev 2, Y at rev -1, Z at rev 0
169 bookmarks X moved to rev 2, Y at rev -1, Z at rev 0
170
170
171 $ hg bookmarks
171 $ hg bookmarks
172 * X 2:db815d6d32e6
172 * X 2:db815d6d32e6
173 X2 1:925d80f479bb
173 X2 1:925d80f479bb
174 Y -1:000000000000
174 Y -1:000000000000
175 Z 0:f7b1eb17ad24
175 Z 0:f7b1eb17ad24
176
176
177 rename nonexistent bookmark
177 rename nonexistent bookmark
178
178
179 $ hg bookmark -m A B
179 $ hg bookmark -m A B
180 abort: bookmark 'A' does not exist
180 abort: bookmark 'A' does not exist
181 [255]
181 [255]
182
182
183 rename to existent bookmark
183 rename to existent bookmark
184
184
185 $ hg bookmark -m X Y
185 $ hg bookmark -m X Y
186 abort: bookmark 'Y' already exists (use -f to force)
186 abort: bookmark 'Y' already exists (use -f to force)
187 [255]
187 [255]
188
188
189 force rename to existent bookmark
189 force rename to existent bookmark
190
190
191 $ hg bookmark -f -m X Y
191 $ hg bookmark -f -m X Y
192
192
193 list bookmarks
193 list bookmarks
194
194
195 $ hg bookmark
195 $ hg bookmark
196 X2 1:925d80f479bb
196 X2 1:925d80f479bb
197 * Y 2:db815d6d32e6
197 * Y 2:db815d6d32e6
198 Z 0:f7b1eb17ad24
198 Z 0:f7b1eb17ad24
199
199
200 bookmarks from a revset
200 bookmarks from a revset
201 $ hg bookmark -r '.^1' REVSET
201 $ hg bookmark -r '.^1' REVSET
202 $ hg bookmark -r ':tip' TIP
202 $ hg bookmark -r ':tip' TIP
203 $ hg up -q TIP
203 $ hg up -q TIP
204 $ hg bookmarks
204 $ hg bookmarks
205 REVSET 0:f7b1eb17ad24
205 REVSET 0:f7b1eb17ad24
206 * TIP 2:db815d6d32e6
206 * TIP 2:db815d6d32e6
207 X2 1:925d80f479bb
207 X2 1:925d80f479bb
208 Y 2:db815d6d32e6
208 Y 2:db815d6d32e6
209 Z 0:f7b1eb17ad24
209 Z 0:f7b1eb17ad24
210
210
211 $ hg bookmark -d REVSET
211 $ hg bookmark -d REVSET
212 $ hg bookmark -d TIP
212 $ hg bookmark -d TIP
213
213
214 rename without new name or multiple names
214 rename without new name or multiple names
215
215
216 $ hg bookmark -m Y
216 $ hg bookmark -m Y
217 abort: new bookmark name required
217 abort: new bookmark name required
218 [255]
218 [255]
219 $ hg bookmark -m Y Y2 Y3
219 $ hg bookmark -m Y Y2 Y3
220 abort: only one new bookmark name allowed
220 abort: only one new bookmark name allowed
221 [255]
221 [255]
222
222
223 delete without name
223 delete without name
224
224
225 $ hg bookmark -d
225 $ hg bookmark -d
226 abort: bookmark name required
226 abort: bookmark name required
227 [255]
227 [255]
228
228
229 delete nonexistent bookmark
229 delete nonexistent bookmark
230
230
231 $ hg bookmark -d A
231 $ hg bookmark -d A
232 abort: bookmark 'A' does not exist
232 abort: bookmark 'A' does not exist
233 [255]
233 [255]
234
234
235 bookmark name with spaces should be stripped
235 bookmark name with spaces should be stripped
236
236
237 $ hg bookmark ' x y '
237 $ hg bookmark ' x y '
238
238
239 list bookmarks
239 list bookmarks
240
240
241 $ hg bookmarks
241 $ hg bookmarks
242 X2 1:925d80f479bb
242 X2 1:925d80f479bb
243 Y 2:db815d6d32e6
243 Y 2:db815d6d32e6
244 Z 0:f7b1eb17ad24
244 Z 0:f7b1eb17ad24
245 * x y 2:db815d6d32e6
245 * x y 2:db815d6d32e6
246
246
247 look up stripped bookmark name
247 look up stripped bookmark name
248
248
249 $ hg log -r '"x y"'
249 $ hg log -r '"x y"'
250 changeset: 2:db815d6d32e6
250 changeset: 2:db815d6d32e6
251 bookmark: Y
251 bookmark: Y
252 bookmark: x y
252 bookmark: x y
253 tag: tip
253 tag: tip
254 parent: 0:f7b1eb17ad24
254 parent: 0:f7b1eb17ad24
255 user: test
255 user: test
256 date: Thu Jan 01 00:00:00 1970 +0000
256 date: Thu Jan 01 00:00:00 1970 +0000
257 summary: 2
257 summary: 2
258
258
259
259
260 reject bookmark name with newline
260 reject bookmark name with newline
261
261
262 $ hg bookmark '
262 $ hg bookmark '
263 > '
263 > '
264 abort: bookmark names cannot consist entirely of whitespace
264 abort: bookmark names cannot consist entirely of whitespace
265 [255]
265 [255]
266
266
267 $ hg bookmark -m Z '
267 $ hg bookmark -m Z '
268 > '
268 > '
269 abort: bookmark names cannot consist entirely of whitespace
269 abort: bookmark names cannot consist entirely of whitespace
270 [255]
270 [255]
271
271
272 bookmark with reserved name
272 bookmark with reserved name
273
273
274 $ hg bookmark tip
274 $ hg bookmark tip
275 abort: the name 'tip' is reserved
275 abort: the name 'tip' is reserved
276 [255]
276 [255]
277
277
278 $ hg bookmark .
278 $ hg bookmark .
279 abort: the name '.' is reserved
279 abort: the name '.' is reserved
280 [255]
280 [255]
281
281
282 $ hg bookmark null
282 $ hg bookmark null
283 abort: the name 'null' is reserved
283 abort: the name 'null' is reserved
284 [255]
284 [255]
285
285
286
286
287 bookmark with existing name
287 bookmark with existing name
288
288
289 $ hg bookmark X2
289 $ hg bookmark X2
290 abort: bookmark 'X2' already exists (use -f to force)
290 abort: bookmark 'X2' already exists (use -f to force)
291 [255]
291 [255]
292
292
293 $ hg bookmark -m Y Z
293 $ hg bookmark -m Y Z
294 abort: bookmark 'Z' already exists (use -f to force)
294 abort: bookmark 'Z' already exists (use -f to force)
295 [255]
295 [255]
296
296
297 bookmark with name of branch
297 bookmark with name of branch
298
298
299 $ hg bookmark default
299 $ hg bookmark default
300 abort: a bookmark cannot have the name of an existing branch
300 abort: a bookmark cannot have the name of an existing branch
301 [255]
301 [255]
302
302
303 $ hg bookmark -m Y default
303 $ hg bookmark -m Y default
304 abort: a bookmark cannot have the name of an existing branch
304 abort: a bookmark cannot have the name of an existing branch
305 [255]
305 [255]
306
306
307 bookmark with integer name
307 bookmark with integer name
308
308
309 $ hg bookmark 10
309 $ hg bookmark 10
310 abort: cannot use an integer as a name
310 abort: cannot use an integer as a name
311 [255]
311 [255]
312
312
313 incompatible options
313 incompatible options
314
314
315 $ hg bookmark -m Y -d Z
315 $ hg bookmark -m Y -d Z
316 abort: --delete and --rename are incompatible
316 abort: --delete and --rename are incompatible
317 [255]
317 [255]
318
318
319 $ hg bookmark -r 1 -d Z
319 $ hg bookmark -r 1 -d Z
320 abort: --rev is incompatible with --delete
320 abort: --rev is incompatible with --delete
321 [255]
321 [255]
322
322
323 $ hg bookmark -r 1 -m Z Y
323 $ hg bookmark -r 1 -m Z Y
324 abort: --rev is incompatible with --rename
324 abort: --rev is incompatible with --rename
325 [255]
325 [255]
326
326
327 force bookmark with existing name
327 force bookmark with existing name
328
328
329 $ hg bookmark -f X2
329 $ hg bookmark -f X2
330
330
331 force bookmark back to where it was, should deactivate it
331 force bookmark back to where it was, should deactivate it
332
332
333 $ hg bookmark -fr1 X2
333 $ hg bookmark -fr1 X2
334 $ hg bookmarks
334 $ hg bookmarks
335 X2 1:925d80f479bb
335 X2 1:925d80f479bb
336 Y 2:db815d6d32e6
336 Y 2:db815d6d32e6
337 Z 0:f7b1eb17ad24
337 Z 0:f7b1eb17ad24
338 x y 2:db815d6d32e6
338 x y 2:db815d6d32e6
339
339
340 forward bookmark to descendant without --force
340 forward bookmark to descendant without --force
341
341
342 $ hg bookmark Z
342 $ hg bookmark Z
343 moving bookmark 'Z' forward from f7b1eb17ad24
343 moving bookmark 'Z' forward from f7b1eb17ad24
344
344
345 list bookmarks
345 list bookmarks
346
346
347 $ hg bookmark
347 $ hg bookmark
348 X2 1:925d80f479bb
348 X2 1:925d80f479bb
349 Y 2:db815d6d32e6
349 Y 2:db815d6d32e6
350 * Z 2:db815d6d32e6
350 * Z 2:db815d6d32e6
351 x y 2:db815d6d32e6
351 x y 2:db815d6d32e6
352
352
353 revision but no bookmark name
353 revision but no bookmark name
354
354
355 $ hg bookmark -r .
355 $ hg bookmark -r .
356 abort: bookmark name required
356 abort: bookmark name required
357 [255]
357 [255]
358
358
359 bookmark name with whitespace only
359 bookmark name with whitespace only
360
360
361 $ hg bookmark ' '
361 $ hg bookmark ' '
362 abort: bookmark names cannot consist entirely of whitespace
362 abort: bookmark names cannot consist entirely of whitespace
363 [255]
363 [255]
364
364
365 $ hg bookmark -m Y ' '
365 $ hg bookmark -m Y ' '
366 abort: bookmark names cannot consist entirely of whitespace
366 abort: bookmark names cannot consist entirely of whitespace
367 [255]
367 [255]
368
368
369 invalid bookmark
369 invalid bookmark
370
370
371 $ hg bookmark 'foo:bar'
371 $ hg bookmark 'foo:bar'
372 abort: ':' cannot be used in a name
372 abort: ':' cannot be used in a name
373 [255]
373 [255]
374
374
375 $ hg bookmark 'foo
375 $ hg bookmark 'foo
376 > bar'
376 > bar'
377 abort: '\n' cannot be used in a name
377 abort: '\n' cannot be used in a name
378 [255]
378 [255]
379
379
380 the bookmark extension should be ignored now that it is part of core
380 the bookmark extension should be ignored now that it is part of core
381
381
382 $ echo "[extensions]" >> $HGRCPATH
382 $ echo "[extensions]" >> $HGRCPATH
383 $ echo "bookmarks=" >> $HGRCPATH
383 $ echo "bookmarks=" >> $HGRCPATH
384 $ hg bookmarks
384 $ hg bookmarks
385 X2 1:925d80f479bb
385 X2 1:925d80f479bb
386 Y 2:db815d6d32e6
386 Y 2:db815d6d32e6
387 * Z 2:db815d6d32e6
387 * Z 2:db815d6d32e6
388 x y 2:db815d6d32e6
388 x y 2:db815d6d32e6
389
389
390 test summary
390 test summary
391
391
392 $ hg summary
392 $ hg summary
393 parent: 2:db815d6d32e6 tip
393 parent: 2:db815d6d32e6 tip
394 2
394 2
395 branch: default
395 branch: default
396 bookmarks: *Z Y x y
396 bookmarks: *Z Y x y
397 commit: (clean)
397 commit: (clean)
398 update: 1 new changesets, 2 branch heads (merge)
398 update: 1 new changesets, 2 branch heads (merge)
399 phases: 3 draft
399 phases: 3 draft
400
400
401 test id
401 test id
402
402
403 $ hg id
403 $ hg id
404 db815d6d32e6 tip Y/Z/x y
404 db815d6d32e6 tip Y/Z/x y
405
405
406 test rollback
406 test rollback
407
407
408 $ echo foo > f1
408 $ echo foo > f1
409 $ hg bookmark tmp-rollback
409 $ hg bookmark tmp-rollback
410 $ hg ci -Amr
410 $ hg ci -Amr
411 adding f1
411 adding f1
412 $ hg bookmarks
412 $ hg bookmarks
413 X2 1:925d80f479bb
413 X2 1:925d80f479bb
414 Y 2:db815d6d32e6
414 Y 2:db815d6d32e6
415 Z 2:db815d6d32e6
415 Z 2:db815d6d32e6
416 * tmp-rollback 3:2bf5cfec5864
416 * tmp-rollback 3:2bf5cfec5864
417 x y 2:db815d6d32e6
417 x y 2:db815d6d32e6
418 $ hg rollback
418 $ hg rollback
419 repository tip rolled back to revision 2 (undo commit)
419 repository tip rolled back to revision 2 (undo commit)
420 working directory now based on revision 2
420 working directory now based on revision 2
421 $ hg bookmarks
421 $ hg bookmarks
422 X2 1:925d80f479bb
422 X2 1:925d80f479bb
423 Y 2:db815d6d32e6
423 Y 2:db815d6d32e6
424 Z 2:db815d6d32e6
424 Z 2:db815d6d32e6
425 * tmp-rollback 2:db815d6d32e6
425 * tmp-rollback 2:db815d6d32e6
426 x y 2:db815d6d32e6
426 x y 2:db815d6d32e6
427 $ hg bookmark -f Z -r 1
427 $ hg bookmark -f Z -r 1
428 $ hg rollback
428 $ hg rollback
429 repository tip rolled back to revision 2 (undo bookmark)
429 repository tip rolled back to revision 2 (undo bookmark)
430 $ hg bookmarks
430 $ hg bookmarks
431 X2 1:925d80f479bb
431 X2 1:925d80f479bb
432 Y 2:db815d6d32e6
432 Y 2:db815d6d32e6
433 Z 2:db815d6d32e6
433 Z 2:db815d6d32e6
434 * tmp-rollback 2:db815d6d32e6
434 * tmp-rollback 2:db815d6d32e6
435 x y 2:db815d6d32e6
435 x y 2:db815d6d32e6
436 $ hg bookmark -d tmp-rollback
436 $ hg bookmark -d tmp-rollback
437
437
438 activate bookmark on working dir parent without --force
438 activate bookmark on working dir parent without --force
439
439
440 $ hg bookmark --inactive Z
440 $ hg bookmark --inactive Z
441 $ hg bookmark Z
441 $ hg bookmark Z
442
442
443 test clone
443 test clone
444
444
445 $ hg bookmark -r 2 -i @
445 $ hg bookmark -r 2 -i @
446 $ hg bookmark -r 2 -i a@
446 $ hg bookmark -r 2 -i a@
447 $ hg bookmarks
447 $ hg bookmarks
448 @ 2:db815d6d32e6
448 @ 2:db815d6d32e6
449 X2 1:925d80f479bb
449 X2 1:925d80f479bb
450 Y 2:db815d6d32e6
450 Y 2:db815d6d32e6
451 * Z 2:db815d6d32e6
451 * Z 2:db815d6d32e6
452 a@ 2:db815d6d32e6
452 a@ 2:db815d6d32e6
453 x y 2:db815d6d32e6
453 x y 2:db815d6d32e6
454 $ hg clone . cloned-bookmarks
454 $ hg clone . cloned-bookmarks
455 updating to bookmark @
455 updating to bookmark @
456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 $ hg -R cloned-bookmarks bookmarks
457 $ hg -R cloned-bookmarks bookmarks
458 * @ 2:db815d6d32e6
458 * @ 2:db815d6d32e6
459 X2 1:925d80f479bb
459 X2 1:925d80f479bb
460 Y 2:db815d6d32e6
460 Y 2:db815d6d32e6
461 Z 2:db815d6d32e6
461 Z 2:db815d6d32e6
462 a@ 2:db815d6d32e6
462 a@ 2:db815d6d32e6
463 x y 2:db815d6d32e6
463 x y 2:db815d6d32e6
464
464
465 test clone with pull protocol
465 test clone with pull protocol
466
466
467 $ hg clone --pull . cloned-bookmarks-pull
467 $ hg clone --pull . cloned-bookmarks-pull
468 requesting all changes
468 requesting all changes
469 adding changesets
469 adding changesets
470 adding manifests
470 adding manifests
471 adding file changes
471 adding file changes
472 added 3 changesets with 3 changes to 3 files (+1 heads)
472 added 3 changesets with 3 changes to 3 files (+1 heads)
473 updating to bookmark @
473 updating to bookmark @
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 $ hg -R cloned-bookmarks-pull bookmarks
475 $ hg -R cloned-bookmarks-pull bookmarks
476 * @ 2:db815d6d32e6
476 * @ 2:db815d6d32e6
477 X2 1:925d80f479bb
477 X2 1:925d80f479bb
478 Y 2:db815d6d32e6
478 Y 2:db815d6d32e6
479 Z 2:db815d6d32e6
479 Z 2:db815d6d32e6
480 a@ 2:db815d6d32e6
480 a@ 2:db815d6d32e6
481 x y 2:db815d6d32e6
481 x y 2:db815d6d32e6
482
482
483 delete multiple bookmarks at once
483 delete multiple bookmarks at once
484
484
485 $ hg bookmark -d @ a@
485 $ hg bookmark -d @ a@
486
486
487 test clone with a bookmark named "default" (issue3677)
487 test clone with a bookmark named "default" (issue3677)
488
488
489 $ hg bookmark -r 1 -f -i default
489 $ hg bookmark -r 1 -f -i default
490 $ hg clone . cloned-bookmark-default
490 $ hg clone . cloned-bookmark-default
491 updating to branch default
491 updating to branch default
492 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
492 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
493 $ hg -R cloned-bookmark-default bookmarks
493 $ hg -R cloned-bookmark-default bookmarks
494 X2 1:925d80f479bb
494 X2 1:925d80f479bb
495 Y 2:db815d6d32e6
495 Y 2:db815d6d32e6
496 Z 2:db815d6d32e6
496 Z 2:db815d6d32e6
497 default 1:925d80f479bb
497 default 1:925d80f479bb
498 x y 2:db815d6d32e6
498 x y 2:db815d6d32e6
499 $ hg -R cloned-bookmark-default parents -q
499 $ hg -R cloned-bookmark-default parents -q
500 2:db815d6d32e6
500 2:db815d6d32e6
501 $ hg bookmark -d default
501 $ hg bookmark -d default
502
502
503 test clone with a specific revision
503 test clone with a specific revision
504
504
505 $ hg clone -r 925d80 . cloned-bookmarks-rev
505 $ hg clone -r 925d80 . cloned-bookmarks-rev
506 adding changesets
506 adding changesets
507 adding manifests
507 adding manifests
508 adding file changes
508 adding file changes
509 added 2 changesets with 2 changes to 2 files
509 added 2 changesets with 2 changes to 2 files
510 updating to branch default
510 updating to branch default
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ hg -R cloned-bookmarks-rev bookmarks
512 $ hg -R cloned-bookmarks-rev bookmarks
513 X2 1:925d80f479bb
513 X2 1:925d80f479bb
514
514
515 test clone with update to a bookmark
515 test clone with update to a bookmark
516
516
517 $ hg clone -u Z . ../cloned-bookmarks-update
517 $ hg clone -u Z . ../cloned-bookmarks-update
518 updating to branch default
518 updating to branch default
519 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
519 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
520 $ hg -R ../cloned-bookmarks-update bookmarks
520 $ hg -R ../cloned-bookmarks-update bookmarks
521 X2 1:925d80f479bb
521 X2 1:925d80f479bb
522 Y 2:db815d6d32e6
522 Y 2:db815d6d32e6
523 * Z 2:db815d6d32e6
523 * Z 2:db815d6d32e6
524 x y 2:db815d6d32e6
524 x y 2:db815d6d32e6
525
525
526 create bundle with two heads
526 create bundle with two heads
527
527
528 $ hg clone . tobundle
528 $ hg clone . tobundle
529 updating to branch default
529 updating to branch default
530 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 $ echo x > tobundle/x
531 $ echo x > tobundle/x
532 $ hg -R tobundle add tobundle/x
532 $ hg -R tobundle add tobundle/x
533 $ hg -R tobundle commit -m'x'
533 $ hg -R tobundle commit -m'x'
534 $ hg -R tobundle update -r -2
534 $ hg -R tobundle update -r -2
535 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
535 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
536 $ echo y > tobundle/y
536 $ echo y > tobundle/y
537 $ hg -R tobundle branch test
537 $ hg -R tobundle branch test
538 marked working directory as branch test
538 marked working directory as branch test
539 (branches are permanent and global, did you want a bookmark?)
539 (branches are permanent and global, did you want a bookmark?)
540 $ hg -R tobundle add tobundle/y
540 $ hg -R tobundle add tobundle/y
541 $ hg -R tobundle commit -m'y'
541 $ hg -R tobundle commit -m'y'
542 $ hg -R tobundle bundle tobundle.hg
542 $ hg -R tobundle bundle tobundle.hg
543 searching for changes
543 searching for changes
544 2 changesets found
544 2 changesets found
545 $ hg unbundle tobundle.hg
545 $ hg unbundle tobundle.hg
546 adding changesets
546 adding changesets
547 adding manifests
547 adding manifests
548 adding file changes
548 adding file changes
549 added 2 changesets with 2 changes to 2 files (+1 heads)
549 added 2 changesets with 2 changes to 2 files (+1 heads)
550 (run 'hg heads' to see heads, 'hg merge' to merge)
550 (run 'hg heads' to see heads, 'hg merge' to merge)
551
551
552 update to active bookmark if it's not the parent
552 update to active bookmark if it's not the parent
553
553
554 $ hg summary
554 $ hg summary
555 parent: 2:db815d6d32e6
555 parent: 2:db815d6d32e6
556 2
556 2
557 branch: default
557 branch: default
558 bookmarks: *Z Y x y
558 bookmarks: *Z Y x y
559 commit: 1 added, 1 unknown (new branch head)
559 commit: 1 added, 1 unknown (new branch head)
560 update: 2 new changesets (update)
560 update: 2 new changesets (update)
561 phases: 5 draft
561 phases: 5 draft
562 $ hg update
562 $ hg update
563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
563 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
564 updating bookmark Z
564 updating bookmark Z
565 $ hg bookmarks
565 $ hg bookmarks
566 X2 1:925d80f479bb
566 X2 1:925d80f479bb
567 Y 2:db815d6d32e6
567 Y 2:db815d6d32e6
568 * Z 3:125c9a1d6df6
568 * Z 3:125c9a1d6df6
569 x y 2:db815d6d32e6
569 x y 2:db815d6d32e6
570
570
571 pull --update works the same as pull && update
571 pull --update works the same as pull && update
572
572
573 $ hg bookmark -r3 Y
573 $ hg bookmark -r3 Y
574 moving bookmark 'Y' forward from db815d6d32e6
574 moving bookmark 'Y' forward from db815d6d32e6
575 $ cp -r ../cloned-bookmarks-update ../cloned-bookmarks-manual-update
575 $ cp -r ../cloned-bookmarks-update ../cloned-bookmarks-manual-update
576 $ cp -r ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence
576 $ cp -r ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence
577
577
578 (manual version)
578 (manual version)
579
579
580 $ hg -R ../cloned-bookmarks-manual-update update Y
580 $ hg -R ../cloned-bookmarks-manual-update update Y
581 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
581 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
582 (activating bookmark Y)
582 (activating bookmark Y)
583 $ hg -R ../cloned-bookmarks-manual-update pull .
583 $ hg -R ../cloned-bookmarks-manual-update pull .
584 pulling from .
584 pulling from .
585 searching for changes
585 searching for changes
586 adding changesets
586 adding changesets
587 adding manifests
587 adding manifests
588 adding file changes
588 adding file changes
589 added 2 changesets with 2 changes to 2 files (+1 heads)
589 added 2 changesets with 2 changes to 2 files (+1 heads)
590 updating bookmark Y
590 updating bookmark Y
591 updating bookmark Z
591 updating bookmark Z
592 (run 'hg heads' to see heads, 'hg merge' to merge)
592 (run 'hg heads' to see heads, 'hg merge' to merge)
593
593
594 (# tests strange but with --date crashing when bookmark have to move)
594 (# tests strange but with --date crashing when bookmark have to move)
595
595
596 $ hg -R ../cloned-bookmarks-manual-update update -d 1986
596 $ hg -R ../cloned-bookmarks-manual-update update -d 1986
597 abort: revision matching date not found
597 abort: revision matching date not found
598 [255]
598 [255]
599 $ hg -R ../cloned-bookmarks-manual-update update
599 $ hg -R ../cloned-bookmarks-manual-update update
600 updating to active bookmark Y
600 updating to active bookmark Y
601 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
601 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
602 (activating bookmark Y)
602 (activating bookmark Y)
603
603
604 (all in one version)
604 (all in one version)
605
605
606 $ hg -R ../cloned-bookmarks-update update Y
606 $ hg -R ../cloned-bookmarks-update update Y
607 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 (activating bookmark Y)
608 (activating bookmark Y)
609 $ hg -R ../cloned-bookmarks-update pull --update .
609 $ hg -R ../cloned-bookmarks-update pull --update .
610 pulling from .
610 pulling from .
611 searching for changes
611 searching for changes
612 adding changesets
612 adding changesets
613 adding manifests
613 adding manifests
614 adding file changes
614 adding file changes
615 added 2 changesets with 2 changes to 2 files (+1 heads)
615 added 2 changesets with 2 changes to 2 files (+1 heads)
616 updating bookmark Y
616 updating bookmark Y
617 updating bookmark Z
617 updating bookmark Z
618 updating to active bookmark Y
618 updating to active bookmark Y
619 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
619 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
620
620
621 We warn about divergent during bare update to the active bookmark
621 We warn about divergent during bare update to the active bookmark
622
622
623 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y
623 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y
624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
625 (activating bookmark Y)
625 (activating bookmark Y)
626 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1
626 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1
627 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks
627 $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks
628 X2 1:925d80f479bb
628 X2 1:925d80f479bb
629 * Y 2:db815d6d32e6
629 * Y 2:db815d6d32e6
630 Y@1 1:925d80f479bb
630 Y@1 1:925d80f479bb
631 Z 2:db815d6d32e6
631 Z 2:db815d6d32e6
632 x y 2:db815d6d32e6
632 x y 2:db815d6d32e6
633 $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull
633 $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull
634 pulling from $TESTTMP
634 pulling from $TESTTMP
635 searching for changes
635 searching for changes
636 adding changesets
636 adding changesets
637 adding manifests
637 adding manifests
638 adding file changes
638 adding file changes
639 added 2 changesets with 2 changes to 2 files (+1 heads)
639 added 2 changesets with 2 changes to 2 files (+1 heads)
640 updating bookmark Y
640 updating bookmark Y
641 updating bookmark Z
641 updating bookmark Z
642 (run 'hg heads' to see heads, 'hg merge' to merge)
642 (run 'hg heads' to see heads, 'hg merge' to merge)
643 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update
643 $ hg -R ../cloned-bookmarks-manual-update-with-divergence update
644 updating to active bookmark Y
644 updating to active bookmark Y
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
646 (activating bookmark Y)
646 (activating bookmark Y)
647 1 other divergent bookmarks for "Y"
647 1 other divergent bookmarks for "Y"
648
648
649 test wrongly formated bookmark
649 test wrongly formated bookmark
650
650
651 $ echo '' >> .hg/bookmarks
651 $ echo '' >> .hg/bookmarks
652 $ hg bookmarks
652 $ hg bookmarks
653 X2 1:925d80f479bb
653 X2 1:925d80f479bb
654 Y 3:125c9a1d6df6
654 Y 3:125c9a1d6df6
655 * Z 3:125c9a1d6df6
655 * Z 3:125c9a1d6df6
656 x y 2:db815d6d32e6
656 x y 2:db815d6d32e6
657 $ echo "Ican'thasformatedlines" >> .hg/bookmarks
657 $ echo "Ican'thasformatedlines" >> .hg/bookmarks
658 $ hg bookmarks
658 $ hg bookmarks
659 malformed line in .hg/bookmarks: "Ican'thasformatedlines"
659 malformed line in .hg/bookmarks: "Ican'thasformatedlines"
660 X2 1:925d80f479bb
660 X2 1:925d80f479bb
661 Y 3:125c9a1d6df6
661 Y 3:125c9a1d6df6
662 * Z 3:125c9a1d6df6
662 * Z 3:125c9a1d6df6
663 x y 2:db815d6d32e6
663 x y 2:db815d6d32e6
664
664
665 test missing revisions
665 test missing revisions
666
666
667 $ echo "925d80f479bc z" > .hg/bookmarks
667 $ echo "925d80f479bc z" > .hg/bookmarks
668 $ hg book
668 $ hg book
669 no bookmarks set
669 no bookmarks set
670
670
671 test stripping a non-checked-out but bookmarked revision
671 test stripping a non-checked-out but bookmarked revision
672
672
673 $ hg log --graph
673 $ hg log --graph
674 o changeset: 4:9ba5f110a0b3
674 o changeset: 4:9ba5f110a0b3
675 | branch: test
675 | branch: test
676 | tag: tip
676 | tag: tip
677 | parent: 2:db815d6d32e6
677 | parent: 2:db815d6d32e6
678 | user: test
678 | user: test
679 | date: Thu Jan 01 00:00:00 1970 +0000
679 | date: Thu Jan 01 00:00:00 1970 +0000
680 | summary: y
680 | summary: y
681 |
681 |
682 | @ changeset: 3:125c9a1d6df6
682 | @ changeset: 3:125c9a1d6df6
683 |/ user: test
683 |/ user: test
684 | date: Thu Jan 01 00:00:00 1970 +0000
684 | date: Thu Jan 01 00:00:00 1970 +0000
685 | summary: x
685 | summary: x
686 |
686 |
687 o changeset: 2:db815d6d32e6
687 o changeset: 2:db815d6d32e6
688 | parent: 0:f7b1eb17ad24
688 | parent: 0:f7b1eb17ad24
689 | user: test
689 | user: test
690 | date: Thu Jan 01 00:00:00 1970 +0000
690 | date: Thu Jan 01 00:00:00 1970 +0000
691 | summary: 2
691 | summary: 2
692 |
692 |
693 | o changeset: 1:925d80f479bb
693 | o changeset: 1:925d80f479bb
694 |/ user: test
694 |/ user: test
695 | date: Thu Jan 01 00:00:00 1970 +0000
695 | date: Thu Jan 01 00:00:00 1970 +0000
696 | summary: 1
696 | summary: 1
697 |
697 |
698 o changeset: 0:f7b1eb17ad24
698 o changeset: 0:f7b1eb17ad24
699 user: test
699 user: test
700 date: Thu Jan 01 00:00:00 1970 +0000
700 date: Thu Jan 01 00:00:00 1970 +0000
701 summary: 0
701 summary: 0
702
702
703 $ hg book should-end-on-two
703 $ hg book should-end-on-two
704 $ hg co --clean 4
704 $ hg co --clean 4
705 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
705 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
706 (leaving bookmark should-end-on-two)
706 (leaving bookmark should-end-on-two)
707 $ hg book four
707 $ hg book four
708 $ hg --config extensions.mq= strip 3
708 $ hg --config extensions.mq= strip 3
709 saved backup bundle to * (glob)
709 saved backup bundle to * (glob)
710 should-end-on-two should end up pointing to revision 2, as that's the
710 should-end-on-two should end up pointing to revision 2, as that's the
711 tipmost surviving ancestor of the stripped revision.
711 tipmost surviving ancestor of the stripped revision.
712 $ hg log --graph
712 $ hg log --graph
713 @ changeset: 3:9ba5f110a0b3
713 @ changeset: 3:9ba5f110a0b3
714 | branch: test
714 | branch: test
715 | bookmark: four
715 | bookmark: four
716 | tag: tip
716 | tag: tip
717 | user: test
717 | user: test
718 | date: Thu Jan 01 00:00:00 1970 +0000
718 | date: Thu Jan 01 00:00:00 1970 +0000
719 | summary: y
719 | summary: y
720 |
720 |
721 o changeset: 2:db815d6d32e6
721 o changeset: 2:db815d6d32e6
722 | bookmark: should-end-on-two
722 | bookmark: should-end-on-two
723 | parent: 0:f7b1eb17ad24
723 | parent: 0:f7b1eb17ad24
724 | user: test
724 | user: test
725 | date: Thu Jan 01 00:00:00 1970 +0000
725 | date: Thu Jan 01 00:00:00 1970 +0000
726 | summary: 2
726 | summary: 2
727 |
727 |
728 | o changeset: 1:925d80f479bb
728 | o changeset: 1:925d80f479bb
729 |/ user: test
729 |/ user: test
730 | date: Thu Jan 01 00:00:00 1970 +0000
730 | date: Thu Jan 01 00:00:00 1970 +0000
731 | summary: 1
731 | summary: 1
732 |
732 |
733 o changeset: 0:f7b1eb17ad24
733 o changeset: 0:f7b1eb17ad24
734 user: test
734 user: test
735 date: Thu Jan 01 00:00:00 1970 +0000
735 date: Thu Jan 01 00:00:00 1970 +0000
736 summary: 0
736 summary: 0
737
737
738 test non-linear update not clearing active bookmark
739
740 $ hg up 1
741 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
742 (leaving bookmark four)
743 $ hg book drop
744 $ hg up -C
745 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
746 (leaving bookmark drop)
747 1 other heads for branch "default"
748 $ hg sum
749 parent: 2:db815d6d32e6
750 2
751 branch: default
752 bookmarks: should-end-on-two
753 commit: 2 unknown (clean)
754 update: 1 new changesets, 2 branch heads (merge)
755 phases: 4 draft
756 $ hg book
757 drop 1:925d80f479bb
758 four 3:9ba5f110a0b3
759 should-end-on-two 2:db815d6d32e6
760 $ hg book -d drop
761 $ hg up four
762 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
763 (activating bookmark four)
764
738
765 no-op update doesn't deactive bookmarks
739 no-op update doesn't deactive bookmarks
766
740
741 $ hg up four
742 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
743 (activating bookmark four)
767 $ hg up
744 $ hg up
768 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
745 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 $ hg sum
746 $ hg sum
770 parent: 3:9ba5f110a0b3 tip
747 parent: 3:9ba5f110a0b3 tip
771 y
748 y
772 branch: test
749 branch: test
773 bookmarks: *four
750 bookmarks: *four
774 commit: 2 unknown (clean)
751 commit: 2 unknown (clean)
775 update: (current)
752 update: (current)
776 phases: 4 draft
753 phases: 4 draft
777
754
778 test clearing divergent bookmarks of linear ancestors
755 test clearing divergent bookmarks of linear ancestors
779
756
780 $ hg bookmark Z -r 0
757 $ hg bookmark Z -r 0
781 $ hg bookmark Z@1 -r 1
758 $ hg bookmark Z@1 -r 1
782 $ hg bookmark Z@2 -r 2
759 $ hg bookmark Z@2 -r 2
783 $ hg bookmark Z@3 -r 3
760 $ hg bookmark Z@3 -r 3
784 $ hg book
761 $ hg book
785 Z 0:f7b1eb17ad24
762 Z 0:f7b1eb17ad24
786 Z@1 1:925d80f479bb
763 Z@1 1:925d80f479bb
787 Z@2 2:db815d6d32e6
764 Z@2 2:db815d6d32e6
788 Z@3 3:9ba5f110a0b3
765 Z@3 3:9ba5f110a0b3
789 * four 3:9ba5f110a0b3
766 * four 3:9ba5f110a0b3
790 should-end-on-two 2:db815d6d32e6
767 should-end-on-two 2:db815d6d32e6
791 $ hg bookmark Z
768 $ hg bookmark Z
792 moving bookmark 'Z' forward from f7b1eb17ad24
769 moving bookmark 'Z' forward from f7b1eb17ad24
793 $ hg book
770 $ hg book
794 * Z 3:9ba5f110a0b3
771 * Z 3:9ba5f110a0b3
795 Z@1 1:925d80f479bb
772 Z@1 1:925d80f479bb
796 four 3:9ba5f110a0b3
773 four 3:9ba5f110a0b3
797 should-end-on-two 2:db815d6d32e6
774 should-end-on-two 2:db815d6d32e6
798
775
799 test clearing only a single divergent bookmark across branches
776 test clearing only a single divergent bookmark across branches
800
777
801 $ hg book foo -r 1
778 $ hg book foo -r 1
802 $ hg book foo@1 -r 0
779 $ hg book foo@1 -r 0
803 $ hg book foo@2 -r 2
780 $ hg book foo@2 -r 2
804 $ hg book foo@3 -r 3
781 $ hg book foo@3 -r 3
805 $ hg book foo -r foo@3
782 $ hg book foo -r foo@3
806 $ hg book
783 $ hg book
807 * Z 3:9ba5f110a0b3
784 * Z 3:9ba5f110a0b3
808 Z@1 1:925d80f479bb
785 Z@1 1:925d80f479bb
809 foo 3:9ba5f110a0b3
786 foo 3:9ba5f110a0b3
810 foo@1 0:f7b1eb17ad24
787 foo@1 0:f7b1eb17ad24
811 foo@2 2:db815d6d32e6
788 foo@2 2:db815d6d32e6
812 four 3:9ba5f110a0b3
789 four 3:9ba5f110a0b3
813 should-end-on-two 2:db815d6d32e6
790 should-end-on-two 2:db815d6d32e6
814
791
815 pull --update works the same as pull && update (case #2)
792 pull --update works the same as pull && update (case #2)
816
793
817 It is assumed that "hg pull" itself doesn't update current active
794 It is assumed that "hg pull" itself doesn't update current active
818 bookmark ('Y' in tests below).
795 bookmark ('Y' in tests below).
819
796
820 $ hg pull -q ../cloned-bookmarks-update
797 $ hg pull -q ../cloned-bookmarks-update
821 divergent bookmark Z stored as Z@2
798 divergent bookmark Z stored as Z@2
822
799
823 (pulling revision on another named branch with --update updates
800 (pulling revision on another named branch with --update updates
824 neither the working directory nor current active bookmark: "no-op"
801 neither the working directory nor current active bookmark: "no-op"
825 case)
802 case)
826
803
827 $ echo yy >> y
804 $ echo yy >> y
828 $ hg commit -m yy
805 $ hg commit -m yy
829
806
830 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
807 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
831 * Y 3:125c9a1d6df6
808 * Y 3:125c9a1d6df6
832 $ hg -R ../cloned-bookmarks-update pull . --update
809 $ hg -R ../cloned-bookmarks-update pull . --update
833 pulling from .
810 pulling from .
834 searching for changes
811 searching for changes
835 adding changesets
812 adding changesets
836 adding manifests
813 adding manifests
837 adding file changes
814 adding file changes
838 added 1 changesets with 1 changes to 1 files
815 added 1 changesets with 1 changes to 1 files
839 divergent bookmark Z stored as Z@default
816 divergent bookmark Z stored as Z@default
840 adding remote bookmark foo
817 adding remote bookmark foo
841 adding remote bookmark four
818 adding remote bookmark four
842 adding remote bookmark should-end-on-two
819 adding remote bookmark should-end-on-two
843 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
820 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
821 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
845 3:125c9a1d6df6
822 3:125c9a1d6df6
846 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
823 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
847 * Y 3:125c9a1d6df6
824 * Y 3:125c9a1d6df6
848
825
849 (pulling revision on current named/topological branch with --update
826 (pulling revision on current named/topological branch with --update
850 updates the working directory and current active bookmark)
827 updates the working directory and current active bookmark)
851
828
852 $ hg update -C -q 125c9a1d6df6
829 $ hg update -C -q 125c9a1d6df6
853 $ echo xx >> x
830 $ echo xx >> x
854 $ hg commit -m xx
831 $ hg commit -m xx
855
832
856 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
833 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
857 * Y 3:125c9a1d6df6
834 * Y 3:125c9a1d6df6
858 $ hg -R ../cloned-bookmarks-update pull . --update
835 $ hg -R ../cloned-bookmarks-update pull . --update
859 pulling from .
836 pulling from .
860 searching for changes
837 searching for changes
861 adding changesets
838 adding changesets
862 adding manifests
839 adding manifests
863 adding file changes
840 adding file changes
864 added 1 changesets with 1 changes to 1 files
841 added 1 changesets with 1 changes to 1 files
865 divergent bookmark Z stored as Z@default
842 divergent bookmark Z stored as Z@default
866 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
867 updating bookmark Y
844 updating bookmark Y
868 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
845 $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
869 6:81dcce76aa0b
846 6:81dcce76aa0b
870 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
847 $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
871 * Y 6:81dcce76aa0b
848 * Y 6:81dcce76aa0b
@@ -1,238 +1,238 b''
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 Inject corruption into the largefiles store and see how update handles that:
189 Inject corruption into the largefiles store and see how update handles that:
190
190
191 $ cd src
191 $ cd src
192 $ hg up -qC
192 $ hg up -qC tip
193 $ cat large
193 $ cat large
194 modified
194 modified
195 $ rm large
195 $ rm large
196 $ cat .hglf/large
196 $ cat .hglf/large
197 e2fb5f2139d086ded2cb600d5a91a196e76bf020
197 e2fb5f2139d086ded2cb600d5a91a196e76bf020
198 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
198 $ mv .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 ..
199 $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
199 $ echo corruption > .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
200 $ hg up -C
200 $ hg up -C
201 getting changed largefiles
201 getting changed largefiles
202 large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
202 large: data corruption in $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 with hash 6a7bb2556144babe3899b25e5428123735bb1e27 (glob)
203 0 largefiles updated, 0 removed
203 0 largefiles updated, 0 removed
204 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 2 other heads for branch "default"
205 2 other heads for branch "default"
206 $ hg st
206 $ hg st
207 ! large
207 ! large
208 ? z
208 ? z
209 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
209 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
210
210
211 #if serve
211 #if serve
212
212
213 Test coverage of error handling from putlfile:
213 Test coverage of error handling from putlfile:
214
214
215 $ mkdir $TESTTMP/mirrorcache
215 $ mkdir $TESTTMP/mirrorcache
216 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
216 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
217 $ cat hg.pid >> $DAEMON_PIDS
217 $ cat hg.pid >> $DAEMON_PIDS
218
218
219 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
219 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
220 pushing to http://localhost:$HGPORT1/
220 pushing to http://localhost:$HGPORT1/
221 searching for changes
221 searching for changes
222 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required
222 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required
223 [255]
223 [255]
224
224
225 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
225 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
226
226
227 Test coverage of 'missing from store':
227 Test coverage of 'missing from store':
228
228
229 $ 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
229 $ 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
230 $ cat hg.pid >> $DAEMON_PIDS
230 $ cat hg.pid >> $DAEMON_PIDS
231
231
232 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
232 $ hg push http://localhost:$HGPORT2 -f --config largefiles.usercache=nocache
233 pushing to http://localhost:$HGPORT2/
233 pushing to http://localhost:$HGPORT2/
234 searching for changes
234 searching for changes
235 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
235 abort: largefile e2fb5f2139d086ded2cb600d5a91a196e76bf020 missing from store (needs to be uploaded)
236 [255]
236 [255]
237
237
238 #endif
238 #endif
@@ -1,352 +1,352 b''
1 Criss cross merging
1 Criss cross merging
2
2
3 $ hg init criss-cross
3 $ hg init criss-cross
4 $ cd criss-cross
4 $ cd criss-cross
5 $ echo '0 base' > f1
5 $ echo '0 base' > f1
6 $ echo '0 base' > f2
6 $ echo '0 base' > f2
7 $ hg ci -Aqm '0 base'
7 $ hg ci -Aqm '0 base'
8
8
9 $ echo '1 first change' > f1
9 $ echo '1 first change' > f1
10 $ hg ci -m '1 first change f1'
10 $ hg ci -m '1 first change f1'
11
11
12 $ hg up -qr0
12 $ hg up -qr0
13 $ echo '2 first change' > f2
13 $ echo '2 first change' > f2
14 $ hg ci -qm '2 first change f2'
14 $ hg ci -qm '2 first change f2'
15
15
16 $ hg merge -qr 1
16 $ hg merge -qr 1
17 $ hg ci -m '3 merge'
17 $ hg ci -m '3 merge'
18
18
19 $ hg up -qr2
19 $ hg up -qr2
20 $ hg merge -qr1
20 $ hg merge -qr1
21 $ hg ci -qm '4 merge'
21 $ hg ci -qm '4 merge'
22
22
23 $ echo '5 second change' > f1
23 $ echo '5 second change' > f1
24 $ hg ci -m '5 second change f1'
24 $ hg ci -m '5 second change f1'
25
25
26 $ hg up -r3
26 $ hg up -r3
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ echo '6 second change' > f2
28 $ echo '6 second change' > f2
29 $ hg ci -m '6 second change f2'
29 $ hg ci -m '6 second change f2'
30
30
31 $ hg log -G
31 $ hg log -G
32 @ changeset: 6:3b08d01b0ab5
32 @ changeset: 6:3b08d01b0ab5
33 | tag: tip
33 | tag: tip
34 | parent: 3:cf89f02107e5
34 | parent: 3:cf89f02107e5
35 | user: test
35 | user: test
36 | date: Thu Jan 01 00:00:00 1970 +0000
36 | date: Thu Jan 01 00:00:00 1970 +0000
37 | summary: 6 second change f2
37 | summary: 6 second change f2
38 |
38 |
39 | o changeset: 5:adfe50279922
39 | o changeset: 5:adfe50279922
40 | | user: test
40 | | user: test
41 | | date: Thu Jan 01 00:00:00 1970 +0000
41 | | date: Thu Jan 01 00:00:00 1970 +0000
42 | | summary: 5 second change f1
42 | | summary: 5 second change f1
43 | |
43 | |
44 | o changeset: 4:7d3e55501ae6
44 | o changeset: 4:7d3e55501ae6
45 | |\ parent: 2:40663881a6dd
45 | |\ parent: 2:40663881a6dd
46 | | | parent: 1:0f6b37dbe527
46 | | | parent: 1:0f6b37dbe527
47 | | | user: test
47 | | | user: test
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
49 | | | summary: 4 merge
49 | | | summary: 4 merge
50 | | |
50 | | |
51 o---+ changeset: 3:cf89f02107e5
51 o---+ changeset: 3:cf89f02107e5
52 | | | parent: 2:40663881a6dd
52 | | | parent: 2:40663881a6dd
53 |/ / parent: 1:0f6b37dbe527
53 |/ / parent: 1:0f6b37dbe527
54 | | user: test
54 | | user: test
55 | | date: Thu Jan 01 00:00:00 1970 +0000
55 | | date: Thu Jan 01 00:00:00 1970 +0000
56 | | summary: 3 merge
56 | | summary: 3 merge
57 | |
57 | |
58 | o changeset: 2:40663881a6dd
58 | o changeset: 2:40663881a6dd
59 | | parent: 0:40494bf2444c
59 | | parent: 0:40494bf2444c
60 | | user: test
60 | | user: test
61 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | date: Thu Jan 01 00:00:00 1970 +0000
62 | | summary: 2 first change f2
62 | | summary: 2 first change f2
63 | |
63 | |
64 o | changeset: 1:0f6b37dbe527
64 o | changeset: 1:0f6b37dbe527
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: 1 first change f1
67 | summary: 1 first change f1
68 |
68 |
69 o changeset: 0:40494bf2444c
69 o changeset: 0:40494bf2444c
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
72 summary: 0 base
72 summary: 0 base
73
73
74
74
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
77 alternatively, use --config merge.preferancestor=40663881a6dd
77 alternatively, use --config merge.preferancestor=40663881a6dd
78 searching for copies back to rev 3
78 searching for copies back to rev 3
79 resolving manifests
79 resolving manifests
80 branchmerge: True, force: False, partial: False
80 branchmerge: True, force: False, partial: False
81 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
81 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
82 preserving f2 for resolve of f2
82 preserving f2 for resolve of f2
83 f1: remote is newer -> g
83 f1: remote is newer -> g
84 getting f1
84 getting f1
85 f2: versions differ -> m (premerge)
85 f2: versions differ -> m (premerge)
86 picked tool ':dump' for f2 (binary False symlink False changedelete False)
86 picked tool ':dump' for f2 (binary False symlink False changedelete False)
87 merging f2
87 merging f2
88 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
88 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
89 f2: versions differ -> m (merge)
89 f2: versions differ -> m (merge)
90 picked tool ':dump' for f2 (binary False symlink False changedelete False)
90 picked tool ':dump' for f2 (binary False symlink False changedelete False)
91 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
91 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
92 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
93 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
93 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
94 [1]
94 [1]
95
95
96 $ head *
96 $ head *
97 ==> f1 <==
97 ==> f1 <==
98 5 second change
98 5 second change
99
99
100 ==> f2 <==
100 ==> f2 <==
101 6 second change
101 6 second change
102
102
103 ==> f2.base <==
103 ==> f2.base <==
104 0 base
104 0 base
105
105
106 ==> f2.local <==
106 ==> f2.local <==
107 6 second change
107 6 second change
108
108
109 ==> f2.orig <==
109 ==> f2.orig <==
110 6 second change
110 6 second change
111
111
112 ==> f2.other <==
112 ==> f2.other <==
113 2 first change
113 2 first change
114
114
115 $ hg up -qC .
115 $ hg up -qC .
116 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
116 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
117 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
117 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
118 alternatively, use --config merge.preferancestor=0f6b37dbe527
118 alternatively, use --config merge.preferancestor=0f6b37dbe527
119 resolving manifests
119 resolving manifests
120 merging f1
120 merging f1
121 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
121 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
122 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
122 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
123 [1]
123 [1]
124
124
125 Redo merge with merge.preferancestor="*" to enable bid merge
125 Redo merge with merge.preferancestor="*" to enable bid merge
126
126
127 $ rm f*
127 $ rm f*
128 $ hg up -qC .
128 $ hg up -qC .
129 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
129 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
130 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
130 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
131
131
132 calculating bids for ancestor 0f6b37dbe527
132 calculating bids for ancestor 0f6b37dbe527
133 searching for copies back to rev 3
133 searching for copies back to rev 3
134 resolving manifests
134 resolving manifests
135 branchmerge: True, force: False, partial: False
135 branchmerge: True, force: False, partial: False
136 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
136 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
137 f1: remote is newer -> g
137 f1: remote is newer -> g
138 f2: versions differ -> m
138 f2: versions differ -> m
139
139
140 calculating bids for ancestor 40663881a6dd
140 calculating bids for ancestor 40663881a6dd
141 searching for copies back to rev 3
141 searching for copies back to rev 3
142 resolving manifests
142 resolving manifests
143 branchmerge: True, force: False, partial: False
143 branchmerge: True, force: False, partial: False
144 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
144 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
145 f1: versions differ -> m
145 f1: versions differ -> m
146 f2: remote unchanged -> k
146 f2: remote unchanged -> k
147
147
148 auction for merging merge bids
148 auction for merging merge bids
149 f1: picking 'get' action
149 f1: picking 'get' action
150 f2: picking 'keep' action
150 f2: picking 'keep' action
151 end of auction
151 end of auction
152
152
153 f1: remote is newer -> g
153 f1: remote is newer -> g
154 getting f1
154 getting f1
155 f2: remote unchanged -> k
155 f2: remote unchanged -> k
156 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 (branch merge, don't forget to commit)
157 (branch merge, don't forget to commit)
158
158
159 $ head *
159 $ head *
160 ==> f1 <==
160 ==> f1 <==
161 5 second change
161 5 second change
162
162
163 ==> f2 <==
163 ==> f2 <==
164 6 second change
164 6 second change
165
165
166
166
167 The other way around:
167 The other way around:
168
168
169 $ hg up -C -r5
169 $ hg up -C -r5
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 $ hg merge -v --debug --config merge.preferancestor="*"
171 $ hg merge -v --debug --config merge.preferancestor="*"
172 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
172 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
173
173
174 calculating bids for ancestor 0f6b37dbe527
174 calculating bids for ancestor 0f6b37dbe527
175 searching for copies back to rev 3
175 searching for copies back to rev 3
176 resolving manifests
176 resolving manifests
177 branchmerge: True, force: False, partial: False
177 branchmerge: True, force: False, partial: False
178 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
178 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
179 f1: remote unchanged -> k
179 f1: remote unchanged -> k
180 f2: versions differ -> m
180 f2: versions differ -> m
181
181
182 calculating bids for ancestor 40663881a6dd
182 calculating bids for ancestor 40663881a6dd
183 searching for copies back to rev 3
183 searching for copies back to rev 3
184 resolving manifests
184 resolving manifests
185 branchmerge: True, force: False, partial: False
185 branchmerge: True, force: False, partial: False
186 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
186 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
187 f1: versions differ -> m
187 f1: versions differ -> m
188 f2: remote is newer -> g
188 f2: remote is newer -> g
189
189
190 auction for merging merge bids
190 auction for merging merge bids
191 f1: picking 'keep' action
191 f1: picking 'keep' action
192 f2: picking 'get' action
192 f2: picking 'get' action
193 end of auction
193 end of auction
194
194
195 f2: remote is newer -> g
195 f2: remote is newer -> g
196 getting f2
196 getting f2
197 f1: remote unchanged -> k
197 f1: remote unchanged -> k
198 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
199 (branch merge, don't forget to commit)
199 (branch merge, don't forget to commit)
200
200
201 $ head *
201 $ head *
202 ==> f1 <==
202 ==> f1 <==
203 5 second change
203 5 second change
204
204
205 ==> f2 <==
205 ==> f2 <==
206 6 second change
206 6 second change
207
207
208 Verify how the output looks and and how verbose it is:
208 Verify how the output looks and and how verbose it is:
209
209
210 $ hg up -qC
210 $ hg up -qC
211 $ hg merge
211 $ hg merge
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
213 (branch merge, don't forget to commit)
213 (branch merge, don't forget to commit)
214
214
215 $ hg up -qC
215 $ hg up -qC tip
216 $ hg merge -v
216 $ hg merge -v
217 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
217 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
218
218
219 calculating bids for ancestor 0f6b37dbe527
219 calculating bids for ancestor 0f6b37dbe527
220 resolving manifests
220 resolving manifests
221
221
222 calculating bids for ancestor 40663881a6dd
222 calculating bids for ancestor 40663881a6dd
223 resolving manifests
223 resolving manifests
224
224
225 auction for merging merge bids
225 auction for merging merge bids
226 f1: picking 'get' action
226 f1: picking 'get' action
227 f2: picking 'keep' action
227 f2: picking 'keep' action
228 end of auction
228 end of auction
229
229
230 getting f1
230 getting f1
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 (branch merge, don't forget to commit)
232 (branch merge, don't forget to commit)
233
233
234 $ hg up -qC
234 $ hg up -qC
235 $ hg merge -v --debug --config merge.preferancestor="*"
235 $ hg merge -v --debug --config merge.preferancestor="*"
236 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
236 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
237
237
238 calculating bids for ancestor 0f6b37dbe527
238 calculating bids for ancestor 0f6b37dbe527
239 searching for copies back to rev 3
239 searching for copies back to rev 3
240 resolving manifests
240 resolving manifests
241 branchmerge: True, force: False, partial: False
241 branchmerge: True, force: False, partial: False
242 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
242 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
243 f1: remote is newer -> g
243 f1: remote is newer -> g
244 f2: versions differ -> m
244 f2: versions differ -> m
245
245
246 calculating bids for ancestor 40663881a6dd
246 calculating bids for ancestor 40663881a6dd
247 searching for copies back to rev 3
247 searching for copies back to rev 3
248 resolving manifests
248 resolving manifests
249 branchmerge: True, force: False, partial: False
249 branchmerge: True, force: False, partial: False
250 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
250 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
251 f1: versions differ -> m
251 f1: versions differ -> m
252 f2: remote unchanged -> k
252 f2: remote unchanged -> k
253
253
254 auction for merging merge bids
254 auction for merging merge bids
255 f1: picking 'get' action
255 f1: picking 'get' action
256 f2: picking 'keep' action
256 f2: picking 'keep' action
257 end of auction
257 end of auction
258
258
259 f1: remote is newer -> g
259 f1: remote is newer -> g
260 getting f1
260 getting f1
261 f2: remote unchanged -> k
261 f2: remote unchanged -> k
262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 (branch merge, don't forget to commit)
263 (branch merge, don't forget to commit)
264
264
265 $ cd ..
265 $ cd ..
266
266
267 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
267 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
268
268
269 $ hg init ancestor-merging
269 $ hg init ancestor-merging
270 $ cd ancestor-merging
270 $ cd ancestor-merging
271 $ echo a > x
271 $ echo a > x
272 $ hg commit -A -m a x
272 $ hg commit -A -m a x
273 $ hg update -q 0
273 $ hg update -q 0
274 $ echo b >> x
274 $ echo b >> x
275 $ hg commit -m b
275 $ hg commit -m b
276 $ hg update -q 0
276 $ hg update -q 0
277 $ echo c >> x
277 $ echo c >> x
278 $ hg commit -qm c
278 $ hg commit -qm c
279 $ hg update -q 1
279 $ hg update -q 1
280 $ hg merge -q --tool internal:local 2
280 $ hg merge -q --tool internal:local 2
281 $ echo c >> x
281 $ echo c >> x
282 $ hg commit -m bc
282 $ hg commit -m bc
283 $ hg update -q 2
283 $ hg update -q 2
284 $ hg merge -q --tool internal:local 1
284 $ hg merge -q --tool internal:local 1
285 $ echo b >> x
285 $ echo b >> x
286 $ hg commit -qm cb
286 $ hg commit -qm cb
287
287
288 $ hg merge --config merge.preferancestor='!'
288 $ hg merge --config merge.preferancestor='!'
289 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
289 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
290 alternatively, use --config merge.preferancestor=b211bbc6eb3c
290 alternatively, use --config merge.preferancestor=b211bbc6eb3c
291 merging x
291 merging x
292 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
292 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
293 (branch merge, don't forget to commit)
293 (branch merge, don't forget to commit)
294 $ cat x
294 $ cat x
295 a
295 a
296 c
296 c
297 b
297 b
298 c
298 c
299
299
300 $ hg up -qC .
300 $ hg up -qC .
301
301
302 $ hg merge --config merge.preferancestor=b211bbc6eb3c
302 $ hg merge --config merge.preferancestor=b211bbc6eb3c
303 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
303 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
304 alternatively, use --config merge.preferancestor=70008a2163f6
304 alternatively, use --config merge.preferancestor=70008a2163f6
305 merging x
305 merging x
306 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
306 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
307 (branch merge, don't forget to commit)
307 (branch merge, don't forget to commit)
308 $ cat x
308 $ cat x
309 a
309 a
310 b
310 b
311 c
311 c
312 b
312 b
313
313
314 $ hg up -qC .
314 $ hg up -qC .
315
315
316 $ hg merge -v --config merge.preferancestor="*"
316 $ hg merge -v --config merge.preferancestor="*"
317 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
317 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
318
318
319 calculating bids for ancestor 70008a2163f6
319 calculating bids for ancestor 70008a2163f6
320 resolving manifests
320 resolving manifests
321
321
322 calculating bids for ancestor b211bbc6eb3c
322 calculating bids for ancestor b211bbc6eb3c
323 resolving manifests
323 resolving manifests
324
324
325 auction for merging merge bids
325 auction for merging merge bids
326 x: multiple bids for merge action:
326 x: multiple bids for merge action:
327 versions differ -> m
327 versions differ -> m
328 versions differ -> m
328 versions differ -> m
329 x: ambiguous merge - picked m action
329 x: ambiguous merge - picked m action
330 end of auction
330 end of auction
331
331
332 merging x
332 merging x
333 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
333 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
334 (branch merge, don't forget to commit)
334 (branch merge, don't forget to commit)
335 $ cat x
335 $ cat x
336 a
336 a
337 c
337 c
338 b
338 b
339 c
339 c
340
340
341 Verify that the old context ancestor works with / despite preferancestor:
341 Verify that the old context ancestor works with / despite preferancestor:
342
342
343 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
343 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
344 1
344 1
345 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
345 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
346 2
346 2
347 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
347 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
348 1
348 1
349 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
349 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
350 2
350 2
351
351
352 $ cd ..
352 $ cd ..
@@ -1,41 +1,36 b''
1 $ hg init
1 $ hg init
2 $ echo This is file a1 > a
2 $ echo This is file a1 > a
3 $ echo This is file b1 > b
3 $ echo This is file b1 > b
4 $ hg add a b
4 $ hg add a b
5 $ hg commit -m "commit #0"
5 $ hg commit -m "commit #0"
6 $ echo This is file b22 > b
6 $ echo This is file b22 > b
7 $ hg commit -m "comment #1"
7 $ hg commit -m "comment #1"
8 $ hg update 0
8 $ hg update 0
9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10 $ rm b
10 $ rm b
11 $ hg commit -A -m "comment #2"
11 $ hg commit -A -m "comment #2"
12 removing b
12 removing b
13 created new head
13 created new head
14 $ hg update 1
14 $ hg update 1
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ hg update
17 abort: not a linear update
18 (merge or update --check to force update)
19 [255]
20 $ rm b
16 $ rm b
21 $ hg update -c
17 $ hg update -c 2
22 abort: uncommitted changes
18 abort: uncommitted changes
23 [255]
19 [255]
24 $ hg revert b
20 $ hg revert b
25 $ hg update -c
21 $ hg update -c 2
26 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 1 other heads for branch "default"
28 $ mv a c
23 $ mv a c
29
24
30 Should abort:
25 Should abort:
31
26
32 $ hg update 1
27 $ hg update 1
33 abort: uncommitted changes
28 abort: uncommitted changes
34 (commit or update --clean to discard changes)
29 (commit or update --clean to discard changes)
35 [255]
30 [255]
36 $ mv c a
31 $ mv c a
37
32
38 Should succeed:
33 Should succeed:
39
34
40 $ hg update 1
35 $ hg update 1
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1,66 +1,64 b''
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 not update:
19 Should not update to the other topological branch:
20
20
21 $ hg pull -u ../tt
21 $ hg pull -u ../tt
22 pulling from ../tt
22 pulling from ../tt
23 searching for changes
23 searching for changes
24 adding changesets
24 adding changesets
25 adding manifests
25 adding manifests
26 adding file changes
26 adding file changes
27 added 1 changesets with 1 changes to 1 files (+1 heads)
27 added 1 changesets with 1 changes to 1 files (+1 heads)
28 abort: not updating: not a linear update
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 (merge or update --check to force update)
29 1 other heads for branch "default"
30 [255]
31
30
32 $ cd ../tt
31 $ cd ../tt
33
32
34 Should not update:
33 Should not update to the other branch:
35
34
36 $ hg pull -u ../t
35 $ hg pull -u ../t
37 pulling from ../t
36 pulling from ../t
38 searching for changes
37 searching for changes
39 adding changesets
38 adding changesets
40 adding manifests
39 adding manifests
41 adding file changes
40 adding file changes
42 added 1 changesets with 1 changes to 1 files (+1 heads)
41 added 1 changesets with 1 changes to 1 files (+1 heads)
43 abort: not updating: not a linear update
42 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 (merge or update --check to force update)
43 1 other heads for branch "default"
45 [255]
46
44
47 $ HGMERGE=true hg merge
45 $ HGMERGE=true hg merge
48 merging foo
46 merging foo
49 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
47 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
50 (branch merge, don't forget to commit)
48 (branch merge, don't forget to commit)
51 $ hg ci -mm
49 $ hg ci -mm
52
50
53 $ cd ../t
51 $ cd ../t
54
52
55 Should work:
53 Should work:
56
54
57 $ hg pull -u ../tt
55 $ hg pull -u ../tt
58 pulling from ../tt
56 pulling from ../tt
59 searching for changes
57 searching for changes
60 adding changesets
58 adding changesets
61 adding manifests
59 adding manifests
62 adding file changes
60 adding file changes
63 added 1 changesets with 1 changes to 1 files (-1 heads)
61 added 1 changesets with 1 changes to 1 files (-1 heads)
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65
63
66 $ cd ..
64 $ cd ..
@@ -1,231 +1,230 b''
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 resolving manifests
70 resolving manifests
71 branchmerge: False, force: False, partial: False
71 branchmerge: False, force: False, partial: False
72 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
72 ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
73 preserving a for resolve of a
73 preserving a for resolve of a
74 b: other deleted -> r
74 b: other deleted -> r
75 removing b
75 removing b
76 a: versions differ -> m (premerge)
76 a: versions differ -> m (premerge)
77 picked tool 'true' for a (binary False symlink False changedelete False)
77 picked tool 'true' for a (binary False symlink False changedelete False)
78 merging a
78 merging a
79 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
79 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
80 a: versions differ -> m (merge)
80 a: versions differ -> m (merge)
81 picked tool 'true' for a (binary False symlink False changedelete False)
81 picked tool 'true' for a (binary False symlink False changedelete False)
82 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
82 my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
83 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
83 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
84 merge tool returned: 0
84 merge tool returned: 0
85 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
85 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
86 $ hg parents
86 $ hg parents
87 changeset: 0:c19d34741b0a
87 changeset: 0:c19d34741b0a
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 summary: 1
90 summary: 1
91
91
92 $ hg parents
92 $ hg parents
93 changeset: 0:c19d34741b0a
93 changeset: 0:c19d34741b0a
94 user: test
94 user: test
95 date: Thu Jan 01 00:00:00 1970 +0000
95 date: Thu Jan 01 00:00:00 1970 +0000
96 summary: 1
96 summary: 1
97
97
98 $ hg --debug up
98 $ hg --debug up
99 searching for copies back to rev 1
99 searching for copies back to rev 1
100 unmatched files in other:
100 unmatched files in other:
101 b
101 b
102 resolving manifests
102 resolving manifests
103 branchmerge: False, force: False, partial: False
103 branchmerge: False, force: False, partial: False
104 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
104 ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
105 preserving a for resolve of a
105 preserving a for resolve of a
106 b: remote created -> g
106 b: remote created -> g
107 getting b
107 getting b
108 a: versions differ -> m (premerge)
108 a: versions differ -> m (premerge)
109 picked tool 'true' for a (binary False symlink False changedelete False)
109 picked tool 'true' for a (binary False symlink False changedelete False)
110 merging a
110 merging a
111 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
111 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
112 a: versions differ -> m (merge)
112 a: versions differ -> m (merge)
113 picked tool 'true' for a (binary False symlink False changedelete False)
113 picked tool 'true' for a (binary False symlink False changedelete False)
114 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
114 my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
115 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
115 launching merge tool: true *$TESTTMP/r2/a* * * (glob)
116 merge tool returned: 0
116 merge tool returned: 0
117 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
117 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
118 $ hg parents
118 $ hg parents
119 changeset: 1:1e71731e6fbb
119 changeset: 1:1e71731e6fbb
120 tag: tip
120 tag: tip
121 user: test
121 user: test
122 date: Thu Jan 01 00:00:00 1970 +0000
122 date: Thu Jan 01 00:00:00 1970 +0000
123 summary: 2
123 summary: 2
124
124
125 $ hg -v history
125 $ hg -v history
126 changeset: 1:1e71731e6fbb
126 changeset: 1:1e71731e6fbb
127 tag: tip
127 tag: tip
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:00 1970 +0000
129 date: Thu Jan 01 00:00:00 1970 +0000
130 files: a b
130 files: a b
131 description:
131 description:
132 2
132 2
133
133
134
134
135 changeset: 0:c19d34741b0a
135 changeset: 0:c19d34741b0a
136 user: test
136 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
137 date: Thu Jan 01 00:00:00 1970 +0000
138 files: a
138 files: a
139 description:
139 description:
140 1
140 1
141
141
142
142
143 $ hg diff --nodates
143 $ hg diff --nodates
144 diff -r 1e71731e6fbb a
144 diff -r 1e71731e6fbb a
145 --- a/a
145 --- a/a
146 +++ b/a
146 +++ b/a
147 @@ -1,1 +1,1 @@
147 @@ -1,1 +1,1 @@
148 -a2
148 -a2
149 +abc
149 +abc
150
150
151
151
152 create a second head
152 create a second head
153
153
154 $ cd ../r1
154 $ cd ../r1
155 $ hg up 0
155 $ hg up 0
156 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
157 $ echo b2 > b
157 $ echo b2 > b
158 $ echo a3 > a
158 $ echo a3 > a
159 $ hg addremove
159 $ hg addremove
160 adding b
160 adding b
161 $ hg commit -m "3"
161 $ hg commit -m "3"
162 created new head
162 created new head
163
163
164 $ cd ../r2
164 $ cd ../r2
165 $ hg -q pull ../r1
165 $ hg -q pull ../r1
166 $ hg status
166 $ hg status
167 M a
167 M a
168 $ hg parents
168 $ hg parents
169 changeset: 1:1e71731e6fbb
169 changeset: 1:1e71731e6fbb
170 user: test
170 user: test
171 date: Thu Jan 01 00:00:00 1970 +0000
171 date: Thu Jan 01 00:00:00 1970 +0000
172 summary: 2
172 summary: 2
173
173
174 $ hg --debug up
174 $ hg --debug up
175 abort: uncommitted changes
175 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 (commit and merge, or update --clean to discard changes)
176 1 other heads for branch "default"
177 [255]
178
177
179 test conflicting untracked files
178 test conflicting untracked files
180
179
181 $ hg up -qC 0
180 $ hg up -qC 0
182 $ echo untracked > b
181 $ echo untracked > b
183 $ hg st
182 $ hg st
184 ? b
183 ? b
185 $ hg up 1
184 $ hg up 1
186 b: untracked file differs
185 b: untracked file differs
187 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
188 [255]
187 [255]
189 $ rm b
188 $ rm b
190
189
191 test conflicting untracked ignored file
190 test conflicting untracked ignored file
192
191
193 $ hg up -qC 0
192 $ hg up -qC 0
194 $ echo ignored > .hgignore
193 $ echo ignored > .hgignore
195 $ hg add .hgignore
194 $ hg add .hgignore
196 $ hg ci -m 'add .hgignore'
195 $ hg ci -m 'add .hgignore'
197 created new head
196 created new head
198 $ echo ignored > ignored
197 $ echo ignored > ignored
199 $ hg add ignored
198 $ hg add ignored
200 $ hg ci -m 'add ignored file'
199 $ hg ci -m 'add ignored file'
201
200
202 $ hg up -q 'desc("add .hgignore")'
201 $ hg up -q 'desc("add .hgignore")'
203 $ echo untracked > ignored
202 $ echo untracked > ignored
204 $ hg st
203 $ hg st
205 $ hg up 'desc("add ignored file")'
204 $ hg up 'desc("add ignored file")'
206 ignored: untracked file differs
205 ignored: untracked file differs
207 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
208 [255]
207 [255]
209
208
210 test a local add
209 test a local add
211
210
212 $ cd ..
211 $ cd ..
213 $ hg init a
212 $ hg init a
214 $ hg init b
213 $ hg init b
215 $ echo a > a/a
214 $ echo a > a/a
216 $ echo a > b/a
215 $ echo a > b/a
217 $ hg --cwd a commit -A -m a
216 $ hg --cwd a commit -A -m a
218 adding a
217 adding a
219 $ cd b
218 $ cd b
220 $ hg add a
219 $ hg add a
221 $ hg pull -u ../a
220 $ hg pull -u ../a
222 pulling from ../a
221 pulling from ../a
223 requesting all changes
222 requesting all changes
224 adding changesets
223 adding changesets
225 adding manifests
224 adding manifests
226 adding file changes
225 adding file changes
227 added 1 changesets with 1 changes to 1 files
226 added 1 changesets with 1 changes to 1 files
228 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
229 $ hg st
228 $ hg st
230
229
231 $ cd ..
230 $ cd ..
@@ -1,268 +1,268 b''
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 abort: not a linear update
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 (merge or update --check to force update)
97 1 other heads for branch "default"
98 parent=2
98 parent=2
99
99
100
100
101 $ revtest 'none clean linear' clean 1 2
101 $ revtest 'none clean linear' clean 1 2
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 parent=2
103 parent=2
104
104
105 $ revtest 'none clean same' clean 2 3
105 $ revtest 'none clean same' clean 2 3
106 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
107 parent=3
107 parent=3
108
108
109 $ revtest 'none clean cross' clean 3 4
109 $ revtest 'none clean cross' clean 3 4
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 parent=4
111 parent=4
112
112
113
113
114 $ revtest 'none dirty linear' dirty 1 2
114 $ revtest 'none dirty linear' dirty 1 2
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 parent=2
116 parent=2
117 M foo
117 M foo
118
118
119 $ revtest 'none dirtysub linear' dirtysub 1 2
119 $ revtest 'none dirtysub linear' dirtysub 1 2
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 parent=2
121 parent=2
122 M sub/suba
122 M sub/suba
123
123
124 $ revtest 'none dirty same' dirty 2 3
124 $ revtest 'none dirty same' dirty 2 3
125 abort: uncommitted changes
125 abort: uncommitted changes
126 (commit or update --clean to discard changes)
126 (commit or update --clean to discard changes)
127 parent=2
127 parent=2
128 M foo
128 M foo
129
129
130 $ revtest 'none dirtysub same' dirtysub 2 3
130 $ revtest 'none dirtysub same' dirtysub 2 3
131 abort: uncommitted changes
131 abort: uncommitted changes
132 (commit or update --clean to discard changes)
132 (commit or update --clean to discard changes)
133 parent=2
133 parent=2
134 M sub/suba
134 M sub/suba
135
135
136 $ revtest 'none dirty cross' dirty 3 4
136 $ revtest 'none dirty cross' dirty 3 4
137 abort: uncommitted changes
137 abort: uncommitted changes
138 (commit or update --clean to discard changes)
138 (commit or update --clean to discard changes)
139 parent=3
139 parent=3
140 M foo
140 M foo
141
141
142 $ norevtest 'none dirty cross' dirty 2
142 $ norevtest 'none dirty cross' dirty 2
143 abort: uncommitted changes
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 (commit and merge, or update --clean to discard changes)
144 1 other heads for branch "default"
145 parent=2
145 parent=2
146 M foo
146 M foo
147
147
148 $ revtest 'none dirtysub cross' dirtysub 3 4
148 $ revtest 'none dirtysub cross' dirtysub 3 4
149 abort: uncommitted changes
149 abort: uncommitted changes
150 (commit or update --clean to discard changes)
150 (commit or update --clean to discard changes)
151 parent=3
151 parent=3
152 M sub/suba
152 M sub/suba
153
153
154 $ revtest '-C dirty linear' dirty 1 2 -C
154 $ revtest '-C dirty linear' dirty 1 2 -C
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 parent=2
156 parent=2
157
157
158 $ revtest '-c dirty linear' dirty 1 2 -c
158 $ revtest '-c dirty linear' dirty 1 2 -c
159 abort: uncommitted changes
159 abort: uncommitted changes
160 parent=1
160 parent=1
161 M foo
161 M foo
162
162
163 $ revtest '-c dirtysub linear' dirtysub 1 2 -c
163 $ revtest '-c dirtysub linear' dirtysub 1 2 -c
164 abort: uncommitted changes in subrepository 'sub'
164 abort: uncommitted changes in subrepository 'sub'
165 parent=1
165 parent=1
166 M sub/suba
166 M sub/suba
167
167
168 $ norevtest '-c clean same' clean 2 -c
168 $ norevtest '-c clean same' clean 2 -c
169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 1 other heads for branch "default"
170 1 other heads for branch "default"
171 parent=3
171 parent=2
172
172
173 $ revtest '-cC dirty linear' dirty 1 2 -cC
173 $ revtest '-cC dirty linear' dirty 1 2 -cC
174 abort: cannot specify both -c/--check and -C/--clean
174 abort: cannot specify both -c/--check and -C/--clean
175 parent=1
175 parent=1
176 M foo
176 M foo
177
177
178 Test obsolescence behavior
178 Test obsolescence behavior
179 ---------------------------------------------------------------------
179 ---------------------------------------------------------------------
180
180
181 successors should be taken in account when checking head destination
181 successors should be taken in account when checking head destination
182
182
183 $ cat << EOF >> $HGRCPATH
183 $ cat << EOF >> $HGRCPATH
184 > [ui]
184 > [ui]
185 > logtemplate={rev}:{node|short} {desc|firstline}
185 > logtemplate={rev}:{node|short} {desc|firstline}
186 > [experimental]
186 > [experimental]
187 > evolution=createmarkers
187 > evolution=createmarkers
188 > EOF
188 > EOF
189
189
190 Test no-argument update to a successor of an obsoleted changeset
190 Test no-argument update to a successor of an obsoleted changeset
191
191
192 $ hg log -G
192 $ hg log -G
193 o 5:ff252e8273df 5
193 o 5:ff252e8273df 5
194 |
194 |
195 o 4:d047485b3896 4
195 o 4:d047485b3896 4
196 |
196 |
197 | o 3:6efa171f091b 3
197 | o 3:6efa171f091b 3
198 | |
198 | |
199 | | o 2:bd10386d478c 2
199 | | o 2:bd10386d478c 2
200 | |/
200 | |/
201 | @ 1:0786582aa4b1 1
201 | @ 1:0786582aa4b1 1
202 |/
202 |/
203 o 0:60829823a42a 0
203 o 0:60829823a42a 0
204
204
205 $ hg book bm -r 3
205 $ hg book bm -r 3
206 $ hg status
206 $ hg status
207 M foo
207 M foo
208
208
209 We add simple obsolescence marker between 3 and 4 (indirect successors)
209 We add simple obsolescence marker between 3 and 4 (indirect successors)
210
210
211 $ hg id --debug -i -r 3
211 $ hg id --debug -i -r 3
212 6efa171f091b00a3c35edc15d48c52a498929953
212 6efa171f091b00a3c35edc15d48c52a498929953
213 $ hg id --debug -i -r 4
213 $ hg id --debug -i -r 4
214 d047485b3896813b2a624e86201983520f003206
214 d047485b3896813b2a624e86201983520f003206
215 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
215 $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
216 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
216 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206
217
217
218 Test that 5 is detected as a valid destination from 3 and also accepts moving
218 Test that 5 is detected as a valid destination from 3 and also accepts moving
219 the bookmark (issue4015)
219 the bookmark (issue4015)
220
220
221 $ hg up --quiet --hidden 3
221 $ hg up --quiet --hidden 3
222 $ hg up 5
222 $ hg up 5
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 $ hg book bm
224 $ hg book bm
225 moving bookmark 'bm' forward from 6efa171f091b
225 moving bookmark 'bm' forward from 6efa171f091b
226 $ hg bookmarks
226 $ hg bookmarks
227 * bm 5:ff252e8273df
227 * bm 5:ff252e8273df
228
228
229 Test that 4 is detected as the no-argument destination from 3 and also moves
229 Test that 4 is detected as the no-argument destination from 3 and also moves
230 the bookmark with it
230 the bookmark with it
231 $ hg up --quiet 0 # we should be able to update to 3 directly
231 $ hg up --quiet 0 # we should be able to update to 3 directly
232 $ hg up --quiet --hidden 3 # but not implemented yet.
232 $ hg up --quiet --hidden 3 # but not implemented yet.
233 $ hg book -f bm
233 $ hg book -f bm
234 $ hg up
234 $ hg up
235 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 updating bookmark bm
236 updating bookmark bm
237 $ hg book
237 $ hg book
238 * bm 4:d047485b3896
238 * bm 4:d047485b3896
239
239
240 Test that 5 is detected as a valid destination from 1
240 Test that 5 is detected as a valid destination from 1
241 $ hg up --quiet 0 # we should be able to update to 3 directly
241 $ hg up --quiet 0 # we should be able to update to 3 directly
242 $ hg up --quiet --hidden 3 # but not implemented yet.
242 $ hg up --quiet --hidden 3 # but not implemented yet.
243 $ hg up 5
243 $ hg up 5
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245
245
246 Test that 5 is not detected as a valid destination from 2
246 Test that 5 is not detected as a valid destination from 2
247 $ hg up --quiet 0
247 $ hg up --quiet 0
248 $ hg up --quiet 2
248 $ hg up --quiet 2
249 $ hg up 5
249 $ hg up 5
250 abort: uncommitted changes
250 abort: uncommitted changes
251 (commit or update --clean to discard changes)
251 (commit or update --clean to discard changes)
252 [255]
252 [255]
253
253
254 Test that we don't crash when updating from a pruned changeset (i.e. has no
254 Test that we don't crash when updating from a pruned changeset (i.e. has no
255 successors). Behavior should probably be that we update to the first
255 successors). Behavior should probably be that we update to the first
256 non-obsolete parent but that will be decided later.
256 non-obsolete parent but that will be decided later.
257 $ hg id --debug -r 2
257 $ hg id --debug -r 2
258 bd10386d478cd5a9faf2e604114c8e6da62d3889
258 bd10386d478cd5a9faf2e604114c8e6da62d3889
259 $ hg up --quiet 0
259 $ hg up --quiet 0
260 $ hg up --quiet 2
260 $ hg up --quiet 2
261 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
261 $ hg debugobsolete bd10386d478cd5a9faf2e604114c8e6da62d3889
262 $ hg up
262 $ hg up
263 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
264
264
265 Test experimental revset support
265 Test experimental revset support
266
266
267 $ hg log -r '_destupdate()'
267 $ hg log -r '_destupdate()'
268 2:bd10386d478c 2 (no-eol)
268 2:bd10386d478c 2 (no-eol)
General Comments 0
You need to be logged in to leave comments. Login now