开发者

How to manage this merge in Hg?

I took a clone of an开发者_运维问答 Hg repos a while ago, and have been making significant local commits (major version change).

In the mean time, the trunk has advanced slightly; several commits, but trivial changes.

Whats the easiest way to manage merging this branch back into the trunk?

Considering my "branch" has significant changes, would it be best to 'diff' the latest trunk, with the version of the trunk I "branched" from and then remake the same feature changes to my v2? - If so, how do I find out what this version is?

Thanks


From your comment it sounds like the problem is there are file renames (which haven't been done via Mercurial) which also contain small changes? You can use hg addremove -s with a value less than 100 to detect these

addremove [OPTION]... [FILE]...
    Add all new files and remove all missing files from the repository. 

    New files are ignored if they match any of the patterns in .hgignore. As
    with add, these changes take effect at the next commit.

    Use the -s option to detect renamed files.  With a parameter > 0,
    this compares every removed file with every added file and records
    those similar enough as renames.  This option takes a percentage
    between 0 (disabled) and 100 (files must be identical) as its
    parameter.  Detecting renamed files this way can be expensive.

    options:
    -s, --similarity  guess renamed files by similarity (0<=s<=100)
    -I, --include     include names matching the given patterns
    -X, --exclude     exclude names matching the given patterns
    -n, --dry-run     do not perform actions, just print output

TortoiseHg also provides a GUI way to do this via the Guess Renames menu


Maybe i'm missing something, but it looks quite easy:

  • Pull trunk changes to your local repo
  • Do a merge
  • push the merge

Nothing exotic... that's what mercurial is for! You can do a rebase instead of the merge if you like a clean history...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜