Click here to Skip to main content
15,890,438 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Yet another Subversion rant Pin
robocodeboy29-Apr-13 22:28
robocodeboy29-Apr-13 22:28 
GeneralRe: Yet another Subversion rant Pin
DaveAuld19-Apr-13 6:14
professionalDaveAuld19-Apr-13 6:14 
GeneralRe: Yet another Subversion rant Pin
Brisingr Aerowing19-Apr-13 7:36
professionalBrisingr Aerowing19-Apr-13 7:36 
GeneralRe: Yet another Subversion rant Pin
PIEBALDconsult20-Apr-13 18:08
mvePIEBALDconsult20-Apr-13 18:08 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson22-Apr-13 11:09
professionalStuart Dootson22-Apr-13 11:09 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang23-Apr-13 4:54
Stefan_Lang23-Apr-13 4:54 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson23-Apr-13 5:56
professionalStuart Dootson23-Apr-13 5:56 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang23-Apr-13 22:21
Stefan_Lang23-Apr-13 22:21 
Stuart Dootson wrote:
when you branch in SVN, you're effectively copying the trunk (or whatever branch you're on) to a new location in the SVN repository (although, of course, it's all done with links, really). With Mercurial or Git, you're just adding a label to the current state of the repository that says what branch the revision is at the tip of.

Actually what you describe for Mercurial/GIT is exactly how the SVN/TSVN documentation describes branching in SVN. The only information stored is the revision number that the branch is based on. So the most recent common ancestor is known.


Stuart Dootson wrote:
1) Create an empty repository and create a file called a on the trunk (in SVN) or default branch (in Hg).

2) Create a branch called test_branch and make it the current branch.

3) Rename the file a to b (using svn rename/hg mv).

4) Merge test_branch back into the trunk/default branch.

 

With SVN (version 1.7.8), this resulted in two files on the trunk, a and b.

I currently use SVN 1.7.1 with Tortoise SVN and cannot reproduce this behaviour. I can still see a in the trunk if I go back to an older revision in the repo browser, but I cannot see a and b at the same time anywhere. Also, if I have either file in my working copy, updating to a newer or older revision will exchange the file as appropriate. If you use SVN correctly, you should not have or see both a and b in any single location. I should mention though that i don't have the command line interface installed, I only apply changes through TSVN, so I am less prone to obscure mistakes due to inappropriate command line parameters.

I do agree though that SVN can be fickle with respect to changes applied to a file that has been renamed in another branch. It's very eassy to lose those changes if you aren't careful. The best way is to commit all changes and synchronize all existing branches immediately before and after a rename. But of course that is not very practical ...

Since version 1.6 (IIRC) SVN does analyze and keep track of already performed merges in a trunk, so it should be able to recognize the greatest common change set and limit the merge to the change sets not yet applied. It surely could do a better job of marking individual change sets in the conflicting files, but other than that I don't think there's much to improve. I suppose there are notable differences in how conflicts are displayed in either tool, and some people may prefer one over the other. That said, SVN/TSVN lets you choose your own tool for viewing and editing conflicts (and I suspect the same is true for Mercurial), so you can choose the tool you feel most comfortable with.

The only thing I'm really not happy with is that there is currently no way for SVN to track moved code - specifically code moved to other files. In old legacy applications I often like to move entire functions to different files, or group them within a new class, split up huge files into multiple several ones, and the like. But whenever I do that, I effectively lose all history from that moved code! The only thing to do is add check-in comments and more comments within the code that point to its previous location. It would be really nice if a VCS were able to track this and keep history intact. But that would require a function level check-in, rather than file-level...
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson23-Apr-13 23:30
professionalStuart Dootson23-Apr-13 23:30 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 4:25
Stefan_Lang24-Apr-13 4:25 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson24-Apr-13 4:43
professionalStuart Dootson24-Apr-13 4:43 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 5:25
Stefan_Lang24-Apr-13 5:25 
GeneralRe: Yet another Subversion rant Pin
Trajan McGill24-Apr-13 11:35
Trajan McGill24-Apr-13 11:35 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 21:41
Stefan_Lang24-Apr-13 21:41 
GeneralRe: Yet another Subversion rant Pin
Trajan McGill25-Apr-13 5:28
Trajan McGill25-Apr-13 5:28 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang25-Apr-13 21:22
Stefan_Lang25-Apr-13 21:22 
GeneralRe: Yet another Subversion rant Pin
Trajan McGill26-Apr-13 4:57
Trajan McGill26-Apr-13 4:57 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 23:16
Stefan_Lang24-Apr-13 23:16 
GeneralRe: Yet another Subversion rant Pin
Stuart Dootson24-Apr-13 23:30
professionalStuart Dootson24-Apr-13 23:30 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang25-Apr-13 1:32
Stefan_Lang25-Apr-13 1:32 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang25-Apr-13 21:50
Stefan_Lang25-Apr-13 21:50 
GeneralRe: Yet another Subversion rant Pin
Member 376360822-Apr-13 13:07
Member 376360822-Apr-13 13:07 
GeneralRe: Yet another Subversion rant Pin
EdReel22-Apr-13 14:45
EdReel22-Apr-13 14:45 
GeneralRe: Yet another Subversion rant Pin
BobJanova22-Apr-13 23:55
BobJanova22-Apr-13 23:55 
GeneralRe: Yet another Subversion rant Pin
Stefan_Lang24-Apr-13 4:28
Stefan_Lang24-Apr-13 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.