How can I sync my custom CodePlex Mercurial fork against the main trunk?
Asked Answered
S

1

5

I've made a fork of some codeplex project. Done some extra code, etc and have even pulled my custom code into the source control repo.

In those few weeks and months since i was working on my own fork, their main trunk has been updated.

how can i sync my code with that of the trunk?

(the main reason for me wanting to sync my code with the trunk is that they upgraded to vs2010 and i'm still using a vs2008 project version :( ).

Sortie answered 19/8, 2010 at 8:18 Comment(3)
Are you looking for the mercurial merge command?Caldron
@borealid - merge? maybe :) any info on how to use that (before I google for it).Sortie
You have your local HG tree, and you pull in their remote HG head via hg pull, and then you do hg merge to merge the two heads.Caldron
P
9

I just ran into the same issue and ended up here. While the comments above lead to the correct answer, they may not cut it for a person new to Mercurial who wants to contribute to an open source project.

A plain hg pull would only pull any changes from your fork to your local cloned repository, not helpful in this case. There is an optional parameter [SOURCE] that allows you to pull from the trunk instead.

Here are the Mercurial command-line commands needed to do the job (replace "someprojectname" accordingly for your desired CodePlex project or, for similar systems, replace the entire URL with your fork's trunk's URL [vs. your fork's URL]):

  1. [Optional] See what changesets are in trunk but not in your local repository: hg incoming https://hg01.codeplex.com/someprojectname
  2. Pull new changesets to your repository: hg pull https://hg01.codeplex.com/someprojectname
  3. Merge those changes into your own code (resolving conflicts accordingly): hg merge
  4. Commit the results to your local repository: hg commit -m "Some message about merging changes from trunk."
  5. Push the updated version of your code from your local repository to your fork on CodePlex: hg push
Petiole answered 1/12, 2011 at 21:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.