I'm new to DVCS so I'm probably misunderstanding some concepts and terminology, but this is the idea of what I'm trying to achieve, and I'm trying to find out if either Bazaar or Mercurial supports this in a straightforward manner:
There is main repository with well-tested code. Say I clone (or pull or branch or whatever the terminology is) from that into a local repository, then every day as I work on the code I commit changes locally, sometimes multiple times a day.
After I'm done with all my changes and testing, I want to get only the latest (locally) committed version of every file put into the main repository, without the dozens of intermediate versions that I committed locally during debugging and unit testing.
From what I've been reading, apparently the entire history of those half-baked versions would get reflected in the main repository if I push to it. Some internet articles seem to suggest that rebase might address that issue if it's handled right, but it's not so clear if/how that can be done, as it seems like rebase is more for avoiding a bifurcated branch/merge history than for avoiding the committing of a large set of intermediate versions.