Aravinda Dassanayake
2013-09-03 15:55:26 UTC
Hi folks,
I am currently capturing the changes that happened to files in the
following approach. Basically, based on the SVNSTatusType, I am filling up
3 lists that hold added, changed and deleted files between 2 revisions
under a repo URL.
diffClient.doDiffStatus(url, start, url, end, SVNDepth.INFINITY, false,
new ISVNDiffStatusHandler() {
@Override
public void handleDiffStatus(final SVNDiffStatus
diffStatus) throws SVNException {
if (diffStatus.getKind() == SVNNodeKind.FILE) {
String ext =
getFileExtension(diffStatus.getURL());
if (extensions.contains(ext)) {
SVNStatusType status =
diffStatus.getModificationType();
if (status == SVNStatusType.STATUS_ADDED) {
addedFiles.add(diffStatus.getURL().toDecodedString());
} else if (status ==
SVNStatusType.STATUS_DELETED) {
deletedFiles.add(diffStatus.getURL().toDecodedString());
} else if (status ==
SVNStatusType.STATUS_MODIFIED) {
changedFiles.add(diffStatus.getURL().toDecodedString());
}
}
}
}
});
Now, I want to selectively add only the files that got affected during
direct check-ins, and not ones that came in during merge operations (coz I
felt that merged content is also getting counted. I wasn't sure if it was
coz things were really merged or if it was merged in a non-svn-merge
fashion by some file merge and direct checkins).
How do I capture whether an addition, change or a deletion is a result of a
merge or not following this approach? I see a property 'MERGED' as well in
SVNStatusType, and wondering if the above approach already has take care of
it.
-Aravinda
I am currently capturing the changes that happened to files in the
following approach. Basically, based on the SVNSTatusType, I am filling up
3 lists that hold added, changed and deleted files between 2 revisions
under a repo URL.
diffClient.doDiffStatus(url, start, url, end, SVNDepth.INFINITY, false,
new ISVNDiffStatusHandler() {
@Override
public void handleDiffStatus(final SVNDiffStatus
diffStatus) throws SVNException {
if (diffStatus.getKind() == SVNNodeKind.FILE) {
String ext =
getFileExtension(diffStatus.getURL());
if (extensions.contains(ext)) {
SVNStatusType status =
diffStatus.getModificationType();
if (status == SVNStatusType.STATUS_ADDED) {
addedFiles.add(diffStatus.getURL().toDecodedString());
} else if (status ==
SVNStatusType.STATUS_DELETED) {
deletedFiles.add(diffStatus.getURL().toDecodedString());
} else if (status ==
SVNStatusType.STATUS_MODIFIED) {
changedFiles.add(diffStatus.getURL().toDecodedString());
}
}
}
}
});
Now, I want to selectively add only the files that got affected during
direct check-ins, and not ones that came in during merge operations (coz I
felt that merged content is also getting counted. I wasn't sure if it was
coz things were really merged or if it was merged in a non-svn-merge
fashion by some file merge and direct checkins).
How do I capture whether an addition, change or a deletion is a result of a
merge or not following this approach? I see a property 'MERGED' as well in
SVNStatusType, and wondering if the above approach already has take care of
it.
-Aravinda