1
Question Body:

We're using Mercurial where I work and I want to have a setup similar to how I used SVN:

  • Trunk
  • Tags
    • Production
  • Branches

Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to repeatedly merge 'Trunk' with 'Production'.

Quite simply, I want to have a development branch for normal work and a production branch that I routinely pull changes from the development branch into. How do I do this with Mercurial?

Edit
avatar
asked15 years ago

    Leave a Comment

    [named hyperlinks] (https://example.com)
    **bold**
    _italic_

    2 Answer

    0

    Something like hg transplant? That's what we use on our dev and prod branches.

    Edit
    avatar
    answered15 years ago
    0

    As the previous poster mentioned, the transplant extension can be used for cherry-picking individual changes from one branch to another. If, however, you always want to pull all the latest changes, the hg merge command will get you there.

    The simplest case is when you're using clones to implement branching (since that's the use case Mercurial is designed around). Assuming you've turned on the built-in fetch extension in your .hgrc / Mercurial.ini:

    cd ~/src/development
    # hack hack hack
    hg commit -m "Made some changes"
    cd ../production
    hg fetch ../development
    

    If you're using local branches:

    hg update -C development
    # hack hack hack
    hg commit -m "Made some changes"
    hg update -C production
    hg merge development
    hg commit -m "Merged from development"
    
    Edit
    avatar
    answered15 years ago

    Your Answer

    Drop files here or click to upload.
    undraw-questions

    Disilab for your Teams

    – Collaborate and share knowledge with a private group.

    Create a free Team