-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Populate it with svnexe, gitexe and JGit providers Co-authored-by: Michael Osipov <[email protected]>
- Loading branch information
Showing
15 changed files
with
495 additions
and
102 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,14 @@ | |
*/ | ||
package org.apache.maven.scm.command.info; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.time.temporal.TemporalAccessor; | ||
|
||
/** | ||
* Encapsulates meta information about a file (or directory) being managed with an SCM. | ||
* | ||
* For historical reasons the field/method names are inspired from (and sometimes only applicable to) the <a href="https://svnbook.red-bean.com/">Subversion SCM</a>. | ||
* | ||
* @author <a href="mailto:[email protected]">Kenney Westerhof</a> | ||
* @author Olivier Lamy | ||
* | ||
|
@@ -45,6 +52,8 @@ public class InfoItem { | |
|
||
private String lastChangedDate; | ||
|
||
private OffsetDateTime lastChangedDateTime; | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
@@ -117,11 +126,36 @@ public void setLastChangedRevision(String lastChangedRevision) { | |
this.lastChangedRevision = lastChangedRevision; | ||
} | ||
|
||
/** | ||
* @deprecated Use {@link #getLastChangedDateTime()} instead | ||
*/ | ||
@Deprecated | ||
public String getLastChangedDate() { | ||
return lastChangedDate; | ||
} | ||
|
||
/** | ||
* @deprecated Use {@link #setLastChangedDateTime(TemporalAccessor)} instead | ||
*/ | ||
@Deprecated | ||
public void setLastChangedDate(String lastChangedDate) { | ||
this.lastChangedDate = lastChangedDate; | ||
} | ||
|
||
/** | ||
* | ||
* @return the date when the file indicated via {@link #getPath()} has been changed in the SCM for the last time | ||
* @since 2.1.0 | ||
*/ | ||
public OffsetDateTime getLastChangedDateTime() { | ||
return lastChangedDateTime; | ||
} | ||
|
||
/** | ||
* @param accessor temporal accessor from which to populate the last changed date | ||
* @since 2.1.0 | ||
*/ | ||
public void setLastChangedDateTime(TemporalAccessor accessor) { | ||
this.lastChangedDateTime = OffsetDateTime.from(accessor); | ||
} | ||
} |
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
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
29 changes: 29 additions & 0 deletions
29
.../java/org/apache/maven/scm/provider/git/gitexe/command/info/GitExeInfoCommandTckTest.java
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,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.maven.scm.provider.git.gitexe.command.info; | ||
|
||
import org.apache.maven.scm.provider.git.GitScmTestUtils; | ||
import org.apache.maven.scm.provider.git.command.info.GitInfoCommandTckTest; | ||
|
||
public class GitExeInfoCommandTckTest extends GitInfoCommandTckTest { | ||
|
||
public String getScmUrl() throws Exception { | ||
return GitScmTestUtils.getScmUrl(getRepositoryRoot(), "git"); | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
...t/src/main/java/org/apache/maven/scm/provider/git/command/info/GitInfoCommandTckTest.java
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,33 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.maven.scm.provider.git.command.info; | ||
|
||
import org.apache.maven.scm.provider.git.GitScmTestUtils; | ||
import org.apache.maven.scm.tck.command.info.InfoCommandTckTest; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Mark Struberg</a> | ||
* | ||
*/ | ||
public abstract class GitInfoCommandTckTest extends InfoCommandTckTest { | ||
/** {@inheritDoc} */ | ||
public void initRepo() throws Exception { | ||
GitScmTestUtils.initRepo("src/test/resources/repository/", getRepositoryRoot(), getWorkingDirectory()); | ||
} | ||
} |
Oops, something went wrong.