SVN Commit Issue - eclipse

Whenever I commit some code to my SVN repository and then do a Synchronization again with the repository the "Team Synchronizing" panel shows me that there is a update to be taken on my code and it shows 0 files and just an "empty update" to update to the latest revision number (the revision number of the recent code commit which I did) in the eclipse. I am on Windows 7. I have used the same tools in Mac and it works fine. Whenever I do a commit in Mac Eclipse it automatically updates it self.
Is this a bug or is there something I am missing?
Any help would be appreciated.

I suspect that although you have Eclipse on both Mac and Windows, the SVN plugin, or the SVN connector used by that plugin, is different between your two setups.
I'm afraid I don't have details to hand, but have seen this behaviour before. The SVN integration in Eclipse makes most sense if you end up with no incoming changes after you do a commit. It seems one of the Eclipse plugins decides after commit to immediately poll for any outstanding changes. It sees that the top-level folder for your project has been updated, so marks it for update.
This is an accurate reflection of what happens in SVN - if you commit a new revision is created in the repository, but your local checkout is not at that revision until you do an update. If you run "svn info" on the command line just after a commit you will see this.

Related

Eclipse SVN: How to recommit after failed commit

Problem
So, the repository I am trying to commit 50 files into has some pre-commit-hooks in place, of which I failed one.
Question
Is there a way to commit the same files again quickly, without having to select them one by one in the tedious Team -> Commit dialogue, e.g. by a hidden buffer or even a staging area like Git has?
My tools
Eclipse Version: Version: Oxygen.3a Release (4.7.3a)
Subclipse 4.2.4
No, not really. The Eclipse Synchronize view does have a changesets feature you can use to manually put your changes into changesets and you can then commit the changeset. If you are using Eclipse Mylyn this can be somewhat automated by following the Mylyn workflow. That is about it though.

Subversion merge loops over the same revision

Using Subversion plugin in Eclipse Juno, am trying to merge 80+ revisions from branch B to A. The point is that, some revisions were already merged manually. But there is no reference tells which revisions were merged manually, so, I decided to merge all 80+ revisions.
After merging each revision, SVN prompts me with current conflicts to resolve, I do resolve them by hand, then mark the file as resolved. Every thing is happy so far.
But when I mark all conflicts as resolved, SVN should try to merge the next revision and so on, but it merges the same revision again and again, showing the same conflicts and I resolve them again, it loops infinitely this way.
I figured out that, this happens only with revisions which were manually merged earlier. And could not find any online talk about this issue. Any help?
I tried to do the same thing with Eclipse Luna and it worked as normal, so it seems to be bug with subversion plugin of eclipse juno.

How to make a tag in SVN using eclipse?

I'm using eclipse and Subversion (SVN) is my new version control.
Till now I used to use Concurrent Versions System (CVS) as my version control and after deploy operation I used to tag my projects with Tag as Version in eclipse like this:
Team --> 'Tag as Version..' --> Version-X-Y-Z
How can I do it now using SVN?
Normally, SVN has three root level directories,
trunk
tags
branches
In SVN server, for each project, you have the same above directory structure.
'trunk' is where you keep your ever developing code base.
'tags' is used for the same purpose that you've indicated. i.e. for versioning.
'branches' is used for things like feature developments/individual development.
An example,
Let's say I am developing a database synchronization application which will go out as Pilot release, Moonshine release, Kilimanjaro release, Great release and onwards..
I start in 'trunk' and continue my development for let's say 2 months at which time I am ready for Pilot release..
Then I create a 'tag' of the 'trunk' which I can name 'Pilot tag' which will be released to customers..
Now my main feature developments for next release which is 'Moonshine release' will continue in the 'trunk'. If their are any immediate bug fixes or show-stoppers in my 'Pilot release' those will be done in the 'Pilot tag' and released to the customers immediately..
However since the above fixes are not in my 'trunk' code, sometime later (before releasing the Moonshine release) I will 'merge' the modifications done in my 'Pilot tag' back to 'trunk'.
Here, there can be conflicts since the same code lines could have been modified in both 'Pilot tag' (for bug fixing mentioned earlier) and in 'trunk' (for feature modifications/development of new release). In this situation, you have to carefully review the conflicts, edit any such conflicts and accept the changes.
TortoiseSVN is the primary client tool for using SVN. It embeds features directly to your Windows right click menu for all above mentioned functionalities like commit, update, merge, branch (i.e. tag or branch) etc.
And for conflict resolution I personally prefer 'Beyond Compare' which is a third party application which you have to buy. You can setup TortoiseSVN to invoke Beyond Compare as the application for conflict resolution and it is far better and user-friendly than the built in conflict editor in TortoiseSVN tool.
You would need to install an Eclipse Subversion plugin like subclipse or Subversive. This will provide the same facility as that available for CVS.
For instance, here is the documentation on how to tag using Subversive.
To TAG, using Eclipse with SubClipse:
select Team, Branch/Tag, then click the 'select' button and drill into the appropriate project, then click 'tags' directory, and drill down to your last tag name or any similar name you plan on creating.
The full URL is copied into bar, then you can edit it changing the rightmost tag name portion to any new tag name.
Click next, select from HEAD (HEAD is referring to the repo path you have established already on previous page so in fact may be the Head of a Branch).
Enter a comment like 'tagging <appName> Release <for reason> version x.y.z'
Finish -
You can prior to this point or after, open the Eclipse 'SVN Console' from dropdown on right bottom of page, and see most recent SVN commands generated and there results.
Every checkin in SVN creates an new revision number. SVN revision number should be equivalent of your tag. Remember the SVN revision number for the production build.
Tagging and branching in Subversion works differently from CVS. In Subversion, "to create a tag" means to copy a revision (typically HEAD, but it can be some other revision) to a new directory within the "tags" directory. That is why, when you go to Team->Branch/Tag..., Eclipse is asking you for a URL to copy to.
Check out this page for a more detailed explanation of tagging in Subversion.
To help you understand how things are done "the SVN way," I'd recommend practicing Subversion usage from the command line, before trying it on Eclipse. Or, if not, at least open an SVN console in Eclipse to see the commands that it runs--you'll see that the tagging operation is indeed an svn copy.

Completely delete commits made on Google Code

After working the whole day with Google Code our group of developers was able to evolve a good workflow, however our work for now wasn't that what we expected so i would like to know whether there is an easy possibility to return to "Revision 3" from the current "Revision 27" and to delete all releases/commit > 3 without having to create a new project (so that we have a clean project). We are working with Eclipse Helios and Mylyn with Subversive SVN.
You won't be able to delete it from the repository, but you will be able to commit a change which will undo all the commits from 4 to 27.
See http://svnbook.red-bean.com/nightly/en/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo and my answer in SVN Revert Trunk, remove a revision as if it never existed?

Rolling back bad changes with svn in Eclipse

Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep.
What would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as those relating to the good changes. How things change if good changes were made to same files as bad changes?
I am mostly looking a way to do this via Eclipse plugins (Subclipse or Subversive) but commandline commands are also interesting.
In Eclipse Ganymede (Subclipse)
Select project/file that contains bad change, and from pop-up menu choose:
Team -> Show History
Revisions related to that project/file will be shown in History tab.
Find revision where "bad changes" were committed and from pop-up menu choose:
Revert Changes from Revision X
This will merge changes in file(s) modified within bad revision, with revision prior to bad revision.
There are two scenarios from here:
If you committed no changes for that file (bad revision is last revision for that file), it will simply remove changes made in bad revision. Those changes are merged to your working copy so you have to commit them.
If you committed some changes for that file (bad revision is not last revision for that file), you will have to manually resolve conflict. Let say that you have file readme.txt with, and bad revision number is 33. Also, you've made another commit for that file in revision 34. After you choose Revert Changes from Revision 33 you will have following in your working copy:
readme.txt.merge-left.r33 - bad revision
readme.txt.merge-right.r32 - before bad revision
readme.txt.working - working copy version (same as in r34 if you don't have any uncommitted changes)
Original readme.txt will be marked conflicted, and will contain merged version (where changes from bad revision are removed) with some markers (<<<<<<< .working etc). If you just want to remove changes from bad revision and keep changes made after that, then all you have to do is remove markers. Otherwise, you can copy contents from one of 3 files mentioned above to original file. Whatever you choose, when you are done, mark conflict resolved by
Team - Mark Resolved
Temporary files will be removed and your file will be marked changed. As in 1, you have to commit changes.
Note that this does not remove revision from revision history in svn repository. You simply made new revision where changes from bad revision are removed.
You have two choices to do this.
The Quick and Dirty is selecting your files (using ctrl) in Project Explorer view, right-click them, choose Replace with... and then you choose the best option for you, from Latest from Repository, or some Branch version. After getting those files you modify them (with a space, or fix something, your call and commit them to create a newer revision.
A more clean way is choosing Merge at team menu and navigate through the wizard that will help you to recovery the old version in the actual revision.
Both commands have their command-line equivalents: svn revert and svn merge.
If you want to do 1 file at a time you can go to the History view for the file assuming you have an Eclipse SVN plugin installed. "Team->Show History"
In the History view, find the last good version of that file, right click and choose "Get Contents". This will replace your current version with that version's contents. Then you can commit the changes when you've fixed it all up.
In Eclipse using Subversive:
Right click your project > Team > Merge
In the merge window, select the revisions you want to revert as normally but also enable checkbox "Reversed merge".
Merge as normally.
I have written a couple of blog posts on this subject. One that is Subclipse centric: http://markphip.blogspot.com/2007/01/how-to-undo-commit-in-subversion.html and one that is command-line centric: http://blogs.collab.net/subversion/2007/07/second-chances/
The svnbook has a section on how Subversion allows you to revert the changes from a particular revision without affecting the changes that occured in subsequent revisions:
http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.undo
I don't use Eclipse much, but in TortoiseSVN you can do this from the from the log dialogue; simply right-click on the revision you want to revert and select "Revert changes from this revision".
In the case that the files for which you want to revert "bad changes" had "good changes" in subsequent revisions, then the process is the same. The changes from the "bad" revision will be reverted leaving the changes from "good" revisions untouched, however you might get conflicts.
I have same problem but CleanUp eclipse option doesn't work for me.
1) install TortoiseSVN
2) Go to windows explorer and right click on your project directory
3 Choice CleanUp option (by checking break lock option)
It's works.
Hope this helps someone.