The Archives

SEARCH

I’m Attending

CodeMash

Tag Archives: source control

Resolving Tree Conflicts in Subversion

Posted in: Programming by Steve on October 28, 2010

I run across this error way too much.  I try to merge a branch into my working copy or another branch, and I get tree conflicts that I can’t explain.  It’s probably because I’m a VCS dummy or because I was doing it wrong at one point or another.

I found this blog post that described how to do branching & merging and it describes a step to resolve the tree conflicts.

svn resolve -R --accept working *

So now, It’s easy enough to just execute this command and move on.

Setting Up Mercurial

Posted in: Programming by Steve on September 30, 2010

With Atlassian acquiring BitBucket yesterday, it’s time to seriously look at moving to a distributed source control system.  We have been struggling with Subversion for a while now and it’s time to start getting our source control under control.

Here’s what you need to get going with Mercurial on Windows (other OS’s are listed too):

After getting everything installed, it’s time to work on getting our environment set for diffs, merges and comments.  I have grown to love Beyond Compare and Notepad++ and want to integrate it into Mercurial.  To do this, we need to set it in the mercurial.ini file.  This is located in c:\Users\<UserName>\mercurial.ini.  If it doesn’t exist, you must create it.

Here is my mercurial.ini:

[extensions]
extdiff =

[extdiff]
cmd.bcomp = c:\Program Files (x86)\Beyond Compare 3\BComp.exe
opts.bcomp = /ro

[tortoisehg]
vdiff = bcomp

[merge-tools]
bcomp.executable = c:\Program Files (x86)\Beyond Compare 3\BComp.exe
bcomp.args = $local $other $base $output
bcomp.priority = 1
bcomp.premerge = True
bcomp.gui = True

[ui]
editor = c:\Program Files (x86)\Notepad++\notepad++.exe
merge = bcomp
username = Stephen Wright (email addresss)

This will set your commit editor to Notepad++ and any merge/diff commands to Beyond Compare.

After saving this file, you can open up a command window and start typing commands.  You can create an account for free at BitBucket, then create a new repository.  You can then setup a local directory for your repo.

Clone Repo

Even though it is empty, this gives you an empty canvas to play with.

The next step is to create a readme file and add it to the repo.

Add File

To push your changes to the repo:

image

How to Rollback to a Earlier Revision in Subversion

Posted in: Programming by Steve on September 21, 2010

498474_88753320 So I’ve been working on a feature where I needed to strip out a lot of legacy code.  Unfortunately, as I was doing so, I was touching more of the code than I really wanted to.  The code in question was not under test and would have to be manually retested.

I had created a branch from the main development branch and had made several commits since the changes had started.  I needed to revert back to when I started tearing some of the original code out.

In Subversion, you have to merge the revision you want to go back to into your current revision and commit.

This is the command:

svn merge -r2467:2453

In my case, the revision I was on was 2467 (current revision) and I wanted to revert back to revision 2453 (revert to revision).

I haven’t had to do this before, and had to look it up.