I want to show the differences on main file itself using CVS? - linux

I am planning to show the differecnes on the samefile by using CVS.
Say i have one file a.txt,it contains two revisions.
2.0
3.0
i can find differecne using cvs diff -r 3.0 -r 2.0 a.txt,but i want to show the changes on 3.0 file only.
That means i want to display the latest file of a.txt and mention the changes happend to file ?
Is it possible? Can someone guide me to how to start on this?

cvs log -N -S -rHEAD a.txt should give you the log message. If you have't checked out the latest revision, you can use cvs rlog
I don't know a way to print the latest revision (as in "cvs cat" or similar) with CVS. You probably have to use cvs checkout or convert your repo to a modern version control system (which you should really consider anyway; CVS is really outdated).

Related

Need a detailed procedure to use meId diff with svn(subversion)

After a lot of search i could see that meId is a good diff tool for comparision in linux
I would like to use the meId for displaying the svn diff
I am new to linux as well as SVN
I just downloaded the meId and placed it on my desktop i am not sure what to do next ?
i could see 'svn diff -r 2165:2182 --diff-cmd meld' is used to do the trick
but i am not sure how to do this
Can some one guide me to get the diff of svn displayed in meID
Any help for this is greatly appreciated ..
You need to create a wrapper script as described here: SVN documentation
In the Meld wiki you can find a wrapper script used to merge with Meld: Meld wiki
You can find the command line usage of Meld in the documentation.

Calling svn diff on some revision and previous revision, with no local copy

I have no local copies of any files from the SVN repository. I do have a full path URL to some file in SVN. How can I see the difference between revision 1234 of that file, and it's previous revision, whatever it may be?
svn diff -c 1234 $URL
Assuming you are using a version of Subversion newer than 1.4 when -c was added. Otherwise you need to do:
svn diff -r 1233:1234 $URL
If you want to see a diff including changes across multiple revisions you can just expand the revision numbers you provide to -r.
You can see detailed documentation of the diff subcommand in the SVN Book.

Find a string in Perforce file without syncing

Not sure if this is possible or not, but I figured I'd ask to see if anyone knows. Is it possible to find a file containing a string in a Perforce repository? Specifically, is it possible to do so without syncing the entire repository to a local directory first? (It's quite large - I don't think I'd have room even if I deleted lots of stuff - that's what the archive servers are for anyhow.)
There's any number of tools that can search through files in a local directory (I personally use Agent Ransack, but it's just one of many), but these will not search a remote Perforce directory, unless there's some (preferably free) tool I'm not aware of that has this capability, or maybe some hidden feature within Perforce itself?
p4 grep is your friend. From the perforce blog
'p4 grep' allows users to use simple file searches as well as regular
expressions to search through file contents of head as well as earlier
revisions of files stored on the server. While not every single option
of a standard grep is supported, the most important options are
available. Here is the syntax of the command according to 'p4 help
grep':
p4 grep [ -a -i -n -v -A after -B before -C context -l -L -t -s -F -G ] -e pattern file[revRange]...
See also, the manual page.
Update: Note that there is a limitation on the number of files that Perforce will search in a single p4 grep command. Presumably this is to help keep the load on the server down. This manifests as an error:
Grep revision limit exceeded (over 10000).
If you have sufficient perforce permissions, you can use p4 configure to increase the dm.grep.maxrevs setting from this default of 10K to something larger. e.g. to set to 1 million:
p4 configure set dm.grep.maxrevs=1M
If you do not have permission to change this, you can work around it by splitting the p4 grep up into multiple commands over the subdirectories. You may have need to split further into sub-subdirectories etc depending on your depot structure.
For example, this command can be used at a bash shell to search each subdirectory of //depot/trunk one at a time. Makes use of the p4 dirs command to obtain the list of subdirectories from the server.
for dir in $(p4 dirs //depot/trunk/*); do
p4 grep -s -i -e the_search_string $dir/...
done
Actually, solved this one myself. p4 grep indeed does the trick. Doc here. You have to carefully narrow it down before it'll work properly - on our server at least you have to get it down to < 10000 files. I also had to redirect the output to a file instead of printing it out in the console, adding > output.txt, because there's a limit of 4096 chars per line in the console and the file paths are quite long.
It's not something you can do with the standard perforce tools. One helpful command might be p4 print but it's not really faster than syncing I would think.
This is a big if but if you have access to the server you can run agent ransack on the perforce directory. Perforce stores all versioned files on disk, it's only the metadata that's in a database.

get the current HEAD version of a CVS file on the server

Using the rlog command I can analyze the commit log to a file on the CVS server itself (that is, directly accessing the file ending in ",v"). That's fine.
Is there a similar command line utility that prints the current HEAD version of that file to stdout?
I need this for a custom CVS status utility (something like ViewVC, but made specifically for a certain repository) that will be written in PHP.
To print the content of the file that would be checked out, just use co -p filename. That will print a small header including the revision number to stderr, and the content of the file to stdout.
You probably want cvs log filename. Not sure buy you might need to do cvs update filename first.

Access TortoiseSVN update text

When you use Tortoise SVN to update from the repository to your local machine, you get the popup that shows what files were added/updated/etc. I'm looking to get hold of that text programmatically.
Do you know if it's dumped to a temporary file or a log file? Or is there another way to get hold of that text? I can't see anything in the settings that provides for it.
One idea might be to use the svn.exe console program, like this
svn.exe log -r head -v <svn-dir>
-r means the revision (head being the newest)
-v being verbose (which includes the file names)
<svn-dir> is a dir that contains a svn checkout ( this can be omitted if you run the command inside such a dir).
There are also an -xml switch that might be useful if you want to massage the data in some way
This requires that you have a svn.exe in you path. It seems to be possible to find the svn.exe exec. here

Resources