maven-scm-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Bergner <>
Subject Howto determine if a directory is a valid working set of an SCM URL
Date Wed, 05 May 2010 09:13:17 GMT
Hi there. I'm using the SCM Plugin from within a Mojo and am trying to 
figure out how to determine if a given directory (D) is a working set of 
a given SCM URL (U).

The context is that I need to check out U or update it if it exists.
The plan is to
- check out U to D if D does not exist,
- update D if D is a valid working directory of U,
- display an error if D exists and is not a valid working directory of U.

What I tried is to call ScmManager.status(...), ScmManager.list(...) and 
ScmManager.changelog(...) and try to guess something from their results 
but that didn't work. The results from status() and changelog() always 
return something positive (isSuccess() = true, getChangedFiles() = valid 
List, no exceptions to catch), whereas list() throws an exception for me 
in any case.

The ideal solution would be independent of the actual SCM system and a 
specific ScmVersion.

Thanks for your help!


View raw message