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

From Dreamwidth Notes
Redirect page
Jump to: navigation, search
m (Edit themes.s2)
 
(242 intermediate revisions by 4 users not shown)
Line 1: Line 1:
= Install and Set Things Up =
+
#REDIRECT [[Newbie_Guide:_Getting_Started_on_Windows]]
 
+
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.
+
 
+
* Apply for a Dreamhack by [http://hack.dreamwidth.net/apply.shtml filling this form].
+
 
+
* Get [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 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: <source lang="bash">passwd</source>
+
 
+
* On your Dreamhack, the default user is called 'system'. You need to set its password so you can access this account. Type: <source lang="bash">$LJHOME/bin/upgrading/make_system.pl</source>
+
 
+
* Once you're done type: <source lang="bash">start-apache</source>
+
 
+
* You can access your Dreamhack at [http://yourusername.hack.dreamwidth.net/ http://yourusername.hack.dreamwidth.net/] and log in as system. You may want to upgrade your account to a paid one by [http://www.ninetydegrees.hack.dreamwidth.net/admin/capedit going here].
+
 
+
 
+
== 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 [http://winscp.net/eng/download.php 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.
+
 
+
* Follow the steps outlined at [[Dreamhack_getting_started#Back_up_your_configs|Back Up Your Configs]].
+
 
+
: N.B. To create files, go to WinSCP, go to the right directory, right-click on New/File and edit.
+
 
+
* Also create the <em>dwu</em>, <em>dws</em> and <em>dwdb</em> scripts as explained in [[Dev_Maintenance#Scripting|Scripting]].
+
 
+
* In PuTTY, type this then Enter:
+
<source lang="bash">cd $LJHOME/cvs/dw-free
+
hg qinit -c</source>
+
 
+
This will create a directory where your patches will be put into: <code>~/dw/csv/dw-free/.hg/patches/</code>
+
 
+
* Do the same thing with dw-nonfree if you're working with non-free styles:
+
<source lang="bash">cd $LJHOME/cvs/dw-nonfree
+
hg qinit -c</source>
+
 
+
The directory will be: <code>~/dw/csv/dw-nonfree/.hg/patches/</code>
+
 
+
 
+
== Create a Bugzilla account ==
+
 
+
Simply [http://bugs.dwscoalition.org/createaccount.cgi click here].
+
 
+
= How All of This Works =
+
 
+
* Your Dreamhack has two parts:
+
** the live part (<code>~/dw/*</code>)
+
** two main repository parts (<code>~/dw/cvs/dw-free/*</code> and <code>~/dw/cvs/dw-nonfree/*</code>).
+
 
+
* What you see on [http://yourusername.hack.dreamwidth.net/ http://yourusername.hack.dreamwidth.net/] is the live part.
+
 
+
* 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':
+
<source lang="bash">cd $LJHOME
+
stop-apache
+
dws
+
dwdb
+
start-apache</source>
+
 
+
* You mustn't forget to regularly update the repository parts by running 'update':
+
<source lang="bash">cd $LJHOME
+
stop-apache
+
dwu
+
start-apache</source>
+
 
+
Of course, you'll have to run <code>dws</code> and <code>dwdb</code> 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 [http://bugs.dwscoalition.org/ Bugzilla].
+
 
+
= Before You Fix Anything =
+
 
+
 
+
== Find or File a Bug ==
+
 
+
* To find: use [http://bugs.dwscoalition.org/query.cgi?format=specific simple search], [http://bugs.dwscoalition.org/query.cgi?format=advanced advanced search] or [http://bugs.dwscoalition.org/userprefs.cgi?tab=saved-searches predefined searches] such as [http://bugs.dwscoalition.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=unassigned%20effort-minor&sharer_id=2 unassigned effort-minor].
+
 
+
* To file: [http://bugs.dwscoalition.org/enter_bug.cgi?product=Dreamwidth%20Development use this form]. 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 first [[#Import a Patch|import and apply these patches to your Dreamhack]] to avoid conflicts. You can see patches up for commit by [http://bugs.dwscoalition.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=needs-commit&sharer_id=2 clicking here].
+
 
+
* Open PuTTY and update everything. You need to work with the latest code.
+
 
+
* Go to dw-free by typing this then Enter:
+
<source lang="bash">cd $LJHOME
+
tocvs</source>
+
 
+
: To go to dw-nonfree, type this then Enter:
+
<source lang="bash">cd $LJHOME
+
tocvs n</source>
+
 
+
* Create a new patch by typing this then Enter (change NUMBER and PATCHNAME of course):
+
<source lang="bash">hg qnew -g bug#NUMBER_PATCHNAME.diff</source>
+
 
+
 
+
== Import a Patch ==
+
 
+
* Go to [http://bugs.dwscoalition.org/ Bugzilla], open the bug, click on the patch. Copy its URL.
+
 
+
* In PuTTY, go to dw-free:
+
<source lang="bash">cd $LJHOME
+
tocvs</source>
+
 
+
* Then type this to import the patch and name it patch:
+
<source lang="bash">wget -O patch URL</source>
+
 
+
* Type this to apply the patch:
+
<source lang="bash">patch -p1 < patch</source>
+
 
+
* Synchronize your live code (as explained [[#How All of This Works|above]]).
+
 
+
 
+
= Edit Files =
+
 
+
Use WinSCP to open the file(s) you need to edit.
+
 
+
TODO: indicate where some files are (upgrading/S2Layers & htdocs probably).
+
 
+
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:
+
<source lang="bash">cd $LJHOME
+
stop-apache</source>
+
 
+
* Synchronize your live code and update your database:
+
<source lang="bash">dws
+
dwdb</source>
+
 
+
* Start your Dreamhack again:
+
<source lang="bash">start-apache</source>
+
 
+
* 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 ===
+
 
+
* In PuTTY, go to your patch directory (see [[#Create a Patch|this section if you've forgotten how to]])
+
 
+
* Type this to update your patch file:
+
<source lang="bash">hg qrefresh</source>
+
 
+
* Go to your patch directory in WinSCP and save a copy of your patch on your computer (see [[#Set Up Your Dreamhack|this section if you've forgotten where the patch folder is]]).
+
 
+
* Go back to the default code by typing (PATCHNAME is full name with extension too):
+
<source lang="bash">hg qpop -a
+
hg qdelete PATCHNAME</source>
+
 
+
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.
+
 
+
 
+
== Put Your Patch On Bugzilla ==
+
 
+
* Log in onto [http://bugs.dwscoalition.org/ 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!
+
 
+
= Specific Topics for People Working on Styles Bugs =
+
 
+
 
+
== Where Are Styles Bugs? ==
+
 
+
[http://bugs.dwscoalition.org/buglist.cgi?bug_status=NEW&keywords=why-styles&keywords_type=allwords&query_format=advanced&order=bug_id%20DESC&query_based_on= Right here!]
+
 
+
 
+
== How do I File a New Style Bug? ==
+
 
+
[http://bugs.dwscoalition.org/enter_bug.cgi?alias=&assigned_to=nobody%40dreamwidth.org&blocked=&bug_file_loc=http%3A%2F%2F&bug_severity=enhancement&bug_status=ASSIGNED&comment=&component=Style%20System&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&dependson=&description=&flag_type-1=X&flag_type-10=X&flag_type-11=X&flag_type-2=X&flag_type-3=X&flag_type-5=X&flag_type-7=X&form_name=enter_bug&keywords=&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=All&priority=P5&product=Dreamwidth%20Development&qa_contact=denise%40dreamwidth.org&rep_platform=All&short_desc=&target_milestone=-undecided-&version=unspecified Use this template]. Fill and edit the fields as needed and don't forget to change the e-mail address in Assign To.
+
 
+
People adding themes can use [http://bugs.dwscoalition.org/enter_bug.cgi?alias=&assigned_to=nobody%40dreamwidth.org&blocked=&bug_file_loc=http%3A%2F%2F&bug_severity=enhancement&bug_status=ASSIGNED&comment=Layout%3A%20%0D%0ATheme%3A%20%0D%0AAuthor%3A%20%0D%0ASubmission%20URL%3A%20&component=Style%20System&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&dependson=680&description=&flag_type-1=X&flag_type-10=X&flag_type-11=X&flag_type-2=X&flag_type-3=X&flag_type-5=X&flag_type-7=X&form_name=enter_bug&keywords=&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=All&priority=P5&product=Dreamwidth%20Development&qa_contact=denise%40dreamwidth.org&rep_platform=All&short_desc=Theme%3A%20THEME%20NAME%20%28LAYOUT%20NAME%29&target_milestone=-undecided-&version=unspecified this template].
+
 
+
 
+
== Where are Styles Files? ==
+
 
+
* core2.s2 is in <code>~/dw/cs/dw-free/bin/upgrading/s2layers/</code>
+
 
+
* Theme and layout .s2 files are in <code>~/dw/cs/dw-free/bin/upgrading/s2layers/LAYERNAME/</code> or <code>~/dw/cs/dw-nonfree/bin/upgrading/s2layers/LAYERNAME/</code>
+
 
+
* .pm layout files are in <code>~/dw/cvs/dw-free/cgi-bin/LJ/S2Theme/</code>
+
 
+
* S2Theme.pm is in <code>~/dw/cvs/dw-free/cgi-bin/LJ/</code>
+
 
+
* S2Theme_local.pm is in <code>~/dw/cvs/dw-nonfree/cgi-bin/LJ/</code>
+
 
+
* s2layers.dat is in <code>~/dw/cs/dw-free/bin/upgrading/</code>
+
 
+
* s2layers-local.dat is in <code>~/dw/cs/dw-nonfree/bin/upgrading/</code>
+
 
+
 
+
== How to Add a Theme ==
+
 
+
 
+
=== Edit themes.s2 ===
+
 
+
* See the previous topic to know where this file is located.
+
 
+
* Make sure your theme header is correctly formatted. As Afuna explained [http://dw-dev-training.dreamwidth.org/9656.html here] in <dwcomm>dw-dev-training</dwcomm>, it should look like this:
+
<source lang="perl">#NEWLAYER: layoutname/themename
+
layerinfo type = "theme";
+
layerinfo name = "Theme Name";
+
layerinfo redist_uniq = "layoutname/themename";
+
layerinfo author_name = "someuser";
+
 
+
set layout_authors = [ { "name" => "someuser", "type" => "user" } ]</source>
+
 
+
: If you're the layout author, no need to add <code>set layout_authors</code>.
+
 
+
* Then add the theme codes.
+
 
+
* If you need to add theme-specific CSS, use:
+
<source lang="perl">function Page::print_theme_stylesheet() {
+
    """
+
    CSS HERE
+
    """;
+
}</source>
+
 
+
=== Edit LAYOUTNAME.pm ===
+
 
+
 
+
[[Category:Styles Development]]
+

Latest revision as of 16:20, 13 March 2013