I finished visual inspection of the changes. Other than the one if statement, everything looks good to me.
Off the top of my head, maybe the isInteresting
method had the !resource.exists()
check to alert the user to tracked files that are missing in the source tree but not marked as removed in hg? Since that's sort of a "dirty" repository state (i.e. hg status
would report that as ! filenamehere
on command line). However, I have no idea if that's actually what it was doing, and I think that would probably only be relevant for uncommitted changesets anyway. Since it's not obvious why the code was checking the resource existence, I concur with your decision to remove that check.
I think this condition accidentally got inverted in the change to isEmpty
.
if (!changesets.isEmpty()) {
I have finished visual inspection of the changes. These changes look good to me.
The goal of this work is to provide the ability to export the known list of hg repositories from one workspace so that they can be imported in another workspace without having to manually recreate each repository in the second workspace.
I took the opportunity to perform some extensive refactoring, over SonarQube reports of code smells and other dubious code. This has the drawback that the actual code of this feature is lost among all those changes. I'll try to find a better way to incorporate such code cleaning actions.
In case you would prefer to let Java use the OS-specific line terminator, you could alternatively do writer.newLine();
here. That way, the output file would use \r\n
for Windows and \r
for Mac, instead of using \n
for all platforms.
writer.newLine();