Version Control – Does Cherry-Pick Pull Changes as Uncommitted?

mercurialversion control

My team uses Mercurial for version control. Our development / version control routine is:

  1. all been committing to the same branch
  2. pulling for changes and rebasing our commits locally before pushing back to the hosted repository

This keeps everyone in sync. And the latest code (even unfinished code) is than grabbed from the tip of this branch and put into our test environment.

I've been tasked with creating a management process where we can more cleanly extract "completed features" into the test environment.

I've advocated that we begin to branch->pull-request->merge->close branch process, but I've been told that branching is not an option, and that the project director would prefer too be able to manually select commits representing completed features/bug fixes and only include those commits in a deployment to testing.

I am not sure what terminology besides cherry-pick in GIT / HG that would represent this process, and if it would even be advisable as the commits would no-longer have a proper revision history as it's my understanding that cherry-pick just pulls changes into the current working tree as uncommitted changes correct?

Best Answer

  1. Cherry-pick for Mercurial is hg graft
  2. History of grafted commits are easy recoverable, especially if graft performed with --log option and without --edit+madcap editing commit-message. Also the good GUI (TortoiseHG) reveals the history of grafting.

Toy-repo with some grafting in it (release+devel branching model)

Glog ouput in console:

hg glog --style changelog
2015-08-05  Author <email>

@       * c.txt, cd.txt:
|       Cnange 4
|       [769d5ba1b198] [tip] <release>
|
o       * c.txt:
|       Cnange 3 (grafted from 3044bbf6fe3542b86d0a1a84b7455d76928b559b)
|       [e58f524b1203] <release>
|
o       * a.txt:
|       Cnange 1
|       [23d4aaf0c632] <release>
|
o       * Release branch created
|       [9f39dda2e0d9] <release>
|
| o     * c.txt, cd.txt:
| |     Cnange 4
| |     [c5523fade515]
| |
| o     * b.txt:
| |     Edit 2
| |     [7efeb998f47e]
| |
| o     * a.txt:
| |     Edit 1
| |     [4f2e0bffed8a]
| |
| o     * c.txt:
| |     Cnange 3
| |     [3044bbf6fe35]
| |
| o     * b.txt:
| |     Cnange 2
| |     [278066927656]
| |
| o     * a.txt:
|/      Cnange 1
|       [e233699bf798]
|
o       * .hgignore:
        Initial structure
        [3bf949e66c66]

(grafted changesets 1,3,6. Only changeset 3 grafted with --log added. Note unchanged commit-message for 1 and 6)

and this repository after all grafting in TortoiseHG

Repo with grafting in THG

Related Topic