#
#
# delete "tests/automate_inventory/inventory_hooks.lua"
#
# delete "tests/manifest_restrictions/ignored.lua"
#
# delete "tests/mkdir/ignore_hook.lua"
#
# delete "tests/restricted_commands_are_consistent/ignore.lua"
#
# delete "tests/revert_ignored_files/ignore.lua"
#
# delete "tests/revert_works_with_restrictions/ignore_hook.lua"
#
# delete "tests/syntax_errors_in_.mtn-ignore/ignore.lua"
#
# rename "tests/spawn_redirected_hook_helper/testhooks"
# to "tests/spawn_redirected_hook_helper/testhooks.lua"
#
# rename "tests/test_some_hook_helper_functions/testhooks"
# to "tests/test_some_hook_helper_functions/testhooks.lua"
#
# patch "ChangeLog"
# from [2a759016cabfd22e924c7d2d7ccad848da766a0a]
# to [ff5e3f7396057cf55685e78c8f0479391f5b76a9]
#
# patch "annotate.cc"
# from [dc5051843ce6406acbf2fadf151e9e9d52a36946]
# to [7e5a4a4c768197dd53f236810b1a661a4a557125]
#
# patch "cmd_ws_commit.cc"
# from [7dc23e7fa867951dbc82b5bd2da8a3560f2e4fc6]
# to [369879d22a0c948672ec69143a441e56c6e70733]
#
# patch "lua_hooks.cc"
# from [2ba09f87d8dc16a1957cad5abc98565a7c87cc7c]
# to [9f6086677ce5eaf8a00d7213af7ff7fad2c6febf]
#
# patch "lua_hooks.hh"
# from [7442504bf6a1fff7e6afe120d6883198f5303842]
# to [4c4cf2633131c9de5b5ee26a7a12bee0e2dd6014]
#
# patch "pcrewrap.cc"
# from [dd081644cde0233e19d86e37323b14ff6daf4594]
# to [a924e9ddb82895ed65efc23daeced38fd3eba67d]
#
# patch "pcrewrap.hh"
# from [5b3070b3642cc669273a7347bf6feb938f465215]
# to [244cc638f7a9676d3981974a70bb274f3be06e84]
#
# patch "restrictions.cc"
# from [474dbc86c29a1f8ce0abb1f27ebde4849c2042dc]
# to [dc91cbcec3bb7d6a70f084b675cb78ca19c89c92]
#
# patch "restrictions.hh"
# from [5b16498cc58ffea38a6e98f4b32efda724dc7ef3]
# to [a92fb8592600abc74bf22c96fbae73268511737e]
#
# patch "std_hooks.lua"
# from [8174984c17963cd5aa57748cb3abd90a1be7b8ce]
# to [2cce6d4e4574dd3225364bbb734a8839df87bcac]
#
# patch "tests/addition_of_files_and_directories/__driver__.lua"
# from [91100a9f3896ff4baa703586ebba94ff2654f115]
# to [c2b0ac39219d138ccf22fb0d6f69e3e84bedc19d]
#
# patch "tests/automate_inventory/__driver__.lua"
# from [21d9c672d0dc7c25066da114ac100a25060e6838]
# to [06b203ca291c9ee93f28cdbf13a775cdf66635cb]
#
# patch "tests/manifest_restrictions/__driver__.lua"
# from [0eea8a13102d0725bfb212125b29c6e33c945119]
# to [9a54979b3b7cb6f1aaab4ba4a9923c0ae66fb9c8]
#
# patch "tests/mkdir/__driver__.lua"
# from [33e48a4f90a4fc32c8031389366479e634619fe1]
# to [d8ac9fa990499b9a7e1692cf3ea85aa55fde6a93]
#
# patch "tests/mtn_add_dot/__driver__.lua"
# from [6858c894d4638b4b9c4dca9ed5e701a8a799918f]
# to [11d25f15c1174862121c8cc4bba914e0c80ec817]
#
# patch "tests/restricted_commands_are_consistent/__driver__.lua"
# from [2859490ab866d2bcb418b6738123b58cf87dc760]
# to [f8d3c49b5417f5d078aac5225e690d9c69cd9d73]
#
# patch "tests/revert_ignored_files/__driver__.lua"
# from [d853be95ada1e10faef3b5e56873054b108fd24d]
# to [35e9149005ae38d0bf2a4d9d946e8aeb4b3aafb6]
#
# patch "tests/revert_works_with_restrictions/__driver__.lua"
# from [0c1cd59c222d501aa739fb0a2caa4d450bba0a2b]
# to [66ebe57ad06990aa60bed705f6146c5988a72726]
#
# patch "tests/spawn_redirected_hook_helper/__driver__.lua"
# from [7510e5e9d34dc9e063bbc33018ce2ea8e86f3c2a]
# to [875dc3cc89a24f7e6cd1b5352eeb216699bd1649]
#
# patch "tests/spawn_redirected_hook_helper/testhooks.lua"
# from [ca2591f01fbf45e890056734ef35209852b6d2fd]
# to [ddaa35c3568350c21994aa3c3851cbe70a341aba]
#
# patch "tests/syntax_errors_in_.mtn-ignore/__driver__.lua"
# from [40ae692978a4b62a47ad35468cc2e52656a68643]
# to [c5de9634b9f83a6d76e6cac44a524153dfef1c4d]
#
# patch "tests/syntax_errors_in_.mtn-ignore/stderr-ref"
# from [6f474b55e26298e81d8a9365fa5bfd99e580e417]
# to [8f8b4d47d427005b67ce140fa324982ee26a118b]
#
# patch "tests/test_hooks.lua"
# from [731fd61c7d9490548d9eed744629a6950748890b]
# to [8bafb1d7da871ac202a12f3745d6a6273a2fdbb6]
#
# patch "tests/test_some_hook_helper_functions/__driver__.lua"
# from [0452cea0d5129e7c27bd16e191a210a1c3e7864b]
# to [c894af66f29df3dbd1ff99e8acf7c856558e1094]
#
# patch "tests/test_some_hook_helper_functions/testhooks.lua"
# from [4c344db8109d494ac0b3bac8789ef97f4fc25ecf]
# to [3bf31c743cd781a151963f0b1b1e93de2d5127d5]
#
# patch "tests/things_in_.mtn-ignore_get_ignored/__driver__.lua"
# from [135078855fd8b9826fa1b15314ad3ced48850d45]
# to [716760c01df74827ba80f177f94f41adf0da623b]
#
# patch "testsuite.lua"
# from [d8002514928ca3bdfd74d4d3fa8e21534175ee1c]
# to [273fdf6f8b1125dabb6d661c1ef85c4525dfcab1]
#
# patch "work.cc"
# from [6d3bd354fb938e901952cc38599415dbb056e3c8]
# to [9d75ba94d10f4f8f10c84477eace793dc4b9a993]
#
============================================================
--- ChangeLog 2a759016cabfd22e924c7d2d7ccad848da766a0a
+++ ChangeLog ff5e3f7396057cf55685e78c8f0479391f5b76a9
@@ -1,3 +1,41 @@
+2007-01-03 Zack Weinberg
+
+ * annotate.cc: Add a #define to suppress boost.serialization
+ (which we do not use).
+ * pcrewrap.hh (basic_regex, regex): Don't disallow the default
+ copy constructor or operator=, so that these objects can be put
+ into STL containers.
+ * pcrewrap.cc (adjrefcount): New function to access a pcre_t's
+ internal reference count conveniently.
+ (regex): Bump the reference count in all constructors.
+ Add definitions of the copy constructor and operator=.
+ Call pcre_free in destructor only if refcount is zero after
+ decrement.
+
+ * restrictions.cc: Transplant all logic for ignoring files here.
+ (ignore_file): New export.
+ (validate_roster_paths, validate_workspace_paths): Use
+ ignore_file. Remove app_state argument. All callers changed.
+ * restrictions.hh: Declare ignore_file.
+ * lua_hooks.cc, lua_hooks.hh (hook_ignore_file): Delete.
+ * std_hooks.lua (dir_matches, ignore_file): Delete.
+ * tests/test_hooks.lua (ignore_file): Delete.
+ * testsuite.lua (mtn_setup): Provide a sane .mtn-ignore.
+
+ * work.cc: Use ignore_file not hook_ignore_file; remove lua_hooks
+ references everywhere they are no longer necessary.
+ * cmd_ws_commit.cc (CMD(mkdir)): Use ignore_file.
+
+ * tests/addition_of_files_and_directories, tests/automate_inventory
+ * tests/manifest_restrictions, tests/mkdir, tests/mtn_add_dot
+ * tests/restricted_commands_are_consistent
+ * tests/revert_ignored_files, tests/revert_works_with_restrictions
+ * tests/spawn_redirected_hook_helper
+ * tests/syntax_errors_in_.mtn-ignore
+ * tests/test_some_hook_helper_functions
+ * tests/things_in_.mtn-ignore_get_ignored:
+ Rejigger for ignore no longer being a hook.
+
2006-12-29 Zack Weinberg
* pcrewrap.cc (pcre_match_error): Remove "subject" parameter.
@@ -76,14 +114,14 @@ 2006-12-21 Thomas Keller
* NEWS: refined some sections and added notes about
- fixes in automate inventory and the localization code
+ fixes in automate inventory and the localization code
2006-12-19 Thomas Keller
@@ -164,11 +202,11 @@ 2006-12-14 Thomas Keller
- * work.cc: handle missing directories properly in
- classify_roster_paths
- * automate.cc: trailing slash also for missing directories
- * tests/...: adapted automate_inventory test which now tests
- for unknown, added (but missing) and dropped (uncommitted) dirs
+ * work.cc: handle missing directories properly in
+ classify_roster_paths
+ * automate.cc: trailing slash also for missing directories
+ * tests/...: adapted automate_inventory test which now tests
+ for unknown, added (but missing) and dropped (uncommitted) dirs
2006-12-14 Thomas Keller
@@ -192,26 +230,26 @@ 2006-12-12 Ben Walton
-
- * cmd_ws_cc: Added mtn mkdir
- * testsuite.lua: added mtn mkdir test
- * included tests/mkdir as unit testing for mtn mkdir
- * added documentation to monotone.texi
+ * cmd_ws_cc: Added mtn mkdir
+ * testsuite.lua: added mtn mkdir test
+ * included tests/mkdir as unit testing for mtn mkdir
+ * added documentation to monotone.texi
+
2006-12-12 Thomas Moschny
* HACKING: Updated "Patch submission guidelines" section.
2006-12-11 Ben Walton
-
- * cmd_ws_commit.cc,
- tests/commit_using__MTN_log/commit_log_modified_return.lua,
- tests/commit_using__MTN_log/__driver__.lua:
- Added the requirement that when _MTN/log is pre-specified by
- the user, that the user remove a 'magic' line prior to the
- commit being accepted. Modified the units tests to verify this.
- Updated texinfo to match this new behaviour.
+ * cmd_ws_commit.cc,
+ tests/commit_using__MTN_log/commit_log_modified_return.lua,
+ tests/commit_using__MTN_log/__driver__.lua:
+ Added the requirement that when _MTN/log is pre-specified by
+ the user, that the user remove a 'magic' line prior to the
+ commit being accepted. Modified the units tests to verify this.
+ Updated texinfo to match this new behaviour.
+
2006-12-10 Timothy Brownawell
Implement a "mtn log --to ", that doesn't log the
@@ -1520,7 +1558,7 @@ 2006-09-02 Matt Johnston
-
+
* botan/: import of Botan 1.5
2006-08-31 Nathaniel Smith
============================================================
--- annotate.cc dc5051843ce6406acbf2fadf151e9e9d52a36946
+++ annotate.cc 7e5a4a4c768197dd53f236810b1a661a4a557125
@@ -10,6 +10,7 @@
#include
#include
+#define BOOST_MULTI_INDEX_DISABLE_SERIALIZATION
#include
#include
#include
============================================================
--- cmd_ws_commit.cc 7dc23e7fa867951dbc82b5bd2da8a3560f2e4fc6
+++ cmd_ws_commit.cc 369879d22a0c948672ec69143a441e56c6e70733
@@ -288,7 +288,7 @@ CMD(mkdir, N_("workspace"), N_("[DIRECTO
//wouldn't make sense to add a dir to .mtn-ignore and then
//try to add it to the project with a mkdir statement, but
//one never can tell...
- N(app.opts.no_ignore || !app.lua.hook_ignore_file(fp),
+ N(app.opts.no_ignore || !ignore_file(fp),
F("ignoring directory '%s' [see .mtn-ignore]") % fp);
paths.insert(sp);
============================================================
--- lua_hooks.cc 2ba09f87d8dc16a1957cad5abc98565a7c87cc7c
+++ lua_hooks.cc 9f6086677ce5eaf8a00d7213af7ff7fad2c6febf
@@ -298,19 +298,6 @@ bool
}
bool
-lua_hooks::hook_ignore_file(file_path const & p)
-{
- bool ignore_it = false;
- bool exec_ok = Lua(st)
- .func("ignore_file")
- .push_str(p.as_external())
- .call(1,1)
- .extract_bool(ignore_it)
- .ok();
- return exec_ok && ignore_it;
-}
-
-bool
lua_hooks::hook_ignore_branch(string const & branch)
{
bool ignore_it = false;
============================================================
--- lua_hooks.hh 7442504bf6a1fff7e6afe120d6883198f5303842
+++ lua_hooks.hh 4c4cf2633131c9de5b5ee26a7a12bee0e2dd6014
@@ -77,7 +77,6 @@ public:
bool hook_get_netsync_write_permitted(rsa_keypair_id const & identity);
// local repo hooks
- bool hook_ignore_file(file_path const & p);
bool hook_ignore_branch(std::string const & branch);
bool hook_merge3(file_path const & anc_path,
file_path const & left_path,
============================================================
--- pcrewrap.cc dd081644cde0233e19d86e37323b14ff6daf4594
+++ pcrewrap.cc a924e9ddb82895ed65efc23daeced38fd3eba67d
@@ -67,22 +67,49 @@ get_capturecount(void const * bd)
return cc;
}
+// We do occasionally need to copy regex objects around, so we make use of
+// the PCRE refcount machinery to ensure the underlying data blocks are
+// freed only once. Encapsulate the pointer diddling needed for this.
+inline unsigned short adjrefcount(void const * bd, short n)
+{
+ return pcre_refcount(static_cast(const_cast(bd)), n);
+}
+
namespace pcre
{
regex::regex(char const * pattern, flags options)
: basic_regex(compile(pattern, options))
- {}
+ {
+ I(adjrefcount(basedat, 1) == 1);
+ }
regex::regex(string const & pattern, flags options)
: basic_regex(compile(pattern.c_str(), options))
- {}
+ {
+ I(adjrefcount(basedat, 1) == 1);
+ }
+ regex::regex(regex const & other)
+ : basic_regex(other)
+ {
+ I(adjrefcount(basedat, 1) < 65535);
+ }
+
+ regex & regex::operator=(regex const & other)
+ {
+ *(static_cast(this)) = static_cast(other);
+ I(adjrefcount(basedat, 1) < 65535);
+ return *this;
+ }
+
regex::~regex()
{
- if (basedat)
- pcre_free(const_cast(basedat));
- if (extradat)
- pcre_free(const_cast(extradat));
+ if (adjrefcount(basedat, -1) == 0)
+ {
+ pcre_free(const_cast(basedat));
+ if (extradat)
+ pcre_free(const_cast(extradat));
+ }
}
bool
============================================================
--- pcrewrap.hh 5b3070b3642cc669273a7347bf6feb938f465215
+++ pcrewrap.hh 244cc638f7a9676d3981974a70bb274f3be06e84
@@ -74,14 +74,13 @@ namespace pcre
struct basic_regex
{
private:
- // disable the default and copy constructors
+ // disable the default constructor; the default copy constructor and
+ // operator= are fine.
basic_regex();
- basic_regex(basic_regex const &);
- basic_regex & operator=(basic_regex const &);
protected:
- void const * const basedat;
- void const * const extradat;
+ void const * basedat;
+ void const * extradat;
// for use only by subclass constructors
basic_regex(std::pair p)
@@ -119,6 +118,10 @@ namespace pcre
regex(char const * pattern, pcre::flags options = DEFAULT);
regex(std::string const & pattern, pcre::flags options = DEFAULT);
~regex();
+
+ // the default copy constructor and operator= are not fine.
+ regex(regex const &);
+ regex & operator=(regex const &);
};
// exceptions thrown for errors from PCRE APIs
============================================================
--- restrictions.cc 474dbc86c29a1f8ce0abb1f27ebde4849c2042dc
+++ restrictions.cc dc91cbcec3bb7d6a70f084b675cb78ca19c89c92
@@ -10,15 +10,17 @@
#include