Show Changes Show Changes
Edit Edit
Print Print
Recent Changes Recent Changes
Subscriptions Subscriptions
Lost and Found Lost and Found
Find References Find References
Rename Rename
Administration Page Administration Page
Search

History

1/18/2005 12:43:00 PM
List all versions List all versions

RSS feed for the FlexWiki namespace

Fw Sync0dot1
.
Summary
FwSync is a command-line tool for editing the wiki. This is the documentation version 0.1 of the tool.

Overview

The basic idea is to provide a command-line tool that operates much like a source control utility. It provides check-in/check-out capabilities to retrieve the contents of a wiki to your local hard drive, where you can then edit them offline. Later you can upload them back to the wiki. FwSync will tell you which files have been edited on the wiki in the meantime to reduce the chance of you unintentionally overwriting changes that others have made.

Status

FwSync is now complete and checked in to source control, although not yet included in the release.

Authorship

FwSync was written by CraigAndera.

Installing FwSync

FwSync is not currently part of the FlexWiki release package, so you will need to obtain the source code from the GotDotNet workspace and build the tool yourself. Once you have built it, simply copy fwsync.exe (and optionally fwsync.pdb) to some directory that is part of your PATH.

Using FwSync

FwSync is a command line tool. You can get complete help for FwSync by typing

  fwsync

at the command line. Here is the message you will receive:

 fwsync version 0.1
 Copyright (c) 2004 Craig Andera http://staff.develop.com/candera
 No arguments were supplied  


 Usage: fwsync <options> <command> <commandoptions>


 Options:
   /debug


 Commands: ( { } denote optional parameters )
   init <baseurl> { <directory> }
   update { <directory> }
   status { <directory> }
   commit <identity> { <directory> } 


   init:           Initial setup of FwSync: Retrieves all topics from the
                   server at <baseurl> and stores them in the new directory
                   <directory>. If no directory is specified, the current
                   directory is used.
   update:         Retrieves any files that have been added or changed on
                   the server, unless they have also been modified on the
                   local machine. If no directory is specified, the current
                   directory is used.
   status:         Prints the status of all wiki files in specified directory.
                   See below for an explanation of statuses. If no directory
                   is specified, the current directory is used.
   commit:         Uploads all locally modified and added files to the web
                   repository. If any files have a status (see below for a
                   description of statuses) of 'InConflict', no commit will
                   be performed - you must resolve all conflicts before
                   performing a commit.


 Status:
   UpToDate          The file is identical with the latest revision in the
                     repository.
   LocallyModified   You have edited the file, and not yet committed your
                     changes
   LocallyAdded      You have added the file to the local file system and not
                     yet committed your changes.
   NoLocalFile       The local file does not exist - it needs to be retrieved
                     from the repository via the update command.
   LocallyOutOfDate  Someone else has committed a newer revision to the
                     repository. You can retrieve the latest version with the
                     update command.
   InConflict        Someone else has committed a newer revision to the
                     repository since your last update, and you have also made
                     modifications to the file. You will not be able to commit
                     while any file is InConflict. See below for instructions
                     on how to deal with conflicts.


 Dealing with conflicts: 


 At some point, this tool will provide help for dealing with conflicts. For
 now, however, it is a manual process. Consider an example where the topic
 MyWiki.HomePage is in conflict. The steps are: 


 1. Rename the conflicting file to something like My HomePage Test.wiki.conflict
 2. Perform an update command to retrieve the current version from the web
 3. Merge the two files using your favorite merge tool (e.g. WinMerge)
 4. Save the merged file back to My HomePage Test.wiki
 5. Commit the modified file.
 6. Delete the My HomePage Test.wiki.conflict file. 

Typical Usage Scenario

Let's assume you wanted to edit a wiki called FooWiki located on the web at http://www.foowiki.com. A typical usage scenario will go something like this:

  1. Choose a new directory on your hard drive. The directory can have any name. We will assume the name of the directory is C:\data\FooWiki
  2. Run fwsync init http://www.foowiki.com C:\data\FooWiki This will create the directory C:\data\FooWiki and grab all the files from the server, creating one directory for each namespace on the server, and creating one file with a .wiki extension in those directories for each topic in the corresponding namespace.
  3. (Optionally) Edit the .wiki files with your favorite text editor, using the same WikiFormatting you use to edit FlexWiki pages on the web. You do not need to be connected to the web for this step, and any amount of time can elapse between this step and the previous one.
  4. (Optionally) Add any new .wiki files you like. You do not need to be connected to the web for this step, and any amount of time can elapse between this step and the previous ones.
  5. (Optionally) Run fwsync status C:\data\FooWiki to see what has been modified on both the server and your local hard drive.
  6. Run fwsync commit myUsername C:\data\FooWiki to push all the changed files up to the web server.
  7. (Optionally) Run fwsync update C:\data\FooWiki to update the local filesystem with any files that have changed on the server.

How FwSync Works

FwSync works by maintaining a file called fwstatus.xml in the directory you specify when you run fwsync init (called the base directory). This file contains information about what fwsync thinks is on the server. It is updated whenever FwSync connects to the server (which currently happens every time you run fwsync). It keeps track of several pieces of information:

FwSync then works by comparing the latest version stored on the server to the based-on version, and the current checksum (calculated from the file on the local disk) with the based-on checksum. Comparing these values lets FwSync know whether the server or the local file system has been modified. This is then used to calculate the status of that file as outlined in this table:

                                         Web                            
                     Unchanged         Modified       Doesn't exist 
                   -------------------------------------------------  
        Unch     |    UpToDate      LocallyOutOfDate  LocallyAdded 
 Local  Mod      | LocallyModified    InConflict      LocallyAdded 
        Not Exist|   NoLocalFile      NoLocalFile         N/A                  

Feature/Enhancement Suggestions

Bug Reports

Questions and Answers

Question

The implementation I'm working on won't do a merge, however, it will refuse to commit files that are in conflict, allowing you to easily merge by renaming the conflicting file, updating to get the current web version, merging with an external tool, and committing the merged file. In the future, I plan to add a resolve command to automate this process, but right now my philosophy is to get it to the point where I can do the basics. -- CraigAndera

Question

It will not work with the FlexWikiEditor in FlexWikiEditor's current state. This is because FlexWikiEditor is an inherently connected application, and FwSync is all about a disconnected model. My plan is to instead morph FlexWikiEditor into an application that only edits local .wiki files, and then use FwSync to get the connectivity to a web instance. This has the additional benefit of yeilding an application that can be used to create wikis without ever connecting to the web. Handy if you just want to take notes.

Eventually, I will probably integrate the two somehow, so you can do all your checkins, up

dates, and conflict resolution from within the single UI. However, first things first. -- CraigAndera

Comment

Thanks! -- CraigAndera

Not logged in. Log in

Welcome to the home of FlexWiki, a collaboration tool, based on WikiWiki, implemented using Microsoft .NET technologies

This is FlexWiki, an open source wiki engine.

This site supports the new NoFollow anti-spam initiative.
Change Style

Recent Topics