mercurial/hgweb/hgweb_mod.py
changeset 3405 970b2d6de3b3
parent 3402 372999405787
child 3406 03e7e8958a27
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -553,8 +553,8 @@ class hgweb(object):
     def filediff(self, fctx):
         n = fctx.node()
         path = fctx.path()
-        parents = fctx.changectx().parents()
-        p1 = parents[0].node()
+        parents = fctx.parents()
+        p1 = parents and parents[0].node() or nullid
 
         def diff(**map):
             yield self.diff(p1, n, [path])