comparison mercurial/hgweb/webutil.py @ 6747:f6c00b17387c

use repo[changeid] to get a changectx
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Jun 2008 14:35:46 -0500
parents 101526031d06
children fb42030d79d6
comparison
equal deleted inserted replaced
6746:1dca460e7d1e 6747:f6c00b17387c
118 changeid = req.form['manifest'][0] 118 changeid = req.form['manifest'][0]
119 else: 119 else:
120 changeid = repo.changelog.count() - 1 120 changeid = repo.changelog.count() - 1
121 121
122 try: 122 try:
123 ctx = repo.changectx(changeid) 123 ctx = repo[changeid]
124 except RepoError: 124 except RepoError:
125 man = repo.manifest 125 man = repo.manifest
126 mn = man.lookup(changeid) 126 ctx = repo[man.linkrev(man.lookup(changeid))]
127 ctx = repo.changectx(man.linkrev(mn))
128 127
129 return ctx 128 return ctx
130 129
131 def filectx(repo, req): 130 def filectx(repo, req):
132 path = cleanpath(repo, req.form['file'][0]) 131 path = cleanpath(repo, req.form['file'][0])
133 if 'node' in req.form: 132 if 'node' in req.form:
134 changeid = req.form['node'][0] 133 changeid = req.form['node'][0]
135 else: 134 else:
136 changeid = req.form['filenode'][0] 135 changeid = req.form['filenode'][0]
137 try: 136 try:
138 ctx = repo.changectx(changeid) 137 fctx = repo[changeid][path]
139 fctx = ctx.filectx(path)
140 except RepoError: 138 except RepoError:
141 fctx = repo.filectx(path, fileid=changeid) 139 fctx = repo.filectx(path, fileid=changeid)
142 140
143 return fctx 141 return fctx