RE: Checking out specific revision

"David Hosier" <[email protected]> Wed, 6 Jul 2005 15:26:40 -0700
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Organization Longview Software
Message-ID <000e01c58279$c977c310$6701a8c0@DAVIDSDESKTOP>
Ok, so I found out about the -p option of the cvs checkout command and
figured that would work for me if I create a custom PrintStream to capture
the output into a StringBuffer.  So I tried to use the CheckoutCommand and
did setPipeToOutput(true).  When I try to do that for a single file, I get
the error:
 
cvs [server aborted]: must specify at least one module or directory
 
but when I specify a module, it tries to checkout the full module like it's
ignoring the fact that I used setFiles() to specify a single file and used
setCheckoutByRevision() to specify a specific revision of that file.
Furthermore, reading the javadoc for the assumeLocalPathWhenUnspecified()
method, it says "in checkout we operate with modules rather then files".
These two things together make me think that I cannot use the javacvs java
library to checkout a single file.  Is this the case?  If not, perhaps
someone can point me to something that I may be doing wrong.  Here is my
code in its entirety:
 
  PServerConnection p = new
PServerConnection(CVSRoot.parse(":pserver:lenny@squiggy:/lsftcvs"));
  p.setEncodedPassword(StandardScrambler.getInstance().scramble("blah"));
  p.verify();
  Client c = new Client(p, new StandardAdminHandler());
  
  c.setLocalPath("/java/eclipse/lsftcvs/javautils");
  c.getEventManager().addCVSListener(new BasicListener(System.out,
System.err));
  
  CheckoutCommand co = new CheckoutCommand();
  co.setFiles(new File[] {new File("/java/eclipse/lsftcvs/javautils",
"build.xml")});
  co.setPipeToOutput(true);
  co.setCheckoutByRevision("1.3");
  c.executeCommand(co, new GlobalOptions());
  


-----Original Message-----
From: David Hosier [mailto:[email protected]] 
Sent: Wednesday, July 06, 2005 8:22 AM
To: [email protected]
Subject: RE: [javacvs-dev] Checking out specific revision



Sorry if I wasn't clear enough, but I'm using the javacvs java library.  I'm
trying to program some actions using the library.  I'm not trying to figure
out how to use NetBeans the IDE.  So I wanted to know if there was some way
to get the contents of a revision into memory without having to use the
CheckoutCommand to check the file out into a temporary location and read the
file myself in code.  Thanks.

 


  _____  


From: Ulf Zibis [mailto:[email protected]] 
Sent: Wednesday, July 06, 2005 3:46 AM
To: [email protected]
Subject: Re: [javacvs-dev] Checking out specific revision

 

1. Hold the Ctrl.-key before you click the specific cvs-command, then you
will see the advanved options.
2. Use the cvs-diff-command with Ctrl-key to have a diff between the desired
revisions.

Hope that helps...

David Hosier schrieb:



Hello, I'm relatively new to using the netbeans cvs module.  Hopefully this
is the correct place to ask questions.  I want to checkout a specific
revision of a file in order to do a diff.  Is there a standard way of doing
this, i.e. do you just check the file out into a temporary location and read
it?  Or is there a way to read the file's contents into memory using the
javacvs library without having to write to the filesystem?  Thanks.

 

-David