As we do in version control systems, Can we do with java code to commit/checkin all files in a folder? If anyone have any idea please have share with me. I really appreciated your help.
you want to write java code that will commit all the files in a given directory to your version control system?
Doesn't your version control system allow wildcards?
Never ascribe to malice that which can be adequately explained by stupidity.
Simpson Kumar
Ranch Hand
Joined: Mar 19, 2008
Posts: 260
posted
0
Hi fred, please look into the following quotes
fred rosenberger wrote:you want to write java code that will commit all the files in a given directory to your version control system?
YES, Could you please give me any solution
fred rosenberger wrote:
Doesn't your version control system allow wildcards?
Actually we got some problems with our current CVS, in order to check in the code we need to first copy the all files to CVS location and commit with java code.
Actually we got some problems with our current CVS, in order to check in the code we need to first copy the all files to CVS location and commit with java code.
This doesn't make sense. CVS allows you to "check out" projects to your local machines. You can then make changes to those files, and submit the changes. There is no need to copy to a CVS location before you can submit.
And there is no need to commit with java code, you can either use the CVS command line interface -- or better yet, with most IDEs, you can have the IDE checkout, and submit the changes back for you.
The phrase "our current CVS" sounds odd here. Are you using CVS, which is a specific type of version control system (VCS)? Or are you using something else?
Kumar Kuchipudi wrote:Actually we got some problems with our current CVS, in order to check in the code we need to first copy the all files to CVS location and commit with java code.
According to whom? Has someone already solved this problem using Java code? Is there a boss somewhere saying "you must use Java" just because they've heard good things about Java?
The thing is, if you use Java code, you'll probably just have to do a Runtime.exec() or something similar, to execute a command to do the commit in a shell. Much like you would have done from the command line, or a script. But it will be harder because using exec() in Java has a bunch of hidden issues. You can do it, but in this case, why?
David Newton wrote:(Well, there's at least two Java SVN libraries, but it still doesn't seem like a good idea in this case.)
Agreed -- it doesn't seem like a good idea... but if you are going to do it, make sure you get a CVS library -- as CVS and SVN are two different source code control systems.