When you make edits to a file within a project using AnkhSVN, can this be reflected at the project level? - visual-studio-2010

When I make edits to file, TortoiseSVN will show an indication on the folder that file belongs to that there are changes pending to child items. AnkhSVN only shows (red tick) changes to a project when files are added/removed (because the actual content of the project file in this case has changed)
Can you make ankh give any indication at the project level that child items have been edited?

Unfortunately, no. Ankh only shows an indication on modified files, whereas TortoiseSVN can traverse folders recursively and mark those with changed files within them.
If you desperately need this feature, you can try out VisualSVN plugin. It tries to mimic TortoiseSVN behaviour as close as possible. In fact, it uses TSVN dialogs for operations such as Commit or Update, for instance. When you modify a file within a project, it highlights the file, the project this file belongs to, as well as the solution node in the Solution Explorer.
Unfortunately, it's not free (US $49 per seat), but IMO it is worth its price.

The recommended way to see what changed globally in AnkhSVN is the 'Pending Changes' toolwindow. This shows you all interesting files in a single view and allows you to operate on them easily.
You can open the toolwindow via View->Pending Changes.

Try this:
Right Click the File -> Subversion -> Lock
This places a lock on the file so that others cannot edit it.
When you commit, it should unlock the file.
If it does not, Follow the same steps and select Unlock.
Edit: I use AnkhSVN for my svn but it's just me that uses it. If a corporate environment I mainly use TFS which does the same thing (lock/unlock) but it does not allow others to check out.

Related

TFS was offline, going online shows way to many files were changed

TFS 2018 was offline only for a day and I only made a couple of changes to a 7 project solution (most of the various projects are base projects like models, repositories, interfaces, etc.)
I had to overwrite files to continue because apparently they were read only. Anyway, I'm going back online today and I'm afraid to checkin my local changes because it shows I've changed nearly 80 files which is impossible, I only changed like 2 or 3 files.
Should I check them in anyway? I'm afraid I'll mess up something!
According to your description, seems you are using server workspace (files are ready only).
Work offline with difficulty and with poor performance
When you are offline in a server workspace, you cannot work with your
local files because they are read-only until you check them out. You
can check out files only from Solution Explorer, and only after you
switch to offline mode (as explained below). While you're offline, you
can't perform any other operations, such as add, delete, rename, or
undo.
Source Link
To edit a workspace, you can specify whether its location is Local or Server. Local Workspaces which could work offline easily. You can quickly begin editing a file when your network connection is unavailable or unreliable. From Solution Explorer you can add, edit, delete, rename, undo, and compare items in your workspace even when you're not connected to your Team Foundation Server.
Edit the workspace and choose advanced, you could see the Location of workspace type.
In your scenario, you could do a diff using Beyond Compare or something to see what changed.
If nothing changed, check if you are using the same workspace. You may select another workspace than you used.
In Source Control Explorer, check if you choosed the workspace the workspace you were work in.
If all above not work, you could also try this workaround, select all the files in "Pending changes" window and activate the context menu. Then click "Undo..." > "Undo Changes" > "No to All".
The files without changes will be rolled back. More details please take a look at this question: how to undo pending changes of files that are unchanged?

How to reset source control for messy project?

I recently refactored an old project and altered its file/folder structure, which has caused big problems checking in. I can't check-in pending changes because parent folders have pending changes along with their children. I've tried checking in groups of changes at a time but to no avail.
Is there a way to reset the source control without erasing my TFS work items and change history?
if everything is as you want it in TFS, you can delete Your local workspace, to clear any files you have locally.
You can then goto to Advanced>Source Control and choose specific Version.
tick both boxes and click ok
when refactoring folder structures within TFS you are best to use the move function of TFS, (shown in first Pic). Move your folders, this way TFS will retain history, then open the solution and remap any projects that have moved

Cannot synchronize my project in VisualStudio

My team and I started a project at Azure and we have a git as the VCS/SCM.
One of my partners had made a few changes, and he had commited them. When I try to get those changes at my local repository, and I press sync at the Visual Studio, the following message appears
Cannot merge because there are uncommitted changes. Commit or undo
your changes before merging again. See the Output window for details.
The output window shows the message below
Cannot complete the operation because of existing changes to the
following file:Project\Project.csproj
I have searched everywhere at google, but I did not find anything similar.
Can anyone help me with this?
We are stack.
Thanks a lot
It probably means VisualStudio automatically added some references to the file ProjectProject.csproj, where it keeps general project settings. In VisualStudio 2013 you may do:
Go to the TeamExplorer
Select "Changes"
Search through Included and Excluded Changes, .csproj file is probably there
Right click on it and select compare with unchanged to see the differences
Now choose to commit it or undo the changes (if, for example, the changes are not necessary) to be able to sync with the current repository.
I had this same dilemma and it turned out that somehow the file that was preventing me from switching branches and was in my solution, was not being tracked like the other files were. I just added it to source control via the explorer window, committed and pushed it, then I was able to switch branches just fine. Hope this helps.

Pending changes in AnkhSVN only shows files from current solution

I'm working under a single repository and mostly in one solution.
However, during the work on the solution I do change other files as well, when I come to commit, however, AnkhSVN only shows the files that are part of the solution. That forces me to use TortoiseSVN to do the commit on the whole directory, which in turn misses some of the files that I added with AnkhSVN.
The simplest solution to this would be if AnkhSVN showed me ALL the pending changes for the repository. A worse alternative would be if AnkhSVN flagged added files so that TortoiseSVN would be also aware to them when doing commit from it.
Anyone knows a solution to these issues?
Thanks!
You can set an option to auto add files when new files are created that should be versioned by going to Tools -> Options -> Source Control -> Subversion Environment. Select "Directly add new files to Subversion" here.
Another alternative to make "New" files "Added" is the "Apply to Working Copy" command, available through the drop down next to the Commit button in the Pending Changes window.
In TortoiseSVN, there's a checkbox in the commit dialog "show unversioned items". If you check that box, the files that are not added yet are shown as well.
You can right click the svn folder then TortoiseSVN-->Add , will show all the items which is not included for supervision.
check the screen shot

How do we keep track of our working copy's branch?

Are there any good techniques to help us know which branch (or trunk) our working copy is from? We recently converted to Subversion and we're using release branches. I had two developers commit changes to the release branch that should have been committed to the trunk. We're using CI (TeamCity), so I recognized the problem right away and was able to revert the changes but I'd like to prevent it from happening again. From within Visual Studio, especially, it's easy to make a mistake and commit to the wrong branch.
We're using TortoiseSVN and AnkhSVN.
Edited to add:
Just to clarify, I'm looking for a method to prevent careless mistakes, I already know how to find this information. There are two careless mistakes I'm trying to prevent:
Doing work on the wrong branch. If this is caught before commit, the developer has to merge the changes back into the correct branch.
Committing to the wrong branch. This combines the pain of point 1 with having to revert the changes in Subversion.
Edited to add: We just made the switch to the VisualSVN VS plugin and it has a toolbar that displays the path of the current working copy. I really like the reassurance that I'm working on the right branch.
Perhaps you should consider using a pre-commit hook: http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html
Then you could do something like only approve checkins that have 'for release' in the comments for that particular branch or something like that and return an error message otherwise.
In AnkhSVN (in Visual Studio) the project url of your working copy is from is displayed in the 'Working on' field of the Pending Changes Window (View->Pending Changes).
The url of a file/folder is also displayed in the Visual Studio project window when you select a file in the Pending Changes Window or Working Copy Explorer (and in many cases even when you select a file in the Solution explorer; but this depends on the project type).
[Update: I just added AnkhSVN issue #581 for extension of the commit dialog.]
Tortoise SVN adds columns to the Windows Explorer view. In "Details" mode, right-click on column headers to get a list of available columns, at the bottom, select "More" to get a dialog of all available column types.
SVN short URL should quickly show you what the location is in the repository.
But this doesn't appear to work under vista ...
Right click the folder, move to the subversion tab, there it says the project it's linked to.
Also, in the commit dialog, it says so at the top of the dialog.
From the working directory:
svn info
URL will contain the branch your working directory points to.
<EDIT> Seeing how many people dislike the command line, the closes thing I found from TortoiseSVN is the "repo browser" which seems to use the selected branch as your starting path in the repo. </EDIT>
Avoid re-using working copies. If you're working on 2 places in the repository, have 2 working copies, named appropriately, like: Project-trunk, Project-release.
Here is a simple idea which might help:
Create an empty text file named "branch_XX" (or any name) and add it to your branch.
commit this and then when you switch to the trunk, the file will not appear in the solution explorer.
It sounds stupid... but it does the trick.
I really hope they will add something that might mark what branch we are using without going to other windows.
In AnkhSVN (in Visual Studio), right click on your project/solution, then Source Control -> Subversion -> Select in Repository Explorer. It will automatically select the branch you're currently working on (i.e. the branch you're switched to).
I don't think that the accepted answer for AnkhSVN works for Projects, since I always see the same URL in the "Pending Changes" even after I use the option "Switch Project" on a project.

Resources