Commit 2e5418cf authored by Steve Borho's avatar Steve Borho
Browse files

fileview: read symlink contents from revlog when possible

This still doesn't show symlink diffs, but these are not a high priority
for me.
parent 0d8cd9375c43
...@@ -560,8 +560,12 @@ class FileData(object): ...@@ -560,8 +560,12 @@ class FileData(object):
self.flabel += u'<b>%s</b>' % hglib.tounicode(wfile) self.flabel += u'<b>%s</b>' % hglib.tounicode(wfile)
absfile = repo.wjoin(wfile) absfile = repo.wjoin(wfile)
if os.path.islink(absfile): if (wfile in ctx and 'l' in ctx.flags(wfile)) or \
data = os.readlink(absfile) os.path.islink(absfile):
if wfile in ctx:
data = ctx[wfile].data()
else:
data = os.readlink(absfile)
self.contents = hglib.tounicode(data) self.contents = hglib.tounicode(data)
self.flabel += _(' <i>(is a symlink)</i>') self.flabel += _(' <i>(is a symlink)</i>')
return return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment