{% for path, basename in node.iter_path_basename reversed %}
{% if forloop.last %}
{{ basename }}
{% else %}
{% ifnotequal repository.get_latest_revision revision %}
{{ basename }}
{% else %}
{{ basename }}
{% endifnotequal %}
{% endif %}
{% if not forloop.last %}/{% endif %}
{% endfor %}