How to push a new feature to a central Mercurial repo?
Posted
by Sly
on Stack Overflow
See other posts from Stack Overflow
or by Sly
Published on 2010-04-08T12:25:10Z
Indexed on
2010/04/08
12:53 UTC
Read the original article
Hit count: 302
I'm assigned the development of a feature for a project. I'm going to work on that feature for several days over a period of a few weeks. I'll clone the central repo. Then I'm going to work locally for 3 weeks. I'll commit my progress to my repo several times during that process. When I'm done, I'm going to pull/merge/commit before I push.
What is the right way push my feature as a single changeset to the central repo? I don't want to push 14 "work in progress" changesets and 1 "merged" changeset to the central repo. I want other collaborators on the project to see only one changeset with a significant commit message (such as "Implemented feature ABC").
I'm new to Mercurial and DVCS so don't hesitate to provide guidance if you think I'm not approaching that the right way.
<My own answer>
So far I came up with a way of reducing 15 changeset to 2 changeset. Suppose changesets 10 to 24 are "work in progress" changesets. I can 'hg collapse -r 10:24 -m "Implemented feature ABC"'
(14 changesets collapsed into 1). Then, I must 'hg pull'
+ 'hg merge'
+ 'hg commit -m "Merged with most recent changes"'
. But now I'm stuck with 2 changesets. I can no longer 'hg collapse'
, because pull/merge/commit broke my changeset sequence. Of course 2 changesets is better then 15 but still, I'd rather have 1 changeset.
</My own answer>
© Stack Overflow or respective owner