Community
Participate
Working Groups
For the reviews project we need a method for retrieving the changes introduced between two changesets.
The method would look similiar to this: ChangeSetDiff ScmCore.calculateChanges(ChangeSet base, ChangeSet target, IProgressMonitor monitor); class ChangeSetDiff { ChangeSet base; ChangeSet target; List<ArtififactDiff> changes; } class ArtifactDiff { // has a method that can be used to fill a compare editor // maybe ChangeType... }
My first thought was that a ChangeSet should object represent exactly that. Maybe a ChangeSet should hold onto Changes that describe what happened linking back to Artifacts?
To be more concrete, I was thinking of something along these lines: // groups a list of changes identified by the same commit message, author and time class ChangeSet { ScmRepository repository; List<Change> changes; String message; Date date; ... } // describes a change to a single file class Change { ArtifactRevision base; ArtifactRevision target; ChangeType type; ... } // uniquely identifies a file revision in the repository, similar to IFileRevision class ArtifactRevision { String path; String revision; }
Created attachment 187165 [details] model used by the Mylyn Builds project
Yeah that would work and would be something we could use to solve bug 334759 by just providing this model. In this bug I was proposing a method for comparing two arbitrary changesets like in svn revision 123 with revision 456, so in that case I would return a list of Change objects - as that method call of comparing two changesets isn't exactly a changeset itself.
(In reply to comment #5) > In this bug I was proposing a method for comparing two arbitrary changesets > like in svn revision 123 with revision 456, so in that case I would return a > list of Change objects - as that method call of comparing two changesets isn't > exactly a changeset itself. If you are comparing two svn revisions couldn't this be represented with a ChangeSet object? Each change would reference how an artifact changed between the base and target revision. If you wanted to get all changes I would expect a method that returns a list of ChangeSets or Change objects given two revisions. Maybe I am not understanding the requirements but unless there is a compelling reason for introducing another model class to represent the differences between two change sets I would lean towards reusing or generalizing the existing classes.
Well I was thinking that a changeset represents exactly one commit in the repository (except that proposed cvs workaround). Using it for a comparision of two different revisions is in my opinion not a good idea. It would be better to extract some common interface or base class for a changeset and that compare revision object. Besides that I could think of one use case for returning a list of all changesets between two revision - the generic implementation for task-changeset mapping would need pretty much that.
Mylyn has been restructured, and our issue tracking has moved to GitHub [1]. We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub. [1] https://github.com/orgs/eclipse-mylyn