[PATCH 1 of 5] committablectx: override hex() to return None

Sean Farley sean at farley.io
Tue Apr 7 11:44:35 CDT 2015


Yuya Nishihara <yuya at tcha.org> writes:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1428141006 -32400
> #      Sat Apr 04 18:50:06 2015 +0900
> # Node ID 6e0da90c09aab6f350afe167f176d37c4bb83a0e
> # Parent  b2fb1403994e033584aed8a487ab162a9d75fa80
> committablectx: override hex() to return None
>
> wctx.hex() crashed before because wctx.node() is None. It could be changed
> to return "{p1node}+" but I chose None for consistency with node().
> "{p1node}+" is sometimes useful, but not always. Machine-readable output such
> as XML does not want it and "|short" filter can't process "+" suffix.

Could we not just improve 'short' to handle '+'? We seem to have a
precedent with 'hg id' appending '+' and also with the actual node used
in the code. I'm unsure what to tell machine-readable output since they
still have to deal with it for 'hg id'.


More information about the Mercurial-devel mailing list