Changes

Jump to: navigation, search

Bugzilla:Patches

2,758 bytes added, 01:26, 20 February 2010
Add Bzr instructions
We also call patches "diffs", because one program used for making patches is called "diff".
== Using CVS =Bzr =
If you installed [[Bugzilla:Bzr|checked Bugzilla from the tarballout of bzr]], it's already set up so that then you can make diffs against CVSpatches using bzr. '''This is the preferred way of making patches.''' == The Simple Way: '''<code>bzr diff</code>''' == The simplest way to make a patch from your current bzr checkout is like this: <pre>bzr diff > patch.diff</pre> And that's it. Then you can upload "patch.diff" as your patch. == If Your Patch Contains Renames: '''<code>bzr bundle</code>''' == If your patch contains renames, then you have to use the '''<code>bzr bundle</code>''' command to produce your patch. To create a bundle: # first you have to locally commit your changes: <pre>bzr commit --local -m 235423</pre> There "235423" was the id of the bug I was working on. That's just a fake "commit message" for this patch, it doesn't really matter what I put there.# Then create the bundle: <pre>bzr bundle bzr://bzr.mozilla.org/bugzilla/trunk > patch.bundle</pre> There, "bzr://bzr.mozilla.org/bugzilla/trunk" is the branch that I'm creating this bundle against. The bundle will, in most cases, only work against that branch. Then you can attach the bundle just like a normal patch. When you upload it, note that it's a bundle in its description. For example, you might call it "v1 (bundle)". === Applying Bundles === If you have a bundle and you want to apply it to your local installation, you can do it like this: # Apply the bundle: <pre>bzr merge path/to/patch.bundle</pre># Remove the fake "commits" that were created while creating the bundle: <pre>bzr revert --forget-merges</pre> And now you have a checkout with the bundle applied, but without any of the "commits" involved in the bundle. == Moving, Adding, and Deleting Files == Before you make your patch, if you have added, moved, or renamed files, you will have to run certain commands so that those files will show up in your patch. * If you have '''added''' files, you can use '''<code>bzr add</code>''' to add them: <pre>bzr add ''path/to/file''</pre> Doing '''<code>bzr add</code>''' on a directory will add that directory and all files in it. Doing '''<code>bzr add</code>''' all by itself, with no arguments, will add every unknown file in your checkout.* If you have '''removed''' files, you don't ''have'' to do anything to make them disappear from your patch. However, if you want, you can use '''<code>bzr rm</code>''' to remove directories or files and also explicitly notify bzr that they're gone.* To rename a file, use '''<code>bzr mv</code>'''. If you've already renamed a file and you just want bzr to know that you renamed it, you can use '''<code>bzr mv --after</code>'''. (Or sometimes, just typing '''<code>bzr mv --auto</code>''' all by itself will have bzr automatically "figure out" if you've moved a file.) = Using CVS = Before Bugzilla used Bazaar, it used CVS, and if you installed Bugzilla from the tarball, it's set up so that you can make diffs against CVS.
1. Change to your Bugzilla directory:
(Except on Windows, that would be "cvsdo.pl" or "perl.exe cvsdo.pl" instead of just "cvsdo".)
== Using diff ==
Sometimes, for various reasons, you can't use CVS. In this case, you can get the difference between two Bugzilla ''directories'', one which contains the base Bugzilla, and one which contains your modified Bugzilla.
Canmove, confirm
345
edits

Navigation menu