Alec Jacobson
Alec Jacobson

Reputation: 6264

Using mercurial why would I ever want to merge without committing?

Perhaps I'm biased from years of svn but why would I ever want to merge with a different branch then make some changes before committing. The hg output itself suggests otherwise:

(branch merge, don't forget to commit)

Dear hg, then why didn't you just do it for me?

Upvotes: 2

Views: 53

Answers (2)

Reimer Behrends
Reimer Behrends

Reputation: 8720

Because a merge operation is not guaranteed to produce correct output (automatic merges can use bad heuristics for how to deal with conflicts, manual merges can suffer from human error). Usually, what you will do is the following:

  1. Merge.
  2. Build.
  3. Test.
  4. If the test failed, fix the issue, go back to 2.
  5. Commit.

Upvotes: 5

Lazy Badger
Lazy Badger

Reputation: 97282

Mercurial does not suggests otherwise, it 's just reminder: "All merge-related changes stored only on Working Dir, commit results into repository for permanent storing" and doesn't prohibit you to make some additional changes in code before commit.

But separation of tasks (merge and not-related to merge changes - i.e changes not initiated by merge-conflicts) into separate changesets is good idea anyway

Upvotes: 1

Related Questions