mercurial/templatekw.py
changeset 39796 94ca3579e84e
parent 39623 34ecc0a09c76
child 40474 2891ee3fcb86
child 41021 70e3e3da24be
--- a/mercurial/templatekw.py	Sat Sep 15 17:26:20 2018 +0900
+++ b/mercurial/templatekw.py	Sat Sep 15 17:26:21 2018 +0900
@@ -11,6 +11,8 @@
 from .node import (
     hex,
     nullid,
+    wdirid,
+    wdirrev,
 )
 
 from . import (
@@ -475,9 +477,10 @@
     ctx = context.resource(mapping, 'ctx')
     mnode = ctx.manifestnode()
     if mnode is None:
-        # just avoid crash, we might want to use the 'ff...' hash in future
-        return
-    mrev = repo.manifestlog.rev(mnode)
+        mnode = wdirid
+        mrev = wdirrev
+    else:
+        mrev = repo.manifestlog.rev(mnode)
     mhex = hex(mnode)
     mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
     f = context.process('manifest', mapping)