3

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?

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
ilf
  • 33
  • 2
  • Just curious why do you commit if *it is not a fix*? – zerkms Sep 21 '11 at 03:43
  • Every commit is a "fix" within development, however they are the smaller fixes needed to make a bigger "fix" for production. It's the motto of "Commit Often". I also work on a lot of various components within development, so it's nice to have everything in-check. I found my answer as "staging changesets" online. So if I stage the changes, instead of getting 50 minor revisions, they will get one mass revision containing all the minor revisions needed for the fix... – ilf Nov 20 '11 at 00:43

2 Answers2

2

The rebase extension with --collapse.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Amber
  • 507,862
  • 82
  • 626
  • 550
1

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.

Joel B Fant
  • 24,406
  • 4
  • 66
  • 67
  • I found a way to stage the changes into thew now various levels of production, so that as development moves forward only the 'approved features' show up in production. I have considered Mercurial Queues, but I can't seem to wrap my head around it... – ilf Jan 27 '12 at 03:37