Show More
@@ -1,440 +1,441 b'' | |||||
1 | # hgweb/webutil.py - utility library for the web interface. |
|
1 | # hgweb/webutil.py - utility library for the web interface. | |
2 | # |
|
2 | # | |
3 | # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net> |
|
3 | # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net> | |
4 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
|
4 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> | |
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 | import os, copy |
|
9 | import os, copy | |
10 | from mercurial import match, patch, error, ui, util, pathutil, context |
|
10 | from mercurial import match, patch, error, ui, util, pathutil, context | |
11 | from mercurial.i18n import _ |
|
11 | from mercurial.i18n import _ | |
12 | from mercurial.node import hex, nullid |
|
12 | from mercurial.node import hex, nullid | |
13 | from common import ErrorResponse |
|
13 | from common import ErrorResponse | |
14 | from common import HTTP_NOT_FOUND |
|
14 | from common import HTTP_NOT_FOUND | |
15 | import difflib |
|
15 | import difflib | |
16 |
|
16 | |||
17 | def up(p): |
|
17 | def up(p): | |
18 | if p[0] != "/": |
|
18 | if p[0] != "/": | |
19 | p = "/" + p |
|
19 | p = "/" + p | |
20 | if p[-1] == "/": |
|
20 | if p[-1] == "/": | |
21 | p = p[:-1] |
|
21 | p = p[:-1] | |
22 | up = os.path.dirname(p) |
|
22 | up = os.path.dirname(p) | |
23 | if up == "/": |
|
23 | if up == "/": | |
24 | return "/" |
|
24 | return "/" | |
25 | return up + "/" |
|
25 | return up + "/" | |
26 |
|
26 | |||
27 | def _navseq(step, firststep=None): |
|
27 | def _navseq(step, firststep=None): | |
28 | if firststep: |
|
28 | if firststep: | |
29 | yield firststep |
|
29 | yield firststep | |
30 | if firststep >= 20 and firststep <= 40: |
|
30 | if firststep >= 20 and firststep <= 40: | |
31 | firststep = 50 |
|
31 | firststep = 50 | |
32 | yield firststep |
|
32 | yield firststep | |
33 | assert step > 0 |
|
33 | assert step > 0 | |
34 | assert firststep > 0 |
|
34 | assert firststep > 0 | |
35 | while step <= firststep: |
|
35 | while step <= firststep: | |
36 | step *= 10 |
|
36 | step *= 10 | |
37 | while True: |
|
37 | while True: | |
38 | yield 1 * step |
|
38 | yield 1 * step | |
39 | yield 3 * step |
|
39 | yield 3 * step | |
40 | step *= 10 |
|
40 | step *= 10 | |
41 |
|
41 | |||
42 | class revnav(object): |
|
42 | class revnav(object): | |
43 |
|
43 | |||
44 | def __init__(self, repo): |
|
44 | def __init__(self, repo): | |
45 | """Navigation generation object |
|
45 | """Navigation generation object | |
46 |
|
46 | |||
47 | :repo: repo object we generate nav for |
|
47 | :repo: repo object we generate nav for | |
48 | """ |
|
48 | """ | |
49 | # used for hex generation |
|
49 | # used for hex generation | |
50 | self._revlog = repo.changelog |
|
50 | self._revlog = repo.changelog | |
51 |
|
51 | |||
52 | def __nonzero__(self): |
|
52 | def __nonzero__(self): | |
53 | """return True if any revision to navigate over""" |
|
53 | """return True if any revision to navigate over""" | |
54 | return self._first() is not None |
|
54 | return self._first() is not None | |
55 |
|
55 | |||
56 | def _first(self): |
|
56 | def _first(self): | |
57 | """return the minimum non-filtered changeset or None""" |
|
57 | """return the minimum non-filtered changeset or None""" | |
58 | try: |
|
58 | try: | |
59 | return iter(self._revlog).next() |
|
59 | return iter(self._revlog).next() | |
60 | except StopIteration: |
|
60 | except StopIteration: | |
61 | return None |
|
61 | return None | |
62 |
|
62 | |||
63 | def hex(self, rev): |
|
63 | def hex(self, rev): | |
64 | return hex(self._revlog.node(rev)) |
|
64 | return hex(self._revlog.node(rev)) | |
65 |
|
65 | |||
66 | def gen(self, pos, pagelen, limit): |
|
66 | def gen(self, pos, pagelen, limit): | |
67 | """computes label and revision id for navigation link |
|
67 | """computes label and revision id for navigation link | |
68 |
|
68 | |||
69 | :pos: is the revision relative to which we generate navigation. |
|
69 | :pos: is the revision relative to which we generate navigation. | |
70 | :pagelen: the size of each navigation page |
|
70 | :pagelen: the size of each navigation page | |
71 | :limit: how far shall we link |
|
71 | :limit: how far shall we link | |
72 |
|
72 | |||
73 | The return is: |
|
73 | The return is: | |
74 | - a single element tuple |
|
74 | - a single element tuple | |
75 | - containing a dictionary with a `before` and `after` key |
|
75 | - containing a dictionary with a `before` and `after` key | |
76 | - values are generator functions taking arbitrary number of kwargs |
|
76 | - values are generator functions taking arbitrary number of kwargs | |
77 | - yield items are dictionaries with `label` and `node` keys |
|
77 | - yield items are dictionaries with `label` and `node` keys | |
78 | """ |
|
78 | """ | |
79 | if not self: |
|
79 | if not self: | |
80 | # empty repo |
|
80 | # empty repo | |
81 | return ({'before': (), 'after': ()},) |
|
81 | return ({'before': (), 'after': ()},) | |
82 |
|
82 | |||
83 | targets = [] |
|
83 | targets = [] | |
84 | for f in _navseq(1, pagelen): |
|
84 | for f in _navseq(1, pagelen): | |
85 | if f > limit: |
|
85 | if f > limit: | |
86 | break |
|
86 | break | |
87 | targets.append(pos + f) |
|
87 | targets.append(pos + f) | |
88 | targets.append(pos - f) |
|
88 | targets.append(pos - f) | |
89 | targets.sort() |
|
89 | targets.sort() | |
90 |
|
90 | |||
91 | first = self._first() |
|
91 | first = self._first() | |
92 | navbefore = [("(%i)" % first, self.hex(first))] |
|
92 | navbefore = [("(%i)" % first, self.hex(first))] | |
93 | navafter = [] |
|
93 | navafter = [] | |
94 | for rev in targets: |
|
94 | for rev in targets: | |
95 | if rev not in self._revlog: |
|
95 | if rev not in self._revlog: | |
96 | continue |
|
96 | continue | |
97 | if pos < rev < limit: |
|
97 | if pos < rev < limit: | |
98 | navafter.append(("+%d" % abs(rev - pos), self.hex(rev))) |
|
98 | navafter.append(("+%d" % abs(rev - pos), self.hex(rev))) | |
99 | if 0 < rev < pos: |
|
99 | if 0 < rev < pos: | |
100 | navbefore.append(("-%d" % abs(rev - pos), self.hex(rev))) |
|
100 | navbefore.append(("-%d" % abs(rev - pos), self.hex(rev))) | |
101 |
|
101 | |||
102 |
|
102 | |||
103 | navafter.append(("tip", "tip")) |
|
103 | navafter.append(("tip", "tip")) | |
104 |
|
104 | |||
105 | data = lambda i: {"label": i[0], "node": i[1]} |
|
105 | data = lambda i: {"label": i[0], "node": i[1]} | |
106 | return ({'before': lambda **map: (data(i) for i in navbefore), |
|
106 | return ({'before': lambda **map: (data(i) for i in navbefore), | |
107 | 'after': lambda **map: (data(i) for i in navafter)},) |
|
107 | 'after': lambda **map: (data(i) for i in navafter)},) | |
108 |
|
108 | |||
109 | class filerevnav(revnav): |
|
109 | class filerevnav(revnav): | |
110 |
|
110 | |||
111 | def __init__(self, repo, path): |
|
111 | def __init__(self, repo, path): | |
112 | """Navigation generation object |
|
112 | """Navigation generation object | |
113 |
|
113 | |||
114 | :repo: repo object we generate nav for |
|
114 | :repo: repo object we generate nav for | |
115 | :path: path of the file we generate nav for |
|
115 | :path: path of the file we generate nav for | |
116 | """ |
|
116 | """ | |
117 | # used for iteration |
|
117 | # used for iteration | |
118 | self._changelog = repo.unfiltered().changelog |
|
118 | self._changelog = repo.unfiltered().changelog | |
119 | # used for hex generation |
|
119 | # used for hex generation | |
120 | self._revlog = repo.file(path) |
|
120 | self._revlog = repo.file(path) | |
121 |
|
121 | |||
122 | def hex(self, rev): |
|
122 | def hex(self, rev): | |
123 | return hex(self._changelog.node(self._revlog.linkrev(rev))) |
|
123 | return hex(self._changelog.node(self._revlog.linkrev(rev))) | |
124 |
|
124 | |||
125 |
|
125 | |||
126 | def _siblings(siblings=[], hiderev=None): |
|
126 | def _siblings(siblings=[], hiderev=None): | |
127 | siblings = [s for s in siblings if s.node() != nullid] |
|
127 | siblings = [s for s in siblings if s.node() != nullid] | |
128 | if len(siblings) == 1 and siblings[0].rev() == hiderev: |
|
128 | if len(siblings) == 1 and siblings[0].rev() == hiderev: | |
129 | return |
|
129 | return | |
130 | for s in siblings: |
|
130 | for s in siblings: | |
131 | d = {'node': s.hex(), 'rev': s.rev()} |
|
131 | d = {'node': s.hex(), 'rev': s.rev()} | |
132 | d['user'] = s.user() |
|
132 | d['user'] = s.user() | |
133 | d['date'] = s.date() |
|
133 | d['date'] = s.date() | |
134 | d['description'] = s.description() |
|
134 | d['description'] = s.description() | |
135 | d['branch'] = s.branch() |
|
135 | d['branch'] = s.branch() | |
136 | if util.safehasattr(s, 'path'): |
|
136 | if util.safehasattr(s, 'path'): | |
137 | d['file'] = s.path() |
|
137 | d['file'] = s.path() | |
138 | yield d |
|
138 | yield d | |
139 |
|
139 | |||
140 | def parents(ctx, hide=None): |
|
140 | def parents(ctx, hide=None): | |
141 |
if |
|
141 | if isinstance(ctx, context.basefilectx): | |
142 |
|
|
142 | introrev = ctx.introrev() | |
143 | return _siblings([ctx._repo[ctx.linkrev()]], hide) |
|
143 | if ctx.changectx().rev() != introrev: | |
|
144 | return _siblings([ctx._repo[introrev]], hide) | |||
144 | return _siblings(ctx.parents(), hide) |
|
145 | return _siblings(ctx.parents(), hide) | |
145 |
|
146 | |||
146 | def children(ctx, hide=None): |
|
147 | def children(ctx, hide=None): | |
147 | return _siblings(ctx.children(), hide) |
|
148 | return _siblings(ctx.children(), hide) | |
148 |
|
149 | |||
149 | def renamelink(fctx): |
|
150 | def renamelink(fctx): | |
150 | r = fctx.renamed() |
|
151 | r = fctx.renamed() | |
151 | if r: |
|
152 | if r: | |
152 | return [{'file': r[0], 'node': hex(r[1])}] |
|
153 | return [{'file': r[0], 'node': hex(r[1])}] | |
153 | return [] |
|
154 | return [] | |
154 |
|
155 | |||
155 | def nodetagsdict(repo, node): |
|
156 | def nodetagsdict(repo, node): | |
156 | return [{"name": i} for i in repo.nodetags(node)] |
|
157 | return [{"name": i} for i in repo.nodetags(node)] | |
157 |
|
158 | |||
158 | def nodebookmarksdict(repo, node): |
|
159 | def nodebookmarksdict(repo, node): | |
159 | return [{"name": i} for i in repo.nodebookmarks(node)] |
|
160 | return [{"name": i} for i in repo.nodebookmarks(node)] | |
160 |
|
161 | |||
161 | def nodebranchdict(repo, ctx): |
|
162 | def nodebranchdict(repo, ctx): | |
162 | branches = [] |
|
163 | branches = [] | |
163 | branch = ctx.branch() |
|
164 | branch = ctx.branch() | |
164 | # If this is an empty repo, ctx.node() == nullid, |
|
165 | # If this is an empty repo, ctx.node() == nullid, | |
165 | # ctx.branch() == 'default'. |
|
166 | # ctx.branch() == 'default'. | |
166 | try: |
|
167 | try: | |
167 | branchnode = repo.branchtip(branch) |
|
168 | branchnode = repo.branchtip(branch) | |
168 | except error.RepoLookupError: |
|
169 | except error.RepoLookupError: | |
169 | branchnode = None |
|
170 | branchnode = None | |
170 | if branchnode == ctx.node(): |
|
171 | if branchnode == ctx.node(): | |
171 | branches.append({"name": branch}) |
|
172 | branches.append({"name": branch}) | |
172 | return branches |
|
173 | return branches | |
173 |
|
174 | |||
174 | def nodeinbranch(repo, ctx): |
|
175 | def nodeinbranch(repo, ctx): | |
175 | branches = [] |
|
176 | branches = [] | |
176 | branch = ctx.branch() |
|
177 | branch = ctx.branch() | |
177 | try: |
|
178 | try: | |
178 | branchnode = repo.branchtip(branch) |
|
179 | branchnode = repo.branchtip(branch) | |
179 | except error.RepoLookupError: |
|
180 | except error.RepoLookupError: | |
180 | branchnode = None |
|
181 | branchnode = None | |
181 | if branch != 'default' and branchnode != ctx.node(): |
|
182 | if branch != 'default' and branchnode != ctx.node(): | |
182 | branches.append({"name": branch}) |
|
183 | branches.append({"name": branch}) | |
183 | return branches |
|
184 | return branches | |
184 |
|
185 | |||
185 | def nodebranchnodefault(ctx): |
|
186 | def nodebranchnodefault(ctx): | |
186 | branches = [] |
|
187 | branches = [] | |
187 | branch = ctx.branch() |
|
188 | branch = ctx.branch() | |
188 | if branch != 'default': |
|
189 | if branch != 'default': | |
189 | branches.append({"name": branch}) |
|
190 | branches.append({"name": branch}) | |
190 | return branches |
|
191 | return branches | |
191 |
|
192 | |||
192 | def showtag(repo, tmpl, t1, node=nullid, **args): |
|
193 | def showtag(repo, tmpl, t1, node=nullid, **args): | |
193 | for t in repo.nodetags(node): |
|
194 | for t in repo.nodetags(node): | |
194 | yield tmpl(t1, tag=t, **args) |
|
195 | yield tmpl(t1, tag=t, **args) | |
195 |
|
196 | |||
196 | def showbookmark(repo, tmpl, t1, node=nullid, **args): |
|
197 | def showbookmark(repo, tmpl, t1, node=nullid, **args): | |
197 | for t in repo.nodebookmarks(node): |
|
198 | for t in repo.nodebookmarks(node): | |
198 | yield tmpl(t1, bookmark=t, **args) |
|
199 | yield tmpl(t1, bookmark=t, **args) | |
199 |
|
200 | |||
200 | def cleanpath(repo, path): |
|
201 | def cleanpath(repo, path): | |
201 | path = path.lstrip('/') |
|
202 | path = path.lstrip('/') | |
202 | return pathutil.canonpath(repo.root, '', path) |
|
203 | return pathutil.canonpath(repo.root, '', path) | |
203 |
|
204 | |||
204 | def changeidctx (repo, changeid): |
|
205 | def changeidctx (repo, changeid): | |
205 | try: |
|
206 | try: | |
206 | ctx = repo[changeid] |
|
207 | ctx = repo[changeid] | |
207 | except error.RepoError: |
|
208 | except error.RepoError: | |
208 | man = repo.manifest |
|
209 | man = repo.manifest | |
209 | ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))] |
|
210 | ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))] | |
210 |
|
211 | |||
211 | return ctx |
|
212 | return ctx | |
212 |
|
213 | |||
213 | def changectx (repo, req): |
|
214 | def changectx (repo, req): | |
214 | changeid = "tip" |
|
215 | changeid = "tip" | |
215 | if 'node' in req.form: |
|
216 | if 'node' in req.form: | |
216 | changeid = req.form['node'][0] |
|
217 | changeid = req.form['node'][0] | |
217 | ipos=changeid.find(':') |
|
218 | ipos=changeid.find(':') | |
218 | if ipos != -1: |
|
219 | if ipos != -1: | |
219 | changeid = changeid[(ipos + 1):] |
|
220 | changeid = changeid[(ipos + 1):] | |
220 | elif 'manifest' in req.form: |
|
221 | elif 'manifest' in req.form: | |
221 | changeid = req.form['manifest'][0] |
|
222 | changeid = req.form['manifest'][0] | |
222 |
|
223 | |||
223 | return changeidctx(repo, changeid) |
|
224 | return changeidctx(repo, changeid) | |
224 |
|
225 | |||
225 | def basechangectx(repo, req): |
|
226 | def basechangectx(repo, req): | |
226 | if 'node' in req.form: |
|
227 | if 'node' in req.form: | |
227 | changeid = req.form['node'][0] |
|
228 | changeid = req.form['node'][0] | |
228 | ipos=changeid.find(':') |
|
229 | ipos=changeid.find(':') | |
229 | if ipos != -1: |
|
230 | if ipos != -1: | |
230 | changeid = changeid[:ipos] |
|
231 | changeid = changeid[:ipos] | |
231 | return changeidctx(repo, changeid) |
|
232 | return changeidctx(repo, changeid) | |
232 |
|
233 | |||
233 | return None |
|
234 | return None | |
234 |
|
235 | |||
235 | def filectx(repo, req): |
|
236 | def filectx(repo, req): | |
236 | if 'file' not in req.form: |
|
237 | if 'file' not in req.form: | |
237 | raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') |
|
238 | raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') | |
238 | path = cleanpath(repo, req.form['file'][0]) |
|
239 | path = cleanpath(repo, req.form['file'][0]) | |
239 | if 'node' in req.form: |
|
240 | if 'node' in req.form: | |
240 | changeid = req.form['node'][0] |
|
241 | changeid = req.form['node'][0] | |
241 | elif 'filenode' in req.form: |
|
242 | elif 'filenode' in req.form: | |
242 | changeid = req.form['filenode'][0] |
|
243 | changeid = req.form['filenode'][0] | |
243 | else: |
|
244 | else: | |
244 | raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given') |
|
245 | raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given') | |
245 | try: |
|
246 | try: | |
246 | fctx = repo[changeid][path] |
|
247 | fctx = repo[changeid][path] | |
247 | except error.RepoError: |
|
248 | except error.RepoError: | |
248 | fctx = repo.filectx(path, fileid=changeid) |
|
249 | fctx = repo.filectx(path, fileid=changeid) | |
249 |
|
250 | |||
250 | return fctx |
|
251 | return fctx | |
251 |
|
252 | |||
252 | def changelistentry(web, ctx, tmpl): |
|
253 | def changelistentry(web, ctx, tmpl): | |
253 | '''Obtain a dictionary to be used for entries in a changelist. |
|
254 | '''Obtain a dictionary to be used for entries in a changelist. | |
254 |
|
255 | |||
255 | This function is called when producing items for the "entries" list passed |
|
256 | This function is called when producing items for the "entries" list passed | |
256 | to the "shortlog" and "changelog" templates. |
|
257 | to the "shortlog" and "changelog" templates. | |
257 | ''' |
|
258 | ''' | |
258 | repo = web.repo |
|
259 | repo = web.repo | |
259 | rev = ctx.rev() |
|
260 | rev = ctx.rev() | |
260 | n = ctx.node() |
|
261 | n = ctx.node() | |
261 | showtags = showtag(repo, tmpl, 'changelogtag', n) |
|
262 | showtags = showtag(repo, tmpl, 'changelogtag', n) | |
262 | files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles) |
|
263 | files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles) | |
263 |
|
264 | |||
264 | return { |
|
265 | return { | |
265 | "author": ctx.user(), |
|
266 | "author": ctx.user(), | |
266 | "parent": parents(ctx, rev - 1), |
|
267 | "parent": parents(ctx, rev - 1), | |
267 | "child": children(ctx, rev + 1), |
|
268 | "child": children(ctx, rev + 1), | |
268 | "changelogtag": showtags, |
|
269 | "changelogtag": showtags, | |
269 | "desc": ctx.description(), |
|
270 | "desc": ctx.description(), | |
270 | "extra": ctx.extra(), |
|
271 | "extra": ctx.extra(), | |
271 | "date": ctx.date(), |
|
272 | "date": ctx.date(), | |
272 | "files": files, |
|
273 | "files": files, | |
273 | "rev": rev, |
|
274 | "rev": rev, | |
274 | "node": hex(n), |
|
275 | "node": hex(n), | |
275 | "tags": nodetagsdict(repo, n), |
|
276 | "tags": nodetagsdict(repo, n), | |
276 | "bookmarks": nodebookmarksdict(repo, n), |
|
277 | "bookmarks": nodebookmarksdict(repo, n), | |
277 | "inbranch": nodeinbranch(repo, ctx), |
|
278 | "inbranch": nodeinbranch(repo, ctx), | |
278 | "branches": nodebranchdict(repo, ctx) |
|
279 | "branches": nodebranchdict(repo, ctx) | |
279 | } |
|
280 | } | |
280 |
|
281 | |||
281 | def listfilediffs(tmpl, files, node, max): |
|
282 | def listfilediffs(tmpl, files, node, max): | |
282 | for f in files[:max]: |
|
283 | for f in files[:max]: | |
283 | yield tmpl('filedifflink', node=hex(node), file=f) |
|
284 | yield tmpl('filedifflink', node=hex(node), file=f) | |
284 | if len(files) > max: |
|
285 | if len(files) > max: | |
285 | yield tmpl('fileellipses') |
|
286 | yield tmpl('fileellipses') | |
286 |
|
287 | |||
287 | def diffs(repo, tmpl, ctx, basectx, files, parity, style): |
|
288 | def diffs(repo, tmpl, ctx, basectx, files, parity, style): | |
288 |
|
289 | |||
289 | def countgen(): |
|
290 | def countgen(): | |
290 | start = 1 |
|
291 | start = 1 | |
291 | while True: |
|
292 | while True: | |
292 | yield start |
|
293 | yield start | |
293 | start += 1 |
|
294 | start += 1 | |
294 |
|
295 | |||
295 | blockcount = countgen() |
|
296 | blockcount = countgen() | |
296 | def prettyprintlines(diff, blockno): |
|
297 | def prettyprintlines(diff, blockno): | |
297 | for lineno, l in enumerate(diff.splitlines(True)): |
|
298 | for lineno, l in enumerate(diff.splitlines(True)): | |
298 | lineno = "%d.%d" % (blockno, lineno + 1) |
|
299 | lineno = "%d.%d" % (blockno, lineno + 1) | |
299 | if l.startswith('+'): |
|
300 | if l.startswith('+'): | |
300 | ltype = "difflineplus" |
|
301 | ltype = "difflineplus" | |
301 | elif l.startswith('-'): |
|
302 | elif l.startswith('-'): | |
302 | ltype = "difflineminus" |
|
303 | ltype = "difflineminus" | |
303 | elif l.startswith('@'): |
|
304 | elif l.startswith('@'): | |
304 | ltype = "difflineat" |
|
305 | ltype = "difflineat" | |
305 | else: |
|
306 | else: | |
306 | ltype = "diffline" |
|
307 | ltype = "diffline" | |
307 | yield tmpl(ltype, |
|
308 | yield tmpl(ltype, | |
308 | line=l, |
|
309 | line=l, | |
309 | lineid="l%s" % lineno, |
|
310 | lineid="l%s" % lineno, | |
310 | linenumber="% 8s" % lineno) |
|
311 | linenumber="% 8s" % lineno) | |
311 |
|
312 | |||
312 | if files: |
|
313 | if files: | |
313 | m = match.exact(repo.root, repo.getcwd(), files) |
|
314 | m = match.exact(repo.root, repo.getcwd(), files) | |
314 | else: |
|
315 | else: | |
315 | m = match.always(repo.root, repo.getcwd()) |
|
316 | m = match.always(repo.root, repo.getcwd()) | |
316 |
|
317 | |||
317 | diffopts = patch.diffopts(repo.ui, untrusted=True) |
|
318 | diffopts = patch.diffopts(repo.ui, untrusted=True) | |
318 | if basectx is None: |
|
319 | if basectx is None: | |
319 | parents = ctx.parents() |
|
320 | parents = ctx.parents() | |
320 | node1 = parents and parents[0].node() or nullid |
|
321 | node1 = parents and parents[0].node() or nullid | |
321 | else: |
|
322 | else: | |
322 | node1 = basectx.node() |
|
323 | node1 = basectx.node() | |
323 | node2 = ctx.node() |
|
324 | node2 = ctx.node() | |
324 |
|
325 | |||
325 | block = [] |
|
326 | block = [] | |
326 | for chunk in patch.diff(repo, node1, node2, m, opts=diffopts): |
|
327 | for chunk in patch.diff(repo, node1, node2, m, opts=diffopts): | |
327 | if chunk.startswith('diff') and block: |
|
328 | if chunk.startswith('diff') and block: | |
328 | blockno = blockcount.next() |
|
329 | blockno = blockcount.next() | |
329 | yield tmpl('diffblock', parity=parity.next(), blockno=blockno, |
|
330 | yield tmpl('diffblock', parity=parity.next(), blockno=blockno, | |
330 | lines=prettyprintlines(''.join(block), blockno)) |
|
331 | lines=prettyprintlines(''.join(block), blockno)) | |
331 | block = [] |
|
332 | block = [] | |
332 | if chunk.startswith('diff') and style != 'raw': |
|
333 | if chunk.startswith('diff') and style != 'raw': | |
333 | chunk = ''.join(chunk.splitlines(True)[1:]) |
|
334 | chunk = ''.join(chunk.splitlines(True)[1:]) | |
334 | block.append(chunk) |
|
335 | block.append(chunk) | |
335 | blockno = blockcount.next() |
|
336 | blockno = blockcount.next() | |
336 | yield tmpl('diffblock', parity=parity.next(), blockno=blockno, |
|
337 | yield tmpl('diffblock', parity=parity.next(), blockno=blockno, | |
337 | lines=prettyprintlines(''.join(block), blockno)) |
|
338 | lines=prettyprintlines(''.join(block), blockno)) | |
338 |
|
339 | |||
339 | def compare(tmpl, context, leftlines, rightlines): |
|
340 | def compare(tmpl, context, leftlines, rightlines): | |
340 | '''Generator function that provides side-by-side comparison data.''' |
|
341 | '''Generator function that provides side-by-side comparison data.''' | |
341 |
|
342 | |||
342 | def compline(type, leftlineno, leftline, rightlineno, rightline): |
|
343 | def compline(type, leftlineno, leftline, rightlineno, rightline): | |
343 | lineid = leftlineno and ("l%s" % leftlineno) or '' |
|
344 | lineid = leftlineno and ("l%s" % leftlineno) or '' | |
344 | lineid += rightlineno and ("r%s" % rightlineno) or '' |
|
345 | lineid += rightlineno and ("r%s" % rightlineno) or '' | |
345 | return tmpl('comparisonline', |
|
346 | return tmpl('comparisonline', | |
346 | type=type, |
|
347 | type=type, | |
347 | lineid=lineid, |
|
348 | lineid=lineid, | |
348 | leftlinenumber="% 6s" % (leftlineno or ''), |
|
349 | leftlinenumber="% 6s" % (leftlineno or ''), | |
349 | leftline=leftline or '', |
|
350 | leftline=leftline or '', | |
350 | rightlinenumber="% 6s" % (rightlineno or ''), |
|
351 | rightlinenumber="% 6s" % (rightlineno or ''), | |
351 | rightline=rightline or '') |
|
352 | rightline=rightline or '') | |
352 |
|
353 | |||
353 | def getblock(opcodes): |
|
354 | def getblock(opcodes): | |
354 | for type, llo, lhi, rlo, rhi in opcodes: |
|
355 | for type, llo, lhi, rlo, rhi in opcodes: | |
355 | len1 = lhi - llo |
|
356 | len1 = lhi - llo | |
356 | len2 = rhi - rlo |
|
357 | len2 = rhi - rlo | |
357 | count = min(len1, len2) |
|
358 | count = min(len1, len2) | |
358 | for i in xrange(count): |
|
359 | for i in xrange(count): | |
359 | yield compline(type=type, |
|
360 | yield compline(type=type, | |
360 | leftlineno=llo + i + 1, |
|
361 | leftlineno=llo + i + 1, | |
361 | leftline=leftlines[llo + i], |
|
362 | leftline=leftlines[llo + i], | |
362 | rightlineno=rlo + i + 1, |
|
363 | rightlineno=rlo + i + 1, | |
363 | rightline=rightlines[rlo + i]) |
|
364 | rightline=rightlines[rlo + i]) | |
364 | if len1 > len2: |
|
365 | if len1 > len2: | |
365 | for i in xrange(llo + count, lhi): |
|
366 | for i in xrange(llo + count, lhi): | |
366 | yield compline(type=type, |
|
367 | yield compline(type=type, | |
367 | leftlineno=i + 1, |
|
368 | leftlineno=i + 1, | |
368 | leftline=leftlines[i], |
|
369 | leftline=leftlines[i], | |
369 | rightlineno=None, |
|
370 | rightlineno=None, | |
370 | rightline=None) |
|
371 | rightline=None) | |
371 | elif len2 > len1: |
|
372 | elif len2 > len1: | |
372 | for i in xrange(rlo + count, rhi): |
|
373 | for i in xrange(rlo + count, rhi): | |
373 | yield compline(type=type, |
|
374 | yield compline(type=type, | |
374 | leftlineno=None, |
|
375 | leftlineno=None, | |
375 | leftline=None, |
|
376 | leftline=None, | |
376 | rightlineno=i + 1, |
|
377 | rightlineno=i + 1, | |
377 | rightline=rightlines[i]) |
|
378 | rightline=rightlines[i]) | |
378 |
|
379 | |||
379 | s = difflib.SequenceMatcher(None, leftlines, rightlines) |
|
380 | s = difflib.SequenceMatcher(None, leftlines, rightlines) | |
380 | if context < 0: |
|
381 | if context < 0: | |
381 | yield tmpl('comparisonblock', lines=getblock(s.get_opcodes())) |
|
382 | yield tmpl('comparisonblock', lines=getblock(s.get_opcodes())) | |
382 | else: |
|
383 | else: | |
383 | for oc in s.get_grouped_opcodes(n=context): |
|
384 | for oc in s.get_grouped_opcodes(n=context): | |
384 | yield tmpl('comparisonblock', lines=getblock(oc)) |
|
385 | yield tmpl('comparisonblock', lines=getblock(oc)) | |
385 |
|
386 | |||
386 | def diffstatgen(ctx, basectx): |
|
387 | def diffstatgen(ctx, basectx): | |
387 | '''Generator function that provides the diffstat data.''' |
|
388 | '''Generator function that provides the diffstat data.''' | |
388 |
|
389 | |||
389 | stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx))) |
|
390 | stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx))) | |
390 | maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats) |
|
391 | maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats) | |
391 | while True: |
|
392 | while True: | |
392 | yield stats, maxname, maxtotal, addtotal, removetotal, binary |
|
393 | yield stats, maxname, maxtotal, addtotal, removetotal, binary | |
393 |
|
394 | |||
394 | def diffsummary(statgen): |
|
395 | def diffsummary(statgen): | |
395 | '''Return a short summary of the diff.''' |
|
396 | '''Return a short summary of the diff.''' | |
396 |
|
397 | |||
397 | stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next() |
|
398 | stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next() | |
398 | return _(' %d files changed, %d insertions(+), %d deletions(-)\n') % ( |
|
399 | return _(' %d files changed, %d insertions(+), %d deletions(-)\n') % ( | |
399 | len(stats), addtotal, removetotal) |
|
400 | len(stats), addtotal, removetotal) | |
400 |
|
401 | |||
401 | def diffstat(tmpl, ctx, statgen, parity): |
|
402 | def diffstat(tmpl, ctx, statgen, parity): | |
402 | '''Return a diffstat template for each file in the diff.''' |
|
403 | '''Return a diffstat template for each file in the diff.''' | |
403 |
|
404 | |||
404 | stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next() |
|
405 | stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next() | |
405 | files = ctx.files() |
|
406 | files = ctx.files() | |
406 |
|
407 | |||
407 | def pct(i): |
|
408 | def pct(i): | |
408 | if maxtotal == 0: |
|
409 | if maxtotal == 0: | |
409 | return 0 |
|
410 | return 0 | |
410 | return (float(i) / maxtotal) * 100 |
|
411 | return (float(i) / maxtotal) * 100 | |
411 |
|
412 | |||
412 | fileno = 0 |
|
413 | fileno = 0 | |
413 | for filename, adds, removes, isbinary in stats: |
|
414 | for filename, adds, removes, isbinary in stats: | |
414 | template = filename in files and 'diffstatlink' or 'diffstatnolink' |
|
415 | template = filename in files and 'diffstatlink' or 'diffstatnolink' | |
415 | total = adds + removes |
|
416 | total = adds + removes | |
416 | fileno += 1 |
|
417 | fileno += 1 | |
417 | yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno, |
|
418 | yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno, | |
418 | total=total, addpct=pct(adds), removepct=pct(removes), |
|
419 | total=total, addpct=pct(adds), removepct=pct(removes), | |
419 | parity=parity.next()) |
|
420 | parity=parity.next()) | |
420 |
|
421 | |||
421 | class sessionvars(object): |
|
422 | class sessionvars(object): | |
422 | def __init__(self, vars, start='?'): |
|
423 | def __init__(self, vars, start='?'): | |
423 | self.start = start |
|
424 | self.start = start | |
424 | self.vars = vars |
|
425 | self.vars = vars | |
425 | def __getitem__(self, key): |
|
426 | def __getitem__(self, key): | |
426 | return self.vars[key] |
|
427 | return self.vars[key] | |
427 | def __setitem__(self, key, value): |
|
428 | def __setitem__(self, key, value): | |
428 | self.vars[key] = value |
|
429 | self.vars[key] = value | |
429 | def __copy__(self): |
|
430 | def __copy__(self): | |
430 | return sessionvars(copy.copy(self.vars), self.start) |
|
431 | return sessionvars(copy.copy(self.vars), self.start) | |
431 | def __iter__(self): |
|
432 | def __iter__(self): | |
432 | separator = self.start |
|
433 | separator = self.start | |
433 | for key, value in sorted(self.vars.iteritems()): |
|
434 | for key, value in sorted(self.vars.iteritems()): | |
434 | yield {'name': key, 'value': str(value), 'separator': separator} |
|
435 | yield {'name': key, 'value': str(value), 'separator': separator} | |
435 | separator = '&' |
|
436 | separator = '&' | |
436 |
|
437 | |||
437 | class wsgiui(ui.ui): |
|
438 | class wsgiui(ui.ui): | |
438 | # default termwidth breaks under mod_wsgi |
|
439 | # default termwidth breaks under mod_wsgi | |
439 | def termwidth(self): |
|
440 | def termwidth(self): | |
440 | return 80 |
|
441 | return 80 |
@@ -1,797 +1,836 b'' | |||||
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 | > EOF |
|
7 | > EOF | |
8 | $ mkcommit() { |
|
8 | $ mkcommit() { | |
9 | > echo "$1" > "$1" |
|
9 | > echo "$1" > "$1" | |
10 | > hg add "$1" |
|
10 | > hg add "$1" | |
11 | > hg ci -m "add $1" |
|
11 | > hg ci -m "add $1" | |
12 | > } |
|
12 | > } | |
13 | $ getid() { |
|
13 | $ getid() { | |
14 | > hg id --debug --hidden -ir "desc('$1')" |
|
14 | > hg id --debug --hidden -ir "desc('$1')" | |
15 | > } |
|
15 | > } | |
16 |
|
16 | |||
17 | $ cat > debugkeys.py <<EOF |
|
17 | $ cat > debugkeys.py <<EOF | |
18 | > def reposetup(ui, repo): |
|
18 | > def reposetup(ui, repo): | |
19 | > class debugkeysrepo(repo.__class__): |
|
19 | > class debugkeysrepo(repo.__class__): | |
20 | > def listkeys(self, namespace): |
|
20 | > def listkeys(self, namespace): | |
21 | > ui.write('listkeys %s\n' % (namespace,)) |
|
21 | > ui.write('listkeys %s\n' % (namespace,)) | |
22 | > return super(debugkeysrepo, self).listkeys(namespace) |
|
22 | > return super(debugkeysrepo, self).listkeys(namespace) | |
23 | > |
|
23 | > | |
24 | > if repo.local(): |
|
24 | > if repo.local(): | |
25 | > repo.__class__ = debugkeysrepo |
|
25 | > repo.__class__ = debugkeysrepo | |
26 | > EOF |
|
26 | > EOF | |
27 |
|
27 | |||
28 | $ hg init tmpa |
|
28 | $ hg init tmpa | |
29 | $ cd tmpa |
|
29 | $ cd tmpa | |
30 | $ mkcommit kill_me |
|
30 | $ mkcommit kill_me | |
31 |
|
31 | |||
32 | Checking that the feature is properly disabled |
|
32 | Checking that the feature is properly disabled | |
33 |
|
33 | |||
34 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar |
|
34 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar | |
35 | abort: creating obsolete markers is not enabled on this repo |
|
35 | abort: creating obsolete markers is not enabled on this repo | |
36 | [255] |
|
36 | [255] | |
37 |
|
37 | |||
38 | Enabling it |
|
38 | Enabling it | |
39 |
|
39 | |||
40 | $ cat >> $HGRCPATH << EOF |
|
40 | $ cat >> $HGRCPATH << EOF | |
41 | > [experimental] |
|
41 | > [experimental] | |
42 | > evolution=createmarkers,exchange |
|
42 | > evolution=createmarkers,exchange | |
43 | > EOF |
|
43 | > EOF | |
44 |
|
44 | |||
45 | Killing a single changeset without replacement |
|
45 | Killing a single changeset without replacement | |
46 |
|
46 | |||
47 | $ hg debugobsolete 0 |
|
47 | $ hg debugobsolete 0 | |
48 | abort: changeset references must be full hexadecimal node identifiers |
|
48 | abort: changeset references must be full hexadecimal node identifiers | |
49 | [255] |
|
49 | [255] | |
50 | $ hg debugobsolete '00' |
|
50 | $ hg debugobsolete '00' | |
51 | abort: changeset references must be full hexadecimal node identifiers |
|
51 | abort: changeset references must be full hexadecimal node identifiers | |
52 | [255] |
|
52 | [255] | |
53 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar |
|
53 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar | |
54 | $ hg debugobsolete |
|
54 | $ hg debugobsolete | |
55 | 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} |
|
55 | 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} | |
56 |
|
56 | |||
57 | (test that mercurial is not confused) |
|
57 | (test that mercurial is not confused) | |
58 |
|
58 | |||
59 | $ hg up null --quiet # having 0 as parent prevents it to be hidden |
|
59 | $ hg up null --quiet # having 0 as parent prevents it to be hidden | |
60 | $ hg tip |
|
60 | $ hg tip | |
61 | -1:000000000000 (public) [tip ] |
|
61 | -1:000000000000 (public) [tip ] | |
62 | $ hg up --hidden tip --quiet |
|
62 | $ hg up --hidden tip --quiet | |
63 |
|
63 | |||
64 | Killing a single changeset with itself should fail |
|
64 | Killing a single changeset with itself should fail | |
65 | (simple local safeguard) |
|
65 | (simple local safeguard) | |
66 |
|
66 | |||
67 | $ hg debugobsolete `getid kill_me` `getid kill_me` |
|
67 | $ hg debugobsolete `getid kill_me` `getid kill_me` | |
68 | abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0 |
|
68 | abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0 | |
69 | [255] |
|
69 | [255] | |
70 |
|
70 | |||
71 | $ cd .. |
|
71 | $ cd .. | |
72 |
|
72 | |||
73 | Killing a single changeset with replacement |
|
73 | Killing a single changeset with replacement | |
74 | (and testing the format option) |
|
74 | (and testing the format option) | |
75 |
|
75 | |||
76 | $ hg init tmpb |
|
76 | $ hg init tmpb | |
77 | $ cd tmpb |
|
77 | $ cd tmpb | |
78 | $ mkcommit a |
|
78 | $ mkcommit a | |
79 | $ mkcommit b |
|
79 | $ mkcommit b | |
80 | $ mkcommit original_c |
|
80 | $ mkcommit original_c | |
81 | $ hg up "desc('b')" |
|
81 | $ hg up "desc('b')" | |
82 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
82 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
83 | $ mkcommit new_c |
|
83 | $ mkcommit new_c | |
84 | created new head |
|
84 | created new head | |
85 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden |
|
85 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden | |
86 | $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120' |
|
86 | $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120' | |
87 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden |
|
87 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden | |
88 | 2:245bde4270cd add original_c |
|
88 | 2:245bde4270cd add original_c | |
89 | $ hg debugrevlog -cd |
|
89 | $ hg debugrevlog -cd | |
90 | # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen |
|
90 | # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen | |
91 | 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0 |
|
91 | 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0 | |
92 | 1 0 -1 59 118 59 59 0 0 58 116 0 1 0 |
|
92 | 1 0 -1 59 118 59 59 0 0 58 116 0 1 0 | |
93 | 2 1 -1 118 193 118 118 59 0 76 192 0 1 0 |
|
93 | 2 1 -1 118 193 118 118 59 0 76 192 0 1 0 | |
94 | 3 1 -1 193 260 193 193 59 0 66 258 0 2 0 |
|
94 | 3 1 -1 193 260 193 193 59 0 66 258 0 2 0 | |
95 | $ hg debugobsolete |
|
95 | $ hg debugobsolete | |
96 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
96 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
97 |
|
97 | |||
98 | (check for version number of the obsstore) |
|
98 | (check for version number of the obsstore) | |
99 |
|
99 | |||
100 | $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null |
|
100 | $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null | |
101 | \x00 (no-eol) (esc) |
|
101 | \x00 (no-eol) (esc) | |
102 |
|
102 | |||
103 | do it again (it read the obsstore before adding new changeset) |
|
103 | do it again (it read the obsstore before adding new changeset) | |
104 |
|
104 | |||
105 | $ hg up '.^' |
|
105 | $ hg up '.^' | |
106 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
106 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
107 | $ mkcommit new_2_c |
|
107 | $ mkcommit new_2_c | |
108 | created new head |
|
108 | created new head | |
109 | $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c` |
|
109 | $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c` | |
110 | $ hg debugobsolete |
|
110 | $ hg debugobsolete | |
111 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
111 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
112 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
112 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
113 |
|
113 | |||
114 | Register two markers with a missing node |
|
114 | Register two markers with a missing node | |
115 |
|
115 | |||
116 | $ hg up '.^' |
|
116 | $ hg up '.^' | |
117 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
117 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
118 | $ mkcommit new_3_c |
|
118 | $ mkcommit new_3_c | |
119 | created new head |
|
119 | created new head | |
120 | $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337 |
|
120 | $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337 | |
121 | $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c` |
|
121 | $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c` | |
122 | $ hg debugobsolete |
|
122 | $ hg debugobsolete | |
123 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
123 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
124 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
124 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
125 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
125 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
126 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
126 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
127 |
|
127 | |||
128 | Refuse pathological nullid successors |
|
128 | Refuse pathological nullid successors | |
129 | $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000 |
|
129 | $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000 | |
130 | transaction abort! |
|
130 | transaction abort! | |
131 | rollback completed |
|
131 | rollback completed | |
132 | abort: bad obsolescence marker detected: invalid successors nullid |
|
132 | abort: bad obsolescence marker detected: invalid successors nullid | |
133 | [255] |
|
133 | [255] | |
134 |
|
134 | |||
135 | Check that graphlog detect that a changeset is obsolete: |
|
135 | Check that graphlog detect that a changeset is obsolete: | |
136 |
|
136 | |||
137 | $ hg log -G |
|
137 | $ hg log -G | |
138 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
138 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c | |
139 | | |
|
139 | | | |
140 | o 1:7c3bad9141dc (draft) [ ] add b |
|
140 | o 1:7c3bad9141dc (draft) [ ] add b | |
141 | | |
|
141 | | | |
142 | o 0:1f0dee641bb7 (draft) [ ] add a |
|
142 | o 0:1f0dee641bb7 (draft) [ ] add a | |
143 |
|
143 | |||
144 |
|
144 | |||
145 | check that heads does not report them |
|
145 | check that heads does not report them | |
146 |
|
146 | |||
147 | $ hg heads |
|
147 | $ hg heads | |
148 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
148 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
149 | $ hg heads --hidden |
|
149 | $ hg heads --hidden | |
150 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
150 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
151 | 4:ca819180edb9 (draft) [ ] add new_2_c |
|
151 | 4:ca819180edb9 (draft) [ ] add new_2_c | |
152 | 3:cdbce2fbb163 (draft) [ ] add new_c |
|
152 | 3:cdbce2fbb163 (draft) [ ] add new_c | |
153 | 2:245bde4270cd (draft) [ ] add original_c |
|
153 | 2:245bde4270cd (draft) [ ] add original_c | |
154 |
|
154 | |||
155 |
|
155 | |||
156 | check that summary does not report them |
|
156 | check that summary does not report them | |
157 |
|
157 | |||
158 | $ hg init ../sink |
|
158 | $ hg init ../sink | |
159 | $ echo '[paths]' >> .hg/hgrc |
|
159 | $ echo '[paths]' >> .hg/hgrc | |
160 | $ echo 'default=../sink' >> .hg/hgrc |
|
160 | $ echo 'default=../sink' >> .hg/hgrc | |
161 | $ hg summary --remote |
|
161 | $ hg summary --remote | |
162 | parent: 5:5601fb93a350 tip |
|
162 | parent: 5:5601fb93a350 tip | |
163 | add new_3_c |
|
163 | add new_3_c | |
164 | branch: default |
|
164 | branch: default | |
165 | commit: (clean) |
|
165 | commit: (clean) | |
166 | update: (current) |
|
166 | update: (current) | |
167 | remote: 3 outgoing |
|
167 | remote: 3 outgoing | |
168 |
|
168 | |||
169 | $ hg summary --remote --hidden |
|
169 | $ hg summary --remote --hidden | |
170 | parent: 5:5601fb93a350 tip |
|
170 | parent: 5:5601fb93a350 tip | |
171 | add new_3_c |
|
171 | add new_3_c | |
172 | branch: default |
|
172 | branch: default | |
173 | commit: (clean) |
|
173 | commit: (clean) | |
174 | update: 3 new changesets, 4 branch heads (merge) |
|
174 | update: 3 new changesets, 4 branch heads (merge) | |
175 | remote: 3 outgoing |
|
175 | remote: 3 outgoing | |
176 |
|
176 | |||
177 | check that various commands work well with filtering |
|
177 | check that various commands work well with filtering | |
178 |
|
178 | |||
179 | $ hg tip |
|
179 | $ hg tip | |
180 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
180 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
181 | $ hg log -r 6 |
|
181 | $ hg log -r 6 | |
182 | abort: unknown revision '6'! |
|
182 | abort: unknown revision '6'! | |
183 | [255] |
|
183 | [255] | |
184 | $ hg log -r 4 |
|
184 | $ hg log -r 4 | |
185 | abort: hidden revision '4'! |
|
185 | abort: hidden revision '4'! | |
186 | (use --hidden to access hidden revisions) |
|
186 | (use --hidden to access hidden revisions) | |
187 | [255] |
|
187 | [255] | |
188 | $ hg debugrevspec 'rev(6)' |
|
188 | $ hg debugrevspec 'rev(6)' | |
189 | $ hg debugrevspec 'rev(4)' |
|
189 | $ hg debugrevspec 'rev(4)' | |
190 |
|
190 | |||
191 | Check that public changeset are not accounted as obsolete: |
|
191 | Check that public changeset are not accounted as obsolete: | |
192 |
|
192 | |||
193 | $ hg --hidden phase --public 2 |
|
193 | $ hg --hidden phase --public 2 | |
194 | $ hg log -G |
|
194 | $ hg log -G | |
195 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
195 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c | |
196 | | |
|
196 | | | |
197 | | o 2:245bde4270cd (public) [ ] add original_c |
|
197 | | o 2:245bde4270cd (public) [ ] add original_c | |
198 | |/ |
|
198 | |/ | |
199 | o 1:7c3bad9141dc (public) [ ] add b |
|
199 | o 1:7c3bad9141dc (public) [ ] add b | |
200 | | |
|
200 | | | |
201 | o 0:1f0dee641bb7 (public) [ ] add a |
|
201 | o 0:1f0dee641bb7 (public) [ ] add a | |
202 |
|
202 | |||
203 |
|
203 | |||
204 | And that bumped changeset are detected |
|
204 | And that bumped changeset are detected | |
205 | -------------------------------------- |
|
205 | -------------------------------------- | |
206 |
|
206 | |||
207 | If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also |
|
207 | If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also | |
208 | note that the bumped changeset (5:5601fb93a350) is not a direct successor of |
|
208 | note that the bumped changeset (5:5601fb93a350) is not a direct successor of | |
209 | the public changeset |
|
209 | the public changeset | |
210 |
|
210 | |||
211 | $ hg log --hidden -r 'bumped()' |
|
211 | $ hg log --hidden -r 'bumped()' | |
212 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
212 | 5:5601fb93a350 (draft) [tip ] add new_3_c | |
213 |
|
213 | |||
214 | And that we can't push bumped changeset |
|
214 | And that we can't push bumped changeset | |
215 |
|
215 | |||
216 | $ hg push ../tmpa -r 0 --force #(make repo related) |
|
216 | $ hg push ../tmpa -r 0 --force #(make repo related) | |
217 | pushing to ../tmpa |
|
217 | pushing to ../tmpa | |
218 | searching for changes |
|
218 | searching for changes | |
219 | warning: repository is unrelated |
|
219 | warning: repository is unrelated | |
220 | adding changesets |
|
220 | adding changesets | |
221 | adding manifests |
|
221 | adding manifests | |
222 | adding file changes |
|
222 | adding file changes | |
223 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
223 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
224 | $ hg push ../tmpa |
|
224 | $ hg push ../tmpa | |
225 | pushing to ../tmpa |
|
225 | pushing to ../tmpa | |
226 | searching for changes |
|
226 | searching for changes | |
227 | abort: push includes bumped changeset: 5601fb93a350! |
|
227 | abort: push includes bumped changeset: 5601fb93a350! | |
228 | [255] |
|
228 | [255] | |
229 |
|
229 | |||
230 | Fixing "bumped" situation |
|
230 | Fixing "bumped" situation | |
231 | We need to create a clone of 5 and add a special marker with a flag |
|
231 | We need to create a clone of 5 and add a special marker with a flag | |
232 |
|
232 | |||
233 | $ hg up '5^' |
|
233 | $ hg up '5^' | |
234 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
234 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
235 | $ hg revert -ar 5 |
|
235 | $ hg revert -ar 5 | |
236 | adding new_3_c |
|
236 | adding new_3_c | |
237 | $ hg ci -m 'add n3w_3_c' |
|
237 | $ hg ci -m 'add n3w_3_c' | |
238 | created new head |
|
238 | created new head | |
239 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` |
|
239 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` | |
240 | $ hg log -r 'bumped()' |
|
240 | $ hg log -r 'bumped()' | |
241 | $ hg log -G |
|
241 | $ hg log -G | |
242 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
242 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c | |
243 | | |
|
243 | | | |
244 | | o 2:245bde4270cd (public) [ ] add original_c |
|
244 | | o 2:245bde4270cd (public) [ ] add original_c | |
245 | |/ |
|
245 | |/ | |
246 | o 1:7c3bad9141dc (public) [ ] add b |
|
246 | o 1:7c3bad9141dc (public) [ ] add b | |
247 | | |
|
247 | | | |
248 | o 0:1f0dee641bb7 (public) [ ] add a |
|
248 | o 0:1f0dee641bb7 (public) [ ] add a | |
249 |
|
249 | |||
250 |
|
250 | |||
251 |
|
251 | |||
252 |
|
252 | |||
253 | $ cd .. |
|
253 | $ cd .. | |
254 |
|
254 | |||
255 | Exchange Test |
|
255 | Exchange Test | |
256 | ============================ |
|
256 | ============================ | |
257 |
|
257 | |||
258 | Destination repo does not have any data |
|
258 | Destination repo does not have any data | |
259 | --------------------------------------- |
|
259 | --------------------------------------- | |
260 |
|
260 | |||
261 | Simple incoming test |
|
261 | Simple incoming test | |
262 |
|
262 | |||
263 | $ hg init tmpc |
|
263 | $ hg init tmpc | |
264 | $ cd tmpc |
|
264 | $ cd tmpc | |
265 | $ hg incoming ../tmpb |
|
265 | $ hg incoming ../tmpb | |
266 | comparing with ../tmpb |
|
266 | comparing with ../tmpb | |
267 | 0:1f0dee641bb7 (public) [ ] add a |
|
267 | 0:1f0dee641bb7 (public) [ ] add a | |
268 | 1:7c3bad9141dc (public) [ ] add b |
|
268 | 1:7c3bad9141dc (public) [ ] add b | |
269 | 2:245bde4270cd (public) [ ] add original_c |
|
269 | 2:245bde4270cd (public) [ ] add original_c | |
270 | 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
270 | 6:6f9641995072 (draft) [tip ] add n3w_3_c | |
271 |
|
271 | |||
272 | Try to pull markers |
|
272 | Try to pull markers | |
273 | (extinct changeset are excluded but marker are pushed) |
|
273 | (extinct changeset are excluded but marker are pushed) | |
274 |
|
274 | |||
275 | $ hg pull ../tmpb |
|
275 | $ hg pull ../tmpb | |
276 | pulling from ../tmpb |
|
276 | pulling from ../tmpb | |
277 | requesting all changes |
|
277 | requesting all changes | |
278 | adding changesets |
|
278 | adding changesets | |
279 | adding manifests |
|
279 | adding manifests | |
280 | adding file changes |
|
280 | adding file changes | |
281 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
281 | added 4 changesets with 4 changes to 4 files (+1 heads) | |
282 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
282 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
283 | $ hg debugobsolete |
|
283 | $ hg debugobsolete | |
284 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
284 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
285 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
285 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
286 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
286 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
287 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
287 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
288 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
288 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
289 |
|
289 | |||
290 | Rollback//Transaction support |
|
290 | Rollback//Transaction support | |
291 |
|
291 | |||
292 | $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
292 | $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb | |
293 | $ hg debugobsolete |
|
293 | $ hg debugobsolete | |
294 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
294 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
295 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
295 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
296 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
296 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
297 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
297 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
298 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
298 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
299 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'} |
|
299 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'} | |
300 | $ hg rollback -n |
|
300 | $ hg rollback -n | |
301 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
301 | repository tip rolled back to revision 3 (undo debugobsolete) | |
302 | $ hg rollback |
|
302 | $ hg rollback | |
303 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
303 | repository tip rolled back to revision 3 (undo debugobsolete) | |
304 | $ hg debugobsolete |
|
304 | $ hg debugobsolete | |
305 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
305 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
306 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
306 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
307 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
307 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
308 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
308 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
309 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
309 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
310 |
|
310 | |||
311 | $ cd .. |
|
311 | $ cd .. | |
312 |
|
312 | |||
313 | Try to push markers |
|
313 | Try to push markers | |
314 |
|
314 | |||
315 | $ hg init tmpd |
|
315 | $ hg init tmpd | |
316 | $ hg -R tmpb push tmpd |
|
316 | $ hg -R tmpb push tmpd | |
317 | pushing to tmpd |
|
317 | pushing to tmpd | |
318 | searching for changes |
|
318 | searching for changes | |
319 | adding changesets |
|
319 | adding changesets | |
320 | adding manifests |
|
320 | adding manifests | |
321 | adding file changes |
|
321 | adding file changes | |
322 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
322 | added 4 changesets with 4 changes to 4 files (+1 heads) | |
323 | $ hg -R tmpd debugobsolete | sort |
|
323 | $ hg -R tmpd debugobsolete | sort | |
324 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
324 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
325 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
325 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
326 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
326 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
327 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
327 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
328 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
328 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
329 |
|
329 | |||
330 | Check obsolete keys are exchanged only if source has an obsolete store |
|
330 | Check obsolete keys are exchanged only if source has an obsolete store | |
331 |
|
331 | |||
332 | $ hg init empty |
|
332 | $ hg init empty | |
333 | $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd |
|
333 | $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd | |
334 | pushing to tmpd |
|
334 | pushing to tmpd | |
335 | listkeys phases |
|
335 | listkeys phases | |
336 | listkeys bookmarks |
|
336 | listkeys bookmarks | |
337 | no changes found |
|
337 | no changes found | |
338 | listkeys phases |
|
338 | listkeys phases | |
339 | [1] |
|
339 | [1] | |
340 |
|
340 | |||
341 | clone support |
|
341 | clone support | |
342 | (markers are copied and extinct changesets are included to allow hardlinks) |
|
342 | (markers are copied and extinct changesets are included to allow hardlinks) | |
343 |
|
343 | |||
344 | $ hg clone tmpb clone-dest |
|
344 | $ hg clone tmpb clone-dest | |
345 | updating to branch default |
|
345 | updating to branch default | |
346 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
346 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
347 | $ hg -R clone-dest log -G --hidden |
|
347 | $ hg -R clone-dest log -G --hidden | |
348 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
348 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c | |
349 | | |
|
349 | | | |
350 | | x 5:5601fb93a350 (draft) [ ] add new_3_c |
|
350 | | x 5:5601fb93a350 (draft) [ ] add new_3_c | |
351 | |/ |
|
351 | |/ | |
352 | | x 4:ca819180edb9 (draft) [ ] add new_2_c |
|
352 | | x 4:ca819180edb9 (draft) [ ] add new_2_c | |
353 | |/ |
|
353 | |/ | |
354 | | x 3:cdbce2fbb163 (draft) [ ] add new_c |
|
354 | | x 3:cdbce2fbb163 (draft) [ ] add new_c | |
355 | |/ |
|
355 | |/ | |
356 | | o 2:245bde4270cd (public) [ ] add original_c |
|
356 | | o 2:245bde4270cd (public) [ ] add original_c | |
357 | |/ |
|
357 | |/ | |
358 | o 1:7c3bad9141dc (public) [ ] add b |
|
358 | o 1:7c3bad9141dc (public) [ ] add b | |
359 | | |
|
359 | | | |
360 | o 0:1f0dee641bb7 (public) [ ] add a |
|
360 | o 0:1f0dee641bb7 (public) [ ] add a | |
361 |
|
361 | |||
362 | $ hg -R clone-dest debugobsolete |
|
362 | $ hg -R clone-dest debugobsolete | |
363 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
363 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
364 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
364 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
365 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
365 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
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 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
367 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
368 |
|
368 | |||
369 |
|
369 | |||
370 | Destination repo have existing data |
|
370 | Destination repo have existing data | |
371 | --------------------------------------- |
|
371 | --------------------------------------- | |
372 |
|
372 | |||
373 | On pull |
|
373 | On pull | |
374 |
|
374 | |||
375 | $ hg init tmpe |
|
375 | $ hg init tmpe | |
376 | $ cd tmpe |
|
376 | $ cd tmpe | |
377 | $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 |
|
377 | $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 | |
378 | $ hg pull ../tmpb |
|
378 | $ hg pull ../tmpb | |
379 | pulling from ../tmpb |
|
379 | pulling from ../tmpb | |
380 | requesting all changes |
|
380 | requesting all changes | |
381 | adding changesets |
|
381 | adding changesets | |
382 | adding manifests |
|
382 | adding manifests | |
383 | adding file changes |
|
383 | adding file changes | |
384 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
384 | added 4 changesets with 4 changes to 4 files (+1 heads) | |
385 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
385 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
386 | $ hg debugobsolete |
|
386 | $ hg debugobsolete | |
387 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
387 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
388 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
388 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
389 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
389 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
390 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
390 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
391 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
391 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
392 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
392 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
393 |
|
393 | |||
394 |
|
394 | |||
395 | On push |
|
395 | On push | |
396 |
|
396 | |||
397 | $ hg push ../tmpc |
|
397 | $ hg push ../tmpc | |
398 | pushing to ../tmpc |
|
398 | pushing to ../tmpc | |
399 | searching for changes |
|
399 | searching for changes | |
400 | no changes found |
|
400 | no changes found | |
401 | [1] |
|
401 | [1] | |
402 | $ hg -R ../tmpc debugobsolete |
|
402 | $ hg -R ../tmpc debugobsolete | |
403 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
403 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
404 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
404 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
405 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
405 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
406 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
406 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
407 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
407 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
408 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
408 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
409 |
|
409 | |||
410 | detect outgoing obsolete and unstable |
|
410 | detect outgoing obsolete and unstable | |
411 | --------------------------------------- |
|
411 | --------------------------------------- | |
412 |
|
412 | |||
413 |
|
413 | |||
414 | $ hg log -G |
|
414 | $ hg log -G | |
415 | o 3:6f9641995072 (draft) [tip ] add n3w_3_c |
|
415 | o 3:6f9641995072 (draft) [tip ] add n3w_3_c | |
416 | | |
|
416 | | | |
417 | | o 2:245bde4270cd (public) [ ] add original_c |
|
417 | | o 2:245bde4270cd (public) [ ] add original_c | |
418 | |/ |
|
418 | |/ | |
419 | o 1:7c3bad9141dc (public) [ ] add b |
|
419 | o 1:7c3bad9141dc (public) [ ] add b | |
420 | | |
|
420 | | | |
421 | o 0:1f0dee641bb7 (public) [ ] add a |
|
421 | o 0:1f0dee641bb7 (public) [ ] add a | |
422 |
|
422 | |||
423 | $ hg up 'desc("n3w_3_c")' |
|
423 | $ hg up 'desc("n3w_3_c")' | |
424 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
424 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
425 | $ mkcommit original_d |
|
425 | $ mkcommit original_d | |
426 | $ mkcommit original_e |
|
426 | $ mkcommit original_e | |
427 | $ hg debugobsolete --record-parents `getid original_d` -d '0 0' |
|
427 | $ hg debugobsolete --record-parents `getid original_d` -d '0 0' | |
428 | $ hg debugobsolete | grep `getid original_d` |
|
428 | $ hg debugobsolete | grep `getid original_d` | |
429 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
429 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
430 | $ hg log -r 'obsolete()' |
|
430 | $ hg log -r 'obsolete()' | |
431 | 4:94b33453f93b (draft) [ ] add original_d |
|
431 | 4:94b33453f93b (draft) [ ] add original_d | |
432 | $ hg log -G -r '::unstable()' |
|
432 | $ hg log -G -r '::unstable()' | |
433 | @ 5:cda648ca50f5 (draft) [tip ] add original_e |
|
433 | @ 5:cda648ca50f5 (draft) [tip ] add original_e | |
434 | | |
|
434 | | | |
435 | x 4:94b33453f93b (draft) [ ] add original_d |
|
435 | x 4:94b33453f93b (draft) [ ] add original_d | |
436 | | |
|
436 | | | |
437 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
437 | o 3:6f9641995072 (draft) [ ] add n3w_3_c | |
438 | | |
|
438 | | | |
439 | o 1:7c3bad9141dc (public) [ ] add b |
|
439 | o 1:7c3bad9141dc (public) [ ] add b | |
440 | | |
|
440 | | | |
441 | o 0:1f0dee641bb7 (public) [ ] add a |
|
441 | o 0:1f0dee641bb7 (public) [ ] add a | |
442 |
|
442 | |||
443 |
|
443 | |||
444 | refuse to push obsolete changeset |
|
444 | refuse to push obsolete changeset | |
445 |
|
445 | |||
446 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
446 | $ hg push ../tmpc/ -r 'desc("original_d")' | |
447 | pushing to ../tmpc/ |
|
447 | pushing to ../tmpc/ | |
448 | searching for changes |
|
448 | searching for changes | |
449 | abort: push includes obsolete changeset: 94b33453f93b! |
|
449 | abort: push includes obsolete changeset: 94b33453f93b! | |
450 | [255] |
|
450 | [255] | |
451 |
|
451 | |||
452 | refuse to push unstable changeset |
|
452 | refuse to push unstable changeset | |
453 |
|
453 | |||
454 | $ hg push ../tmpc/ |
|
454 | $ hg push ../tmpc/ | |
455 | pushing to ../tmpc/ |
|
455 | pushing to ../tmpc/ | |
456 | searching for changes |
|
456 | searching for changes | |
457 | abort: push includes unstable changeset: cda648ca50f5! |
|
457 | abort: push includes unstable changeset: cda648ca50f5! | |
458 | [255] |
|
458 | [255] | |
459 |
|
459 | |||
460 | Test that extinct changeset are properly detected |
|
460 | Test that extinct changeset are properly detected | |
461 |
|
461 | |||
462 | $ hg log -r 'extinct()' |
|
462 | $ hg log -r 'extinct()' | |
463 |
|
463 | |||
464 | Don't try to push extinct changeset |
|
464 | Don't try to push extinct changeset | |
465 |
|
465 | |||
466 | $ hg init ../tmpf |
|
466 | $ hg init ../tmpf | |
467 | $ hg out ../tmpf |
|
467 | $ hg out ../tmpf | |
468 | comparing with ../tmpf |
|
468 | comparing with ../tmpf | |
469 | searching for changes |
|
469 | searching for changes | |
470 | 0:1f0dee641bb7 (public) [ ] add a |
|
470 | 0:1f0dee641bb7 (public) [ ] add a | |
471 | 1:7c3bad9141dc (public) [ ] add b |
|
471 | 1:7c3bad9141dc (public) [ ] add b | |
472 | 2:245bde4270cd (public) [ ] add original_c |
|
472 | 2:245bde4270cd (public) [ ] add original_c | |
473 | 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
473 | 3:6f9641995072 (draft) [ ] add n3w_3_c | |
474 | 4:94b33453f93b (draft) [ ] add original_d |
|
474 | 4:94b33453f93b (draft) [ ] add original_d | |
475 | 5:cda648ca50f5 (draft) [tip ] add original_e |
|
475 | 5:cda648ca50f5 (draft) [tip ] add original_e | |
476 | $ hg push ../tmpf -f # -f because be push unstable too |
|
476 | $ hg push ../tmpf -f # -f because be push unstable too | |
477 | pushing to ../tmpf |
|
477 | pushing to ../tmpf | |
478 | searching for changes |
|
478 | searching for changes | |
479 | adding changesets |
|
479 | adding changesets | |
480 | adding manifests |
|
480 | adding manifests | |
481 | adding file changes |
|
481 | adding file changes | |
482 | added 6 changesets with 6 changes to 6 files (+1 heads) |
|
482 | added 6 changesets with 6 changes to 6 files (+1 heads) | |
483 |
|
483 | |||
484 | no warning displayed |
|
484 | no warning displayed | |
485 |
|
485 | |||
486 | $ hg push ../tmpf |
|
486 | $ hg push ../tmpf | |
487 | pushing to ../tmpf |
|
487 | pushing to ../tmpf | |
488 | searching for changes |
|
488 | searching for changes | |
489 | no changes found |
|
489 | no changes found | |
490 | [1] |
|
490 | [1] | |
491 |
|
491 | |||
492 | Do not warn about new head when the new head is a successors of a remote one |
|
492 | Do not warn about new head when the new head is a successors of a remote one | |
493 |
|
493 | |||
494 | $ hg log -G |
|
494 | $ hg log -G | |
495 | @ 5:cda648ca50f5 (draft) [tip ] add original_e |
|
495 | @ 5:cda648ca50f5 (draft) [tip ] add original_e | |
496 | | |
|
496 | | | |
497 | x 4:94b33453f93b (draft) [ ] add original_d |
|
497 | x 4:94b33453f93b (draft) [ ] add original_d | |
498 | | |
|
498 | | | |
499 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
499 | o 3:6f9641995072 (draft) [ ] add n3w_3_c | |
500 | | |
|
500 | | | |
501 | | o 2:245bde4270cd (public) [ ] add original_c |
|
501 | | o 2:245bde4270cd (public) [ ] add original_c | |
502 | |/ |
|
502 | |/ | |
503 | o 1:7c3bad9141dc (public) [ ] add b |
|
503 | o 1:7c3bad9141dc (public) [ ] add b | |
504 | | |
|
504 | | | |
505 | o 0:1f0dee641bb7 (public) [ ] add a |
|
505 | o 0:1f0dee641bb7 (public) [ ] add a | |
506 |
|
506 | |||
507 | $ hg up -q 'desc(n3w_3_c)' |
|
507 | $ hg up -q 'desc(n3w_3_c)' | |
508 | $ mkcommit obsolete_e |
|
508 | $ mkcommit obsolete_e | |
509 | created new head |
|
509 | created new head | |
510 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` |
|
510 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` | |
511 | $ hg outgoing ../tmpf # parasite hg outgoing testin |
|
511 | $ hg outgoing ../tmpf # parasite hg outgoing testin | |
512 | comparing with ../tmpf |
|
512 | comparing with ../tmpf | |
513 | searching for changes |
|
513 | searching for changes | |
514 | 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
514 | 6:3de5eca88c00 (draft) [tip ] add obsolete_e | |
515 | $ hg push ../tmpf |
|
515 | $ hg push ../tmpf | |
516 | pushing to ../tmpf |
|
516 | pushing to ../tmpf | |
517 | searching for changes |
|
517 | searching for changes | |
518 | adding changesets |
|
518 | adding changesets | |
519 | adding manifests |
|
519 | adding manifests | |
520 | adding file changes |
|
520 | adding file changes | |
521 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
521 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
522 |
|
522 | |||
523 | test relevance computation |
|
523 | test relevance computation | |
524 | --------------------------------------- |
|
524 | --------------------------------------- | |
525 |
|
525 | |||
526 | Checking simple case of "marker relevance". |
|
526 | Checking simple case of "marker relevance". | |
527 |
|
527 | |||
528 |
|
528 | |||
529 | Reminder of the repo situation |
|
529 | Reminder of the repo situation | |
530 |
|
530 | |||
531 | $ hg log --hidden --graph |
|
531 | $ hg log --hidden --graph | |
532 | @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
532 | @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e | |
533 | | |
|
533 | | | |
534 | | x 5:cda648ca50f5 (draft) [ ] add original_e |
|
534 | | x 5:cda648ca50f5 (draft) [ ] add original_e | |
535 | | | |
|
535 | | | | |
536 | | x 4:94b33453f93b (draft) [ ] add original_d |
|
536 | | x 4:94b33453f93b (draft) [ ] add original_d | |
537 | |/ |
|
537 | |/ | |
538 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
538 | o 3:6f9641995072 (draft) [ ] add n3w_3_c | |
539 | | |
|
539 | | | |
540 | | o 2:245bde4270cd (public) [ ] add original_c |
|
540 | | o 2:245bde4270cd (public) [ ] add original_c | |
541 | |/ |
|
541 | |/ | |
542 | o 1:7c3bad9141dc (public) [ ] add b |
|
542 | o 1:7c3bad9141dc (public) [ ] add b | |
543 | | |
|
543 | | | |
544 | o 0:1f0dee641bb7 (public) [ ] add a |
|
544 | o 0:1f0dee641bb7 (public) [ ] add a | |
545 |
|
545 | |||
546 |
|
546 | |||
547 | List of all markers |
|
547 | List of all markers | |
548 |
|
548 | |||
549 | $ hg debugobsolete |
|
549 | $ hg debugobsolete | |
550 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
550 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
551 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
551 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
552 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
552 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
553 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
553 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
554 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
554 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
555 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
555 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
556 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
556 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
557 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
557 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) | |
558 |
|
558 | |||
559 | List of changesets with no chain |
|
559 | List of changesets with no chain | |
560 |
|
560 | |||
561 | $ hg debugobsolete --hidden --rev ::2 |
|
561 | $ hg debugobsolete --hidden --rev ::2 | |
562 |
|
562 | |||
563 | List of changesets that are included on marker chain |
|
563 | List of changesets that are included on marker chain | |
564 |
|
564 | |||
565 | $ hg debugobsolete --hidden --rev 6 |
|
565 | $ hg debugobsolete --hidden --rev 6 | |
566 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
566 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) | |
567 |
|
567 | |||
568 | List of changesets with a longer chain, (including a pruned children) |
|
568 | List of changesets with a longer chain, (including a pruned children) | |
569 |
|
569 | |||
570 | $ hg debugobsolete --hidden --rev 3 |
|
570 | $ hg debugobsolete --hidden --rev 3 | |
571 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
571 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
572 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
572 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
573 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
573 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
574 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
574 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
575 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
575 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
576 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
576 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
577 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
577 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
578 |
|
578 | |||
579 | List of both |
|
579 | List of both | |
580 |
|
580 | |||
581 | $ hg debugobsolete --hidden --rev 3::6 |
|
581 | $ hg debugobsolete --hidden --rev 3::6 | |
582 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
582 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
583 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
583 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} | |
584 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
584 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} | |
585 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
585 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
586 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
586 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
587 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
587 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} | |
588 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
588 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) | |
589 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
589 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} | |
590 |
|
590 | |||
591 | #if serve |
|
591 | #if serve | |
592 |
|
592 | |||
593 | check hgweb does not explode |
|
593 | check hgweb does not explode | |
594 | ==================================== |
|
594 | ==================================== | |
595 |
|
595 | |||
596 | $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg |
|
596 | $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg | |
597 | adding changesets |
|
597 | adding changesets | |
598 | adding manifests |
|
598 | adding manifests | |
599 | adding file changes |
|
599 | adding file changes | |
600 | added 62 changesets with 63 changes to 9 files (+60 heads) |
|
600 | added 62 changesets with 63 changes to 9 files (+60 heads) | |
601 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
601 | (run 'hg heads .' to see heads, 'hg merge' to merge) | |
602 | $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`; |
|
602 | $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`; | |
603 | > do |
|
603 | > do | |
604 | > hg debugobsolete $node |
|
604 | > hg debugobsolete $node | |
605 | > done |
|
605 | > done | |
606 | $ hg up tip |
|
606 | $ hg up tip | |
607 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
607 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
608 |
|
608 | |||
609 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
609 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
610 | $ cat hg.pid >> $DAEMON_PIDS |
|
610 | $ cat hg.pid >> $DAEMON_PIDS | |
611 |
|
611 | |||
612 | check changelog view |
|
612 | check changelog view | |
613 |
|
613 | |||
614 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/' |
|
614 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/' | |
615 | 200 Script output follows |
|
615 | 200 Script output follows | |
616 |
|
616 | |||
617 | check graph view |
|
617 | check graph view | |
618 |
|
618 | |||
619 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph' |
|
619 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph' | |
620 | 200 Script output follows |
|
620 | 200 Script output follows | |
621 |
|
621 | |||
622 | check filelog view |
|
622 | check filelog view | |
623 |
|
623 | |||
624 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar' |
|
624 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar' | |
625 | 200 Script output follows |
|
625 | 200 Script output follows | |
626 |
|
626 | |||
627 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68' |
|
627 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68' | |
628 | 200 Script output follows |
|
628 | 200 Script output follows | |
629 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67' |
|
629 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67' | |
630 | 404 Not Found |
|
630 | 404 Not Found | |
631 | [1] |
|
631 | [1] | |
632 |
|
632 | |||
633 | check that web.view config option: |
|
633 | check that web.view config option: | |
634 |
|
634 | |||
635 | $ "$TESTDIR/killdaemons.py" hg.pid |
|
635 | $ "$TESTDIR/killdaemons.py" hg.pid | |
636 | $ cat >> .hg/hgrc << EOF |
|
636 | $ cat >> .hg/hgrc << EOF | |
637 | > [web] |
|
637 | > [web] | |
638 | > view=all |
|
638 | > view=all | |
639 | > EOF |
|
639 | > EOF | |
640 | $ wait |
|
640 | $ wait | |
641 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
641 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
642 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67' |
|
642 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67' | |
643 | 200 Script output follows |
|
643 | 200 Script output follows | |
644 | $ "$TESTDIR/killdaemons.py" hg.pid |
|
644 | $ "$TESTDIR/killdaemons.py" hg.pid | |
645 |
|
645 | |||
646 | Checking _enable=False warning if obsolete marker exists |
|
646 | Checking _enable=False warning if obsolete marker exists | |
647 |
|
647 | |||
648 | $ echo '[experimental]' >> $HGRCPATH |
|
648 | $ echo '[experimental]' >> $HGRCPATH | |
649 | $ echo "evolution=" >> $HGRCPATH |
|
649 | $ echo "evolution=" >> $HGRCPATH | |
650 | $ hg log -r tip |
|
650 | $ hg log -r tip | |
651 | obsolete feature not enabled but 68 markers found! |
|
651 | obsolete feature not enabled but 68 markers found! | |
652 | 68:c15e9edfca13 (draft) [tip ] add celestine |
|
652 | 68:c15e9edfca13 (draft) [tip ] add celestine | |
653 |
|
653 | |||
654 | reenable for later test |
|
654 | reenable for later test | |
655 |
|
655 | |||
656 | $ echo '[experimental]' >> $HGRCPATH |
|
656 | $ echo '[experimental]' >> $HGRCPATH | |
657 | $ echo "evolution=createmarkers,exchange" >> $HGRCPATH |
|
657 | $ echo "evolution=createmarkers,exchange" >> $HGRCPATH | |
658 |
|
658 | |||
659 | #endif |
|
659 | #endif | |
660 |
|
660 | |||
661 | Test incoming/outcoming with changesets obsoleted remotely, known locally |
|
661 | Test incoming/outcoming with changesets obsoleted remotely, known locally | |
662 | =============================================================================== |
|
662 | =============================================================================== | |
663 |
|
663 | |||
664 | This test issue 3805 |
|
664 | This test issue 3805 | |
665 |
|
665 | |||
666 | $ hg init repo-issue3805 |
|
666 | $ hg init repo-issue3805 | |
667 | $ cd repo-issue3805 |
|
667 | $ cd repo-issue3805 | |
668 | $ echo "foo" > foo |
|
668 | $ echo "foo" > foo | |
669 | $ hg ci -Am "A" |
|
669 | $ hg ci -Am "A" | |
670 | adding foo |
|
670 | adding foo | |
671 | $ hg clone . ../other-issue3805 |
|
671 | $ hg clone . ../other-issue3805 | |
672 | updating to branch default |
|
672 | updating to branch default | |
673 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
673 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
674 | $ echo "bar" >> foo |
|
674 | $ echo "bar" >> foo | |
675 | $ hg ci --amend |
|
675 | $ hg ci --amend | |
676 | $ cd ../other-issue3805 |
|
676 | $ cd ../other-issue3805 | |
677 | $ hg log -G |
|
677 | $ hg log -G | |
678 | @ 0:193e9254ce7e (draft) [tip ] A |
|
678 | @ 0:193e9254ce7e (draft) [tip ] A | |
679 |
|
679 | |||
680 | $ hg log -G -R ../repo-issue3805 |
|
680 | $ hg log -G -R ../repo-issue3805 | |
681 | @ 2:3816541e5485 (draft) [tip ] A |
|
681 | @ 2:3816541e5485 (draft) [tip ] A | |
682 |
|
682 | |||
683 | $ hg incoming |
|
683 | $ hg incoming | |
684 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
684 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) | |
685 | searching for changes |
|
685 | searching for changes | |
686 | 2:3816541e5485 (draft) [tip ] A |
|
686 | 2:3816541e5485 (draft) [tip ] A | |
687 | $ hg incoming --bundle ../issue3805.hg |
|
687 | $ hg incoming --bundle ../issue3805.hg | |
688 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
688 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) | |
689 | searching for changes |
|
689 | searching for changes | |
690 | 2:3816541e5485 (draft) [tip ] A |
|
690 | 2:3816541e5485 (draft) [tip ] A | |
691 | $ hg outgoing |
|
691 | $ hg outgoing | |
692 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
692 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) | |
693 | searching for changes |
|
693 | searching for changes | |
694 | no changes found |
|
694 | no changes found | |
695 | [1] |
|
695 | [1] | |
696 |
|
696 | |||
697 | #if serve |
|
697 | #if serve | |
698 |
|
698 | |||
699 | $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
699 | $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
700 | $ cat hg.pid >> $DAEMON_PIDS |
|
700 | $ cat hg.pid >> $DAEMON_PIDS | |
701 |
|
701 | |||
702 | $ hg incoming http://localhost:$HGPORT |
|
702 | $ hg incoming http://localhost:$HGPORT | |
703 | comparing with http://localhost:$HGPORT/ |
|
703 | comparing with http://localhost:$HGPORT/ | |
704 | searching for changes |
|
704 | searching for changes | |
705 | 1:3816541e5485 (draft) [tip ] A |
|
705 | 1:3816541e5485 (draft) [tip ] A | |
706 | $ hg outgoing http://localhost:$HGPORT |
|
706 | $ hg outgoing http://localhost:$HGPORT | |
707 | comparing with http://localhost:$HGPORT/ |
|
707 | comparing with http://localhost:$HGPORT/ | |
708 | searching for changes |
|
708 | searching for changes | |
709 | no changes found |
|
709 | no changes found | |
710 | [1] |
|
710 | [1] | |
711 |
|
711 | |||
712 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
712 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |
713 |
|
713 | |||
714 | #endif |
|
714 | #endif | |
715 |
|
715 | |||
716 | This test issue 3814 |
|
716 | This test issue 3814 | |
717 |
|
717 | |||
718 | (nothing to push but locally hidden changeset) |
|
718 | (nothing to push but locally hidden changeset) | |
719 |
|
719 | |||
720 | $ cd .. |
|
720 | $ cd .. | |
721 | $ hg init repo-issue3814 |
|
721 | $ hg init repo-issue3814 | |
722 | $ cd repo-issue3805 |
|
722 | $ cd repo-issue3805 | |
723 | $ hg push -r 3816541e5485 ../repo-issue3814 |
|
723 | $ hg push -r 3816541e5485 ../repo-issue3814 | |
724 | pushing to ../repo-issue3814 |
|
724 | pushing to ../repo-issue3814 | |
725 | searching for changes |
|
725 | searching for changes | |
726 | adding changesets |
|
726 | adding changesets | |
727 | adding manifests |
|
727 | adding manifests | |
728 | adding file changes |
|
728 | adding file changes | |
729 | added 1 changesets with 1 changes to 1 files |
|
729 | added 1 changesets with 1 changes to 1 files | |
730 | $ hg out ../repo-issue3814 |
|
730 | $ hg out ../repo-issue3814 | |
731 | comparing with ../repo-issue3814 |
|
731 | comparing with ../repo-issue3814 | |
732 | searching for changes |
|
732 | searching for changes | |
733 | no changes found |
|
733 | no changes found | |
734 | [1] |
|
734 | [1] | |
735 |
|
735 | |||
736 | Test that a local tag blocks a changeset from being hidden |
|
736 | Test that a local tag blocks a changeset from being hidden | |
737 |
|
737 | |||
738 | $ hg tag -l visible -r 0 --hidden |
|
738 | $ hg tag -l visible -r 0 --hidden | |
739 | $ hg log -G |
|
739 | $ hg log -G | |
740 | @ 2:3816541e5485 (draft) [tip ] A |
|
740 | @ 2:3816541e5485 (draft) [tip ] A | |
741 |
|
741 | |||
742 | x 0:193e9254ce7e (draft) [visible ] A |
|
742 | x 0:193e9254ce7e (draft) [visible ] A | |
743 |
|
743 | |||
744 | Test that removing a local tag does not cause some commands to fail |
|
744 | Test that removing a local tag does not cause some commands to fail | |
745 |
|
745 | |||
746 | $ hg tag -l -r tip tiptag |
|
746 | $ hg tag -l -r tip tiptag | |
747 | $ hg tags |
|
747 | $ hg tags | |
748 | tiptag 2:3816541e5485 |
|
748 | tiptag 2:3816541e5485 | |
749 | tip 2:3816541e5485 |
|
749 | tip 2:3816541e5485 | |
750 | visible 0:193e9254ce7e |
|
750 | visible 0:193e9254ce7e | |
751 | $ hg --config extensions.strip= strip -r tip --no-backup |
|
751 | $ hg --config extensions.strip= strip -r tip --no-backup | |
752 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
752 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
753 | $ hg tags |
|
753 | $ hg tags | |
754 | visible 0:193e9254ce7e |
|
754 | visible 0:193e9254ce7e | |
755 | tip 0:193e9254ce7e |
|
755 | tip 0:193e9254ce7e | |
756 |
|
756 | |||
|
757 | #if serve | |||
|
758 | ||||
|
759 | Test issue 4506 | |||
|
760 | ||||
|
761 | $ cd .. | |||
|
762 | $ hg init repo-issue4506 | |||
|
763 | $ cd repo-issue4506 | |||
|
764 | $ echo "0" > foo | |||
|
765 | $ hg add foo | |||
|
766 | $ hg ci -m "content-0" | |||
|
767 | ||||
|
768 | $ hg up null | |||
|
769 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
770 | $ echo "1" > bar | |||
|
771 | $ hg add bar | |||
|
772 | $ hg ci -m "content-1" | |||
|
773 | created new head | |||
|
774 | $ hg up 0 | |||
|
775 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
776 | $ hg graft 1 | |||
|
777 | grafting 1:1c9eddb02162 "content-1" (tip) | |||
|
778 | ||||
|
779 | $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'` | |||
|
780 | ||||
|
781 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |||
|
782 | $ cat hg.pid >> $DAEMON_PIDS | |||
|
783 | ||||
|
784 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/1' | |||
|
785 | 404 Not Found | |||
|
786 | [1] | |||
|
787 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'file/tip/bar' | |||
|
788 | 200 Script output follows | |||
|
789 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'annotate/tip/bar' | |||
|
790 | 200 Script output follows | |||
|
791 | ||||
|
792 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |||
|
793 | ||||
|
794 | #endif | |||
|
795 | ||||
757 | $ hg init a |
|
796 | $ hg init a | |
758 | $ cd a |
|
797 | $ cd a | |
759 | $ touch foo |
|
798 | $ touch foo | |
760 | $ hg add foo |
|
799 | $ hg add foo | |
761 | $ hg ci -mfoo |
|
800 | $ hg ci -mfoo | |
762 | $ touch bar |
|
801 | $ touch bar | |
763 | $ hg add bar |
|
802 | $ hg add bar | |
764 | $ hg ci -mbar |
|
803 | $ hg ci -mbar | |
765 | $ hg up 0 |
|
804 | $ hg up 0 | |
766 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
805 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
767 | $ touch quux |
|
806 | $ touch quux | |
768 | $ hg add quux |
|
807 | $ hg add quux | |
769 | $ hg ci -m quux |
|
808 | $ hg ci -m quux | |
770 | created new head |
|
809 | created new head | |
771 | $ hg up 1 |
|
810 | $ hg up 1 | |
772 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
811 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
773 | $ hg tag 1.0 |
|
812 | $ hg tag 1.0 | |
774 |
|
813 | |||
775 | $ hg up 2 |
|
814 | $ hg up 2 | |
776 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
815 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
777 | $ hg log -G |
|
816 | $ hg log -G | |
778 | o 3:bc47fc7e1c1d (draft) [tip ] Added tag 1.0 for changeset 50c889141114 |
|
817 | o 3:bc47fc7e1c1d (draft) [tip ] Added tag 1.0 for changeset 50c889141114 | |
779 | | |
|
818 | | | |
780 | | @ 2:3d7f255a0081 (draft) [ ] quux |
|
819 | | @ 2:3d7f255a0081 (draft) [ ] quux | |
781 | | | |
|
820 | | | | |
782 | o | 1:50c889141114 (draft) [1.0 ] bar |
|
821 | o | 1:50c889141114 (draft) [1.0 ] bar | |
783 | |/ |
|
822 | |/ | |
784 | o 0:1f7b0de80e11 (draft) [ ] foo |
|
823 | o 0:1f7b0de80e11 (draft) [ ] foo | |
785 |
|
824 | |||
786 | $ hg debugobsolete `getid bar` |
|
825 | $ hg debugobsolete `getid bar` | |
787 | $ hg debugobsolete `getid 1.0` |
|
826 | $ hg debugobsolete `getid 1.0` | |
788 | $ hg tag 1.0 |
|
827 | $ hg tag 1.0 | |
789 | $ hg log -G |
|
828 | $ hg log -G | |
790 | @ 4:f9f2ab71ffd5 (draft) [tip ] Added tag 1.0 for changeset 3d7f255a0081 |
|
829 | @ 4:f9f2ab71ffd5 (draft) [tip ] Added tag 1.0 for changeset 3d7f255a0081 | |
791 | | |
|
830 | | | |
792 | o 2:3d7f255a0081 (draft) [1.0 ] quux |
|
831 | o 2:3d7f255a0081 (draft) [1.0 ] quux | |
793 | | |
|
832 | | | |
794 | o 0:1f7b0de80e11 (draft) [ ] foo |
|
833 | o 0:1f7b0de80e11 (draft) [ ] foo | |
795 |
|
834 | |||
796 | $ cat .hgtags |
|
835 | $ cat .hgtags | |
797 | 3d7f255a008103380aeb2a7d581fe257f40969e7 1.0 |
|
836 | 3d7f255a008103380aeb2a7d581fe257f40969e7 1.0 |
General Comments 0
You need to be logged in to leave comments.
Login now