How to repeatedly merge branches in Mercurial

后端 未结 2 1056
眼角桃花
眼角桃花 2021-01-31 22:10

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

  • Trunk
  • Tags
    • Production
  • Branches
相关标签:
2条回答
  • 2021-01-31 22:30

    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"
    
    0 讨论(0)
  • 2021-01-31 22:54

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

    0 讨论(0)
提交回复
热议问题