SVN: Colleague checked in a folder into repository, but I can't Update my version to it - visual-studio

In showing a colleague how to use SVN yesterday, we created a test folder and file within our existing Visual Studio Solution. We'll call it "Test" folder with two files, "Test.ascx" and "Test.ascx.cs". We added it (or Visual SVN added it, 'cos it's awesome), and committed it. We also added and committed other files elsewhere in the project.
We can see it in the repository (and the other files).
Doing an update on my own machine to pull down these new files resulted in the other files being pulled down correctly, BUT the Test folder does not appear. No matter how many times I try Updating from various points in VS and in TortoiseSVN (urgh) Repo browser, it can't see that there are any changes to pull down.
Where am I going wrong?

This is a known problem.
You can use
$ svn update --depth=infinity
to force the update. With TortoiseSVN, use the "Update to revision" command in the Submenu, then change the depth combobox to "fully recursive".

I've had ghost errors like this before and found the easiest work around is to delete the parent folder and update it's parent:
Project Root
Project
NewFolder
Delete Project, then Update Project Root

We can see it in the repository (and the other files).
...
No matter how many times I try Updating from various points in VS and in TortoiseSVN (urgh) Repo browser, it can't see that there are any changes to pull down.
So you can or cannot see it in the repository browser?

Did you commit and update the parent folder of your Test folder?

I don't know, svn is always telling me to clean, did you try that?

It's not an answer, I know, but I have tried all the solutions you guys have kindly suggested and I just end up with conflicts, crashed TortoiseSVN and built up Karma. Therefore, a trusty edit in the .svn/entries file sorted it.
I have until now been a single developer using SVN just to manage my source code. Other people don't have problems, and I just check in stuff. I use Visual SVN as a layer to frig SVN for .NET (which it isn't great with) and I seem to constantly run into issues. I am performing very simple operations, not even branching/tagging. Simple simple simple. And yet I have issues with it?

Related

Can`t see the file history in Gitlens (on a specific project)

I have a problem with Gitlens extension. Firstly, Gitlens or Git History extension is working fine on any other project except the this Laravel project. My problem is, can`t see the file history or line history in this project.
On the other hand, there is no problem in the git log (Git History Extension) as seen in screenshot;
But I can't compare any files with their any version (every commit seems like in the ss). I have no idea what the problem is about.
Lastly, I don't think the problem is about extension settings because other projects do not have this problem. Is there a any chance to fix this issue without resetting git history?
I am answering after 3 months, maybe it works for someone. As I mentioned in the title, surely there is no problem about extension settings for this specific project. The problem is just about git files. Maybe, I damaged some git files while moving the project on my desktop :)
So, there is no chance to fix this issue without resetting git history or starting fresh with git, if you`re having the same problem.
Do not play with git files, it`s no joke!
I've got a similar issue. My problem is in using symbolic links for folders.
I have this folder symlink for my repos.
C:\>dir
Directory of C:\
27.09.2018 21:07 <JUNCTION> repos [C:\Users\Qwerty\repos]
(GitLens v11)
The top editor is opened via C:\repos
The bottom editor via C:\Users\Qwerty\repos
You can see that some git features still work (yellow), but others don't.
However, this is very strange, because in my other repos, I have never observed such issues.
Also notice below that it is still possible to invoke the same action via a git lens popup and then it is possible to use the Prev Next Revision buttons.
Anyway, after more testing, I actually observe the same thing in my other repos. I assume that something must have changed between versions as I only observe these issues for last maybe 2-3 months. I even submitted a ticket that GitLens stopped working in v12.0.0 and later versions https://github.com/gitkraken/vscode-gitlens/issues/1979
The buttons completely disappeared and even the commit information
v11
v12
And Now actually, after having reopened my repo via original path and after updating GitLens back to v12.0.6 I see that it is working properly!
Bottom editor is opened via C:\repos symlink.

Delete an unreferenced image from repository in Xcode

I deleted default.png from my resources folder because I wanted a different image for the loading screen, but I just deleted the reference which was apparently a dumb thing to do. I dragged the new image into resources and tried to change the name to Default.png, but it won't let me, which I think is because the first Default.png is still in the repository somewhere. Anyway, how do I delete that image(and others with which I have probably done the same thing) from the repository when it is no longer visible in xcode?
What kind of repository is it? Subversion? Git?
The SCM integration in Xcode is great for checking out files and committing changes without having to leave the IDE, but it's hardly a full-blown GUI front end to either svn or git. It may be possible to fix your mistake by adding the file back to the project and then deleting it in Xcode in such a way that Xcode will remove it from the repository for you, but the simple solution is to just delete the file from the repository yourself by using the appropriate version control command. For example, if you're using Subversion you could:
svn remove default.png
to remove the file from your version of the repository. When you commit your changes, the file will be deleted in that version. (It'll still exist in previous versions -- that's the whole point of SCM, after all.)
After that, you can create the new file and add it to both the project and the repository in the usual way.
You need to manually go into your app's file structure and delete the image files themselves. Also, it is usually a good idea to "clean" the app whenever you remove files or references to files from an XCode project, since XCode can be a bit temperamental about removing files; the key combination for this is
Hope this fixes your problem.
Clean all targets should work (at least it worked for me). You can try the following:
a) delete the reference from "Copy Bundle resources" of your target
b) delete the app from Simulator/Device
c) clean all targets
Caleb is absolutely right. That fixed the problem here as well for the most files.
An easier way to get an overview of the accidentally un-deleted files, is creating a bookmark of the working copy with Versions (SVN Software - in case you use SVN). There you can detect the problematic files grafically and delete them. I always have to do this after restructuring the project folder.

TortoiseSVN: how to set up projects on a existing directory structure of source code

I have an old pet project I want to revive (haven't had enough time for it last year - small kid - you know) - so restored old copy of my dev folder from archive, but since I have rebuilt my machine since when - I can't remember what needs to be done now. I installed the latest version of TortoiseSVN, and the existing directory structure from my old dev machine looks like:
ProjectName
*SubProject1
**branches
***1.1
***1.2
**tags
**trunk
*SubProject2
**branches
**1.0.3
**1.0.4
**1.0.5
**tags
**trunk
I tried "import project" but it ask for a url - don't know what to specify there ...
can someone post a url to a good TortSVN tutorial - so I could set up my projects quickly (I guess I need to setup SubProject1 and SubProject2) - then I install AnkhSVN for VS2008
and will spend this Sunday coding like crazy while I still have some time ;-)
Rather than focusing on TortoiseSVN specifically, I would actually recommend that you review the SVN documentation first:
http://svnbook.red-bean.com/
A good understanding of what's going on behind the scenes is really helpful when using Tortoise, Ankh, or any other front end.
Getting to your question, the URL is the URL of your SVN repository, plus any subdirectories. An example could be
file:///C:/svn/trunk/ProjectName
if your repository were stored locally, or
http://my.repo.site/trunk/ProjectName
if it is hosted on the Web.
Just hit F1. TortoiseSVN has good built-in help docs.
The url it's asking for is the svn repo to import your project into.
The Url you refer to is likely the address of the project at the Subversion repository (wherever that is, since you didn't mention any). If you right click on your local directory and choose properties you should be able to see a subversion tab where you can find the address your project came from.
If you don't have the repository data, then I think the best thing to do is make sure to remove all the .svn folders from your project folders - good discussion here - and start anew with the files you have. This will mean you don't get all the history you had previously, but, lacking the repository, I don't think there's a way to recover anyway.
Then using whatever tools you'd like create a new repository somewhere, checkout the empty root, copy in all of your folders and then commit.

How to I tell VisualSVN to do a replace instead of a merge?

We're finding ourselves unable to open our project in Visual Studio because SVN is adding lines like
"<<<<<<< .mine"
to our .csproj files.
This is apparently something SVN inserts when it has trouble merging files, but we're not interested in merging things as two people can never have the same file checked out.
How do we set Visual SVN to Replace instead of Merge?
Thanks for any help.
It's doing that because SVN tries to preserve whatever changes you've made to your local working copy. Thats a pretty important aspect to the SVN method of version control so I don't know, and doubt, if its possible to do that. I do know you can tell svn to ignore files, but their changes then won't be committed to the repository, nor updated from the repository.
If its a problem, delete the csproj file, then when you update it will redownload the proper version. Do that whenever theres a problem. If it happens quite a bit, then one of the developers is messing with the file.
Past projects I've worked on had a dozen engineers working on the same projects, and we never had constant merge problems with the .csproj files.
What do you mean by "two people can never have the same file checked out"? I think you are misunderstanding how Subversion works - checkout is not an exclusive lock on a file.
Visual SVN uses Tortoise on the backend I believe. when you are in a conflicted situation (i.e. SVN cannot merge the two versions cleanly) you should have the option you should get a pop up where you have the option to either "Use Local" or "Use Repository". If you choose "Resolve Later" you'll get what you are describing.

Visual Source Safe - Removing files from web projects

I'll try to make this as straight forward as possible.
Currently our team has a VSS database where our projects are stored.
Developers grab the code and place on their localhost machine and develop locally.
Designated developer grabs latest version and pushes to development server.
The problem is, when a file is removed from the project (by deleting it in VS2008) then the next time another developer (not the one who deleted it) checks in, it prompts them to check in those deleted files because they still have a copy on their local machine.
Is there a way around this? To have VSS instruct the client machine to remove these files and not prompt them to check back in? What is the preferred approach for this?
Edit Note(s):
I agree SVN is better than VSS
I agree Web Application project is better than Web Site project
Problem: This same thing happens with files which are removed from class libraries.
You number one way around this is to stop using web site projects. Web Site Projects cause visual studio to automatically add anything it finds in the project path to the project.
Instead, move to Web Application Projects which don't have this behavior problem.
Web Site projects are good for single person developments.
UPDATE:
VB shops from the days gone past had similiar issues in that whatever they had installed affected the build process. You might take a page from their playbook and have a "clean" build machine. Prior to doing a deployment you would delete all of the project folders, then do a get latest. This way you would be sure that the only thing deployed is what you have in source control.
Incidentally, this is also how the TFS Build server works. It deletes the workspace, then creates a new one and downloads the necessary project files.
Further, you might consider using something like Cruise Control to handle builds.
Maybe the dev should take care to only check in or add things that they have been working on. Its kind of sloppy if they are adding things that they were not even using.
Your best solution would be to switch to a better version control system, like SVN.
At my job we recently acquired a project from an outsourcing company who did use VSS as their version control. We were able to import all of the change history into SVN from VSS, and get up and running pretty quickly with SVN at that point.
And with SVN, you can set up ignores for files and folders, so the files in your web projects dont get put into SVN and the ignore attributes are checked out onto each developer's machine
I believe we used VSSMigrate to do the migration to SVN http://www.poweradmin.com/sourcecode/vssmigrate.aspx
VSS is an awful versioning system and you should switch to SVN but that's got nothing to do with the crux of the problem. The project file contains references to what files are actually part of the project. If the visual studio project isn't checked in along with the changes to it, theres no way for any other developer to be fully updated hence queries to delete files when they grab the latest from VSS. From there you've got multiple choices...
Make the vbproj part of the repository. Any project level changes will be part of the commit and other developers can be notified. Problem here is it's also going to be on the dev server. Ideally you could use near the same process to deploy to dev as you would to deploy as release. This leads into the other way...
SVN gives you hooks for almost all major events, where hooks are literally just a properly named batch file / exe. For your purposes, you could use a post-commit hook to push the appropriate files, say via ftp, to the server on every commit. File problems solved, and more importantly closer towards the concept of continuous integration.
Something you may want to consider doing:
Get Latest (Recursive)
Check In ...
Its a manual process, but it may give you the desired result, plus if VS talks about deleted files, you know they should be deleted from the local machine in step 1.

Resources