Merging conflict with Unity Script Assemblies - version-control

I want to be able to merge my changes to the main repository branch. I accidentally merged all my Unity files on the last merge and I think that caused an error for my next merge . I get the following error:
% hg --repository C:\kiln\development merge --verbose --tool=internal:fail 4595
~/Assembly-CSharp-Editor.pidb: untracked file differs
~/Assembly-UnityScript-Editor.pidb: untracked file differs
~/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll: untracked file differs
~/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb: untracked file differs
~/Library/ScriptAssemblies/Assembly-UnityScript-Editor.dll: untracked file differs
~/Library/ScriptAssemblies/Assembly-UnityScript-Editor.dll.mdb: untracked file differs
~/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll: untracked file differs
~/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll.mdb: untracked file differs
abort: untracked files in working directory differ from files in requested revision
I'm not sure what to do now. I was thinking about deleting those files from my local repository and then pulling from the main repo. However, I'm afraid those files might damage my game somehow.
What should I do?

In general you should not check the Library folder into Mercurial. From the Unity Manual:
When checking the project into a version control system, you should add the Assets and the ProjectSettings directories to the system. The Library directory should be completely ignored - when using external version control, it's only a local cache of imported assets.
(see also http://docs.unity3d.com/Documentation/Manual/ExternalVersionControlSystemSupport.html)
Specific to your question: All dll and mdb-files in the Library/ScriptAssemblies folder are automatically regenerated from your code files so you can safely delete these files. Unity will regenerate them when it's recompiling the code in your project.

Related

gitignore > some ignored files still added to the repository

I don't understand why ignored files are still added to the repository. Are there some circumstances when files which are in the .gitignore list, can be still added to the repository
I added directory to the .gitignore before I did anything with the project (project is clean, no trucked or untracked files). Then I built the project. During the build process some files were modified. When the build was done, most of the modified files were ignored, but some were added to the repository. I don't understand this git's selectivity.
Usually, files are added to the index when modified if they were tracked before the .gitignore referenced them.
Try:
git rm --cached -r biz/modules/rest-apis/docs/refAddress
Then control that all files are ignored, by selecting one which was added before:
git check-ignore -v -- biz/modules/rest-apis/docs/refAddress/GET_1.0_v4_addresses.json
You should see a .gitignore rule (no output means: the file is not ignored).

CVS ignores .git folder

I was trying to synchronize my local git repository to a CVS repository and everything gets synchronized properly, except for the .git folder.
At first, I thought all folders starting with a dot would be ignored, so I tried adding a .test folder and putting mock files in it. To my surprise, it is detected as a new folder, and the files inside of it are listed and ready to be synchronized.
How do I make CVS sync the .git folder? Thank you.
P.S. I use git locally to keep track of individual changes, and CVS for major milestones. They don't have to be linked in any form.
You definitely do not want the .git folder itself to be synced "as is" to your CVS repository.
When using git, the .git folder contains the version information, e.g. the content of all versions of all files in the repository (in a compressed format).
When you are syncing, the information in .git is used to populate the version control information in CVS. But CVS cannot read the information in the .git folder directly.
Syncing content of .git so that it would be visible in CVS would only be confusing (and dangerous if you tried to "sync back" that content to git, overwriting the contents of the .git folder in git).

Git Ignore tracked files

If any directory is ignored through .gitignore that contains a few important files that are committed to repository but also contains some unwanted temp files which are generated.
What will happen if important file is modified, will this file be ignored by git?
File already tracked in Git are not affected by .gitignore.
Any changes to tracked files will show up in git status.

Restore revision history of a copied file using Perforce

I copied a bunch of java classes into another java package outside of perforce by accident and made a bunch of changes to them. I now realised that the revision history of those files has been lost as I didn't use perforce to copy the files over.
Example:
original file - dir1/Class1.java
copied file - dir2/Class1.java
The original file still exists.
If I want to restore the revision history of the files what would be the appropriate command to run in order to do this?
You should have branched the file in Perforce rather than copied it outside of Perforce, but that can be remedied.
Copy dir2/Class1.java to another location then delete the original
Branch dir1/Class1.java to dir2/Class1.java
Check out dir2/Class1.java
Copy the backup of the file you made in step 1. to dir2/Class1.java
Check in dir2/Class1.java
You will then have your recent modifications to the file dir2/Class1.java in version control and the file will be linked to its original via the branch history.

Change root directory of repo in Mercurial

I'm working on an Android game with the folder structure:
\bin
\data (contains game graphics)
\libs (libgdx engine jars)
\src
----\com
--------\brand
------------\game
(*.class files)
Foolishly, I created a mercurial repository (hg init) in the \src directory. Thus, if I update any of the graphics (small file sizes), they aren't added to the repo when I commit. My question is: how can I change the root of the repo to include the \data directory as well as the \src directory, but without including the \libs directory as that includes 10-20mb jars?
There are two ways to do this.
1) Start a new repo. It's quick and easy but you'll lose your history.
2) Use hg rename. This is effectively a move command.
Rename the src directory to be something meaningful and then do this.
hg rename MyProject/com MyProject/src/com
Copy all the files/folders into the MyProject/ directory.
Mark bin and libs as ignorable and
Add everything else.
hg commit
If you don't want to just do an hg rename, you can do it with the convert extension (which comes by default with Mercurial, you just need to enable it in your .hgrc).
Run it with the --filemap parameter and a filemap file that has something like:
rename com src/com
You will end up with a new repository with all of your history, but with your com directory moved into src/com. You can then copy you bin, data and libs folders in there, run hg addremove and you should be all good to go.
Warning: the new repo is completely different than the old one -- changeset IDs and such will be different, so anybody you worked with in the past will have to get on the new repo.