##// END OF EJS Templates
hgweb: disable diff.noprefix option for diffstat...
Yuya Nishihara -
r35445:0279c226 stable
parent child Browse files
Show More
@@ -1,643 +1,644 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 from __future__ import absolute_import
9 from __future__ import absolute_import
10
10
11 import copy
11 import copy
12 import difflib
12 import difflib
13 import os
13 import os
14 import re
14 import re
15
15
16 from ..i18n import _
16 from ..i18n import _
17 from ..node import hex, nullid, short
17 from ..node import hex, nullid, short
18
18
19 from .common import (
19 from .common import (
20 ErrorResponse,
20 ErrorResponse,
21 HTTP_BAD_REQUEST,
21 HTTP_BAD_REQUEST,
22 HTTP_NOT_FOUND,
22 HTTP_NOT_FOUND,
23 paritygen,
23 paritygen,
24 )
24 )
25
25
26 from .. import (
26 from .. import (
27 context,
27 context,
28 error,
28 error,
29 match,
29 match,
30 mdiff,
30 mdiff,
31 patch,
31 patch,
32 pathutil,
32 pathutil,
33 pycompat,
33 pycompat,
34 templatefilters,
34 templatefilters,
35 ui as uimod,
35 ui as uimod,
36 util,
36 util,
37 )
37 )
38
38
39 def up(p):
39 def up(p):
40 if p[0] != "/":
40 if p[0] != "/":
41 p = "/" + p
41 p = "/" + p
42 if p[-1] == "/":
42 if p[-1] == "/":
43 p = p[:-1]
43 p = p[:-1]
44 up = os.path.dirname(p)
44 up = os.path.dirname(p)
45 if up == "/":
45 if up == "/":
46 return "/"
46 return "/"
47 return up + "/"
47 return up + "/"
48
48
49 def _navseq(step, firststep=None):
49 def _navseq(step, firststep=None):
50 if firststep:
50 if firststep:
51 yield firststep
51 yield firststep
52 if firststep >= 20 and firststep <= 40:
52 if firststep >= 20 and firststep <= 40:
53 firststep = 50
53 firststep = 50
54 yield firststep
54 yield firststep
55 assert step > 0
55 assert step > 0
56 assert firststep > 0
56 assert firststep > 0
57 while step <= firststep:
57 while step <= firststep:
58 step *= 10
58 step *= 10
59 while True:
59 while True:
60 yield 1 * step
60 yield 1 * step
61 yield 3 * step
61 yield 3 * step
62 step *= 10
62 step *= 10
63
63
64 class revnav(object):
64 class revnav(object):
65
65
66 def __init__(self, repo):
66 def __init__(self, repo):
67 """Navigation generation object
67 """Navigation generation object
68
68
69 :repo: repo object we generate nav for
69 :repo: repo object we generate nav for
70 """
70 """
71 # used for hex generation
71 # used for hex generation
72 self._revlog = repo.changelog
72 self._revlog = repo.changelog
73
73
74 def __nonzero__(self):
74 def __nonzero__(self):
75 """return True if any revision to navigate over"""
75 """return True if any revision to navigate over"""
76 return self._first() is not None
76 return self._first() is not None
77
77
78 __bool__ = __nonzero__
78 __bool__ = __nonzero__
79
79
80 def _first(self):
80 def _first(self):
81 """return the minimum non-filtered changeset or None"""
81 """return the minimum non-filtered changeset or None"""
82 try:
82 try:
83 return next(iter(self._revlog))
83 return next(iter(self._revlog))
84 except StopIteration:
84 except StopIteration:
85 return None
85 return None
86
86
87 def hex(self, rev):
87 def hex(self, rev):
88 return hex(self._revlog.node(rev))
88 return hex(self._revlog.node(rev))
89
89
90 def gen(self, pos, pagelen, limit):
90 def gen(self, pos, pagelen, limit):
91 """computes label and revision id for navigation link
91 """computes label and revision id for navigation link
92
92
93 :pos: is the revision relative to which we generate navigation.
93 :pos: is the revision relative to which we generate navigation.
94 :pagelen: the size of each navigation page
94 :pagelen: the size of each navigation page
95 :limit: how far shall we link
95 :limit: how far shall we link
96
96
97 The return is:
97 The return is:
98 - a single element tuple
98 - a single element tuple
99 - containing a dictionary with a `before` and `after` key
99 - containing a dictionary with a `before` and `after` key
100 - values are generator functions taking arbitrary number of kwargs
100 - values are generator functions taking arbitrary number of kwargs
101 - yield items are dictionaries with `label` and `node` keys
101 - yield items are dictionaries with `label` and `node` keys
102 """
102 """
103 if not self:
103 if not self:
104 # empty repo
104 # empty repo
105 return ({'before': (), 'after': ()},)
105 return ({'before': (), 'after': ()},)
106
106
107 targets = []
107 targets = []
108 for f in _navseq(1, pagelen):
108 for f in _navseq(1, pagelen):
109 if f > limit:
109 if f > limit:
110 break
110 break
111 targets.append(pos + f)
111 targets.append(pos + f)
112 targets.append(pos - f)
112 targets.append(pos - f)
113 targets.sort()
113 targets.sort()
114
114
115 first = self._first()
115 first = self._first()
116 navbefore = [("(%i)" % first, self.hex(first))]
116 navbefore = [("(%i)" % first, self.hex(first))]
117 navafter = []
117 navafter = []
118 for rev in targets:
118 for rev in targets:
119 if rev not in self._revlog:
119 if rev not in self._revlog:
120 continue
120 continue
121 if pos < rev < limit:
121 if pos < rev < limit:
122 navafter.append(("+%d" % abs(rev - pos), self.hex(rev)))
122 navafter.append(("+%d" % abs(rev - pos), self.hex(rev)))
123 if 0 < rev < pos:
123 if 0 < rev < pos:
124 navbefore.append(("-%d" % abs(rev - pos), self.hex(rev)))
124 navbefore.append(("-%d" % abs(rev - pos), self.hex(rev)))
125
125
126
126
127 navafter.append(("tip", "tip"))
127 navafter.append(("tip", "tip"))
128
128
129 data = lambda i: {"label": i[0], "node": i[1]}
129 data = lambda i: {"label": i[0], "node": i[1]}
130 return ({'before': lambda **map: (data(i) for i in navbefore),
130 return ({'before': lambda **map: (data(i) for i in navbefore),
131 'after': lambda **map: (data(i) for i in navafter)},)
131 'after': lambda **map: (data(i) for i in navafter)},)
132
132
133 class filerevnav(revnav):
133 class filerevnav(revnav):
134
134
135 def __init__(self, repo, path):
135 def __init__(self, repo, path):
136 """Navigation generation object
136 """Navigation generation object
137
137
138 :repo: repo object we generate nav for
138 :repo: repo object we generate nav for
139 :path: path of the file we generate nav for
139 :path: path of the file we generate nav for
140 """
140 """
141 # used for iteration
141 # used for iteration
142 self._changelog = repo.unfiltered().changelog
142 self._changelog = repo.unfiltered().changelog
143 # used for hex generation
143 # used for hex generation
144 self._revlog = repo.file(path)
144 self._revlog = repo.file(path)
145
145
146 def hex(self, rev):
146 def hex(self, rev):
147 return hex(self._changelog.node(self._revlog.linkrev(rev)))
147 return hex(self._changelog.node(self._revlog.linkrev(rev)))
148
148
149 class _siblings(object):
149 class _siblings(object):
150 def __init__(self, siblings=None, hiderev=None):
150 def __init__(self, siblings=None, hiderev=None):
151 if siblings is None:
151 if siblings is None:
152 siblings = []
152 siblings = []
153 self.siblings = [s for s in siblings if s.node() != nullid]
153 self.siblings = [s for s in siblings if s.node() != nullid]
154 if len(self.siblings) == 1 and self.siblings[0].rev() == hiderev:
154 if len(self.siblings) == 1 and self.siblings[0].rev() == hiderev:
155 self.siblings = []
155 self.siblings = []
156
156
157 def __iter__(self):
157 def __iter__(self):
158 for s in self.siblings:
158 for s in self.siblings:
159 d = {
159 d = {
160 'node': s.hex(),
160 'node': s.hex(),
161 'rev': s.rev(),
161 'rev': s.rev(),
162 'user': s.user(),
162 'user': s.user(),
163 'date': s.date(),
163 'date': s.date(),
164 'description': s.description(),
164 'description': s.description(),
165 'branch': s.branch(),
165 'branch': s.branch(),
166 }
166 }
167 if util.safehasattr(s, 'path'):
167 if util.safehasattr(s, 'path'):
168 d['file'] = s.path()
168 d['file'] = s.path()
169 yield d
169 yield d
170
170
171 def __len__(self):
171 def __len__(self):
172 return len(self.siblings)
172 return len(self.siblings)
173
173
174 def difffeatureopts(req, ui, section):
174 def difffeatureopts(req, ui, section):
175 diffopts = patch.difffeatureopts(ui, untrusted=True,
175 diffopts = patch.difffeatureopts(ui, untrusted=True,
176 section=section, whitespace=True)
176 section=section, whitespace=True)
177
177
178 for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
178 for k in ('ignorews', 'ignorewsamount', 'ignorewseol', 'ignoreblanklines'):
179 v = req.form.get(k, [None])[0]
179 v = req.form.get(k, [None])[0]
180 if v is not None:
180 if v is not None:
181 v = util.parsebool(v)
181 v = util.parsebool(v)
182 setattr(diffopts, k, v if v is not None else True)
182 setattr(diffopts, k, v if v is not None else True)
183
183
184 return diffopts
184 return diffopts
185
185
186 def annotate(req, fctx, ui):
186 def annotate(req, fctx, ui):
187 diffopts = difffeatureopts(req, ui, 'annotate')
187 diffopts = difffeatureopts(req, ui, 'annotate')
188 return fctx.annotate(follow=True, linenumber=True, diffopts=diffopts)
188 return fctx.annotate(follow=True, linenumber=True, diffopts=diffopts)
189
189
190 def parents(ctx, hide=None):
190 def parents(ctx, hide=None):
191 if isinstance(ctx, context.basefilectx):
191 if isinstance(ctx, context.basefilectx):
192 introrev = ctx.introrev()
192 introrev = ctx.introrev()
193 if ctx.changectx().rev() != introrev:
193 if ctx.changectx().rev() != introrev:
194 return _siblings([ctx.repo()[introrev]], hide)
194 return _siblings([ctx.repo()[introrev]], hide)
195 return _siblings(ctx.parents(), hide)
195 return _siblings(ctx.parents(), hide)
196
196
197 def children(ctx, hide=None):
197 def children(ctx, hide=None):
198 return _siblings(ctx.children(), hide)
198 return _siblings(ctx.children(), hide)
199
199
200 def renamelink(fctx):
200 def renamelink(fctx):
201 r = fctx.renamed()
201 r = fctx.renamed()
202 if r:
202 if r:
203 return [{'file': r[0], 'node': hex(r[1])}]
203 return [{'file': r[0], 'node': hex(r[1])}]
204 return []
204 return []
205
205
206 def nodetagsdict(repo, node):
206 def nodetagsdict(repo, node):
207 return [{"name": i} for i in repo.nodetags(node)]
207 return [{"name": i} for i in repo.nodetags(node)]
208
208
209 def nodebookmarksdict(repo, node):
209 def nodebookmarksdict(repo, node):
210 return [{"name": i} for i in repo.nodebookmarks(node)]
210 return [{"name": i} for i in repo.nodebookmarks(node)]
211
211
212 def nodebranchdict(repo, ctx):
212 def nodebranchdict(repo, ctx):
213 branches = []
213 branches = []
214 branch = ctx.branch()
214 branch = ctx.branch()
215 # If this is an empty repo, ctx.node() == nullid,
215 # If this is an empty repo, ctx.node() == nullid,
216 # ctx.branch() == 'default'.
216 # ctx.branch() == 'default'.
217 try:
217 try:
218 branchnode = repo.branchtip(branch)
218 branchnode = repo.branchtip(branch)
219 except error.RepoLookupError:
219 except error.RepoLookupError:
220 branchnode = None
220 branchnode = None
221 if branchnode == ctx.node():
221 if branchnode == ctx.node():
222 branches.append({"name": branch})
222 branches.append({"name": branch})
223 return branches
223 return branches
224
224
225 def nodeinbranch(repo, ctx):
225 def nodeinbranch(repo, ctx):
226 branches = []
226 branches = []
227 branch = ctx.branch()
227 branch = ctx.branch()
228 try:
228 try:
229 branchnode = repo.branchtip(branch)
229 branchnode = repo.branchtip(branch)
230 except error.RepoLookupError:
230 except error.RepoLookupError:
231 branchnode = None
231 branchnode = None
232 if branch != 'default' and branchnode != ctx.node():
232 if branch != 'default' and branchnode != ctx.node():
233 branches.append({"name": branch})
233 branches.append({"name": branch})
234 return branches
234 return branches
235
235
236 def nodebranchnodefault(ctx):
236 def nodebranchnodefault(ctx):
237 branches = []
237 branches = []
238 branch = ctx.branch()
238 branch = ctx.branch()
239 if branch != 'default':
239 if branch != 'default':
240 branches.append({"name": branch})
240 branches.append({"name": branch})
241 return branches
241 return branches
242
242
243 def showtag(repo, tmpl, t1, node=nullid, **args):
243 def showtag(repo, tmpl, t1, node=nullid, **args):
244 for t in repo.nodetags(node):
244 for t in repo.nodetags(node):
245 yield tmpl(t1, tag=t, **args)
245 yield tmpl(t1, tag=t, **args)
246
246
247 def showbookmark(repo, tmpl, t1, node=nullid, **args):
247 def showbookmark(repo, tmpl, t1, node=nullid, **args):
248 for t in repo.nodebookmarks(node):
248 for t in repo.nodebookmarks(node):
249 yield tmpl(t1, bookmark=t, **args)
249 yield tmpl(t1, bookmark=t, **args)
250
250
251 def branchentries(repo, stripecount, limit=0):
251 def branchentries(repo, stripecount, limit=0):
252 tips = []
252 tips = []
253 heads = repo.heads()
253 heads = repo.heads()
254 parity = paritygen(stripecount)
254 parity = paritygen(stripecount)
255 sortkey = lambda item: (not item[1], item[0].rev())
255 sortkey = lambda item: (not item[1], item[0].rev())
256
256
257 def entries(**map):
257 def entries(**map):
258 count = 0
258 count = 0
259 if not tips:
259 if not tips:
260 for tag, hs, tip, closed in repo.branchmap().iterbranches():
260 for tag, hs, tip, closed in repo.branchmap().iterbranches():
261 tips.append((repo[tip], closed))
261 tips.append((repo[tip], closed))
262 for ctx, closed in sorted(tips, key=sortkey, reverse=True):
262 for ctx, closed in sorted(tips, key=sortkey, reverse=True):
263 if limit > 0 and count >= limit:
263 if limit > 0 and count >= limit:
264 return
264 return
265 count += 1
265 count += 1
266 if closed:
266 if closed:
267 status = 'closed'
267 status = 'closed'
268 elif ctx.node() not in heads:
268 elif ctx.node() not in heads:
269 status = 'inactive'
269 status = 'inactive'
270 else:
270 else:
271 status = 'open'
271 status = 'open'
272 yield {
272 yield {
273 'parity': next(parity),
273 'parity': next(parity),
274 'branch': ctx.branch(),
274 'branch': ctx.branch(),
275 'status': status,
275 'status': status,
276 'node': ctx.hex(),
276 'node': ctx.hex(),
277 'date': ctx.date()
277 'date': ctx.date()
278 }
278 }
279
279
280 return entries
280 return entries
281
281
282 def cleanpath(repo, path):
282 def cleanpath(repo, path):
283 path = path.lstrip('/')
283 path = path.lstrip('/')
284 return pathutil.canonpath(repo.root, '', path)
284 return pathutil.canonpath(repo.root, '', path)
285
285
286 def changeidctx(repo, changeid):
286 def changeidctx(repo, changeid):
287 try:
287 try:
288 ctx = repo[changeid]
288 ctx = repo[changeid]
289 except error.RepoError:
289 except error.RepoError:
290 man = repo.manifestlog._revlog
290 man = repo.manifestlog._revlog
291 ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))]
291 ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))]
292
292
293 return ctx
293 return ctx
294
294
295 def changectx(repo, req):
295 def changectx(repo, req):
296 changeid = "tip"
296 changeid = "tip"
297 if 'node' in req.form:
297 if 'node' in req.form:
298 changeid = req.form['node'][0]
298 changeid = req.form['node'][0]
299 ipos = changeid.find(':')
299 ipos = changeid.find(':')
300 if ipos != -1:
300 if ipos != -1:
301 changeid = changeid[(ipos + 1):]
301 changeid = changeid[(ipos + 1):]
302 elif 'manifest' in req.form:
302 elif 'manifest' in req.form:
303 changeid = req.form['manifest'][0]
303 changeid = req.form['manifest'][0]
304
304
305 return changeidctx(repo, changeid)
305 return changeidctx(repo, changeid)
306
306
307 def basechangectx(repo, req):
307 def basechangectx(repo, req):
308 if 'node' in req.form:
308 if 'node' in req.form:
309 changeid = req.form['node'][0]
309 changeid = req.form['node'][0]
310 ipos = changeid.find(':')
310 ipos = changeid.find(':')
311 if ipos != -1:
311 if ipos != -1:
312 changeid = changeid[:ipos]
312 changeid = changeid[:ipos]
313 return changeidctx(repo, changeid)
313 return changeidctx(repo, changeid)
314
314
315 return None
315 return None
316
316
317 def filectx(repo, req):
317 def filectx(repo, req):
318 if 'file' not in req.form:
318 if 'file' not in req.form:
319 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
319 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
320 path = cleanpath(repo, req.form['file'][0])
320 path = cleanpath(repo, req.form['file'][0])
321 if 'node' in req.form:
321 if 'node' in req.form:
322 changeid = req.form['node'][0]
322 changeid = req.form['node'][0]
323 elif 'filenode' in req.form:
323 elif 'filenode' in req.form:
324 changeid = req.form['filenode'][0]
324 changeid = req.form['filenode'][0]
325 else:
325 else:
326 raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given')
326 raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given')
327 try:
327 try:
328 fctx = repo[changeid][path]
328 fctx = repo[changeid][path]
329 except error.RepoError:
329 except error.RepoError:
330 fctx = repo.filectx(path, fileid=changeid)
330 fctx = repo.filectx(path, fileid=changeid)
331
331
332 return fctx
332 return fctx
333
333
334 def linerange(req):
334 def linerange(req):
335 linerange = req.form.get('linerange')
335 linerange = req.form.get('linerange')
336 if linerange is None:
336 if linerange is None:
337 return None
337 return None
338 if len(linerange) > 1:
338 if len(linerange) > 1:
339 raise ErrorResponse(HTTP_BAD_REQUEST,
339 raise ErrorResponse(HTTP_BAD_REQUEST,
340 'redundant linerange parameter')
340 'redundant linerange parameter')
341 try:
341 try:
342 fromline, toline = map(int, linerange[0].split(':', 1))
342 fromline, toline = map(int, linerange[0].split(':', 1))
343 except ValueError:
343 except ValueError:
344 raise ErrorResponse(HTTP_BAD_REQUEST,
344 raise ErrorResponse(HTTP_BAD_REQUEST,
345 'invalid linerange parameter')
345 'invalid linerange parameter')
346 try:
346 try:
347 return util.processlinerange(fromline, toline)
347 return util.processlinerange(fromline, toline)
348 except error.ParseError as exc:
348 except error.ParseError as exc:
349 raise ErrorResponse(HTTP_BAD_REQUEST, str(exc))
349 raise ErrorResponse(HTTP_BAD_REQUEST, str(exc))
350
350
351 def formatlinerange(fromline, toline):
351 def formatlinerange(fromline, toline):
352 return '%d:%d' % (fromline + 1, toline)
352 return '%d:%d' % (fromline + 1, toline)
353
353
354 def commonentry(repo, ctx):
354 def commonentry(repo, ctx):
355 node = ctx.node()
355 node = ctx.node()
356 return {
356 return {
357 'rev': ctx.rev(),
357 'rev': ctx.rev(),
358 'node': hex(node),
358 'node': hex(node),
359 'author': ctx.user(),
359 'author': ctx.user(),
360 'desc': ctx.description(),
360 'desc': ctx.description(),
361 'date': ctx.date(),
361 'date': ctx.date(),
362 'extra': ctx.extra(),
362 'extra': ctx.extra(),
363 'phase': ctx.phasestr(),
363 'phase': ctx.phasestr(),
364 'branch': nodebranchnodefault(ctx),
364 'branch': nodebranchnodefault(ctx),
365 'inbranch': nodeinbranch(repo, ctx),
365 'inbranch': nodeinbranch(repo, ctx),
366 'branches': nodebranchdict(repo, ctx),
366 'branches': nodebranchdict(repo, ctx),
367 'tags': nodetagsdict(repo, node),
367 'tags': nodetagsdict(repo, node),
368 'bookmarks': nodebookmarksdict(repo, node),
368 'bookmarks': nodebookmarksdict(repo, node),
369 'parent': lambda **x: parents(ctx),
369 'parent': lambda **x: parents(ctx),
370 'child': lambda **x: children(ctx),
370 'child': lambda **x: children(ctx),
371 }
371 }
372
372
373 def changelistentry(web, ctx, tmpl):
373 def changelistentry(web, ctx, tmpl):
374 '''Obtain a dictionary to be used for entries in a changelist.
374 '''Obtain a dictionary to be used for entries in a changelist.
375
375
376 This function is called when producing items for the "entries" list passed
376 This function is called when producing items for the "entries" list passed
377 to the "shortlog" and "changelog" templates.
377 to the "shortlog" and "changelog" templates.
378 '''
378 '''
379 repo = web.repo
379 repo = web.repo
380 rev = ctx.rev()
380 rev = ctx.rev()
381 n = ctx.node()
381 n = ctx.node()
382 showtags = showtag(repo, tmpl, 'changelogtag', n)
382 showtags = showtag(repo, tmpl, 'changelogtag', n)
383 files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
383 files = listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
384
384
385 entry = commonentry(repo, ctx)
385 entry = commonentry(repo, ctx)
386 entry.update(
386 entry.update(
387 allparents=lambda **x: parents(ctx),
387 allparents=lambda **x: parents(ctx),
388 parent=lambda **x: parents(ctx, rev - 1),
388 parent=lambda **x: parents(ctx, rev - 1),
389 child=lambda **x: children(ctx, rev + 1),
389 child=lambda **x: children(ctx, rev + 1),
390 changelogtag=showtags,
390 changelogtag=showtags,
391 files=files,
391 files=files,
392 )
392 )
393 return entry
393 return entry
394
394
395 def symrevorshortnode(req, ctx):
395 def symrevorshortnode(req, ctx):
396 if 'node' in req.form:
396 if 'node' in req.form:
397 return templatefilters.revescape(req.form['node'][0])
397 return templatefilters.revescape(req.form['node'][0])
398 else:
398 else:
399 return short(ctx.node())
399 return short(ctx.node())
400
400
401 def changesetentry(web, req, tmpl, ctx):
401 def changesetentry(web, req, tmpl, ctx):
402 '''Obtain a dictionary to be used to render the "changeset" template.'''
402 '''Obtain a dictionary to be used to render the "changeset" template.'''
403
403
404 showtags = showtag(web.repo, tmpl, 'changesettag', ctx.node())
404 showtags = showtag(web.repo, tmpl, 'changesettag', ctx.node())
405 showbookmarks = showbookmark(web.repo, tmpl, 'changesetbookmark',
405 showbookmarks = showbookmark(web.repo, tmpl, 'changesetbookmark',
406 ctx.node())
406 ctx.node())
407 showbranch = nodebranchnodefault(ctx)
407 showbranch = nodebranchnodefault(ctx)
408
408
409 files = []
409 files = []
410 parity = paritygen(web.stripecount)
410 parity = paritygen(web.stripecount)
411 for blockno, f in enumerate(ctx.files()):
411 for blockno, f in enumerate(ctx.files()):
412 template = f in ctx and 'filenodelink' or 'filenolink'
412 template = f in ctx and 'filenodelink' or 'filenolink'
413 files.append(tmpl(template,
413 files.append(tmpl(template,
414 node=ctx.hex(), file=f, blockno=blockno + 1,
414 node=ctx.hex(), file=f, blockno=blockno + 1,
415 parity=next(parity)))
415 parity=next(parity)))
416
416
417 basectx = basechangectx(web.repo, req)
417 basectx = basechangectx(web.repo, req)
418 if basectx is None:
418 if basectx is None:
419 basectx = ctx.p1()
419 basectx = ctx.p1()
420
420
421 style = web.config('web', 'style')
421 style = web.config('web', 'style')
422 if 'style' in req.form:
422 if 'style' in req.form:
423 style = req.form['style'][0]
423 style = req.form['style'][0]
424
424
425 diff = diffs(web, tmpl, ctx, basectx, None, style)
425 diff = diffs(web, tmpl, ctx, basectx, None, style)
426
426
427 parity = paritygen(web.stripecount)
427 parity = paritygen(web.stripecount)
428 diffstatsgen = diffstatgen(ctx, basectx)
428 diffstatsgen = diffstatgen(ctx, basectx)
429 diffstats = diffstat(tmpl, ctx, diffstatsgen, parity)
429 diffstats = diffstat(tmpl, ctx, diffstatsgen, parity)
430
430
431 return dict(
431 return dict(
432 diff=diff,
432 diff=diff,
433 symrev=symrevorshortnode(req, ctx),
433 symrev=symrevorshortnode(req, ctx),
434 basenode=basectx.hex(),
434 basenode=basectx.hex(),
435 changesettag=showtags,
435 changesettag=showtags,
436 changesetbookmark=showbookmarks,
436 changesetbookmark=showbookmarks,
437 changesetbranch=showbranch,
437 changesetbranch=showbranch,
438 files=files,
438 files=files,
439 diffsummary=lambda **x: diffsummary(diffstatsgen),
439 diffsummary=lambda **x: diffsummary(diffstatsgen),
440 diffstat=diffstats,
440 diffstat=diffstats,
441 archives=web.archivelist(ctx.hex()),
441 archives=web.archivelist(ctx.hex()),
442 **commonentry(web.repo, ctx))
442 **commonentry(web.repo, ctx))
443
443
444 def listfilediffs(tmpl, files, node, max):
444 def listfilediffs(tmpl, files, node, max):
445 for f in files[:max]:
445 for f in files[:max]:
446 yield tmpl('filedifflink', node=hex(node), file=f)
446 yield tmpl('filedifflink', node=hex(node), file=f)
447 if len(files) > max:
447 if len(files) > max:
448 yield tmpl('fileellipses')
448 yield tmpl('fileellipses')
449
449
450 def diffs(web, tmpl, ctx, basectx, files, style, linerange=None,
450 def diffs(web, tmpl, ctx, basectx, files, style, linerange=None,
451 lineidprefix=''):
451 lineidprefix=''):
452
452
453 def prettyprintlines(lines, blockno):
453 def prettyprintlines(lines, blockno):
454 for lineno, l in enumerate(lines, 1):
454 for lineno, l in enumerate(lines, 1):
455 difflineno = "%d.%d" % (blockno, lineno)
455 difflineno = "%d.%d" % (blockno, lineno)
456 if l.startswith('+'):
456 if l.startswith('+'):
457 ltype = "difflineplus"
457 ltype = "difflineplus"
458 elif l.startswith('-'):
458 elif l.startswith('-'):
459 ltype = "difflineminus"
459 ltype = "difflineminus"
460 elif l.startswith('@'):
460 elif l.startswith('@'):
461 ltype = "difflineat"
461 ltype = "difflineat"
462 else:
462 else:
463 ltype = "diffline"
463 ltype = "diffline"
464 yield tmpl(ltype,
464 yield tmpl(ltype,
465 line=l,
465 line=l,
466 lineno=lineno,
466 lineno=lineno,
467 lineid=lineidprefix + "l%s" % difflineno,
467 lineid=lineidprefix + "l%s" % difflineno,
468 linenumber="% 8s" % difflineno)
468 linenumber="% 8s" % difflineno)
469
469
470 repo = web.repo
470 repo = web.repo
471 if files:
471 if files:
472 m = match.exact(repo.root, repo.getcwd(), files)
472 m = match.exact(repo.root, repo.getcwd(), files)
473 else:
473 else:
474 m = match.always(repo.root, repo.getcwd())
474 m = match.always(repo.root, repo.getcwd())
475
475
476 diffopts = patch.diffopts(repo.ui, untrusted=True)
476 diffopts = patch.diffopts(repo.ui, untrusted=True)
477 node1 = basectx.node()
477 node1 = basectx.node()
478 node2 = ctx.node()
478 node2 = ctx.node()
479 parity = paritygen(web.stripecount)
479 parity = paritygen(web.stripecount)
480
480
481 diffhunks = patch.diffhunks(repo, node1, node2, m, opts=diffopts)
481 diffhunks = patch.diffhunks(repo, node1, node2, m, opts=diffopts)
482 for blockno, (fctx1, fctx2, header, hunks) in enumerate(diffhunks, 1):
482 for blockno, (fctx1, fctx2, header, hunks) in enumerate(diffhunks, 1):
483 if style != 'raw':
483 if style != 'raw':
484 header = header[1:]
484 header = header[1:]
485 lines = [h + '\n' for h in header]
485 lines = [h + '\n' for h in header]
486 for hunkrange, hunklines in hunks:
486 for hunkrange, hunklines in hunks:
487 if linerange is not None and hunkrange is not None:
487 if linerange is not None and hunkrange is not None:
488 s1, l1, s2, l2 = hunkrange
488 s1, l1, s2, l2 = hunkrange
489 if not mdiff.hunkinrange((s2, l2), linerange):
489 if not mdiff.hunkinrange((s2, l2), linerange):
490 continue
490 continue
491 lines.extend(hunklines)
491 lines.extend(hunklines)
492 if lines:
492 if lines:
493 yield tmpl('diffblock', parity=next(parity), blockno=blockno,
493 yield tmpl('diffblock', parity=next(parity), blockno=blockno,
494 lines=prettyprintlines(lines, blockno))
494 lines=prettyprintlines(lines, blockno))
495
495
496 def compare(tmpl, context, leftlines, rightlines):
496 def compare(tmpl, context, leftlines, rightlines):
497 '''Generator function that provides side-by-side comparison data.'''
497 '''Generator function that provides side-by-side comparison data.'''
498
498
499 def compline(type, leftlineno, leftline, rightlineno, rightline):
499 def compline(type, leftlineno, leftline, rightlineno, rightline):
500 lineid = leftlineno and ("l%s" % leftlineno) or ''
500 lineid = leftlineno and ("l%s" % leftlineno) or ''
501 lineid += rightlineno and ("r%s" % rightlineno) or ''
501 lineid += rightlineno and ("r%s" % rightlineno) or ''
502 return tmpl('comparisonline',
502 return tmpl('comparisonline',
503 type=type,
503 type=type,
504 lineid=lineid,
504 lineid=lineid,
505 leftlineno=leftlineno,
505 leftlineno=leftlineno,
506 leftlinenumber="% 6s" % (leftlineno or ''),
506 leftlinenumber="% 6s" % (leftlineno or ''),
507 leftline=leftline or '',
507 leftline=leftline or '',
508 rightlineno=rightlineno,
508 rightlineno=rightlineno,
509 rightlinenumber="% 6s" % (rightlineno or ''),
509 rightlinenumber="% 6s" % (rightlineno or ''),
510 rightline=rightline or '')
510 rightline=rightline or '')
511
511
512 def getblock(opcodes):
512 def getblock(opcodes):
513 for type, llo, lhi, rlo, rhi in opcodes:
513 for type, llo, lhi, rlo, rhi in opcodes:
514 len1 = lhi - llo
514 len1 = lhi - llo
515 len2 = rhi - rlo
515 len2 = rhi - rlo
516 count = min(len1, len2)
516 count = min(len1, len2)
517 for i in xrange(count):
517 for i in xrange(count):
518 yield compline(type=type,
518 yield compline(type=type,
519 leftlineno=llo + i + 1,
519 leftlineno=llo + i + 1,
520 leftline=leftlines[llo + i],
520 leftline=leftlines[llo + i],
521 rightlineno=rlo + i + 1,
521 rightlineno=rlo + i + 1,
522 rightline=rightlines[rlo + i])
522 rightline=rightlines[rlo + i])
523 if len1 > len2:
523 if len1 > len2:
524 for i in xrange(llo + count, lhi):
524 for i in xrange(llo + count, lhi):
525 yield compline(type=type,
525 yield compline(type=type,
526 leftlineno=i + 1,
526 leftlineno=i + 1,
527 leftline=leftlines[i],
527 leftline=leftlines[i],
528 rightlineno=None,
528 rightlineno=None,
529 rightline=None)
529 rightline=None)
530 elif len2 > len1:
530 elif len2 > len1:
531 for i in xrange(rlo + count, rhi):
531 for i in xrange(rlo + count, rhi):
532 yield compline(type=type,
532 yield compline(type=type,
533 leftlineno=None,
533 leftlineno=None,
534 leftline=None,
534 leftline=None,
535 rightlineno=i + 1,
535 rightlineno=i + 1,
536 rightline=rightlines[i])
536 rightline=rightlines[i])
537
537
538 s = difflib.SequenceMatcher(None, leftlines, rightlines)
538 s = difflib.SequenceMatcher(None, leftlines, rightlines)
539 if context < 0:
539 if context < 0:
540 yield tmpl('comparisonblock', lines=getblock(s.get_opcodes()))
540 yield tmpl('comparisonblock', lines=getblock(s.get_opcodes()))
541 else:
541 else:
542 for oc in s.get_grouped_opcodes(n=context):
542 for oc in s.get_grouped_opcodes(n=context):
543 yield tmpl('comparisonblock', lines=getblock(oc))
543 yield tmpl('comparisonblock', lines=getblock(oc))
544
544
545 def diffstatgen(ctx, basectx):
545 def diffstatgen(ctx, basectx):
546 '''Generator function that provides the diffstat data.'''
546 '''Generator function that provides the diffstat data.'''
547
547
548 stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx)))
548 stats = patch.diffstatdata(
549 util.iterlines(ctx.diff(basectx, noprefix=False)))
549 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
550 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
550 while True:
551 while True:
551 yield stats, maxname, maxtotal, addtotal, removetotal, binary
552 yield stats, maxname, maxtotal, addtotal, removetotal, binary
552
553
553 def diffsummary(statgen):
554 def diffsummary(statgen):
554 '''Return a short summary of the diff.'''
555 '''Return a short summary of the diff.'''
555
556
556 stats, maxname, maxtotal, addtotal, removetotal, binary = next(statgen)
557 stats, maxname, maxtotal, addtotal, removetotal, binary = next(statgen)
557 return _(' %d files changed, %d insertions(+), %d deletions(-)\n') % (
558 return _(' %d files changed, %d insertions(+), %d deletions(-)\n') % (
558 len(stats), addtotal, removetotal)
559 len(stats), addtotal, removetotal)
559
560
560 def diffstat(tmpl, ctx, statgen, parity):
561 def diffstat(tmpl, ctx, statgen, parity):
561 '''Return a diffstat template for each file in the diff.'''
562 '''Return a diffstat template for each file in the diff.'''
562
563
563 stats, maxname, maxtotal, addtotal, removetotal, binary = next(statgen)
564 stats, maxname, maxtotal, addtotal, removetotal, binary = next(statgen)
564 files = ctx.files()
565 files = ctx.files()
565
566
566 def pct(i):
567 def pct(i):
567 if maxtotal == 0:
568 if maxtotal == 0:
568 return 0
569 return 0
569 return (float(i) / maxtotal) * 100
570 return (float(i) / maxtotal) * 100
570
571
571 fileno = 0
572 fileno = 0
572 for filename, adds, removes, isbinary in stats:
573 for filename, adds, removes, isbinary in stats:
573 template = filename in files and 'diffstatlink' or 'diffstatnolink'
574 template = filename in files and 'diffstatlink' or 'diffstatnolink'
574 total = adds + removes
575 total = adds + removes
575 fileno += 1
576 fileno += 1
576 yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno,
577 yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno,
577 total=total, addpct=pct(adds), removepct=pct(removes),
578 total=total, addpct=pct(adds), removepct=pct(removes),
578 parity=next(parity))
579 parity=next(parity))
579
580
580 class sessionvars(object):
581 class sessionvars(object):
581 def __init__(self, vars, start='?'):
582 def __init__(self, vars, start='?'):
582 self.start = start
583 self.start = start
583 self.vars = vars
584 self.vars = vars
584 def __getitem__(self, key):
585 def __getitem__(self, key):
585 return self.vars[key]
586 return self.vars[key]
586 def __setitem__(self, key, value):
587 def __setitem__(self, key, value):
587 self.vars[key] = value
588 self.vars[key] = value
588 def __copy__(self):
589 def __copy__(self):
589 return sessionvars(copy.copy(self.vars), self.start)
590 return sessionvars(copy.copy(self.vars), self.start)
590 def __iter__(self):
591 def __iter__(self):
591 separator = self.start
592 separator = self.start
592 for key, value in sorted(self.vars.iteritems()):
593 for key, value in sorted(self.vars.iteritems()):
593 yield {'name': key,
594 yield {'name': key,
594 'value': pycompat.bytestr(value),
595 'value': pycompat.bytestr(value),
595 'separator': separator,
596 'separator': separator,
596 }
597 }
597 separator = '&'
598 separator = '&'
598
599
599 class wsgiui(uimod.ui):
600 class wsgiui(uimod.ui):
600 # default termwidth breaks under mod_wsgi
601 # default termwidth breaks under mod_wsgi
601 def termwidth(self):
602 def termwidth(self):
602 return 80
603 return 80
603
604
604 def getwebsubs(repo):
605 def getwebsubs(repo):
605 websubtable = []
606 websubtable = []
606 websubdefs = repo.ui.configitems('websub')
607 websubdefs = repo.ui.configitems('websub')
607 # we must maintain interhg backwards compatibility
608 # we must maintain interhg backwards compatibility
608 websubdefs += repo.ui.configitems('interhg')
609 websubdefs += repo.ui.configitems('interhg')
609 for key, pattern in websubdefs:
610 for key, pattern in websubdefs:
610 # grab the delimiter from the character after the "s"
611 # grab the delimiter from the character after the "s"
611 unesc = pattern[1]
612 unesc = pattern[1]
612 delim = re.escape(unesc)
613 delim = re.escape(unesc)
613
614
614 # identify portions of the pattern, taking care to avoid escaped
615 # identify portions of the pattern, taking care to avoid escaped
615 # delimiters. the replace format and flags are optional, but
616 # delimiters. the replace format and flags are optional, but
616 # delimiters are required.
617 # delimiters are required.
617 match = re.match(
618 match = re.match(
618 r'^s%s(.+)(?:(?<=\\\\)|(?<!\\))%s(.*)%s([ilmsux])*$'
619 r'^s%s(.+)(?:(?<=\\\\)|(?<!\\))%s(.*)%s([ilmsux])*$'
619 % (delim, delim, delim), pattern)
620 % (delim, delim, delim), pattern)
620 if not match:
621 if not match:
621 repo.ui.warn(_("websub: invalid pattern for %s: %s\n")
622 repo.ui.warn(_("websub: invalid pattern for %s: %s\n")
622 % (key, pattern))
623 % (key, pattern))
623 continue
624 continue
624
625
625 # we need to unescape the delimiter for regexp and format
626 # we need to unescape the delimiter for regexp and format
626 delim_re = re.compile(r'(?<!\\)\\%s' % delim)
627 delim_re = re.compile(r'(?<!\\)\\%s' % delim)
627 regexp = delim_re.sub(unesc, match.group(1))
628 regexp = delim_re.sub(unesc, match.group(1))
628 format = delim_re.sub(unesc, match.group(2))
629 format = delim_re.sub(unesc, match.group(2))
629
630
630 # the pattern allows for 6 regexp flags, so set them if necessary
631 # the pattern allows for 6 regexp flags, so set them if necessary
631 flagin = match.group(3)
632 flagin = match.group(3)
632 flags = 0
633 flags = 0
633 if flagin:
634 if flagin:
634 for flag in flagin.upper():
635 for flag in flagin.upper():
635 flags |= re.__dict__[flag]
636 flags |= re.__dict__[flag]
636
637
637 try:
638 try:
638 regexp = re.compile(regexp, flags)
639 regexp = re.compile(regexp, flags)
639 websubtable.append((regexp, format))
640 websubtable.append((regexp, format))
640 except re.error:
641 except re.error:
641 repo.ui.warn(_("websub: invalid regexp for %s: %s\n")
642 repo.ui.warn(_("websub: invalid regexp for %s: %s\n")
642 % (key, regexp))
643 % (key, regexp))
643 return websubtable
644 return websubtable
@@ -1,1169 +1,1186 b''
1 #require serve
1 #require serve
2
2
3 setting up repo
3 setting up repo
4
4
5 $ hg init test
5 $ hg init test
6 $ cd test
6 $ cd test
7 $ echo a > a
7 $ echo a > a
8 $ echo b > b
8 $ echo b > b
9 $ hg ci -Ama
9 $ hg ci -Ama
10 adding a
10 adding a
11 adding b
11 adding b
12
12
13 change permissions for git diffs
13 change permissions for git diffs
14
14
15 $ hg import -q --bypass - <<EOF
15 $ hg import -q --bypass - <<EOF
16 > # HG changeset patch
16 > # HG changeset patch
17 > # User test
17 > # User test
18 > # Date 0 0
18 > # Date 0 0
19 > b
19 > b
20 >
20 >
21 > diff --git a/a b/a
21 > diff --git a/a b/a
22 > old mode 100644
22 > old mode 100644
23 > new mode 100755
23 > new mode 100755
24 > diff --git a/b b/b
24 > diff --git a/b b/b
25 > deleted file mode 100644
25 > deleted file mode 100644
26 > --- a/b
26 > --- a/b
27 > +++ /dev/null
27 > +++ /dev/null
28 > @@ -1,1 +0,0 @@
28 > @@ -1,1 +0,0 @@
29 > -b
29 > -b
30 > EOF
30 > EOF
31
31
32 set up hgweb
32 set up hgweb
33
33
34 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
34 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
35 $ cat hg.pid >> $DAEMON_PIDS
35 $ cat hg.pid >> $DAEMON_PIDS
36
36
37 revision
37 revision
38
38
39 $ get-with-headers.py localhost:$HGPORT 'rev/0'
39 $ get-with-headers.py localhost:$HGPORT 'rev/0'
40 200 Script output follows
40 200 Script output follows
41
41
42 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
42 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
43 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
44 <head>
44 <head>
45 <link rel="icon" href="/static/hgicon.png" type="image/png" />
45 <link rel="icon" href="/static/hgicon.png" type="image/png" />
46 <meta name="robots" content="index, nofollow" />
46 <meta name="robots" content="index, nofollow" />
47 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
47 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
48 <script type="text/javascript" src="/static/mercurial.js"></script>
48 <script type="text/javascript" src="/static/mercurial.js"></script>
49
49
50 <title>test: 0cd96de13884</title>
50 <title>test: 0cd96de13884</title>
51 </head>
51 </head>
52 <body>
52 <body>
53 <div class="container">
53 <div class="container">
54 <div class="menu">
54 <div class="menu">
55 <div class="logo">
55 <div class="logo">
56 <a href="https://mercurial-scm.org/">
56 <a href="https://mercurial-scm.org/">
57 <img src="/static/hglogo.png" alt="mercurial" /></a>
57 <img src="/static/hglogo.png" alt="mercurial" /></a>
58 </div>
58 </div>
59 <ul>
59 <ul>
60 <li><a href="/shortlog/0">log</a></li>
60 <li><a href="/shortlog/0">log</a></li>
61 <li><a href="/graph/0">graph</a></li>
61 <li><a href="/graph/0">graph</a></li>
62 <li><a href="/tags">tags</a></li>
62 <li><a href="/tags">tags</a></li>
63 <li><a href="/bookmarks">bookmarks</a></li>
63 <li><a href="/bookmarks">bookmarks</a></li>
64 <li><a href="/branches">branches</a></li>
64 <li><a href="/branches">branches</a></li>
65 </ul>
65 </ul>
66 <ul>
66 <ul>
67 <li class="active">changeset</li>
67 <li class="active">changeset</li>
68 <li><a href="/raw-rev/0">raw</a></li>
68 <li><a href="/raw-rev/0">raw</a></li>
69 <li><a href="/file/0">browse</a></li>
69 <li><a href="/file/0">browse</a></li>
70 </ul>
70 </ul>
71 <ul>
71 <ul>
72
72
73 </ul>
73 </ul>
74 <ul>
74 <ul>
75 <li><a href="/help">help</a></li>
75 <li><a href="/help">help</a></li>
76 </ul>
76 </ul>
77 </div>
77 </div>
78
78
79 <div class="main">
79 <div class="main">
80
80
81 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
81 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
82 <h3>
82 <h3>
83 changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
83 changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
84
84
85 </h3>
85 </h3>
86
86
87
87
88 <form class="search" action="/log">
88 <form class="search" action="/log">
89
89
90 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
90 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
91 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
91 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
92 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
92 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
93 </form>
93 </form>
94
94
95 <div class="description">a</div>
95 <div class="description">a</div>
96
96
97 <table id="changesetEntry">
97 <table id="changesetEntry">
98 <tr>
98 <tr>
99 <th class="author">author</th>
99 <th class="author">author</th>
100 <td class="author">&#116;&#101;&#115;&#116;</td>
100 <td class="author">&#116;&#101;&#115;&#116;</td>
101 </tr>
101 </tr>
102 <tr>
102 <tr>
103 <th class="date">date</th>
103 <th class="date">date</th>
104 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
104 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
105 </tr>
105 </tr>
106 <tr>
106 <tr>
107 <th class="author">parents</th>
107 <th class="author">parents</th>
108 <td class="author"></td>
108 <td class="author"></td>
109 </tr>
109 </tr>
110 <tr>
110 <tr>
111 <th class="author">children</th>
111 <th class="author">children</th>
112 <td class="author"> <a href="/rev/559edbd9ed20">559edbd9ed20</a></td>
112 <td class="author"> <a href="/rev/559edbd9ed20">559edbd9ed20</a></td>
113 </tr>
113 </tr>
114 <tr>
114 <tr>
115 <th class="files">files</th>
115 <th class="files">files</th>
116 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
116 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
117 </tr>
117 </tr>
118 <tr>
118 <tr>
119 <th class="diffstat">diffstat</th>
119 <th class="diffstat">diffstat</th>
120 <td class="diffstat">
120 <td class="diffstat">
121 2 files changed, 2 insertions(+), 0 deletions(-)
121 2 files changed, 2 insertions(+), 0 deletions(-)
122
122
123 <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
123 <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
124 <div id="diffstatdetails" style="display:none;">
124 <div id="diffstatdetails" style="display:none;">
125 <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
125 <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
126 <table class="diffstat-table stripes2"> <tr>
126 <table class="diffstat-table stripes2"> <tr>
127 <td class="diffstat-file"><a href="#l1.1">a</a></td>
127 <td class="diffstat-file"><a href="#l1.1">a</a></td>
128 <td class="diffstat-total" align="right">1</td>
128 <td class="diffstat-total" align="right">1</td>
129 <td class="diffstat-graph">
129 <td class="diffstat-graph">
130 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
130 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
131 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
131 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
132 </td>
132 </td>
133 </tr>
133 </tr>
134 <tr>
134 <tr>
135 <td class="diffstat-file"><a href="#l2.1">b</a></td>
135 <td class="diffstat-file"><a href="#l2.1">b</a></td>
136 <td class="diffstat-total" align="right">1</td>
136 <td class="diffstat-total" align="right">1</td>
137 <td class="diffstat-graph">
137 <td class="diffstat-graph">
138 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
138 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
139 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
139 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
140 </td>
140 </td>
141 </tr>
141 </tr>
142 </table>
142 </table>
143 </div>
143 </div>
144 </td>
144 </td>
145 </tr>
145 </tr>
146 </table>
146 </table>
147
147
148 <div class="overflow">
148 <div class="overflow">
149 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
149 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
150 <div class="sourcefirst"> line diff</div>
150 <div class="sourcefirst"> line diff</div>
151 <div class="stripes2 diffblocks">
151 <div class="stripes2 diffblocks">
152 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
152 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
153 <span id="l1.1" class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
153 <span id="l1.1" class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
154 <span id="l1.2" class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
154 <span id="l1.2" class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
155 <span id="l1.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.3"></a>
155 <span id="l1.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.3"></a>
156 <span id="l1.4" class="plusline">+a</span><a href="#l1.4"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
156 <span id="l1.4" class="plusline">+a</span><a href="#l1.4"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
157 <span id="l2.1" class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.1"></a>
157 <span id="l2.1" class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.1"></a>
158 <span id="l2.2" class="plusline">+++ b/b Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.2"></a>
158 <span id="l2.2" class="plusline">+++ b/b Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.2"></a>
159 <span id="l2.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.3"></a>
159 <span id="l2.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.3"></a>
160 <span id="l2.4" class="plusline">+b</span><a href="#l2.4"></a></pre></div>
160 <span id="l2.4" class="plusline">+b</span><a href="#l2.4"></a></pre></div>
161 </div>
161 </div>
162 </div>
162 </div>
163
163
164 </div>
164 </div>
165 </div>
165 </div>
166
166
167
167
168 </body>
168 </body>
169 </html>
169 </html>
170
170
171
171
172 raw revision
172 raw revision
173
173
174 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
174 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
175 200 Script output follows
175 200 Script output follows
176
176
177
177
178 # HG changeset patch
178 # HG changeset patch
179 # User test
179 # User test
180 # Date 0 0
180 # Date 0 0
181 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
181 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
182
182
183 a
183 a
184
184
185 diff -r 000000000000 -r 0cd96de13884 a
185 diff -r 000000000000 -r 0cd96de13884 a
186 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
186 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
187 +++ b/a Thu Jan 01 00:00:00 1970 +0000
187 +++ b/a Thu Jan 01 00:00:00 1970 +0000
188 @@ -0,0 +1,1 @@
188 @@ -0,0 +1,1 @@
189 +a
189 +a
190 diff -r 000000000000 -r 0cd96de13884 b
190 diff -r 000000000000 -r 0cd96de13884 b
191 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
191 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
192 +++ b/b Thu Jan 01 00:00:00 1970 +0000
192 +++ b/b Thu Jan 01 00:00:00 1970 +0000
193 @@ -0,0 +1,1 @@
193 @@ -0,0 +1,1 @@
194 +b
194 +b
195
195
196
196
197 diff removed file
197 diff removed file
198
198
199 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
199 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
200 a
200 a
201 b
201 b
202 $ hg parents --template "{node|short}\n" -r tip
202 $ hg parents --template "{node|short}\n" -r tip
203 0cd96de13884
203 0cd96de13884
204 $ hg parents --template "{node|short}\n" -r tip b
204 $ hg parents --template "{node|short}\n" -r tip b
205 0cd96de13884
205 0cd96de13884
206
206
207 $ get-with-headers.py localhost:$HGPORT 'diff/tip/b'
207 $ get-with-headers.py localhost:$HGPORT 'diff/tip/b'
208 200 Script output follows
208 200 Script output follows
209
209
210 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
210 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
211 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
211 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
212 <head>
212 <head>
213 <link rel="icon" href="/static/hgicon.png" type="image/png" />
213 <link rel="icon" href="/static/hgicon.png" type="image/png" />
214 <meta name="robots" content="index, nofollow" />
214 <meta name="robots" content="index, nofollow" />
215 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
215 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
216 <script type="text/javascript" src="/static/mercurial.js"></script>
216 <script type="text/javascript" src="/static/mercurial.js"></script>
217
217
218 <title>test: b diff</title>
218 <title>test: b diff</title>
219 </head>
219 </head>
220 <body>
220 <body>
221
221
222 <div class="container">
222 <div class="container">
223 <div class="menu">
223 <div class="menu">
224 <div class="logo">
224 <div class="logo">
225 <a href="https://mercurial-scm.org/">
225 <a href="https://mercurial-scm.org/">
226 <img src="/static/hglogo.png" alt="mercurial" /></a>
226 <img src="/static/hglogo.png" alt="mercurial" /></a>
227 </div>
227 </div>
228 <ul>
228 <ul>
229 <li><a href="/shortlog/tip">log</a></li>
229 <li><a href="/shortlog/tip">log</a></li>
230 <li><a href="/graph/tip">graph</a></li>
230 <li><a href="/graph/tip">graph</a></li>
231 <li><a href="/tags">tags</a></li>
231 <li><a href="/tags">tags</a></li>
232 <li><a href="/bookmarks">bookmarks</a></li>
232 <li><a href="/bookmarks">bookmarks</a></li>
233 <li><a href="/branches">branches</a></li>
233 <li><a href="/branches">branches</a></li>
234 </ul>
234 </ul>
235 <ul>
235 <ul>
236 <li><a href="/rev/tip">changeset</a></li>
236 <li><a href="/rev/tip">changeset</a></li>
237 <li><a href="/file/tip">browse</a></li>
237 <li><a href="/file/tip">browse</a></li>
238 </ul>
238 </ul>
239 <ul>
239 <ul>
240 <li><a href="/file/tip/b">file</a></li>
240 <li><a href="/file/tip/b">file</a></li>
241 <li><a href="/file/tip/b">latest</a></li>
241 <li><a href="/file/tip/b">latest</a></li>
242 <li class="active">diff</li>
242 <li class="active">diff</li>
243 <li><a href="/comparison/tip/b">comparison</a></li>
243 <li><a href="/comparison/tip/b">comparison</a></li>
244 <li><a href="/annotate/tip/b">annotate</a></li>
244 <li><a href="/annotate/tip/b">annotate</a></li>
245 <li><a href="/log/tip/b">file log</a></li>
245 <li><a href="/log/tip/b">file log</a></li>
246 <li><a href="/raw-file/tip/b">raw</a></li>
246 <li><a href="/raw-file/tip/b">raw</a></li>
247 </ul>
247 </ul>
248 <ul>
248 <ul>
249 <li><a href="/help">help</a></li>
249 <li><a href="/help">help</a></li>
250 </ul>
250 </ul>
251 </div>
251 </div>
252
252
253 <div class="main">
253 <div class="main">
254 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
254 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
255 <h3>
255 <h3>
256 diff b @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
256 diff b @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
257 <span class="tag">tip</span>
257 <span class="tag">tip</span>
258 </h3>
258 </h3>
259
259
260
260
261 <form class="search" action="/log">
261 <form class="search" action="/log">
262
262
263 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
263 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
264 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
264 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
265 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
265 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
266 </form>
266 </form>
267
267
268 <div class="description">b</div>
268 <div class="description">b</div>
269
269
270 <table id="changesetEntry">
270 <table id="changesetEntry">
271 <tr>
271 <tr>
272 <th>author</th>
272 <th>author</th>
273 <td>&#116;&#101;&#115;&#116;</td>
273 <td>&#116;&#101;&#115;&#116;</td>
274 </tr>
274 </tr>
275 <tr>
275 <tr>
276 <th>date</th>
276 <th>date</th>
277 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
277 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
278 </tr>
278 </tr>
279 <tr>
279 <tr>
280 <th>parents</th>
280 <th>parents</th>
281 <td><a href="/file/0cd96de13884/b">0cd96de13884</a> </td>
281 <td><a href="/file/0cd96de13884/b">0cd96de13884</a> </td>
282 </tr>
282 </tr>
283 <tr>
283 <tr>
284 <th>children</th>
284 <th>children</th>
285 <td></td>
285 <td></td>
286 </tr>
286 </tr>
287 </table>
287 </table>
288
288
289 <div class="overflow">
289 <div class="overflow">
290 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
290 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
291 <div class="sourcefirst"> line diff</div>
291 <div class="sourcefirst"> line diff</div>
292 <div class="stripes2 diffblocks">
292 <div class="stripes2 diffblocks">
293 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
293 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
294 <span id="l1.1" class="minusline">--- a/b Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
294 <span id="l1.1" class="minusline">--- a/b Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
295 <span id="l1.2" class="plusline">+++ /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
295 <span id="l1.2" class="plusline">+++ /dev/null Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
296 <span id="l1.3" class="atline">@@ -1,1 +0,0 @@</span><a href="#l1.3"></a>
296 <span id="l1.3" class="atline">@@ -1,1 +0,0 @@</span><a href="#l1.3"></a>
297 <span id="l1.4" class="minusline">-b</span><a href="#l1.4"></a></pre></div>
297 <span id="l1.4" class="minusline">-b</span><a href="#l1.4"></a></pre></div>
298 </div>
298 </div>
299 </div>
299 </div>
300 </div>
300 </div>
301 </div>
301 </div>
302
302
303
303
304
304
305 </body>
305 </body>
306 </html>
306 </html>
307
307
308
308
309 set up hgweb with git diffs + noprefix
310
311 $ killdaemons.py
312 $ hg serve --config 'diff.git=1' --config 'diff.noprefix=1' -p $HGPORT -d \
313 > --pid-file=hg.pid -A access.log -E errors.log
314 $ cat hg.pid >> $DAEMON_PIDS
315
316 patch header and diffstat
317
318 $ get-with-headers.py localhost:$HGPORT 'rev/0' \
319 > | egrep 'files changed|---|\+\+\+'
320 2 files changed, 2 insertions(+), 0 deletions(-)
321 <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
322 <span id="l1.3" class="plusline">+++ a</span><a href="#l1.3"></a>
323 <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
324 <span id="l2.3" class="plusline">+++ b</span><a href="#l2.3"></a>
325
309 set up hgweb with git diffs
326 set up hgweb with git diffs
310
327
311 $ killdaemons.py
328 $ killdaemons.py
312 $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
329 $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
313 $ cat hg.pid >> $DAEMON_PIDS
330 $ cat hg.pid >> $DAEMON_PIDS
314
331
315 revision
332 revision
316
333
317 $ get-with-headers.py localhost:$HGPORT 'rev/0'
334 $ get-with-headers.py localhost:$HGPORT 'rev/0'
318 200 Script output follows
335 200 Script output follows
319
336
320 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
337 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
321 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
338 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
322 <head>
339 <head>
323 <link rel="icon" href="/static/hgicon.png" type="image/png" />
340 <link rel="icon" href="/static/hgicon.png" type="image/png" />
324 <meta name="robots" content="index, nofollow" />
341 <meta name="robots" content="index, nofollow" />
325 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
342 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
326 <script type="text/javascript" src="/static/mercurial.js"></script>
343 <script type="text/javascript" src="/static/mercurial.js"></script>
327
344
328 <title>test: 0cd96de13884</title>
345 <title>test: 0cd96de13884</title>
329 </head>
346 </head>
330 <body>
347 <body>
331 <div class="container">
348 <div class="container">
332 <div class="menu">
349 <div class="menu">
333 <div class="logo">
350 <div class="logo">
334 <a href="https://mercurial-scm.org/">
351 <a href="https://mercurial-scm.org/">
335 <img src="/static/hglogo.png" alt="mercurial" /></a>
352 <img src="/static/hglogo.png" alt="mercurial" /></a>
336 </div>
353 </div>
337 <ul>
354 <ul>
338 <li><a href="/shortlog/0">log</a></li>
355 <li><a href="/shortlog/0">log</a></li>
339 <li><a href="/graph/0">graph</a></li>
356 <li><a href="/graph/0">graph</a></li>
340 <li><a href="/tags">tags</a></li>
357 <li><a href="/tags">tags</a></li>
341 <li><a href="/bookmarks">bookmarks</a></li>
358 <li><a href="/bookmarks">bookmarks</a></li>
342 <li><a href="/branches">branches</a></li>
359 <li><a href="/branches">branches</a></li>
343 </ul>
360 </ul>
344 <ul>
361 <ul>
345 <li class="active">changeset</li>
362 <li class="active">changeset</li>
346 <li><a href="/raw-rev/0">raw</a></li>
363 <li><a href="/raw-rev/0">raw</a></li>
347 <li><a href="/file/0">browse</a></li>
364 <li><a href="/file/0">browse</a></li>
348 </ul>
365 </ul>
349 <ul>
366 <ul>
350
367
351 </ul>
368 </ul>
352 <ul>
369 <ul>
353 <li><a href="/help">help</a></li>
370 <li><a href="/help">help</a></li>
354 </ul>
371 </ul>
355 </div>
372 </div>
356
373
357 <div class="main">
374 <div class="main">
358
375
359 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
376 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
360 <h3>
377 <h3>
361 changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
378 changeset 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
362
379
363 </h3>
380 </h3>
364
381
365
382
366 <form class="search" action="/log">
383 <form class="search" action="/log">
367
384
368 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
385 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
369 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
386 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
370 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
387 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
371 </form>
388 </form>
372
389
373 <div class="description">a</div>
390 <div class="description">a</div>
374
391
375 <table id="changesetEntry">
392 <table id="changesetEntry">
376 <tr>
393 <tr>
377 <th class="author">author</th>
394 <th class="author">author</th>
378 <td class="author">&#116;&#101;&#115;&#116;</td>
395 <td class="author">&#116;&#101;&#115;&#116;</td>
379 </tr>
396 </tr>
380 <tr>
397 <tr>
381 <th class="date">date</th>
398 <th class="date">date</th>
382 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
399 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
383 </tr>
400 </tr>
384 <tr>
401 <tr>
385 <th class="author">parents</th>
402 <th class="author">parents</th>
386 <td class="author"></td>
403 <td class="author"></td>
387 </tr>
404 </tr>
388 <tr>
405 <tr>
389 <th class="author">children</th>
406 <th class="author">children</th>
390 <td class="author"> <a href="/rev/559edbd9ed20">559edbd9ed20</a></td>
407 <td class="author"> <a href="/rev/559edbd9ed20">559edbd9ed20</a></td>
391 </tr>
408 </tr>
392 <tr>
409 <tr>
393 <th class="files">files</th>
410 <th class="files">files</th>
394 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
411 <td class="files"><a href="/file/0cd96de13884/a">a</a> <a href="/file/0cd96de13884/b">b</a> </td>
395 </tr>
412 </tr>
396 <tr>
413 <tr>
397 <th class="diffstat">diffstat</th>
414 <th class="diffstat">diffstat</th>
398 <td class="diffstat">
415 <td class="diffstat">
399 2 files changed, 2 insertions(+), 0 deletions(-)
416 2 files changed, 2 insertions(+), 0 deletions(-)
400
417
401 <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
418 <a id="diffstatexpand" href="javascript:toggleDiffstat()">[<tt>+</tt>]</a>
402 <div id="diffstatdetails" style="display:none;">
419 <div id="diffstatdetails" style="display:none;">
403 <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
420 <a href="javascript:toggleDiffstat()">[<tt>-</tt>]</a>
404 <table class="diffstat-table stripes2"> <tr>
421 <table class="diffstat-table stripes2"> <tr>
405 <td class="diffstat-file"><a href="#l1.1">a</a></td>
422 <td class="diffstat-file"><a href="#l1.1">a</a></td>
406 <td class="diffstat-total" align="right">1</td>
423 <td class="diffstat-total" align="right">1</td>
407 <td class="diffstat-graph">
424 <td class="diffstat-graph">
408 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
425 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
409 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
426 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
410 </td>
427 </td>
411 </tr>
428 </tr>
412 <tr>
429 <tr>
413 <td class="diffstat-file"><a href="#l2.1">b</a></td>
430 <td class="diffstat-file"><a href="#l2.1">b</a></td>
414 <td class="diffstat-total" align="right">1</td>
431 <td class="diffstat-total" align="right">1</td>
415 <td class="diffstat-graph">
432 <td class="diffstat-graph">
416 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
433 <span class="diffstat-add" style="width:100.0%;">&nbsp;</span>
417 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
434 <span class="diffstat-remove" style="width:0.0%;">&nbsp;</span>
418 </td>
435 </td>
419 </tr>
436 </tr>
420 </table>
437 </table>
421 </div>
438 </div>
422 </td>
439 </td>
423 </tr>
440 </tr>
424 </table>
441 </table>
425
442
426 <div class="overflow">
443 <div class="overflow">
427 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
444 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
428 <div class="sourcefirst"> line diff</div>
445 <div class="sourcefirst"> line diff</div>
429 <div class="stripes2 diffblocks">
446 <div class="stripes2 diffblocks">
430 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
447 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
431 <span id="l1.1">new file mode 100644</span><a href="#l1.1"></a>
448 <span id="l1.1">new file mode 100644</span><a href="#l1.1"></a>
432 <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
449 <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
433 <span id="l1.3" class="plusline">+++ b/a</span><a href="#l1.3"></a>
450 <span id="l1.3" class="plusline">+++ b/a</span><a href="#l1.3"></a>
434 <span id="l1.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.4"></a>
451 <span id="l1.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.4"></a>
435 <span id="l1.5" class="plusline">+a</span><a href="#l1.5"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
452 <span id="l1.5" class="plusline">+a</span><a href="#l1.5"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
436 <span id="l2.1">new file mode 100644</span><a href="#l2.1"></a>
453 <span id="l2.1">new file mode 100644</span><a href="#l2.1"></a>
437 <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
454 <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
438 <span id="l2.3" class="plusline">+++ b/b</span><a href="#l2.3"></a>
455 <span id="l2.3" class="plusline">+++ b/b</span><a href="#l2.3"></a>
439 <span id="l2.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.4"></a>
456 <span id="l2.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.4"></a>
440 <span id="l2.5" class="plusline">+b</span><a href="#l2.5"></a></pre></div>
457 <span id="l2.5" class="plusline">+b</span><a href="#l2.5"></a></pre></div>
441 </div>
458 </div>
442 </div>
459 </div>
443
460
444 </div>
461 </div>
445 </div>
462 </div>
446
463
447
464
448 </body>
465 </body>
449 </html>
466 </html>
450
467
451
468
452 revision
469 revision
453
470
454 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
471 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
455 200 Script output follows
472 200 Script output follows
456
473
457
474
458 # HG changeset patch
475 # HG changeset patch
459 # User test
476 # User test
460 # Date 0 0
477 # Date 0 0
461 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
478 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
462
479
463 a
480 a
464
481
465 diff --git a/a b/a
482 diff --git a/a b/a
466 new file mode 100644
483 new file mode 100644
467 --- /dev/null
484 --- /dev/null
468 +++ b/a
485 +++ b/a
469 @@ -0,0 +1,1 @@
486 @@ -0,0 +1,1 @@
470 +a
487 +a
471 diff --git a/b b/b
488 diff --git a/b b/b
472 new file mode 100644
489 new file mode 100644
473 --- /dev/null
490 --- /dev/null
474 +++ b/b
491 +++ b/b
475 @@ -0,0 +1,1 @@
492 @@ -0,0 +1,1 @@
476 +b
493 +b
477
494
478
495
479 diff modified file
496 diff modified file
480
497
481 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
498 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip
482 a
499 a
483 b
500 b
484 $ hg parents --template "{node|short}\n" -r tip
501 $ hg parents --template "{node|short}\n" -r tip
485 0cd96de13884
502 0cd96de13884
486 $ hg parents --template "{node|short}\n" -r tip a
503 $ hg parents --template "{node|short}\n" -r tip a
487 0cd96de13884
504 0cd96de13884
488
505
489 $ get-with-headers.py localhost:$HGPORT 'diff/tip/a'
506 $ get-with-headers.py localhost:$HGPORT 'diff/tip/a'
490 200 Script output follows
507 200 Script output follows
491
508
492 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
509 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
493 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
510 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
494 <head>
511 <head>
495 <link rel="icon" href="/static/hgicon.png" type="image/png" />
512 <link rel="icon" href="/static/hgicon.png" type="image/png" />
496 <meta name="robots" content="index, nofollow" />
513 <meta name="robots" content="index, nofollow" />
497 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
514 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
498 <script type="text/javascript" src="/static/mercurial.js"></script>
515 <script type="text/javascript" src="/static/mercurial.js"></script>
499
516
500 <title>test: a diff</title>
517 <title>test: a diff</title>
501 </head>
518 </head>
502 <body>
519 <body>
503
520
504 <div class="container">
521 <div class="container">
505 <div class="menu">
522 <div class="menu">
506 <div class="logo">
523 <div class="logo">
507 <a href="https://mercurial-scm.org/">
524 <a href="https://mercurial-scm.org/">
508 <img src="/static/hglogo.png" alt="mercurial" /></a>
525 <img src="/static/hglogo.png" alt="mercurial" /></a>
509 </div>
526 </div>
510 <ul>
527 <ul>
511 <li><a href="/shortlog/tip">log</a></li>
528 <li><a href="/shortlog/tip">log</a></li>
512 <li><a href="/graph/tip">graph</a></li>
529 <li><a href="/graph/tip">graph</a></li>
513 <li><a href="/tags">tags</a></li>
530 <li><a href="/tags">tags</a></li>
514 <li><a href="/bookmarks">bookmarks</a></li>
531 <li><a href="/bookmarks">bookmarks</a></li>
515 <li><a href="/branches">branches</a></li>
532 <li><a href="/branches">branches</a></li>
516 </ul>
533 </ul>
517 <ul>
534 <ul>
518 <li><a href="/rev/tip">changeset</a></li>
535 <li><a href="/rev/tip">changeset</a></li>
519 <li><a href="/file/tip">browse</a></li>
536 <li><a href="/file/tip">browse</a></li>
520 </ul>
537 </ul>
521 <ul>
538 <ul>
522 <li><a href="/file/tip/a">file</a></li>
539 <li><a href="/file/tip/a">file</a></li>
523 <li><a href="/file/tip/a">latest</a></li>
540 <li><a href="/file/tip/a">latest</a></li>
524 <li class="active">diff</li>
541 <li class="active">diff</li>
525 <li><a href="/comparison/tip/a">comparison</a></li>
542 <li><a href="/comparison/tip/a">comparison</a></li>
526 <li><a href="/annotate/tip/a">annotate</a></li>
543 <li><a href="/annotate/tip/a">annotate</a></li>
527 <li><a href="/log/tip/a">file log</a></li>
544 <li><a href="/log/tip/a">file log</a></li>
528 <li><a href="/raw-file/tip/a">raw</a></li>
545 <li><a href="/raw-file/tip/a">raw</a></li>
529 </ul>
546 </ul>
530 <ul>
547 <ul>
531 <li><a href="/help">help</a></li>
548 <li><a href="/help">help</a></li>
532 </ul>
549 </ul>
533 </div>
550 </div>
534
551
535 <div class="main">
552 <div class="main">
536 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
553 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
537 <h3>
554 <h3>
538 diff a @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
555 diff a @ 1:<a href="/rev/559edbd9ed20">559edbd9ed20</a>
539 <span class="tag">tip</span>
556 <span class="tag">tip</span>
540 </h3>
557 </h3>
541
558
542
559
543 <form class="search" action="/log">
560 <form class="search" action="/log">
544
561
545 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
562 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
546 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
563 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
547 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
564 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
548 </form>
565 </form>
549
566
550 <div class="description">b</div>
567 <div class="description">b</div>
551
568
552 <table id="changesetEntry">
569 <table id="changesetEntry">
553 <tr>
570 <tr>
554 <th>author</th>
571 <th>author</th>
555 <td>&#116;&#101;&#115;&#116;</td>
572 <td>&#116;&#101;&#115;&#116;</td>
556 </tr>
573 </tr>
557 <tr>
574 <tr>
558 <th>date</th>
575 <th>date</th>
559 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
576 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
560 </tr>
577 </tr>
561 <tr>
578 <tr>
562 <th>parents</th>
579 <th>parents</th>
563 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
580 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
564 </tr>
581 </tr>
565 <tr>
582 <tr>
566 <th>children</th>
583 <th>children</th>
567 <td></td>
584 <td></td>
568 </tr>
585 </tr>
569 </table>
586 </table>
570
587
571 <div class="overflow">
588 <div class="overflow">
572 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
589 <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="javascript:toggleLinewrap()">on</a></div>
573 <div class="sourcefirst"> line diff</div>
590 <div class="sourcefirst"> line diff</div>
574 <div class="stripes2 diffblocks">
591 <div class="stripes2 diffblocks">
575 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
592 <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
576 <span id="l1.1">old mode 100644</span><a href="#l1.1"></a>
593 <span id="l1.1">old mode 100644</span><a href="#l1.1"></a>
577 <span id="l1.2">new mode 100755</span><a href="#l1.2"></a></pre></div>
594 <span id="l1.2">new mode 100755</span><a href="#l1.2"></a></pre></div>
578 </div>
595 </div>
579 </div>
596 </div>
580 </div>
597 </div>
581 </div>
598 </div>
582
599
583
600
584
601
585 </body>
602 </body>
586 </html>
603 </html>
587
604
588
605
589 comparison new file
606 comparison new file
590
607
591 $ hg parents --template "{rev}:{node|short}\n" -r 0
608 $ hg parents --template "{rev}:{node|short}\n" -r 0
592 $ hg log --template "{rev}:{node|short}\n" -r 0
609 $ hg log --template "{rev}:{node|short}\n" -r 0
593 0:0cd96de13884
610 0:0cd96de13884
594
611
595 $ get-with-headers.py localhost:$HGPORT 'comparison/0/a'
612 $ get-with-headers.py localhost:$HGPORT 'comparison/0/a'
596 200 Script output follows
613 200 Script output follows
597
614
598 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
615 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
599 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
616 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
600 <head>
617 <head>
601 <link rel="icon" href="/static/hgicon.png" type="image/png" />
618 <link rel="icon" href="/static/hgicon.png" type="image/png" />
602 <meta name="robots" content="index, nofollow" />
619 <meta name="robots" content="index, nofollow" />
603 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
620 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
604 <script type="text/javascript" src="/static/mercurial.js"></script>
621 <script type="text/javascript" src="/static/mercurial.js"></script>
605
622
606 <title>test: a comparison</title>
623 <title>test: a comparison</title>
607 </head>
624 </head>
608 <body>
625 <body>
609
626
610 <div class="container">
627 <div class="container">
611 <div class="menu">
628 <div class="menu">
612 <div class="logo">
629 <div class="logo">
613 <a href="https://mercurial-scm.org/">
630 <a href="https://mercurial-scm.org/">
614 <img src="/static/hglogo.png" alt="mercurial" /></a>
631 <img src="/static/hglogo.png" alt="mercurial" /></a>
615 </div>
632 </div>
616 <ul>
633 <ul>
617 <li><a href="/shortlog/0">log</a></li>
634 <li><a href="/shortlog/0">log</a></li>
618 <li><a href="/graph/0">graph</a></li>
635 <li><a href="/graph/0">graph</a></li>
619 <li><a href="/tags">tags</a></li>
636 <li><a href="/tags">tags</a></li>
620 <li><a href="/bookmarks">bookmarks</a></li>
637 <li><a href="/bookmarks">bookmarks</a></li>
621 <li><a href="/branches">branches</a></li>
638 <li><a href="/branches">branches</a></li>
622 </ul>
639 </ul>
623 <ul>
640 <ul>
624 <li><a href="/rev/0">changeset</a></li>
641 <li><a href="/rev/0">changeset</a></li>
625 <li><a href="/file/0">browse</a></li>
642 <li><a href="/file/0">browse</a></li>
626 </ul>
643 </ul>
627 <ul>
644 <ul>
628 <li><a href="/file/0/a">file</a></li>
645 <li><a href="/file/0/a">file</a></li>
629 <li><a href="/file/tip/a">latest</a></li>
646 <li><a href="/file/tip/a">latest</a></li>
630 <li><a href="/diff/0/a">diff</a></li>
647 <li><a href="/diff/0/a">diff</a></li>
631 <li class="active">comparison</li>
648 <li class="active">comparison</li>
632 <li><a href="/annotate/0/a">annotate</a></li>
649 <li><a href="/annotate/0/a">annotate</a></li>
633 <li><a href="/log/0/a">file log</a></li>
650 <li><a href="/log/0/a">file log</a></li>
634 <li><a href="/raw-file/0/a">raw</a></li>
651 <li><a href="/raw-file/0/a">raw</a></li>
635 </ul>
652 </ul>
636 <ul>
653 <ul>
637 <li><a href="/help">help</a></li>
654 <li><a href="/help">help</a></li>
638 </ul>
655 </ul>
639 </div>
656 </div>
640
657
641 <div class="main">
658 <div class="main">
642 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
659 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
643 <h3>
660 <h3>
644 comparison a @ 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
661 comparison a @ 0:<a href="/rev/0cd96de13884">0cd96de13884</a>
645
662
646 </h3>
663 </h3>
647
664
648
665
649 <form class="search" action="/log">
666 <form class="search" action="/log">
650
667
651 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
668 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
652 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
669 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
653 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
670 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
654 </form>
671 </form>
655
672
656 <div class="description">a</div>
673 <div class="description">a</div>
657
674
658 <table id="changesetEntry">
675 <table id="changesetEntry">
659 <tr>
676 <tr>
660 <th>author</th>
677 <th>author</th>
661 <td>&#116;&#101;&#115;&#116;</td>
678 <td>&#116;&#101;&#115;&#116;</td>
662 </tr>
679 </tr>
663 <tr>
680 <tr>
664 <th>date</th>
681 <th>date</th>
665 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
682 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
666 </tr>
683 </tr>
667 <tr>
684 <tr>
668 <th>parents</th>
685 <th>parents</th>
669 <td></td>
686 <td></td>
670 </tr>
687 </tr>
671 <tr>
688 <tr>
672 <th>children</th>
689 <th>children</th>
673 <td></td>
690 <td></td>
674 </tr>
691 </tr>
675 </table>
692 </table>
676
693
677 <div class="overflow">
694 <div class="overflow">
678 <div class="sourcefirst"> comparison</div>
695 <div class="sourcefirst"> comparison</div>
679 <div class="legend">
696 <div class="legend">
680 <span class="legendinfo equal">equal</span>
697 <span class="legendinfo equal">equal</span>
681 <span class="legendinfo delete">deleted</span>
698 <span class="legendinfo delete">deleted</span>
682 <span class="legendinfo insert">inserted</span>
699 <span class="legendinfo insert">inserted</span>
683 <span class="legendinfo replace">replaced</span>
700 <span class="legendinfo replace">replaced</span>
684 </div>
701 </div>
685
702
686 <table class="bigtable">
703 <table class="bigtable">
687 <thead class="header">
704 <thead class="header">
688 <tr>
705 <tr>
689 <th>-1:000000000000</th>
706 <th>-1:000000000000</th>
690 <th>0:0cd96de13884</th>
707 <th>0:0cd96de13884</th>
691 </tr>
708 </tr>
692 </thead>
709 </thead>
693
710
694 <tbody class="block">
711 <tbody class="block">
695
712
696 <tr id="r1">
713 <tr id="r1">
697 <td class="source insert"><a href="#r1"> </a> </td>
714 <td class="source insert"><a href="#r1"> </a> </td>
698 <td class="source insert"><a href="#r1"> 1</a> a</td>
715 <td class="source insert"><a href="#r1"> 1</a> a</td>
699 </tr>
716 </tr>
700 </tbody>
717 </tbody>
701 </table>
718 </table>
702
719
703 </div>
720 </div>
704 </div>
721 </div>
705 </div>
722 </div>
706
723
707
724
708
725
709 </body>
726 </body>
710 </html>
727 </html>
711
728
712
729
713 comparison existing file
730 comparison existing file
714
731
715 $ hg up
732 $ hg up
716 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
733 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
717 $ echo a >> a
734 $ echo a >> a
718 $ hg ci -mc
735 $ hg ci -mc
719
736
720 $ hg parents --template "{rev}:{node|short}\n" -r tip
737 $ hg parents --template "{rev}:{node|short}\n" -r tip
721 1:559edbd9ed20
738 1:559edbd9ed20
722 $ hg log --template "{rev}:{node|short}\n" -r tip
739 $ hg log --template "{rev}:{node|short}\n" -r tip
723 2:d73db4d812ff
740 2:d73db4d812ff
724
741
725 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a'
742 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a'
726 200 Script output follows
743 200 Script output follows
727
744
728 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
745 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
729 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
746 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
730 <head>
747 <head>
731 <link rel="icon" href="/static/hgicon.png" type="image/png" />
748 <link rel="icon" href="/static/hgicon.png" type="image/png" />
732 <meta name="robots" content="index, nofollow" />
749 <meta name="robots" content="index, nofollow" />
733 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
750 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
734 <script type="text/javascript" src="/static/mercurial.js"></script>
751 <script type="text/javascript" src="/static/mercurial.js"></script>
735
752
736 <title>test: a comparison</title>
753 <title>test: a comparison</title>
737 </head>
754 </head>
738 <body>
755 <body>
739
756
740 <div class="container">
757 <div class="container">
741 <div class="menu">
758 <div class="menu">
742 <div class="logo">
759 <div class="logo">
743 <a href="https://mercurial-scm.org/">
760 <a href="https://mercurial-scm.org/">
744 <img src="/static/hglogo.png" alt="mercurial" /></a>
761 <img src="/static/hglogo.png" alt="mercurial" /></a>
745 </div>
762 </div>
746 <ul>
763 <ul>
747 <li><a href="/shortlog/tip">log</a></li>
764 <li><a href="/shortlog/tip">log</a></li>
748 <li><a href="/graph/tip">graph</a></li>
765 <li><a href="/graph/tip">graph</a></li>
749 <li><a href="/tags">tags</a></li>
766 <li><a href="/tags">tags</a></li>
750 <li><a href="/bookmarks">bookmarks</a></li>
767 <li><a href="/bookmarks">bookmarks</a></li>
751 <li><a href="/branches">branches</a></li>
768 <li><a href="/branches">branches</a></li>
752 </ul>
769 </ul>
753 <ul>
770 <ul>
754 <li><a href="/rev/tip">changeset</a></li>
771 <li><a href="/rev/tip">changeset</a></li>
755 <li><a href="/file/tip">browse</a></li>
772 <li><a href="/file/tip">browse</a></li>
756 </ul>
773 </ul>
757 <ul>
774 <ul>
758 <li><a href="/file/tip/a">file</a></li>
775 <li><a href="/file/tip/a">file</a></li>
759 <li><a href="/file/tip/a">latest</a></li>
776 <li><a href="/file/tip/a">latest</a></li>
760 <li><a href="/diff/tip/a">diff</a></li>
777 <li><a href="/diff/tip/a">diff</a></li>
761 <li class="active">comparison</li>
778 <li class="active">comparison</li>
762 <li><a href="/annotate/tip/a">annotate</a></li>
779 <li><a href="/annotate/tip/a">annotate</a></li>
763 <li><a href="/log/tip/a">file log</a></li>
780 <li><a href="/log/tip/a">file log</a></li>
764 <li><a href="/raw-file/tip/a">raw</a></li>
781 <li><a href="/raw-file/tip/a">raw</a></li>
765 </ul>
782 </ul>
766 <ul>
783 <ul>
767 <li><a href="/help">help</a></li>
784 <li><a href="/help">help</a></li>
768 </ul>
785 </ul>
769 </div>
786 </div>
770
787
771 <div class="main">
788 <div class="main">
772 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
789 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
773 <h3>
790 <h3>
774 comparison a @ 2:<a href="/rev/d73db4d812ff">d73db4d812ff</a>
791 comparison a @ 2:<a href="/rev/d73db4d812ff">d73db4d812ff</a>
775 <span class="tag">tip</span>
792 <span class="tag">tip</span>
776 </h3>
793 </h3>
777
794
778
795
779 <form class="search" action="/log">
796 <form class="search" action="/log">
780
797
781 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
798 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
782 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
799 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
783 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
800 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
784 </form>
801 </form>
785
802
786 <div class="description">c</div>
803 <div class="description">c</div>
787
804
788 <table id="changesetEntry">
805 <table id="changesetEntry">
789 <tr>
806 <tr>
790 <th>author</th>
807 <th>author</th>
791 <td>&#116;&#101;&#115;&#116;</td>
808 <td>&#116;&#101;&#115;&#116;</td>
792 </tr>
809 </tr>
793 <tr>
810 <tr>
794 <th>date</th>
811 <th>date</th>
795 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
812 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
796 </tr>
813 </tr>
797 <tr>
814 <tr>
798 <th>parents</th>
815 <th>parents</th>
799 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
816 <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
800 </tr>
817 </tr>
801 <tr>
818 <tr>
802 <th>children</th>
819 <th>children</th>
803 <td></td>
820 <td></td>
804 </tr>
821 </tr>
805 </table>
822 </table>
806
823
807 <div class="overflow">
824 <div class="overflow">
808 <div class="sourcefirst"> comparison</div>
825 <div class="sourcefirst"> comparison</div>
809 <div class="legend">
826 <div class="legend">
810 <span class="legendinfo equal">equal</span>
827 <span class="legendinfo equal">equal</span>
811 <span class="legendinfo delete">deleted</span>
828 <span class="legendinfo delete">deleted</span>
812 <span class="legendinfo insert">inserted</span>
829 <span class="legendinfo insert">inserted</span>
813 <span class="legendinfo replace">replaced</span>
830 <span class="legendinfo replace">replaced</span>
814 </div>
831 </div>
815
832
816 <table class="bigtable">
833 <table class="bigtable">
817 <thead class="header">
834 <thead class="header">
818 <tr>
835 <tr>
819 <th>1:559edbd9ed20</th>
836 <th>1:559edbd9ed20</th>
820 <th>2:d73db4d812ff</th>
837 <th>2:d73db4d812ff</th>
821 </tr>
838 </tr>
822 </thead>
839 </thead>
823
840
824 <tbody class="block">
841 <tbody class="block">
825
842
826 <tr id="l1r1">
843 <tr id="l1r1">
827 <td class="source equal"><a href="#l1r1"> 1</a> a</td>
844 <td class="source equal"><a href="#l1r1"> 1</a> a</td>
828 <td class="source equal"><a href="#l1r1"> 1</a> a</td>
845 <td class="source equal"><a href="#l1r1"> 1</a> a</td>
829 </tr>
846 </tr>
830 <tr id="r2">
847 <tr id="r2">
831 <td class="source insert"><a href="#r2"> </a> </td>
848 <td class="source insert"><a href="#r2"> </a> </td>
832 <td class="source insert"><a href="#r2"> 2</a> a</td>
849 <td class="source insert"><a href="#r2"> 2</a> a</td>
833 </tr>
850 </tr>
834 </tbody>
851 </tbody>
835 </table>
852 </table>
836
853
837 </div>
854 </div>
838 </div>
855 </div>
839 </div>
856 </div>
840
857
841
858
842
859
843 </body>
860 </body>
844 </html>
861 </html>
845
862
846
863
847 comparison removed file
864 comparison removed file
848
865
849 $ hg rm a
866 $ hg rm a
850 $ hg ci -md
867 $ hg ci -md
851
868
852 $ hg parents --template "{rev}:{node|short}\n" -r tip
869 $ hg parents --template "{rev}:{node|short}\n" -r tip
853 2:d73db4d812ff
870 2:d73db4d812ff
854 $ hg log --template "{rev}:{node|short}\n" -r tip
871 $ hg log --template "{rev}:{node|short}\n" -r tip
855 3:20e80271eb7a
872 3:20e80271eb7a
856
873
857 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a'
874 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a'
858 200 Script output follows
875 200 Script output follows
859
876
860 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
877 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
861 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
878 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
862 <head>
879 <head>
863 <link rel="icon" href="/static/hgicon.png" type="image/png" />
880 <link rel="icon" href="/static/hgicon.png" type="image/png" />
864 <meta name="robots" content="index, nofollow" />
881 <meta name="robots" content="index, nofollow" />
865 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
882 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
866 <script type="text/javascript" src="/static/mercurial.js"></script>
883 <script type="text/javascript" src="/static/mercurial.js"></script>
867
884
868 <title>test: a comparison</title>
885 <title>test: a comparison</title>
869 </head>
886 </head>
870 <body>
887 <body>
871
888
872 <div class="container">
889 <div class="container">
873 <div class="menu">
890 <div class="menu">
874 <div class="logo">
891 <div class="logo">
875 <a href="https://mercurial-scm.org/">
892 <a href="https://mercurial-scm.org/">
876 <img src="/static/hglogo.png" alt="mercurial" /></a>
893 <img src="/static/hglogo.png" alt="mercurial" /></a>
877 </div>
894 </div>
878 <ul>
895 <ul>
879 <li><a href="/shortlog/tip">log</a></li>
896 <li><a href="/shortlog/tip">log</a></li>
880 <li><a href="/graph/tip">graph</a></li>
897 <li><a href="/graph/tip">graph</a></li>
881 <li><a href="/tags">tags</a></li>
898 <li><a href="/tags">tags</a></li>
882 <li><a href="/bookmarks">bookmarks</a></li>
899 <li><a href="/bookmarks">bookmarks</a></li>
883 <li><a href="/branches">branches</a></li>
900 <li><a href="/branches">branches</a></li>
884 </ul>
901 </ul>
885 <ul>
902 <ul>
886 <li><a href="/rev/tip">changeset</a></li>
903 <li><a href="/rev/tip">changeset</a></li>
887 <li><a href="/file/tip">browse</a></li>
904 <li><a href="/file/tip">browse</a></li>
888 </ul>
905 </ul>
889 <ul>
906 <ul>
890 <li><a href="/file/tip/a">file</a></li>
907 <li><a href="/file/tip/a">file</a></li>
891 <li><a href="/file/tip/a">latest</a></li>
908 <li><a href="/file/tip/a">latest</a></li>
892 <li><a href="/diff/tip/a">diff</a></li>
909 <li><a href="/diff/tip/a">diff</a></li>
893 <li class="active">comparison</li>
910 <li class="active">comparison</li>
894 <li><a href="/annotate/tip/a">annotate</a></li>
911 <li><a href="/annotate/tip/a">annotate</a></li>
895 <li><a href="/log/tip/a">file log</a></li>
912 <li><a href="/log/tip/a">file log</a></li>
896 <li><a href="/raw-file/tip/a">raw</a></li>
913 <li><a href="/raw-file/tip/a">raw</a></li>
897 </ul>
914 </ul>
898 <ul>
915 <ul>
899 <li><a href="/help">help</a></li>
916 <li><a href="/help">help</a></li>
900 </ul>
917 </ul>
901 </div>
918 </div>
902
919
903 <div class="main">
920 <div class="main">
904 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
921 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
905 <h3>
922 <h3>
906 comparison a @ 3:<a href="/rev/20e80271eb7a">20e80271eb7a</a>
923 comparison a @ 3:<a href="/rev/20e80271eb7a">20e80271eb7a</a>
907 <span class="tag">tip</span>
924 <span class="tag">tip</span>
908 </h3>
925 </h3>
909
926
910
927
911 <form class="search" action="/log">
928 <form class="search" action="/log">
912
929
913 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
930 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
914 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
931 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
915 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
932 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
916 </form>
933 </form>
917
934
918 <div class="description">d</div>
935 <div class="description">d</div>
919
936
920 <table id="changesetEntry">
937 <table id="changesetEntry">
921 <tr>
938 <tr>
922 <th>author</th>
939 <th>author</th>
923 <td>&#116;&#101;&#115;&#116;</td>
940 <td>&#116;&#101;&#115;&#116;</td>
924 </tr>
941 </tr>
925 <tr>
942 <tr>
926 <th>date</th>
943 <th>date</th>
927 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
944 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
928 </tr>
945 </tr>
929 <tr>
946 <tr>
930 <th>parents</th>
947 <th>parents</th>
931 <td><a href="/file/d73db4d812ff/a">d73db4d812ff</a> </td>
948 <td><a href="/file/d73db4d812ff/a">d73db4d812ff</a> </td>
932 </tr>
949 </tr>
933 <tr>
950 <tr>
934 <th>children</th>
951 <th>children</th>
935 <td></td>
952 <td></td>
936 </tr>
953 </tr>
937 </table>
954 </table>
938
955
939 <div class="overflow">
956 <div class="overflow">
940 <div class="sourcefirst"> comparison</div>
957 <div class="sourcefirst"> comparison</div>
941 <div class="legend">
958 <div class="legend">
942 <span class="legendinfo equal">equal</span>
959 <span class="legendinfo equal">equal</span>
943 <span class="legendinfo delete">deleted</span>
960 <span class="legendinfo delete">deleted</span>
944 <span class="legendinfo insert">inserted</span>
961 <span class="legendinfo insert">inserted</span>
945 <span class="legendinfo replace">replaced</span>
962 <span class="legendinfo replace">replaced</span>
946 </div>
963 </div>
947
964
948 <table class="bigtable">
965 <table class="bigtable">
949 <thead class="header">
966 <thead class="header">
950 <tr>
967 <tr>
951 <th>2:d73db4d812ff</th>
968 <th>2:d73db4d812ff</th>
952 <th>3:20e80271eb7a</th>
969 <th>3:20e80271eb7a</th>
953 </tr>
970 </tr>
954 </thead>
971 </thead>
955
972
956 <tbody class="block">
973 <tbody class="block">
957
974
958 <tr id="l1">
975 <tr id="l1">
959 <td class="source delete"><a href="#l1"> 1</a> a</td>
976 <td class="source delete"><a href="#l1"> 1</a> a</td>
960 <td class="source delete"><a href="#l1"> </a> </td>
977 <td class="source delete"><a href="#l1"> </a> </td>
961 </tr>
978 </tr>
962 <tr id="l2">
979 <tr id="l2">
963 <td class="source delete"><a href="#l2"> 2</a> a</td>
980 <td class="source delete"><a href="#l2"> 2</a> a</td>
964 <td class="source delete"><a href="#l2"> </a> </td>
981 <td class="source delete"><a href="#l2"> </a> </td>
965 </tr>
982 </tr>
966 </tbody>
983 </tbody>
967 </table>
984 </table>
968
985
969 </div>
986 </div>
970 </div>
987 </div>
971 </div>
988 </div>
972
989
973
990
974
991
975 </body>
992 </body>
976 </html>
993 </html>
977
994
978
995
979 comparison not-modified file
996 comparison not-modified file
980
997
981 $ echo e > e
998 $ echo e > e
982 $ hg add e
999 $ hg add e
983 $ hg ci -m e
1000 $ hg ci -m e
984 $ echo f > f
1001 $ echo f > f
985 $ hg add f
1002 $ hg add f
986 $ hg ci -m f
1003 $ hg ci -m f
987 $ hg tip --template "{rev}:{node|short}\n"
1004 $ hg tip --template "{rev}:{node|short}\n"
988 5:41d9fc4a6ae1
1005 5:41d9fc4a6ae1
989 $ hg diff -c tip e
1006 $ hg diff -c tip e
990 $ hg parents --template "{rev}:{node|short}\n" -r tip
1007 $ hg parents --template "{rev}:{node|short}\n" -r tip
991 4:402bea3b0976
1008 4:402bea3b0976
992 $ hg parents --template "{rev}:{node|short}\n" -r tip e
1009 $ hg parents --template "{rev}:{node|short}\n" -r tip e
993 4:402bea3b0976
1010 4:402bea3b0976
994
1011
995 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/e'
1012 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/e'
996 200 Script output follows
1013 200 Script output follows
997
1014
998 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1015 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
999 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1016 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1000 <head>
1017 <head>
1001 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1018 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1002 <meta name="robots" content="index, nofollow" />
1019 <meta name="robots" content="index, nofollow" />
1003 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1020 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1004 <script type="text/javascript" src="/static/mercurial.js"></script>
1021 <script type="text/javascript" src="/static/mercurial.js"></script>
1005
1022
1006 <title>test: e comparison</title>
1023 <title>test: e comparison</title>
1007 </head>
1024 </head>
1008 <body>
1025 <body>
1009
1026
1010 <div class="container">
1027 <div class="container">
1011 <div class="menu">
1028 <div class="menu">
1012 <div class="logo">
1029 <div class="logo">
1013 <a href="https://mercurial-scm.org/">
1030 <a href="https://mercurial-scm.org/">
1014 <img src="/static/hglogo.png" alt="mercurial" /></a>
1031 <img src="/static/hglogo.png" alt="mercurial" /></a>
1015 </div>
1032 </div>
1016 <ul>
1033 <ul>
1017 <li><a href="/shortlog/tip">log</a></li>
1034 <li><a href="/shortlog/tip">log</a></li>
1018 <li><a href="/graph/tip">graph</a></li>
1035 <li><a href="/graph/tip">graph</a></li>
1019 <li><a href="/tags">tags</a></li>
1036 <li><a href="/tags">tags</a></li>
1020 <li><a href="/bookmarks">bookmarks</a></li>
1037 <li><a href="/bookmarks">bookmarks</a></li>
1021 <li><a href="/branches">branches</a></li>
1038 <li><a href="/branches">branches</a></li>
1022 </ul>
1039 </ul>
1023 <ul>
1040 <ul>
1024 <li><a href="/rev/tip">changeset</a></li>
1041 <li><a href="/rev/tip">changeset</a></li>
1025 <li><a href="/file/tip">browse</a></li>
1042 <li><a href="/file/tip">browse</a></li>
1026 </ul>
1043 </ul>
1027 <ul>
1044 <ul>
1028 <li><a href="/file/tip/e">file</a></li>
1045 <li><a href="/file/tip/e">file</a></li>
1029 <li><a href="/file/tip/e">latest</a></li>
1046 <li><a href="/file/tip/e">latest</a></li>
1030 <li><a href="/diff/tip/e">diff</a></li>
1047 <li><a href="/diff/tip/e">diff</a></li>
1031 <li class="active">comparison</li>
1048 <li class="active">comparison</li>
1032 <li><a href="/annotate/tip/e">annotate</a></li>
1049 <li><a href="/annotate/tip/e">annotate</a></li>
1033 <li><a href="/log/tip/e">file log</a></li>
1050 <li><a href="/log/tip/e">file log</a></li>
1034 <li><a href="/raw-file/tip/e">raw</a></li>
1051 <li><a href="/raw-file/tip/e">raw</a></li>
1035 </ul>
1052 </ul>
1036 <ul>
1053 <ul>
1037 <li><a href="/help">help</a></li>
1054 <li><a href="/help">help</a></li>
1038 </ul>
1055 </ul>
1039 </div>
1056 </div>
1040
1057
1041 <div class="main">
1058 <div class="main">
1042 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1059 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1043 <h3>
1060 <h3>
1044 comparison e @ 5:<a href="/rev/41d9fc4a6ae1">41d9fc4a6ae1</a>
1061 comparison e @ 5:<a href="/rev/41d9fc4a6ae1">41d9fc4a6ae1</a>
1045 <span class="tag">tip</span>
1062 <span class="tag">tip</span>
1046 </h3>
1063 </h3>
1047
1064
1048
1065
1049 <form class="search" action="/log">
1066 <form class="search" action="/log">
1050
1067
1051 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1068 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1052 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1069 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1053 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1070 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1054 </form>
1071 </form>
1055
1072
1056 <div class="description">f</div>
1073 <div class="description">f</div>
1057
1074
1058 <table id="changesetEntry">
1075 <table id="changesetEntry">
1059 <tr>
1076 <tr>
1060 <th>author</th>
1077 <th>author</th>
1061 <td>&#116;&#101;&#115;&#116;</td>
1078 <td>&#116;&#101;&#115;&#116;</td>
1062 </tr>
1079 </tr>
1063 <tr>
1080 <tr>
1064 <th>date</th>
1081 <th>date</th>
1065 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1082 <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
1066 </tr>
1083 </tr>
1067 <tr>
1084 <tr>
1068 <th>parents</th>
1085 <th>parents</th>
1069 <td><a href="/file/402bea3b0976/e">402bea3b0976</a> </td>
1086 <td><a href="/file/402bea3b0976/e">402bea3b0976</a> </td>
1070 </tr>
1087 </tr>
1071 <tr>
1088 <tr>
1072 <th>children</th>
1089 <th>children</th>
1073 <td></td>
1090 <td></td>
1074 </tr>
1091 </tr>
1075 </table>
1092 </table>
1076
1093
1077 <div class="overflow">
1094 <div class="overflow">
1078 <div class="sourcefirst"> comparison</div>
1095 <div class="sourcefirst"> comparison</div>
1079 <div class="legend">
1096 <div class="legend">
1080 <span class="legendinfo equal">equal</span>
1097 <span class="legendinfo equal">equal</span>
1081 <span class="legendinfo delete">deleted</span>
1098 <span class="legendinfo delete">deleted</span>
1082 <span class="legendinfo insert">inserted</span>
1099 <span class="legendinfo insert">inserted</span>
1083 <span class="legendinfo replace">replaced</span>
1100 <span class="legendinfo replace">replaced</span>
1084 </div>
1101 </div>
1085
1102
1086 <table class="bigtable">
1103 <table class="bigtable">
1087 <thead class="header">
1104 <thead class="header">
1088 <tr>
1105 <tr>
1089 <th>4:402bea3b0976</th>
1106 <th>4:402bea3b0976</th>
1090 <th>5:41d9fc4a6ae1</th>
1107 <th>5:41d9fc4a6ae1</th>
1091 </tr>
1108 </tr>
1092 </thead>
1109 </thead>
1093
1110
1094 </table>
1111 </table>
1095
1112
1096 </div>
1113 </div>
1097 </div>
1114 </div>
1098 </div>
1115 </div>
1099
1116
1100
1117
1101
1118
1102 </body>
1119 </body>
1103 </html>
1120 </html>
1104
1121
1105 $ cd ..
1122 $ cd ..
1106
1123
1107 test import rev as raw-rev
1124 test import rev as raw-rev
1108
1125
1109 $ hg clone -r0 test test1
1126 $ hg clone -r0 test test1
1110 adding changesets
1127 adding changesets
1111 adding manifests
1128 adding manifests
1112 adding file changes
1129 adding file changes
1113 added 1 changesets with 2 changes to 2 files
1130 added 1 changesets with 2 changes to 2 files
1114 new changesets 0cd96de13884
1131 new changesets 0cd96de13884
1115 updating to branch default
1132 updating to branch default
1116 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1133 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1117 $ cd test1
1134 $ cd test1
1118 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
1135 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1
1119
1136
1120 raw revision with diff block numbers
1137 raw revision with diff block numbers
1121
1138
1122 $ killdaemons.py
1139 $ killdaemons.py
1123 $ cat <<EOF > .hg/hgrc
1140 $ cat <<EOF > .hg/hgrc
1124 > [web]
1141 > [web]
1125 > templates = rawdiff
1142 > templates = rawdiff
1126 > EOF
1143 > EOF
1127 $ mkdir rawdiff
1144 $ mkdir rawdiff
1128 $ cat <<EOF > rawdiff/map
1145 $ cat <<EOF > rawdiff/map
1129 > mimetype = 'text/plain; charset={encoding}'
1146 > mimetype = 'text/plain; charset={encoding}'
1130 > changeset = '{diff}'
1147 > changeset = '{diff}'
1131 > difflineplus = '{line}'
1148 > difflineplus = '{line}'
1132 > difflineminus = '{line}'
1149 > difflineminus = '{line}'
1133 > difflineat = '{line}'
1150 > difflineat = '{line}'
1134 > diffline = '{line}'
1151 > diffline = '{line}'
1135 > filenodelink = ''
1152 > filenodelink = ''
1136 > filenolink = ''
1153 > filenolink = ''
1137 > fileline = '{line}'
1154 > fileline = '{line}'
1138 > diffblock = 'Block: {blockno}\n{lines}\n'
1155 > diffblock = 'Block: {blockno}\n{lines}\n'
1139 > EOF
1156 > EOF
1140 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1157 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1141 $ cat hg.pid >> $DAEMON_PIDS
1158 $ cat hg.pid >> $DAEMON_PIDS
1142 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
1159 $ get-with-headers.py localhost:$HGPORT 'raw-rev/0'
1143 200 Script output follows
1160 200 Script output follows
1144
1161
1145 Block: 1
1162 Block: 1
1146 diff -r 000000000000 -r 0cd96de13884 a
1163 diff -r 000000000000 -r 0cd96de13884 a
1147 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1164 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1148 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1165 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1149 @@ -0,0 +1,1 @@
1166 @@ -0,0 +1,1 @@
1150 +a
1167 +a
1151
1168
1152 Block: 2
1169 Block: 2
1153 diff -r 000000000000 -r 0cd96de13884 b
1170 diff -r 000000000000 -r 0cd96de13884 b
1154 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1171 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1155 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1172 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1156 @@ -0,0 +1,1 @@
1173 @@ -0,0 +1,1 @@
1157 +b
1174 +b
1158
1175
1159 $ killdaemons.py
1176 $ killdaemons.py
1160 $ rm .hg/hgrc rawdiff/map
1177 $ rm .hg/hgrc rawdiff/map
1161 $ rmdir rawdiff
1178 $ rmdir rawdiff
1162 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1179 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1163 $ cat hg.pid >> $DAEMON_PIDS
1180 $ cat hg.pid >> $DAEMON_PIDS
1164
1181
1165 errors
1182 errors
1166
1183
1167 $ cat ../test/errors.log
1184 $ cat ../test/errors.log
1168
1185
1169 $ cd ..
1186 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now