##// END OF EJS Templates
clfilter: use filtering in `visibleheads`...
Pierre-Yves David -
r18104:a2cebd3e default
parent child Browse files
Show More
@@ -1,358 +1,346 b''
1 # discovery.py - protocol changeset discovery functions
1 # discovery.py - protocol changeset discovery functions
2 #
2 #
3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
3 # Copyright 2010 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from node import nullid, short
8 from node import nullid, short
9 from i18n import _
9 from i18n import _
10 import util, setdiscovery, treediscovery, phases, obsolete, bookmarks
10 import util, setdiscovery, treediscovery, phases, obsolete, bookmarks
11
11
12 def findcommonincoming(repo, remote, heads=None, force=False):
12 def findcommonincoming(repo, remote, heads=None, force=False):
13 """Return a tuple (common, anyincoming, heads) used to identify the common
13 """Return a tuple (common, anyincoming, heads) used to identify the common
14 subset of nodes between repo and remote.
14 subset of nodes between repo and remote.
15
15
16 "common" is a list of (at least) the heads of the common subset.
16 "common" is a list of (at least) the heads of the common subset.
17 "anyincoming" is testable as a boolean indicating if any nodes are missing
17 "anyincoming" is testable as a boolean indicating if any nodes are missing
18 locally. If remote does not support getbundle, this actually is a list of
18 locally. If remote does not support getbundle, this actually is a list of
19 roots of the nodes that would be incoming, to be supplied to
19 roots of the nodes that would be incoming, to be supplied to
20 changegroupsubset. No code except for pull should be relying on this fact
20 changegroupsubset. No code except for pull should be relying on this fact
21 any longer.
21 any longer.
22 "heads" is either the supplied heads, or else the remote's heads.
22 "heads" is either the supplied heads, or else the remote's heads.
23
23
24 If you pass heads and they are all known locally, the response lists just
24 If you pass heads and they are all known locally, the response lists just
25 these heads in "common" and in "heads".
25 these heads in "common" and in "heads".
26
26
27 Please use findcommonoutgoing to compute the set of outgoing nodes to give
27 Please use findcommonoutgoing to compute the set of outgoing nodes to give
28 extensions a good hook into outgoing.
28 extensions a good hook into outgoing.
29 """
29 """
30
30
31 if not remote.capable('getbundle'):
31 if not remote.capable('getbundle'):
32 return treediscovery.findcommonincoming(repo, remote, heads, force)
32 return treediscovery.findcommonincoming(repo, remote, heads, force)
33
33
34 if heads:
34 if heads:
35 allknown = True
35 allknown = True
36 nm = repo.changelog.nodemap
36 nm = repo.changelog.nodemap
37 for h in heads:
37 for h in heads:
38 if nm.get(h) is None:
38 if nm.get(h) is None:
39 allknown = False
39 allknown = False
40 break
40 break
41 if allknown:
41 if allknown:
42 return (heads, False, heads)
42 return (heads, False, heads)
43
43
44 res = setdiscovery.findcommonheads(repo.ui, repo, remote,
44 res = setdiscovery.findcommonheads(repo.ui, repo, remote,
45 abortwhenunrelated=not force)
45 abortwhenunrelated=not force)
46 common, anyinc, srvheads = res
46 common, anyinc, srvheads = res
47 return (list(common), anyinc, heads or list(srvheads))
47 return (list(common), anyinc, heads or list(srvheads))
48
48
49 class outgoing(object):
49 class outgoing(object):
50 '''Represents the set of nodes present in a local repo but not in a
50 '''Represents the set of nodes present in a local repo but not in a
51 (possibly) remote one.
51 (possibly) remote one.
52
52
53 Members:
53 Members:
54
54
55 missing is a list of all nodes present in local but not in remote.
55 missing is a list of all nodes present in local but not in remote.
56 common is a list of all nodes shared between the two repos.
56 common is a list of all nodes shared between the two repos.
57 excluded is the list of missing changeset that shouldn't be sent remotely.
57 excluded is the list of missing changeset that shouldn't be sent remotely.
58 missingheads is the list of heads of missing.
58 missingheads is the list of heads of missing.
59 commonheads is the list of heads of common.
59 commonheads is the list of heads of common.
60
60
61 The sets are computed on demand from the heads, unless provided upfront
61 The sets are computed on demand from the heads, unless provided upfront
62 by discovery.'''
62 by discovery.'''
63
63
64 def __init__(self, revlog, commonheads, missingheads):
64 def __init__(self, revlog, commonheads, missingheads):
65 self.commonheads = commonheads
65 self.commonheads = commonheads
66 self.missingheads = missingheads
66 self.missingheads = missingheads
67 self._revlog = revlog
67 self._revlog = revlog
68 self._common = None
68 self._common = None
69 self._missing = None
69 self._missing = None
70 self.excluded = []
70 self.excluded = []
71
71
72 def _computecommonmissing(self):
72 def _computecommonmissing(self):
73 sets = self._revlog.findcommonmissing(self.commonheads,
73 sets = self._revlog.findcommonmissing(self.commonheads,
74 self.missingheads)
74 self.missingheads)
75 self._common, self._missing = sets
75 self._common, self._missing = sets
76
76
77 @util.propertycache
77 @util.propertycache
78 def common(self):
78 def common(self):
79 if self._common is None:
79 if self._common is None:
80 self._computecommonmissing()
80 self._computecommonmissing()
81 return self._common
81 return self._common
82
82
83 @util.propertycache
83 @util.propertycache
84 def missing(self):
84 def missing(self):
85 if self._missing is None:
85 if self._missing is None:
86 self._computecommonmissing()
86 self._computecommonmissing()
87 return self._missing
87 return self._missing
88
88
89 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
89 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
90 commoninc=None, portable=False):
90 commoninc=None, portable=False):
91 '''Return an outgoing instance to identify the nodes present in repo but
91 '''Return an outgoing instance to identify the nodes present in repo but
92 not in other.
92 not in other.
93
93
94 If onlyheads is given, only nodes ancestral to nodes in onlyheads
94 If onlyheads is given, only nodes ancestral to nodes in onlyheads
95 (inclusive) are included. If you already know the local repo's heads,
95 (inclusive) are included. If you already know the local repo's heads,
96 passing them in onlyheads is faster than letting them be recomputed here.
96 passing them in onlyheads is faster than letting them be recomputed here.
97
97
98 If commoninc is given, it must be the result of a prior call to
98 If commoninc is given, it must be the result of a prior call to
99 findcommonincoming(repo, other, force) to avoid recomputing it here.
99 findcommonincoming(repo, other, force) to avoid recomputing it here.
100
100
101 If portable is given, compute more conservative common and missingheads,
101 If portable is given, compute more conservative common and missingheads,
102 to make bundles created from the instance more portable.'''
102 to make bundles created from the instance more portable.'''
103 # declare an empty outgoing object to be filled later
103 # declare an empty outgoing object to be filled later
104 og = outgoing(repo.changelog, None, None)
104 og = outgoing(repo.changelog, None, None)
105
105
106 # get common set if not provided
106 # get common set if not provided
107 if commoninc is None:
107 if commoninc is None:
108 commoninc = findcommonincoming(repo, other, force=force)
108 commoninc = findcommonincoming(repo, other, force=force)
109 og.commonheads, _any, _hds = commoninc
109 og.commonheads, _any, _hds = commoninc
110
110
111 # compute outgoing
111 # compute outgoing
112 mayexclude = (repo._phasecache.phaseroots[phases.secret] or repo.obsstore)
112 mayexclude = (repo._phasecache.phaseroots[phases.secret] or repo.obsstore)
113 if not mayexclude:
113 if not mayexclude:
114 og.missingheads = onlyheads or repo.heads()
114 og.missingheads = onlyheads or repo.heads()
115 elif onlyheads is None:
115 elif onlyheads is None:
116 # use visible heads as it should be cached
116 # use visible heads as it should be cached
117 og.missingheads = visibleheads(repo)
117 og.missingheads = visibleheads(repo)
118 og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
118 og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
119 else:
119 else:
120 # compute common, missing and exclude secret stuff
120 # compute common, missing and exclude secret stuff
121 sets = repo.changelog.findcommonmissing(og.commonheads, onlyheads)
121 sets = repo.changelog.findcommonmissing(og.commonheads, onlyheads)
122 og._common, allmissing = sets
122 og._common, allmissing = sets
123 og._missing = missing = []
123 og._missing = missing = []
124 og.excluded = excluded = []
124 og.excluded = excluded = []
125 for node in allmissing:
125 for node in allmissing:
126 ctx = repo[node]
126 ctx = repo[node]
127 if ctx.phase() >= phases.secret or ctx.extinct():
127 if ctx.phase() >= phases.secret or ctx.extinct():
128 excluded.append(node)
128 excluded.append(node)
129 else:
129 else:
130 missing.append(node)
130 missing.append(node)
131 if len(missing) == len(allmissing):
131 if len(missing) == len(allmissing):
132 missingheads = onlyheads
132 missingheads = onlyheads
133 else: # update missing heads
133 else: # update missing heads
134 missingheads = phases.newheads(repo, onlyheads, excluded)
134 missingheads = phases.newheads(repo, onlyheads, excluded)
135 og.missingheads = missingheads
135 og.missingheads = missingheads
136 if portable:
136 if portable:
137 # recompute common and missingheads as if -r<rev> had been given for
137 # recompute common and missingheads as if -r<rev> had been given for
138 # each head of missing, and --base <rev> for each head of the proper
138 # each head of missing, and --base <rev> for each head of the proper
139 # ancestors of missing
139 # ancestors of missing
140 og._computecommonmissing()
140 og._computecommonmissing()
141 cl = repo.changelog
141 cl = repo.changelog
142 missingrevs = set(cl.rev(n) for n in og._missing)
142 missingrevs = set(cl.rev(n) for n in og._missing)
143 og._common = set(cl.ancestors(missingrevs)) - missingrevs
143 og._common = set(cl.ancestors(missingrevs)) - missingrevs
144 commonheads = set(og.commonheads)
144 commonheads = set(og.commonheads)
145 og.missingheads = [h for h in og.missingheads if h not in commonheads]
145 og.missingheads = [h for h in og.missingheads if h not in commonheads]
146
146
147 return og
147 return og
148
148
149 def _headssummary(repo, remote, outgoing):
149 def _headssummary(repo, remote, outgoing):
150 """compute a summary of branch and heads status before and after push
150 """compute a summary of branch and heads status before and after push
151
151
152 return {'branch': ([remoteheads], [newheads], [unsyncedheads])} mapping
152 return {'branch': ([remoteheads], [newheads], [unsyncedheads])} mapping
153
153
154 - branch: the branch name
154 - branch: the branch name
155 - remoteheads: the list of remote heads known locally
155 - remoteheads: the list of remote heads known locally
156 None is the branch is new
156 None is the branch is new
157 - newheads: the new remote heads (known locally) with outgoing pushed
157 - newheads: the new remote heads (known locally) with outgoing pushed
158 - unsyncedheads: the list of remote heads unknown locally.
158 - unsyncedheads: the list of remote heads unknown locally.
159 """
159 """
160 cl = repo.changelog
160 cl = repo.changelog
161 headssum = {}
161 headssum = {}
162 # A. Create set of branches involved in the push.
162 # A. Create set of branches involved in the push.
163 branches = set(repo[n].branch() for n in outgoing.missing)
163 branches = set(repo[n].branch() for n in outgoing.missing)
164 remotemap = remote.branchmap()
164 remotemap = remote.branchmap()
165 newbranches = branches - set(remotemap)
165 newbranches = branches - set(remotemap)
166 branches.difference_update(newbranches)
166 branches.difference_update(newbranches)
167
167
168 # A. register remote heads
168 # A. register remote heads
169 remotebranches = set()
169 remotebranches = set()
170 for branch, heads in remote.branchmap().iteritems():
170 for branch, heads in remote.branchmap().iteritems():
171 remotebranches.add(branch)
171 remotebranches.add(branch)
172 known = []
172 known = []
173 unsynced = []
173 unsynced = []
174 for h in heads:
174 for h in heads:
175 if h in cl.nodemap:
175 if h in cl.nodemap:
176 known.append(h)
176 known.append(h)
177 else:
177 else:
178 unsynced.append(h)
178 unsynced.append(h)
179 headssum[branch] = (known, list(known), unsynced)
179 headssum[branch] = (known, list(known), unsynced)
180 # B. add new branch data
180 # B. add new branch data
181 missingctx = list(repo[n] for n in outgoing.missing)
181 missingctx = list(repo[n] for n in outgoing.missing)
182 touchedbranches = set()
182 touchedbranches = set()
183 for ctx in missingctx:
183 for ctx in missingctx:
184 branch = ctx.branch()
184 branch = ctx.branch()
185 touchedbranches.add(branch)
185 touchedbranches.add(branch)
186 if branch not in headssum:
186 if branch not in headssum:
187 headssum[branch] = (None, [], [])
187 headssum[branch] = (None, [], [])
188
188
189 # C drop data about untouched branches:
189 # C drop data about untouched branches:
190 for branch in remotebranches - touchedbranches:
190 for branch in remotebranches - touchedbranches:
191 del headssum[branch]
191 del headssum[branch]
192
192
193 # D. Update newmap with outgoing changes.
193 # D. Update newmap with outgoing changes.
194 # This will possibly add new heads and remove existing ones.
194 # This will possibly add new heads and remove existing ones.
195 newmap = dict((branch, heads[1]) for branch, heads in headssum.iteritems()
195 newmap = dict((branch, heads[1]) for branch, heads in headssum.iteritems()
196 if heads[0] is not None)
196 if heads[0] is not None)
197 repo._updatebranchcache(newmap, missingctx)
197 repo._updatebranchcache(newmap, missingctx)
198 for branch, newheads in newmap.iteritems():
198 for branch, newheads in newmap.iteritems():
199 headssum[branch][1][:] = newheads
199 headssum[branch][1][:] = newheads
200 return headssum
200 return headssum
201
201
202 def _oldheadssummary(repo, remoteheads, outgoing, inc=False):
202 def _oldheadssummary(repo, remoteheads, outgoing, inc=False):
203 """Compute branchmapsummary for repo without branchmap support"""
203 """Compute branchmapsummary for repo without branchmap support"""
204
204
205 cl = repo.changelog
205 cl = repo.changelog
206 # 1-4b. old servers: Check for new topological heads.
206 # 1-4b. old servers: Check for new topological heads.
207 # Construct {old,new}map with branch = None (topological branch).
207 # Construct {old,new}map with branch = None (topological branch).
208 # (code based on _updatebranchcache)
208 # (code based on _updatebranchcache)
209 oldheads = set(h for h in remoteheads if h in cl.nodemap)
209 oldheads = set(h for h in remoteheads if h in cl.nodemap)
210 # all nodes in outgoing.missing are children of either:
210 # all nodes in outgoing.missing are children of either:
211 # - an element of oldheads
211 # - an element of oldheads
212 # - another element of outgoing.missing
212 # - another element of outgoing.missing
213 # - nullrev
213 # - nullrev
214 # This explains why the new head are very simple to compute.
214 # This explains why the new head are very simple to compute.
215 r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
215 r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
216 newheads = list(c.node() for c in r)
216 newheads = list(c.node() for c in r)
217 unsynced = inc and set([None]) or set()
217 unsynced = inc and set([None]) or set()
218 return {None: (oldheads, newheads, unsynced)}
218 return {None: (oldheads, newheads, unsynced)}
219
219
220 def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False):
220 def checkheads(repo, remote, outgoing, remoteheads, newbranch=False, inc=False):
221 """Check that a push won't add any outgoing head
221 """Check that a push won't add any outgoing head
222
222
223 raise Abort error and display ui message as needed.
223 raise Abort error and display ui message as needed.
224 """
224 """
225 # Check for each named branch if we're creating new remote heads.
225 # Check for each named branch if we're creating new remote heads.
226 # To be a remote head after push, node must be either:
226 # To be a remote head after push, node must be either:
227 # - unknown locally
227 # - unknown locally
228 # - a local outgoing head descended from update
228 # - a local outgoing head descended from update
229 # - a remote head that's known locally and not
229 # - a remote head that's known locally and not
230 # ancestral to an outgoing head
230 # ancestral to an outgoing head
231 if remoteheads == [nullid]:
231 if remoteheads == [nullid]:
232 # remote is empty, nothing to check.
232 # remote is empty, nothing to check.
233 return
233 return
234
234
235 if remote.capable('branchmap'):
235 if remote.capable('branchmap'):
236 headssum = _headssummary(repo, remote, outgoing)
236 headssum = _headssummary(repo, remote, outgoing)
237 else:
237 else:
238 headssum = _oldheadssummary(repo, remoteheads, outgoing, inc)
238 headssum = _oldheadssummary(repo, remoteheads, outgoing, inc)
239 newbranches = [branch for branch, heads in headssum.iteritems()
239 newbranches = [branch for branch, heads in headssum.iteritems()
240 if heads[0] is None]
240 if heads[0] is None]
241 # 1. Check for new branches on the remote.
241 # 1. Check for new branches on the remote.
242 if newbranches and not newbranch: # new branch requires --new-branch
242 if newbranches and not newbranch: # new branch requires --new-branch
243 branchnames = ', '.join(sorted(newbranches))
243 branchnames = ', '.join(sorted(newbranches))
244 raise util.Abort(_("push creates new remote branches: %s!")
244 raise util.Abort(_("push creates new remote branches: %s!")
245 % branchnames,
245 % branchnames,
246 hint=_("use 'hg push --new-branch' to create"
246 hint=_("use 'hg push --new-branch' to create"
247 " new remote branches"))
247 " new remote branches"))
248
248
249 # 2 compute newly pushed bookmarks. We
249 # 2 compute newly pushed bookmarks. We
250 # we don't warned about bookmarked heads.
250 # we don't warned about bookmarked heads.
251 localbookmarks = repo._bookmarks
251 localbookmarks = repo._bookmarks
252 remotebookmarks = remote.listkeys('bookmarks')
252 remotebookmarks = remote.listkeys('bookmarks')
253 bookmarkedheads = set()
253 bookmarkedheads = set()
254 for bm in localbookmarks:
254 for bm in localbookmarks:
255 rnode = remotebookmarks.get(bm)
255 rnode = remotebookmarks.get(bm)
256 if rnode and rnode in repo:
256 if rnode and rnode in repo:
257 lctx, rctx = repo[bm], repo[rnode]
257 lctx, rctx = repo[bm], repo[rnode]
258 if bookmarks.validdest(repo, rctx, lctx):
258 if bookmarks.validdest(repo, rctx, lctx):
259 bookmarkedheads.add(lctx.node())
259 bookmarkedheads.add(lctx.node())
260
260
261 # 3. Check for new heads.
261 # 3. Check for new heads.
262 # If there are more heads after the push than before, a suitable
262 # If there are more heads after the push than before, a suitable
263 # error message, depending on unsynced status, is displayed.
263 # error message, depending on unsynced status, is displayed.
264 error = None
264 error = None
265 unsynced = False
265 unsynced = False
266 allmissing = set(outgoing.missing)
266 allmissing = set(outgoing.missing)
267 allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
267 allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
268 allfuturecommon.update(allmissing)
268 allfuturecommon.update(allmissing)
269 for branch, heads in headssum.iteritems():
269 for branch, heads in headssum.iteritems():
270 if heads[0] is None:
270 if heads[0] is None:
271 # Maybe we should abort if we push more that one head
271 # Maybe we should abort if we push more that one head
272 # for new branches ?
272 # for new branches ?
273 continue
273 continue
274 candidate_newhs = set(heads[1])
274 candidate_newhs = set(heads[1])
275 # add unsynced data
275 # add unsynced data
276 oldhs = set(heads[0])
276 oldhs = set(heads[0])
277 oldhs.update(heads[2])
277 oldhs.update(heads[2])
278 candidate_newhs.update(heads[2])
278 candidate_newhs.update(heads[2])
279 dhs = None
279 dhs = None
280 discardedheads = set()
280 discardedheads = set()
281 if repo.obsstore:
281 if repo.obsstore:
282 # remove future heads which are actually obsolete by another
282 # remove future heads which are actually obsolete by another
283 # pushed element:
283 # pushed element:
284 #
284 #
285 # XXX as above, There are several cases this case does not handle
285 # XXX as above, There are several cases this case does not handle
286 # XXX properly
286 # XXX properly
287 #
287 #
288 # (1) if <nh> is public, it won't be affected by obsolete marker
288 # (1) if <nh> is public, it won't be affected by obsolete marker
289 # and a new is created
289 # and a new is created
290 #
290 #
291 # (2) if the new heads have ancestors which are not obsolete and
291 # (2) if the new heads have ancestors which are not obsolete and
292 # not ancestors of any other heads we will have a new head too.
292 # not ancestors of any other heads we will have a new head too.
293 #
293 #
294 # This two case will be easy to handle for know changeset but much
294 # This two case will be easy to handle for know changeset but much
295 # more tricky for unsynced changes.
295 # more tricky for unsynced changes.
296 newhs = set()
296 newhs = set()
297 for nh in candidate_newhs:
297 for nh in candidate_newhs:
298 if nh in repo and repo[nh].phase() <= phases.public:
298 if nh in repo and repo[nh].phase() <= phases.public:
299 newhs.add(nh)
299 newhs.add(nh)
300 else:
300 else:
301 for suc in obsolete.allsuccessors(repo.obsstore, [nh]):
301 for suc in obsolete.allsuccessors(repo.obsstore, [nh]):
302 if suc != nh and suc in allfuturecommon:
302 if suc != nh and suc in allfuturecommon:
303 discardedheads.add(nh)
303 discardedheads.add(nh)
304 break
304 break
305 else:
305 else:
306 newhs.add(nh)
306 newhs.add(nh)
307 else:
307 else:
308 newhs = candidate_newhs
308 newhs = candidate_newhs
309 if [h for h in heads[2] if h not in discardedheads]:
309 if [h for h in heads[2] if h not in discardedheads]:
310 unsynced = True
310 unsynced = True
311 if len(newhs) > len(oldhs):
311 if len(newhs) > len(oldhs):
312 # strip updates to existing remote heads from the new heads list
312 # strip updates to existing remote heads from the new heads list
313 dhs = list(newhs - bookmarkedheads - oldhs)
313 dhs = list(newhs - bookmarkedheads - oldhs)
314 if dhs:
314 if dhs:
315 if error is None:
315 if error is None:
316 if branch not in ('default', None):
316 if branch not in ('default', None):
317 error = _("push creates new remote head %s "
317 error = _("push creates new remote head %s "
318 "on branch '%s'!") % (short(dhs[0]), branch)
318 "on branch '%s'!") % (short(dhs[0]), branch)
319 else:
319 else:
320 error = _("push creates new remote head %s!"
320 error = _("push creates new remote head %s!"
321 ) % short(dhs[0])
321 ) % short(dhs[0])
322 if heads[2]: # unsynced
322 if heads[2]: # unsynced
323 hint = _("you should pull and merge or "
323 hint = _("you should pull and merge or "
324 "use push -f to force")
324 "use push -f to force")
325 else:
325 else:
326 hint = _("did you forget to merge? "
326 hint = _("did you forget to merge? "
327 "use push -f to force")
327 "use push -f to force")
328 if branch is not None:
328 if branch is not None:
329 repo.ui.note(_("new remote heads on branch '%s'\n") % branch)
329 repo.ui.note(_("new remote heads on branch '%s'\n") % branch)
330 for h in dhs:
330 for h in dhs:
331 repo.ui.note(_("new remote head %s\n") % short(h))
331 repo.ui.note(_("new remote head %s\n") % short(h))
332 if error:
332 if error:
333 raise util.Abort(error, hint=hint)
333 raise util.Abort(error, hint=hint)
334
334
335 # 6. Check for unsynced changes on involved branches.
335 # 6. Check for unsynced changes on involved branches.
336 if unsynced:
336 if unsynced:
337 repo.ui.warn(_("note: unsynced remote changes!\n"))
337 repo.ui.warn(_("note: unsynced remote changes!\n"))
338
338
339 def visibleheads(repo):
339 def visibleheads(repo):
340 """return the set of visible head of this repo"""
340 """return the set of visible head of this repo"""
341 # XXX we want a cache on this
341 return repo.filtered('unserved').heads()
342 sroots = repo._phasecache.phaseroots[phases.secret]
343 if sroots or repo.obsstore:
344 # XXX very slow revset. storing heads or secret "boundary"
345 # would help.
346 revset = repo.set('heads(not (%ln:: + extinct()))', sroots)
347
348 vheads = [ctx.node() for ctx in revset]
349 if not vheads:
350 vheads.append(nullid)
351 else:
352 vheads = repo.heads()
353 return vheads
354
342
355
343
356 def visiblebranchmap(repo):
344 def visiblebranchmap(repo):
357 """return a branchmap for the visible set"""
345 """return a branchmap for the visible set"""
358 return repo.filtered('unserved').branchmap()
346 return repo.filtered('unserved').branchmap()
@@ -1,441 +1,441 b''
1 Test file dedicated to testing the divergent troubles from obsolete changeset.
1 Test file dedicated to testing the divergent troubles from obsolete changeset.
2
2
3 This is the most complexe troubles from far so we isolate it in a dedicated
3 This is the most complexe troubles from far so we isolate it in a dedicated
4 file.
4 file.
5
5
6 Enable obsolete
6 Enable obsolete
7
7
8 $ cat > obs.py << EOF
8 $ cat > obs.py << EOF
9 > import mercurial.obsolete
9 > import mercurial.obsolete
10 > mercurial.obsolete._enabled = True
10 > mercurial.obsolete._enabled = True
11 > EOF
11 > EOF
12 $ cat >> $HGRCPATH << EOF
12 $ cat >> $HGRCPATH << EOF
13 > [ui]
13 > [ui]
14 > logtemplate = {rev}:{node|short} {desc}\n
14 > logtemplate = {rev}:{node|short} {desc}\n
15 > [extensions]
15 > [extensions]
16 > obs=${TESTTMP}/obs.py
16 > obs=${TESTTMP}/obs.py
17 > [alias]
17 > [alias]
18 > debugobsolete = debugobsolete -d '0 0'
18 > debugobsolete = debugobsolete -d '0 0'
19 > [phases]
19 > [phases]
20 > publish=False
20 > publish=False
21 > EOF
21 > EOF
22
22
23
23
24 $ mkcommit() {
24 $ mkcommit() {
25 > echo "$1" > "$1"
25 > echo "$1" > "$1"
26 > hg add "$1"
26 > hg add "$1"
27 > hg ci -m "$1"
27 > hg ci -m "$1"
28 > }
28 > }
29 $ getid() {
29 $ getid() {
30 > hg id --debug -ir "desc('$1')"
30 > hg id --debug -ir "desc('$1')"
31 > }
31 > }
32
32
33 setup repo
33 setup repo
34
34
35 $ hg init reference
35 $ hg init reference
36 $ cd reference
36 $ cd reference
37 $ mkcommit base
37 $ mkcommit base
38 $ mkcommit A_0
38 $ mkcommit A_0
39 $ hg up 0
39 $ hg up 0
40 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
41 $ mkcommit A_1
41 $ mkcommit A_1
42 created new head
42 created new head
43 $ hg up 0
43 $ hg up 0
44 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
44 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
45 $ mkcommit A_2
45 $ mkcommit A_2
46 created new head
46 created new head
47 $ hg up 0
47 $ hg up 0
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
48 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
49 $ cd ..
49 $ cd ..
50
50
51
51
52 $ newcase() {
52 $ newcase() {
53 > hg clone -u 0 -q reference $1
53 > hg clone -u 0 -q reference $1
54 > cd $1
54 > cd $1
55 > }
55 > }
56
56
57 direct divergence
57 direct divergence
58 -----------------
58 -----------------
59
59
60 A_1 have two direct and divergent successors A_1 and A_1
60 A_1 have two direct and divergent successors A_1 and A_1
61
61
62 $ newcase direct
62 $ newcase direct
63 $ hg debugobsolete `getid A_0` `getid A_1`
63 $ hg debugobsolete `getid A_0` `getid A_1`
64 $ hg debugobsolete `getid A_0` `getid A_2`
64 $ hg debugobsolete `getid A_0` `getid A_2`
65 $ hg log -G --hidden
65 $ hg log -G --hidden
66 o 3:392fd25390da A_2
66 o 3:392fd25390da A_2
67 |
67 |
68 | o 2:82623d38b9ba A_1
68 | o 2:82623d38b9ba A_1
69 |/
69 |/
70 | x 1:007dc284c1f8 A_0
70 | x 1:007dc284c1f8 A_0
71 |/
71 |/
72 @ 0:d20a80d4def3 base
72 @ 0:d20a80d4def3 base
73
73
74 $ hg debugsuccessorssets 'all()'
74 $ hg debugsuccessorssets 'all()'
75 d20a80d4def3
75 d20a80d4def3
76 d20a80d4def3
76 d20a80d4def3
77 007dc284c1f8
77 007dc284c1f8
78 392fd25390da
78 392fd25390da
79 82623d38b9ba
79 82623d38b9ba
80 82623d38b9ba
80 82623d38b9ba
81 82623d38b9ba
81 82623d38b9ba
82 392fd25390da
82 392fd25390da
83 392fd25390da
83 392fd25390da
84 $ hg log -r 'divergent()'
84 $ hg log -r 'divergent()'
85 2:82623d38b9ba A_1
85 2:82623d38b9ba A_1
86 3:392fd25390da A_2
86 3:392fd25390da A_2
87
87
88 check that mercurial refuse to push
88 check that mercurial refuse to push
89
89
90 $ hg init ../other
90 $ hg init ../other
91 $ hg push ../other
91 $ hg push ../other
92 pushing to ../other
92 pushing to ../other
93 searching for changes
93 searching for changes
94 abort: push includes divergent changeset: 82623d38b9ba!
94 abort: push includes divergent changeset: 392fd25390da!
95 [255]
95 [255]
96
96
97 $ cd ..
97 $ cd ..
98
98
99
99
100 indirect divergence with known changeset
100 indirect divergence with known changeset
101 -------------------------------------------
101 -------------------------------------------
102
102
103 $ newcase indirect_known
103 $ newcase indirect_known
104 $ hg debugobsolete `getid A_0` `getid A_1`
104 $ hg debugobsolete `getid A_0` `getid A_1`
105 $ hg debugobsolete `getid A_0` `getid A_2`
105 $ hg debugobsolete `getid A_0` `getid A_2`
106 $ mkcommit A_3
106 $ mkcommit A_3
107 created new head
107 created new head
108 $ hg debugobsolete `getid A_2` `getid A_3`
108 $ hg debugobsolete `getid A_2` `getid A_3`
109 $ hg log -G --hidden
109 $ hg log -G --hidden
110 @ 4:01f36c5a8fda A_3
110 @ 4:01f36c5a8fda A_3
111 |
111 |
112 | x 3:392fd25390da A_2
112 | x 3:392fd25390da A_2
113 |/
113 |/
114 | o 2:82623d38b9ba A_1
114 | o 2:82623d38b9ba A_1
115 |/
115 |/
116 | x 1:007dc284c1f8 A_0
116 | x 1:007dc284c1f8 A_0
117 |/
117 |/
118 o 0:d20a80d4def3 base
118 o 0:d20a80d4def3 base
119
119
120 $ hg debugsuccessorssets 'all()'
120 $ hg debugsuccessorssets 'all()'
121 d20a80d4def3
121 d20a80d4def3
122 d20a80d4def3
122 d20a80d4def3
123 007dc284c1f8
123 007dc284c1f8
124 01f36c5a8fda
124 01f36c5a8fda
125 82623d38b9ba
125 82623d38b9ba
126 82623d38b9ba
126 82623d38b9ba
127 82623d38b9ba
127 82623d38b9ba
128 392fd25390da
128 392fd25390da
129 01f36c5a8fda
129 01f36c5a8fda
130 01f36c5a8fda
130 01f36c5a8fda
131 01f36c5a8fda
131 01f36c5a8fda
132 $ hg log -r 'divergent()'
132 $ hg log -r 'divergent()'
133 2:82623d38b9ba A_1
133 2:82623d38b9ba A_1
134 4:01f36c5a8fda A_3
134 4:01f36c5a8fda A_3
135 $ cd ..
135 $ cd ..
136
136
137
137
138 indirect divergence with known changeset
138 indirect divergence with known changeset
139 -------------------------------------------
139 -------------------------------------------
140
140
141 $ newcase indirect_unknown
141 $ newcase indirect_unknown
142 $ hg debugobsolete `getid A_0` aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
142 $ hg debugobsolete `getid A_0` aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
143 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid A_1`
143 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid A_1`
144 $ hg debugobsolete `getid A_0` `getid A_2`
144 $ hg debugobsolete `getid A_0` `getid A_2`
145 $ hg log -G --hidden
145 $ hg log -G --hidden
146 o 3:392fd25390da A_2
146 o 3:392fd25390da A_2
147 |
147 |
148 | o 2:82623d38b9ba A_1
148 | o 2:82623d38b9ba A_1
149 |/
149 |/
150 | x 1:007dc284c1f8 A_0
150 | x 1:007dc284c1f8 A_0
151 |/
151 |/
152 @ 0:d20a80d4def3 base
152 @ 0:d20a80d4def3 base
153
153
154 $ hg debugsuccessorssets 'all()'
154 $ hg debugsuccessorssets 'all()'
155 d20a80d4def3
155 d20a80d4def3
156 d20a80d4def3
156 d20a80d4def3
157 007dc284c1f8
157 007dc284c1f8
158 392fd25390da
158 392fd25390da
159 82623d38b9ba
159 82623d38b9ba
160 82623d38b9ba
160 82623d38b9ba
161 82623d38b9ba
161 82623d38b9ba
162 392fd25390da
162 392fd25390da
163 392fd25390da
163 392fd25390da
164 $ hg log -r 'divergent()'
164 $ hg log -r 'divergent()'
165 2:82623d38b9ba A_1
165 2:82623d38b9ba A_1
166 3:392fd25390da A_2
166 3:392fd25390da A_2
167 $ cd ..
167 $ cd ..
168
168
169 do not take unknown node in account if they are final
169 do not take unknown node in account if they are final
170 -----------------------------------------------------
170 -----------------------------------------------------
171
171
172 $ newcase final-unknown
172 $ newcase final-unknown
173 $ hg debugobsolete `getid A_0` `getid A_1`
173 $ hg debugobsolete `getid A_0` `getid A_1`
174 $ hg debugobsolete `getid A_1` `getid A_2`
174 $ hg debugobsolete `getid A_1` `getid A_2`
175 $ hg debugobsolete `getid A_0` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
175 $ hg debugobsolete `getid A_0` bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
176 $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccc
176 $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccc
177 $ hg debugobsolete `getid A_1` dddddddddddddddddddddddddddddddddddddddd
177 $ hg debugobsolete `getid A_1` dddddddddddddddddddddddddddddddddddddddd
178
178
179 $ hg debugsuccessorssets 'desc('A_0')'
179 $ hg debugsuccessorssets 'desc('A_0')'
180 007dc284c1f8
180 007dc284c1f8
181 392fd25390da
181 392fd25390da
182
182
183 $ cd ..
183 $ cd ..
184
184
185 divergence that converge again is not divergence anymore
185 divergence that converge again is not divergence anymore
186 -----------------------------------------------------
186 -----------------------------------------------------
187
187
188 $ newcase converged_divergence
188 $ newcase converged_divergence
189 $ hg debugobsolete `getid A_0` `getid A_1`
189 $ hg debugobsolete `getid A_0` `getid A_1`
190 $ hg debugobsolete `getid A_0` `getid A_2`
190 $ hg debugobsolete `getid A_0` `getid A_2`
191 $ mkcommit A_3
191 $ mkcommit A_3
192 created new head
192 created new head
193 $ hg debugobsolete `getid A_1` `getid A_3`
193 $ hg debugobsolete `getid A_1` `getid A_3`
194 $ hg debugobsolete `getid A_2` `getid A_3`
194 $ hg debugobsolete `getid A_2` `getid A_3`
195 $ hg log -G --hidden
195 $ hg log -G --hidden
196 @ 4:01f36c5a8fda A_3
196 @ 4:01f36c5a8fda A_3
197 |
197 |
198 | x 3:392fd25390da A_2
198 | x 3:392fd25390da A_2
199 |/
199 |/
200 | x 2:82623d38b9ba A_1
200 | x 2:82623d38b9ba A_1
201 |/
201 |/
202 | x 1:007dc284c1f8 A_0
202 | x 1:007dc284c1f8 A_0
203 |/
203 |/
204 o 0:d20a80d4def3 base
204 o 0:d20a80d4def3 base
205
205
206 $ hg debugsuccessorssets 'all()'
206 $ hg debugsuccessorssets 'all()'
207 d20a80d4def3
207 d20a80d4def3
208 d20a80d4def3
208 d20a80d4def3
209 007dc284c1f8
209 007dc284c1f8
210 01f36c5a8fda
210 01f36c5a8fda
211 82623d38b9ba
211 82623d38b9ba
212 01f36c5a8fda
212 01f36c5a8fda
213 392fd25390da
213 392fd25390da
214 01f36c5a8fda
214 01f36c5a8fda
215 01f36c5a8fda
215 01f36c5a8fda
216 01f36c5a8fda
216 01f36c5a8fda
217 $ hg log -r 'divergent()'
217 $ hg log -r 'divergent()'
218 $ cd ..
218 $ cd ..
219
219
220 split is not divergences
220 split is not divergences
221 -----------------------------
221 -----------------------------
222
222
223 $ newcase split
223 $ newcase split
224 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
224 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
225 $ hg log -G --hidden
225 $ hg log -G --hidden
226 o 3:392fd25390da A_2
226 o 3:392fd25390da A_2
227 |
227 |
228 | o 2:82623d38b9ba A_1
228 | o 2:82623d38b9ba A_1
229 |/
229 |/
230 | x 1:007dc284c1f8 A_0
230 | x 1:007dc284c1f8 A_0
231 |/
231 |/
232 @ 0:d20a80d4def3 base
232 @ 0:d20a80d4def3 base
233
233
234 $ hg debugsuccessorssets 'all()'
234 $ hg debugsuccessorssets 'all()'
235 d20a80d4def3
235 d20a80d4def3
236 d20a80d4def3
236 d20a80d4def3
237 007dc284c1f8
237 007dc284c1f8
238 82623d38b9ba 392fd25390da
238 82623d38b9ba 392fd25390da
239 82623d38b9ba
239 82623d38b9ba
240 82623d38b9ba
240 82623d38b9ba
241 392fd25390da
241 392fd25390da
242 392fd25390da
242 392fd25390da
243 $ hg log -r 'divergent()'
243 $ hg log -r 'divergent()'
244
244
245 Even when subsequente rewriting happen
245 Even when subsequente rewriting happen
246
246
247 $ mkcommit A_3
247 $ mkcommit A_3
248 created new head
248 created new head
249 $ hg debugobsolete `getid A_1` `getid A_3`
249 $ hg debugobsolete `getid A_1` `getid A_3`
250 $ hg up 0
250 $ hg up 0
251 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
251 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
252 $ mkcommit A_4
252 $ mkcommit A_4
253 created new head
253 created new head
254 $ hg debugobsolete `getid A_2` `getid A_4`
254 $ hg debugobsolete `getid A_2` `getid A_4`
255 $ hg up 0
255 $ hg up 0
256 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
256 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
257 $ mkcommit A_5
257 $ mkcommit A_5
258 created new head
258 created new head
259 $ hg debugobsolete `getid A_4` `getid A_5`
259 $ hg debugobsolete `getid A_4` `getid A_5`
260 $ hg log -G --hidden
260 $ hg log -G --hidden
261 @ 6:e442cfc57690 A_5
261 @ 6:e442cfc57690 A_5
262 |
262 |
263 | x 5:6a411f0d7a0a A_4
263 | x 5:6a411f0d7a0a A_4
264 |/
264 |/
265 | o 4:01f36c5a8fda A_3
265 | o 4:01f36c5a8fda A_3
266 |/
266 |/
267 | x 3:392fd25390da A_2
267 | x 3:392fd25390da A_2
268 |/
268 |/
269 | x 2:82623d38b9ba A_1
269 | x 2:82623d38b9ba A_1
270 |/
270 |/
271 | x 1:007dc284c1f8 A_0
271 | x 1:007dc284c1f8 A_0
272 |/
272 |/
273 o 0:d20a80d4def3 base
273 o 0:d20a80d4def3 base
274
274
275 $ hg debugsuccessorssets 'all()'
275 $ hg debugsuccessorssets 'all()'
276 d20a80d4def3
276 d20a80d4def3
277 d20a80d4def3
277 d20a80d4def3
278 007dc284c1f8
278 007dc284c1f8
279 01f36c5a8fda e442cfc57690
279 01f36c5a8fda e442cfc57690
280 82623d38b9ba
280 82623d38b9ba
281 01f36c5a8fda
281 01f36c5a8fda
282 392fd25390da
282 392fd25390da
283 e442cfc57690
283 e442cfc57690
284 01f36c5a8fda
284 01f36c5a8fda
285 01f36c5a8fda
285 01f36c5a8fda
286 6a411f0d7a0a
286 6a411f0d7a0a
287 e442cfc57690
287 e442cfc57690
288 e442cfc57690
288 e442cfc57690
289 e442cfc57690
289 e442cfc57690
290 $ hg log -r 'divergent()'
290 $ hg log -r 'divergent()'
291
291
292 Check more complexe obsolescence graft (with divergence)
292 Check more complexe obsolescence graft (with divergence)
293
293
294 $ mkcommit B_0; hg up 0
294 $ mkcommit B_0; hg up 0
295 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
295 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
296 $ hg debugobsolete `getid B_0` `getid A_2`
296 $ hg debugobsolete `getid B_0` `getid A_2`
297 $ mkcommit A_7; hg up 0
297 $ mkcommit A_7; hg up 0
298 created new head
298 created new head
299 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
299 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
300 $ mkcommit A_8; hg up 0
300 $ mkcommit A_8; hg up 0
301 created new head
301 created new head
302 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
302 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
303 $ hg debugobsolete `getid A_5` `getid A_7` `getid A_8`
303 $ hg debugobsolete `getid A_5` `getid A_7` `getid A_8`
304 $ mkcommit A_9; hg up 0
304 $ mkcommit A_9; hg up 0
305 created new head
305 created new head
306 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
306 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
307 $ hg debugobsolete `getid A_5` `getid A_9`
307 $ hg debugobsolete `getid A_5` `getid A_9`
308 $ hg log -G --hidden
308 $ hg log -G --hidden
309 o 10:bed64f5d2f5a A_9
309 o 10:bed64f5d2f5a A_9
310 |
310 |
311 | o 9:14608b260df8 A_8
311 | o 9:14608b260df8 A_8
312 |/
312 |/
313 | o 8:7ae126973a96 A_7
313 | o 8:7ae126973a96 A_7
314 |/
314 |/
315 | x 7:3750ebee865d B_0
315 | x 7:3750ebee865d B_0
316 | |
316 | |
317 | x 6:e442cfc57690 A_5
317 | x 6:e442cfc57690 A_5
318 |/
318 |/
319 | x 5:6a411f0d7a0a A_4
319 | x 5:6a411f0d7a0a A_4
320 |/
320 |/
321 | o 4:01f36c5a8fda A_3
321 | o 4:01f36c5a8fda A_3
322 |/
322 |/
323 | x 3:392fd25390da A_2
323 | x 3:392fd25390da A_2
324 |/
324 |/
325 | x 2:82623d38b9ba A_1
325 | x 2:82623d38b9ba A_1
326 |/
326 |/
327 | x 1:007dc284c1f8 A_0
327 | x 1:007dc284c1f8 A_0
328 |/
328 |/
329 @ 0:d20a80d4def3 base
329 @ 0:d20a80d4def3 base
330
330
331 $ hg debugsuccessorssets 'all()'
331 $ hg debugsuccessorssets 'all()'
332 d20a80d4def3
332 d20a80d4def3
333 d20a80d4def3
333 d20a80d4def3
334 007dc284c1f8
334 007dc284c1f8
335 01f36c5a8fda bed64f5d2f5a
335 01f36c5a8fda bed64f5d2f5a
336 01f36c5a8fda 7ae126973a96 14608b260df8
336 01f36c5a8fda 7ae126973a96 14608b260df8
337 82623d38b9ba
337 82623d38b9ba
338 01f36c5a8fda
338 01f36c5a8fda
339 392fd25390da
339 392fd25390da
340 bed64f5d2f5a
340 bed64f5d2f5a
341 7ae126973a96 14608b260df8
341 7ae126973a96 14608b260df8
342 01f36c5a8fda
342 01f36c5a8fda
343 01f36c5a8fda
343 01f36c5a8fda
344 6a411f0d7a0a
344 6a411f0d7a0a
345 bed64f5d2f5a
345 bed64f5d2f5a
346 7ae126973a96 14608b260df8
346 7ae126973a96 14608b260df8
347 e442cfc57690
347 e442cfc57690
348 bed64f5d2f5a
348 bed64f5d2f5a
349 7ae126973a96 14608b260df8
349 7ae126973a96 14608b260df8
350 3750ebee865d
350 3750ebee865d
351 bed64f5d2f5a
351 bed64f5d2f5a
352 7ae126973a96 14608b260df8
352 7ae126973a96 14608b260df8
353 7ae126973a96
353 7ae126973a96
354 7ae126973a96
354 7ae126973a96
355 14608b260df8
355 14608b260df8
356 14608b260df8
356 14608b260df8
357 bed64f5d2f5a
357 bed64f5d2f5a
358 bed64f5d2f5a
358 bed64f5d2f5a
359 $ hg log -r 'divergent()'
359 $ hg log -r 'divergent()'
360 4:01f36c5a8fda A_3
360 4:01f36c5a8fda A_3
361 8:7ae126973a96 A_7
361 8:7ae126973a96 A_7
362 9:14608b260df8 A_8
362 9:14608b260df8 A_8
363 10:bed64f5d2f5a A_9
363 10:bed64f5d2f5a A_9
364
364
365 fix the divergence
365 fix the divergence
366
366
367 $ mkcommit A_A; hg up 0
367 $ mkcommit A_A; hg up 0
368 created new head
368 created new head
369 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
369 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
370 $ hg debugobsolete `getid A_9` `getid A_A`
370 $ hg debugobsolete `getid A_9` `getid A_A`
371 $ hg debugobsolete `getid A_7` `getid A_A`
371 $ hg debugobsolete `getid A_7` `getid A_A`
372 $ hg debugobsolete `getid A_8` `getid A_A`
372 $ hg debugobsolete `getid A_8` `getid A_A`
373 $ hg log -G --hidden
373 $ hg log -G --hidden
374 o 11:a139f71be9da A_A
374 o 11:a139f71be9da A_A
375 |
375 |
376 | x 10:bed64f5d2f5a A_9
376 | x 10:bed64f5d2f5a A_9
377 |/
377 |/
378 | x 9:14608b260df8 A_8
378 | x 9:14608b260df8 A_8
379 |/
379 |/
380 | x 8:7ae126973a96 A_7
380 | x 8:7ae126973a96 A_7
381 |/
381 |/
382 | x 7:3750ebee865d B_0
382 | x 7:3750ebee865d B_0
383 | |
383 | |
384 | x 6:e442cfc57690 A_5
384 | x 6:e442cfc57690 A_5
385 |/
385 |/
386 | x 5:6a411f0d7a0a A_4
386 | x 5:6a411f0d7a0a A_4
387 |/
387 |/
388 | o 4:01f36c5a8fda A_3
388 | o 4:01f36c5a8fda A_3
389 |/
389 |/
390 | x 3:392fd25390da A_2
390 | x 3:392fd25390da A_2
391 |/
391 |/
392 | x 2:82623d38b9ba A_1
392 | x 2:82623d38b9ba A_1
393 |/
393 |/
394 | x 1:007dc284c1f8 A_0
394 | x 1:007dc284c1f8 A_0
395 |/
395 |/
396 @ 0:d20a80d4def3 base
396 @ 0:d20a80d4def3 base
397
397
398 $ hg debugsuccessorssets 'all()'
398 $ hg debugsuccessorssets 'all()'
399 d20a80d4def3
399 d20a80d4def3
400 d20a80d4def3
400 d20a80d4def3
401 007dc284c1f8
401 007dc284c1f8
402 01f36c5a8fda a139f71be9da
402 01f36c5a8fda a139f71be9da
403 82623d38b9ba
403 82623d38b9ba
404 01f36c5a8fda
404 01f36c5a8fda
405 392fd25390da
405 392fd25390da
406 a139f71be9da
406 a139f71be9da
407 01f36c5a8fda
407 01f36c5a8fda
408 01f36c5a8fda
408 01f36c5a8fda
409 6a411f0d7a0a
409 6a411f0d7a0a
410 a139f71be9da
410 a139f71be9da
411 e442cfc57690
411 e442cfc57690
412 a139f71be9da
412 a139f71be9da
413 3750ebee865d
413 3750ebee865d
414 a139f71be9da
414 a139f71be9da
415 7ae126973a96
415 7ae126973a96
416 a139f71be9da
416 a139f71be9da
417 14608b260df8
417 14608b260df8
418 a139f71be9da
418 a139f71be9da
419 bed64f5d2f5a
419 bed64f5d2f5a
420 a139f71be9da
420 a139f71be9da
421 a139f71be9da
421 a139f71be9da
422 a139f71be9da
422 a139f71be9da
423 $ hg log -r 'divergent()'
423 $ hg log -r 'divergent()'
424
424
425 $ cd ..
425 $ cd ..
426
426
427
427
428 Subset does not diverge
428 Subset does not diverge
429 ------------------------------
429 ------------------------------
430
430
431 Do not report divergent successors-set if it is a subset of another
431 Do not report divergent successors-set if it is a subset of another
432 successors-set. (report [A,B] not [A] + [A,B])
432 successors-set. (report [A,B] not [A] + [A,B])
433
433
434 $ newcase subset
434 $ newcase subset
435 $ hg debugobsolete `getid A_0` `getid A_2`
435 $ hg debugobsolete `getid A_0` `getid A_2`
436 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
436 $ hg debugobsolete `getid A_0` `getid A_1` `getid A_2`
437 $ hg debugsuccessorssets 'desc('A_0')'
437 $ hg debugsuccessorssets 'desc('A_0')'
438 007dc284c1f8
438 007dc284c1f8
439 82623d38b9ba 392fd25390da
439 82623d38b9ba 392fd25390da
440
440
441 $ cd ..
441 $ cd ..
@@ -1,599 +1,600 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > [phases]
4 > [phases]
5 > # public changeset are not obsolete
5 > # public changeset are not obsolete
6 > publish=false
6 > publish=false
7 > EOF
7 > EOF
8 $ mkcommit() {
8 $ mkcommit() {
9 > echo "$1" > "$1"
9 > echo "$1" > "$1"
10 > hg add "$1"
10 > hg add "$1"
11 > hg ci -m "add $1"
11 > hg ci -m "add $1"
12 > }
12 > }
13 $ getid() {
13 $ getid() {
14 > hg id --debug -ir "desc('$1')"
14 > hg id --debug -ir "desc('$1')"
15 > }
15 > }
16
16
17 $ cat > debugkeys.py <<EOF
17 $ cat > debugkeys.py <<EOF
18 > def reposetup(ui, repo):
18 > def reposetup(ui, repo):
19 > class debugkeysrepo(repo.__class__):
19 > class debugkeysrepo(repo.__class__):
20 > def listkeys(self, namespace):
20 > def listkeys(self, namespace):
21 > ui.write('listkeys %s\n' % (namespace,))
21 > ui.write('listkeys %s\n' % (namespace,))
22 > return super(debugkeysrepo, self).listkeys(namespace)
22 > return super(debugkeysrepo, self).listkeys(namespace)
23 >
23 >
24 > if repo.local():
24 > if repo.local():
25 > repo.__class__ = debugkeysrepo
25 > repo.__class__ = debugkeysrepo
26 > EOF
26 > EOF
27
27
28 $ hg init tmpa
28 $ hg init tmpa
29 $ cd tmpa
29 $ cd tmpa
30 $ mkcommit kill_me
30 $ mkcommit kill_me
31
31
32 Checking that the feature is properly disabled
32 Checking that the feature is properly disabled
33
33
34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
35 abort: obsolete feature is not enabled on this repo
35 abort: obsolete feature is not enabled on this repo
36 [255]
36 [255]
37
37
38 Enabling it
38 Enabling it
39
39
40 $ cat > ../obs.py << EOF
40 $ cat > ../obs.py << EOF
41 > import mercurial.obsolete
41 > import mercurial.obsolete
42 > mercurial.obsolete._enabled = True
42 > mercurial.obsolete._enabled = True
43 > EOF
43 > EOF
44 $ echo '[extensions]' >> $HGRCPATH
44 $ echo '[extensions]' >> $HGRCPATH
45 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
45 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
46
46
47 Killing a single changeset without replacement
47 Killing a single changeset without replacement
48
48
49 $ hg debugobsolete 0
49 $ hg debugobsolete 0
50 abort: changeset references must be full hexadecimal node identifiers
50 abort: changeset references must be full hexadecimal node identifiers
51 [255]
51 [255]
52 $ hg debugobsolete '00'
52 $ hg debugobsolete '00'
53 abort: changeset references must be full hexadecimal node identifiers
53 abort: changeset references must be full hexadecimal node identifiers
54 [255]
54 [255]
55 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
55 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
56 $ hg debugobsolete
56 $ hg debugobsolete
57 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
57 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
58 $ cd ..
58 $ cd ..
59
59
60 Killing a single changeset with replacement
60 Killing a single changeset with replacement
61
61
62 $ hg init tmpb
62 $ hg init tmpb
63 $ cd tmpb
63 $ cd tmpb
64 $ mkcommit a
64 $ mkcommit a
65 $ mkcommit b
65 $ mkcommit b
66 $ mkcommit original_c
66 $ mkcommit original_c
67 $ hg up "desc('b')"
67 $ hg up "desc('b')"
68 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 $ mkcommit new_c
69 $ mkcommit new_c
70 created new head
70 created new head
71 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
71 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
72 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
72 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
73 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
73 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
74 2:245bde4270cd add original_c
74 2:245bde4270cd add original_c
75 $ hg debugobsolete
75 $ hg debugobsolete
76 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
76 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
77
77
78 do it again (it read the obsstore before adding new changeset)
78 do it again (it read the obsstore before adding new changeset)
79
79
80 $ hg up '.^'
80 $ hg up '.^'
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 $ mkcommit new_2_c
82 $ mkcommit new_2_c
83 created new head
83 created new head
84 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
84 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
85 $ hg debugobsolete
85 $ hg debugobsolete
86 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
86 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
87 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
87 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
88
88
89 Register two markers with a missing node
89 Register two markers with a missing node
90
90
91 $ hg up '.^'
91 $ hg up '.^'
92 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
92 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 $ mkcommit new_3_c
93 $ mkcommit new_3_c
94 created new head
94 created new head
95 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
95 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
96 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
96 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
97 $ hg debugobsolete
97 $ hg debugobsolete
98 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
98 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
99 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
99 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
100 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
100 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
101 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
101 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
102
102
103 Refuse pathological nullid successors
103 Refuse pathological nullid successors
104 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
104 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
105 transaction abort!
105 transaction abort!
106 rollback completed
106 rollback completed
107 abort: bad obsolescence marker detected: invalid successors nullid
107 abort: bad obsolescence marker detected: invalid successors nullid
108 [255]
108 [255]
109
109
110 Check that graphlog detect that a changeset is obsolete:
110 Check that graphlog detect that a changeset is obsolete:
111
111
112 $ hg glog
112 $ hg glog
113 @ changeset: 5:5601fb93a350
113 @ changeset: 5:5601fb93a350
114 | tag: tip
114 | tag: tip
115 | parent: 1:7c3bad9141dc
115 | parent: 1:7c3bad9141dc
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: add new_3_c
118 | summary: add new_3_c
119 |
119 |
120 o changeset: 1:7c3bad9141dc
120 o changeset: 1:7c3bad9141dc
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: add b
123 | summary: add b
124 |
124 |
125 o changeset: 0:1f0dee641bb7
125 o changeset: 0:1f0dee641bb7
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: add a
128 summary: add a
129
129
130
130
131 Check that public changeset are not accounted as obsolete:
131 Check that public changeset are not accounted as obsolete:
132
132
133 $ hg phase --public 2
133 $ hg phase --public 2
134 $ hg --config 'extensions.graphlog=' glog
134 $ hg --config 'extensions.graphlog=' glog
135 @ changeset: 5:5601fb93a350
135 @ changeset: 5:5601fb93a350
136 | tag: tip
136 | tag: tip
137 | parent: 1:7c3bad9141dc
137 | parent: 1:7c3bad9141dc
138 | user: test
138 | user: test
139 | date: Thu Jan 01 00:00:00 1970 +0000
139 | date: Thu Jan 01 00:00:00 1970 +0000
140 | summary: add new_3_c
140 | summary: add new_3_c
141 |
141 |
142 | o changeset: 2:245bde4270cd
142 | o changeset: 2:245bde4270cd
143 |/ user: test
143 |/ user: test
144 | date: Thu Jan 01 00:00:00 1970 +0000
144 | date: Thu Jan 01 00:00:00 1970 +0000
145 | summary: add original_c
145 | summary: add original_c
146 |
146 |
147 o changeset: 1:7c3bad9141dc
147 o changeset: 1:7c3bad9141dc
148 | user: test
148 | user: test
149 | date: Thu Jan 01 00:00:00 1970 +0000
149 | date: Thu Jan 01 00:00:00 1970 +0000
150 | summary: add b
150 | summary: add b
151 |
151 |
152 o changeset: 0:1f0dee641bb7
152 o changeset: 0:1f0dee641bb7
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:00 1970 +0000
154 date: Thu Jan 01 00:00:00 1970 +0000
155 summary: add a
155 summary: add a
156
156
157
157
158 And that bumped changeset are detected
158 And that bumped changeset are detected
159 --------------------------------------
159 --------------------------------------
160
160
161 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
161 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
162 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
162 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
163 the public changeset
163 the public changeset
164
164
165 $ hg log --hidden -r 'bumped()'
165 $ hg log --hidden -r 'bumped()'
166 changeset: 5:5601fb93a350
166 changeset: 5:5601fb93a350
167 tag: tip
167 tag: tip
168 parent: 1:7c3bad9141dc
168 parent: 1:7c3bad9141dc
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: add new_3_c
171 summary: add new_3_c
172
172
173
173
174 And that we can't push bumped changeset
174 And that we can't push bumped changeset
175
175
176 $ hg push ../tmpa -r 0 --force #(make repo related)
176 $ hg push ../tmpa -r 0 --force #(make repo related)
177 pushing to ../tmpa
177 pushing to ../tmpa
178 searching for changes
178 searching for changes
179 warning: repository is unrelated
179 adding changesets
180 adding changesets
180 adding manifests
181 adding manifests
181 adding file changes
182 adding file changes
182 added 1 changesets with 1 changes to 1 files (+1 heads)
183 added 1 changesets with 1 changes to 1 files (+1 heads)
183 $ hg push ../tmpa
184 $ hg push ../tmpa
184 pushing to ../tmpa
185 pushing to ../tmpa
185 searching for changes
186 searching for changes
186 abort: push includes bumped changeset: 5601fb93a350!
187 abort: push includes bumped changeset: 5601fb93a350!
187 [255]
188 [255]
188
189
189 Fixing "bumped" situation
190 Fixing "bumped" situation
190 We need to create a clone of 5 and add a special marker with a flag
191 We need to create a clone of 5 and add a special marker with a flag
191
192
192 $ hg up '5^'
193 $ hg up '5^'
193 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
194 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
194 $ hg revert -ar 5
195 $ hg revert -ar 5
195 adding new_3_c
196 adding new_3_c
196 $ hg ci -m 'add n3w_3_c'
197 $ hg ci -m 'add n3w_3_c'
197 created new head
198 created new head
198 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
199 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
199 $ hg log -r 'bumped()'
200 $ hg log -r 'bumped()'
200 $ hg log -G
201 $ hg log -G
201 @ changeset: 6:6f9641995072
202 @ changeset: 6:6f9641995072
202 | tag: tip
203 | tag: tip
203 | parent: 1:7c3bad9141dc
204 | parent: 1:7c3bad9141dc
204 | user: test
205 | user: test
205 | date: Thu Jan 01 00:00:00 1970 +0000
206 | date: Thu Jan 01 00:00:00 1970 +0000
206 | summary: add n3w_3_c
207 | summary: add n3w_3_c
207 |
208 |
208 | o changeset: 2:245bde4270cd
209 | o changeset: 2:245bde4270cd
209 |/ user: test
210 |/ user: test
210 | date: Thu Jan 01 00:00:00 1970 +0000
211 | date: Thu Jan 01 00:00:00 1970 +0000
211 | summary: add original_c
212 | summary: add original_c
212 |
213 |
213 o changeset: 1:7c3bad9141dc
214 o changeset: 1:7c3bad9141dc
214 | user: test
215 | user: test
215 | date: Thu Jan 01 00:00:00 1970 +0000
216 | date: Thu Jan 01 00:00:00 1970 +0000
216 | summary: add b
217 | summary: add b
217 |
218 |
218 o changeset: 0:1f0dee641bb7
219 o changeset: 0:1f0dee641bb7
219 user: test
220 user: test
220 date: Thu Jan 01 00:00:00 1970 +0000
221 date: Thu Jan 01 00:00:00 1970 +0000
221 summary: add a
222 summary: add a
222
223
223
224
224
225
225
226
226 $ cd ..
227 $ cd ..
227
228
228 Exchange Test
229 Exchange Test
229 ============================
230 ============================
230
231
231 Destination repo does not have any data
232 Destination repo does not have any data
232 ---------------------------------------
233 ---------------------------------------
233
234
234 Try to pull markers
235 Try to pull markers
235 (extinct changeset are excluded but marker are pushed)
236 (extinct changeset are excluded but marker are pushed)
236
237
237 $ hg init tmpc
238 $ hg init tmpc
238 $ cd tmpc
239 $ cd tmpc
239 $ hg pull ../tmpb
240 $ hg pull ../tmpb
240 pulling from ../tmpb
241 pulling from ../tmpb
241 requesting all changes
242 requesting all changes
242 adding changesets
243 adding changesets
243 adding manifests
244 adding manifests
244 adding file changes
245 adding file changes
245 added 4 changesets with 4 changes to 4 files (+1 heads)
246 added 4 changesets with 4 changes to 4 files (+1 heads)
246 (run 'hg heads' to see heads, 'hg merge' to merge)
247 (run 'hg heads' to see heads, 'hg merge' to merge)
247 $ hg debugobsolete
248 $ hg debugobsolete
248 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
249 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
249 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
250 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
250 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
251 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
251 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
252 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
252 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
253 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
253
254
254 Rollback//Transaction support
255 Rollback//Transaction support
255
256
256 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
257 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
257 $ hg debugobsolete
258 $ hg debugobsolete
258 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
259 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
259 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
260 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
260 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
261 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
261 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
262 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
262 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
263 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
263 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
264 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
264 $ hg rollback -n
265 $ hg rollback -n
265 repository tip rolled back to revision 3 (undo debugobsolete)
266 repository tip rolled back to revision 3 (undo debugobsolete)
266 $ hg rollback
267 $ hg rollback
267 repository tip rolled back to revision 3 (undo debugobsolete)
268 repository tip rolled back to revision 3 (undo debugobsolete)
268 $ hg debugobsolete
269 $ hg debugobsolete
269 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
270 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
270 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
271 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
271 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
272 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
272 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
273 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
273 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
274 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
274
275
275 $ cd ..
276 $ cd ..
276
277
277 Try to pull markers
278 Try to pull markers
278
279
279 $ hg init tmpd
280 $ hg init tmpd
280 $ hg -R tmpb push tmpd
281 $ hg -R tmpb push tmpd
281 pushing to tmpd
282 pushing to tmpd
282 searching for changes
283 searching for changes
283 adding changesets
284 adding changesets
284 adding manifests
285 adding manifests
285 adding file changes
286 adding file changes
286 added 4 changesets with 4 changes to 4 files (+1 heads)
287 added 4 changesets with 4 changes to 4 files (+1 heads)
287 $ hg -R tmpd debugobsolete
288 $ hg -R tmpd debugobsolete
288 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
289 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
289 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
290 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
290 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
291 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
291 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
292 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
292 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
293 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
293
294
294 Check obsolete keys are exchanged only if source has an obsolete store
295 Check obsolete keys are exchanged only if source has an obsolete store
295
296
296 $ hg init empty
297 $ hg init empty
297 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
298 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
298 pushing to tmpd
299 pushing to tmpd
299 no changes found
300 no changes found
300 listkeys phases
301 listkeys phases
301 listkeys bookmarks
302 listkeys bookmarks
302 [1]
303 [1]
303
304
304 clone support
305 clone support
305 (markers are copied and extinct changesets are included to allow hardlinks)
306 (markers are copied and extinct changesets are included to allow hardlinks)
306
307
307 $ hg clone tmpb clone-dest
308 $ hg clone tmpb clone-dest
308 updating to branch default
309 updating to branch default
309 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 $ hg -R clone-dest log -G --hidden
311 $ hg -R clone-dest log -G --hidden
311 @ changeset: 6:6f9641995072
312 @ changeset: 6:6f9641995072
312 | tag: tip
313 | tag: tip
313 | parent: 1:7c3bad9141dc
314 | parent: 1:7c3bad9141dc
314 | user: test
315 | user: test
315 | date: Thu Jan 01 00:00:00 1970 +0000
316 | date: Thu Jan 01 00:00:00 1970 +0000
316 | summary: add n3w_3_c
317 | summary: add n3w_3_c
317 |
318 |
318 | x changeset: 5:5601fb93a350
319 | x changeset: 5:5601fb93a350
319 |/ parent: 1:7c3bad9141dc
320 |/ parent: 1:7c3bad9141dc
320 | user: test
321 | user: test
321 | date: Thu Jan 01 00:00:00 1970 +0000
322 | date: Thu Jan 01 00:00:00 1970 +0000
322 | summary: add new_3_c
323 | summary: add new_3_c
323 |
324 |
324 | x changeset: 4:ca819180edb9
325 | x changeset: 4:ca819180edb9
325 |/ parent: 1:7c3bad9141dc
326 |/ parent: 1:7c3bad9141dc
326 | user: test
327 | user: test
327 | date: Thu Jan 01 00:00:00 1970 +0000
328 | date: Thu Jan 01 00:00:00 1970 +0000
328 | summary: add new_2_c
329 | summary: add new_2_c
329 |
330 |
330 | x changeset: 3:cdbce2fbb163
331 | x changeset: 3:cdbce2fbb163
331 |/ parent: 1:7c3bad9141dc
332 |/ parent: 1:7c3bad9141dc
332 | user: test
333 | user: test
333 | date: Thu Jan 01 00:00:00 1970 +0000
334 | date: Thu Jan 01 00:00:00 1970 +0000
334 | summary: add new_c
335 | summary: add new_c
335 |
336 |
336 | o changeset: 2:245bde4270cd
337 | o changeset: 2:245bde4270cd
337 |/ user: test
338 |/ user: test
338 | date: Thu Jan 01 00:00:00 1970 +0000
339 | date: Thu Jan 01 00:00:00 1970 +0000
339 | summary: add original_c
340 | summary: add original_c
340 |
341 |
341 o changeset: 1:7c3bad9141dc
342 o changeset: 1:7c3bad9141dc
342 | user: test
343 | user: test
343 | date: Thu Jan 01 00:00:00 1970 +0000
344 | date: Thu Jan 01 00:00:00 1970 +0000
344 | summary: add b
345 | summary: add b
345 |
346 |
346 o changeset: 0:1f0dee641bb7
347 o changeset: 0:1f0dee641bb7
347 user: test
348 user: test
348 date: Thu Jan 01 00:00:00 1970 +0000
349 date: Thu Jan 01 00:00:00 1970 +0000
349 summary: add a
350 summary: add a
350
351
351 $ hg -R clone-dest debugobsolete
352 $ hg -R clone-dest debugobsolete
352 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
353 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
353 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
354 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
354 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
355 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
355 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
356 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
356 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
357 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
357
358
358
359
359 Destination repo have existing data
360 Destination repo have existing data
360 ---------------------------------------
361 ---------------------------------------
361
362
362 On pull
363 On pull
363
364
364 $ hg init tmpe
365 $ hg init tmpe
365 $ cd tmpe
366 $ cd tmpe
366 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
367 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
367 $ hg pull ../tmpb
368 $ hg pull ../tmpb
368 pulling from ../tmpb
369 pulling from ../tmpb
369 requesting all changes
370 requesting all changes
370 adding changesets
371 adding changesets
371 adding manifests
372 adding manifests
372 adding file changes
373 adding file changes
373 added 4 changesets with 4 changes to 4 files (+1 heads)
374 added 4 changesets with 4 changes to 4 files (+1 heads)
374 (run 'hg heads' to see heads, 'hg merge' to merge)
375 (run 'hg heads' to see heads, 'hg merge' to merge)
375 $ hg debugobsolete
376 $ hg debugobsolete
376 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
377 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
377 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
378 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
378 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
379 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
379 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
380 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
380 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
381 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
381 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
382 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
382
383
383
384
384 On push
385 On push
385
386
386 $ hg push ../tmpc
387 $ hg push ../tmpc
387 pushing to ../tmpc
388 pushing to ../tmpc
388 searching for changes
389 searching for changes
389 no changes found
390 no changes found
390 [1]
391 [1]
391 $ hg -R ../tmpc debugobsolete
392 $ hg -R ../tmpc debugobsolete
392 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
393 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
393 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
394 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
394 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
395 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
395 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
396 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
396 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
397 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
397 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
398 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
398
399
399 detect outgoing obsolete and unstable
400 detect outgoing obsolete and unstable
400 ---------------------------------------
401 ---------------------------------------
401
402
402
403
403 $ hg glog
404 $ hg glog
404 o changeset: 3:6f9641995072
405 o changeset: 3:6f9641995072
405 | tag: tip
406 | tag: tip
406 | parent: 1:7c3bad9141dc
407 | parent: 1:7c3bad9141dc
407 | user: test
408 | user: test
408 | date: Thu Jan 01 00:00:00 1970 +0000
409 | date: Thu Jan 01 00:00:00 1970 +0000
409 | summary: add n3w_3_c
410 | summary: add n3w_3_c
410 |
411 |
411 | o changeset: 2:245bde4270cd
412 | o changeset: 2:245bde4270cd
412 |/ user: test
413 |/ user: test
413 | date: Thu Jan 01 00:00:00 1970 +0000
414 | date: Thu Jan 01 00:00:00 1970 +0000
414 | summary: add original_c
415 | summary: add original_c
415 |
416 |
416 o changeset: 1:7c3bad9141dc
417 o changeset: 1:7c3bad9141dc
417 | user: test
418 | user: test
418 | date: Thu Jan 01 00:00:00 1970 +0000
419 | date: Thu Jan 01 00:00:00 1970 +0000
419 | summary: add b
420 | summary: add b
420 |
421 |
421 o changeset: 0:1f0dee641bb7
422 o changeset: 0:1f0dee641bb7
422 user: test
423 user: test
423 date: Thu Jan 01 00:00:00 1970 +0000
424 date: Thu Jan 01 00:00:00 1970 +0000
424 summary: add a
425 summary: add a
425
426
426 $ hg up 'desc("n3w_3_c")'
427 $ hg up 'desc("n3w_3_c")'
427 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 $ mkcommit original_d
429 $ mkcommit original_d
429 $ mkcommit original_e
430 $ mkcommit original_e
430 $ hg debugobsolete `getid original_d` -d '0 0'
431 $ hg debugobsolete `getid original_d` -d '0 0'
431 $ hg log -r 'obsolete()'
432 $ hg log -r 'obsolete()'
432 changeset: 4:94b33453f93b
433 changeset: 4:94b33453f93b
433 user: test
434 user: test
434 date: Thu Jan 01 00:00:00 1970 +0000
435 date: Thu Jan 01 00:00:00 1970 +0000
435 summary: add original_d
436 summary: add original_d
436
437
437 $ hg glog -r '::unstable()'
438 $ hg glog -r '::unstable()'
438 @ changeset: 5:cda648ca50f5
439 @ changeset: 5:cda648ca50f5
439 | tag: tip
440 | tag: tip
440 | user: test
441 | user: test
441 | date: Thu Jan 01 00:00:00 1970 +0000
442 | date: Thu Jan 01 00:00:00 1970 +0000
442 | summary: add original_e
443 | summary: add original_e
443 |
444 |
444 x changeset: 4:94b33453f93b
445 x changeset: 4:94b33453f93b
445 | user: test
446 | user: test
446 | date: Thu Jan 01 00:00:00 1970 +0000
447 | date: Thu Jan 01 00:00:00 1970 +0000
447 | summary: add original_d
448 | summary: add original_d
448 |
449 |
449 o changeset: 3:6f9641995072
450 o changeset: 3:6f9641995072
450 | parent: 1:7c3bad9141dc
451 | parent: 1:7c3bad9141dc
451 | user: test
452 | user: test
452 | date: Thu Jan 01 00:00:00 1970 +0000
453 | date: Thu Jan 01 00:00:00 1970 +0000
453 | summary: add n3w_3_c
454 | summary: add n3w_3_c
454 |
455 |
455 o changeset: 1:7c3bad9141dc
456 o changeset: 1:7c3bad9141dc
456 | user: test
457 | user: test
457 | date: Thu Jan 01 00:00:00 1970 +0000
458 | date: Thu Jan 01 00:00:00 1970 +0000
458 | summary: add b
459 | summary: add b
459 |
460 |
460 o changeset: 0:1f0dee641bb7
461 o changeset: 0:1f0dee641bb7
461 user: test
462 user: test
462 date: Thu Jan 01 00:00:00 1970 +0000
463 date: Thu Jan 01 00:00:00 1970 +0000
463 summary: add a
464 summary: add a
464
465
465
466
466 refuse to push obsolete changeset
467 refuse to push obsolete changeset
467
468
468 $ hg push ../tmpc/ -r 'desc("original_d")'
469 $ hg push ../tmpc/ -r 'desc("original_d")'
469 pushing to ../tmpc/
470 pushing to ../tmpc/
470 searching for changes
471 searching for changes
471 abort: push includes obsolete changeset: 94b33453f93b!
472 abort: push includes obsolete changeset: 94b33453f93b!
472 [255]
473 [255]
473
474
474 refuse to push unstable changeset
475 refuse to push unstable changeset
475
476
476 $ hg push ../tmpc/
477 $ hg push ../tmpc/
477 pushing to ../tmpc/
478 pushing to ../tmpc/
478 searching for changes
479 searching for changes
479 abort: push includes unstable changeset: cda648ca50f5!
480 abort: push includes unstable changeset: cda648ca50f5!
480 [255]
481 [255]
481
482
482 Test that extinct changeset are properly detected
483 Test that extinct changeset are properly detected
483
484
484 $ hg log -r 'extinct()'
485 $ hg log -r 'extinct()'
485
486
486 Don't try to push extinct changeset
487 Don't try to push extinct changeset
487
488
488 $ hg init ../tmpf
489 $ hg init ../tmpf
489 $ hg out ../tmpf
490 $ hg out ../tmpf
490 comparing with ../tmpf
491 comparing with ../tmpf
491 searching for changes
492 searching for changes
492 changeset: 0:1f0dee641bb7
493 changeset: 0:1f0dee641bb7
493 user: test
494 user: test
494 date: Thu Jan 01 00:00:00 1970 +0000
495 date: Thu Jan 01 00:00:00 1970 +0000
495 summary: add a
496 summary: add a
496
497
497 changeset: 1:7c3bad9141dc
498 changeset: 1:7c3bad9141dc
498 user: test
499 user: test
499 date: Thu Jan 01 00:00:00 1970 +0000
500 date: Thu Jan 01 00:00:00 1970 +0000
500 summary: add b
501 summary: add b
501
502
502 changeset: 2:245bde4270cd
503 changeset: 2:245bde4270cd
503 user: test
504 user: test
504 date: Thu Jan 01 00:00:00 1970 +0000
505 date: Thu Jan 01 00:00:00 1970 +0000
505 summary: add original_c
506 summary: add original_c
506
507
507 changeset: 3:6f9641995072
508 changeset: 3:6f9641995072
508 parent: 1:7c3bad9141dc
509 parent: 1:7c3bad9141dc
509 user: test
510 user: test
510 date: Thu Jan 01 00:00:00 1970 +0000
511 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: add n3w_3_c
512 summary: add n3w_3_c
512
513
513 changeset: 4:94b33453f93b
514 changeset: 4:94b33453f93b
514 user: test
515 user: test
515 date: Thu Jan 01 00:00:00 1970 +0000
516 date: Thu Jan 01 00:00:00 1970 +0000
516 summary: add original_d
517 summary: add original_d
517
518
518 changeset: 5:cda648ca50f5
519 changeset: 5:cda648ca50f5
519 tag: tip
520 tag: tip
520 user: test
521 user: test
521 date: Thu Jan 01 00:00:00 1970 +0000
522 date: Thu Jan 01 00:00:00 1970 +0000
522 summary: add original_e
523 summary: add original_e
523
524
524 $ hg push ../tmpf -f # -f because be push unstable too
525 $ hg push ../tmpf -f # -f because be push unstable too
525 pushing to ../tmpf
526 pushing to ../tmpf
526 searching for changes
527 searching for changes
527 adding changesets
528 adding changesets
528 adding manifests
529 adding manifests
529 adding file changes
530 adding file changes
530 added 6 changesets with 6 changes to 6 files (+1 heads)
531 added 6 changesets with 6 changes to 6 files (+1 heads)
531
532
532 no warning displayed
533 no warning displayed
533
534
534 $ hg push ../tmpf
535 $ hg push ../tmpf
535 pushing to ../tmpf
536 pushing to ../tmpf
536 searching for changes
537 searching for changes
537 no changes found
538 no changes found
538 [1]
539 [1]
539
540
540 Do not warn about new head when the new head is a successors of a remote one
541 Do not warn about new head when the new head is a successors of a remote one
541
542
542 $ hg glog
543 $ hg glog
543 @ changeset: 5:cda648ca50f5
544 @ changeset: 5:cda648ca50f5
544 | tag: tip
545 | tag: tip
545 | user: test
546 | user: test
546 | date: Thu Jan 01 00:00:00 1970 +0000
547 | date: Thu Jan 01 00:00:00 1970 +0000
547 | summary: add original_e
548 | summary: add original_e
548 |
549 |
549 x changeset: 4:94b33453f93b
550 x changeset: 4:94b33453f93b
550 | user: test
551 | user: test
551 | date: Thu Jan 01 00:00:00 1970 +0000
552 | date: Thu Jan 01 00:00:00 1970 +0000
552 | summary: add original_d
553 | summary: add original_d
553 |
554 |
554 o changeset: 3:6f9641995072
555 o changeset: 3:6f9641995072
555 | parent: 1:7c3bad9141dc
556 | parent: 1:7c3bad9141dc
556 | user: test
557 | user: test
557 | date: Thu Jan 01 00:00:00 1970 +0000
558 | date: Thu Jan 01 00:00:00 1970 +0000
558 | summary: add n3w_3_c
559 | summary: add n3w_3_c
559 |
560 |
560 | o changeset: 2:245bde4270cd
561 | o changeset: 2:245bde4270cd
561 |/ user: test
562 |/ user: test
562 | date: Thu Jan 01 00:00:00 1970 +0000
563 | date: Thu Jan 01 00:00:00 1970 +0000
563 | summary: add original_c
564 | summary: add original_c
564 |
565 |
565 o changeset: 1:7c3bad9141dc
566 o changeset: 1:7c3bad9141dc
566 | user: test
567 | user: test
567 | date: Thu Jan 01 00:00:00 1970 +0000
568 | date: Thu Jan 01 00:00:00 1970 +0000
568 | summary: add b
569 | summary: add b
569 |
570 |
570 o changeset: 0:1f0dee641bb7
571 o changeset: 0:1f0dee641bb7
571 user: test
572 user: test
572 date: Thu Jan 01 00:00:00 1970 +0000
573 date: Thu Jan 01 00:00:00 1970 +0000
573 summary: add a
574 summary: add a
574
575
575 $ hg up -q 'desc(n3w_3_c)'
576 $ hg up -q 'desc(n3w_3_c)'
576 $ mkcommit obsolete_e
577 $ mkcommit obsolete_e
577 created new head
578 created new head
578 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
579 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
579 $ hg push ../tmpf
580 $ hg push ../tmpf
580 pushing to ../tmpf
581 pushing to ../tmpf
581 searching for changes
582 searching for changes
582 adding changesets
583 adding changesets
583 adding manifests
584 adding manifests
584 adding file changes
585 adding file changes
585 added 1 changesets with 1 changes to 1 files (+1 heads)
586 added 1 changesets with 1 changes to 1 files (+1 heads)
586
587
587 Checking _enable=False warning if obsolete marker exists
588 Checking _enable=False warning if obsolete marker exists
588
589
589 $ echo '[extensions]' >> $HGRCPATH
590 $ echo '[extensions]' >> $HGRCPATH
590 $ echo "obs=!" >> $HGRCPATH
591 $ echo "obs=!" >> $HGRCPATH
591 $ hg log -r tip
592 $ hg log -r tip
592 obsolete feature not enabled but 8 markers found!
593 obsolete feature not enabled but 8 markers found!
593 changeset: 6:3de5eca88c00
594 changeset: 6:3de5eca88c00
594 tag: tip
595 tag: tip
595 parent: 3:6f9641995072
596 parent: 3:6f9641995072
596 user: test
597 user: test
597 date: Thu Jan 01 00:00:00 1970 +0000
598 date: Thu Jan 01 00:00:00 1970 +0000
598 summary: add obsolete_e
599 summary: add obsolete_e
599
600
General Comments 0
You need to be logged in to leave comments. Login now