This project is read-only.

How to accept contributions to your CodePlex project

Who is this for?

This document is for developers/coordinators on a CodePlex project that wish to accept and apply patches from the community.

Get the CodePlex Client

Download CodePlex Client (installation instructions).

Install a diff/merge tool

You will need to install a diff/merge tool in order to be able to validate your changes. Our configuration information contains pre-canned configuration items for many free (and a couple for-pay) diff/merge tools. I would strongly recommend you choose a tool which does 3-way merges. I personally use and love TortoiseMerge from TortoiseSVN. If you don't know which one to choose, you might start with that one.

Get a clean copy of the source code and apply the patch

You will want to apply the patch to a clean copy of the source code, rather than your current working area. Download a copy of the patch file from your project Source Code tab to your local disk (f.e., to C:\Patch.xml).
  1. Make a new directory
  2. Checkout a clean copy of the source code
  3. Apply the patch
C:\> md MyProjectSrc
C:\> cd MyProjectSrc
C:\MyProjectSrc> cpc checkout MyProject
[...checkout output...]
C:\MyProjectSrc> cpc applypatch C:\Patch.xml
[...patch output...]

Inspecting the patch results

The apply patch process will roll back individual files to the version that the person patched from, and then apply their differences. Note that these changes files remain the older version, so that it's easy to see the exact changes the user made. You can use "cpc status /gui" to view the changes using your installed GUI diff tool.

However, the codebase may have progressed since the patch was submitted, so they may not build properly any more. After you've inspected the patch results, and want to see how well they work, you should run "cpc syncup" to get all the source back to current versions. This may cause conflicts for files that have revved since the patch, so after running syncup, you will want to run "cpc status /gui" again to examine and resolve the conflicts with your installed GUI merge tool.

Happy with the patch?

If you're happy with the patch, you will want to take the following steps:
  • Ensure the patch is fully functional, by testing your application and/or running your unit tests.
  • Commit the patch using "cpc commit".
  • Mark the patch as Accepted on the Source Control tab of your project.
  • If the patch resolved any issues, visit those issues on the Issue Tracker for your project and mark them as fixed or closed as appropriate.

Not happy with the patch?

If you've decided to reject the patch, you will want to take the following steps:
  • Mark the patch as Declined on the Source Control tab of your project.
Note: Once a patch has been declined, only project coordinators/developers will be able to download it.

Cleaning up

Once you're done, you can delete the temporary folder you made for your source code.

Last edited Jun 4, 2007 at 9:14 PM by BradWilson, version 1


r_keith_hill Apr 4, 2010 at 7:53 PM 
Just out of curiousity (as a long time TFS user), why weren't shelvesets used for this? It sure would be easier to integrate somebody's shelveset right from within Visual Studio.

JayBeavers Nov 21, 2007 at 11:20 AM 
Sure would be nice if we had a "cleanup" tool (like Purger for the Source Depot system) that could clean an enlistment back to "virgin" state rather than having to delete/reenlist each time we want a clean directory to test a patch in. I worry about the load generated on Codeplex once we have more large project and we're having to reenlist large projects just to look at a patch.

BradWilson Sep 3, 2007 at 1:00 PM 
PandaWood, that usually means one of two things:
1. You tried to apply the patch to a copy of the source code that you did not get using cpc. This is likely to be the case if you see this message for every patched file in the XML patch file.
2. Both you and the patch submitter created a new file with the same name, and it doesn't know how to merge those changes into your source without overwriting your file in its entirety.

PandaWood Aug 19, 2007 at 10:26 AM 
How do I interpret the error "error: Won't clobber writable filename.cs" that occurrs when I run "cpc applypatch filename.xml"?