Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:21:47+00:00 2026-05-25T19:21:47+00:00

I have a graphlog that looks something like this: (snip) | | | o

  • 0

I have a graphlog that looks something like this:

(snip)
  | |
  | o    1) Other Dev: Commit
  | | \
  o | |  2) Me: Commit
/ | | |
| | o |  3) Other Dev: Commits with an error
| |/| |
| o |/   4) Me: Merge and commit
|  /|    
|/  |
o   |    5) Me: Realize there were bugs in the commit and take earlier version to merge with
|   o    6) Other Dev: Fixes error
o /      7) Me: committing some changes
|/
o        8) Me: Merge fixed tip

At (8), everything is as it should be with the exception of the dangling extra head at (4). To get rid of it I have to merge (4) -.-> (8) but, since there is nothing in (4) that I need, I can safely discard all of it’s changes. I could do this merge manually file-by-file (and usually this isn’t that big a deal) but for my own edification – is there a simple one-line way to say “merge (4) with (8) and always take (8)”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:21:48+00:00Added an answer on May 25, 2026 at 7:21 pm

    Yes. The internal:local builtin merge tool.

    $ hg merge 4 --tool internal:local
    

    Similarly there’s internal:other that picks the other version of files as the merged version.

    Here’s an example to clarify what’s going on, start off with a repo with a single file:

    $ echo a >> a
    $ hg ci -Am.
    adding a
    $ echo a >> a
    $ hg ci -Am.
    

    Branch it and put a conflict in a:

    $ hg up 0
    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    $ echo b >> a
    

    Also add another file just in the merged in branch:

    $ echo b >> b
    $ hg ci -Am.
    adding b
    created new head
    

    Go back and merge the anonymous head:

    $ hg up 1
    1 files updated, 0 files merged, 1 files removed, 0 files unresolved
    $ hg merge 2 --tool internal:local
    1 files updated, 1 files merged, 0 files removed, 0 files unresolved
    (branch merge, don't forget to commit)
    

    Naturally at this point without the merge tool we’d get a conflict on a. But using the merge tool, we’re telling Mercurial to take the version of the first parent on every file that the merged with cset has also touched.

    $ hg st
    M a
    M b
    $ cat a
    a
    a
    $ cat b
    b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
have a php code like this,going to convert it in to C#. function isValid($n){
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have some dates in my local Oracle 11g database that are in this format:
Have a text box which get data for price. If someone enter something like
have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
Have converted devise new session from erb to Haml but doens't work, this is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.