Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
GitChangeSet |
|
| 1.0;1 |
1 | package org.apache.maven.scm.provider.git; | |
2 | ||
3 | /* | |
4 | * Licensed to the Apache Software Foundation (ASF) under one | |
5 | * or more contributor license agreements. See the NOTICE file | |
6 | * distributed with this work for additional information | |
7 | * regarding copyright ownership. The ASF licenses this file | |
8 | * to you under the Apache License, Version 2.0 (the | |
9 | * "License"); you may not use this file except in compliance | |
10 | * with the License. You may obtain a copy of the License at | |
11 | * | |
12 | * http://www.apache.org/licenses/LICENSE-2.0 | |
13 | * | |
14 | * Unless required by applicable law or agreed to in writing, | |
15 | * software distributed under the License is distributed on an | |
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
17 | * KIND, either express or implied. See the License for the | |
18 | * specific language governing permissions and limitations | |
19 | * under the License. | |
20 | */ | |
21 | ||
22 | import org.apache.maven.scm.ChangeFile; | |
23 | import org.apache.maven.scm.ChangeSet; | |
24 | import org.apache.maven.scm.provider.ScmProviderRepository; | |
25 | import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; | |
26 | import org.codehaus.plexus.util.StringUtils; | |
27 | ||
28 | import java.util.Date; | |
29 | import java.util.Iterator; | |
30 | import java.util.List; | |
31 | ||
32 | /** | |
33 | * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> | |
34 | * @version $Id: GitChangeSet.java 823147 2009-10-08 12:39:23Z struberg $ | |
35 | */ | |
36 | public class GitChangeSet | |
37 | extends ChangeSet | |
38 | { | |
39 | public GitChangeSet() | |
40 | { | |
41 | 0 | super(); |
42 | 0 | } |
43 | ||
44 | /** | |
45 | * @param strDate | |
46 | * @param userDatePattern | |
47 | * @param comment | |
48 | * @param author | |
49 | * @param files List of {@link ChangeFile} | |
50 | */ | |
51 | public GitChangeSet( String strDate, String userDatePattern, String comment, String author, List files ) | |
52 | { | |
53 | 0 | super( strDate, userDatePattern, comment, author, files ); |
54 | 0 | } |
55 | ||
56 | /** | |
57 | * @param date | |
58 | * @param comment | |
59 | * @param author | |
60 | * @param files List of {@link ChangeFile} | |
61 | */ | |
62 | public GitChangeSet( Date date, String comment, String author, List files ) | |
63 | { | |
64 | 0 | super( date, comment, author, files ); |
65 | 0 | } |
66 | ||
67 | /** {@inheritDoc} */ | |
68 | /*X TODO maybe we can drop the whole class? | |
69 | public boolean containsFilename( String filename, ScmProviderRepository repository ) | |
70 | { | |
71 | GitScmProviderRepository repo = (GitScmProviderRepository) repository; | |
72 | ||
73 | String url = repo.getUrl(); | |
74 | ||
75 | if ( !url.endsWith( "/" ) ) | |
76 | { | |
77 | url += "/"; | |
78 | } | |
79 | ||
80 | String currentFile = url + StringUtils.replace( filename, "\\", "/" ); | |
81 | ||
82 | if ( getFiles() != null ) | |
83 | { | |
84 | for ( Iterator i = getFiles().iterator(); i.hasNext(); ) | |
85 | { | |
86 | ChangeFile file = (ChangeFile) i.next(); | |
87 | ||
88 | if ( currentFile.endsWith( StringUtils.replace( file.getName(), "\\", "/" ) ) ) | |
89 | { | |
90 | return true; | |
91 | } | |
92 | } | |
93 | } | |
94 | ||
95 | return false; | |
96 | } | |
97 | */ | |
98 | } |