0

I think it is common practice of many development teams to create new features or bugfixes in a separate feature clone repository and pull and merge back if the feature/bugfix is ready.

However, sometimes I don't want to include all of incoming changes. To harness all the power of DVCS to review incoming changes I think it is necessary to be able to fully modify and select single aspects of the incoming changes.

What's the preferred workflow for this scenario?

As far as I know transplant extension offers the possibility to pick single changesets but I would also like to prune/pick on a path/file base e.g. to exclude some test scripts or stuff like that, that isn't required for the final feature anymore.

Since transplant is an extension, what's the official way to have a "clone, change, ... review" cycle in HG?

Peter
  • 785
  • 2
  • 7
  • 18

1 Answers1

1
  1. Mercurial is changeset-centric VCS, thus - operational object is changeset, cherry-picking inside changeset not possible at all
  2. In Mercurial you can't discard some of incoming changesets in bundle (but can do in Git, AFAICR)
  3. It's not official way in any form, just personal POV: because pull produce anonymous branch, before merging this branch with mainline you can edit branch content in order to exclude unwanted parts, using

    • histedit - delete changests, join
    • MQ - remove changeset from branch, edit content of changeset (convert to MQ-patch, edit, finish, reorder)
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • 1.) I didn't want to pick on single HUNKs but on paths. I think using the convert extension and a temporary clone could do this (with a lot of manual work overhead of course) – Peter Feb 01 '12 at 09:30
  • 2.) Maybe I could use graft or transplant to pick from the pulled head, but then I would still have to edit the repository using a temporary clone to abandon the rest of the incomming changes. – Peter Feb 01 '12 at 09:32
  • 3.) I guess using histedit would render the fork/branch clone where I got the pull-request from unable to update from upstream? – Peter Feb 01 '12 at 09:34
  • The best idea maybe is to pull into a local clone of the mainline, then cherrypick from the pulled head using graft or transplant and then drop the pulled head using 'push -r', 'push -b' or 'hg clone' in a similiar way. I have to try this. – Peter Feb 01 '12 at 09:37
  • @Peter - I'll answer in one big heap. 1. If you want path-based pick, you can split-delete-finish **pulled** changeset with (again) MQ + histedit. 2. Graft **ideologically* is better than transplant 3. Any editing history produce at least new anonymous branch after pulling edited cset (we changed cset-hash) – Lazy Badger Feb 01 '12 at 18:54