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: a54ec428f3093cc06fc51860df


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: a54ec428f3093cc06fc51860dff5ca0e4949d180
Date: Fri, 18 Feb 2011 20:54:19 +0100 (CET)

revision:            a54ec428f3093cc06fc51860dff5ca0e4949d180
date:                2011-02-08T16:15:00
author:              address@hidden
branch:              net.venge.monotone
changelog:
merge of 'a97adfb356cbb187d309c4496385a38b02fb6f94'
     and 'c05709d4b5aedc2800b7bab596583c52b5f7f73b'

manifest:
format_version "1"

new_manifest [891779c4ce1ef0b5f3172ceb45e8a60b87238abe]

old_revision [a97adfb356cbb187d309c4496385a38b02fb6f94]

patch "test/extra/bash_completion/library.exp"
 from [fe2bdcd48b3dae04cf4863d11bccb42b98ad01d5]
   to [1785f08fc97cacfd1ec382191e3d86268125adca]

patch "test/src/tester.cc"
 from [acaadc933bb12e50e8d7ef310678c2fcaf2243bf]
   to [98ee04487bc08d905de66ea4bd335417d4bfaeef]

old_revision [c05709d4b5aedc2800b7bab596583c52b5f7f73b]

patch "src/cmd.cc"
 from [738af533e09611f04b922b5e9ab5f6eae894b918]
   to [a30ab07e170d4057669ae434735272338667915d]
============================================================
--- test/src/tester.cc	acaadc933bb12e50e8d7ef310678c2fcaf2243bf
+++ test/src/tester.cc	98ee04487bc08d905de66ea4bd335417d4bfaeef
@@ -914,7 +914,7 @@ int main(int argc, char **argv)
 
       if (want_help || need_help)
         {
-          P(F("Usage: %s test-file testsuite [options] [tests]\n") % argv[0]);
+          P(F("Usage: %s testsuite [options] [tests]\n") % argv[0]);
           P(F("Testsuite: a Lua script defining the test suite to run.\n"
               "Options:\n"
               "  -l, --list     just list tests that would be run\n"
============================================================
--- test/extra/bash_completion/library.exp	fe2bdcd48b3dae04cf4863d11bccb42b98ad01d5
+++ test/extra/bash_completion/library.exp	1785f08fc97cacfd1ec382191e3d86268125adca
@@ -15,7 +15,8 @@ set env(srcdir) $srcdir
 set timeout 2
 set env(initial_dir) $initial_dir
 set env(srcdir) $srcdir
-spawn "bash" "--rcfile" "$srcdir/extra/bash_completion/bashrc"
+# some user's ~/.bash_profile start xserver etc; don't do that
+spawn "bash" "--init-file" "/dev/nul" "--rcfile" "$srcdir/extra/bash_completion/bashrc"
 # If there is no completion package, it's no point trying this.
 expect {
     -timeout 1
============================================================
--- src/cmd.cc	738af533e09611f04b922b5e9ab5f6eae894b918
+++ src/cmd.cc	a30ab07e170d4057669ae434735272338667915d
@@ -41,6 +41,9 @@ using boost::lexical_cast;
 using std::cout;
 using boost::lexical_cast;
 
+using std::cerr;
+using std::endl;
+
 //
 // Definition of top-level commands, used to classify the real commands
 // in logical groups.
@@ -630,10 +633,36 @@ static string
 }
 
 static string
+man_hyphens(string const s)
+{
+  string out;
+  size_t p1 = 0;
+  size_t p2 = s.find("-", p1);
+  while (p2 != s.npos)
+    {
+      // Sometimes, this function gets called again with the result of a
+      // previous call, so watch out for hyphens that are already preceeded
+      // with a backslash
+      if (p2 > 0 && s[p2 - 1] == '\\')
+        {
+          p2 = s.find("-", p2 + 1);
+          continue;
+        }
+
+      out += s.substr(p1, p2 - p1);
+      out += "\\-";
+      p1 = p2 + 1;
+      p2 = s.find("-", p1);
+    }
+  out += s.substr(p1, s.npos);
+  return out;
+}
+
+static string
 man_definition(vector<string> const & labels, string const & content, int width = -1)
 {
   string out;
-  out += ".IP \"" + (*labels.begin()) + "\"";
+  out += ".IP \"" + man_hyphens(*labels.begin()) + "\"";
 
   if (width != -1)
     out += " " + lexical_cast<string>(width);
@@ -645,13 +674,14 @@ man_definition(vector<string> const & la
       for (vector<string>::const_iterator i = labels.begin() + 1;
            i < labels.end(); ++i)
         {
-          out += ".IP \"" + (*i) + "\"\n";
+          out += ".IP \"" + man_hyphens(*i) + "\"\n";
         }
       out += ".PD\n";
     }
-  out += content;
+  out += man_hyphens(content);
   if (content.rfind('\n') != (content.size() - 1))
      out += "\n";
+
   return out;
 }
 
@@ -881,7 +911,7 @@ CMD_NO_WORKSPACE(manpage, "manpage", "",
   ss << man_title("monotone");
   ss << man_section(_("Name"));
 
-  ss << _("monotone - a distributed version control system") << "\n";
+  ss << _("monotone \\- a distributed version control system") << "\n";
   ss << man_section(_("Synopsis"));
   ss << man_bold(prog_name) << " "
      << man_italic(_("[options...] command [arguments...]"))
@@ -925,7 +955,7 @@ CMD_NO_WORKSPACE(manpage, "manpage", "",
           "programmers, known as the monotone development team.") << "\n";
 
   ss << man_section("Copyright");
-  ss << (F("monotone and this man page is Copyright (c) 2004 - %s by "
+  ss << (F("monotone and this man page is Copyright (c) 2004 \\- %s by "
            "the monotone development team.")
            % date_t::now().as_formatted_localtime("%Y")).str() << "\n";
 

reply via email to

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