Commit Graph

4 Commits

Author SHA1 Message Date
Yuya Nishihara
2db9374d13 templatekw: use common "rev:node" format as the default of predecessors
I'm not sure if this is better. If we're planning to add a template keyword
that returns obsoleted nodes unavailable in the repo (i.e. they have no valid
revision numbers), we might want to use the current "node"-only format
everywhere.
2017-06-17 13:34:18 +09:00
Yuya Nishihara
c3de10454c templatekw: populate all keywords depending on predecessor in map operation
This is what showparents() does. repo[precnode] should never fail since its
validity is tested by closestpredecessors().
2017-06-17 13:23:55 +09:00
Yuya Nishihara
5e5cff46c2 templatekw: reference predecessor node id as {node} in map operation
More predecessor-depending values will be populated by the next patch.
2017-06-17 13:18:03 +09:00
Boris Feld
6b02ddc020 template: add predecessors template
Add a 'predecessors' template that returns the list of all closest known
predecessors for a changectx. The elements of the list are row changectx node id
formatted by default as short nodes.

The "closest predecessors" are the first locally known revisions encountered
while, walking predecessors markers. For example:

  1) If a (A, (B)) markers exists and both A and B are locally known A is a
  closest predecessors of B.

  2) If a (A, (B)) and (B, (C)) markers exists and only A and C are known
  locally, A will be the closest precursors of C.

This logic respect repository filtering. So hidden revision will be skipped by
this logic unless --hidden is specified. Since we only display the visible
predecessors, this template will not display anything in most case. It makes a
good candidate for inclusion in the default log output.

I added a new test-file for testing the precursors in various scenarios. This
test file will also be used for the successors template.

A new "obsutil" module has been added to start gathering utility function
outside of the large obsolete.py module.
2017-06-15 13:02:58 +02:00