##// END OF EJS Templates
hgweb: add hook for remapping repository path into virtual paths...
Martin Geisler -
r16448:e6b45e9a default
parent child Browse files
Show More
@@ -303,6 +303,14 b' def changeset(web, req, tmpl):'
303
303
304 rev = changeset
304 rev = changeset
305
305
306 def decodepath(path):
307 """Hook for mapping a path in the repository to a path in the
308 working copy.
309
310 Extensions (e.g., largefiles) can override this to remap files in
311 the virtual file system presented by the manifest command below."""
312 return path
313
306 def manifest(web, req, tmpl):
314 def manifest(web, req, tmpl):
307 ctx = webutil.changectx(web.repo, req)
315 ctx = webutil.changectx(web.repo, req)
308 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
316 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
@@ -318,13 +326,17 b' def manifest(web, req, tmpl):'
318 l = len(path)
326 l = len(path)
319 abspath = "/" + path
327 abspath = "/" + path
320
328
321 for f, n in mf.iteritems():
329 for full, n in mf.iteritems():
330 # the virtual path (working copy path) used for the full
331 # (repository) path
332 f = decodepath(full)
333
322 if f[:l] != path:
334 if f[:l] != path:
323 continue
335 continue
324 remain = f[l:]
336 remain = f[l:]
325 elements = remain.split('/')
337 elements = remain.split('/')
326 if len(elements) == 1:
338 if len(elements) == 1:
327 files[remain] = f
339 files[remain] = full
328 else:
340 else:
329 h = dirs # need to retain ref to dirs (root)
341 h = dirs # need to retain ref to dirs (root)
330 for elem in elements[0:-1]:
342 for elem in elements[0:-1]:
General Comments 0
You need to be logged in to leave comments. Login now