The 2010 and 2012 are essentially the same system, with that being said what are your application needs?
If you do a lot of 3D work or video work the 8 core is better for you, if you do a lot of photoshop work a 4 core with a higher processor speed could be better for you needs.
But all things being equal like you asked the 8 core is better. It has a better upgrade path, can hold more ram, has for the most part more processing power, and will have a better resale value.
The 2010 8-core is 2 quad-core 2.8 MHz Gulftown e5620 Xeons with 12 G of L3 cache; the 2012 is a single quad-core 3.2 MHz w3565 Xeon w 8 G of L3 cache. The 2010 comes with 6 GB stock expandable to 64, the 2012 comes with 6 GB stock expandable to 32. The 2010 has draft-n wifi while the 2012 has n wifi. Everything else is the same.
So if your software is capable of using 8 cores, the 8 core is better. If the software you are using has its strength elsewhere, such as in usage of L3, the 8 core is still better. If the software is not capable of using more than 4 cores it will run a bit faster (probably not really noticably) on the 4 core. If you will be handling a lot of simultaneous tasks, go 8 core.
But as violst says, it depends, because these two boxes are really very similar. You would have to be using the system exceptionally intensely to see the benefit of one over the other, and even then that benefit is qualified by the usage pattern. Assuming you are not, the differences are negligible enough to lean toward the 8 core machine for the reasons violist states. On the other hand, the cutoff for upgraded OS may disenfranchise the 2010 long before the 2012, but then they are so similar that the eventual cutoff may come at the same time for both of them. That's about as educated a guess as anyone can make on that front.
So even with all else held equal, one of those tiny advantages must really stick out for you to be the determining factor. Otherwise it is a virtual tie. Were it me, I'd go with the 8 core.