mercurial/templatekw.py
changeset 27215 5b8da5643a8a
parent 27214 60af96494a76
child 27891 ac8c0ee5c3b8
equal deleted inserted replaced
27214:60af96494a76 27215:5b8da5643a8a
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from __future__ import absolute_import
     8 from __future__ import absolute_import
     9 
     9 
    10 from .node import hex
    10 from .node import hex, nullid
    11 from . import (
    11 from . import (
    12     error,
    12     error,
    13     hbisect,
    13     hbisect,
    14     patch,
    14     patch,
    15     scmutil,
    15     scmutil,
   341     return showlist('file', args['ctx'].files(), **args)
   341     return showlist('file', args['ctx'].files(), **args)
   342 
   342 
   343 def showgraphnode(repo, ctx, **args):
   343 def showgraphnode(repo, ctx, **args):
   344     """:graphnode: String. The character representing the changeset node in
   344     """:graphnode: String. The character representing the changeset node in
   345     an ASCII revision graph"""
   345     an ASCII revision graph"""
   346     wpnodes = [pctx.node() for pctx in repo[None].parents()]
   346     wpnodes = repo.dirstate.parents()
       
   347     if wpnodes[1] == nullid:
       
   348         wpnodes = wpnodes[:1]
   347     if ctx.node() in wpnodes:
   349     if ctx.node() in wpnodes:
   348         return '@'
   350         return '@'
   349     elif ctx.obsolete():
   351     elif ctx.obsolete():
   350         return 'x'
   352         return 'x'
   351     elif ctx.closesbranch():
   353     elif ctx.closesbranch():