Building Qt once added to subversion? - windows

I need to make some changes to Qt 4.7.1, so I need to add it to my subversion server to track my changes. However, once it's added, the configure script fails. I'm guessing it's choking on the .svn files.
I'm using Windows. Is there any way to add Qt to subversion, delete all the .svn folders, configure and build it, recreate the .svn folders, and then submit my changes?
Or is there any other work around? The error I get is 'Couldn't update default mkspec'

Here is what I would have done:
Install Qt in some folder.
Make sure that auto-props and global-ignores are set up properly.
Rename the whole folder.
Create an empty repository.
Create an empty folder having the same name as the original one.
Import the empty folder into the repository.
Remove the folder.
Check out the folder.
Copy the contents of the backup to the working copy.
Carefully add everything you want to be source controlled, probably using the -N or --depth options.
Put everything else into appropriate svn:ignore properties.
Commit.
Compare the working copy and the backup.
If there are any differences, wipe both the working directory and the repository, then repeat from the step 2, correcting the mistakes.
It may seem a bit of overkill, but importing such a large project into an SVN repository isn't a trivial task.

The problem is if .svn folders exist in /mkspecs/default and /mkspecs-win32-msvc2008 then configure fails to run with the error 'Couldn't update default mkspec'
If I move the .svn folders, configure, then replace them, I can then build.

Related

Working copy location of xCode SVN repository

Reference version: xCode 4.5.2
In Organizer-Repositories I see for each repository a "Root" folder and one or more folders related to the root. How I can see the working copy location related to each folder?
By right-clicking the folders I see only the link to the help and no options to see the actual location of the directory on my computer.
The reason why I'm asking this is that I added folders in my repository from different locations in my local filesystem. Now I need to find all the locations, remove them and put my working copy in a single directory tree to avoid mixing SVN working copy files with non-versioned files.
Many thanks for the help.
The xCode-Repositories interface for SVN seems incomplete (as appears from other questions/answers on it).
So I've resolved by removing the repository from xCode interface and re-creating it.
I now use "xcrun svn ..." command line interface for all the operations except the simple checkout/commit commands.

Copy new (changed) files into repository

I have a magento project that I'm managing under subversion version control.
I want to install a module that I downloaded which modifies some core files that are already under svn.
When I copy the new files over the existing managed ones, the repo becomes 'obstructed':
svn: Directory '/foo/app/.svn' containing working copy admin area is missing
What's the proper way to manage bringing in code from outside the repo?
Just make sure not to delete any .svn directory when you copy the new files into your working copy (unless of course you want to delete the repository containing this .svn directory). A simple way to do that is to keep all the directories as is, and only delete and update files.
Alternatively, use SVN 1.7, which uses a single .svn directory at the root of the project instead of a .svn directory in every directory of the project.

change svn working copy to another directory

Q: So I have local svn setup on my mac. I want to change to working copy of a repository to another folder without 'svn checkout', so that I can commit some code that is not currently in the working copy.
Problem with 'svn checkout'
The reason I don't want to use 'svn checkout' is b/c I don't want to overwrite the code into the new folder designated for working copy, because when I move the new code into the new designated folder and do an svn commit, I get an error based on the .svn hidden folders that svn attaches to your committed code.
What I am trying to accomplish?
I got myself into this mess, b/c I am trying to add multiple versions of my code into different folders, so that I can compare them against one another.
Thanks, Jon
You can use "svn copy" to copy one or more files in a working copy or in the repository.
More details: http://www.visualsvn.com/support/svnbook/ref/svn/c/copy/
I hope it helps.
When you do a svn checkout, it does not delete and overwrite existing files - it merges them (try it - make a backup copy of your target directory and then svn checkout into it).
However, the simplest way is to svn checkout into a clean directory, then copy your files on top of the checkout. Rename your current directory to something else if you need to keep the directory name for your checkout.

TortoiseHg change default .hg folder location

Is it recommend to change the default .hg folder location to a central place? Instead of having the .hg folder stored under working directory. Since I have accidentally shift-deleted the working directory and lost all commit history.
Is there any way to change the default .hg folder location in TortoiseHg?
Or any recommendation on backing up the repo? And how?
AFAIK, changing the location of the .hg folder is not possible. The presence of a .hg folder indicates that a given folder is a HG repository.
Even if it was possible to move the .hg folder itself to another location, there would still have to be some information in your working folder where your actual .hg folder is. So if you would accidentally delete your working folder, you'd also lose the path to the real .hg folder. Same problem :-)
Backing up a repo is easy in distributed version control systems like HG.
Make a clone somewhere (on a server in your network that's backed up regularly, or if you're at home, use a Bitbucket account) and push to it regularly.
I can think of two possible solutions, one I recommend, and one I don't.
The solution I don't recommend relies on your file system having Hard Links. When you create a new project, you could move the .hg directory to somewhere else on the file system, and set up a hard link to it in your working directory. You then essentially have two references on the file system to the same .hg directory, so if you delete one it will still exist.
I have done similar things on my gaming PC to have all savegames stored in subdirectories of a single \savegame directory.
However, a much better solution, and one that I would definitely recommend is as follows:
Have a directory (for example C:\HG) in which all "base" repositories sit. These are not working repositories, and would not have a working directory other than "null". When you create a new project, your first step would be to create a new empty repository in this base area:
hg init C:\HG\myNewProject
You now don't need to touch that repository other than to back it up (I use SkyDrive).
Then in the place you do all your work, you create a clone of that repository:
cd C:\WhereIWork\Projects
hg clone C:\HG\myNewProject myNewProject
Creating the clone automatically creates a link between your working repository and the one in C:\HG : any work you do should be regularly committed and pushed.
And there you have it - a backup that you never need to touch unless you delete your working directory by accident and need to re-clone.

How do I keep Resharper Files out of SVN?

I am using VS2008 and Resharper. Resharper creates a directory _Resharper.ProjectName. These files provide no value for source control that I am aware of and cause issues when committing changes. How can I get SVN to ignore them? I am using TortoiseSVN as my interface for SVN.
EDIT: You guys are fast.
Here's a link to show the ignoring process in TortoiseSVN
Add the file names (or even the pattern _Resharper.*) to the svn:ignore property for its parent directory.
Gonna post an answer to my own question here as I read the manual after I typed this up. In TortoiseSVN, goto settings. Add
*ReSharper*
to the "Global ignore pattern". Adding items to the global ignore pattern means that these files will be ignored for any project you work on for the client with TortoiseSVN installed, so it might not be appropriate to use the global ignore in all cases.
You can also add specific files and directories to the ignore list for individual projects if you select this from the TortoiseSVN menu BEFORE they have been added to your repository. The "BEFORE" part is what tripped me up originally. Since this is a single developer project, I've been checking in binaries, etc. b/c it has no consequence for other developers, and the Resharper files got in there.
Store Resharper caches in system temp folder.
Check First setting page in r#.
Environment -> General -> System -> Store caches ..
Short answer: the "svn:ignore" property
Long answer:
# cd /your/working/copy
# export EDITOR=vi
# svn propedit svn:ignore .
(add "_Resharper.ProjectName" on its own line and write the file out)
Edit: erg... doh, just realized you said tortoise... this is how you do it with the command-line version of SVN
svn has an "ignore" property you can attach to a filename pattern or a directory. Files and directories that are ignored won't be reported in "svn st" commands and won't go into the repo.
Example: you have C source code in .c and .h files, but the compiler creates a bunch of .o files that you don't want subversion to bother telling you about. You can use Subversion's properties feature to tell it to ignore these.
For a few files in one checked-out working directory, for example myproject/mysource/
bash> svn propedit svn:ignore mysource
In the text editor that pops up (in linux, probably vi or whatever your EDITOR env var is set to), add one filename pattern per line. Do not put a trailing space after the pattern (this confuses svn).
*.o
*.bak
That's all. You may want to do a commit right away, since sometimes svn gets fussy about users making too many different kinds of changes to files between commits. (my rule is: if in doubt, commit. It's cheap)
For a type of file appearing in many places in a sprawling directory tree, edit the subversion config file kept inside the repository. This requires the repository administrator's action, unless you have direct access to the repository (not through svn: or http: or file:, but can 'cd' to the repository location and 'ls' its files). The svn books should have the details; i don't recall offhand right now.
Since i don't use Tortoise, i don't know how directly the description above translates - but that's why we have editable answers (joy!)
This blog post provides a example on how to do what you want on via command line svn.
http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/
These change will be reflected in TortoiseSVN.
I believe there is a way to do it via tortoise however i don't have a windows vm accessible atm, sorry :(
SVN only controls what you put into it when creating your repository. Don't just import your entire project folder but import a "clean" folder BEFORE doing a build. After the build you get all the object files or your _Resharper folder etc. but they are not version controlled.
I forgot: the svn:ignore command is another possibility to tell SVN to exclude certain files. You can add this as a property to the version controlled folders, e.g. with TortoiseSVN.

Resources