|
![]() |
10 Minute GuideI figured the best way for people to play with FastCST as it is now is for them to go through something like a manual test case. This way I get free cheap labor and you get to do something completely mind-numbingly boring. Alright, I’ll try to make it not so boring, but don’t blame me if you would rather watch Desperate Housewives. This introduction will cover some terms, run through an example of using FastCST, and then cover some advanced functionality. The whole process shouldn’t take more than 10-20 minutes including building and installing FastCST (assuming you actually read the instructions). Getting The GearThe simplest way to get started is to download the stand-alone single ‘fcst’ script and try running one of the included scripts. One was build on ArchLinux the other Debian. If neither of those work then download the release and follow the README instructions for installing it using the setup.rb script. Some Fancy WordsBefore you get started, there’s some words I’ll be using which you should be familiar with:
That’s the extent of the terminology you would need to know for the moment. I’m actually working to reduce even that further in an attempt to simplify things further. The next step is to try using FastCST in a series of situations. Making Your First ChangesetMake sure you can run the fcst command without any problems. If you still have problems and you’ve read through the README then contact me at zedshaw at zedshaw dot com or on IRC in #ruby-lang on the irc.freenode.org servers. We’re going to actually grab the FastCST source using the fcst command. Just do this:
That should be it. Replace (youremail) and (your full name) with actual values, not fake ones. You’ll need your real e-mail address later. Next step is to use the apply command to move your currently empty repository to the latest 0.6.5 revision. Applying RevisionsYou currently have an empty source directory, but you need to be at the 0.6.5.1 revision. The way you do this right now is manually, but future versions will let you do this automatically. Just do the following:
The first thing to notice is that we just run fcst without any commands to get into shell mode. The shell mode is a very basic shell-like prompt so you can easily run commands without having to type “fcst” all the time. After that we just apply each revision in order, using an occasional list command to see what’s next. A list command without any options (use -h to get help for it) will show you the current path of applied revisions, and then a list of children under this path. It similar to the ls command in your normal shell. At the end the status command should show that nothing has changed. Kind of a pain, but you explicitly know what’s going on during the process, so you won’t be surprised if you suddenly get weird stuff. We’ll fix this huge path next using merging to make a new release. Creating A New ReleaseSo you don’t want people to have to do all that apply crap (which will go away in the near future). No problem, we’ll just make a new release that contains all those fixes and is a direct child of root. First thing we have to do is use undo and list to get back to the root revision.
Just keep doing undo/list until the path shown by list says [ root ] and then stop. You are now at the root of the revision tree. The next thing we want to do is create our new 0.6-release revision which will eventually contain all of these revisions in one snappy packaged revision. This is pretty simple:
The begin command should tell you some simple stuff like the UUID of the revision. The status command should still show no changes, but the show command should dump information on your current in-progress revision. Finally, the list command will show you that you’re working on 0.6-release and you are at revision path [ root ] (which has 0.6.3 as a child). Now that you’ve started a new we can merge “down the revision tree” to combine all the little 0.6 revisions into one final revision. This is again pretty simple using the merge command:
Each merge command should say there are no conflicts, and then ask if you want to go ahead an apply the revision. Each time you do it, you are basically modifying the 0.6-release you have in-progress. The list commands are basically showing you what children are under the revision you just merged. This lets you follow the path reliably, but you don’t have to do the listing if you don’t want (and you’re really brave). What happens if you mess up and want to start over? You’ll want to use the abort -f command, which does a “full” (-f) abort completely abort any changes you made and put you back at the root revision (or whatever revision you started with before the begin command). The other option is to just fix it yourself manually. It’s a good idea to get in the habit of doing a log command between each merge so that people know why you’re doing this. Notice I said “why” and not “what”, “how”, “where”, “who”, or “when”? All the other questions are answered by the meta-data that comes with each revision. Try doing a show -c command to see what is available already. What people really need is why you are doing this. What’s your motivation? Another habit to get into is not mixing merging with making other changes like fixing bugs. This is totally up to taste, but I’ve found that when you mix bug fixes with merging it blends the bug fix into the merge making it hard to apply to other revisions. It also hides your real intent which is to merge other revisions into a new revision. Just some friendly advice from someone who’s had to deal with “moby patches” that we giant whales and impossible to decipher. Now that you’ve made all your merges, you could make some additional changes if you like. One thing I try to do is run my clean process (rake clean ; ruby setup.rb clean) so that I’m not accidentally putting junk in my revisions. The revisions you have actually have this very problem, so I’m going to come up with a more automatic solution to the problem using Triggers. Anyway, all you have to do now is run the finish command and you’re done. Use the usual list, status, and show commands to figure out what happened. Next up is covering the different ways you can distribute your fancy new revision. Distributing ChangesetsFastCST supports three main ways of distributing revisions: e-mail, ftp+http, http only. Each has their advantages/disadvantages depending on what you need to do. I’ll be adding more secure methods in the near future as well. Let’s say you just want to send this 0.6-release revision you created to a co-worker with very little fuss. You’ve got two choices depending on what kind of networking is available:
The third method is where you use the publish command to publish your new repository changes to an FTP server which other can access using the get command (which will work with FTP or HTTP). Introducing The EnvironmentThe main problem with distributing your changes over the network is that it requires some amount of configuration. The serve and get commands don’t take much, but send, recv, read and publish take quite a few configuration options. FastCST helps with this problem by letting you store common configuration options in the Environment. This is just a YAML file name env.yaml in the repository directory (.fastcst/env.yaml). You can search or modify the settings in this file using the env command. Let’s setup our default SMTP Host for the send command:
Send, Recv, ReadOnce you set the ‘SMTP Host’ environment variable, then you can just run the send command with the following options:
Once you send it to someone they will need to use the recv, and read commands to get them:
The recv command also uses environment variables ‘POP3 Host’ and ‘POP3 Username’ to make things even easier. Serve and GetThe other method is to use the server and get commands to quickly sync a repository right out of your repository. This is handy if you just want to trade with someone else on your network real quick or if you want to get stuff onto another computer. It’s pretty simple. On the “master” computer, do this:
TADA! Your repository is now available to anyone else at http://yourhost:3040 (make sure you don’t add the trailing /). You can change the port with the -p option. One the host(s) you want to receive revisions on do:
Which is just like what you did previously to get the FastCST repository. PublishThe other distribution method is to use an FTP server and the publish command. I’ll leave this to you to figure out. Other GoodiesThat’s pretty much all there is to using FastCST, and hopefully that’s all there ever will be to using it. There may be a refinement of the apply vs. merge concept (since they are nearly the exact same thing), but otherwise it’s pretty stable. You’ll probably want to play with some of the other commands that are available and please feel free to try and break things. I love bug reports. Feel free to read the FAQ and learn about writing your own plugins. Full List of CommandsYou can also get this list by using the “help” or ? commands.
|