Commit 142381 by jpetso

Commit #142381 by jpetso at 22:26
Version Control API: /modules/versioncontrol/commitlog/commitlog.module 1.41.2.6 @ DRUPAL-5--2
Version Control API: /modules/versioncontrol/versioncontrol-backend.inc 1.46.2.7 @ DRUPAL-5--2
Version Control API: /modules/versioncontrol/versioncontrol.install 1.35.2.3 @ DRUPAL-5--2
Version Control API: /modules/versioncontrol/versioncontrol.module 1.95.2.10 @ DRUPAL-5--2
Version Control API: /modules/versioncontrol/versioncontrol_fakevcs/versioncontrol_fakevcs.module 1.52.2.7 @ DRUPAL-5--2
jpetso saves the world *again*!
Here comes the destruction of the Last Difficult Problem that had to be
solved for the Version Control API's 2.x branch. Like, from an API design
point of view. Everything from here on will be a piece of cake,
so to speak. (Of course, there's still lots of work to do.)

Changes? You bet.
- Renamed the versioncontrol_add_whatever() function to
versioncontrol_fetch_whatever(), as the old names just didn't sound
intuitively at all. Especially when introducing
versioncontrol_add_item_revision_id()... NOT.
Everything that loads data into objects (or rather, arrays) and
modifies those rather than returning them as a result is "fetch" now.
Such as the versioncontrol_fetch_item_revision_id() helper function.
- Introduced versioncontrol_fetch_successor_items().
The opposite of versioncontrol_fetch_source_items().
- Major strike #1: Implemented versioncontrol_get_item_history()
in the API module! That means that a) it works for all backends
even if they don't implement on-the-fly file history parsers,
and b) we can assume bearable performance. The current implementation
is the naive one going from item to item, but the potential for large
performance gains is there. Oh, and c) you can limit the number
of returned items. Yay.
- Major strike #2: Got rid of the potential function overkill for
backends to retrieve selected labels. It's now two functions only -
[versioncontrol_backend]_get_selected_label_for_{operation,other_item}() -
and stuffs all the retrievals with related or non-related items
into that "from other item" function. Most important achievement,
keeps the API somewhat usable (although still complex, but that's
probably the price of abstraction and code reuse and stuff).
It struck me during lunch! (...)
- Renamed versioncontrol_get_commits() to versioncontrol_get_commit_operations(),
for consistency.
- Plus, as usual, a few fixes that I already forgot again.

So all the hard API problems are solved, I think. The remaining ones are
either relatively easy or stupid porting work, like for Commit Log.
Ok, so much for saving the world, now on to the boring non-VCS stuff again...