Blitz Mercurial SCM (HG) 4---Merge

Source: Internet
Author: User
Tags mercurial

Scenario:
Once you have modified your code, you have done a pull+update before you prepared the commit, did some conflict resolution work, and then verified that the code worked correctly.
After confirming that everything is OK, execute the HG commit and then execute the HG push. But there is a problem with the network and push fails. Wait until the network is back to normal, find that their version is not the latest version,
Push continues to fail. Tips:
Abort:push creates new remote head 8f1da767f592!
Hint:you should pull and merge or use push-f to force

Merge:
As indicated in the prompt, we need to update the code and do a merge operation before we can properly commit our own code.
After performing the Hg pull, Hg is very human to prompt us:
(Run ' HG heads ' to see heads, ' hg merge ' to merge)
When I directly execute the HG merge, Hg again prompts me:
Abort:outstanding uncommitted changes (use ' HG status ' to list changes)
It seems that there is still a problem, OK, first look at the help of the merge.
$ hg Merge--HELPHG merge [-P] [-f] [[-R] Rev]merge working directory with another revision the current working Directo    Ry is updated with all changes made in the requested revision since the last common predecessor revision. Files that changed between either parent is marked as changed for the next commit and a commit must be performed BEFO Re any further updates to the repository is allowed.    The next commit would have both parents. "--tool" can used to specify the merge tool used for file merges.    It overrides the Hgmerge environment variable and your configuration files.    See ' HG help Merge-tools ' for options.  If No revision is specified, the working directory's parent is a head revision, and the current branch contains exactly One other head, the other head was merged with by default.    Otherwise, an explicit-revision with which-to-merge with must is provided.    "Hg Resolve" must is used to resolve unresolved files. To undo an uncommitted MergE, use "HG update--clean." Which would check out a clean copy of the original merge parent, losing all changes. Returns 0 On success, 1 if there is unresolved files.options:-F--force Force a merge with outstanding Changes-r- -rev Rev revision to merge-p--preview review revisions to merge (no merge is performed)-T--tool VALUE specify Me Rge tooluse "hg-v help merge" to show more info

Try Hg update--clean and look good.
$ HG Update--clean8 files updated, 0 files merged, 1 files removed, 0 files unresolved

Execute merge again.

$ HG merge2 files updated, 0 files merged, 0 files removed, 0 files unresolved (branch merge, don ' t forget to commit)

Looks successful, follow the prompts and commit again. At this point our submission information is just a merge operation.
Then push, success. The result is the original commit or the changeset, and the latest commit is the one you just submitted with the message merge.
This merge is successful!

Blitz Mercurial SCM (HG) 4---Merge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.