Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76636 - in branches/quickbook-dev: . libs/crc/doc/html libs/filesystem/v3/doc libs/filesystem/v3/src tools tools/quickbook tools/quickbook/src tools/quickbook/test
From: dnljms_at_[hidden]
Date: 2012-01-22 12:28:47


Author: danieljames
Date: 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
New Revision: 76636
URL: http://svn.boost.org/trac/boost/changeset/76636

Log:
Quickbook: Merge to quickbook-dev
Removed:
   branches/quickbook-dev/libs/crc/doc/html/
Properties modified:
   branches/quickbook-dev/ (props changed)
   branches/quickbook-dev/tools/ (props changed)
   branches/quickbook-dev/tools/quickbook/ (props changed)
Text files modified:
   branches/quickbook-dev/libs/filesystem/v3/doc/release_history.html | 26 +++++++++++++++++++++++++-
   branches/quickbook-dev/libs/filesystem/v3/src/operations.cpp | 7 ++++---
   branches/quickbook-dev/tools/quickbook/src/actions.cpp | 7 +++++--
   branches/quickbook-dev/tools/quickbook/src/id_manager.cpp | 29 +++++++++++++++++++++++------
   branches/quickbook-dev/tools/quickbook/src/id_manager.hpp | 2 ++
   branches/quickbook-dev/tools/quickbook/test/heading-1_1.gold | 6 ++++++
   branches/quickbook-dev/tools/quickbook/test/heading-1_1.quickbook | 6 ++++++
   branches/quickbook-dev/tools/quickbook/test/heading-1_5.gold | 13 +++++++++++--
   branches/quickbook-dev/tools/quickbook/test/heading-1_5.quickbook | 6 ++++++
   branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold | 14 +++++++++++---
   branches/quickbook-dev/tools/quickbook/test/heading-1_6.quickbook | 6 ++++++
   11 files changed, 105 insertions(+), 17 deletions(-)

Modified: branches/quickbook-dev/libs/filesystem/v3/doc/release_history.html
==============================================================================
--- branches/quickbook-dev/libs/filesystem/v3/doc/release_history.html (original)
+++ branches/quickbook-dev/libs/filesystem/v3/doc/release_history.html 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -36,6 +36,30 @@
   </tr>
 </table>
 
+<h2>1.49.0</h2>
+<ul>
+ <li>Fix directory_iterator access violation on Windows if error is thrown
+ (#5900). Thanks to Andreas Eckleder for the patch.</li>
+ <li>Fix a bug in director_iterator construction with error_code argument that
+ caused increment to be called without the ec argument being passed. Reported
+ by anonymous as ticket #5900 comment 3.</li>
+ <li>Cleaned up test suite path_test.cpp code issues exposed by #5989 even
+ though the ticket itself was NAD. Clarified docs; iteration over a path yields
+ generic format.</li>
+ <li>Added test cases and fixes for class path errors when assignment or append
+ used self or portion of self as source. Fixes ticket #3714.</li>
+ <li>Change Windows codecvt processing from CP_THREAD_ACP to CP_ACP, resolving
+ ticket #5592.</li>
+ <li>Operations function fixes for PGI compiler, thanks to Noel Belcourt.</li>
+ <li>Relax permissions test to reflect reality, particularly on the Sandia test
+ platforms.</li>
+ <li>Fix #4889, #6320, Locale codecvt_facet not thread safe on Windows. Move
+ Windows, Mac OS X, locale and codecvt facet back to namespace scope. POSIX
+ except OS X uses local static initialization (IE lazy) to ensure exceptions
+ are catchable if environmental variables are misconfigured and to avoid use of
+ locale(&quot;&quot;) if not actually used.</li>
+</ul>
+
 <h2>1.48.0</h2>
 <ul>
   <li>Added operational function canonical(),
@@ -88,7 +112,7 @@
 </ul>
 <hr>
 <p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->03 October, 2011<!--webbot bot="Timestamp" endspan i-checksum="38359" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->21 January, 2012<!--webbot bot="Timestamp" endspan i-checksum="38504" --></p>
 <p>© Copyright Beman Dawes, 2011</p>
 <p> Use, modification, and distribution are subject to the Boost Software
 License, Version 1.0. See <a href="http://www.boost.org/LICENSE_1_0.txt">

Modified: branches/quickbook-dev/libs/filesystem/v3/src/operations.cpp
==============================================================================
--- branches/quickbook-dev/libs/filesystem/v3/src/operations.cpp (original)
+++ branches/quickbook-dev/libs/filesystem/v3/src/operations.cpp 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -2146,7 +2146,7 @@
         && (filename.size()== 1
           || (filename[1] == dot
             && filename.size()== 2)))
- { it.increment(); }
+ { it.increment(*ec); }
     }
   }
 
@@ -2168,13 +2168,14 @@
 # endif
         filename, file_stat, symlink_file_stat);
 
- if (temp_ec)
+ if (temp_ec) // happens if filesystem is corrupt, such as on a damaged optical disc
       {
+ path error_path(it.m_imp->dir_entry.path().parent_path()); // fix ticket #5900
         it.m_imp.reset();
         if (ec == 0)
           BOOST_FILESYSTEM_THROW(
             filesystem_error("boost::filesystem::directory_iterator::operator++",
- it.m_imp->dir_entry.path().parent_path(),
+ error_path,
               error_code(BOOST_ERRNO, system_category())));
         ec->assign(BOOST_ERRNO, system_category());
         return;

Modified: branches/quickbook-dev/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.cpp 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -412,7 +412,9 @@
             // version and the generation version are less then 103u.
 
             std::string anchor = actions.ids.old_style_id(
- detail::make_identifier(content.get_encoded()),
+ detail::make_identifier(
+ actions.ids.replace_placeholders_with_unresolved_ids(
+ content.get_encoded())),
                 id_category::generated_heading);
 
             write_bridgehead(actions, level,
@@ -425,7 +427,8 @@
                 detail::make_identifier(
                     actions.ids.compatibility_version() >= 106 ?
                         content.get_quickbook() :
- content.get_encoded()
+ actions.ids.replace_placeholders_with_unresolved_ids(
+ content.get_encoded())
                 ),
                 id_category::generated_heading);
 

Modified: branches/quickbook-dev/tools/quickbook/src/id_manager.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/id_manager.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/id_manager.cpp 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -30,6 +30,8 @@
 
     struct id_placeholder;
     struct id_data;
+ std::string replace_ids(id_state& state, std::string const& xml,
+ bool use_resolved_ids = true);
     std::string process_ids(id_state&, std::string const&);
 
     static const std::size_t max_size = 32;
@@ -46,6 +48,9 @@
         state_enum generation_state;
                                 // Placeholder's position in generation
                                 // process.
+ std::string unresolved_id;
+ // The id that would be generated without any
+ // duplicate handling.
         std::string id; // The id so far.
         id_placeholder* parent; // Placeholder of the parent id.
                                 // Only when generation_state == child
@@ -69,6 +74,7 @@
                 id_placeholder* parent_ = 0)
           : index(index),
             generation_state(parent_ ? child : unresolved),
+ unresolved_id(parent_ ? parent_->unresolved_id + '.' + id : id),
             id(id),
             parent(parent_),
             category(category),
@@ -285,6 +291,12 @@
         return state->add_placeholder(id, category)->to_string();
     }
 
+ std::string id_manager::replace_placeholders_with_unresolved_ids(
+ std::string const& xml) const
+ {
+ return replace_ids(*state, xml, false);
+ }
+
     std::string id_manager::replace_placeholders(std::string const& xml) const
     {
         assert(!state->current_file);
@@ -868,7 +880,6 @@
     placeholder_index index_placeholders(id_state&, std::string const& xml);
     void resolve_id(id_placeholder&, allocated_ids&);
     void generate_id(id_placeholder&, allocated_ids&);
- std::string replace_ids(id_state& state, std::string const& xml);
 
     std::string process_ids(id_state& state, std::string const& xml)
     {
@@ -1081,11 +1092,13 @@
     struct replace_ids_callback : xml_processor::callback
     {
         id_state& state;
+ bool use_resolved_ids;
         std::string::const_iterator source_pos;
         std::string result;
 
- replace_ids_callback(id_state& state)
+ replace_ids_callback(id_state& state, bool resolved)
           : state(state),
+ use_resolved_ids(resolved),
             source_pos(),
             result()
         {}
@@ -1099,10 +1112,13 @@
         {
             if (id_placeholder* p = state.get_placeholder(value))
             {
- assert(p->check_state(id_placeholder::generated));
+ assert(!use_resolved_ids ||
+ p->check_state(id_placeholder::generated));
+ std::string const& id = use_resolved_ids ?
+ p->id : p->unresolved_id;
 
                 result.append(source_pos, value.begin());
- result.append(p->id.begin(), p->id.end());
+ result.append(id.begin(), id.end());
                 source_pos = value.end();
             }
         }
@@ -1114,10 +1130,11 @@
         }
     };
 
- std::string replace_ids(id_state& state, std::string const& xml)
+ std::string replace_ids(id_state& state, std::string const& xml,
+ bool use_unresolved_ids)
     {
         xml_processor processor;
- replace_ids_callback callback(state);
+ replace_ids_callback callback(state, use_unresolved_ids);
         processor.parse(xml, callback);
         return callback.result;
     }

Modified: branches/quickbook-dev/tools/quickbook/src/id_manager.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/id_manager.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/id_manager.hpp 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -73,6 +73,8 @@
         std::string add_id(std::string const&, id_category);
         std::string add_anchor(std::string const&, id_category);
 
+ std::string replace_placeholders_with_unresolved_ids(
+ std::string const&) const;
         std::string replace_placeholders(std::string const&) const;
         
         unsigned compatibility_version() const;

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_1.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_1.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_1.gold 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -37,6 +37,12 @@
   <bridgehead renderas="sect1" id="._also_not_an_id">
     :also not an id
   </bridgehead>
+ <bridgehead renderas="sect1" id="._anchor_id__anchor___anchor_heading">
+ <anchor id="anchor"/>Anchor heading
+ </bridgehead>
+ <bridgehead renderas="sect1" id="._link_linkend__anchor__link_heading__link_">
+ <link linkend="anchor">Link heading</link>
+ </bridgehead>
   <bridgehead renderas="sect1" id=".h1">
     H1
   </bridgehead>

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_1.quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_1.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_1.quickbook 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -20,6 +20,12 @@
 [h1:notanid]
 [h1:also not an id]
 
+[/ Test how ids are generated for headings containing things like anchors
+ and links ]
+
+[h1 [#anchor]Anchor heading]
+[h1 [link anchor Link heading]]
+
 [/ Test how heading ids are generated inside sections]
 
 [h1 H1]

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_5.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_5.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_5.gold 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -45,7 +45,16 @@
     <phrase id="heading_test_1_5._also_not_an_id"/><link linkend="heading_test_1_5._also_not_an_id">:also
     not an id</link>
   </bridgehead>
- <bridgehead renderas="sect2" id="heading_test_1_5.h13">
+ <bridgehead renderas="sect1" id="heading_test_1_5.h13">
+ <phrase id="heading_test_1_5._anchor_id__anchor___anchor_heading"/><link linkend="heading_test_1_5._anchor_id__anchor___anchor_heading"><anchor
+ id="anchor"/>Anchor heading</link>
+ </bridgehead>
+ <bridgehead renderas="sect1" id="heading_test_1_5.h14">
+ <phrase id="heading_test_1_5._link_linkend__anchor__link_heading__link_"/><link
+ linkend="heading_test_1_5._link_linkend__anchor__link_heading__link_"><link linkend="anchor">Link
+ heading</link></link>
+ </bridgehead>
+ <bridgehead renderas="sect2" id="heading_test_1_5.h15">
     <phrase id="heading_test_1_5.h1"/><link linkend="heading_test_1_5.h1">H1</link>
   </bridgehead>
   <section id="heading_test_1_5.s1">
@@ -72,7 +81,7 @@
       <phrase id="heading_test_1_5.s1.h6"/><link linkend="heading_test_1_5.s1.h6">H6</link>
     </bridgehead>
   </section>
- <bridgehead renderas="sect1" id="heading_test_1_5.h14">
+ <bridgehead renderas="sect1" id="heading_test_1_5.h16">
     <phrase id="heading_test_1_5.h7"/><link linkend="heading_test_1_5.h7">H7</link>
   </bridgehead>
 </article>

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_5.quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_5.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_5.quickbook 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -22,6 +22,12 @@
 [h1:notanid]
 [h1:also not an id]
 
+[/ Test how ids are generated for headings containing things like anchors
+ and links ]
+
+[h1 [#anchor]Anchor heading]
+[h1 [link anchor Link heading]]
+
 [/ Test how heading ids are generated inside sections]
 
 [heading H1]

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_6.gold 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -39,6 +39,14 @@
     <phrase id="heading_test_1_6.comment"/><link linkend="heading_test_1_6.comment">Comment</link>
   </bridgehead>
   <bridgehead renderas="sect1" id="heading_test_1_6.h11">
+ <phrase id="heading_test_1_6.anchor_anchor_heading"/><link linkend="heading_test_1_6.anchor_anchor_heading"><anchor
+ id="anchor"/>Anchor heading</link>
+ </bridgehead>
+ <bridgehead renderas="sect1" id="heading_test_1_6.h12">
+ <phrase id="heading_test_1_6.link_anchor_link_heading"/><link linkend="heading_test_1_6.link_anchor_link_heading"><link
+ linkend="anchor">Link heading</link></link>
+ </bridgehead>
+ <bridgehead renderas="sect1" id="heading_test_1_6.h13">
     <phrase id="heading_test_1_6.h1"/><link linkend="heading_test_1_6.h1">H1</link>
   </bridgehead>
   <section id="heading_test_1_6.s1">
@@ -65,10 +73,10 @@
       <phrase id="heading_test_1_6.s1.h6"/><link linkend="heading_test_1_6.s1.h6">H6</link>
     </bridgehead>
   </section>
- <bridgehead renderas="sect1" id="heading_test_1_6.h12">
+ <bridgehead renderas="sect1" id="heading_test_1_6.h14">
     <phrase id="heading_test_1_6.h7"/><link linkend="heading_test_1_6.h7">H7</link>
   </bridgehead>
- <bridgehead renderas="sect1" id="heading_test_1_6.h13">
+ <bridgehead renderas="sect1" id="heading_test_1_6.h15">
     <phrase id="heading_test_1_6.a1"/><link linkend="heading_test_1_6.a1">H1</link>
   </bridgehead>
   <section id="heading_test_1_6.s1_0">
@@ -95,7 +103,7 @@
       <phrase id="heading_test_1_6.s1_0.a6"/><link linkend="heading_test_1_6.s1_0.a6">H6</link>
     </bridgehead>
   </section>
- <bridgehead renderas="sect1" id="heading_test_1_6.h14">
+ <bridgehead renderas="sect1" id="heading_test_1_6.h16">
     <phrase id="heading_test_1_6.a7"/><link linkend="heading_test_1_6.a7">H7</link>
   </bridgehead>
 </article>

Modified: branches/quickbook-dev/tools/quickbook/test/heading-1_6.quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/heading-1_6.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/heading-1_6.quickbook 2012-01-22 12:28:46 EST (Sun, 22 Jan 2012)
@@ -17,6 +17,12 @@
 [h1 *Bold*]
 [h1 [/]Comment[/]]
 
+[/ Test how ids are generated for headings containing things like anchors
+ and links ]
+
+[h1 [#anchor]Anchor heading]
+[h1 [link anchor Link heading]]
+
 [/ Test how heading ids are generated inside sections]
 
 [h1 H1]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk