Pending changes in AnkhSVN only shows files from current solution - visual-studio

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

Related

Why does TFS show pending changes for all my files when I haven't changed anything?

I am new to using TFS source control.
I have a large project which I have been porting from SVN. I am checked in and up to date with all projects. However, I opened up Visual Studio today and all project items are in the pending changes included window even though there are no changes.
I haven't touched or edited any of the files for my TFS files since last time.
To verify, I used Araxis Merge to do a folder comparison and can see that no actual changes have taken place.
Why are these unchanged files appearing in my check-in window?
Here is an example of a diff in visual studio from the previous version:
I can't see anything!
Hopefully this shows my local workspace
When you create or edit a workspace, you can specify whether its location is Local or Server. Local Workspaces are TFS's attempt at DVCS and actually gives you a much more SVN-Like experience.
Edit the workspace and choose advanced, you could see the Location of workspace type.
Maybe formatting, line endings, encoding. 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?

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.

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

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.

Is there a best practice to not forget SVN Add new files with Tortoise SVN?

We've been using Source Safe for years. Now we use Tortoise SVN. It's quite a problem to not forget to add new files to the repository - Source Safe had integration with Visual Studio but I don't see any for Tortoise SVN and so I often forget to add files and this breaks the build.
Is there some industry-wide practice for simplifying adding new files? Maybe some Tortoise SVN command like "show me all unversioned files"?
In the Commit window, there's a checkbox in the lower left "Show unversioned files." Check it, and you'll see everything that hasn't been added to the repository. You'll want to use this in conjunction with either global ignores which are in Tortiose's settings, or with svn ignores (right click on the file, add to ignore list).
One really good (and free) VisualStudio integration for svn is ANKH Svn. If you add files or projects to a solution it automatically adds it to the svn and commits them like you are used to from Tortoise. There is a "pending changes" window which also shows added files which haven't been comitted yet.
Apart from Tortoise's option to "show unversioned files", I'd suggest having a continuous integration server checking your builds. At least for me, this ensures that if I do forget to add a source file, the server finds out before any of my colleagues get to roll their eyes at me for forgetting.
Tortoise also add small icons over the files in Windows Explorer, unversioned files have a blue question mark over them and it's quite easy to spot them and remeber to add them.
Tortoise does have a command to show the unversioned files. There is a check box for it at the bottom of the commit dialog.
There are also several plugins for integrating svn into Visual Studio like VisualSVN and Ankh
As well as "show unversioned files", as others have mentioned, Tortoise SVN also lets you add the versioned state as an explorer column, which you can sort by. I've found this to be useful to visually see unversioned files in one place in a directory listing - but obviously only one folder at a time.
In either case, it's best to use these in conjuction with svn-ignore (which Tortoise makes easy), so you don't get binaries and other generated files showing up as noise.
When you commit, TortoiseSVB shows a list of all unversioned files, if you enable the checkbox for it.
SVN also has add-ons for Visual Studio. AnkhSVN is one on the top of my head.
You already said it: Tortoise has a
show unversioned files
checkbox to the bottom of the commit dialog and the "Check for modifications" window.
The solution I use now is the following.
When I need to add files to a project I of course use the "Add existing items" dialog, but this dialog shows files exactly the same way as Windows Explorer does and I can run any Tortoise SVN commands there. So I just do "SVN Add" there and then add files to the project.

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