Right, so last time I said I was thinking about merging. So here are my thoughts.
If you detect a conflict (ie, the last local revision is older than the the last commited revision) you need to figure out if you can patch it.
To do this step, you find the greatest shared revision of both files and get a diff against them. Then you compare the hunks of the two diffs. If you have hunks that overlap then you have a conflict, and you need to throw that hunk away, or at least think about it very carefully before you attempt to apply it. Hunks that don't overlap are applied to the local copy.
If you don't have any overlapping hunks then the merge is flawless and easy -- its just a patch. I've not figured out how to do more granular merging but at least I can detect it and deal with it at some level, and this is a step in the right direction.
Now of course I need to implement it...