cvs tag -F (patch)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

cvs tag -F (patch)

Benoit Decherf
Hi,

As I told you in scm-users list (12/07), I need to disable the -F option
in cvs tag.
I make a patch to add the option useForceTag. This works, but in case of
a conflict with an existing flag, the cvs tag won't failed. (the tag is
not set). Is this acceptable ?
Or maybe I should check for Warning messages in the output and the
command should fail if there are any warnings ?

Benoit

Index: maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/mdo/cvs-settings.mdo
===================================================================
--- maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/mdo/cvs-settings.mdo (revision 602747)
+++ maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/mdo/cvs-settings.mdo (working copy)
@@ -70,6 +70,15 @@
             <multiplicity>*</multiplicity>
           </association>
         </field>
+        <field>
+          <name>useForceTag</name>
+          <version>1.0.0+</version>
+          <type>boolean</type>
+          <defaultValue>true</defaultValue>
+          <description><![CDATA[
+             Move tag if it already exists.
+          ]]></description>
+        </field>
       </fields>
     </class>
   </classes>
Index: maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.java
===================================================================
--- maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.java (revision 602747)
+++ maven-scm-providers/maven-scm-providers-cvs/maven-scm-provider-cvs-commons/src/main/java/org/apache/maven/scm/provider/cvslib/command/tag/AbstractCvsTagCommand.java (working copy)
@@ -28,6 +28,8 @@
 import org.apache.maven.scm.provider.cvslib.command.CvsCommand;
 import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils;
 import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository;
+import org.apache.maven.scm.provider.cvslib.util.CvsUtil;
+import org.apache.maven.scm.providers.cvslib.settings.Settings;
 import org.codehaus.plexus.util.cli.Commandline;
 
 /**
@@ -45,8 +47,11 @@
         CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
 
         Commandline cl = CvsCommandUtils.getBaseCommand( "tag", repository, fileSet, false );
+ Settings settings = CvsUtil.getSettings();
 
-        cl.createArgument().setValue( "-F" );
+
+ if(settings.isUseForceTag())
+        cl.createArgument().setValue( "-F" );
 
         cl.createArgument().setValue( "-c" );
 
Reply | Threaded
Open this post in threaded view
|

Re: cvs tag -F (patch)

Emmanuel Venisse-2
Please, attach your patch to an issue and I'll look at it when I'll found some time.

Thanks.
Emmanuel

Benoit Decherf a écrit :

> Hi,
>
> As I told you in scm-users list (12/07), I need to disable the -F option
> in cvs tag.
> I make a patch to add the option useForceTag. This works, but in case of
> a conflict with an existing flag, the cvs tag won't failed. (the tag is
> not set). Is this acceptable ?
> Or maybe I should check for Warning messages in the output and the
> command should fail if there are any warnings ?
>
> Benoit
>
Reply | Threaded
Open this post in threaded view
|

Re: cvs tag -F (patch)

Benoit Decherf
I add the issue with the patch: http://jira.codehaus.org/browse/SCM-361

I let the priority to major as we need it and we will have to use the
patched version in my company. If you thinks that this solution is not
good enough, please tell me how this feature has to be implemented.

Thanks.
Benoit

Emmanuel Venisse wrote:

> Please, attach your patch to an issue and I'll look at it when I'll
> found some time.
>
> Thanks.
> Emmanuel
>
> Benoit Decherf a écrit :
>> Hi,
>>
>> As I told you in scm-users list (12/07), I need to disable the -F
>> option in cvs tag.
>> I make a patch to add the option useForceTag. This works, but in case
>> of a conflict with an existing flag, the cvs tag won't failed. (the
>> tag is not set). Is this acceptable ?
>> Or maybe I should check for Warning messages in the output and the
>> command should fail if there are any warnings ?
>>
>> Benoit
>>