monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone.issue-120: d7372b630bc6b89e


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.issue-120: d7372b630bc6b89e6ce810652cb2dd011f06297e
Date: Thu, 24 Feb 2011 17:30:44 +0100 (CET)

revision:            d7372b630bc6b89e6ce810652cb2dd011f06297e
date:                2011-02-21T00:00:28
author:              Richard Hopkins <address@hidden>
branch:              net.venge.monotone.issue-120
changelog:
propagate from branch 'net.venge.monotone' (head 
3fdbae2f1a2277e919238fb62b72455dcfd3acc0)
            to branch 'net.venge.monotone.issue-120' (head 
dbc39ee80dd71d7357f93e06fc760b98a12c317e)

manifest:
format_version "1"

new_manifest [0d9c0cf865b3787fab5b507f7d87c98029a9f4a7]

old_revision [3fdbae2f1a2277e919238fb62b72455dcfd3acc0]

patch "NEWS"
 from [848a8d23c760b709d5954ef1ca4a812c72404343]
   to [10e25e4e76b43b8ee758a8e3d8c3ed27087af2a3]

patch "src/cmd_list.cc"
 from [12643b2161237863a8de6656c99328dc6ea3c7e6]
   to [042cb24c88d1bbfd70cc57b5f054b5d51adb3de3]

old_revision [dbc39ee80dd71d7357f93e06fc760b98a12c317e]

rename "test/func/netsync_key_hook"
    to "test/func/netsync_key_hooks"

add_dir "test/func/netsync_bind_opt"

add_file "test/func/netsync_bind_opt/__driver__.lua"
 content [153c2be3d3c3c37b4fea590633d2d3be9bae5e82]

add_file "test/func/netsync_key_hooks/server-hooks.lua"
 content [434dab628a58b2c644f5ad6997420f1186cabbb5]

patch ".mtn-ignore"
 from [ee776b54b58b1d3cc4265cdfa09a6d426ae1f6c5]
   to [347361ce3fa47016cbe4f5ba29188696d939a1d8]

patch "NEWS"
 from [6c8a5b78abdefae4e54702b4467037193c98b365]
   to [10e25e4e76b43b8ee758a8e3d8c3ed27087af2a3]

patch "doc/monotone.texi"
 from [73e344eb1ba340193ab61f755d72979a29c58fde]
   to [5c18cff828089e592f5f2d53c2d60793715a4a40]

patch "src/keys.cc"
 from [bdf4a6b94902d29411b16cb169851986a16b3956]
   to [19db9fa939a1d87aba964f4e84743adcfff6fdd2]

patch "src/lua_hooks.cc"
 from [33d6643e8776fa87296f47658fdbfd3001e3cfd9]
   to [1c178085332c73dcefb4681d205d17b059e52080]

patch "src/lua_hooks.hh"
 from [325fd5a4b588ff4d41e3cec69cbf652089a33fa9]
   to [66412b9fa5db97cd3b3ec01cadf036fb346ac161]

patch "src/network/connection_info.cc"
 from [78789566ad076c92d8795ea7e3877646c3749693]
   to [b732c16161db2394aac449f50c6a6921e553ef22]

patch "src/network/connection_info.hh"
 from [8841c299c1a214c46071b6f77c3a5dbadeaf4959]
   to [0ba5fc1778b78fb3446ad345ec78e073fd9221e4]

patch "test/extra/mtn-cleanup/__driver__.lua"
 from [c0a63dd6bbb69d30db6f6b64f7d59f2b5f1d00c7]
   to [f650305a0d130a4ac6fb988eed58662a564dcc64]

patch "test/func/manpage/__driver__.lua"
 from [2230d26ba35875be86cbb8000b4c0c8c7d36f735]
   to [a381ef4517c907170547a4984923650617f69c60]

patch "test/func/netsync_key_hooks/__driver__.lua"
 from [87963f895052ee9dd35d513e23004811169bca38]
   to [d7fad5a70688d3db512a05ebb0e3643006f8c7e2]

patch "test/func/netsync_key_hooks/client-hooks.lua"
 from [f60d553a6bff838e53904f94294588d9f9ed84ee]
   to [e9eb38666d23a1f4a5be33404220902ee90756eb]
============================================================
--- NEWS	848a8d23c760b709d5954ef1ca4a812c72404343
+++ NEWS	10e25e4e76b43b8ee758a8e3d8c3ed27087af2a3
@@ -118,6 +118,9 @@ XXX XXX XX XX:XX:XX UTC 2011
           or partial identifier contains non-hex digits.
           (fixes monotone issue 143)
 
+        - Performance of "mtn ls changed" has been improved and is now
+          comparable to "mtn status". (fixes monotone issue 120)
+
         Internal
 
         - The source tree has been reorganized. Sources, tests and documentation
============================================================
--- src/cmd_list.cc	12643b2161237863a8de6656c99328dc6ea3c7e6
+++ src/cmd_list.cc	042cb24c88d1bbfd70cc57b5f054b5d51adb3de3
@@ -12,6 +12,8 @@
 #include "safe_map.hh"
 #include <utility>
 #include <iostream>
+#include <sstream>
+#include <set>
 #include <iterator>
 
 #include <boost/tuple/tuple.hpp>
@@ -45,6 +47,7 @@ using std::ostream;
 using std::sort;
 using std::copy;
 using std::ostream;
+using std::ostringstream;
 using std::string;
 using std::vector;
 
@@ -853,50 +856,97 @@ CMD(changed, "changed", "", CMD_REF(list
     "",
     options::opts::depth | options::opts::exclude)
 {
+  roster_t new_roster;
+  parent_map old_rosters;
+  revision_t rev;
+  temp_node_id_source nis;
+
   database db(app);
+  project_t project(db);
   workspace work(app);
 
-  parent_map parents;
-  roster_t new_roster;
-  temp_node_id_source nis;
+  work.get_parent_rosters(db, old_rosters);
   work.get_current_roster_shape(db, nis, new_roster);
-  work.update_current_roster_from_filesystem(new_roster);
 
-  work.get_parent_rosters(db, parents);
-
   node_restriction mask(args_to_paths(args),
                         args_to_paths(app.opts.exclude),
                         app.opts.depth,
-                        parents, new_roster, ignored_file(work));
+                        old_rosters, new_roster, ignored_file(work));
 
-  revision_t rrev;
-  make_restricted_revision(parents, new_roster, mask, rrev);
+  work.update_current_roster_from_filesystem(new_roster, mask);
+  make_restricted_revision(old_rosters, new_roster, mask, rev);
 
-  // to be printed sorted, with duplicates removed
-  set<file_path> print_paths;
+  revision_id rid;
+  calculate_ident(rev, rid);
 
-  for (edge_map::const_iterator i = rrev.edges.begin();
-       i != rrev.edges.end(); i++)
+  set<file_path> output_files;
+
+  // TODO: Refactor this method and promote these locals to parameters
+  // We can then use the method to provide us with "mtn ls added" for
+  // example
+  bool output_dropped = true;
+  bool output_renamed = true;
+  bool output_added = true;
+  bool output_patched = true;
+  bool output_attrs = true;
+
+  for (edge_map::const_iterator i = rev.edges.begin(); i != rev.edges.end(); ++i)
     {
-      set<node_id> nodes;
-      roster_t const & old_roster
-        = *safe_get(parents, edge_old_revision(i)).first;
-      select_nodes_modified_by_cset(edge_changes(i),
-                                    old_roster, new_roster, nodes);
+      revision_id parent = edge_old_revision(*i);
+      cset const & cs = edge_changes(*i);
 
-      for (set<node_id>::const_iterator i = nodes.begin(); i != nodes.end();
-           ++i)
+      if (output_dropped)
         {
-          file_path p;
-          if (new_roster.has_node(*i))
-            new_roster.get_name(*i, p);
-          else
-            old_roster.get_name(*i, p);
-          print_paths.insert(p);
+          for (set<file_path>::const_iterator i = cs.nodes_deleted.begin();
+            i != cs.nodes_deleted.end(); ++i)
+            output_files.insert(*i);
         }
+
+      if (output_renamed)
+        {
+          for (map<file_path, file_path>::const_iterator
+            i = cs.nodes_renamed.begin();
+            i != cs.nodes_renamed.end(); ++i)
+            output_files.insert(i->second);
+        }
+
+      if (output_added)
+        {
+          for (set<file_path>::const_iterator i = cs.dirs_added.begin();
+            i != cs.dirs_added.end(); ++i)
+            output_files.insert(*i);
+
+          for (map<file_path, file_id>::const_iterator i = cs.files_added.begin();
+            i != cs.files_added.end(); ++i)
+            output_files.insert(i->first);
+        }
+
+      if (output_patched)
+        {
+          for (map<file_path, pair<file_id, file_id> >::const_iterator
+            i = cs.deltas_applied.begin(); i != cs.deltas_applied.end(); ++i)
+            output_files.insert(i->first);
+        }
+
+      if (output_attrs)
+        {
+          for (map<pair<file_path, attr_key>, attr_value >::const_iterator
+            i = cs.attrs_set.begin(); i != cs.attrs_set.end(); ++i)
+            output_files.insert(i->first.first);
+
+            // FIXME: naming here could not be more inconsistent
+            // the cset calls it attrs_cleared
+            // the command is attr drop
+            // here it is called unset
+            // the revision text uses attr clear 
+
+          for (set<pair<file_path, attr_key> >::const_iterator
+            i = cs.attrs_cleared.begin(); i != cs.attrs_cleared.end(); ++i)
+            output_files.insert(i->first);
+        }
     }
 
-  copy(print_paths.begin(), print_paths.end(),
+  copy(output_files.begin(), output_files.end(),
        ostream_iterator<file_path>(cout, "\n"));
 }
 
============================================================
--- NEWS	6c8a5b78abdefae4e54702b4467037193c98b365
+++ NEWS	10e25e4e76b43b8ee758a8e3d8c3ed27087af2a3
@@ -29,6 +29,13 @@ XXX XXX XX XX:XX:XX UTC 2011
           messages from mtn automate, regardless of the locale of the
           calling process.
 
+        - The hook 'get_netsync_key' has been split up into two separate
+          hooks, one for client usage ('get_netsync_client_key', with
+          the same arguments as the original 'get_netsync_key') and one
+          for server usage ('get_netsync_server_key', with a single table
+          argument containing all the given '--bind' options).  Please
+          review your custom hooks accordingly.
+ 
         - Short options ('-b', '-d', ...) are no longer completed.  This
           fixes an invariant failure originating from wrong option usage.
           (closes monotone issue 141)
@@ -87,6 +94,19 @@ XXX XXX XX XX:XX:XX UTC 2011
           if no database is specified for these commands.
           (fixes monotone issue 113)
 
+        - If 'mtn serve' is called with one or more '--bind' options, then
+          the arguments to these options can now be specified again
+          as follows:
+
+            '<ip-or-host>' 
+                to listen to IP or host on the default port
+            '<ip-or-host>:<port>'
+                to listen to IP or host on the specified port  - or
+            ':<port>'
+                to listen on all interfaces on the specified port
+
+          (fixes monotone issue 119)
+          
         - monotone does no longer enforce ".mtn" as file extension
           for managed databases.  Instead a new Lua hook,
           get_default_database_glob(), is used to determine a pattern
============================================================
--- src/keys.cc	bdf4a6b94902d29411b16cb169851986a16b3956
+++ src/keys.cc	19db9fa939a1d87aba964f4e84743adcfff6fdd2
@@ -183,13 +183,20 @@ cache_netsync_key(options const & opts,
           found_key = true;
         }
     }
-  else if (lua.hook_get_netsync_key(utf8(info->client.get_uri().resource(), origin::user),
-                                    info->client.get_include_pattern(),
-                                    info->client.get_exclude_pattern(),
-                                    keys, project, key))
+  else if (info->info_type == netsync_connection_info::client_info &&
+           lua.hook_get_netsync_client_key(utf8(info->client.get_uri().resource(), origin::user),
+                                           info->client.get_include_pattern(),
+                                           info->client.get_exclude_pattern(),
+                                           keys, project, key))
     {
       found_key = true;
     }
+  else if (info->info_type == netsync_connection_info::server_info &&
+           lua.hook_get_netsync_server_key(info->server.addrs,
+                                           keys, project, key))
+    {
+      found_key = true;
+    }
   else
     {
       found_key = get_only_key(keys, key_requiredness, key);
============================================================
--- src/lua_hooks.cc	33d6643e8776fa87296f47658fdbfd3001e3cfd9
+++ src/lua_hooks.cc	1c178085332c73dcefb4681d205d17b059e52080
@@ -783,17 +783,17 @@ bool
 }
 
 bool
-lua_hooks::hook_get_netsync_key(utf8 const & server_address,
-                                globish const & include,
-                                globish const & exclude,
-                                key_store & keys,
-                                project_t & project,
-                                key_id & k)
+lua_hooks::hook_get_netsync_client_key(utf8 const & server_address,
+                                       globish const & include,
+                                       globish const & exclude,
+                                       key_store & keys,
+                                       project_t & project,
+                                       key_id & k)
 {
   string name;
   bool exec_ok
     = Lua(st)
-    .func("get_netsync_key")
+    .func("get_netsync_client_key")
     .push_str(server_address())
     .push_str(include())
     .push_str(exclude())
@@ -812,6 +812,41 @@ lua_hooks::hook_get_netsync_key(utf8 con
     }
 }
 
+bool
+lua_hooks::hook_get_netsync_server_key(vector<utf8> const & server_ports,
+                                       key_store & keys,
+                                       project_t & project,
+                                       key_id & k)
+{
+  string name;
+  Lua ll(st);
+  ll.func("get_netsync_server_key");
+
+  ll.push_table();
+  vector<utf8>::const_iterator i;
+  int j;
+  for (i = server_ports.begin(), j = 1; i != server_ports.end(); ++i, ++j)
+    {
+      ll.push_int(j);
+      ll.push_str((*i)());
+      ll.set_table();
+    }
+
+  bool exec_ok = ll.call(1, 1)
+                   .extract_str(name)
+                   .ok();
+
+  if (!exec_ok || name.empty())
+    return false;
+  else
+    {
+      key_identity_info identity;
+      project.get_key_identity(keys, *this, external_key_name(name, origin::user), identity);
+      k = identity.id;
+      return true;
+    }
+}
+
 static void
 push_uri(uri_t const & uri, Lua & ll)
 {
============================================================
--- src/lua_hooks.hh	325fd5a4b588ff4d41e3cec69cbf652089a33fa9
+++ src/lua_hooks.hh	66412b9fa5db97cd3b3ec01cadf036fb346ac161
@@ -80,12 +80,16 @@ public:
                                      map<key_id, bool> const & new_results);
 
   // network hooks
-  bool hook_get_netsync_key(utf8 const & server_address,
-                            globish const & include,
-                            globish const & exclude,
-                            key_store & keys,
-                            project_t & project,
-                            key_id & k);
+  bool hook_get_netsync_client_key(utf8 const & server_address,
+                                   globish const & include,
+                                   globish const & exclude,
+                                   key_store & keys,
+                                   project_t & project,
+                                   key_id & k);
+  bool hook_get_netsync_server_key(vector<utf8> const & server_ports,
+                                   key_store & keys,
+                                   project_t & project,
+                                   key_id & k);
   bool hook_get_netsync_connect_command(uri_t const & uri,
                                         globish const & include_pattern,
                                         globish const & exclude_pattern,
============================================================
--- doc/monotone.texi	73e344eb1ba340193ab61f755d72979a29c58fde
+++ doc/monotone.texi	5c18cff828089e592f5f2d53c2d60793715a4a40
@@ -4687,12 +4687,15 @@ @subsection Global Options
 For a non-netsync command, the Lua hook @address@hidden is
 called.
 
-For a netsync command, the Lua hook @address@hidden is
-called.
+For a client-side netsync command, the Lua hook
address@hidden@ref{get_netsync_client_key}} is called.
 
-If the hook returns non-nil, the return value is the name of the
-key.
+For a command that starts a monotone server, the Lua hook
address@hidden@ref{get_netsync_server_key}} is used.
 
+If any of the aforementioned hooks returns non-nil, the return value
+is the name of the key.
+
 @item
 If there is only one key in the keydir, that is the key.
 
@@ -11419,12 +11422,12 @@ @subsection User Defaults
 
 There is no default definition for this hook; it returns nil.
 
address@hidden@item get_netsync_key(@var{server}, @var{include}, @var{exclude})
address@hidden@item get_netsync_client_key(@var{server}, @var{include}, @var{exclude})
 
-Called by the server and client when a netsync connection is being
-established, and @address@hidden was not given. Returns a string
-which is the name or hash of the key to use to authenticate the
-netsync connection.
+Called by the client when a netsync connection is being established,
+and @address@hidden was not given. Returns a string which is the name
+or hash of the key to use to authenticate the client side of a netsync
+connection.
 
 Note that netsync commands do not need a signing key; they only transmit
 already signed information.
@@ -11432,32 +11435,44 @@ @subsection User Defaults
 See @address@hidden for a discussion of how monotone determines
 what key to use.
 
-Arguments, when called by the server:
+Arguments, when called:
 
 @table @var
 @item server
-The address monotone is listening on.
+The scheme, user, host, port, and path fields from the URI provided on
+the command line. See @ref{netsync uri}.
 
 @item include
-"*"
+The include pattern in the URI provided on the command line.
 
 @item exclude
-""
+The exclude pattern in the URI provided on the command line.
+
 @end table
 
-When called by the client:
address@hidden@item get_netsync_server_key(@var{addresses})
 
address@hidden @var
address@hidden server
-The scheme, user, host, port, and path fields from the URI provided on
-the command line. See @ref{netsync uri}.
+Called by the server when a new netsync server instance is created, and
address@hidden@ref{--key}} was not given. Returns a string which is the name
+or hash of the key to use to authenticate the server side of a netsync
+connection.
 
address@hidden include
-The include pattern in the URI provided on the command line.
+Note that netsync commands do not need a signing key; they only transmit
+already signed information.
 
address@hidden exclude
-The exclude pattern in the URI provided on the command line.
+See @address@hidden for a discussion of how monotone determines
+what key to use.
 
+Arguments, when called:
+
address@hidden @var
address@hidden addresses
+A table of addresses given to monotone via the @option{--bind} option that
+denote the addresses and / or ports monotone is listening on for connections.
+If the address in one of the table entries is omitted, the port must be given
+with a leading colon; in this case monotone listens on all interfaces on this
+port.
+
 @end table
 
 @address@hidden get_default_command_options(@var{command})
============================================================
--- .mtn-ignore	ee776b54b58b1d3cc4265cdfa09a6d426ae1f6c5
+++ .mtn-ignore	347361ce3fa47016cbe4f5ba29188696d939a1d8
@@ -16,7 +16,8 @@
 ^doc/stamp-vti$
 ^doc/texinfo\.tex$
 ^doc/version\.texi$
-^html
+^extra/building/dump-test-logs.sh$
+^extra/shell/monotone.bash_completion$
 ^install-sh$
 ^m4/codeset\.m4$
 ^m4/gettext\.m4$
@@ -55,7 +56,7 @@
 ^po/insert-header\.sin$
 ^po/monotone\.pot$
 ^po/quot\.sed$
-^run_(func|tester|unit)_tests$
+^run_(extra|func|tester|unit)_tests$
 ^src/package_(full_)?revision(\.cc|\.txt|_(dist|raw)\.txt)$
 ^src/schema\.cc$
 ^src/std_hooks\.cc$
============================================================
--- test/func/netsync_key_hook/__driver__.lua	87963f895052ee9dd35d513e23004811169bca38
+++ test/func/netsync_key_hooks/__driver__.lua	d7fad5a70688d3db512a05ebb0e3643006f8c7e2
@@ -1,6 +1,10 @@ mtn_setup()
 
 includecommon("netsync.lua")
 mtn_setup()
+
+--
+-- test get_netsync_client_key
+--
 netsync.setup()
 
 writefile("foo", "bar")
@@ -21,6 +25,7 @@ function client(what, ret)
      "--keydir=keys",
      "--db=test.db", srv.address,
      "--rcfile=client-hooks.lua",
+     "--no-workspace",
      "*"}
   for k, v in pairs(args) do
      table.insert(what, v)
@@ -34,3 +39,33 @@ srv:stop()
 client({"pull", "address@hidden"}, 1)
 
 srv:stop()
+
+--
+-- test get_netsync_server_key
+--
+
+get("server-hooks.lua")
+-- we send a SIGTERM to the server process to stop it, so this is also
+-- what we expect as (negated) return value
+SIGTERM=15
+
+function server(what, ret, exp_err)
+  local addr = "localhost:" .. math.random(1024, 65535)
+  args = {"--rcfile=test_hooks.lua",
+     "--keydir=keys",
+     "--db=test.db", "--bind=" .. addr,
+     "--no-workspace",
+     "serve"}
+  for k, v in pairs(args) do
+     table.insert(what, v)
+  end
+  srv = bg(raw_mtn(unpack(what)), ret, false, true)
+  srv:finish(3)
+  if exp_err ~= nil then
+    check(qgrep(exp_err, "stderr"))
+  end
+end
+
+server({}, 1, "you have multiple private keys")
+server({"--rcfile", "server-hooks.lua"}, -SIGTERM, "beginning service on localhost")
+
============================================================
--- test/func/netsync_key_hook/client-hooks.lua	f60d553a6bff838e53904f94294588d9f9ed84ee
+++ test/func/netsync_key_hooks/client-hooks.lua	e9eb38666d23a1f4a5be33404220902ee90756eb
@@ -1,3 +1,3 @@
-function get_netsync_key(server, include, exclude)
+function get_netsync_client_key(server, include, exclude)
    return "address@hidden"
 end
============================================================
--- src/network/connection_info.cc	78789566ad076c92d8795ea7e3877646c3749693
+++ src/network/connection_info.cc	b732c16161db2394aac449f50c6a6921e553ef22
@@ -279,7 +279,7 @@ netsync_connection_info::Client::set_raw
 
   if (uri.scheme.empty())
     uri.scheme = "mtn";
- 
+
   E(uri.scheme != "mtn" || !uri.host.empty(), origin::user,
     F("a non-empty hostname is expected for the 'mtn' uri scheme"));
 
@@ -400,6 +400,7 @@ netsync_connection_info::setup_default(o
                                        shared_conn_info & info)
 {
   info.reset(new netsync_connection_info(db, opts));
+  info->info_type = client_info;
   info->client.conn_type = type;
 
   info->client.ensure_completeness();
@@ -414,6 +415,7 @@ netsync_connection_info::setup_from_sync
                                                  shared_conn_info & info)
 {
   info.reset(new netsync_connection_info(db, opts));
+  info->info_type = client_info;
   info->client.conn_type = netsync_connection;
 
   info->client.set_raw_uri(request.address);
@@ -461,6 +463,7 @@ netsync_connection_info::setup_from_uri(
                                         shared_conn_info & info)
 {
   info.reset(new netsync_connection_info(db, opts));
+  info->info_type = client_info;
   info->client.conn_type = type;
 
   info->client.set_raw_uri(uri());
@@ -497,6 +500,7 @@ netsync_connection_info::setup_from_serv
       "please consider using the URI calling syntax instead"));
 
   info.reset(new netsync_connection_info(db, opts));
+  info->info_type = client_info;
   info->client.conn_type = type;
 
   info->client.set_raw_uri(host());
@@ -515,6 +519,7 @@ netsync_connection_info::setup_for_serve
                                          shared_conn_info & info)
 {
   info.reset(new netsync_connection_info(db, opts));
+  info->info_type = server_info;
   info->server.addrs = opts.bind_uris;
   info->client.conn_type = netsync_connection;
 
@@ -523,16 +528,6 @@ netsync_connection_info::setup_for_serve
       E(lua.hook_persist_phrase_ok(), origin::user,
         F("need permission to store persistent passphrase "
           "(see hook persist_phrase_ok())"));
-
-      // the uri as well as the include / exclude pattern are
-      // not used directly for serve, but need to be configured
-      // in order to let keys::cache_netsync_key() call the
-      // get_netsync_key() hook properly
-      if (!opts.bind_uris.empty())
-        info->client.set_raw_uri((*opts.bind_uris.begin())());
-
-      info->client.include_pattern = globish("*", origin::internal);
-      info->client.exclude_pattern = globish("", origin::internal);
     }
   else if (!opts.bind_stdio)
     W(F("The --no-transport-auth option is usually only used "
============================================================
--- src/network/connection_info.hh	8841c299c1a214c46071b6f77c3a5dbadeaf4959
+++ src/network/connection_info.hh	0ba5fc1778b78fb3446ad345ec78e073fd9221e4
@@ -102,6 +102,8 @@ struct netsync_connection_info
 
 struct netsync_connection_info
 {
+  enum { client_info, server_info } info_type;
+
   class Server
   {
   public:
============================================================
--- test/func/manpage/__driver__.lua	2230d26ba35875be86cbb8000b4c0c8c7d36f735
+++ test/func/manpage/__driver__.lua	a381ef4517c907170547a4984923650617f69c60
@@ -6,7 +6,7 @@ local s,e,version = string.find(readfile
 -- check for a proper header line
 check(mtn("version"), 0, true, false)
 local s,e,version = string.find(readfile("stdout"), "(monotone %d+\.%d+%S*)")
-check(qgrep(".TH \"monotone\" 1 \"" .. os.date("%Y-%m-%d") .. "\" \"" .. version .. "\"", "manpage"))
+check(qgrep(".TH \"monotone\" 1 \"[0-9]{4}-[0-9]{2}-[0-9]{2}\" \"" .. version .. "\"", "manpage"))
 
 -- check required sections
 check(qgrep(".SH \"NAME\"", "manpage"))
@@ -20,6 +20,3 @@ check(qgrep(".SH \"COPYRIGHT\"", "manpag
 check(qgrep(".SH \"BUGS\"", "manpage"))
 check(qgrep(".SH \"AUTHORS\"", "manpage"))
 check(qgrep(".SH \"COPYRIGHT\"", "manpage"))
-
--- ensure that the copyright is up-to-date
-check(qgrep("Copyright [(]c[)] 2004 - "..os.date("%Y"), "manpage"))
============================================================
--- test/extra/mtn-cleanup/__driver__.lua	c0a63dd6bbb69d30db6f6b64f7d59f2b5f1d00c7
+++ test/extra/mtn-cleanup/__driver__.lua	f650305a0d130a4ac6fb988eed58662a564dcc64
@@ -17,7 +17,7 @@ writefile("workspace/test3", "baz")
 check(indir("workspace", mtn("add", "test2")), 0, false, false)
 writefile("workspace/test3", "baz")
 
-check(indir("workspace", {"./run-mtn-cleanup",srcdir,test.root}),
+check(indir("workspace", {"../run-mtn-cleanup",srcdir,test.root}),
       0, true, false)
 check(exists("workspace/test1"))
 xfail(exists("workspace/test2"))
============================================================
--- /dev/null	
+++ test/func/netsync_bind_opt/__driver__.lua	153c2be3d3c3c37b4fea590633d2d3be9bae5e82
@@ -0,0 +1,27 @@
+skip_if(not existsonpath("netstat"))
+
+includecommon("netsync.lua")
+mtn_setup()
+netsync.setup()
+
+math.randomseed(get_pid())
+local port = math.random(1024, 65535)
+
+-- test with host:port
+srv = netsync.start({"--bind", "localhost:" .. port})
+check({"netstat", "-a", "-n"}, 0, true, false)
+check(qgrep("127[.]0[.]0[.]1[.:]" .. port, "stdout"))
+srv:stop()
+
+-- test with ip:port
+srv = netsync.start({"--bind", "127.0.0.1:" .. port})
+check({"netstat", "-a", "-n"}, 0, true, false)
+check(qgrep("127[.]0[.]0[.]1[.:]" .. port, "stdout"))
+srv:stop()
+
+-- test only with :port
+srv = netsync.start({"--bind", ":" .. port})
+check({"netstat", "-a", "-n"}, 0, true, false)
+check(qgrep("([*]|0[.]0[.]0[.]0)[.:]" .. port, "stdout"))
+srv:stop()
+
============================================================
--- /dev/null	
+++ test/func/netsync_key_hooks/server-hooks.lua	434dab628a58b2c644f5ad6997420f1186cabbb5
@@ -0,0 +1,3 @@
+function get_netsync_server_key(addresses)
+   return "address@hidden"
+end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]