Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-beta-4
-
None
Description
As discussed on continuum-users:
http://www.nabble.com/Update-over-scm-local-does-not-delete-files-removed-from-source-dir-tf2257460.html#a6281593
Scm-local so far does not support incoming deletions. That means if you delete a file from the repository, it won't be deleted in your local working directory. This is a problem, e.g. if you use scm-local to connect Continuum to a ClearCase dynamic view. Files that are deleted from the repository will stay in Continuum's working directory and potentially cause the build to fail.
The solution is to let scm-local maintain a xml file .maven-scm-local that contains the list of files in the repository directory, as seen during the last checkout or update operation:
- During checkout, the file .maven-scm-local is created in the checkout base directory. Its an XML file containing the list of files that have been checked out.
- The update command looks for the file. If it is there, it compares the contents of that file to the current repository directory contents (including subdirs). All files that are in .maven-scm-local but are no longer in the repository dir, have been deleted in the repository dir. The update command therefore removes them from the checkout dir.
- If for whatever reason .maven-scm-local is not there, the update command won't delete any files. That way, we're backwards compatible.
- After completing the update process, the update command rewrites the .maven-scm-local metadata file.
The attached patch contains the implementation and test cases.