# HG changeset patch # User Steve Losh # Date 1257713578 18000 # Node ID 272a76c50002dfe2d13eb0f421eac48edee91806 # Parent e1c8340a2a3a0dac524c6da7f649af471b4ff206 Fix a possible edge-case bug with {tip}. diff -r e1c8340a2a3a -r 272a76c50002 prompt.py --- a/prompt.py Sun Nov 08 15:50:53 2009 -0500 +++ b/prompt.py Sun Nov 08 15:52:58 2009 -0500 @@ -211,6 +211,7 @@ rev = parents[parent].rev() if parent is not None else -1 return _with_groups(out_g, str(rev)) if rev >= 0 else '' + def _tip(m): g = m.groups() out_g = (g[0],) + (g[-1],) @@ -218,9 +219,10 @@ format = short if '|short' in g else hex tip = repo[len(repo) - 1] + rev = tip.rev() tip = format(tip.node()) if '|node' in g else tip.rev() - return _with_groups(out_g, str(tip)) if tip >= 0 else '' + return _with_groups(out_g, str(tip)) if rev >= 0 else '' def _node(m): g = m.groups()