Hello everybody,
A main assumption in current implementation is that a revision is global
to the whole repository. This is however not the case with bazaar and
other distributed version control systems.
Additionally there is some unnecessary duplication of functionality in
the current api. For example, there are two ways to create a changeset
either from a Changeset.get_changes() from a Repository.get_changes().
In the first case path restriction is implemented by Trac, whereas in
the second it is implemented by the version control backend. This could
surely be avoided.
Let me do a summary of the functionality we have:
changeset displays all / some changes committed in a single revision
diff displays all / some changes committed over multiple revisions,
possibly between different paths
log lists all revision that modify a given path
source lists the inventory at a given revision
Suggestions:
1. Since a changeset is a special diff, Id suggest that they share
implementation in class Changeset.
2. Also, revision is currently just a string and that is insufficient
(e.g. to better implement bzr support) and IMHO wed better make a class
out of it. A revision would be a snapshot of (part of) the repository at
the time of a commit. Let that be the class Revision.
3. A Revision object could be extracted from a Repository from a
revision number (currently hex allowed) and path (to support bzr like
systems). The reason is that revno 100 at path1 would be different from
revno 100 at path2.
4. A Changeset would then be the difference between two nodes. A node is
a file or dir at a specific revision (as it is now). A changeset
(current implementation) would be the difference between '/' at revno 99
and '/' at revno 100.
To summarize, here are the classes with some of their methods:
Repository
get_revision (path, rev)
get_revisions (start, end)
Revision
properties: revno, message, time, author, etc.
get_node (path)
Changeset
create (node1, node2)
get_changes()
I plan to try this out with the bzr backend (Aaron Bentley's trac+bzr)
and would really appreciate if somebody gives me feedback, or even
better, works in parallel on the svn backend.
Regards,
Peter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---