How to automate check outs from version control?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to automate check outs from version control?
# 1  
Old 04-10-2008
How to automate check outs from version control?

I'm in a fustrating situation where I am repeatidly checking code, editing,
synchronizing, finding something is broke, reverting all my changes and starting over. This if often easier than trying to merge my changes with someone who has beat me to the checkin.

Is there a way I can mitigate this with a script? Doing perl search and replace on files helps. I know there are some patch utilties that will generate a patch file that (I think) are part of CVS. The problem is that we are not using CVS or SVN.

Is there an open source utiltity, perhaps a perl module, that will apply the changes I have made to a file again when I have starting over from a fresh checkout? I was hoping for one based on search strings instead of line numbers.

It seems like there should be a way to make emacs save a journal that I can execute again later.

Thanks,
siegfried
# 2  
Old 04-10-2008
If it's not SVN or CVS then what are you using?

Sounds like you should look at some of the distributed version control systems out there. Some have pretty sophisticated patch handling. Darcs is supposed to be good at this, although I can't say I've had it live up to its promise for me. (I like it a lot, otherwise.)
# 3  
Old 04-10-2008
Dont' ask me, I just work here!

I am told we are using a derivative or variant of perforce called source depot. I don't know how this could be because I've used perforce before and this command line interface is quite different. Also, I don't understand how a derivative or variant of a commercial product like perforce could exist.

I do have rcs installed for my personal use: that must be able to compute and execute deltas.

Anyway, I did not select source depot. I'm just "contingency staff". It's command line interface sure is crude compared to the nice GUIs available for CVS and SVN.

My prediction came true again today! Only this time, it is because I broke the build and I have to revert everything to fix that immediately.

So I did my editing with using elisp code and saved that code so I could execute my editing changes again. There must be a better way!

Siegfried
# 4  
Old 04-11-2008
You certainly can use RCS locally if Source Depot will allow that. You don't even have to have the ,v files in the same directory or a subdirectory, although I'm not sure this is documented anywhere -- I saw a colleague use that and vaguely recall having read about it somewhere, but I could not find it in the documentation when I wanted to read about it.

(This is from memory, I don't have RCS here.)

Code:
co file /path/to/file,v

Similarly for ci, rlog, etc.

If the conflicts are complex, you still end up with a mess. I hear Mercurial (or was it Monotone?) is supposed to bring some relief to resolving conflicts. Also, have you tried xxdiff, emerge (if you use Emacs) or some other dedicated diff merge tool?

Of course, according to theory, you should talk to your colleagues so you can avoid conflicts, not just struggle with a merge tool in your cubicle.
# 5  
Old 04-11-2008
How to compute deltas and execute them?

Can you help me understand the rcs commands to compute the deltas between two files and save the delta so I can apply it again after I have reverted using source depot?
Siegfried
# 6  
Old 04-12-2008
It's all just diff and patch anyway, RCS doesn't particularly add anything to that. I have been assuming you've tried diff and patch already and not been happy with the result? If not, try that first.

Code:
mv file file.mine
sd revert file # or whatever the command to revert is
diff -u file file.mine >mine.patch
sd get # or whatever you do to bring in the latest version
patch <p0 mine.patch
# pore over conflicts
sd commit
rm file.mine mine.patch

It's been a long time since I used RCS, but if I remember correctly, even CVS brings substantial improvements to conflict handling in particular. There's nothing to prevent you from checking the files into a local CVS repo, save for the CVS directory which might upset another version control system, and/or need manual sync if you use another version control in tandem.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SunOS - version upgrade - Control Characters

Hi, We have a scenario of OS upgrade and in a simialr upgrade last time, we noticed a few stray bytes appearing and it resulted in application programs failing..... Could you please share your expertise in removing such control characters in input/output files, to keep the ball rolling in... (1 Reply)
Discussion started by: ab_2010
1 Replies

2. Programming

Version control for audit

Hi.I am running some scripts from a "scripts" directory for my job (I am working in Financial industry).For compliance purposes I need to use a "release" directory when running them using some sort of version control(CVS,SVN or GIT) in case the program is audited.Basically I have to maintain a dev... (0 Replies)
Discussion started by: rolleikid
0 Replies

3. Shell Programming and Scripting

Create a File for Version Control

Hi , I have to create a file with 3 columns A,B,C. I have to read the column A,B values from a text pad. Where as Column a contains approximately 10 values and column B has 1 value which is constant. Column C is a version control column ,initially the value would be 1. (1 Reply)
Discussion started by: Inform123
1 Replies

4. UNIX for Dummies Questions & Answers

Simple version control script for text files

HI guys, Could you help me writing a simple version control script for a text files. the format could be ./version_control <file(s)> (I want it to be able to work with more than 1 file at the same time) commands are add and get, add means you add new file(s) to the archive, get means you... (4 Replies)
Discussion started by: s3270226
4 Replies

5. Shell Programming and Scripting

Version Control Through the Shell Script

Version Control Through the Shell Script Hi Guys, Apologize for the big request, please take some time and read it completely... This is Very important for me, and ur help is Very much Appriciated. I want to maintain the Version control to all my scripts running in Production server, I am... (6 Replies)
Discussion started by: Anji
6 Replies

6. Windows & DOS: Issues & Discussions

Automate restart Grid control

Hi all, I'm trying to write a batch program to automate restart of grid control. oraclehomes\db10g\bin\lsnrctl status >> %filename% oraclehomes\oms10g\bin\emctl status oms >> %filename% (This is just for testing.) However, i cannot seem to let both of the line to execute as the batch... (3 Replies)
Discussion started by: beginningDBA
3 Replies

7. UNIX for Advanced & Expert Users

Maintaining different version Control account

How can I maintain different version control account(any common unix based version control like CVS,RCS,SCCS..) from a single UNIX Login Account. Many programmers share a common UNIX user/login account.How do they maintain separate Version Control Account. (1 Reply)
Discussion started by: johnbach
1 Replies

8. UNIX for Dummies Questions & Answers

How do you automate an hourly file check?

Hi, New to the forum, Great site, I can learn a lot from here!! :cool: I would like to know how to automate a command that checks the Sybase database's are "alive" on an hourly basis, and mails outlook if they are not (1 Reply)
Discussion started by: mals
1 Replies

9. UNIX for Dummies Questions & Answers

Version Control

I am not sure if this is the right forum to post my question on Version Control. Anyway, here it is! I use CVS for source code maintainence in my Solaris box. Is there any command where I can find out in CVS, if any check-in/check-out was done in the last 24 hours? I need a listing of all the... (3 Replies)
Discussion started by: Deepa
3 Replies
Login or Register to Ask a Question