Can we select what version to be checked out from CVS - download

I have updated cvs a few times and want to get one of the older versions, is it possible to get different versions of the same file? Or should it be only the latest checked in version?

Switch to a certain revision number: cvs update -r 1.42 myfile
Switch to a certain tag: cvs update -r mytag
Switch to a certain date: cvs update -D 'last friday 12:00 PST'
If you haven't already checked out some version, you can pass -r or -D directly to cvs checkout.
These all switch your working copy to the revision or date you specified (this is called a “sticky tag”). To go back to the head revision, issue cvs update -A.
You can also retrieve a specific revision into a different file with the -p option: cvs update -p -r 1.42 myfile >myfile-1.42. This doesn't touch your working copy of myfile.

Yes - in the lingo of CVS it sounds like you have committed several versions (to the repository) and now you want to get one of the previous revs back... so you will be updating your sandbox. If it's a particularly interesting rev, you might want to TAG it so you can find it again without having to use the rev number.
In either case you might run a cvs command like so:
cvs update -r 1.14 foo.java
cvs update -r spiffy_tag foo.java
But know that if you run either of those, you will have a "sticky tag" in your local copy and cannot commit back from there. (Run "cvs status foo.java" to see the sticky)... so if you want to work on that rev and tune it up, you might want to create a branch first... then if you run:
cvs update -r my-branch foo.java
you will be able to commit changes back to the repo.

Related

Create Working Folders using stcmd

I have been trying to write an stcmd that checks out code from a StarTeam repository. Here's what the command looks like:
stcmd co -p "Username:Password#localHost:1024/Store Server/Store Server/USB/sources/$OEM$/$$/Setup/Scripts"
Every time I run this code, I get the following response:
C:\StarTeam\Store Server\USB\sources\$OEM$\$$\Setup\Scripts\osConfig.ps1 (The system cannot find the path specified)
I'm guessing I need to have to create the working folder's location in order for my check-out command to work properly. Is there a way to create the working folders of a repository using stcmd? I know I can do it through StarTeam, but I wanted to see if it's possible to create it through stcmd so it can create the folders on new computers when my code runs.
You haven't said which version you're using, but in 5.4 the command to create working directories is:
stdcmd local-mkdir
so you'd need something like:
stdcmd local-mkdir -p "Username:Password#localHost:1024/Store Server/Store Server/USB/sources/$OEM$/$$/Setup/Scripts"
This is the answer to your question, but I'm not sure it'll be the solution to your problem!
Not sure which version of StarTeam you're using, but in 13.0 at least, there's an option -cwf (checkout working folders) which you can append to the check-out command. if you also want this to checkout subfolders of said working folders, you can also append -is (include subfolders, maybe?). So, try:
stcmd co -p "Username:password#localHost:1024/Store Server/Store Server/USB/sources/$OEM$/$$/Setup/Scripts/" -cwf -is

How to fix subversion <<!>> and <<?>> status automatically?

I use svn to sync my text files or any important notes which i place in my mac filesystem to my server. So, when i modify the file i use Sublime to add or delete files which are under svn-control and thus gets unsync with svn commands.
How do i fix it other than running the svn commands? I know i should use svn commands to rename or add or remove the files, but how do i do without using svn command? In Windows, i believe tortise SVN make note of those changes and we just need to commit but is there any software for mac which does the samething?
$ svn status
? MySql/MySQL_Start_On_Different_OS
! OS/Software/Nginx_Atmosphere.txt
! OS/Software/Nginx_Caching.txt
! OS/Software/Nginx_RpmInstallation.txt
! OS/Software/Nginx_Windows.txt
Again, i know i can fix the above status by doing svn add or svn remove <filename>. Atleast was there any command or script that convert ! to remove and ? to add?
To the first part of your question: Since you mention TortoiseSVN, I think you are looking for a graphical user interface to svn that helps you with adding/deleting files. Here is a short overview of available clients for OS X. I have personally used Cornerstone and was content enough with it, although there are certainly cheaper options that sound like they fulfil your requirements just as well.
As to the part where you are looking for a scripting solution: Use
svn st | grep "^?" | awk '{print $2}' | xargs svn add
to add all files marked as unknown by svn (i.e. ?). Use
svn st | grep '^!' | awk '{print $2}' | xargs svn rm
to remove all files that were already marked as deleted by hand (e.g. !). Then commit to svn with
svn ci -m "Your commit message goes here."

SVN export files changed since date or revision (Windows svn.exe)

I have a repository of sql scripts, some of which change for each of our monthly releases (different scripts change each month).
I am trying to automate the compilation of deployment packages and want to be able to export all the scripts which have changed since the last release, which has a known date and known revision.
SVN Branches are per release, SVN Tags are per build.
I have googled and know that svn diff --summarize -r {2012-05-01} svn://server/path/to/ > files.txt gives me a list of all the changes but how do I then use that list to export only those files using Windows CMD - all the examples I have found are for Linux and use Linux commands.
Is there any other direct way of doing this in SVN? (using SVN Export?)
Use revision number as start revision, not date: it's more bullet-proof
Use revision range, even if end revision is HEAD: it's more bullet-proof
You can have Bash even on Windows, and use Bash-scripts
You can install Ruby and use Ruby script (or compile Ruby to exe)
At last
You can install TortoiseSVN and prepare tree in GUI by hand
or
Write own parser of diff output (PoserShell will do it)
>svn diff --summarize -r 26:34 http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/
A http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/Dr%C3%A6p%C3%A6r.ma%C3%BEar.sv%C3%A6nskan.man.eller.smalensk%C3%A6n.txt
M http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/Hello.en.txt
M http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/Hello.fr.txt
M http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk/Hello.de.txt
M http://mayorat.ursinecorner.ru:8088/svn/Hello/trunk
(copy all files, which have A|M in fist char of line, or pre-grep all strings, which have trailing slash after path-base /filter last string in my example/)

Git: File Rename

I wanted to rename a folder from "Frameworks" to "frameworks", but git would not let me add the new lowercase name. I guess it treats filenames case insensitive, does it?
A git add frameworks/ -f didn't help
You can try:
"git mv -f foo.txt Foo.txt" (note: this is no longer needed since git 2.0.1)
to set ignorecase to false in the config file.
But the issue of case (on Windows for instance) is described in the msysgit issue 228 (again: this should now -- June 2014 -- work with git 2.0.1)
there is always an option to set ignorecase to false in the config file that will force Unix like Git semantics on top of NTFS.
Git supports this behavior but it is not the default - from NTFS point of view a.txt
and A.txt are the same thing - so Git tries to preserve that as most users would expect
As a better workaround, you can
git mv foo.txt foo.txt.tmp && git mv foo.txt.tmp Foo.txt
, which also changes the case of the file as stored on disk.
This blog post illustrates the same issue on MacOs during a rebase:
The default on Mac OS X file systems is that they are case-insensitive. FFFFFF.gif is the same as ffffff.gif.
If you delete the file in question, just from the file system, not from the Git index, mind you, you can merge the branch in question, and have it restore the file as if nothing happened.
The steps are pretty simple:
$ rm file/in/question.gif
$ git merge trunk
Anyhow, remember what git mv stands for:
mv oldname newname
git add newname
git rm oldname
, so if newname and oldname clash, you need to make them different (even if it is only for a short period of time), hence the git mv foo.txt foo.txt.tmp && git mv foo.txt.tmp Foo.txt
If you happen to host on Github, you can use the rename function on their website. Had to change the casing for 5 files and found it worked really well.
I was having a similar problem and couldn't get a new folder name (different case) to change on remote repos. I found that the easiest solution was just to move the file out of the repo and commit. Triggering a delete action. Then re-add and when I added, it came in with the proper case.

StarTeam - checkout file of a specific revision using stcmd

Is it possible to checkout file of a specific revision using stcmd?
I want to checkout all (or some) history of a specific file.
Is it possible to checkout file of a specific revision using stcmd?
You can checkout a specific revision using the label as follows
"C:\Program Files\Borland\StarTeam Cross-Platform Client 2005 R2\stcmd" co -p "user:pwd#host:port/MyProject/view_r1/" -is -eol on -o -rp "D:\LocalDir" -cfgl "LABELNAME"
The history of a particular file in that label is gotten by
stcmd hist -p "user:pwd#host:port/MyProject/view_r1/" -cfgl "labelName" -is -rp "D:\LocalDir" FILENAME
stcmd.exe co has a -vn flag that allows you to specify a version number. This is the version number, not the DotNotation, so 1.15 would be version 16. This command:
stcmd.exe co -vn 1 -fp . -p "user:password#server:port/ProjectName/ViewName/FolderPath" file.ext
would get you the 1.0 of file.ext in the current directory. If you want to get the full history, you can parse the output of stcmd hist and figure out the current revision number, or you can just run the above stcmd co command with increasing version numbers from 1 until the result says "file.ext: skipped" instead of "file.ext: checked out" (the current version of stcmd does not error if the version number is too large to be valid). Remember to either delete the local file between calls or add the -o flag to overwrite it. I'd recommend deleting it - there have been issues with stcmd co and overwriting.
Note this will only get you the versions of the file on the current branch back to the 1.0 - you won't get any versions of the file from other branches. So if the current version is 1.5.2.1, you would be able to get 1.5.2.1, 1.5.2.0, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0, but not 1.5.1.0.

Resources