-
Improvement
-
Resolution: Fixed
-
Critical
-
None
-
Platform: All, OS: All
-
Powered by SuggestiMate
It is currently difficult to maintain (update) a trunk checkout with some
modules switched to a branch. With the "Use update" checkbox selected:
1. if Hudson is configured to check out the trunk (and a build script is used to
the switch some modules to a branch ), when it does an update it will use a -D
CVS option, which will switch the branched modules back to the trunk.
2. if Hudson is configured to check out the the branched modules (and the rest
of the modules is checked out by the build script), when it does an update it
will switch everything to the branch because it will use a -r option for all
modules.
The option to turn off -D described in issue 229 would help if Hudson was
configured as in #1, but generate no changelogs for the branched modules.
I suggest the introduction of an option to allow Hudson to update just the
modules specified in the "Module(s)" list. The UI could change from
[x] Use update
to
[x] Use update [x] only for the above modules
Of course, when the "only above modules" check box is selected, updating any
other modules in the workspace should be done by the user e.g. in the build script.
[JENKINS-528] An option to update just the specified modules
As an user I find "[ ] only for the above modules" confusing — it wouldn't
occur to me that Hudson automatically updates everything by default.
The negation has a less of that problem, I think:
[ ] Use update [ ] including modules that the build checked out
But more importantly, I think Hudson should do this right without requiring one
more option. From what I understand in the e-mail thread
(http://www.nabble.com/Project-with-mixed-trunk-and-branch-checkout-tf3669209.html),
the only issue is that we are not computing changelogs correctly.
I agree that the checkbox looks better with a positive aspect.
Doing this automatically (without an explicit option) could be tricky. The
algorithm would I guess be something like this (dealing only with "legacy" mode
and update mode):
String b; // HEAD or branch name specified in prj config
String[] mods; // list of modules, possibly incl '/', listed in prj config
File workdir;
Map<String,String[]> contents = empty; // branch -> (sub)module in actual wd
for (mod : mods) contents[b] = mod;
void recurse(File dir, String prefix) {
for (n : dir.list()) {
path = prefix + n;
subdir = dir + n;
if (grep
mods)
{ // check inside this dir recurse(subdir, path + '/'); }else
{ // assumed to be all one branch - otherwise diffs will get clobbered contents[readCvsTag(subdir)] = path; } }
}
recurse(workdir, '');
for ((branch, dirs) : contents) {
update(branch, dirs);
}
for ((branch, dirs) : contents) {
log(branch, dirs);
}
There are probably some subtleties missing in the above, such as handling of
files (not dirs) which are siblings of branched subdirs.
A more extreme algorithm would actually ignore the project settings (b & mods)
entirely when working on an existing checkout, and discover the branch of every
dir in the workdir by doing a full scan. This would be the most flexible. On the
other hand, (1) it might be slow to read all those CVS/Tags files (though
certainly much faster than the CVS update itself, so maybe not relevant); (2)
there is the risk that a typical, simple project (all one branch) could
accumulate accidental branchings over time, if some haywire build step or CVS
error changed the tag somewhere.
I agree with the positive aspect of the check box too. I suggested it the way I
did because unselected it is backwards-compatible with the current behavior. But
it can of course be positive and selected by default.
I don't think the only issue is the changelogs not being computed correctly.
Another issues is that Hudson will also switch all the modules to either a
branch or a trunk. See for example the log for the "j2ee" module:
http://deadlock.nbextras.org/hudson/job/merged_model_j2ee/121/consoleText
All those "is no longer in the repository" messages are caused by Hudson
switching the module to the trunk (which doesn't contain those files, they are
on the branch only). Currently I work around this by switching the modules back
to the branch in the build script.
If the modules are updated "the right way" according to the project
configuration or the CVS/Tag, Hudson could also easily make it possible to set
up more than one CVS operation in the project configuration, and it would be
able to update the result correctly, even if the operations overlap (e.g., the
"j2ee" module is checked out from the trunk, but the "j2ee/ddapi" directory is
checked out from a branch). This is not doable with the current asumption that
the whole workspace is either from the trunk or a branch.
I do not find this issue important anymore either. Feel free to close if you want.
Code changed in jenkins
User: mc1arke
Path:
pom.xml
src/main/java/hudson/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/CVSEntry.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/CvsUser.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/RCSFile.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/RedirectingOutputStream.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/RedirectingStreamHandler.java
src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/package.html
src/main/java/hudson/scm/CVSChangeLogParser.java
src/main/java/hudson/scm/CVSChangeLogSet.java
src/main/java/hudson/scm/CVSRepositoryBrowser.java
src/main/java/hudson/scm/CVSSCM.java
src/main/java/hudson/scm/CvsChangeLogHelper.java
src/main/java/hudson/scm/CvsChangeSet.java
src/main/java/hudson/scm/CvsFile.java
src/main/java/hudson/scm/CvsModule.java
src/main/java/hudson/scm/CvsModuleLocation.java
src/main/java/hudson/scm/CvsModuleLocationType.java
src/main/java/hudson/scm/CvsRepository.java
src/main/java/hudson/scm/CvsRevisionState.java
src/main/java/hudson/scm/ExcludedRegion.java
src/main/java/hudson/scm/LegacyConvertor.java
src/main/java/hudson/scm/MailAddressResolverImpl.java
src/main/java/hudson/scm/cvstagging/CvsTagAction.java
src/main/java/hudson/scm/cvstagging/CvsTagActionDescriptor.java
src/main/java/hudson/scm/cvstagging/CvsTagActionWorker.java
src/main/java/hudson/scm/cvstagging/LegacyTagAction.java
src/main/resources/hudson/scm/CVSSCM/DescriptorImpl/enterPassword.jelly
src/main/resources/hudson/scm/CVSSCM/DescriptorImpl/versionCheckError.jelly
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_de.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_fr.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_ja.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_nl.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_pt_BR.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_ru.html
src/main/resources/hudson/scm/CVSSCM/TagAction/help-tagAll_tr.html
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm.jelly
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_de.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_es.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_fr.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_ja.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_nl.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_pt_BR.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_ru.properties
src/main/resources/hudson/scm/CVSSCM/TagAction/tagForm_tr.properties
src/main/resources/hudson/scm/CVSSCM/config.jelly
src/main/resources/hudson/scm/CVSSCM/config.properties
src/main/resources/hudson/scm/CVSSCM/global.jelly
src/main/resources/hudson/scm/CVSSCM/help-allModules.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_de.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_fr.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_ja.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_nl.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_pt_BR.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_ru.html
src/main/resources/hudson/scm/CVSSCM/help-allModules_tr.html
src/main/resources/hudson/scm/CVSSCM/help-branch.html
src/main/resources/hudson/scm/CVSSCM/help-branch_de.html
src/main/resources/hudson/scm/CVSSCM/help-branch_fr.html
src/main/resources/hudson/scm/CVSSCM/help-branch_ja.html
src/main/resources/hudson/scm/CVSSCM/help-branch_nl.html
src/main/resources/hudson/scm/CVSSCM/help-branch_pt_BR.html
src/main/resources/hudson/scm/CVSSCM/help-branch_ru.html
src/main/resources/hudson/scm/CVSSCM/help-branch_tr.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_de.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_fr.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_ja.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_nl.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_pt_BR.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_ru.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_tr.html
src/main/resources/hudson/scm/CVSSCM/help-cvsExe_zh_CN.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_de.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_fr.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_ja.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_nl.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_pt_BR.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_ru.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRoot_tr.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_de.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_fr.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_ja.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_nl.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_pt_BR.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_ru.html
src/main/resources/hudson/scm/CVSSCM/help-cvsRsh_tr.html
src/main/resources/hudson/scm/CVSSCM/help-cvspassFile.html
src/main/resources/hudson/scm/CVSSCM/help-cvspassFile_de.html
src/main/resources/hudson/scm/CVSSCM/help-cvspassFile_fr.html
src/main/resources/hudson/scm/CVSSCM/help-cvspassFile_ja.html
src/main/resources/hudson/scm/CVSSCM/help-cvspassFile_zh_CN.html
src/main/resources/hudson/scm/CVSSCM/help-disableCvsQuiet.html
src/main/resources/hudson/scm/CVSSCM/help-excludedRegions.html
src/main/resources/hudson/scm/CVSSCM/help-excludedRegions_de.html
src/main/resources/hudson/scm/CVSSCM/help-excludedRegions_fr.html
src/main/resources/hudson/scm/CVSSCM/help-excludedRegions_ja.html
src/main/resources/hudson/scm/CVSSCM/help-pruneEmptyDirectories.html
src/main/resources/hudson/scm/CVSSCM/help-skipChangeLog.html
src/main/resources/hudson/scm/CVSSCM/help-useHeadIfNotFound.html
src/main/resources/hudson/scm/CVSSCM/help-useHeadIfNotFound_de.html
src/main/resources/hudson/scm/CvsModule/config.jelly
src/main/resources/hudson/scm/CvsModule/config.properties
src/main/resources/hudson/scm/CvsModule/config_de.properties
src/main/resources/hudson/scm/CvsModule/config_es.properties
src/main/resources/hudson/scm/CvsModule/config_fr.properties
src/main/resources/hudson/scm/CvsModule/config_ja.properties
src/main/resources/hudson/scm/CvsModule/config_nl.properties
src/main/resources/hudson/scm/CvsModule/config_pt_BR.properties
src/main/resources/hudson/scm/CvsModule/config_ru.properties
src/main/resources/hudson/scm/CvsModule/config_tr.properties
src/main/resources/hudson/scm/CvsModule/help-branchName.html
src/main/resources/hudson/scm/CvsModule/help-localName.html
src/main/resources/hudson/scm/CvsModule/help-remoteName.html
src/main/resources/hudson/scm/CvsModule/help-tagName.html
src/main/resources/hudson/scm/CvsModule/help-useHeadIfNotFound.html
src/main/resources/hudson/scm/CvsModule/help-useHeadIfNotFound_de.html
src/main/resources/hudson/scm/CvsModuleLocation/BranchModuleLocation/config.jelly
src/main/resources/hudson/scm/CvsModuleLocation/HeadModuleLocation/config.jelly
src/main/resources/hudson/scm/CvsModuleLocation/TagModuleLocation/config.jelly
src/main/resources/hudson/scm/CvsRepository/config.jelly
src/main/resources/hudson/scm/CvsRepository/config.properties
src/main/resources/hudson/scm/CvsRepository/config_de.properties
src/main/resources/hudson/scm/CvsRepository/config_es.properties
src/main/resources/hudson/scm/CvsRepository/config_fr.properties
src/main/resources/hudson/scm/CvsRepository/config_ja.properties
src/main/resources/hudson/scm/CvsRepository/config_nl.properties
src/main/resources/hudson/scm/CvsRepository/config_pt_BR.properties
src/main/resources/hudson/scm/CvsRepository/config_ru.properties
src/main/resources/hudson/scm/CvsRepository/config_tr.properties
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_de.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_fr.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_ja.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_nl.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_pt_BR.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_ru.html
src/main/resources/hudson/scm/CvsRepository/help-cvsRoot_tr.html
src/main/resources/hudson/scm/CvsRepository/help-excludedRegions.html
src/main/resources/hudson/scm/CvsRepository/help-excludedRegions_de.html
src/main/resources/hudson/scm/CvsRepository/help-excludedRegions_fr.html
src/main/resources/hudson/scm/CvsRepository/help-excludedRegions_ja.html
src/main/resources/hudson/scm/ExcludedRegion/config.jelly
src/main/resources/hudson/scm/cvs/Messages.properties
src/main/resources/hudson/scm/cvs/Messages_de.properties
src/main/resources/hudson/scm/cvs/Messages_es.properties
src/main/resources/hudson/scm/cvs/Messages_fr.properties
src/main/resources/hudson/scm/cvs/Messages_ja.properties
src/main/resources/hudson/scm/cvs/Messages_nl.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_de.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_fr.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_ja.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_nl.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_pt_BR.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_ru.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/help-tagAll_tr.html
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm.jelly
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_de.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_es.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_fr.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_ja.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_nl.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_pt_BR.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_ru.properties
src/main/resources/hudson/scm/cvstagging/CvsTagAction/tagForm_tr.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_de.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_fr.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_ja.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_nl.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_pt_BR.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_ru.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/help-tagAll_tr.html
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm.jelly
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_de.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_es.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_fr.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_ja.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_nl.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_pt_BR.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_ru.properties
src/main/resources/hudson/scm/cvstagging/LegacyTagAction/tagForm_tr.properties
src/test/java/hudson/scm/CVSSCMTest.java
src/test/java/hudson/scm/CvsChangeLogHelperTest.java
http://jenkins-ci.org/commit/cvs-plugin/1c6ddef1e5c1c3fe9f1a236fe4cc3aa336b8ca21
Log:
Merge pull request #5 from mc1arke/master
Overhaul of the cvs plugin
Changes:
- Allowing checking out modules from different branch/tags in a single repository (
JENKINS-768,JENKINS-6812) - Allowing multiple repositories in a single job i.e. multiple CVS roots (
JENKINS-2638) - Using a Java CVS Library rather than depend on a system library (
JENKINS-49,JENKINS-3848,JENKINS-3756,JENKINS-1676) - Use 'rlog' for polling and change-log generation and 'rtag' for tagging (
JENKINS-6312,JENKINS-10981,JENKINS-11787,JENKINS-1847,JENKINS-1359,JENKINS-76,JENKINS-9809,JENKINS-2710,JENKINS-5744,JENKINS-4604) - Restrict CVS to only check-out configured modules and not other CVS items in the workspace (
JENKINS-7449,JENKINS-2345,JENKINS-4489,JENKINS-1638,JENKINS-528) - Add check-box to allow disabling change-log generation per project (
JENKINS-3979) - Leave CVS/Entries contents in their original encoding (
JENKINS-4241,JENKINS-2614) - Making CVS Prune (-p parameter) optional through job configuration (
JENKINS-1013) - Improving warnings and validation (
JENKINS-9670,JENKINS-9045,JENKINS-7407,JENKINS-3133) - Fixing cyclic dependency with subversion plugin in POM (
JENKINS-10370) - Fixing 'after-the-fact' tagging of builds (
JENKINS-8128) - Improved date format on CVS commands (
JENKINS-6119,JENKINS-7833) - Allowing macro/parameter expansion on input fields (
JENKINS-2318,JENKINS-3821) - Fixing missing CVS change log entries when 'use head if not found' is used (
JENKINS-12104)
Potentially also fixes:
JENKINS-1737: Alternative Quiet Period Implementation (untested - updated polling should fix this)
JENKINS-10843: CVS Update (defect is unclear)
JENKINS-427: Cannot check out alias modules from CVS (untested - using rlog should fix this)
It's probably worth updating the version number in the POM to 2.0 given the number/scale of these changes, although this hasn't been included as part of this request.
Compare: https://github.com/jenkinsci/cvs-plugin/compare/7b57474...1c6ddef
As of version 2.0, cvs plugin now only updates modules specified in the config rather than the whole workspace. This means any modules checkout out by scripts retain their existing state.
I guess this is sort of my fault since I put in a patch to update (and log)
everything in the working dir. Which, for other kinds of projects, is quite
useful. But I guess it needs to be an option.