문제

I noticed a problem:
In Mercurial bookmarks are intended to be used for feature-branches and be the equivalent of branches in Git. But In Git revision is always has an information about to which branch it belongs. So in Git we are always can say when work on feature is started and when - finished.

In Mercurial - bookmark points to just one commit, so we cant say where feature branch actually starts, and we cannot merge that feature branch back (because the revision will belong to the same branch as that revision we want to merge with). That is only possible if use named branches, but they are to 'heavy' for feature branches, while bookmarks seems to be too 'lightweight'.

What are common solutions of that problem and how proper feature-branching happens in Mercurial?

upd:
Approximate workflow for want I want to achieve is:
- Make new meaningless commit to default
- Update to previous commit, and make commits related to the feature
- Then merge with meaningless commit, and amend it with results of merge.

도움이 되었습니까?

해결책

  1. Git's "branches" and Mercurial's bookmarks are totally equivalent, with single small exception (unrelated to "lightweight branching"): Git branches pulled|pushed by default, Mercurial bookmarks are local and can be pulled|pushed only if it explicitly defined
  2. You are misinformed about metadata of Git-changesets - they does not contain branch-name, to which non-tip changeset belongs
  3. You can always merge bookmark to any other HEAD (or not head) of any branch and you haven't to know starting-point of feature-branch in order to do it: just up to merge-point and hg merge <bookmark>
  4. Read Steve Losh's "A Guide to Branching in Mercurial" in a part of "Branching with Bookmarks"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top