# # # delete "crypto" # # delete "crypto/crypto.ml" # # delete "crypto/crypto.mli" # # delete "crypto/ocaml-openssl.c" # # delete "database.ml" # # delete "database.mli" # # delete "extlib-1.3" # # delete "extlib-1.3/IO.ml" # # delete "extlib-1.3/IO.mli" # # delete "extlib-1.3/unzip.ml" # # delete "extlib-1.3/unzip.mli" # # delete "mlsqlite" # # delete "mlsqlite/config.h" # # delete "mlsqlite/ocaml-sqlite3.c" # # delete "mlsqlite/ocaml-sqlite3.h" # # delete "mlsqlite/sqlite3.ml" # # delete "mlsqlite/sqlite3.mli" # # delete "ocamlnet-0.97.1" # # delete "ocamlnet-0.97.1/LICENSE" # # delete "ocamlnet-0.97.1/base64.ml" # # delete "ocamlnet-0.97.1/base64.mli" # # delete "schema_lexer.mll" # # patch "INSTALL" # from [656dd842a340729b89f5d42611d01db59800d7ef] # to [6967797fa40a713127dc6f0ac4e6aa0e8667d014] # # patch "Makefile" # from [e5432015d52a5be853627b2720e850a2ffc3118b] # to [017f52424d23de717b9ddcb654e4ed9481b455aa] # # patch "README" # from [ca8f7f128d188deaecc95d31dc580154e53fd454] # to [c531da9135fc36d53466037d11e7959d2e800f01] # # patch "app.ml" # from [07ab9f9e45097db0f3110a86bf82c966cea7ca8c] # to [e62a81510dee75756f4a3db537240560d5ffa1b0] # # patch "app.mli" # from [0e5ebab671b99f8b3fa6d9e96875b9de5556e668] # to [81de698901b6c3e71f1b3ef78377748697b32294] # # patch "autocolor.ml" # from [f27c2d9e8720246e30948ab64095a38854b7b085] # to [940507d413a192f50208ca5723b2c99749dac513] # # patch "automate.ml" # from [ae72699f11e1740a3d117761a63dc7a227d226e8] # to [62bea2673c7abf9ab1f7662999be0de90004f46e] # # patch "automate.mli" # from [64a15340bcb799983b67576fb276bb4e8bfd57c6] # to [27a0f822b26d9b436416f597c5a079f3f45bb784] # # patch "config.make.in" # from [93dc881513748f3dad53927c5e1f021129d40a6c] # to [ab4dd391e36577ee261132a3e330476f043cc551] # # patch "configure.ac" # from [7099114251fbf1712393a6ec463554fb3edb63df] # to [689605aee70ba90dcbd5c63121ccfc97aafa5cf3] # # patch "main.ml" # from [59666f3ce595ac5513666dfbf041dec11bc514ad] # to [8e7daec7e3710febd6995d823f60ddc3159d53a9] # # patch "ui.ml" # from [cb79a5993595b871401f3526c39f3cc65691e4b9] # to [fa3fc2636ed401ab869c6af1383eb65b9afdbca5] # # patch "ui.mli" # from [ebb1dcbc5ede2640f55c9f9ceed9793780ed231d] # to [eb8ae605a812037deaa0f8bf4d9f7b3d744aed13] # ============================================================ --- INSTALL 656dd842a340729b89f5d42611d01db59800d7ef +++ INSTALL 6967797fa40a713127dc6f0ac4e6aa0e8667d014 @@ -13,13 +13,11 @@ compile from source, something like this $ make install -* GTK+, libgnomecanvas & OpenSSL's libcrypto +* GTK+, libgnomecanvas You'll need the development packages of GTK+ 2.4 (or newer) and -libgnomecanvas. You'll also need OpenSSL's development package -(monotone-viz uses libcrypto). +libgnomecanvas. - * LablGTK LablGTK is a GTK+ bindings for ocaml [2]. Tarballs distributions of monotone-viz include LablGTK so you don't have @@ -37,19 +35,6 @@ libgnomecanvas support: $ make install -* Sqlite -Monotone-viz can either use the sqlite3 library that is statically -linked into the monotone executable, or a shared sqlite3 library. The -former is safer (monotone-viz runs the same code as monotone to access -the database) but you need to have a compiled monotone tree. The -shared library build is the default. - -If you want to use the static sqlite3 library, create a link named -monotone to the monotone build tree and run configure: - - $ ln -s /path/to/monotone-tree monotone - $ ./configure --with-shared-sqlite=no - * Monotone-viz Compiling monotone-viz should now be as simple as: ============================================================ --- Makefile e5432015d52a5be853627b2720e850a2ffc3118b +++ Makefile 017f52424d23de717b9ddcb654e4ed9481b455aa @@ -1,37 +1,28 @@ include config.make include config.make -OCAMLNET := ocamlnet-0.97.1 -EXTLIB := extlib-1.3 - -MLINCDIRS_LOCAL = -I $(OCAMLNET) -I mlsqlite -I $(EXTLIB) -I glib -I crypto +MLINCDIRS_LOCAL = -I glib MLINCDIRS = -I $(LABLGTK_DIR) $(MLINCDIRS_LOCAL) GTK_CFLAGS := $(shell pkg-config gtk+-2.0 --cflags) GNOMECANVAS_CFLAGS := $(shell pkg-config libgnomecanvas-2.0 --cflags) -SRC = $(OCAMLNET)/base64.ml $(OCAMLNET)/base64.mli \ - mlsqlite/sqlite3.ml mlsqlite/sqlite3.mli \ - $(EXTLIB)/IO.mli $(EXTLIB)/IO.ml $(EXTLIB)/unzip.ml $(EXTLIB)/unzip.mli \ - glib/gspawn.ml glib/gspawn.mli glib/giochannel.ml glib/giochannel.mli \ +SRC = glib/gspawn.ml glib/gspawn.mli glib/giochannel.ml glib/giochannel.mli \ glib/viz_gmisc.ml glib/gpattern.ml \ - crypto/crypto.ml crypto/crypto.mli \ viz_misc.ml viz_misc.mli viz_types.ml viz_types.mli \ q.ml q.mli \ dot_lexer.ml dot_parser.ml dot_parser.mli \ basic_io_lexer.mli basic_io_lexer.ml revision.mli revision.ml \ subprocess.ml subprocess.mli \ - components.ml schema_lexer.ml \ + components.ml \ automate.mli automate.ml monotone.mli monotone.ml \ - database.ml database.mli agraph.ml agraph.mli \ + agraph.ml agraph.mli \ autocolor.ml autocolor.mli viz_style.ml viz_style.mli \ icon.ml ui.ml ui.mli unidiff.ml unidiff.mli \ view.ml view.mli query.ml query.mli app.ml app.mli version.ml main.ml -C_OBJ = mlsqlite/ocaml-sqlite3.o \ - glib/ocaml-gspawn.o glib/ocaml-giochannel.o \ +C_OBJ = glib/ocaml-gspawn.o glib/ocaml-giochannel.o \ glib/ocaml-misc.o glib/ocaml-gdate.o glib/ocaml-gpattern.o \ - crypto/ocaml-openssl.o \ gnomecanvas_hack.o USE_P4 = viz_style.ml revision.ml @@ -46,21 +37,14 @@ DISTSRC = Makefile configure.ac config.m dot_types.mli dot_lexer.mll dot_parser.mly \ subprocess.ml subprocess.mli icon.ml ui.ml ui.mli \ basic_io_lexer.mll basic_io_lexer.mli revision.mli revision.ml \ - components.ml schema_lexer.mll \ - monotone.mli monotone.ml \ - database.ml database.mli agraph.ml agraph.mli \ + components.ml monotone.mli monotone.ml agraph.ml agraph.mli \ unidiff.ml unidiff.mli gnomecanvas_hack.c view.ml view.mli \ query.ml query.mli app.mli app.ml main.ml \ - mlsqlite/sqlite3.ml mlsqlite/sqlite3.mli \ - mlsqlite/config.h mlsqlite/ocaml-sqlite3.h mlsqlite/ocaml-sqlite3.c \ - ocamlnet-0.97.1/base64.ml ocamlnet-0.97.1/base64.mli ocamlnet-0.97.1/LICENSE \ - extlib-1.3/IO.ml extlib-1.3/IO.mli extlib-1.3/unzip.ml extlib-1.3/unzip.mli \ glib/gspawn.ml glib/gspawn.mli glib/giochannel.ml glib/giochannel.mli \ glib/viz_gmisc.ml glib/gpattern.ml \ glib/ocaml-gspawn.c glib/ocaml-giochannel.c \ glib/ocaml-misc.c glib/ocaml-gdate.c glib/ocaml-gpattern.c \ glib/gspawn_tags.var glib/giochannel_tags.var \ - crypto/ocaml-openssl.c crypto/crypto.ml crypto/crypto.mli DIST_LABLGTK= lablgtk/configure lablgtk/configure.in lablgtk/config.make.in \ lablgtk/COPYING lablgtk/CHANGES lablgtk/README* \ lablgtk/Makefile lablgtk/src/Makefile lablgtk/src/.depend \ @@ -69,23 +53,18 @@ DIST_LABLGTK= lablgtk/configure lablgtk/ -ifdef SQLITE_LIBS LIB3RDPARTY_OBJ = $(C_OBJ) -SQLITE_LINK = -cclib "$(SQLITE_LIBS)" -else -LIB3RDPARTY_OBJ = $(MONOTONE_DIR)/sqlite/lib3rdparty_a-*.o $(C_OBJ) -endif ifeq ($(OCAMLBEST), opt) monotone-viz : $(OBJX) lib3rdparty.a - $(OCAMLOPT) -o $@ -I $(LABLGTK_DIR) $(MLLIBS) $^ $(CRYPTO_LIB) $(SQLITE_LINK) + $(OCAMLOPT) -o $@ -I $(LABLGTK_DIR) $(MLLIBS) $^ monotone-viz : MLLIBS = str.cmxa lablgtk.cmxa gtkInit.cmx lablgnomecanvas.cmxa ifeq ($(LOCAL_LABLGTK), yes) $(OBJX) : .lablgtk endif else monotone-viz : $(OBJ) lib3rdparty.a - $(OCAMLC) -custom -o $@ -I $(LABLGTK_DIR) $(MLLIBS) $^ $(CRYPTO_LIB) $(SQLITE_LINK) + $(OCAMLC) -custom -o $@ -I $(LABLGTK_DIR) $(MLLIBS) $^ monotone-viz : MLLIBS = str.cma lablgtk.cma gtkInit.cmo lablgnomecanvas.cma ifeq ($(LOCAL_LABLGTK), yes) $(OBJ) : .lablgtk @@ -98,14 +77,7 @@ glib/ocaml-%.o : CINCDIRS = -I glib/ocaml-gspawn.o : glib/gspawn_tags.c glib/gspawn_tags.h glib/ocaml-giochannel.o : glib/giochannel_tags.c glib/giochannel_tags.h glib/ocaml-%.o : CINCDIRS = -I $(LABLGTK_DIR) -ccopt "$(GTK_CFLAGS)" -ifdef SQLITE_LIBS -mlsqlite/ocaml-sqlite3.o : CINCDIRS = -ccopt "$(SQLITE_CFLAGS)" -else -mlsqlite/ocaml-sqlite3.o : CINCDIRS = -I $(MONOTONE_DIR)/sqlite -endif -crypto/ocaml-openssl.o : CINCDIRS = -ccopt "$(CRYPTO_CFLAGS)" gnomecanvas_hack.o : CINCDIRS = -ccopt "$(GNOMECANVAS_CFLAGS)" -$(EXTLIB)/unzip.% : MLFLAGS += -w y REVISION_FILE := $(shell test -r _MTN/revision && echo _MTN/revision) REVISION_ID = $(shell mtn automate get_base_revision_id || ( test -r _MTN/revision && cat _MTN/revision )) @@ -137,14 +109,8 @@ clean : clean : rm -f *.a *.so *.o *.cm* monotone-viz - rm -f dot_lexer.ml dot_parser.ml dot_parser.mli - rm -f revision_lexer.ml revision_parser.ml revision_parser.mli - rm -f schema_lexer.ml - cd mlsqlite && rm -f *.a *.so *.o *.cm* - cd $(OCAMLNET) && rm -f *.o *.cm* - cd $(EXTLIB) && rm -f *.o *.cm* + rm -f dot_lexer.ml dot_parser.ml dot_parser.mli basic_io_lexer.ml cd glib && rm -f *.o *.cm* - cd crypto && rm -f *.o *.cm* install : install -d $(DESTDIR)$(bindir) ============================================================ --- README ca8f7f128d188deaecc95d31dc580154e53fd454 +++ README c531da9135fc36d53466037d11e7959d2e800f01 @@ -14,8 +14,6 @@ - dot from the graphviz package http://www.research.att.com/sw/tools/graphviz/ - GTK+ 2.4, libgnomecanvas -- OpenSSL development files -- either a compiled monotone tree or sqlite development files COMPILING @@ -27,8 +25,6 @@ - run ./configure, with the following options if needed: --with-lablgtk-dir= --without-local-lablgtk - --with-monotone-dir= - --without-shared-sqlite --bindir - make - make install ============================================================ --- app.ml 07ab9f9e45097db0f3110a86bf82c966cea7ca8c +++ app.ml e62a81510dee75756f4a3db537240560d5ffa1b0 @@ -10,7 +10,6 @@ class type t = class type t = object - method get_db : Database.t option method get_mtn : Monotone.t option method get_agraph : Agraph.t option method get_prefs : Viz_style.prefs @@ -57,7 +56,6 @@ class ctrl w ~prefs ~manager ~status ~vi class ctrl w ~prefs ~manager ~status ~view : t = let busy = Ui.Busy.make w in object (self) - val mutable db = None val mutable mtn = None val mutable agraph = None val mutable prefs = prefs @@ -80,7 +78,6 @@ class ctrl w ~prefs ~manager ~status ~vi open_d <- Some d ; d - method get_db = db method get_mtn = mtn method get_agraph = agraph method get_prefs = prefs @@ -92,13 +89,8 @@ class ctrl w ~prefs ~manager ~status ~vi prefs <- new_prefs ; Ui.Prefs.update_prefs self old_prefs new_prefs - method private locked_db _ = - Ui.LockedDB.show self - method open_db ?id ?branch fname = self#close_db () ; - let m_db = Database.open_db ~busy_handler:self#locked_db fname in - db <- Some m_db ; let m_mtn = Monotone.make prefs.Viz_style.monotone_path fname in mtn <- Some m_mtn ; View.open_db view self ; @@ -113,8 +105,6 @@ class ctrl w ~prefs ~manager ~status ~vi method close_db () = self#clear ; - may Database.close_db db ; - db <- None ; may Monotone.exit mtn ; mtn <- None ; may Agraph.abort_layout agraph ; @@ -123,7 +113,7 @@ class ctrl w ~prefs ~manager ~status ~vi Ui.close_db manager self method finalize () = - may Database.close_db db + may Monotone.exit mtn method display_certs id = Ui.Busy.start busy ; @@ -140,7 +130,7 @@ class ctrl w ~prefs ~manager ~status ~vi method reload () = let s = view.View.selector in - let fname = maybe Database.get_filename db in + let fname = maybe Automate.get_dbfname mtn in let id = self#get_selected_node in let state = View.Branch_selector.get_state s in self#close_db () ; ============================================================ --- app.mli 0e5ebab671b99f8b3fa6d9e96875b9de5556e668 +++ app.mli 81de698901b6c3e71f1b3ef78377748697b32294 @@ -10,7 +10,6 @@ class type t = class type t = object - method get_db : Database.t option method get_mtn : Monotone.t option method get_agraph : Agraph.t option method get_prefs : Viz_style.prefs ============================================================ --- autocolor.ml f27c2d9e8720246e30948ab64095a38854b7b085 +++ autocolor.ml 940507d413a192f50208ca5723b2c99749dac513 @@ -28,7 +28,7 @@ let autocolor_hash s = 0xffl let autocolor_hash s = - let hash = Crypto.sha1 s in + let hash = Digest.string s in let f_of_hash p = float (Char.code hash.[p]) /. 256. in (* take 8 bits for hue *) let hue = f_of_hash 0 in ============================================================ --- automate.ml ae72699f11e1740a3d117761a63dc7a227d226e8 +++ automate.ml 62bea2673c7abf9ab1f7662999be0de90004f46e @@ -65,6 +65,8 @@ let get_info c = let get_info c = c.mtn, c.db_fname +let get_dbfname c = + c.db_fname ============================================================ --- automate.mli 64a15340bcb799983b67576fb276bb4e8bfd57c6 +++ automate.mli 27a0f822b26d9b436416f597c5a079f3f45bb784 @@ -7,6 +7,7 @@ val get_info : t -> string * string | `SYNTAX_ERROR of string] val get_info : t -> string * string +val get_dbfname : t -> string val make : string -> string -> t val exit : t -> unit ============================================================ --- config.make.in 93dc881513748f3dad53927c5e1f021129d40a6c +++ config.make.in ab4dd391e36577ee261132a3e330476f043cc551 @@ -15,10 +15,6 @@ endif LABLGTK_DIR := @LABLGTK_DIR@ endif -MONOTONE_DIR := @MONOTONE_DIR@ -CRYPTO_LIB := @CRYPTO_LIB@ -SQLITE_CFLAGS := @SQLITE_CFLAGS@ -SQLITE_LIBS := @SQLITE_LIBS@ CPPFLAGS := @CPPFLAGS@ prefix := @prefix@ ============================================================ --- configure.ac 7099114251fbf1712393a6ec463554fb3edb63df +++ configure.ac 689605aee70ba90dcbd5c63121ccfc97aafa5cf3 @@ -86,53 +86,6 @@ fi echo fi -# Check the sqlite3 sources -AC_ARG_WITH([monotone-dir], - AS_HELP_STRING([--with-monotone-dir=], - [specify location of monotone build tree]), - MONOTONE_DIR=$withval, - MONOTONE_DIR=monotone) -AC_ARG_WITH([shared-sqlite], - AS_HELP_STRING([--without-shared-sqlite], - [use a system-wide shared sqlite library]), - SHARED_SQLITE=$withval, - SHARED_SQLITE=maybe) -if test "$SHARED_SQLITE" = "yes" -o '(' "$SHARED_SQLITE" = "maybe" -a ! -d "$MONOTONE_DIR" ')' ; then - # Actually we need at least 3.2.2 but the micro number isn't in the - # pkgconfig file (sigh) - PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.2, - SHARED_SQLITE=yes, - if test "$SHARED_SQLITE" = "yes" ; then AC_MSG_ERROR([ -Couldn't find the shared sqlite package.]) ; fi) -fi - -if test "$SHARED_SQLITE" != "yes" ; then - AC_MSG_CHECKING(monotone's sqlite) - if test -d "$MONOTONE_DIR" -a -r "$MONOTONE_DIR/sqlite/lib3rdparty_a-main.o" ; then - AC_MSG_RESULT(found in $MONOTONE_DIR/sqlite) - else - AC_MSG_ERROR([ - -Could not find compiled sqlite sources. Monotone-viz needs a compiled -monotone tree for the sqlite library. Create a link named `monotone' -or specify the location to configure using the `--with-monotone-dir=' -option.]) - fi - if test "${MONOTONE_DIR:0:1}" != "/" ; then - MONOTONE_DIR="$(pwd)/$MONOTONE_DIR" - fi -fi -AC_SUBST(MONOTONE_DIR) - - -# Check for libcrypto using pkg-config, defaulting to /usr/lib -AC_MSG_CHECKING(OpenSSL's crypto lib) -CRYPTO_LIB_DIR="$(pkg-config openssl --variable=libdir)" -CRYPTO_LIB="${CRYPTO_LIB_DIR:-/usr/lib}/libcrypto.a" -AC_MSG_RESULT($CRYPTO_LIB) -AC_SUBST(CRYPTO_LIB) - - # Keep CPPFLAGS around, can be useful if caml headers are in a # non-standard location. AC_SUBST(CPPFLAGS) ============================================================ --- main.ml 59666f3ce595ac5513666dfbf041dec11bc514ad +++ main.ml 8e7daec7e3710febd6995d823f60ddc3159d53a9 @@ -122,8 +122,6 @@ let exn_handler ctrl = function let exn_handler ctrl = function - | Sqlite3.Error ((Sqlite3.BUSY | Sqlite3.LOCKED), _) -> - () | exn -> ctrl#error_notice begin ============================================================ --- ui.ml cb79a5993595b871401f3526c39f3cc65691e4b9 +++ ui.ml fa3fc2636ed401ab869c6af1383eb65b9afdbca5 @@ -32,9 +32,6 @@ let pump () = let pump () = while Glib.Main.iteration false do () done -let nice_fetch f db = - with_grab (fun () -> Database.with_progress pump f db) - let fold_in_loop ?(granularity=10) f init l = with_grab (fun () -> let i = ref 0 in @@ -287,6 +284,7 @@ end resp end +(* module LockedDB = struct let message ctrl = @@ -336,7 +334,7 @@ end resp end - +*) @@ -366,7 +364,6 @@ let ui_info = "\ \ \ \ - \ \ \ \ @@ -405,7 +402,6 @@ let make_groups () = add "Open" ~stock:`OPEN ~tooltip:"Open a database" ; add "Quit" ~stock:`QUIT ~tooltip:"Exit" ; add "Prefs" ~stock:`PREFERENCES ~tooltip:"Edit Preferences" ; - add "Test_automate" ~label:"_Test automate interface" ; add "FindEntry" ~accel:"l" ] ; let g_db = GAction.action_group ~name:"db" () in GAction.add_actions g_db [ @@ -563,19 +559,6 @@ let automate_cb auto o = end ; ignore (Glib.Timeout.add 5000 (fun () -> Automate.exit auto ; false)) -let test_automate ctrl () = - match ctrl#get_db with - | Some db -> - let mtn = (ctrl#get_prefs).Viz_style.monotone_path in - let db_fname = Database.get_filename db in - let auto = Automate.make mtn db_fname in - let id = - Automate.submit - auto [ "interface_version" ] - (automate_cb auto) in - Printf.eprintf "### automate: submitted command %d\n%!" id - | None -> - Printf.eprintf "### automate: no db open\n%!" @@ -611,9 +594,7 @@ let setup ({ manager = ui } as m) ctrl = may (set_clipboard m) ctrl#get_current_cert_value) ; - action_connect "/FindEntry" ctrl#focus_find_entry ; - action_connect "/menubar/FileMenu/Test_automate" - (test_automate ctrl) + action_connect "/FindEntry" ctrl#focus_find_entry let open_db m ctrl = ============================================================ --- ui.mli ebb1dcbc5ede2640f55c9f9ceed9793780ed231d +++ ui.mli eb8ae605a812037deaa0f8bf4d9f7b3d744aed13 @@ -5,7 +5,6 @@ val with_grab : (unit -> 'a) -> 'a parent:#GWindow.window_skel -> ('a, unit, string, unit) format4 -> 'a val with_grab : (unit -> 'a) -> 'a -val nice_fetch : (Database.t -> 'a) -> Database.t -> 'a val fold_in_loop : ?granularity:int -> ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a val wrap_in_scroll_window : (GObj.widget -> unit) -> GObj.widget -> unit @@ -42,9 +41,11 @@ end val show : t -> string option end +(* module LockedDB : sig val show : #App.t -> [`FAIL | `RETRY] end +*) type manager val make : unit -> manager * GObj.widget * GObj.widget