• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any java code for to commit the file/s dynamically in a folder?

 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12084
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Henry Wong
author
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Henry
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most systems allow copying/moving via wildcards as well anyway...

It's not really clear what problem you're trying to solve--and it's almost *certainly* not best solved with Java.
 
Mike Simmons
Ranch Hand
Posts: 3028
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Well, there's at least two Java SVN libraries, but it still doesn't seem like a good idea in this case.)
 
Henry Wong
author
Marshal
Pie
Posts: 20882
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Henry
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, right. *lol* I'm so over CVS don't even see it when it's right in front of me ;)

Wow, I'm really terrible sometimes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic