Difference between revisions of "Newbie Guide for Windows People Working on Minor Bugs"

From Dreamwidth Notes
Jump to: navigation, search
(Oops)
(warning about manual editing)
Line 181: Line 181:
  
 
For more commands, see https://developer.mozilla.org/en/Mercurial_Queues
 
For more commands, see https://developer.mozilla.org/en/Mercurial_Queues
 +
 +
!!! Do not manually edit your patch. This may cause errors and your patch won't work.
  
  

Revision as of 12:00, 29 October 2009

To Wikify: http://experiment.dreamwidth.org/9596.html

Installing and Settings Things Up

You'll only have to do this once.


Get a Dreamhack

What's a Dreamhack? To put it simply, it's a mirror of the Dreamwidth site where you can test your changes.

  • Get PuTTY - choose the 'Windows installer for everything except PuTTYtel' .exe file - and install it.
  • Run PuTTY. In the configuration window, enter "hack.dreamwidth.net" for the host name. Go to Connection/Data and enter the username/login given to you in the welcome e-mail. It should be something like dh-xxx.
You may also want to change the Window/Appearance, Window/Colours and Window/Selection settings.
Once you're done, go back to Session. Select Default Settings and click on Save.
  • Click on Open. Click Yes on the pop-up message box.
  • Enter the password given to you in the welcome e-mail when asked. Note that no characters are displayed and the cursor won't move. It's normal.
  • Change your password by typing:
    passwd
  • On your Dreamhack, the default user is called 'system'. You need to set its password so you can access this account. Type:
    $LJHOME/bin/upgrading/make_system.pl
  • Once you're done type:
    start-apache


Install WinSCP

What for? WinSCP will allow you to see and manage the files of your Dreamhack. You'll use it to edit the theme/layout files.

  • Install WinSCP. I chose the Explorer mode because I don't need to access any files on my computer but choose what's best for you.
  • Use "hack.dreamwidth.net" for the host name. Enter your username and password. Click on Save then on Login.


Set Up Your Dreamhack

Again?! Yes, you need to create some files that will make keeping your Dreamhack up-to-date easier.

N.B. To create files, go to WinSCP, go to the right directory, right-click on New/File and edit.
  • Also create the dwu, dws and dwdb scripts as explained in Scripting.
  • In PuTTY, type this then Enter:
cd $LJHOME/cvs/dw-free
hg qinit -c

This will create a directory where your patches will be put into: ~/dw/csv/dw-free/.hg/patches/

  • Do the same thing with dw-nonfree if you're working with non-free styles:
cd $LJHOME/cvs/dw-nonfree
hg qinit -c

The directory will be: ~/dw/csv/dw-nonfree/.hg/patches/


Create a Bugzilla account

Simply click here.


How All of This Works

  • Your Dreamhack has two parts:
    • the live part (~/dw/*)
    • two main repository parts (~/dw/cvs/dw-free/* and ~/dw/cvs/dw-nonfree/*).
  • But you edit files in the repository parts and you create patches in the repository parts.
  • To make the live part match the repository parts, you use 'synchronize' and 'update database':
cd $LJHOME
stop-apache
dws
dwdb
start-apache
  • You mustn't forget to regularly update the repository parts by running 'update':
cd $LJHOME
stop-apache
dwu
start-apache

Of course, you'll have to run dws and dwdb again after that. You'll do this often. :)

  • To edit files, you use WinSCP.
  • To create patches and update code, you use PuTTY.
  • To find bugs, file bugs, upload patches, you use Bugzilla.

Before You Fix Anything

Find or File a Bug

  • To file: use this template. Fill and edit the fields as needed and don't forget to change the e-mail address in Assign To.

Create a Patch

  • First make sure nobody's working on the files you want to edit. If there are already patches up for review/commit, you may need to import and apply these patches to your Dreamhack first to avoid conflicts. You can see patches up for commit by clicking here.
  • Open PuTTY and update everything. You need to work with the latest code.
  • Go to the patch directory by typing this then Enter:
cd $LJHOME
tocvs
To go to dw-nonfree, type this then Enter:
cd $LJHOME
tocvs n
  • Create a new patch by typing this then Enter (change NUMBER and PATCHNAME of course):
hg qnew -g bug#NUMBER_PATCHNAME.diff


Edit Files

Use WinSCP to open the file you need to edit:

core2.s2 is in ~/dw/cs/dw-free/bin/upgrading/s2layers/
theme and layout .s2 files are in ~/dw/cs/dw-free/bin/upgrading/s2layers/LAYERNAME/ or ~/dw/cs/dw-nonfree/bin/upgrading/s2layers/LAYERNAME/
.pm layout files are in ~/dw/cvs/dw-free/cgi-bin/LJ/S2Theme/
S2Theme.pm is in ~/dw/cvs/dw-free/cgi-bin/LJ/
S2Theme_local.pm is in ~/dw/cvs/dw-nonfree/cgi-bin/LJ/
s2layers.dat is in ~/dw/cs/dw-free/bin/upgrading/
s2layers-local.dat is in ~/dw/cs/dw-nonfree/bin/upgrading/

N.B. If WinSCP is not using your favorite editor, go to View/Preferences/Editor. Click on Add/External Editor and Browse. At the end don't forget to click on Up to make it the default editor.


Test Your Changes on Your Dreamhack

  • In PuTTY, stop your Dreamhack:
cd $LJHOME
stop-apache
  • Synchronize your live code and update your database:
dws
dwdb
  • Start your Dreamhack again:
start-apache
  • Go to your Dreamhack and test. Edit the files again in WinSCP if more changes are needed. Go through these steps again to resynchronize your live code and test your new changes.


Upload Your Patch

Update & Save Your Patch

  • Type this to update your patch file:
hg qrefresh
  • Go back to the default code by typing (PATCHNAME is full name with extension too):
hg qpop -a
hg qdelete PATCHNAME

For more commands, see https://developer.mozilla.org/en/Mercurial_Queues

!!! Do not manually edit your patch. This may cause errors and your patch won't work.


Upload Your Patch

  • Log in onto Bugzilla and open your bug.
  • Click on 'Add an Attachment' to attach your patch. Add a description and check 'patch'. Set Flags/Commit and Flags/Review to ? then click on Commit.
  • Wait for someone to review and commit your patch. :) You're done. Congrats!