unison

Fork of Unison, a bi-directional file synchronization tool
git clone git://git.laack.co/unison.git
Log | Files | Refs | README | LICENSE

ROADMAP.txt (2999B)


      1 FINDING YOUR WAY AROUND THE UNISON SOURCES
      2 ------------------------------------------
      3 
      4 Although parts of it are somewhat intricate, Unison is not a very large
      5 program.  If you want to get familiar with the code, the best place to
      6 start is probably with the textual user interface module, uitext.ml.  The
      7 'start' function at the bottom is a simple driver for all the rest of the
      8 major modules in the program.  (See below for some more details.)
      9 
     10 After that, check out main.ml to see how things get set up.  Again,
     11 the bottom is the most interesting part.
     12 
     13 Next, look at the interface files in this order:
     14       globals.mli      common low-level datatype definitions
     15       common.mli       common high-level datatype definitions
     16       update.mli       update detection
     17       recon.mli        reconciliation of updates (i.e. deciding what to do)
     18       transport.mli    propagation of changes (also files.mi)
     19 
     20 From here, you probably know your way around enough to decide where to
     21 look next.  Here's a summary of the most interesting modules:
     22      pred          implements "predicates" (e.g. ignore) based on regexps
     23      prefs         command-line and preference file parsing
     24      main          the top-level program
     25      os            low-level filesystem operations
     26      trace         tracing messages
     27      uicommon      stuff common to the two UIs
     28      uitext        the textual UI
     29      uigtk         the graphical UI (Gtk version)
     30 
     31 The files linktext.ml and linkgtk.ml contain linking commands for
     32 assembling unision with either a textual or a graphical user interface.
     33 (The Main module, which takes the UI as a parameter, is the only part of
     34 the program that is functorized.)
     35 
     36 The module Remote handles RPC communication between clients and remote
     37 servers.  It's pretty tricky, but the rest of the system doesn't need
     38 to know much about how it works.
     39 
     40                    ________________________________
     41 
     42 In a little more detail, here is the flow of control at startup time:
     43 
     44 - The first code to execute (not counting some small per-module
     45   initialization stuff) is the call to Main.init() from Main.Body.  This
     46   handles a few special preferences like -version, -doc, and -server.  If it
     47   returns, then Main.Body next calls the start function of whatever UI
     48   module has been provided as an argument to the Main module.
     49 
     50 - The start function in each of the UI modules (Uitext, Uigtk2, etc.)
     51   behaves slightly differently, but they all have quite a bit of common
     52   structure; this is captured in the function Uicommon.uiInit, which is
     53   where all the heavy lifting happens (parsing command line and preference
     54   files, connecting to the server, etc.); when this returns, the user
     55   interface continues with the actual synchronization.
     56 
     57 - The core functions that do the real work (of synchronization) are:
     58      Update.findUpdates()     find out what changed
     59      Recon.reconcileAll       build the list of "recon items"
     60      Transport.transportItem  perform the action described by a recon item