1

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

Andrew Bullock
  • 36,616
  • 34
  • 155
  • 231
  • You should be able to find the revision you started working on by pulling the trunk changes and see where the branching starts – Cédric Rup Sep 13 '11 at 16:27
  • 1
    you may want to edit your question to elaborate on your comment about whole files being moved as this could be the key to the problem – jk. Sep 13 '11 at 16:31

2 Answers2

1

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

Jon Adams
  • 24,464
  • 18
  • 82
  • 120
jk.
  • 13,817
  • 5
  • 37
  • 50
0

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...

Cédric Rup
  • 15,468
  • 3
  • 39
  • 30
  • the changes are too severe, whole files (with likely small changes in trunk) have completely moved – Andrew Bullock Sep 13 '11 at 15:44
  • detect renames with hg addremove – jk. Sep 13 '11 at 16:15
  • if files were moved with mercurial, the merge should be able to follow. If classes were ripped off files, that won't do the trick... have you tried to do the merge on a clone of your local repo? – Cédric Rup Sep 13 '11 at 16:24