pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev_training2011-11-21 05:27 pm
Entry tags:

Question thread #3

It's time for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer.
chagrined: Marvel comics: zombie!Spider-Man, holding playing cards, saying "Brains?" (brains?)

[personal profile] chagrined 2011-12-05 10:19 pm (UTC)(link)
I'm baaaaaaaaaaaack?

Thanks to [staff profile] denise's response to my question I was able to figure out the hooks in MoodThemeChooser.pm and now I think I have a version that correctly uses CSS positioning. Only then I tried to figure out how to generate a patch and got totally lost. I tried to follow the instructions on the wiki for maintenance/syncing my CVS installation/whatever first. Okay. But from what I can gather ...the instructions on patching on most of those pages assume I was doing my edits in the CVS directory and generating patches as I went along? Now I'm just lost and frustrated. One of the "getting started" pages on the wiki said that you could do your editing in either the live directory or in the CVS directories and that it had something to do with personal preference for workflow? So I did it in the live directory but now can't figure out how to get THAT to sync with my CVS directory. The problem is that I did change files other than MoodThemeChooser.pm, so when I generated a "compare everything" patch it had a lot of other changes I don't want to include in this patch. But I don't want to JUST declare MoodThemeChooser.pm b/c I also changed the files governing the CSS rules for that page (in both htdocs and ssldocs). So I guess I could generate three separate patches, one for each of those files, but that seems annoying, and then if I had more than three files could get old really soon.

I backed up the other files in my live directory that I changed anyway so that's why I wanted to just sync/override the whole thing, then I could copy my modified MoodThemeChooser.pm & related files back in there to only generate the patch based on those. Also though when I did the patch comparing everything in my live directory with the CVS one, there was a lot of weird stuff in there I definitely didn't change, like, config files related to ...time and things like that? (I don't have the patch file in front of me right now).

Uh basically I'm just confused and frustrated and wondering whether it's best to wipe my entire installation, reset it from scratch and then try to figure out this other method of doing my edits in the CVS directory instead? (And then I use patches to make those edits apply to the live directory so I can see them when I go to the site or something? Is that how that works?)
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2011-12-05 10:41 pm (UTC)(link)
Fear not, you don't have to delete everything! It is possible to sync between live and cvs fairly easily. These instructions will walk you through setting up an alias to do it so you don't have to run the whole command every time.

(Also, if you wind up with changes in a patch that you don't want (other changed files, etc) you can just delete those changes. Make sure you get everything from the part that starts "diff -r" to the beginning of the next "diff -r", or else there will be problems applying the patch).

1) First, do this: http://wiki.dwscoalition.org/notes/Dreamhack_getting_started#Protect_your_configs_from_updates (that will prevent your config changes from being included in every patch ever).

2) Second, while logged into your DH account, cd ~/bin and pico -w sc. In the window that results, paste:


Hit ctrl-X, say yes when it asks you to save, and once you're back at the command line type chmod +x sc. Then, pico -w sl and paste:


Ctrl-X, save, and type chmod +x sl.

Once you've done that, you'll be able to type sl to sync live files to cvs, and sc to sync cvs files to live. I, personally, do all my changes in live, test them on the site, then "sc" to move them from live->cvs to generate the patch.

The parts of the instructions that assume you're generating patches as you go have to do with the fact that unless you want to muddle around with learning mercurial queues -- which I never have -- you will want to revert out your changes from the cvs directory after every patch you generate, or else each subsequent patch is going to contain all the other patches you did and the system will bitch at you when you try to upgrade to the newest code. (The command to revert changes is 'hg revert --all', and you need to be in ~/dw/cvs/dw-free or ~/dw/cvs/dw-nonfree when you run it.)

So, my own personal workflow goes:
1) make changes in live, test, get it working, yadda
2) "sl" to sync live files to cvs
3) "hg diff > ~/bugXXXX.patch" to generate a patchfile in my home directory
4) open the patch file, confirm it's got everything I need and doesn't have anything I don't need, upload to bugzilla, etc
5) "hg revert --all" in ~/dw/cvs/dw-free to revert the changes I just made in cvs
6) "sc" to sync cvs files (the unchanged versions) back to live and reset to the pre-patch state

This way doesn't take advantage of a lot of the things you can do with Mercurial, but given the complexity of the bugs I'm working on (ie, not much) it's just easier for me to do it that way, personally! If you want to learn Mercurial someone else would have to help out. *g*
chagrined: Marvel comics: zombie!Spider-Man, holding playing cards, saying "Brains?" (brains?)

[personal profile] chagrined 2011-12-09 10:46 pm (UTC)(link)
Well I had to tweak some things but I think I eventually sort of made this work. :) So thanks, that was helpful. One weird thing -- I noticed there's no ssldocs directory inside dw-free? At least I don't seem to have one. But there are two (identical) copies of the .css file I changed, one in htdocs/stc/widgets and the other in ssldocs/stc/widgets. But since my dw-free directory contains no ssldocs directory, the patchfile is only showing the differences in the htdocs version.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2011-12-09 10:47 pm (UTC)(link)
That's okay! ssldocs is an automagically-generated thing to allow for certain things to be served securely without errors or warnings. Just ignore it. :)
chagrined: Marvel comics: zombie!Spider-Man, holding playing cards, saying "Brains?" (brains?)

[personal profile] chagrined 2011-12-09 10:56 pm (UTC)(link)
Okay, well, I attempted to upload what I came up with on bugzilla, so we'll see how that goes. ^__^