[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Streamy blame

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-09-20 22:18:10 CEST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch implements streamy blame. It is not ready to be committed,
but does pass the blame tests, except for 'blame -g'. I'm posting here
to get some feedback to see if the approach is sound and get feedback.
It is loosely based on Dan Berlin's patch here:
http://svn.haxx.se/dev/archive-2005-03/1036.shtml

Open issues:
 * The client requests file revs in reverse order. How does the client
   know it is actually getting them in reverse order? (pre-1.5 will
   still send them in forward order.)
   - Possible solution: An entirely new repos/ra API for this
     functionality.
 * I haven't yet tested the backwards compat functionality of
   old_blame() with the new data structures.
 * 'blame -g' is currently broken.
 * The client doesn't yet detect when it doesn't need more revisions,
   and therefore doesn't tell the server to stop sending them.
 * Not extensively tested, so it probably breaks on corner cases.

There are additional comments in the code.

Oh, one last thing: I really do think this is ultimately the right way
to go with our blame implementation. On the one hand, I'm concerned
that this is a lot more difficult that it appears at first blush, and I
don't want to postpone the 1.5 branch. On the other, we've already
rev'd the concerned APIs, and waiting will mean even more compat cruft
to carry around. Just a thought.

- -Hyrum

[[[
     *** THIS PATCH IS NOT READY TO BE COMMITTED ***
Implement streamy blame, by sending file revisions in backward order,
and using a reverse blaming algorithm on the client.

On the client, the basic idea is to maintain 2 blame chains, one for the
HEAD and one which changes as we process file diffs. As we go back in
time and lines get removed, chunks of the HEAD chain get marked final,
as chunks from the current chain get removed. Chunks which get added to
the current chain are inconsequential because they don't appear in HEAD.

Patch by: dberlin
          me

* subversion/libsvn_ra/wrapper_template.h,
  subversion/libsvn_ra/ra_loader.c,
  subversion/libsvn_ra/ra_loader.h,
  subversion/include/svn_ra.h,
  subversion/libsvn_ra_local/ra_plugin.c,
  subversion/libsvn_ra_serf/blame.c,
  subversion/libsvn_ra_serf/ra_serf.h,
  subversion/libsvn_ra_neon/file_revs.c,
  subversion/libsvn_ra_neon/ra_neon.h,
  subversion/mod_dav_svn/reports/file-revs.c,
  subversion/libsvn_ra_svn/client.c,
  subversion/svnserve/serve.c,
  subversion/include/svn_repos.h:
  Add an additional parameter, reverse, to svn_repos_get_file_revs2().
  Punch it through the various RA layers.

* subversion/libsvn_client/blame.c
  (struct blame): Add final flag.
  (struct blame_thing): New.
  (struct diff_baton): Add blame_thing, and rename revision member.
  (struct file_rev_baton): Add additional members.
  (create_thing): New.
  (blame_create): Take a blame_thing as input.
  (blame_find): Skip over final blame chunks.
  (blame_split): New.
  (blame_delete_range): Delete from the current chain, and mark sections
   of the head chain as final.
  (blame_insert_range): Use the current chain.
  (add_file_blame): Use a blame_thing to manage differences.
  (file_rev_handler): Update to use a blame_thing.
  (svn_client_blame4): Request revisions in reverse order.
  (old_blame): Update to use new data structures.

* subversion/libsvn_repos/rev_hunt.c
  (struct send_info_t): New.
  (find_interesting_revisions): Under certain conditions, send revisions
   immediately, instead of queuing them up to be sent later.
   interesting revisions.
  (send_revision_now): New.
  (send_revision_list): New.
  (forward_file_revs): New. A compatibility implementation for pre-1.5
   clients.
  (svn_repos_get_file_revs2): Set up the send_info data structure, and
   use find_interesting_revisions() to go through the history.
  (svn_repos_get_file_revs): Update wrapper.
]]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG8tWCCwOubk4kUXwRAqk7AJ97lIqxp5LG+zQSG2euNGpcbjUyNACgnRcT
7+m6JWRWDtyDBkYg2fq8pLQ=
=+zyU
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Sep 20 22:18:43 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.