Mercurial - the branch of the old code on top of the new code, ignoring the branch, is merged with the old code

I played with the Adium source code and found that they had an unreleased branch in adium-1.4which fixes Facebook chat integration using XMPP called facebook-xmpp. Everything is good there, performed it, and it works.

The problem is that if I wanted to have the same functionality in the latest Adium 1.5, whose code got a split from the older version about two years ago (with some changes from the old version, transplanted from time to time), what do I need somehow reinstall the entire range of sets of changes that make up the branch facebook-xmpp, and apply it to the end of the new branch adium-1.5. I thought this might work, as it facebook-xmpplooks like it is adding new code, so it should be easily integrated with the latest development code.

However, since the branch facebook-xmppmerged several times with adium-1.4, I found that rebasing would pull the merged changes from adium-1.4to adium-1.5, and this leads to a lot of merge conflicts.

---------------------------------------  adium-1.4
               |                   \---  facebook-xmpp (created 1 month ago)
               |
               \-----------------------  adium-1.5
               ^ sometime in 2009

, adium-1.5 , facebook-xmpp, , adium-1.4?

+3
1

1 ( )

, facebook-xmpp audium-1.5,

  • audium-1.4 facebook-xmpp,
  • audium-1.4 facebook-xmpp
  • -1.5.

, .

--------o---o    <- tip of audium-1.4
   \     \   \
    \     o---o  <- tip of facebook-xmpp (all audium-1.4 changes merged in)
     \
      o-------o  <- tip of audium-1.5 (apply patch here)

:

$ hg up facebook-xmpp
$ hg merge audium-1.4
$ hg commit -m "Merge audium-1.4 into facebook-xmpp"
$ hg diff -r audium-1.4 -r facebook-xmpp > fbx.patch # facebook-only changes
$ hg up audium-1.5
$ hg import fbx.patch # good luck

2 ( )

, , facebook-xmpp audium-1.5 , internal:local ( 1000 ), facebook-xmpp ( , ). , , , facebook.

UPDATE: . , facebook-xmpp fb-<something>.c foo.c bar.c ( facebook-xmpp audium-1.4). facebook-xmpp audium-1.5 :

$ hg up audium-1.5
$ hg --config ui.merge=internal:local \
     --config merge-patterns.fb-*.c=internal:merge \
     --config merge-patterns.foo.c=internal:merge \
     --config merge-patterns.bar.c=internal:merge \
     merge facebook-xmpp

, audium-1.5 , audium-1.4, audium-1.5. , , facebook-xmpp, , , , . , foo.c ,

$ hg resolve foo.c

. , , , audium-1.4. facebook-xmpp:

$ hg ci -I "fb-*.c" -I foo.c -I bar.c
$ hg up -C # get rid of remaining new files from audium-1.4
+3

All Articles