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.
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. ^__^