ilf
ilf

Reputation: 33

Mercurial Commits vs Actual Production Graph

Ok, I've yet to see this popup as a combined question on mercurial, but it's something I've noticed recently.

When looking at other repos for development software, the commits are pretty much 'ideal' so if the objective was to fix a function f() then the commit is just 'fixed f() by ---'. My thing, I doubt every correction took place in just a single commit.

I would have something like

[1:trying x to fix f] -> [2:trying y to fix f] -> [3:trying z to fix f] -> [4:f fixed]

I noticed with or without named branches, if I try to then merge [4:fixed] to the 'stable' branch I have, then whether pushing or pulling the change, it pull [1:4] not just [4].

I would only want to push a clean correction to a repo or to a production setup. What's the easiest way to share all of my non-test changes?

Upvotes: 3

Views: 94

Answers (2)

Amber
Amber

Reputation: 527073

The rebase extension with --collapse.

Upvotes: 2

Joel B Fant
Joel B Fant

Reputation: 24766

If you only want to push a clean changeset, only make a clean changeset. Collapsing multiple local changesets into 1 (a la Amber's answer) is one way.

The way I prefer is to use Mercurial Queues and do my bits of work in a patch. Then when it is complete I finish the patch and becomes a changeset.

Upvotes: 1

Related Questions