What is R60, R72, and MINE file? - c#

I was building a DataAccessLayer using C# in VS 2012, and in my project, there are three files which I don't know how to deal with.
DataAccessLayer.csproj.mine
DataAccessLayer.csproj.r60
DataAccessLayer.csproj.r72
What are they? How should I deal with them?

They are files created from your repository that the code is saved in. You did an update and when you try to commit your files you will get a commit failed probably. When you diff the files, it will use the .mine .r60 .r72 files to bring up the differences between each revision (.r60, r72) and your file (.mine) and allow you to do something like Keep all changes in mine.
In order to get rid of the commit failed error messages, find the original file, update it with the correct changes, and when finished right click it and Mark as resolved and commit. This will get rid of those files.

Those files are related to version control (.mine is your file, .rX come from revision number X). You should try to merge them using your version controlling tool if you have one. If you don't have one and got those files by copying a project, you can possibly delete the .r files and rename DataAccessLayer.csproj.mine in DataAccessLayer.csproj (unless you already have DataAccessLayer.csproj - just keep it and delete the other then). Edit: And if it causes problems, try merging them manually (using a text editor for example) before keeping the final file.

Related

TFS: Splitting a large source code file without losing version history

Is there any way to move classes from one source code file to a new one without losing version control history? We are using TFS.
Thanks.
It's based on which version control system you are working with:
This not possible with TFVC as Marvin Glenn Lacuna also described very clearly above, However you could try the following workaroud:
Branch FileX to FileA
Branch FileX to FileB
Open each file and delete the party you don't want
Delete FileX
Now you could maintain history on all of the visible lines of pre code
through the branch relationship.
For GIT, you could take a look at this question: How does git track source code moved between files?
In TFS, from my experience, the simple answer is no, it stays on the source file and will remain in the source file. It will not be copied to the target file (ctrl+c, ctrl+v). I believe that's why it is called "file history" and not file section/classes history.
With current TFS version, the default version control is Git.
So you could do it by a trick.
Assume that you have two classes ClassA and ClassB in a file named File.ext, your source code is at branch master.
The steps should be:
Create branch 'developA' from 'master'
Call 'git mv File.ext ClsA.ext' then commit to have ClsA.ext with history of File.ext
Cleanup ClassB in ClsA.ext then commit.
Create branch 'developB' from 'master'
Call 'git mv File.ext ClsB.ext' then commit to have ClsB.ext with history of File.ext
Cleanup ClassA in ClsB.ext then commit.
Merge two branches 'developA' and 'developB' then push to 'master'
Now you have both files ClsA.ext and ClsB.ext without losing their history from File.ext.
An example could be found at my github repository.

libgit2sharp get next version changes

Using the code from this answer I can checkout a specific version of the codebase just fine.
How do I get a previous version of a file with libgit2sharp
I then further want to get the next version after that. I get an error when getting the next version.
19691 conflicts prevent checkout
What is the best way to get the changes from the next version into the same directory ? Perhaps do a get first to a temp directory and then copy replace over the first, is there a better way ?
What I ended up doing is to get code using the answer from this question.
How do I get a previous version of a file with libgit2sharp
Then do a diff in the main repository to figure out the changed files for the next commit. With that list I can get only the changed or added files and remove deleted files from the first get. This works pretty fast when dealing with repositories with a lot of files in them.

Subversion to Update the ver in a text file

I am in a circular trap here...
We are building on a dedicated server, so when we do a pull and build I want to update the version information in the projects to show a version such that the last digit is the "revision" number at that current pull for subversion.
But if the script updates that file, then it is not current. So I need to re-commit that file, or merge it in the next pull, or ...? Then the revision number is incremented.
I solved it in a C++ program by placing the actual revision numbers in a file that was NOT under the control of SVN. Now the script can "svn update", capture the revision number, change the local file, and built. However that creates a dependency on a file that is not under SVN control.
Furthermore, there are projects where it appears I cannot externalize the version number into a dedicated file, and leave that file out of SVN control.
What I really would like to see is a "eyecatcher" tag that SVN would update upon an svn commit (or svn update). Something arbitrary like: {!SVN_REV}
So, my C# assembly file might look like this:
[assembly: AssemblyFileVersion("1.1.0.{!SVN_REV}")]
Other version control systems support this kind of ability. Is there anyway in Subversion to do it?
Thanks for any advice.
Scotty
if the script updates that file, then it is not current
No, it's current (it terms of information), you can just not save this minor change in repository (best and easiest way)
From other side, you can
Store template-file in repository (read about SubWCRev and it's keyword)
At build stage create additional not versioned file at first stage with keywords, substituted with real (actual data) and use this file, not template

Prevent deleting a folder during uninstall

Is there any possible way to prevent files in a folder being removed or from over written during re installation? i have a folder where i store some templates for sending mails which user can edit.I have added the basic templates in my setup and so during re installation it removes the templates which the user might have already edited and places a new copy of the template.How can i prevent this?Should i use installer class or is there any property that i can use?Please Guide.
See:
File Versioning Rules (Windows)
Especially:
Neither File Has a Version (Windows)
You are using a tool that makes every single file a key file of it's own components. Therefore, you should already be getting this default behavior. If you set Permanent, they should not get removed. You said that the use "can" modify these files. The behavior is that if they haven't modified the files, they will get overwritten and if they have modified the files they will not.
However, IMO, a better pattern is to have an override directory that users can copy templates to and modify. You can get into undesired behaviors on upgrades resulting from the conflict of 1) My new build fixes something and 2) I can't install it because the old stuff has user data. This is especially true for things like XML files.
this can be done by selecting the file properties and setting the value of permanent to true.

How to get the installation directory (installed with MSI, created with VS2010) at a custom uninstall action?

So I've created a simple msi-setup for my application using a setup project and added a couple of custom actions that take care of stuff like extracting files from archives. Now, there are two extra files in my program files -directory which means that the MSI won't remove the directory at the uninstall by itself. My solution to this was to create a custom action that removes the rest of the files.
Now this works just fine and dandy, as long as the default directory is used at installation. But what if the user chooses to change it? I'd assume there has to be a very simple way to read the directory at the custom action, but I'm not quite sure what that is.
As far as I've found out by googling, there are properties such as TARGETDIR related to the MSI-package. However, some sites also say that I should be setting this property by myself, at the installation stage.
All this has left me quite confused. Basically I see two ways to resolve this:
1) Make sure the application does not create files by itself, and the MSI will take care of it. This would mean a bit more work because I'm not responsible for those extra files.
2) Find out the installation directory at the custom action while uninstalling the application, and remove the last bits by myself. This is the quick-and-dirty way as I see it, and would definitely suffice for now. But how to accomplish this?
Also while I'm here I might as well ask this one more related question. As I mentioned earlier, I extract some files at the install. Now, I'd like to get rid of these archives once I've extracted them. The problem is, if I do this, MSI will think my installation is broken and copy them back each time I launch the application. So how to avoid this?
There is no need to use a custom action to remove the files. MSI has built in support for this scenario in two steps:
Use a search to locate the files you want to remove. Here is a tutorial
http://msdn.microsoft.com/en-us/library/aa371564(VS.85).aspx
Then you can schedule a file removal operation to actually delete the files.
http://msdn.microsoft.com/en-us/library/aa371201(VS.85).aspx
Regarding your second question:
Don't add the archives to the File table. Instead create some self extracting archives and use binary custom actions to unpack them.
http://msdn.microsoft.com/en-us/library/aa368085(VS.85).aspx

Categories