0

If i want to pull changes from local branch to my main stream branch and don't want interim changeset history of local branch in main branch. How we can do it?

smooth reggae
  • 2,189
  • 13
  • 14

2 Answers2

0
  1. You can't rewrite changesets history on push to server
  2. You can rewrite local history in local repository before push
  3. You can perform partial push and send only specific branch(es) hg push -b ..., not the whole repo

Consolidation of 1-3 means

  • You have to have new, separate pushable branch
  • You'll merge to this branch and collapse it's history (MQ-patches, add extension: histedit|collapse)
  • Push this branch only
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
0

since it is not possible omit changesets when pushing, you can try this solution, it is not clear at all, but you can do it this way. Imagine your local hg log like this:

  • 5: top (this changeset you want to have in main branch)
  • 4: (local changeset)
  • 3: (local changeset)
  • 2: (local changeset)
  • 1: Change set what already is in main branch and should be parent of newly pushed changeset from local

If I had this issue I would update to 1, then revert all changest from 5 (so I will have working directory same as 5 is) then do temporarily commit (6), and this temporarily commit(same as changeset 5) I would push into main. In your local you can then merge 5 and 6 and continue, but there will allways be outgoing changesets from your local into main. Commands would look like this:

  1. hg up 1
  2. hg revert -r 5 -a (now you have your working dir same as 5)
  3. hg ci -m "Name of commit that will be shown in main branch"
  4. hg push -r 6 main_branch_path

But proper solution, is, as we use it this way, to keep all your devel changesets in main too. HTH

Václav
  • 365
  • 2
  • 15