Show More
@@ -1,346 +1,353 | |||||
1 | # repoview.py - Filtered view of a localrepo object |
|
1 | # repoview.py - Filtered view of a localrepo object | |
2 | # |
|
2 | # | |
3 | # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
|
3 | # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org> | |
4 | # Logilab SA <contact@logilab.fr> |
|
4 | # Logilab SA <contact@logilab.fr> | |
5 | # |
|
5 | # | |
6 | # This software may be used and distributed according to the terms of the |
|
6 | # This software may be used and distributed according to the terms of the | |
7 | # GNU General Public License version 2 or any later version. |
|
7 | # GNU General Public License version 2 or any later version. | |
8 |
|
8 | |||
9 | from __future__ import absolute_import |
|
9 | from __future__ import absolute_import | |
10 |
|
10 | |||
11 | import copy |
|
11 | import copy | |
12 | import heapq |
|
12 | import heapq | |
13 | import struct |
|
13 | import struct | |
14 |
|
14 | |||
15 | from .node import nullrev |
|
15 | from .node import nullrev | |
16 | from . import ( |
|
16 | from . import ( | |
17 | error, |
|
17 | error, | |
18 | obsolete, |
|
18 | obsolete, | |
19 | phases, |
|
19 | phases, | |
20 | tags as tagsmod, |
|
20 | tags as tagsmod, | |
21 | util, |
|
21 | util, | |
22 | ) |
|
22 | ) | |
23 |
|
23 | |||
24 | def hideablerevs(repo): |
|
24 | def hideablerevs(repo): | |
25 | """Revisions candidates to be hidden |
|
25 | """Revisions candidates to be hidden | |
26 |
|
26 | |||
27 | This is a standalone function to help extensions to wrap it.""" |
|
27 | This is a standalone function to help extensions to wrap it.""" | |
28 | return obsolete.getrevs(repo, 'obsolete') |
|
28 | return obsolete.getrevs(repo, 'obsolete') | |
29 |
|
29 | |||
30 | def _getstatichidden(repo): |
|
30 | def _getstatichidden(repo): | |
31 | """Revision to be hidden (disregarding dynamic blocker) |
|
31 | """Revision to be hidden (disregarding dynamic blocker) | |
32 |
|
32 | |||
33 | To keep a consistent graph, we cannot hide any revisions with |
|
33 | To keep a consistent graph, we cannot hide any revisions with | |
34 | non-hidden descendants. This function computes the set of |
|
34 | non-hidden descendants. This function computes the set of | |
35 | revisions that could be hidden while keeping the graph consistent. |
|
35 | revisions that could be hidden while keeping the graph consistent. | |
36 |
|
36 | |||
37 | A second pass will be done to apply "dynamic blocker" like bookmarks or |
|
37 | A second pass will be done to apply "dynamic blocker" like bookmarks or | |
38 | working directory parents. |
|
38 | working directory parents. | |
39 |
|
39 | |||
40 | """ |
|
40 | """ | |
41 | assert not repo.changelog.filteredrevs |
|
41 | assert not repo.changelog.filteredrevs | |
42 | hidden = set(hideablerevs(repo)) |
|
42 | hidden = set(hideablerevs(repo)) | |
43 | if hidden: |
|
43 | if hidden: | |
44 | getphase = repo._phasecache.phase |
|
44 | getphase = repo._phasecache.phase | |
45 | getparentrevs = repo.changelog.parentrevs |
|
45 | getparentrevs = repo.changelog.parentrevs | |
46 | # Skip heads which are public (guaranteed to not be hidden) |
|
46 | # Skip heads which are public (guaranteed to not be hidden) | |
47 | heap = [-r for r in repo.changelog.headrevs() if getphase(repo, r)] |
|
47 | heap = [-r for r in repo.changelog.headrevs() if getphase(repo, r)] | |
48 | heapq.heapify(heap) |
|
48 | heapq.heapify(heap) | |
49 | heappop = heapq.heappop |
|
49 | heappop = heapq.heappop | |
50 | heappush = heapq.heappush |
|
50 | heappush = heapq.heappush | |
51 | seen = set() # no need to init it with heads, they have no children |
|
51 | seen = set() # no need to init it with heads, they have no children | |
52 | while heap: |
|
52 | while heap: | |
53 | rev = -heappop(heap) |
|
53 | rev = -heappop(heap) | |
54 | # All children have been processed so at that point, if no children |
|
54 | # All children have been processed so at that point, if no children | |
55 | # removed 'rev' from the 'hidden' set, 'rev' is going to be hidden. |
|
55 | # removed 'rev' from the 'hidden' set, 'rev' is going to be hidden. | |
56 | blocker = rev not in hidden |
|
56 | blocker = rev not in hidden | |
57 | for parent in getparentrevs(rev): |
|
57 | for parent in getparentrevs(rev): | |
58 | if parent == nullrev: |
|
58 | if parent == nullrev: | |
59 | continue |
|
59 | continue | |
60 | if blocker: |
|
60 | if blocker: | |
61 | # If visible, ensure parent will be visible too |
|
61 | # If visible, ensure parent will be visible too | |
62 | hidden.discard(parent) |
|
62 | hidden.discard(parent) | |
63 | # - Avoid adding the same revision twice |
|
63 | # - Avoid adding the same revision twice | |
64 | # - Skip nodes which are public (guaranteed to not be hidden) |
|
64 | # - Skip nodes which are public (guaranteed to not be hidden) | |
65 | pre = len(seen) |
|
65 | pre = len(seen) | |
66 | seen.add(parent) |
|
66 | seen.add(parent) | |
67 | if pre < len(seen) and getphase(repo, rev): |
|
67 | if pre < len(seen) and getphase(repo, rev): | |
68 | heappush(heap, -parent) |
|
68 | heappush(heap, -parent) | |
69 | return hidden |
|
69 | return hidden | |
70 |
|
70 | |||
71 | def _getdynamicblockers(repo): |
|
71 | def _getdynamicblockers(repo): | |
72 | """Non-cacheable revisions blocking hidden changesets from being filtered. |
|
72 | """Non-cacheable revisions blocking hidden changesets from being filtered. | |
73 |
|
73 | |||
74 | Get revisions that will block hidden changesets and are likely to change, |
|
74 | Get revisions that will block hidden changesets and are likely to change, | |
75 | but unlikely to create hidden blockers. They won't be cached, so be careful |
|
75 | but unlikely to create hidden blockers. They won't be cached, so be careful | |
76 | with adding additional computation.""" |
|
76 | with adding additional computation.""" | |
77 |
|
77 | |||
78 | cl = repo.changelog |
|
78 | cl = repo.changelog | |
79 | blockers = set() |
|
79 | blockers = set() | |
80 | blockers.update([par.rev() for par in repo[None].parents()]) |
|
80 | blockers.update([par.rev() for par in repo[None].parents()]) | |
81 | blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()]) |
|
81 | blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()]) | |
82 |
|
82 | |||
83 | tags = {} |
|
83 | tags = {} | |
84 | tagsmod.readlocaltags(repo.ui, repo, tags, {}) |
|
84 | tagsmod.readlocaltags(repo.ui, repo, tags, {}) | |
85 | if tags: |
|
85 | if tags: | |
86 | rev, nodemap = cl.rev, cl.nodemap |
|
86 | rev, nodemap = cl.rev, cl.nodemap | |
87 | blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap) |
|
87 | blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap) | |
88 | return blockers |
|
88 | return blockers | |
89 |
|
89 | |||
90 | cacheversion = 1 |
|
90 | cacheversion = 1 | |
91 | cachefile = 'cache/hidden' |
|
91 | cachefile = 'cache/hidden' | |
92 |
|
92 | |||
93 | def cachehash(repo, hideable): |
|
93 | def cachehash(repo, hideable): | |
94 | """return sha1 hash of repository data to identify a valid cache. |
|
94 | """return sha1 hash of repository data to identify a valid cache. | |
95 |
|
95 | |||
96 | We calculate a sha1 of repo heads and the content of the obsstore and write |
|
96 | We calculate a sha1 of repo heads and the content of the obsstore and write | |
97 | it to the cache. Upon reading we can easily validate by checking the hash |
|
97 | it to the cache. Upon reading we can easily validate by checking the hash | |
98 | against the stored one and discard the cache in case the hashes don't match. |
|
98 | against the stored one and discard the cache in case the hashes don't match. | |
99 | """ |
|
99 | """ | |
100 | h = util.sha1() |
|
100 | h = util.sha1() | |
101 | h.update(''.join(repo.heads())) |
|
101 | h.update(''.join(repo.heads())) | |
102 | h.update(str(hash(frozenset(hideable)))) |
|
102 | h.update(str(hash(frozenset(hideable)))) | |
103 | return h.digest() |
|
103 | return h.digest() | |
104 |
|
104 | |||
105 | def _writehiddencache(cachefile, cachehash, hidden): |
|
105 | def _writehiddencache(cachefile, cachehash, hidden): | |
106 | """write hidden data to a cache file""" |
|
106 | """write hidden data to a cache file""" | |
107 | data = struct.pack('>%ii' % len(hidden), *sorted(hidden)) |
|
107 | data = struct.pack('>%ii' % len(hidden), *sorted(hidden)) | |
108 | cachefile.write(struct.pack(">H", cacheversion)) |
|
108 | cachefile.write(struct.pack(">H", cacheversion)) | |
109 | cachefile.write(cachehash) |
|
109 | cachefile.write(cachehash) | |
110 | cachefile.write(data) |
|
110 | cachefile.write(data) | |
111 |
|
111 | |||
112 | def trywritehiddencache(repo, hideable, hidden): |
|
112 | def trywritehiddencache(repo, hideable, hidden): | |
113 | """write cache of hidden changesets to disk |
|
113 | """write cache of hidden changesets to disk | |
114 |
|
114 | |||
115 | Will not write the cache if a wlock cannot be obtained lazily. |
|
115 | Will not write the cache if a wlock cannot be obtained lazily. | |
116 | The cache consists of a head of 22byte: |
|
116 | The cache consists of a head of 22byte: | |
117 | 2 byte version number of the cache |
|
117 | 2 byte version number of the cache | |
118 | 20 byte sha1 to validate the cache |
|
118 | 20 byte sha1 to validate the cache | |
119 | n*4 byte hidden revs |
|
119 | n*4 byte hidden revs | |
120 | """ |
|
120 | """ | |
121 | wlock = fh = None |
|
121 | wlock = fh = None | |
122 | try: |
|
122 | try: | |
123 | wlock = repo.wlock(wait=False) |
|
123 | wlock = repo.wlock(wait=False) | |
124 | # write cache to file |
|
124 | # write cache to file | |
125 | newhash = cachehash(repo, hideable) |
|
125 | newhash = cachehash(repo, hideable) | |
126 | fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True) |
|
126 | fh = repo.vfs.open(cachefile, 'w+b', atomictemp=True) | |
127 | _writehiddencache(fh, newhash, hidden) |
|
127 | _writehiddencache(fh, newhash, hidden) | |
128 | except (IOError, OSError): |
|
128 | except (IOError, OSError): | |
129 | repo.ui.debug('error writing hidden changesets cache\n') |
|
129 | repo.ui.debug('error writing hidden changesets cache\n') | |
130 | except error.LockHeld: |
|
130 | except error.LockHeld: | |
131 | repo.ui.debug('cannot obtain lock to write hidden changesets cache\n') |
|
131 | repo.ui.debug('cannot obtain lock to write hidden changesets cache\n') | |
132 | finally: |
|
132 | finally: | |
133 | if fh: |
|
133 | if fh: | |
134 | fh.close() |
|
134 | fh.close() | |
135 | if wlock: |
|
135 | if wlock: | |
136 | wlock.release() |
|
136 | wlock.release() | |
137 |
|
137 | |||
138 | def tryreadcache(repo, hideable): |
|
138 | def tryreadcache(repo, hideable): | |
139 | """read a cache if the cache exists and is valid, otherwise returns None.""" |
|
139 | """read a cache if the cache exists and is valid, otherwise returns None.""" | |
140 | hidden = fh = None |
|
140 | hidden = fh = None | |
141 | try: |
|
141 | try: | |
142 | if repo.vfs.exists(cachefile): |
|
142 | if repo.vfs.exists(cachefile): | |
143 | fh = repo.vfs.open(cachefile, 'rb') |
|
143 | fh = repo.vfs.open(cachefile, 'rb') | |
144 | version, = struct.unpack(">H", fh.read(2)) |
|
144 | version, = struct.unpack(">H", fh.read(2)) | |
145 | oldhash = fh.read(20) |
|
145 | oldhash = fh.read(20) | |
146 | newhash = cachehash(repo, hideable) |
|
146 | newhash = cachehash(repo, hideable) | |
147 | if (cacheversion, oldhash) == (version, newhash): |
|
147 | if (cacheversion, oldhash) == (version, newhash): | |
148 | # cache is valid, so we can start reading the hidden revs |
|
148 | # cache is valid, so we can start reading the hidden revs | |
149 | data = fh.read() |
|
149 | data = fh.read() | |
150 | count = len(data) / 4 |
|
150 | count = len(data) / 4 | |
151 | hidden = frozenset(struct.unpack('>%ii' % count, data)) |
|
151 | hidden = frozenset(struct.unpack('>%ii' % count, data)) | |
152 | return hidden |
|
152 | return hidden | |
|
153 | except struct.error: | |||
|
154 | repo.ui.debug('corrupted hidden cache\n') | |||
|
155 | # No need to fix the content as it will get rewritten | |||
|
156 | return None | |||
|
157 | except (IOError, OSError): | |||
|
158 | repo.ui.debug('cannot read hidden cache\n') | |||
|
159 | return None | |||
153 | finally: |
|
160 | finally: | |
154 | if fh: |
|
161 | if fh: | |
155 | fh.close() |
|
162 | fh.close() | |
156 |
|
163 | |||
157 | def computehidden(repo): |
|
164 | def computehidden(repo): | |
158 | """compute the set of hidden revision to filter |
|
165 | """compute the set of hidden revision to filter | |
159 |
|
166 | |||
160 | During most operation hidden should be filtered.""" |
|
167 | During most operation hidden should be filtered.""" | |
161 | assert not repo.changelog.filteredrevs |
|
168 | assert not repo.changelog.filteredrevs | |
162 |
|
169 | |||
163 | hidden = frozenset() |
|
170 | hidden = frozenset() | |
164 | hideable = hideablerevs(repo) |
|
171 | hideable = hideablerevs(repo) | |
165 | if hideable: |
|
172 | if hideable: | |
166 | cl = repo.changelog |
|
173 | cl = repo.changelog | |
167 | hidden = tryreadcache(repo, hideable) |
|
174 | hidden = tryreadcache(repo, hideable) | |
168 | if hidden is None: |
|
175 | if hidden is None: | |
169 | hidden = frozenset(_getstatichidden(repo)) |
|
176 | hidden = frozenset(_getstatichidden(repo)) | |
170 | trywritehiddencache(repo, hideable, hidden) |
|
177 | trywritehiddencache(repo, hideable, hidden) | |
171 |
|
178 | |||
172 | # check if we have wd parents, bookmarks or tags pointing to hidden |
|
179 | # check if we have wd parents, bookmarks or tags pointing to hidden | |
173 | # changesets and remove those. |
|
180 | # changesets and remove those. | |
174 | dynamic = hidden & _getdynamicblockers(repo) |
|
181 | dynamic = hidden & _getdynamicblockers(repo) | |
175 | if dynamic: |
|
182 | if dynamic: | |
176 | blocked = cl.ancestors(dynamic, inclusive=True) |
|
183 | blocked = cl.ancestors(dynamic, inclusive=True) | |
177 | hidden = frozenset(r for r in hidden if r not in blocked) |
|
184 | hidden = frozenset(r for r in hidden if r not in blocked) | |
178 | return hidden |
|
185 | return hidden | |
179 |
|
186 | |||
180 | def computeunserved(repo): |
|
187 | def computeunserved(repo): | |
181 | """compute the set of revision that should be filtered when used a server |
|
188 | """compute the set of revision that should be filtered when used a server | |
182 |
|
189 | |||
183 | Secret and hidden changeset should not pretend to be here.""" |
|
190 | Secret and hidden changeset should not pretend to be here.""" | |
184 | assert not repo.changelog.filteredrevs |
|
191 | assert not repo.changelog.filteredrevs | |
185 | # fast path in simple case to avoid impact of non optimised code |
|
192 | # fast path in simple case to avoid impact of non optimised code | |
186 | hiddens = filterrevs(repo, 'visible') |
|
193 | hiddens = filterrevs(repo, 'visible') | |
187 | if phases.hassecret(repo): |
|
194 | if phases.hassecret(repo): | |
188 | cl = repo.changelog |
|
195 | cl = repo.changelog | |
189 | secret = phases.secret |
|
196 | secret = phases.secret | |
190 | getphase = repo._phasecache.phase |
|
197 | getphase = repo._phasecache.phase | |
191 | first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret]) |
|
198 | first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret]) | |
192 | revs = cl.revs(start=first) |
|
199 | revs = cl.revs(start=first) | |
193 | secrets = set(r for r in revs if getphase(repo, r) >= secret) |
|
200 | secrets = set(r for r in revs if getphase(repo, r) >= secret) | |
194 | return frozenset(hiddens | secrets) |
|
201 | return frozenset(hiddens | secrets) | |
195 | else: |
|
202 | else: | |
196 | return hiddens |
|
203 | return hiddens | |
197 |
|
204 | |||
198 | def computemutable(repo): |
|
205 | def computemutable(repo): | |
199 | """compute the set of revision that should be filtered when used a server |
|
206 | """compute the set of revision that should be filtered when used a server | |
200 |
|
207 | |||
201 | Secret and hidden changeset should not pretend to be here.""" |
|
208 | Secret and hidden changeset should not pretend to be here.""" | |
202 | assert not repo.changelog.filteredrevs |
|
209 | assert not repo.changelog.filteredrevs | |
203 | # fast check to avoid revset call on huge repo |
|
210 | # fast check to avoid revset call on huge repo | |
204 | if any(repo._phasecache.phaseroots[1:]): |
|
211 | if any(repo._phasecache.phaseroots[1:]): | |
205 | getphase = repo._phasecache.phase |
|
212 | getphase = repo._phasecache.phase | |
206 | maymutable = filterrevs(repo, 'base') |
|
213 | maymutable = filterrevs(repo, 'base') | |
207 | return frozenset(r for r in maymutable if getphase(repo, r)) |
|
214 | return frozenset(r for r in maymutable if getphase(repo, r)) | |
208 | return frozenset() |
|
215 | return frozenset() | |
209 |
|
216 | |||
210 | def computeimpactable(repo): |
|
217 | def computeimpactable(repo): | |
211 | """Everything impactable by mutable revision |
|
218 | """Everything impactable by mutable revision | |
212 |
|
219 | |||
213 | The immutable filter still have some chance to get invalidated. This will |
|
220 | The immutable filter still have some chance to get invalidated. This will | |
214 | happen when: |
|
221 | happen when: | |
215 |
|
222 | |||
216 | - you garbage collect hidden changeset, |
|
223 | - you garbage collect hidden changeset, | |
217 | - public phase is moved backward, |
|
224 | - public phase is moved backward, | |
218 | - something is changed in the filtering (this could be fixed) |
|
225 | - something is changed in the filtering (this could be fixed) | |
219 |
|
226 | |||
220 | This filter out any mutable changeset and any public changeset that may be |
|
227 | This filter out any mutable changeset and any public changeset that may be | |
221 | impacted by something happening to a mutable revision. |
|
228 | impacted by something happening to a mutable revision. | |
222 |
|
229 | |||
223 | This is achieved by filtered everything with a revision number egal or |
|
230 | This is achieved by filtered everything with a revision number egal or | |
224 | higher than the first mutable changeset is filtered.""" |
|
231 | higher than the first mutable changeset is filtered.""" | |
225 | assert not repo.changelog.filteredrevs |
|
232 | assert not repo.changelog.filteredrevs | |
226 | cl = repo.changelog |
|
233 | cl = repo.changelog | |
227 | firstmutable = len(cl) |
|
234 | firstmutable = len(cl) | |
228 | for roots in repo._phasecache.phaseroots[1:]: |
|
235 | for roots in repo._phasecache.phaseroots[1:]: | |
229 | if roots: |
|
236 | if roots: | |
230 | firstmutable = min(firstmutable, min(cl.rev(r) for r in roots)) |
|
237 | firstmutable = min(firstmutable, min(cl.rev(r) for r in roots)) | |
231 | # protect from nullrev root |
|
238 | # protect from nullrev root | |
232 | firstmutable = max(0, firstmutable) |
|
239 | firstmutable = max(0, firstmutable) | |
233 | return frozenset(xrange(firstmutable, len(cl))) |
|
240 | return frozenset(xrange(firstmutable, len(cl))) | |
234 |
|
241 | |||
235 | # function to compute filtered set |
|
242 | # function to compute filtered set | |
236 | # |
|
243 | # | |
237 | # When adding a new filter you MUST update the table at: |
|
244 | # When adding a new filter you MUST update the table at: | |
238 | # mercurial.branchmap.subsettable |
|
245 | # mercurial.branchmap.subsettable | |
239 | # Otherwise your filter will have to recompute all its branches cache |
|
246 | # Otherwise your filter will have to recompute all its branches cache | |
240 | # from scratch (very slow). |
|
247 | # from scratch (very slow). | |
241 | filtertable = {'visible': computehidden, |
|
248 | filtertable = {'visible': computehidden, | |
242 | 'served': computeunserved, |
|
249 | 'served': computeunserved, | |
243 | 'immutable': computemutable, |
|
250 | 'immutable': computemutable, | |
244 | 'base': computeimpactable} |
|
251 | 'base': computeimpactable} | |
245 |
|
252 | |||
246 | def filterrevs(repo, filtername): |
|
253 | def filterrevs(repo, filtername): | |
247 | """returns set of filtered revision for this filter name""" |
|
254 | """returns set of filtered revision for this filter name""" | |
248 | if filtername not in repo.filteredrevcache: |
|
255 | if filtername not in repo.filteredrevcache: | |
249 | func = filtertable[filtername] |
|
256 | func = filtertable[filtername] | |
250 | repo.filteredrevcache[filtername] = func(repo.unfiltered()) |
|
257 | repo.filteredrevcache[filtername] = func(repo.unfiltered()) | |
251 | return repo.filteredrevcache[filtername] |
|
258 | return repo.filteredrevcache[filtername] | |
252 |
|
259 | |||
253 | class repoview(object): |
|
260 | class repoview(object): | |
254 | """Provide a read/write view of a repo through a filtered changelog |
|
261 | """Provide a read/write view of a repo through a filtered changelog | |
255 |
|
262 | |||
256 | This object is used to access a filtered version of a repository without |
|
263 | This object is used to access a filtered version of a repository without | |
257 | altering the original repository object itself. We can not alter the |
|
264 | altering the original repository object itself. We can not alter the | |
258 | original object for two main reasons: |
|
265 | original object for two main reasons: | |
259 | - It prevents the use of a repo with multiple filters at the same time. In |
|
266 | - It prevents the use of a repo with multiple filters at the same time. In | |
260 | particular when multiple threads are involved. |
|
267 | particular when multiple threads are involved. | |
261 | - It makes scope of the filtering harder to control. |
|
268 | - It makes scope of the filtering harder to control. | |
262 |
|
269 | |||
263 | This object behaves very closely to the original repository. All attribute |
|
270 | This object behaves very closely to the original repository. All attribute | |
264 | operations are done on the original repository: |
|
271 | operations are done on the original repository: | |
265 | - An access to `repoview.someattr` actually returns `repo.someattr`, |
|
272 | - An access to `repoview.someattr` actually returns `repo.someattr`, | |
266 | - A write to `repoview.someattr` actually sets value of `repo.someattr`, |
|
273 | - A write to `repoview.someattr` actually sets value of `repo.someattr`, | |
267 | - A deletion of `repoview.someattr` actually drops `someattr` |
|
274 | - A deletion of `repoview.someattr` actually drops `someattr` | |
268 | from `repo.__dict__`. |
|
275 | from `repo.__dict__`. | |
269 |
|
276 | |||
270 | The only exception is the `changelog` property. It is overridden to return |
|
277 | The only exception is the `changelog` property. It is overridden to return | |
271 | a (surface) copy of `repo.changelog` with some revisions filtered. The |
|
278 | a (surface) copy of `repo.changelog` with some revisions filtered. The | |
272 | `filtername` attribute of the view control the revisions that need to be |
|
279 | `filtername` attribute of the view control the revisions that need to be | |
273 | filtered. (the fact the changelog is copied is an implementation detail). |
|
280 | filtered. (the fact the changelog is copied is an implementation detail). | |
274 |
|
281 | |||
275 | Unlike attributes, this object intercepts all method calls. This means that |
|
282 | Unlike attributes, this object intercepts all method calls. This means that | |
276 | all methods are run on the `repoview` object with the filtered `changelog` |
|
283 | all methods are run on the `repoview` object with the filtered `changelog` | |
277 | property. For this purpose the simple `repoview` class must be mixed with |
|
284 | property. For this purpose the simple `repoview` class must be mixed with | |
278 | the actual class of the repository. This ensures that the resulting |
|
285 | the actual class of the repository. This ensures that the resulting | |
279 | `repoview` object have the very same methods than the repo object. This |
|
286 | `repoview` object have the very same methods than the repo object. This | |
280 | leads to the property below. |
|
287 | leads to the property below. | |
281 |
|
288 | |||
282 | repoview.method() --> repo.__class__.method(repoview) |
|
289 | repoview.method() --> repo.__class__.method(repoview) | |
283 |
|
290 | |||
284 | The inheritance has to be done dynamically because `repo` can be of any |
|
291 | The inheritance has to be done dynamically because `repo` can be of any | |
285 | subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`. |
|
292 | subclasses of `localrepo`. Eg: `bundlerepo` or `statichttprepo`. | |
286 | """ |
|
293 | """ | |
287 |
|
294 | |||
288 | def __init__(self, repo, filtername): |
|
295 | def __init__(self, repo, filtername): | |
289 | object.__setattr__(self, '_unfilteredrepo', repo) |
|
296 | object.__setattr__(self, '_unfilteredrepo', repo) | |
290 | object.__setattr__(self, 'filtername', filtername) |
|
297 | object.__setattr__(self, 'filtername', filtername) | |
291 | object.__setattr__(self, '_clcachekey', None) |
|
298 | object.__setattr__(self, '_clcachekey', None) | |
292 | object.__setattr__(self, '_clcache', None) |
|
299 | object.__setattr__(self, '_clcache', None) | |
293 |
|
300 | |||
294 | # not a propertycache on purpose we shall implement a proper cache later |
|
301 | # not a propertycache on purpose we shall implement a proper cache later | |
295 | @property |
|
302 | @property | |
296 | def changelog(self): |
|
303 | def changelog(self): | |
297 | """return a filtered version of the changeset |
|
304 | """return a filtered version of the changeset | |
298 |
|
305 | |||
299 | this changelog must not be used for writing""" |
|
306 | this changelog must not be used for writing""" | |
300 | # some cache may be implemented later |
|
307 | # some cache may be implemented later | |
301 | unfi = self._unfilteredrepo |
|
308 | unfi = self._unfilteredrepo | |
302 | unfichangelog = unfi.changelog |
|
309 | unfichangelog = unfi.changelog | |
303 | # bypass call to changelog.method |
|
310 | # bypass call to changelog.method | |
304 | unfiindex = unfichangelog.index |
|
311 | unfiindex = unfichangelog.index | |
305 | unfilen = len(unfiindex) - 1 |
|
312 | unfilen = len(unfiindex) - 1 | |
306 | unfinode = unfiindex[unfilen - 1][7] |
|
313 | unfinode = unfiindex[unfilen - 1][7] | |
307 |
|
314 | |||
308 | revs = filterrevs(unfi, self.filtername) |
|
315 | revs = filterrevs(unfi, self.filtername) | |
309 | cl = self._clcache |
|
316 | cl = self._clcache | |
310 | newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed) |
|
317 | newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed) | |
311 | if cl is not None and newkey != self._clcachekey: |
|
318 | if cl is not None and newkey != self._clcachekey: | |
312 | cl = None |
|
319 | cl = None | |
313 | # could have been made None by the previous if |
|
320 | # could have been made None by the previous if | |
314 | if cl is None: |
|
321 | if cl is None: | |
315 | cl = copy.copy(unfichangelog) |
|
322 | cl = copy.copy(unfichangelog) | |
316 | cl.filteredrevs = revs |
|
323 | cl.filteredrevs = revs | |
317 | object.__setattr__(self, '_clcache', cl) |
|
324 | object.__setattr__(self, '_clcache', cl) | |
318 | object.__setattr__(self, '_clcachekey', newkey) |
|
325 | object.__setattr__(self, '_clcachekey', newkey) | |
319 | return cl |
|
326 | return cl | |
320 |
|
327 | |||
321 | def unfiltered(self): |
|
328 | def unfiltered(self): | |
322 | """Return an unfiltered version of a repo""" |
|
329 | """Return an unfiltered version of a repo""" | |
323 | return self._unfilteredrepo |
|
330 | return self._unfilteredrepo | |
324 |
|
331 | |||
325 | def filtered(self, name): |
|
332 | def filtered(self, name): | |
326 | """Return a filtered version of a repository""" |
|
333 | """Return a filtered version of a repository""" | |
327 | if name == self.filtername: |
|
334 | if name == self.filtername: | |
328 | return self |
|
335 | return self | |
329 | return self.unfiltered().filtered(name) |
|
336 | return self.unfiltered().filtered(name) | |
330 |
|
337 | |||
331 | # everything access are forwarded to the proxied repo |
|
338 | # everything access are forwarded to the proxied repo | |
332 | def __getattr__(self, attr): |
|
339 | def __getattr__(self, attr): | |
333 | return getattr(self._unfilteredrepo, attr) |
|
340 | return getattr(self._unfilteredrepo, attr) | |
334 |
|
341 | |||
335 | def __setattr__(self, attr, value): |
|
342 | def __setattr__(self, attr, value): | |
336 | return setattr(self._unfilteredrepo, attr, value) |
|
343 | return setattr(self._unfilteredrepo, attr, value) | |
337 |
|
344 | |||
338 | def __delattr__(self, attr): |
|
345 | def __delattr__(self, attr): | |
339 | return delattr(self._unfilteredrepo, attr) |
|
346 | return delattr(self._unfilteredrepo, attr) | |
340 |
|
347 | |||
341 | # The `requirements` attribute is initialized during __init__. But |
|
348 | # The `requirements` attribute is initialized during __init__. But | |
342 | # __getattr__ won't be called as it also exists on the class. We need |
|
349 | # __getattr__ won't be called as it also exists on the class. We need | |
343 | # explicit forwarding to main repo here |
|
350 | # explicit forwarding to main repo here | |
344 | @property |
|
351 | @property | |
345 | def requirements(self): |
|
352 | def requirements(self): | |
346 | return self._unfilteredrepo.requirements |
|
353 | return self._unfilteredrepo.requirements |
@@ -1,991 +1,1008 | |||||
1 | $ cat >> $HGRCPATH << EOF |
|
1 | $ cat >> $HGRCPATH << EOF | |
2 | > [phases] |
|
2 | > [phases] | |
3 | > # public changeset are not obsolete |
|
3 | > # public changeset are not obsolete | |
4 | > publish=false |
|
4 | > publish=false | |
5 | > [ui] |
|
5 | > [ui] | |
6 | > logtemplate="{rev}:{node|short} ({phase}) [{tags} {bookmarks}] {desc|firstline}\n" |
|
6 | > logtemplate="{rev}:{node|short} ({phase}) [{tags} {bookmarks}] {desc|firstline}\n" | |
7 | > [experimental] |
|
7 | > [experimental] | |
8 | > # drop me once bundle2 is the default, |
|
8 | > # drop me once bundle2 is the default, | |
9 | > # added to get test change early. |
|
9 | > # added to get test change early. | |
10 | > bundle2-exp = True |
|
10 | > bundle2-exp = True | |
11 | > EOF |
|
11 | > EOF | |
12 | $ mkcommit() { |
|
12 | $ mkcommit() { | |
13 | > echo "$1" > "$1" |
|
13 | > echo "$1" > "$1" | |
14 | > hg add "$1" |
|
14 | > hg add "$1" | |
15 | > hg ci -m "add $1" |
|
15 | > hg ci -m "add $1" | |
16 | > } |
|
16 | > } | |
17 | $ getid() { |
|
17 | $ getid() { | |
18 | > hg log -T "{node}\n" --hidden -r "desc('$1')" |
|
18 | > hg log -T "{node}\n" --hidden -r "desc('$1')" | |
19 | > } |
|
19 | > } | |
20 |
|
20 | |||
21 | $ cat > debugkeys.py <<EOF |
|
21 | $ cat > debugkeys.py <<EOF | |
22 | > def reposetup(ui, repo): |
|
22 | > def reposetup(ui, repo): | |
23 | > class debugkeysrepo(repo.__class__): |
|
23 | > class debugkeysrepo(repo.__class__): | |
24 | > def listkeys(self, namespace): |
|
24 | > def listkeys(self, namespace): | |
25 | > ui.write('listkeys %s\n' % (namespace,)) |
|
25 | > ui.write('listkeys %s\n' % (namespace,)) | |
26 | > return super(debugkeysrepo, self).listkeys(namespace) |
|
26 | > return super(debugkeysrepo, self).listkeys(namespace) | |
27 | > |
|
27 | > | |
28 | > if repo.local(): |
|
28 | > if repo.local(): | |
29 | > repo.__class__ = debugkeysrepo |
|
29 | > repo.__class__ = debugkeysrepo | |
30 | > EOF |
|
30 | > EOF | |
31 |
|
31 | |||
32 | $ hg init tmpa |
|
32 | $ hg init tmpa | |
33 | $ cd tmpa |
|
33 | $ cd tmpa | |
34 | $ mkcommit kill_me |
|
34 | $ mkcommit kill_me | |
35 |
|
35 | |||
36 | Checking that the feature is properly disabled |
|
36 | Checking that the feature is properly disabled | |
37 |
|
37 | |||
38 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar |
|
38 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar | |
39 | abort: creating obsolete markers is not enabled on this repo |
|
39 | abort: creating obsolete markers is not enabled on this repo | |
40 | [255] |
|
40 | [255] | |
41 |
|
41 | |||
42 | Enabling it |
|
42 | Enabling it | |
43 |
|
43 | |||
44 | $ cat >> $HGRCPATH << EOF |
|
44 | $ cat >> $HGRCPATH << EOF | |
45 | > [experimental] |
|
45 | > [experimental] | |
46 | > evolution=createmarkers,exchange |
|
46 | > evolution=createmarkers,exchange | |
47 | > EOF |
|
47 | > EOF | |
48 |
|
48 | |||
49 | Killing a single changeset without replacement |
|
49 | Killing a single changeset without replacement | |
50 |
|
50 | |||
51 | $ hg debugobsolete 0 |
|
51 | $ hg debugobsolete 0 | |
52 | abort: changeset references must be full hexadecimal node identifiers |
|
52 | abort: changeset references must be full hexadecimal node identifiers | |
53 | [255] |
|
53 | [255] | |
54 | $ hg debugobsolete '00' |
|
54 | $ hg debugobsolete '00' | |
55 | abort: changeset references must be full hexadecimal node identifiers |
|
55 | abort: changeset references must be full hexadecimal node identifiers | |
56 | [255] |
|
56 | [255] | |
57 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar |
|
57 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar | |
58 | $ hg debugobsolete |
|
58 | $ hg debugobsolete | |
59 | 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} |
|
59 | 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} | |
60 |
|
60 | |||
61 | (test that mercurial is not confused) |
|
61 | (test that mercurial is not confused) | |
62 |
|
62 | |||
63 | $ hg up null --quiet # having 0 as parent prevents it to be hidden |
|
63 | $ hg up null --quiet # having 0 as parent prevents it to be hidden | |
64 | $ hg tip |
|
64 | $ hg tip | |
65 | -1:000000000000 (public) [tip ] |
|
65 | -1:000000000000 (public) [tip ] | |
66 | $ hg up --hidden tip --quiet |
|
66 | $ hg up --hidden tip --quiet | |
67 |
|
67 | |||
68 | Killing a single changeset with itself should fail |
|
68 | Killing a single changeset with itself should fail | |
69 | (simple local safeguard) |
|
69 | (simple local safeguard) | |
70 |
|
70 | |||
71 | $ hg debugobsolete `getid kill_me` `getid kill_me` |
|
71 | $ hg debugobsolete `getid kill_me` `getid kill_me` | |
72 | abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0 |
|
72 | abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0 | |
73 | [255] |
|
73 | [255] | |
74 |
|
74 | |||
75 | $ cd .. |
|
75 | $ cd .. | |
76 |
|
76 | |||
77 | Killing a single changeset with replacement |
|
77 | Killing a single changeset with replacement | |
78 | (and testing the format option) |
|
78 | (and testing the format option) | |
79 |
|
79 | |||
80 | $ hg init tmpb |
|
80 | $ hg init tmpb | |
81 | $ cd tmpb |
|
81 | $ cd tmpb | |
82 | $ mkcommit a |
|
82 | $ mkcommit a | |
83 | $ mkcommit b |
|
83 | $ mkcommit b | |
84 | $ mkcommit original_c |
|
84 | $ mkcommit original_c | |
85 | $ hg up "desc('b')" |
|
85 | $ hg up "desc('b')" | |
86 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
86 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
87 | $ mkcommit new_c |
|
87 | $ mkcommit new_c | |
88 | created new head |
|
88 | created new head | |
89 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden |
|
89 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden | |
90 | $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120' |
|
90 | $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120' | |
91 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden |
|
91 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden | |
92 | 2:245bde4270cd add original_c |
|
92 | 2:245bde4270cd add original_c | |
93 | $ hg debugrevlog -cd |
|
93 | $ hg debugrevlog -cd | |
94 | # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen |
|
94 | # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen | |
95 | 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0 |
|
95 | 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0 | |
96 | 1 0 -1 59 118 59 59 0 0 58 116 0 1 0 |
|
96 | 1 0 -1 59 118 59 59 0 0 58 116 0 1 0 | |
97 | 2 1 -1 118 193 118 118 59 0 76 192 0 1 0 |
|
97 | 2 1 -1 118 193 118 118 59 0 76 192 0 1 0 | |
98 | 3 1 -1 193 260 193 193 59 0 66 258 0 2 0 |
|
98 | 3 1 -1 193 260 193 193 59 0 66 258 0 2 0 | |
99 | $ hg debugobsolete |
|
99 | $ hg debugobsolete | |
100 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
100 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
101 |
|
101 | |||
102 | (check for version number of the obsstore) |
|
102 | (check for version number of the obsstore) | |
103 |
|
103 | |||
104 | $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null |
|
104 | $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null | |
105 | \x00 (no-eol) (esc) |
|
105 | \x00 (no-eol) (esc) | |
106 |
|
106 | |||
107 | do it again (it read the obsstore before adding new changeset) |
|
107 | do it again (it read the obsstore before adding new changeset) | |
108 |
|
108 | |||
109 | $ hg up '.^' |
|
109 | $ hg up '.^' | |
110 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
110 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
111 | $ mkcommit new_2_c |
|
111 | $ mkcommit new_2_c | |
112 | created new head |
|
112 | created new head | |
113 | $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c` |
|
113 | $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c` | |
114 | $ hg debugobsolete |
|
114 | $ hg debugobsolete | |
115 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
115 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
116 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
116 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
117 |
|
117 | |||
118 | Register two markers with a missing node |
|
118 | Register two markers with a missing node | |
119 |
|
119 | |||
120 | $ hg up '.^' |
|
120 | $ hg up '.^' | |
121 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
121 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
122 | $ mkcommit new_3_c |
|
122 | $ mkcommit new_3_c | |
123 | created new head |
|
123 | created new head | |
124 | $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337 |
|
124 | $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337 | |
125 | $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c` |
|
125 | $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c` | |
126 | $ hg debugobsolete |
|
126 | $ hg debugobsolete | |
127 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
127 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
128 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
128 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
129 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
129 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
130 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
130 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
131 |
|
131 | |||
132 | Refuse pathological nullid successors |
|
132 | Refuse pathological nullid successors | |
133 | $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000 |
|
133 | $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000 | |
134 | transaction abort! |
|
134 | transaction abort! | |
135 | rollback completed |
|
135 | rollback completed | |
136 | abort: bad obsolescence marker detected: invalid successors nullid |
|
136 | abort: bad obsolescence marker detected: invalid successors nullid | |
137 | [255] |
|
137 | [255] | |
138 |
|
138 | |||
139 | Check that graphlog detect that a changeset is obsolete: |
|
139 | Check that graphlog detect that a changeset is obsolete: | |
140 |
|
140 | |||
141 | $ hg log -G |
|
141 | $ hg log -G | |
142 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
142 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c | |
143 | | |
|
143 | | | |
144 | o 1:7c3bad9141dc (draft) [ ] add b |
|
144 | o 1:7c3bad9141dc (draft) [ ] add b | |
145 | | |
|
145 | | | |
146 | o 0:1f0dee641bb7 (draft) [ ] add a |
|
146 | o 0:1f0dee641bb7 (draft) [ ] add a | |
147 |
|
147 | |||
148 |
|
148 | |||
149 | check that heads does not report them |
|
149 | check that heads does not report them | |
150 |
|
150 | |||
151 | $ hg heads |
|
151 | $ hg heads | |
152 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
152 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
153 | $ hg heads --hidden |
|
153 | $ hg heads --hidden | |
154 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
154 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
155 | 4:ca819180edb9 (draft) [ ] add new_2_c |
|
155 | 4:ca819180edb9 (draft) [ ] add new_2_c | |
156 | 3:cdbce2fbb163 (draft) [ ] add new_c |
|
156 | 3:cdbce2fbb163 (draft) [ ] add new_c | |
157 | 2:245bde4270cd (draft) [ ] add original_c |
|
157 | 2:245bde4270cd (draft) [ ] add original_c | |
158 |
|
158 | |||
159 |
|
159 | |||
160 | check that summary does not report them |
|
160 | check that summary does not report them | |
161 |
|
161 | |||
162 | $ hg init ../sink |
|
162 | $ hg init ../sink | |
163 | $ echo '[paths]' >> .hg/hgrc |
|
163 | $ echo '[paths]' >> .hg/hgrc | |
164 | $ echo 'default=../sink' >> .hg/hgrc |
|
164 | $ echo 'default=../sink' >> .hg/hgrc | |
165 | $ hg summary --remote |
|
165 | $ hg summary --remote | |
166 | parent: 5:5601fb93a350 tip |
|
166 | parent: 5:5601fb93a350 tip | |
167 | add new_3_c |
|
167 | add new_3_c | |
168 | branch: default |
|
168 | branch: default | |
169 | commit: (clean) |
|
169 | commit: (clean) | |
170 | update: (current) |
|
170 | update: (current) | |
171 | phases: 3 draft |
|
171 | phases: 3 draft | |
172 | remote: 3 outgoing |
|
172 | remote: 3 outgoing | |
173 |
|
173 | |||
174 | $ hg summary --remote --hidden |
|
174 | $ hg summary --remote --hidden | |
175 | parent: 5:5601fb93a350 tip |
|
175 | parent: 5:5601fb93a350 tip | |
176 | add new_3_c |
|
176 | add new_3_c | |
177 | branch: default |
|
177 | branch: default | |
178 | commit: (clean) |
|
178 | commit: (clean) | |
179 | update: 3 new changesets, 4 branch heads (merge) |
|
179 | update: 3 new changesets, 4 branch heads (merge) | |
180 | phases: 6 draft |
|
180 | phases: 6 draft | |
181 | remote: 3 outgoing |
|
181 | remote: 3 outgoing | |
182 |
|
182 | |||
183 | check that various commands work well with filtering |
|
183 | check that various commands work well with filtering | |
184 |
|
184 | |||
185 | $ hg tip |
|
185 | $ hg tip | |
186 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
186 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
187 | $ hg log -r 6 |
|
187 | $ hg log -r 6 | |
188 | abort: unknown revision '6'! |
|
188 | abort: unknown revision '6'! | |
189 | [255] |
|
189 | [255] | |
190 | $ hg log -r 4 |
|
190 | $ hg log -r 4 | |
191 | abort: hidden revision '4'! |
|
191 | abort: hidden revision '4'! | |
192 | (use --hidden to access hidden revisions) |
|
192 | (use --hidden to access hidden revisions) | |
193 | [255] |
|
193 | [255] | |
194 | $ hg debugrevspec 'rev(6)' |
|
194 | $ hg debugrevspec 'rev(6)' | |
195 | $ hg debugrevspec 'rev(4)' |
|
195 | $ hg debugrevspec 'rev(4)' | |
196 | $ hg debugrevspec 'null' |
|
196 | $ hg debugrevspec 'null' | |
197 | -1 |
|
197 | -1 | |
198 |
|
198 | |||
199 | Check that public changeset are not accounted as obsolete: |
|
199 | Check that public changeset are not accounted as obsolete: | |
200 |
|
200 | |||
201 | $ hg --hidden phase --public 2 |
|
201 | $ hg --hidden phase --public 2 | |
202 | $ hg log -G |
|
202 | $ hg log -G | |
203 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
203 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c | |
204 | | |
|
204 | | | |
205 | | o 2:245bde4270cd (public) [ ] add original_c |
|
205 | | o 2:245bde4270cd (public) [ ] add original_c | |
206 | |/ |
|
206 | |/ | |
207 | o 1:7c3bad9141dc (public) [ ] add b |
|
207 | o 1:7c3bad9141dc (public) [ ] add b | |
208 | | |
|
208 | | | |
209 | o 0:1f0dee641bb7 (public) [ ] add a |
|
209 | o 0:1f0dee641bb7 (public) [ ] add a | |
210 |
|
210 | |||
211 |
|
211 | |||
212 | And that bumped changeset are detected |
|
212 | And that bumped changeset are detected | |
213 | -------------------------------------- |
|
213 | -------------------------------------- | |
214 |
|
214 | |||
215 | If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also |
|
215 | If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also | |
216 | note that the bumped changeset (5:5601fb93a350) is not a direct successor of |
|
216 | note that the bumped changeset (5:5601fb93a350) is not a direct successor of | |
217 | the public changeset |
|
217 | the public changeset | |
218 |
|
218 | |||
219 | $ hg log --hidden -r 'bumped()' |
|
219 | $ hg log --hidden -r 'bumped()' | |
220 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
220 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
221 |
|
221 | |||
222 | And that we can't push bumped changeset |
|
222 | And that we can't push bumped changeset | |
223 |
|
223 | |||
224 | $ hg push ../tmpa -r 0 --force #(make repo related) |
|
224 | $ hg push ../tmpa -r 0 --force #(make repo related) | |
225 | pushing to ../tmpa |
|
225 | pushing to ../tmpa | |
226 | searching for changes |
|
226 | searching for changes | |
227 | warning: repository is unrelated |
|
227 | warning: repository is unrelated | |
228 | adding changesets |
|
228 | adding changesets | |
229 | adding manifests |
|
229 | adding manifests | |
230 | adding file changes |
|
230 | adding file changes | |
231 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
231 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
232 | $ hg push ../tmpa |
|
232 | $ hg push ../tmpa | |
233 | pushing to ../tmpa |
|
233 | pushing to ../tmpa | |
234 | searching for changes |
|
234 | searching for changes | |
235 | abort: push includes bumped changeset: 5601fb93a350! |
|
235 | abort: push includes bumped changeset: 5601fb93a350! | |
236 | [255] |
|
236 | [255] | |
237 |
|
237 | |||
238 | Fixing "bumped" situation |
|
238 | Fixing "bumped" situation | |
239 | We need to create a clone of 5 and add a special marker with a flag |
|
239 | We need to create a clone of 5 and add a special marker with a flag | |
240 |
|
240 | |||
241 | $ hg summary |
|
241 | $ hg summary | |
242 | parent: 5:5601fb93a350 tip |
|
242 | parent: 5:5601fb93a350 tip | |
243 | add new_3_c |
|
243 | add new_3_c | |
244 | branch: default |
|
244 | branch: default | |
245 | commit: (clean) |
|
245 | commit: (clean) | |
246 | update: 1 new changesets, 2 branch heads (merge) |
|
246 | update: 1 new changesets, 2 branch heads (merge) | |
247 | phases: 1 draft |
|
247 | phases: 1 draft | |
248 | bumped: 1 changesets |
|
248 | bumped: 1 changesets | |
249 | $ hg up '5^' |
|
249 | $ hg up '5^' | |
250 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
250 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
251 | $ hg revert -ar 5 |
|
251 | $ hg revert -ar 5 | |
252 | adding new_3_c |
|
252 | adding new_3_c | |
253 | $ hg ci -m 'add n3w_3_c' |
|
253 | $ hg ci -m 'add n3w_3_c' | |
254 | created new head |
|
254 | created new head | |
255 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` |
|
255 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` | |
256 | $ hg log -r 'bumped()' |
|
256 | $ hg log -r 'bumped()' | |
257 | $ hg log -G |
|
257 | $ hg log -G | |
258 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
258 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c | |
259 | | |
|
259 | | | |
260 | | o 2:245bde4270cd (public) [ ] add original_c |
|
260 | | o 2:245bde4270cd (public) [ ] add original_c | |
261 | |/ |
|
261 | |/ | |
262 | o 1:7c3bad9141dc (public) [ ] add b |
|
262 | o 1:7c3bad9141dc (public) [ ] add b | |
263 | | |
|
263 | | | |
264 | o 0:1f0dee641bb7 (public) [ ] add a |
|
264 | o 0:1f0dee641bb7 (public) [ ] add a | |
265 |
|
265 | |||
266 |
|
266 | |||
267 | $ cd .. |
|
267 | $ cd .. | |
268 |
|
268 | |||
269 | Revision 0 is hidden |
|
269 | Revision 0 is hidden | |
270 | -------------------- |
|
270 | -------------------- | |
271 |
|
271 | |||
272 | $ hg init rev0hidden |
|
272 | $ hg init rev0hidden | |
273 | $ cd rev0hidden |
|
273 | $ cd rev0hidden | |
274 |
|
274 | |||
275 | $ mkcommit kill0 |
|
275 | $ mkcommit kill0 | |
276 | $ hg up -q null |
|
276 | $ hg up -q null | |
277 | $ hg debugobsolete `getid kill0` |
|
277 | $ hg debugobsolete `getid kill0` | |
278 | $ mkcommit a |
|
278 | $ mkcommit a | |
279 | $ mkcommit b |
|
279 | $ mkcommit b | |
280 |
|
280 | |||
281 | Should pick the first visible revision as "repo" node |
|
281 | Should pick the first visible revision as "repo" node | |
282 |
|
282 | |||
283 | $ hg archive ../archive-null |
|
283 | $ hg archive ../archive-null | |
284 | $ cat ../archive-null/.hg_archival.txt |
|
284 | $ cat ../archive-null/.hg_archival.txt | |
285 | repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e |
|
285 | repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e | |
286 | node: 7c3bad9141dcb46ff89abf5f61856facd56e476c |
|
286 | node: 7c3bad9141dcb46ff89abf5f61856facd56e476c | |
287 | branch: default |
|
287 | branch: default | |
288 | latesttag: null |
|
288 | latesttag: null | |
289 | latesttagdistance: 2 |
|
289 | latesttagdistance: 2 | |
290 | changessincelatesttag: 2 |
|
290 | changessincelatesttag: 2 | |
291 |
|
291 | |||
292 |
|
292 | |||
293 | $ cd .. |
|
293 | $ cd .. | |
294 |
|
294 | |||
295 | Exchange Test |
|
295 | Exchange Test | |
296 | ============================ |
|
296 | ============================ | |
297 |
|
297 | |||
298 | Destination repo does not have any data |
|
298 | Destination repo does not have any data | |
299 | --------------------------------------- |
|
299 | --------------------------------------- | |
300 |
|
300 | |||
301 | Simple incoming test |
|
301 | Simple incoming test | |
302 |
|
302 | |||
303 | $ hg init tmpc |
|
303 | $ hg init tmpc | |
304 | $ cd tmpc |
|
304 | $ cd tmpc | |
305 | $ hg incoming ../tmpb |
|
305 | $ hg incoming ../tmpb | |
306 | comparing with ../tmpb |
|
306 | comparing with ../tmpb | |
307 | 0:1f0dee641bb7 (public) [ ] add a |
|
307 | 0:1f0dee641bb7 (public) [ ] add a | |
308 | 1:7c3bad9141dc (public) [ ] add b |
|
308 | 1:7c3bad9141dc (public) [ ] add b | |
309 | 2:245bde4270cd (public) [ ] add original_c |
|
309 | 2:245bde4270cd (public) [ ] add original_c | |
310 | 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
310 | 6:6f9641995072 (draft) [tip ] add n3w_3_c | |
311 |
|
311 | |||
312 | Try to pull markers |
|
312 | Try to pull markers | |
313 | (extinct changeset are excluded but marker are pushed) |
|
313 | (extinct changeset are excluded but marker are pushed) | |
314 |
|
314 | |||
315 | $ hg pull ../tmpb |
|
315 | $ hg pull ../tmpb | |
316 | pulling from ../tmpb |
|
316 | pulling from ../tmpb | |
317 | requesting all changes |
|
317 | requesting all changes | |
318 | adding changesets |
|
318 | adding changesets | |
319 | adding manifests |
|
319 | adding manifests | |
320 | adding file changes |
|
320 | adding file changes | |
321 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
321 | added 4 changesets with 4 changes to 4 files (+1 heads) | |
322 | 5 new obsolescence markers |
|
322 | 5 new obsolescence markers | |
323 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
323 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
324 | $ hg debugobsolete |
|
324 | $ hg debugobsolete | |
325 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
325 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
326 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
326 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
327 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
327 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
328 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
328 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
329 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
329 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
330 |
|
330 | |||
331 | Rollback//Transaction support |
|
331 | Rollback//Transaction support | |
332 |
|
332 | |||
333 | $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
333 | $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | |
334 | $ hg debugobsolete |
|
334 | $ hg debugobsolete | |
335 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
335 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
336 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
336 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
337 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
337 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
338 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
338 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
339 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
339 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
340 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'} |
|
340 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'} | |
341 | $ hg rollback -n |
|
341 | $ hg rollback -n | |
342 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
342 | repository tip rolled back to revision 3 (undo debugobsolete) | |
343 | $ hg rollback |
|
343 | $ hg rollback | |
344 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
344 | repository tip rolled back to revision 3 (undo debugobsolete) | |
345 | $ hg debugobsolete |
|
345 | $ hg debugobsolete | |
346 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
346 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
347 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
347 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
348 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
348 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
349 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
349 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
350 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
350 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
351 |
|
351 | |||
352 | $ cd .. |
|
352 | $ cd .. | |
353 |
|
353 | |||
354 | Try to push markers |
|
354 | Try to push markers | |
355 |
|
355 | |||
356 | $ hg init tmpd |
|
356 | $ hg init tmpd | |
357 | $ hg -R tmpb push tmpd |
|
357 | $ hg -R tmpb push tmpd | |
358 | pushing to tmpd |
|
358 | pushing to tmpd | |
359 | searching for changes |
|
359 | searching for changes | |
360 | adding changesets |
|
360 | adding changesets | |
361 | adding manifests |
|
361 | adding manifests | |
362 | adding file changes |
|
362 | adding file changes | |
363 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
363 | added 4 changesets with 4 changes to 4 files (+1 heads) | |
364 | 5 new obsolescence markers |
|
364 | 5 new obsolescence markers | |
365 | $ hg -R tmpd debugobsolete | sort |
|
365 | $ hg -R tmpd debugobsolete | sort | |
366 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
366 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
367 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
367 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
368 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
368 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
369 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
369 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
370 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
370 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
371 |
|
371 | |||
372 | Check obsolete keys are exchanged only if source has an obsolete store |
|
372 | Check obsolete keys are exchanged only if source has an obsolete store | |
373 |
|
373 | |||
374 | $ hg init empty |
|
374 | $ hg init empty | |
375 | $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd |
|
375 | $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd | |
376 | pushing to tmpd |
|
376 | pushing to tmpd | |
377 | listkeys phases |
|
377 | listkeys phases | |
378 | listkeys bookmarks |
|
378 | listkeys bookmarks | |
379 | no changes found |
|
379 | no changes found | |
380 | listkeys phases |
|
380 | listkeys phases | |
381 | [1] |
|
381 | [1] | |
382 |
|
382 | |||
383 | clone support |
|
383 | clone support | |
384 | (markers are copied and extinct changesets are included to allow hardlinks) |
|
384 | (markers are copied and extinct changesets are included to allow hardlinks) | |
385 |
|
385 | |||
386 | $ hg clone tmpb clone-dest |
|
386 | $ hg clone tmpb clone-dest | |
387 | updating to branch default |
|
387 | updating to branch default | |
388 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
388 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
389 | $ hg -R clone-dest log -G --hidden |
|
389 | $ hg -R clone-dest log -G --hidden | |
390 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
390 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c | |
391 | | |
|
391 | | | |
392 | | x 5:5601fb93a350 (draft) [ ] add new_3_c |
|
392 | | x 5:5601fb93a350 (draft) [ ] add new_3_c | |
393 | |/ |
|
393 | |/ | |
394 | | x 4:ca819180edb9 (draft) [ ] add new_2_c |
|
394 | | x 4:ca819180edb9 (draft) [ ] add new_2_c | |
395 | |/ |
|
395 | |/ | |
396 | | x 3:cdbce2fbb163 (draft) [ ] add new_c |
|
396 | | x 3:cdbce2fbb163 (draft) [ ] add new_c | |
397 | |/ |
|
397 | |/ | |
398 | | o 2:245bde4270cd (public) [ ] add original_c |
|
398 | | o 2:245bde4270cd (public) [ ] add original_c | |
399 | |/ |
|
399 | |/ | |
400 | o 1:7c3bad9141dc (public) [ ] add b |
|
400 | o 1:7c3bad9141dc (public) [ ] add b | |
401 | | |
|
401 | | | |
402 | o 0:1f0dee641bb7 (public) [ ] add a |
|
402 | o 0:1f0dee641bb7 (public) [ ] add a | |
403 |
|
403 | |||
404 | $ hg -R clone-dest debugobsolete |
|
404 | $ hg -R clone-dest debugobsolete | |
405 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
405 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
406 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
406 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
407 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
407 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
408 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
408 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
409 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
409 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
410 |
|
410 | |||
411 |
|
411 | |||
412 | Destination repo have existing data |
|
412 | Destination repo have existing data | |
413 | --------------------------------------- |
|
413 | --------------------------------------- | |
414 |
|
414 | |||
415 | On pull |
|
415 | On pull | |
416 |
|
416 | |||
417 | $ hg init tmpe |
|
417 | $ hg init tmpe | |
418 | $ cd tmpe |
|
418 | $ cd tmpe | |
419 | $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 |
|
419 | $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 | |
420 | $ hg pull ../tmpb |
|
420 | $ hg pull ../tmpb | |
421 | pulling from ../tmpb |
|
421 | pulling from ../tmpb | |
422 | requesting all changes |
|
422 | requesting all changes | |
423 | adding changesets |
|
423 | adding changesets | |
424 | adding manifests |
|
424 | adding manifests | |
425 | adding file changes |
|
425 | adding file changes | |
426 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
426 | added 4 changesets with 4 changes to 4 files (+1 heads) | |
427 | 5 new obsolescence markers |
|
427 | 5 new obsolescence markers | |
428 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
428 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
429 | $ hg debugobsolete |
|
429 | $ hg debugobsolete | |
430 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
430 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
431 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
431 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
432 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
432 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
433 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
433 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
434 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
434 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
435 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
435 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
436 |
|
436 | |||
437 |
|
437 | |||
438 | On push |
|
438 | On push | |
439 |
|
439 | |||
440 | $ hg push ../tmpc |
|
440 | $ hg push ../tmpc | |
441 | pushing to ../tmpc |
|
441 | pushing to ../tmpc | |
442 | searching for changes |
|
442 | searching for changes | |
443 | no changes found |
|
443 | no changes found | |
444 | 1 new obsolescence markers |
|
444 | 1 new obsolescence markers | |
445 | [1] |
|
445 | [1] | |
446 | $ hg -R ../tmpc debugobsolete |
|
446 | $ hg -R ../tmpc debugobsolete | |
447 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
447 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
448 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
448 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
449 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
449 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
450 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
450 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
451 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
451 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
452 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
452 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
453 |
|
453 | |||
454 | detect outgoing obsolete and unstable |
|
454 | detect outgoing obsolete and unstable | |
455 | --------------------------------------- |
|
455 | --------------------------------------- | |
456 |
|
456 | |||
457 |
|
457 | |||
458 | $ hg log -G |
|
458 | $ hg log -G | |
459 | o 3:6f9641995072 (draft) [tip ] add n3w_3_c |
|
459 | o 3:6f9641995072 (draft) [tip ] add n3w_3_c | |
460 | | |
|
460 | | | |
461 | | o 2:245bde4270cd (public) [ ] add original_c |
|
461 | | o 2:245bde4270cd (public) [ ] add original_c | |
462 | |/ |
|
462 | |/ | |
463 | o 1:7c3bad9141dc (public) [ ] add b |
|
463 | o 1:7c3bad9141dc (public) [ ] add b | |
464 | | |
|
464 | | | |
465 | o 0:1f0dee641bb7 (public) [ ] add a |
|
465 | o 0:1f0dee641bb7 (public) [ ] add a | |
466 |
|
466 | |||
467 | $ hg up 'desc("n3w_3_c")' |
|
467 | $ hg up 'desc("n3w_3_c")' | |
468 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
468 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
469 | $ mkcommit original_d |
|
469 | $ mkcommit original_d | |
470 | $ mkcommit original_e |
|
470 | $ mkcommit original_e | |
471 | $ hg debugobsolete --record-parents `getid original_d` -d '0 0' |
|
471 | $ hg debugobsolete --record-parents `getid original_d` -d '0 0' | |
472 | $ hg debugobsolete | grep `getid original_d` |
|
472 | $ hg debugobsolete | grep `getid original_d` | |
473 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
473 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
474 | $ hg log -r 'obsolete()' |
|
474 | $ hg log -r 'obsolete()' | |
475 | 4:94b33453f93b (draft) [ ] add original_d |
|
475 | 4:94b33453f93b (draft) [ ] add original_d | |
476 | $ hg summary |
|
476 | $ hg summary | |
477 | parent: 5:cda648ca50f5 tip |
|
477 | parent: 5:cda648ca50f5 tip | |
478 | add original_e |
|
478 | add original_e | |
479 | branch: default |
|
479 | branch: default | |
480 | commit: (clean) |
|
480 | commit: (clean) | |
481 | update: 1 new changesets, 2 branch heads (merge) |
|
481 | update: 1 new changesets, 2 branch heads (merge) | |
482 | phases: 3 draft |
|
482 | phases: 3 draft | |
483 | unstable: 1 changesets |
|
483 | unstable: 1 changesets | |
484 | $ hg log -G -r '::unstable()' |
|
484 | $ hg log -G -r '::unstable()' | |
485 | @ 5:cda648ca50f5 (draft) [tip ] add original_e |
|
485 | @ 5:cda648ca50f5 (draft) [tip ] add original_e | |
486 | | |
|
486 | | | |
487 | x 4:94b33453f93b (draft) [ ] add original_d |
|
487 | x 4:94b33453f93b (draft) [ ] add original_d | |
488 | | |
|
488 | | | |
489 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
489 | o 3:6f9641995072 (draft) [ ] add n3w_3_c | |
490 | | |
|
490 | | | |
491 | o 1:7c3bad9141dc (public) [ ] add b |
|
491 | o 1:7c3bad9141dc (public) [ ] add b | |
492 | | |
|
492 | | | |
493 | o 0:1f0dee641bb7 (public) [ ] add a |
|
493 | o 0:1f0dee641bb7 (public) [ ] add a | |
494 |
|
494 | |||
495 |
|
495 | |||
496 | refuse to push obsolete changeset |
|
496 | refuse to push obsolete changeset | |
497 |
|
497 | |||
498 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
498 | $ hg push ../tmpc/ -r 'desc("original_d")' | |
499 | pushing to ../tmpc/ |
|
499 | pushing to ../tmpc/ | |
500 | searching for changes |
|
500 | searching for changes | |
501 | abort: push includes obsolete changeset: 94b33453f93b! |
|
501 | abort: push includes obsolete changeset: 94b33453f93b! | |
502 | [255] |
|
502 | [255] | |
503 |
|
503 | |||
504 | refuse to push unstable changeset |
|
504 | refuse to push unstable changeset | |
505 |
|
505 | |||
506 | $ hg push ../tmpc/ |
|
506 | $ hg push ../tmpc/ | |
507 | pushing to ../tmpc/ |
|
507 | pushing to ../tmpc/ | |
508 | searching for changes |
|
508 | searching for changes | |
509 | abort: push includes unstable changeset: cda648ca50f5! |
|
509 | abort: push includes unstable changeset: cda648ca50f5! | |
510 | [255] |
|
510 | [255] | |
511 |
|
511 | |||
512 | Test that extinct changeset are properly detected |
|
512 | Test that extinct changeset are properly detected | |
513 |
|
513 | |||
514 | $ hg log -r 'extinct()' |
|
514 | $ hg log -r 'extinct()' | |
515 |
|
515 | |||
516 | Don't try to push extinct changeset |
|
516 | Don't try to push extinct changeset | |
517 |
|
517 | |||
518 | $ hg init ../tmpf |
|
518 | $ hg init ../tmpf | |
519 | $ hg out ../tmpf |
|
519 | $ hg out ../tmpf | |
520 | comparing with ../tmpf |
|
520 | comparing with ../tmpf | |
521 | searching for changes |
|
521 | searching for changes | |
522 | 0:1f0dee641bb7 (public) [ ] add a |
|
522 | 0:1f0dee641bb7 (public) [ ] add a | |
523 | 1:7c3bad9141dc (public) [ ] add b |
|
523 | 1:7c3bad9141dc (public) [ ] add b | |
524 | 2:245bde4270cd (public) [ ] add original_c |
|
524 | 2:245bde4270cd (public) [ ] add original_c | |
525 | 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
525 | 3:6f9641995072 (draft) [ ] add n3w_3_c | |
526 | 4:94b33453f93b (draft) [ ] add original_d |
|
526 | 4:94b33453f93b (draft) [ ] add original_d | |
527 | 5:cda648ca50f5 (draft) [tip ] add original_e |
|
527 | 5:cda648ca50f5 (draft) [tip ] add original_e | |
528 | $ hg push ../tmpf -f # -f because be push unstable too |
|
528 | $ hg push ../tmpf -f # -f because be push unstable too | |
529 | pushing to ../tmpf |
|
529 | pushing to ../tmpf | |
530 | searching for changes |
|
530 | searching for changes | |
531 | adding changesets |
|
531 | adding changesets | |
532 | adding manifests |
|
532 | adding manifests | |
533 | adding file changes |
|
533 | adding file changes | |
534 | added 6 changesets with 6 changes to 6 files (+1 heads) |
|
534 | added 6 changesets with 6 changes to 6 files (+1 heads) | |
535 | 7 new obsolescence markers |
|
535 | 7 new obsolescence markers | |
536 |
|
536 | |||
537 | no warning displayed |
|
537 | no warning displayed | |
538 |
|
538 | |||
539 | $ hg push ../tmpf |
|
539 | $ hg push ../tmpf | |
540 | pushing to ../tmpf |
|
540 | pushing to ../tmpf | |
541 | searching for changes |
|
541 | searching for changes | |
542 | no changes found |
|
542 | no changes found | |
543 | [1] |
|
543 | [1] | |
544 |
|
544 | |||
545 | Do not warn about new head when the new head is a successors of a remote one |
|
545 | Do not warn about new head when the new head is a successors of a remote one | |
546 |
|
546 | |||
547 | $ hg log -G |
|
547 | $ hg log -G | |
548 | @ 5:cda648ca50f5 (draft) [tip ] add original_e |
|
548 | @ 5:cda648ca50f5 (draft) [tip ] add original_e | |
549 | | |
|
549 | | | |
550 | x 4:94b33453f93b (draft) [ ] add original_d |
|
550 | x 4:94b33453f93b (draft) [ ] add original_d | |
551 | | |
|
551 | | | |
552 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
552 | o 3:6f9641995072 (draft) [ ] add n3w_3_c | |
553 | | |
|
553 | | | |
554 | | o 2:245bde4270cd (public) [ ] add original_c |
|
554 | | o 2:245bde4270cd (public) [ ] add original_c | |
555 | |/ |
|
555 | |/ | |
556 | o 1:7c3bad9141dc (public) [ ] add b |
|
556 | o 1:7c3bad9141dc (public) [ ] add b | |
557 | | |
|
557 | | | |
558 | o 0:1f0dee641bb7 (public) [ ] add a |
|
558 | o 0:1f0dee641bb7 (public) [ ] add a | |
559 |
|
559 | |||
560 | $ hg up -q 'desc(n3w_3_c)' |
|
560 | $ hg up -q 'desc(n3w_3_c)' | |
561 | $ mkcommit obsolete_e |
|
561 | $ mkcommit obsolete_e | |
562 | created new head |
|
562 | created new head | |
563 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` |
|
563 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` | |
564 | $ hg outgoing ../tmpf # parasite hg outgoing testin |
|
564 | $ hg outgoing ../tmpf # parasite hg outgoing testin | |
565 | comparing with ../tmpf |
|
565 | comparing with ../tmpf | |
566 | searching for changes |
|
566 | searching for changes | |
567 | 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
567 | 6:3de5eca88c00 (draft) [tip ] add obsolete_e | |
568 | $ hg push ../tmpf |
|
568 | $ hg push ../tmpf | |
569 | pushing to ../tmpf |
|
569 | pushing to ../tmpf | |
570 | searching for changes |
|
570 | searching for changes | |
571 | adding changesets |
|
571 | adding changesets | |
572 | adding manifests |
|
572 | adding manifests | |
573 | adding file changes |
|
573 | adding file changes | |
574 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
574 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
575 | 1 new obsolescence markers |
|
575 | 1 new obsolescence markers | |
576 |
|
576 | |||
577 | test relevance computation |
|
577 | test relevance computation | |
578 | --------------------------------------- |
|
578 | --------------------------------------- | |
579 |
|
579 | |||
580 | Checking simple case of "marker relevance". |
|
580 | Checking simple case of "marker relevance". | |
581 |
|
581 | |||
582 |
|
582 | |||
583 | Reminder of the repo situation |
|
583 | Reminder of the repo situation | |
584 |
|
584 | |||
585 | $ hg log --hidden --graph |
|
585 | $ hg log --hidden --graph | |
586 | @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
586 | @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e | |
587 | | |
|
587 | | | |
588 | | x 5:cda648ca50f5 (draft) [ ] add original_e |
|
588 | | x 5:cda648ca50f5 (draft) [ ] add original_e | |
589 | | | |
|
589 | | | | |
590 | | x 4:94b33453f93b (draft) [ ] add original_d |
|
590 | | x 4:94b33453f93b (draft) [ ] add original_d | |
591 | |/ |
|
591 | |/ | |
592 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
592 | o 3:6f9641995072 (draft) [ ] add n3w_3_c | |
593 | | |
|
593 | | | |
594 | | o 2:245bde4270cd (public) [ ] add original_c |
|
594 | | o 2:245bde4270cd (public) [ ] add original_c | |
595 | |/ |
|
595 | |/ | |
596 | o 1:7c3bad9141dc (public) [ ] add b |
|
596 | o 1:7c3bad9141dc (public) [ ] add b | |
597 | | |
|
597 | | | |
598 | o 0:1f0dee641bb7 (public) [ ] add a |
|
598 | o 0:1f0dee641bb7 (public) [ ] add a | |
599 |
|
599 | |||
600 |
|
600 | |||
601 | List of all markers |
|
601 | List of all markers | |
602 |
|
602 | |||
603 | $ hg debugobsolete |
|
603 | $ hg debugobsolete | |
604 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
604 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
605 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
605 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
606 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
606 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
607 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
607 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
608 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
608 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
609 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
609 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
610 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
610 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
611 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
611 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) | |
612 |
|
612 | |||
613 | List of changesets with no chain |
|
613 | List of changesets with no chain | |
614 |
|
614 | |||
615 | $ hg debugobsolete --hidden --rev ::2 |
|
615 | $ hg debugobsolete --hidden --rev ::2 | |
616 |
|
616 | |||
617 | List of changesets that are included on marker chain |
|
617 | List of changesets that are included on marker chain | |
618 |
|
618 | |||
619 | $ hg debugobsolete --hidden --rev 6 |
|
619 | $ hg debugobsolete --hidden --rev 6 | |
620 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
620 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) | |
621 |
|
621 | |||
622 | List of changesets with a longer chain, (including a pruned children) |
|
622 | List of changesets with a longer chain, (including a pruned children) | |
623 |
|
623 | |||
624 | $ hg debugobsolete --hidden --rev 3 |
|
624 | $ hg debugobsolete --hidden --rev 3 | |
625 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
625 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
626 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
626 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
627 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
627 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
628 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
628 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
629 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
629 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
630 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
630 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
631 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
631 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
632 |
|
632 | |||
633 | List of both |
|
633 | List of both | |
634 |
|
634 | |||
635 | $ hg debugobsolete --hidden --rev 3::6 |
|
635 | $ hg debugobsolete --hidden --rev 3::6 | |
636 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
636 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
637 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
637 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
638 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
638 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
639 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
639 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
640 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
640 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
641 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
641 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
642 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
642 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) | |
643 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
643 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
644 |
|
644 | |||
645 | #if serve |
|
645 | #if serve | |
646 |
|
646 | |||
647 | Test the debug output for exchange |
|
647 | Test the debug output for exchange | |
648 | ---------------------------------- |
|
648 | ---------------------------------- | |
649 |
|
649 | |||
650 | $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True' |
|
650 | $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True' | |
651 | pulling from ../tmpb |
|
651 | pulling from ../tmpb | |
652 | searching for changes |
|
652 | searching for changes | |
653 | no changes found |
|
653 | no changes found | |
654 | obsmarker-exchange: 346 bytes received |
|
654 | obsmarker-exchange: 346 bytes received | |
655 |
|
655 | |||
656 | check hgweb does not explode |
|
656 | check hgweb does not explode | |
657 | ==================================== |
|
657 | ==================================== | |
658 |
|
658 | |||
659 | $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg |
|
659 | $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg | |
660 | adding changesets |
|
660 | adding changesets | |
661 | adding manifests |
|
661 | adding manifests | |
662 | adding file changes |
|
662 | adding file changes | |
663 | added 62 changesets with 63 changes to 9 files (+60 heads) |
|
663 | added 62 changesets with 63 changes to 9 files (+60 heads) | |
664 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
664 | (run 'hg heads .' to see heads, 'hg merge' to merge) | |
665 | $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`; |
|
665 | $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`; | |
666 | > do |
|
666 | > do | |
667 | > hg debugobsolete $node |
|
667 | > hg debugobsolete $node | |
668 | > done |
|
668 | > done | |
669 | $ hg up tip |
|
669 | $ hg up tip | |
670 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
670 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
671 |
|
671 | |||
672 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
672 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
673 | $ cat hg.pid >> $DAEMON_PIDS |
|
673 | $ cat hg.pid >> $DAEMON_PIDS | |
674 |
|
674 | |||
675 | check changelog view |
|
675 | check changelog view | |
676 |
|
676 | |||
677 | $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/' |
|
677 | $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/' | |
678 | 200 Script output follows |
|
678 | 200 Script output follows | |
679 |
|
679 | |||
680 | check graph view |
|
680 | check graph view | |
681 |
|
681 | |||
682 | $ get-with-headers.py --headeronly localhost:$HGPORT 'graph' |
|
682 | $ get-with-headers.py --headeronly localhost:$HGPORT 'graph' | |
683 | 200 Script output follows |
|
683 | 200 Script output follows | |
684 |
|
684 | |||
685 | check filelog view |
|
685 | check filelog view | |
686 |
|
686 | |||
687 | $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' |
|
687 | $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' | |
688 | 200 Script output follows |
|
688 | 200 Script output follows | |
689 |
|
689 | |||
690 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68' |
|
690 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68' | |
691 | 200 Script output follows |
|
691 | 200 Script output follows | |
692 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67' |
|
692 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67' | |
693 | 404 Not Found |
|
693 | 404 Not Found | |
694 | [1] |
|
694 | [1] | |
695 |
|
695 | |||
696 | check that web.view config option: |
|
696 | check that web.view config option: | |
697 |
|
697 | |||
698 | $ killdaemons.py hg.pid |
|
698 | $ killdaemons.py hg.pid | |
699 | $ cat >> .hg/hgrc << EOF |
|
699 | $ cat >> .hg/hgrc << EOF | |
700 | > [web] |
|
700 | > [web] | |
701 | > view=all |
|
701 | > view=all | |
702 | > EOF |
|
702 | > EOF | |
703 | $ wait |
|
703 | $ wait | |
704 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
704 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
705 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67' |
|
705 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67' | |
706 | 200 Script output follows |
|
706 | 200 Script output follows | |
707 | $ killdaemons.py hg.pid |
|
707 | $ killdaemons.py hg.pid | |
708 |
|
708 | |||
709 | Checking _enable=False warning if obsolete marker exists |
|
709 | Checking _enable=False warning if obsolete marker exists | |
710 |
|
710 | |||
711 | $ echo '[experimental]' >> $HGRCPATH |
|
711 | $ echo '[experimental]' >> $HGRCPATH | |
712 | $ echo "evolution=" >> $HGRCPATH |
|
712 | $ echo "evolution=" >> $HGRCPATH | |
713 | $ hg log -r tip |
|
713 | $ hg log -r tip | |
714 | obsolete feature not enabled but 68 markers found! |
|
714 | obsolete feature not enabled but 68 markers found! | |
715 | 68:c15e9edfca13 (draft) [tip ] add celestine |
|
715 | 68:c15e9edfca13 (draft) [tip ] add celestine | |
716 |
|
716 | |||
717 | reenable for later test |
|
717 | reenable for later test | |
718 |
|
718 | |||
719 | $ echo '[experimental]' >> $HGRCPATH |
|
719 | $ echo '[experimental]' >> $HGRCPATH | |
720 | $ echo "evolution=createmarkers,exchange" >> $HGRCPATH |
|
720 | $ echo "evolution=createmarkers,exchange" >> $HGRCPATH | |
721 |
|
721 | |||
722 | #endif |
|
722 | #endif | |
723 |
|
723 | |||
724 | Test incoming/outcoming with changesets obsoleted remotely, known locally |
|
724 | Test incoming/outcoming with changesets obsoleted remotely, known locally | |
725 | =============================================================================== |
|
725 | =============================================================================== | |
726 |
|
726 | |||
727 | This test issue 3805 |
|
727 | This test issue 3805 | |
728 |
|
728 | |||
729 | $ hg init repo-issue3805 |
|
729 | $ hg init repo-issue3805 | |
730 | $ cd repo-issue3805 |
|
730 | $ cd repo-issue3805 | |
731 | $ echo "base" > base |
|
731 | $ echo "base" > base | |
732 | $ hg ci -Am "base" |
|
732 | $ hg ci -Am "base" | |
733 | adding base |
|
733 | adding base | |
734 | $ echo "foo" > foo |
|
734 | $ echo "foo" > foo | |
735 | $ hg ci -Am "A" |
|
735 | $ hg ci -Am "A" | |
736 | adding foo |
|
736 | adding foo | |
737 | $ hg clone . ../other-issue3805 |
|
737 | $ hg clone . ../other-issue3805 | |
738 | updating to branch default |
|
738 | updating to branch default | |
739 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
739 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
740 | $ echo "bar" >> foo |
|
740 | $ echo "bar" >> foo | |
741 | $ hg ci --amend |
|
741 | $ hg ci --amend | |
742 | $ cd ../other-issue3805 |
|
742 | $ cd ../other-issue3805 | |
743 | $ hg log -G |
|
743 | $ hg log -G | |
744 | @ 1:29f0c6921ddd (draft) [tip ] A |
|
744 | @ 1:29f0c6921ddd (draft) [tip ] A | |
745 | | |
|
745 | | | |
746 | o 0:d20a80d4def3 (draft) [ ] base |
|
746 | o 0:d20a80d4def3 (draft) [ ] base | |
747 |
|
747 | |||
748 | $ hg log -G -R ../repo-issue3805 |
|
748 | $ hg log -G -R ../repo-issue3805 | |
749 | @ 3:323a9c3ddd91 (draft) [tip ] A |
|
749 | @ 3:323a9c3ddd91 (draft) [tip ] A | |
750 | | |
|
750 | | | |
751 | o 0:d20a80d4def3 (draft) [ ] base |
|
751 | o 0:d20a80d4def3 (draft) [ ] base | |
752 |
|
752 | |||
753 | $ hg incoming |
|
753 | $ hg incoming | |
754 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
754 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) | |
755 | searching for changes |
|
755 | searching for changes | |
756 | 3:323a9c3ddd91 (draft) [tip ] A |
|
756 | 3:323a9c3ddd91 (draft) [tip ] A | |
757 | $ hg incoming --bundle ../issue3805.hg |
|
757 | $ hg incoming --bundle ../issue3805.hg | |
758 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
758 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) | |
759 | searching for changes |
|
759 | searching for changes | |
760 | 3:323a9c3ddd91 (draft) [tip ] A |
|
760 | 3:323a9c3ddd91 (draft) [tip ] A | |
761 | $ hg outgoing |
|
761 | $ hg outgoing | |
762 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
762 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) | |
763 | searching for changes |
|
763 | searching for changes | |
764 | 1:29f0c6921ddd (draft) [tip ] A |
|
764 | 1:29f0c6921ddd (draft) [tip ] A | |
765 |
|
765 | |||
766 | #if serve |
|
766 | #if serve | |
767 |
|
767 | |||
768 | $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
768 | $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
769 | $ cat hg.pid >> $DAEMON_PIDS |
|
769 | $ cat hg.pid >> $DAEMON_PIDS | |
770 |
|
770 | |||
771 | $ hg incoming http://localhost:$HGPORT |
|
771 | $ hg incoming http://localhost:$HGPORT | |
772 | comparing with http://localhost:$HGPORT/ |
|
772 | comparing with http://localhost:$HGPORT/ | |
773 | searching for changes |
|
773 | searching for changes | |
774 | 2:323a9c3ddd91 (draft) [tip ] A |
|
774 | 2:323a9c3ddd91 (draft) [tip ] A | |
775 | $ hg outgoing http://localhost:$HGPORT |
|
775 | $ hg outgoing http://localhost:$HGPORT | |
776 | comparing with http://localhost:$HGPORT/ |
|
776 | comparing with http://localhost:$HGPORT/ | |
777 | searching for changes |
|
777 | searching for changes | |
778 | 1:29f0c6921ddd (draft) [tip ] A |
|
778 | 1:29f0c6921ddd (draft) [tip ] A | |
779 |
|
779 | |||
780 | $ killdaemons.py |
|
780 | $ killdaemons.py | |
781 |
|
781 | |||
782 | #endif |
|
782 | #endif | |
783 |
|
783 | |||
784 | This test issue 3814 |
|
784 | This test issue 3814 | |
785 |
|
785 | |||
786 | (nothing to push but locally hidden changeset) |
|
786 | (nothing to push but locally hidden changeset) | |
787 |
|
787 | |||
788 | $ cd .. |
|
788 | $ cd .. | |
789 | $ hg init repo-issue3814 |
|
789 | $ hg init repo-issue3814 | |
790 | $ cd repo-issue3805 |
|
790 | $ cd repo-issue3805 | |
791 | $ hg push -r 323a9c3ddd91 ../repo-issue3814 |
|
791 | $ hg push -r 323a9c3ddd91 ../repo-issue3814 | |
792 | pushing to ../repo-issue3814 |
|
792 | pushing to ../repo-issue3814 | |
793 | searching for changes |
|
793 | searching for changes | |
794 | adding changesets |
|
794 | adding changesets | |
795 | adding manifests |
|
795 | adding manifests | |
796 | adding file changes |
|
796 | adding file changes | |
797 | added 2 changesets with 2 changes to 2 files |
|
797 | added 2 changesets with 2 changes to 2 files | |
798 | 2 new obsolescence markers |
|
798 | 2 new obsolescence markers | |
799 | $ hg out ../repo-issue3814 |
|
799 | $ hg out ../repo-issue3814 | |
800 | comparing with ../repo-issue3814 |
|
800 | comparing with ../repo-issue3814 | |
801 | searching for changes |
|
801 | searching for changes | |
802 | no changes found |
|
802 | no changes found | |
803 | [1] |
|
803 | [1] | |
804 |
|
804 | |||
805 | Test that a local tag blocks a changeset from being hidden |
|
805 | Test that a local tag blocks a changeset from being hidden | |
806 |
|
806 | |||
807 | $ hg tag -l visible -r 1 --hidden |
|
807 | $ hg tag -l visible -r 1 --hidden | |
808 | $ hg log -G |
|
808 | $ hg log -G | |
809 | @ 3:323a9c3ddd91 (draft) [tip ] A |
|
809 | @ 3:323a9c3ddd91 (draft) [tip ] A | |
810 | | |
|
810 | | | |
811 | | x 1:29f0c6921ddd (draft) [visible ] A |
|
811 | | x 1:29f0c6921ddd (draft) [visible ] A | |
812 | |/ |
|
812 | |/ | |
813 | o 0:d20a80d4def3 (draft) [ ] base |
|
813 | o 0:d20a80d4def3 (draft) [ ] base | |
814 |
|
814 | |||
815 | Test that removing a local tag does not cause some commands to fail |
|
815 | Test that removing a local tag does not cause some commands to fail | |
816 |
|
816 | |||
817 | $ hg tag -l -r tip tiptag |
|
817 | $ hg tag -l -r tip tiptag | |
818 | $ hg tags |
|
818 | $ hg tags | |
819 | tiptag 3:323a9c3ddd91 |
|
819 | tiptag 3:323a9c3ddd91 | |
820 | tip 3:323a9c3ddd91 |
|
820 | tip 3:323a9c3ddd91 | |
821 | visible 1:29f0c6921ddd |
|
821 | visible 1:29f0c6921ddd | |
822 | $ hg --config extensions.strip= strip -r tip --no-backup |
|
822 | $ hg --config extensions.strip= strip -r tip --no-backup | |
823 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
823 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
824 | $ hg tags |
|
824 | $ hg tags | |
825 | visible 1:29f0c6921ddd |
|
825 | visible 1:29f0c6921ddd | |
826 | tip 1:29f0c6921ddd |
|
826 | tip 1:29f0c6921ddd | |
827 |
|
827 | |||
828 | Test bundle overlay onto hidden revision |
|
828 | Test bundle overlay onto hidden revision | |
829 |
|
829 | |||
830 | $ cd .. |
|
830 | $ cd .. | |
831 | $ hg init repo-bundleoverlay |
|
831 | $ hg init repo-bundleoverlay | |
832 | $ cd repo-bundleoverlay |
|
832 | $ cd repo-bundleoverlay | |
833 | $ echo "A" > foo |
|
833 | $ echo "A" > foo | |
834 | $ hg ci -Am "A" |
|
834 | $ hg ci -Am "A" | |
835 | adding foo |
|
835 | adding foo | |
836 | $ echo "B" >> foo |
|
836 | $ echo "B" >> foo | |
837 | $ hg ci -m "B" |
|
837 | $ hg ci -m "B" | |
838 | $ hg up 0 |
|
838 | $ hg up 0 | |
839 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
839 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
840 | $ echo "C" >> foo |
|
840 | $ echo "C" >> foo | |
841 | $ hg ci -m "C" |
|
841 | $ hg ci -m "C" | |
842 | created new head |
|
842 | created new head | |
843 | $ hg log -G |
|
843 | $ hg log -G | |
844 | @ 2:c186d7714947 (draft) [tip ] C |
|
844 | @ 2:c186d7714947 (draft) [tip ] C | |
845 | | |
|
845 | | | |
846 | | o 1:44526ebb0f98 (draft) [ ] B |
|
846 | | o 1:44526ebb0f98 (draft) [ ] B | |
847 | |/ |
|
847 | |/ | |
848 | o 0:4b34ecfb0d56 (draft) [ ] A |
|
848 | o 0:4b34ecfb0d56 (draft) [ ] A | |
849 |
|
849 | |||
850 |
|
850 | |||
851 | $ hg clone -r1 . ../other-bundleoverlay |
|
851 | $ hg clone -r1 . ../other-bundleoverlay | |
852 | adding changesets |
|
852 | adding changesets | |
853 | adding manifests |
|
853 | adding manifests | |
854 | adding file changes |
|
854 | adding file changes | |
855 | added 2 changesets with 2 changes to 1 files |
|
855 | added 2 changesets with 2 changes to 1 files | |
856 | updating to branch default |
|
856 | updating to branch default | |
857 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
857 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
858 | $ cd ../other-bundleoverlay |
|
858 | $ cd ../other-bundleoverlay | |
859 | $ echo "B+" >> foo |
|
859 | $ echo "B+" >> foo | |
860 | $ hg ci --amend -m "B+" |
|
860 | $ hg ci --amend -m "B+" | |
861 | $ hg log -G --hidden |
|
861 | $ hg log -G --hidden | |
862 | @ 3:b7d587542d40 (draft) [tip ] B+ |
|
862 | @ 3:b7d587542d40 (draft) [tip ] B+ | |
863 | | |
|
863 | | | |
864 | | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98 |
|
864 | | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98 | |
865 | | | |
|
865 | | | | |
866 | | x 1:44526ebb0f98 (draft) [ ] B |
|
866 | | x 1:44526ebb0f98 (draft) [ ] B | |
867 | |/ |
|
867 | |/ | |
868 | o 0:4b34ecfb0d56 (draft) [ ] A |
|
868 | o 0:4b34ecfb0d56 (draft) [ ] A | |
869 |
|
869 | |||
870 |
|
870 | |||
871 | $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg |
|
871 | $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg | |
872 | comparing with ../repo-bundleoverlay |
|
872 | comparing with ../repo-bundleoverlay | |
873 | searching for changes |
|
873 | searching for changes | |
874 | 1:44526ebb0f98 (draft) [ ] B |
|
874 | 1:44526ebb0f98 (draft) [ ] B | |
875 | 2:c186d7714947 (draft) [tip ] C |
|
875 | 2:c186d7714947 (draft) [tip ] C | |
876 | $ hg log -G -R ../bundleoverlay.hg |
|
876 | $ hg log -G -R ../bundleoverlay.hg | |
877 | o 4:c186d7714947 (draft) [tip ] C |
|
877 | o 4:c186d7714947 (draft) [tip ] C | |
878 | | |
|
878 | | | |
879 | | @ 3:b7d587542d40 (draft) [ ] B+ |
|
879 | | @ 3:b7d587542d40 (draft) [ ] B+ | |
880 | |/ |
|
880 | |/ | |
881 | o 0:4b34ecfb0d56 (draft) [ ] A |
|
881 | o 0:4b34ecfb0d56 (draft) [ ] A | |
882 |
|
882 | |||
883 |
|
883 | |||
884 | #if serve |
|
884 | #if serve | |
885 |
|
885 | |||
886 | Test issue 4506 |
|
886 | Test issue 4506 | |
887 |
|
887 | |||
888 | $ cd .. |
|
888 | $ cd .. | |
889 | $ hg init repo-issue4506 |
|
889 | $ hg init repo-issue4506 | |
890 | $ cd repo-issue4506 |
|
890 | $ cd repo-issue4506 | |
891 | $ echo "0" > foo |
|
891 | $ echo "0" > foo | |
892 | $ hg add foo |
|
892 | $ hg add foo | |
893 | $ hg ci -m "content-0" |
|
893 | $ hg ci -m "content-0" | |
894 |
|
894 | |||
895 | $ hg up null |
|
895 | $ hg up null | |
896 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
896 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
897 | $ echo "1" > bar |
|
897 | $ echo "1" > bar | |
898 | $ hg add bar |
|
898 | $ hg add bar | |
899 | $ hg ci -m "content-1" |
|
899 | $ hg ci -m "content-1" | |
900 | created new head |
|
900 | created new head | |
901 | $ hg up 0 |
|
901 | $ hg up 0 | |
902 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
902 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
903 | $ hg graft 1 |
|
903 | $ hg graft 1 | |
904 | grafting 1:1c9eddb02162 "content-1" (tip) |
|
904 | grafting 1:1c9eddb02162 "content-1" (tip) | |
905 |
|
905 | |||
906 | $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'` |
|
906 | $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'` | |
907 |
|
907 | |||
908 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
908 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
909 | $ cat hg.pid >> $DAEMON_PIDS |
|
909 | $ cat hg.pid >> $DAEMON_PIDS | |
910 |
|
910 | |||
911 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1' |
|
911 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1' | |
912 | 404 Not Found |
|
912 | 404 Not Found | |
913 | [1] |
|
913 | [1] | |
914 | $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar' |
|
914 | $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar' | |
915 | 200 Script output follows |
|
915 | 200 Script output follows | |
916 | $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar' |
|
916 | $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar' | |
917 | 200 Script output follows |
|
917 | 200 Script output follows | |
918 |
|
918 | |||
919 | $ killdaemons.py |
|
919 | $ killdaemons.py | |
920 |
|
920 | |||
921 | #endif |
|
921 | #endif | |
922 |
|
922 | |||
923 | Test heads computation on pending index changes with obsolescence markers |
|
923 | Test heads computation on pending index changes with obsolescence markers | |
924 | $ cd .. |
|
924 | $ cd .. | |
925 | $ cat >$TESTTMP/test_extension.py << EOF |
|
925 | $ cat >$TESTTMP/test_extension.py << EOF | |
926 | > from mercurial import cmdutil |
|
926 | > from mercurial import cmdutil | |
927 | > from mercurial.i18n import _ |
|
927 | > from mercurial.i18n import _ | |
928 | > |
|
928 | > | |
929 | > cmdtable = {} |
|
929 | > cmdtable = {} | |
930 | > command = cmdutil.command(cmdtable) |
|
930 | > command = cmdutil.command(cmdtable) | |
931 | > @command("amendtransient",[], _('hg amendtransient [rev]')) |
|
931 | > @command("amendtransient",[], _('hg amendtransient [rev]')) | |
932 | > def amend(ui, repo, *pats, **opts): |
|
932 | > def amend(ui, repo, *pats, **opts): | |
933 | > def commitfunc(ui, repo, message, match, opts): |
|
933 | > def commitfunc(ui, repo, message, match, opts): | |
934 | > return repo.commit(message, repo['.'].user(), repo['.'].date(), match) |
|
934 | > return repo.commit(message, repo['.'].user(), repo['.'].date(), match) | |
935 | > opts['message'] = 'Test' |
|
935 | > opts['message'] = 'Test' | |
936 | > opts['logfile'] = None |
|
936 | > opts['logfile'] = None | |
937 | > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts) |
|
937 | > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts) | |
938 | > print repo.changelog.headrevs() |
|
938 | > print repo.changelog.headrevs() | |
939 | > EOF |
|
939 | > EOF | |
940 | $ cat >> $HGRCPATH << EOF |
|
940 | $ cat >> $HGRCPATH << EOF | |
941 | > [extensions] |
|
941 | > [extensions] | |
942 | > testextension=$TESTTMP/test_extension.py |
|
942 | > testextension=$TESTTMP/test_extension.py | |
943 | > EOF |
|
943 | > EOF | |
944 | $ hg init repo-issue-nativerevs-pending-changes |
|
944 | $ hg init repo-issue-nativerevs-pending-changes | |
945 | $ cd repo-issue-nativerevs-pending-changes |
|
945 | $ cd repo-issue-nativerevs-pending-changes | |
946 | $ mkcommit a |
|
946 | $ mkcommit a | |
947 | $ mkcommit b |
|
947 | $ mkcommit b | |
948 | $ hg up ".^" |
|
948 | $ hg up ".^" | |
949 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
949 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
950 | $ echo aa > a |
|
950 | $ echo aa > a | |
951 | $ hg amendtransient |
|
951 | $ hg amendtransient | |
952 | [1, 3] |
|
952 | [1, 3] | |
953 |
|
953 | |||
|
954 | Check that corrupted hidden cache does not crash | |||
|
955 | ||||
|
956 | $ printf "" > .hg/cache/hidden | |||
|
957 | $ hg log -r . -T '{node}' --debug | |||
|
958 | corrupted hidden cache | |||
|
959 | 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol) | |||
|
960 | $ hg log -r . -T '{node}' --debug | |||
|
961 | 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol) | |||
|
962 | ||||
|
963 | Check that wrong hidden cache permission does not crash | |||
|
964 | ||||
|
965 | $ chmod 000 .hg/cache/hidden | |||
|
966 | $ hg log -r . -T '{node}' --debug | |||
|
967 | cannot read hidden cache | |||
|
968 | error writing hidden changesets cache | |||
|
969 | 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol) | |||
|
970 | ||||
954 | Test cache consistency for the visible filter |
|
971 | Test cache consistency for the visible filter | |
955 | 1) We want to make sure that the cached filtered revs are invalidated when |
|
972 | 1) We want to make sure that the cached filtered revs are invalidated when | |
956 | bookmarks change |
|
973 | bookmarks change | |
957 | $ cd .. |
|
974 | $ cd .. | |
958 | $ cat >$TESTTMP/test_extension.py << EOF |
|
975 | $ cat >$TESTTMP/test_extension.py << EOF | |
959 | > from mercurial import cmdutil, extensions, bookmarks, repoview |
|
976 | > from mercurial import cmdutil, extensions, bookmarks, repoview | |
960 | > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs): |
|
977 | > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs): | |
961 | > repo = bkmstoreinst._repo |
|
978 | > repo = bkmstoreinst._repo | |
962 | > ret = orig(bkmstoreinst, *args, **kwargs) |
|
979 | > ret = orig(bkmstoreinst, *args, **kwargs) | |
963 | > hidden1 = repoview.computehidden(repo) |
|
980 | > hidden1 = repoview.computehidden(repo) | |
964 | > hidden = repoview.filterrevs(repo, 'visible') |
|
981 | > hidden = repoview.filterrevs(repo, 'visible') | |
965 | > if sorted(hidden1) != sorted(hidden): |
|
982 | > if sorted(hidden1) != sorted(hidden): | |
966 | > print "cache inconsistency" |
|
983 | > print "cache inconsistency" | |
967 | > return ret |
|
984 | > return ret | |
968 | > def extsetup(ui): |
|
985 | > def extsetup(ui): | |
969 | > extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged) |
|
986 | > extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged) | |
970 | > EOF |
|
987 | > EOF | |
971 |
|
988 | |||
972 | $ hg init repo-cache-inconsistency |
|
989 | $ hg init repo-cache-inconsistency | |
973 | $ cd repo-issue-nativerevs-pending-changes |
|
990 | $ cd repo-issue-nativerevs-pending-changes | |
974 | $ mkcommit a |
|
991 | $ mkcommit a | |
975 | a already tracked! |
|
992 | a already tracked! | |
976 | $ mkcommit b |
|
993 | $ mkcommit b | |
977 | $ hg id |
|
994 | $ hg id | |
978 | 13bedc178fce tip |
|
995 | 13bedc178fce tip | |
979 | $ echo "hello" > b |
|
996 | $ echo "hello" > b | |
980 | $ hg commit --amend -m "message" |
|
997 | $ hg commit --amend -m "message" | |
981 | $ hg book bookb -r 13bedc178fce --hidden |
|
998 | $ hg book bookb -r 13bedc178fce --hidden | |
982 | $ hg log -r 13bedc178fce |
|
999 | $ hg log -r 13bedc178fce | |
983 | 5:13bedc178fce (draft) [ bookb] add b |
|
1000 | 5:13bedc178fce (draft) [ bookb] add b | |
984 | $ hg book -d bookb |
|
1001 | $ hg book -d bookb | |
985 | $ hg log -r 13bedc178fce |
|
1002 | $ hg log -r 13bedc178fce | |
986 | abort: hidden revision '13bedc178fce'! |
|
1003 | abort: hidden revision '13bedc178fce'! | |
987 | (use --hidden to access hidden revisions) |
|
1004 | (use --hidden to access hidden revisions) | |
988 | [255] |
|
1005 | [255] | |
989 |
|
1006 | |||
990 |
|
1007 | |||
991 |
|
1008 |
General Comments 0
You need to be logged in to leave comments.
Login now