-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-5347] Added use commit times on files #116
Open
ekesseler
wants to merge
3
commits into
jenkinsci:master
Choose a base branch
from
ekesseler:add-commit-times-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/resources/hudson/scm/SubversionSCM/help-usingCommitTimes.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div> | ||
<p>If set Jenkins will set the file timestamps to the last commit time (of each file) when doing a checkout or an update. Otherwise Jenkins will set the current date as the timestamp of each file.</p> | ||
<p> | ||
Normally the working copy files have timestamps that reflect the last time they were touched by any process. This is generally convenient for most build systems as they look at timestamps as a way of deciding which files need to be recompiled. | ||
In other situations, however, it's sometimes nice for the working copy files to have timestamps that reflect the last time they were changed in the repository. The svn export command always places these 'last-commit timestamps' on trees that it produces. | ||
See <a href="http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.advanced.confarea.opts.config">SVN Red Book</a> for more information. | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,9 @@ | |
|
||
import static hudson.scm.SubversionSCM.compareSVNAuthentications; | ||
import static org.jvnet.hudson.test.recipes.PresetData.DataSet.ANONYMOUS_READONLY; | ||
import static org.hamcrest.Matchers.is; | ||
import static org.hamcrest.Matchers.not; | ||
import static org.junit.Assert.assertThat; | ||
|
||
/** | ||
* @author Kohsuke Kawaguchi | ||
|
@@ -885,7 +888,7 @@ private void verifyChangelogFilter(boolean shouldFilterLog) throws Exception, | |
File repo = new CopyExisting(getClass().getResource("JENKINS-10449.zip")).allocate(); | ||
SubversionSCM scm = new SubversionSCM(ModuleLocation.parse(new String[]{"file://" + repo.toURI().toURL().getPath()}, | ||
new String[]{"."},null,null), | ||
new UpdateUpdater(), null, "/z.*", "", "", "", "", false, shouldFilterLog, null); | ||
new UpdateUpdater(), null, "/z.*", "", "", "", "", false, shouldFilterLog, null, false); | ||
|
||
FreeStyleProject p = createFreeStyleProject(String.format("testFilterChangelog-%s", shouldFilterLog)); | ||
p.setScm(scm); | ||
|
@@ -1706,4 +1709,44 @@ private void invokeTestPollingExternalsForFile() throws Exception { | |
// should detect change | ||
assertTrue(p.poll(StreamTaskListener.fromStdout()).hasChanges()); | ||
} | ||
|
||
/** | ||
* Test related to https://issues.jenkins-ci.org/browse/JENKINS-5347 | ||
* | ||
* @throws Throwable | ||
*/ | ||
public void testUseCommitTimes() throws Throwable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you create tests for a particular JIRA issue, it worth to reference it via comments or |
||
// Given a subversion workspace where the commit times should be used | ||
// When the workspace is checked out | ||
// Then verify that the last modified time stamp of the format file is 2010-12-31 | ||
|
||
FreeStyleProject p = createFreeStyleProject(); | ||
File repo = new CopyExisting(getClass().getResource("small.zip")).allocate(); | ||
SubversionSCM scm = new SubversionSCM(ModuleLocation.parse(new String[]{"file://" + repo.toURI().toURL().getPath()}, | ||
new String[]{"."}, null, null), new UpdateUpdater(), null, "/z.*", "", "", "", "", false, false, null, true); | ||
p.setScm(scm); | ||
FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0, new Cause.UserIdCause()).get()); | ||
// Using long matching to prevent Timezone issues, divided by 1000 as some OS does not return the exact milliseconds | ||
assertThat(b.getWorkspace().child("b").lastModified() / 1000, is(1293845528l)); | ||
} | ||
|
||
/** | ||
* Test related to https://issues.jenkins-ci.org/browse/JENKINS-5347 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, use the annotation |
||
* | ||
* @throws Throwable | ||
*/ | ||
public void testNotUseCommitTimes() throws Throwable { | ||
// Given a subversion workspace where the commit times should NOT be used | ||
// When the workspace is checked out | ||
// Then verify that the last modified time stamp of the format file NOT is 2011-01-01 | ||
|
||
FreeStyleProject p = createFreeStyleProject(); | ||
File repo = new CopyExisting(getClass().getResource("small.zip")).allocate(); | ||
SubversionSCM scm = new SubversionSCM(ModuleLocation.parse(new String[]{"file://" + repo.toURI().toURL().getPath()}, | ||
new String[]{"."}, null, null), new UpdateUpdater(), null, "/z.*", "", "", "", "", false, false, null, false); | ||
p.setScm(scm); | ||
FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0, new Cause.UserIdCause()).get()); | ||
// Using long matching to prevent Timezone issues, divided by 1000 as some OS does not return the exact milliseconds | ||
assertThat(b.getWorkspace().child("b").lastModified() / 1000, not(is(1293845528l))); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use the annotation
@Issue