Include revision in View Diff summary head of files

Review Request #579 — Created Oct. 6, 2008 and discarded

Review Board SVN (deprecated)
Added revision id so that the file and rev is displayed at the top before the diffs. This is useful for _some_ SCMs that have integer per file version numbers. For some of the distributed SCM's this may not be so useful.

Raising review as a discussion point, see

Tested with SVN and another SCM (that uses integers for rev id's) that is not officially supported by ReviewBoard
  1. It looks like as-is, this will just format things in a system-agnostic way (<filename> <rev>). I wonder if there's a way to add some knowledge about the best way to format this, since each SCM has a "canonical" way of writing revision numbers.
    For example:
    SVN: <filename> r<rev>
    Perforce: <filename>#<rev>
    Git: <filename> <short-rev>...
    1. Nice idea, I guess we would need to sub-class core.Revision in each SCM implementation. Something along the lines of:
      class SVNRevision(Revision):
          def __init__(self, name):
     = name
          def __str__(self):
              ## NOTE, we should really use __unicode__
              return 'r%s' %
          def __eq__(self, other):
              return == str(other)
          def __ne__(self, other):
              return != str(other)
          def __repr__(self):
              return '<Revision: %s>' %
      I'm still a rookie with the code base though, my guess is that this would require some changes where ever Revision is instantiated.
    2. It would probably be less complex to just have a format_revision() function in the SCMTool for now.
    3. Any update on this?