Copy new (changed) files into repository - macos

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.

Related

Changed folder structure in Xcode Project not reflected in Git Repository

I have an Xcode project that is under version control. I've grouped the classes in the project navigator into folders based on what the classes do (eg. Models, Views, Controllers, etc.). However, these folder structures seem local to my machine and it is not reflected in my own local git repository, or if I do a git pull from another machine, the folders that I've created or organized my classes into don't appear. So, How do you get the changes you make (organizing the classes into folders) to reflect in your local and remote repository?
Try this
# modified, new and deleted files
git add -A
ref
I found that the adding a folder or directory manually inside the local repository to work for me. Create the folder in the repository,git add folder_name/ to actually track and add it to the repo. The files then can be moved into this folder. Depending on how you move it, you may need to do git rm <file_name> and git add </folder_name/file_name>.

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.

Xcode git add file not in current directory

I'm using Xcode 4's built-in Git functionality, and I am pushing my commits to a remote repository.
However, the code files are in one directory (~/users/me/projects/theproject) and the images are in a second, separate directory. (~/dropbox/projects/theproject). Xcode thus allows me to add, commit, and push files that I place in the first directory, but not in the second one. If I right-click one of files, then do Source Control -> Add, it's greyed out.
How can I add the files in the second directory in the remote repository? Is it possible to do it within Xcode? If not, what would be the git command?
Files in a single git repository need to be part of the same directory tree (that is, they all need to be located somewhere underneath the directory containing the .git directory). If you were to move your images from ~/dropbox/... into ~/users/me/projects/theproject, you would be able to add them to the repository.
Alternatively, you could create a separate repository inside your dropbox folder and use that just for the images.
I do this exact thing by creating a junction or hardlink (see below) to my "directory that's outside of the tree" so that it appears to be mounted inside the directory hierarchy where my .git folder/repo sits.
like so:
\(root of project) <------ \real_images_folder
|-- .git |
|-- htdocs |
|-- images <------junction---
see my answer here for details on how to create a junction: https://superuser.com/questions/455853/can-i-delete-the-the-folder-c-programdata-package-cache?answertab=active#tab-top

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.

Building Qt once added to subversion?

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.

Resources