Django

Code

Changeset 4203

Show
Ignore:
Timestamp:
12/14/06 15:02:30 (2 years ago)
Author:
adrian
Message:

Beefed up 'Using branches' part of docs/contributing.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/contributing.txt

    r4191 r4203  
    5050      cases, etc. This means including a clear, concise description of the 
    5151      problem, and a clear set of instructions for replicating the problem. 
    52       A minimal example that illustrates the bug in a nice small test case  
     52      A minimal example that illustrates the bug in a nice small test case 
    5353      is the best possible bug report. 
    5454 
     
    126126      it obvious that the ticket includes a patch, and it will add the ticket 
    127127      to the `list of tickets with patches`_. 
    128        
    129     * The code required to fix a problem or add a feature is an essential part  
     128 
     129    * The code required to fix a problem or add a feature is an essential part 
    130130      of a patch, but it is not the only part. A good patch should also include 
    131131      a regression test to validate the behavior that has been fixed (and prevent 
    132       the problem from arising again).  
    133        
    134     * If the code associated with a patch adds a new feature, or modifies behavior  
     132      the problem from arising again). 
     133 
     134    * If the code associated with a patch adds a new feature, or modifies behavior 
    135135      of an existing feature, the patch should also contain documentation. 
    136136 
     
    148148============= 
    149149 
    150 Unfortunately, not all bug reports in the `ticket tracker`_ provide all  
     150Unfortunately, not all bug reports in the `ticket tracker`_ provide all 
    151151the `required details`_. A number of tickets have patches, but those patches 
    152152don't meet all the requirements of a `good patch`_. 
    153153 
    154154One way to help out is to *triage* bugs that have been reported by other users. 
    155 Pick an open ticket that is missing some details, and try to replicate the  
     155Pick an open ticket that is missing some details, and try to replicate the 
    156156problem. Fill in the missing pieces of the report. If the ticket doesn't have 
    157157a patch, create one. 
     
    160160patch with all the required features, e-mail `django-developers`_. Indicate 
    161161that you have triaged a ticket, and recommend a course of action for dealing 
    162 with that ticket.  
     162with that ticket. 
    163163 
    164164At first, this may require you to be persistent. If you find that your triaged 
     
    388388-------------- 
    389389 
    390 To test a given branch, you can simply check out the entire branch, like so:: 
     390To use a branch, you'll need to do two things: 
     391 
     392    * Get the branch's code through Subversion. 
     393 
     394    * Point your Python ``site-packages`` directory at the branch's version of 
     395      the ``django`` package rather than the version you already have 
     396      installed. 
     397 
     398Getting the code from Subversion 
     399~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     400 
     401To get the latest version of a branch's code, check it out using Subversion:: 
    391402 
    392403    svn co http://code.djangoproject.com/svn/django/branches/<branch>/ 
    393404 
    394 Or, if you've got a working directory you'd like to switch to use a branch, 
    395 you can use:: 
     405...where ``<branch>`` is the branch's name. See the `list of branch names`_. 
     406 
     407Alternatively, you can automatically convert an existing directory of the 
     408Django source code as long as you've checked it out via Subversion. To do the 
     409conversion, execute this command from within your ``django`` directory:: 
    396410 
    397411    svn switch http://code.djangoproject.com/svn/django/branches/<branch>/ 
    398  
    399 ...in the root of your Django sandbox (the directory that contains ``django``, 
    400 ``docs``, and ``tests``). 
    401412 
    402413The advantage of using ``svn switch`` instead of ``svn co`` is that the 
    403414``switch`` command retains any changes you might have made to your local copy 
    404 of the code. It attempts to merge those changes into the "switched" code. 
     415of the code. It attempts to merge those changes into the "switched" code. The 
     416disadvantage is that it may cause conflicts with your local changes if the 
     417"switched" code has altered the same lines of code. 
     418 
     419(Note that if you use ``svn switch``, you don't need to point Python at the new 
     420version, as explained in the next section.) 
     421 
     422.. _list of branch names: http://code.djangoproject.com/browser/django/branches 
     423 
     424Pointing Python at the new Django version 
     425~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     426 
     427Once you've retrieved the branch's code, you'll need to change your Python 
     428``site-packages`` directory so that it points to the branch version of the 
     429``django`` directory. (The ``site-packages`` directory is somewhere such as 
     430``/usr/lib/python2.4/site-packages`` or 
     431``/usr/local/lib/python2.4/site-packages`` or ``C:\Python\site-packages``.) 
     432 
     433The simplest way to do this is by renaming the old ``django`` directory to 
     434``django.OLD`` and moving the trunk version of the code into the directory 
     435and calling it ``django``. 
     436 
     437Alternatively, you can use a symlink called ``django`` that points to the 
     438location of the branch's ``django`` package. If you want to switch back, just 
     439change the symlink to point to the old code. 
     440 
     441If you're using Django 0.95 or earlier and installed it using 
     442``python setup.py install``, you'll have a directory called something like 
     443``Django-0.95-py2.4.egg`` instead of ``django``. In this case, edit the file 
     444``setuptools.pth`` and remove the line that references the Django ``.egg`` 
     445file. Then copy the branch's version of the ``django`` directory into 
     446``site-packages``. 
    405447 
    406448Official releases