RE: Checkout only one File by release or revision
"David Hosier" <[email protected]> Wed, 16 Nov 2005 07:34:05 -0800
| Newsgroups | gmane.comp.java.netbeans.modules.javacvs.devel |
|---|---|
| Organization | Longview Software |
| Message-ID | <[email protected]> |
------=_NextPart_000_0036_01C5EA80.21483160 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit For some crazy reason, you have to use the setModule() call instead of setFiles(). Try it and see if that works for you. Just pass the filename into the setModule() call. -David _____ From: Lippert, Sebastian [mailto:[email protected]] Sent: Wednesday, November 16, 2005 4:43 AM To: [email protected] Subject: [javacvs-dev] Checkout only one File by release or revision Hello, i am new here. I have a Problem with the Checkout of one specific file. I have tested the following command at the commandline and it works fine, but I can not post it with the API: D:\ACM\test2>cvs -d :pserver;username=Demo;password=00000000;hostname=da8szt02: /CVS-Module/Nimbus checkout -r DemoTag test2/test2.txt cvs checkout: cwd=D:\ACM\test2 ,current=D:\ACM\test2 U test2/test2.txt My code: CheckoutCommand command = new CheckoutCommand(); command.setBuilder(null); File file = new File("D:\\ACM\\test2", "test1.txt"); command.setFiles(new File[]{file}); command.setCheckoutByRevision("DemoTag"); command.setRecursive(false); try { client.executeCommand(command, this.globalOptions); } catch (AuthenticationException ex) { throw (Exception) ex; } catch (CommandException ex) { throw (Exception) ex; } Result: cvs [server aborted]: must specify at least one module or directory Thanks a lot! Regards Sebastian Lippert ------=_NextPart_000_0036_01C5EA80.21483160 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <title>[javacvs-dev] Checkout only one File by release or = revision</title> <style> <!-- /* Font Definitions */ @font-face {font-family:Courier; panose-1:2 7 4 9 2 2 5 2 4 4;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; font-size:12.0pt; font-family:"Times New Roman";} span.EmailStyle18 {mso-style-type:personal-reply; font-family:Arial; color:navy;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style> </head> <body lang=3DEN-US link=3Dblue vlink=3Dpurple> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>For some crazy reason, you have to = use the setModule() call instead of setFiles(). Try it and see if that = works for you. Just pass the filename into the setModule() = call.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>-David<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <div> <div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font = size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1> </span></font></div> <p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span = style=3D'font-size:10.0pt; font-family:Tahoma;font-weight:bold'>From:</span></font></b><font = size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'> = Lippert, Sebastian [mailto:[email protected]] <br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, November = 16, 2005 4:43 AM<br> <b><span style=3D'font-weight:bold'>To:</span></b> = [email protected]<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> [javacvs-dev] = Checkout only one File by release or revision</span></font><o:p></o:p></p> </div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> <p><font size=3D3 face=3DVerdana><span = style=3D'font-size:12.0pt;font-family:Verdana'>Hello, i am new here.</span></font> <br> <font face=3DVerdana><span = style=3D'font-family:Verdana'> </span></font> <br> <font face=3DVerdana><span style=3D'font-family:Verdana'>I have a = Problem with the Checkout of one specific file. </span></font><o:p></o:p></p> <p><font size=3D3 face=3DVerdana><span = style=3D'font-size:12.0pt;font-family:Verdana'>I have tested the following command at the commandline and it works fine, = but I can not post it with the API:</span></font> <o:p></o:p></p> <p><font size=3D3 face=3DCourier><span = style=3D'font-size:12.0pt;font-family:Courier'>D:\ACM\test2>cvs -d = :pserver;username=3DDemo;password=3D00000000;hostname=3Dda8szt02:</span><= /font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'>/CVS-Module/Nimbus checkout -r DemoTag test2/test2.txt</span></font> <o:p></o:p></p> <p><font size=3D3 face=3DCourier><span = style=3D'font-size:12.0pt;font-family:Courier'>cvs checkout: cwd=3DD:\ACM\test2 ,current=3DD:\ACM\test2</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>U = test2/test2.txt</span></font> <o:p></o:p></p> <p><font size=3D3 face=3DVerdana><span = style=3D'font-size:12.0pt;font-family:Verdana'>My code:</span></font> <o:p></o:p></p> <p><font size=3D3 face=3DCourier><span = style=3D'font-size:12.0pt;font-family:Courier'>CheckoutCommand command =3D new CheckoutCommand();</span></font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'>command.setBuilder(null);</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>File file =3D = new File("D:\\ACM\\test2", "test1.txt");</span></font> = <br> <font face=3DCourier><span = style=3D'font-family:Courier'>command.setFiles(new File[]{file});</span></font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'>command.setCheckoutByRevision("DemoTag= ");</span></font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'>command.setRecursive(false);</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>try = {</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>client.executeCommand(command, = this.globalOptions);</span></font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'> }</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>catch (AuthenticationException ex) {</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>throw (Exception) ex;</span></font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'> }</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>catch = (CommandException ex) {</span></font> <br> <font face=3DCourier><span style=3D'font-family:Courier'>throw (Exception) ex;</span></font> <br> <font face=3DCourier><span = style=3D'font-family:Courier'> } </span></font><o:p></o:p></p> <p><font size=3D3 face=3DVerdana><span = style=3D'font-size:12.0pt;font-family:Verdana'>Result:</span></font> <o:p></o:p></p> <p><font size=3D3 face=3DCourier><span = style=3D'font-size:12.0pt;font-family:Courier'>cvs [server aborted]: must specify at least one module or = directory</span></font> <o:p></o:p></p> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> <p><font size=3D3 face=3DVerdana><span = style=3D'font-size:12.0pt;font-family:Verdana'>Thanks a lot!</span></font> <o:p></o:p></p> <p><font size=3D3 face=3DVerdana><span = style=3D'font-size:12.0pt;font-family:Verdana'>Regards Sebastian Lippert </span></font><o:p></o:p></p> </div> </body> </html> ------=_NextPart_000_0036_01C5EA80.21483160--