Rst2HTML post-processing

To keep track of the changes since the last time I uploaded something to my website I created a function that can copy files to a separate directory in the mirror environment and at the same time commits these into a Mercurial repository. This way I know that only what in this directory needs to be transferred over FTP.

I called this process "staging" and the directory to use ".staging" and the command to use binfab www.stage that starts with finding out which files haven't yet been moved into the repository (in their latest form).

/docs/scripts/rst2html-staging/stage-help.png

You can choose to process everything that has been changed or added, only the changes, only the new files or even a single file. The function kan also be called with a "list" option to preview what will be done:

/docs/scripts/rst2html-staging/stage-list-output.png

When starting without the list option the selected files are copied to the staging area and a popup will let you provide a title for the commit:

/docs/scripts/rst2html-staging/commit-dialog.png

At this stage it is still possible to terminate the process by canceling the dialog (or even leaving the text field empty); processing will the stop with the message "Afgebroken".

After entering the text and confirming the dialog the files will be committed and a result message will be shown:

/docs/scripts/rst2html-staging/stage-output.png

You can now transfer the files in the staging area to the live site over FTP.

Should you want to overloog what's in the staging area zit without having to use a file manager you can use the following command:

binfab www.list-staged <sitename> [--full]

By default it shows the files in the root directory and just counts the ones in subdirectories, if you want to have them listed also you need to use the "full" option gebruiken

/docs/scripts/rst2html-staging/list-staged.png /docs/scripts/rst2html-staging/list-staged-full.png

After copying the files to the live site the staging area can be cleared (or removed entirely; if needed it will be recreated) to prevent losing the overview and processing the files more than once, this also ensures that subsequent additions will be added in a new commit. You can use the following command to do this:

binfab www.clear-staged

You may not always want to move the files to the live site after each time you stage; you can also use the staging to consolidate an intermediary result and then continue to make changes to documents. In that case the files for subsequent stagings are added to the commit, which you can see from the dialog for the commit message, that will present the one you originally entered (and which you can modify should you want to):

/docs/scripts/rst2html-staging/commit-dialog-existing.png