Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334761 - [api] Method for retrieving changes of two changesets
Summary: [api] Method for retrieving changes of two changesets
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 330616
  Show dependency tree
 
Reported: 2011-01-19 06:23 EST by Kilian Matt CLA
Modified: 2011-01-21 04:51 EST (History)
2 users (show)

See Also:


Attachments
model used by the Mylyn Builds project (16.69 KB, image/png)
2011-01-19 23:32 EST, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kilian Matt CLA 2011-01-19 06:23:37 EST
For the reviews project we need a method for retrieving the changes introduced between two changesets.
Comment 1 Kilian Matt CLA 2011-01-19 08:43:57 EST
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...
}
Comment 2 Steffen Pingel CLA 2011-01-19 23:10:45 EST
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?
Comment 3 Steffen Pingel CLA 2011-01-19 23:32:15 EST
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;
}
Comment 4 Steffen Pingel CLA 2011-01-19 23:32:43 EST
Created attachment 187165 [details]
model used by the Mylyn Builds project
Comment 5 Kilian Matt CLA 2011-01-20 04:34:29 EST
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.
Comment 6 Steffen Pingel CLA 2011-01-20 14:46:51 EST
(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.
Comment 7 Kilian Matt CLA 2011-01-21 04:51:54 EST
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.
Comment 8 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
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