Mon Oct 3 04:47:34 UTC 2005 Alberto Bertogli * Use the real file if there's no pristine directory available. diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi --- old-darcsweb/darcsweb.cgi 2015-09-22 23:49:45.000000000 +0000 +++ new-darcsweb/darcsweb.cgi 2015-09-22 23:49:45.000000000 +0000 @@ -189,6 +189,12 @@ return 1 return 0 +def realpath(fname): + realf = filter_file(config.repodir + '/_darcs/current/' + fname) + if not os.path.exists(realf): + realf = filter_file(config.repodir + '/' + fname) + return realf + # # generic html functions @@ -254,14 +260,9 @@ summary | shortlog | log +| tree """ % { "myreponame": config.myreponame } - if os.path.isdir(config.repodir + '/_darcs/current/'): - # the current directory is missing if the --no-pristine-tree - # option was used in darcs get, so we only show the link if - # the directory exists - print '| tree' % config.myreponame - if h: print """ | commit @@ -269,7 +270,7 @@ | headdiff """ % { "myreponame": config.myreponame, 'hash': h } - realf = filter_file(config.repodir + '/_darcs/current/' + f) + realf = realpath(f) if f and h: print """ @@ -964,7 +965,7 @@ """ return - f = open(config.repodir + '/_darcs/current/' + fname, 'r') + f = open(realpath(fname), 'r') count = 1 for l in f: l = fixu8(escape(l)) @@ -1463,16 +1464,19 @@ """ - realpath = config.repodir + '/_darcs/current/' + dname + '/' + path = realpath(dname) + alt = False - files = os.listdir(realpath) + files = os.listdir(path) files.sort() # list directories first dlist = [] flist = [] for f in files: - realfile = realpath + f + if f == "_darcs": + continue + realfile = path + f if os.path.isdir(realfile): dlist.append(f) else: @@ -1485,7 +1489,7 @@ else: print '' alt = not alt - realfile = realpath + f + realfile = path + f print '' @@ -1545,7 +1549,7 @@ def do_plainblob(fname): print_plain_header() - f = open(config.repodir + '/_darcs/current/' + fname, 'r') + f = open(realpath(fname), 'r') for l in f: sys.stdout.write(fixu8(l))
', fperms(realfile), print '