Does cherry-pick just pull changes into the current working tree as uncommitted changes?

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?

  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:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>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]
</code>
<code>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] </code>
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

I’m not sure about mercurial, but git cherry-pick will create a new commit to contain the changes unless you tell it otherwise. The crucial point is that it detaches the commit from its history, including any commits it depends on for proper operation. That also makes it a pain when you have to merge testing changes back into the development branch, and makes it difficult or impossible to use built-in version control tools to do just about any useful comparison you’d want to do between testing and develop, including simple questions like “Did that bug fix make it into testing?”

I would find out the reasons behind branching not being an option. Perhaps they are basing it on a previous bad merging experience in a subpar version control system (pretty much all of them were bad at merging before hg and git came along, and a lot still are bad).

I would sell feature branches as being able to select commits containing completed features together with all required dependencies, while always maintaining the ability to track and compare between development and testing. cherry-pick is useful to correct the occasional exceptional circumstance that your branching model didn’t account for, but using it as the total basis for your configuration management is asking for trouble.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật