The examples mention the existance of .mtime() but I have not managed to call it, or find it defined in the sources anyway.
I'm taking a look at this now. I'll try to write up an example showing what to do.
Add details-for-tree-entry
That example that's added shows how to do what you're looking to do.
The examples mention the existance of .mtime() but I have not managed to call it, or find it defined in the sources anyway.