[PATCH V2] revset: make id() to not abort on an unknown 40-byte string

Yuya Nishihara yuya at tcha.org
Tue Apr 14 10:30:32 CDT 2015


On Tue, 14 Apr 2015 18:15:57 +0300, Alexander Drozdov wrote:
> On Tue, 14 Apr 2015 22:25:33 +0900, FUJIWARA Katsunori wrote:
> > Alexander's work seems to be reversed approach of mine (I tried to
> > make "id()" and "rev()" abort for hidden/unknown revision).
> >
> >    http://selenic.com/pipermail/mercurial-devel/2015-March/067894.html
> >    http://selenic.com/pipermail/mercurial-devel/2015-March/067897.html
> >
> >  From the point of view of "equivalence between id() and rev()",
> > returning empty set for unknown/hidden revision seems reasonable.
> 
> The repository I'm working on use transplant/graft intensively. I'm trying to
> extend the 'default' template by printing 'transplant_source'/'source' extras
> with corresponded revision numbers. Some of the revisions stored in extras are
> not present in the repository, so I want to print the hexadecimal values only
> for them, without numbers. I think getting empty set by calling revset() from
> the template is the only way to do that now:
> {revset("id(%s)", get(extras, "source"))}. To make it to work right now I
> pass 'get(extras, "source")|short', but it looks ugly for me.

For now, you can use present() to silence RepoLookupError.


More information about the Mercurial-devel mailing list