summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordan <dan>2007-05-28 08:13:25 +0000
committerdan <dan>2007-05-28 08:13:25 +0000
commit62cd6f97ad7c619eaaa21c0e279debf68dc4dcf3 (patch)
treec9ad648e2639d22a8a0511604bfef709e7b4faaf
parent35e80d1738803098b3ef4aca94f38ea5a8076884 (diff)
downloadpkgsrc-62cd6f97ad7c619eaaa21c0e279debf68dc4dcf3.tar.gz
pluck a number of fixes from mainline mtn to fix a bug introduced shortly
before the 0.35 release, which could cause monotone db files to grow larger than necessary by not removing some file/delta content as they were superceded by new versions. Most noticable on fresh pulls, or via "db check". Extra content can be cleaned up with a local sync into a fresh db. Changes from Matt Johnston, via pluck -r t:monotone-0.35 -r 397dcbd2f \ database.{cc,hh} diff_patch.{cc,hh} work.cc bump PKGREVISION
-rw-r--r--devel/monotone/Makefile4
-rw-r--r--devel/monotone/distinfo7
-rw-r--r--devel/monotone/patches/patch-da30
-rw-r--r--devel/monotone/patches/patch-db114
-rw-r--r--devel/monotone/patches/patch-dc35
-rw-r--r--devel/monotone/patches/patch-dd70
-rw-r--r--devel/monotone/patches/patch-de21
7 files changed, 279 insertions, 2 deletions
diff --git a/devel/monotone/Makefile b/devel/monotone/Makefile
index 918716d0e93..32dc3e64747 100644
--- a/devel/monotone/Makefile
+++ b/devel/monotone/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.37 2007/05/13 10:45:19 jmmv Exp $
+# $NetBSD: Makefile,v 1.38 2007/05/28 08:13:25 dan Exp $
#
DISTNAME= monotone-0.35
@@ -9,6 +9,8 @@ MAINTAINER= jmmv@NetBSD.org
HOMEPAGE= http://monotone.ca/
COMMENT= Free distributed version control system
+PKGREVISION= 1
+
GCC_REQD+= 3.0
GNU_CONFIGURE= yes
INFO_FILES= # PLIST
diff --git a/devel/monotone/distinfo b/devel/monotone/distinfo
index 41af9431e99..59c9c9ff2c2 100644
--- a/devel/monotone/distinfo
+++ b/devel/monotone/distinfo
@@ -1,5 +1,10 @@
-$NetBSD: distinfo,v 1.29 2007/05/13 10:45:19 jmmv Exp $
+$NetBSD: distinfo,v 1.30 2007/05/28 08:13:25 dan Exp $
SHA1 (monotone-0.35.tar.gz) = b745eee239ab198f4263493c7f79cfd1b6935127
RMD160 (monotone-0.35.tar.gz) = 91cb91fc25415f8357a57f199a5f83b8ea9293a1
Size (monotone-0.35.tar.gz) = 4857094 bytes
+SHA1 (patch-da) = 7788a38488e3ea143ba0a82dbe5a367c34f0d41f
+SHA1 (patch-db) = 3225f5e42e3fc36d071e67d66778c38a28ac03ab
+SHA1 (patch-dc) = 2daf64dc25410b82d9ba031e3e77fd099493ad63
+SHA1 (patch-dd) = 84748f95117632726b7ded61ece7cd1f895011a4
+SHA1 (patch-de) = 25839f337dff78514b845647b948a53902a83172
diff --git a/devel/monotone/patches/patch-da b/devel/monotone/patches/patch-da
new file mode 100644
index 00000000000..3e500d2b66e
--- /dev/null
+++ b/devel/monotone/patches/patch-da
@@ -0,0 +1,30 @@
+$NetBSD: patch-da,v 1.1 2007/05/28 08:13:25 dan Exp $
+#
+# old_revision [f92dd754bf5c1e6eddc9c462b8d68691cfeb7f8b]
+#
+# patch "database.hh"
+# from [aa0ee865053a7c27df33ab9906ce681db1e9d6c8]
+# to [954a78c55234b282b7c047569cc5cc6ca9014341]
+#
+============================================================
+--- database.hh aa0ee865053a7c27df33ab9906ce681db1e9d6c8
++++ database.hh 954a78c55234b282b7c047569cc5cc6ca9014341
+@@ -187,6 +187,7 @@ private:
+ bool have_delayed_file(file_id const & id);
+ void load_delayed_file(file_id const & id, file_data & dat);
+ void cancel_delayed_file(file_id const & id);
++ void drop_or_cancel_file(file_id const & id);
+ void schedule_delayed_file(file_id const & id, file_data const & dat);
+
+ std::map<file_id, file_data> delayed_files;
+@@ -215,6 +216,10 @@ private:
+ bool delta_exists(std::string const & ident,
+ std::string const & table);
+
++ bool delta_exists(std::string const & ident,
++ std::string const & base,
++ std::string const & table);
++
+ void get_file_or_manifest_base_unchecked(hexenc<id> const & new_id,
+ data & dat,
+ std::string const & table);
diff --git a/devel/monotone/patches/patch-db b/devel/monotone/patches/patch-db
new file mode 100644
index 00000000000..6942884bb10
--- /dev/null
+++ b/devel/monotone/patches/patch-db
@@ -0,0 +1,114 @@
+$NetBSD: patch-db,v 1.1 2007/05/28 08:13:25 dan Exp $
+#
+# old_revision [f92dd754bf5c1e6eddc9c462b8d68691cfeb7f8b]
+#
+# patch "database.cc"
+# from [4e7fc712cb49d0e87413ee46797b07ce53c286af]
+# to [d2603c50782ad0ee0f86fa96f58846608a6d9748]
+#
+============================================================
+--- database.cc 4e7fc712cb49d0e87413ee46797b07ce53c286af
++++ database.cc d2603c50782ad0ee0f86fa96f58846608a6d9748
+@@ -922,6 +922,15 @@ void
+ }
+
+ void
++database::drop_or_cancel_file(file_id const & id)
++{
++ if (have_delayed_file(id))
++ cancel_delayed_file(id);
++ else
++ drop(id.inner()(), "files");
++}
++
++void
+ database::schedule_delayed_file(file_id const & an_id,
+ file_data const & dat)
+ {
+@@ -1032,6 +1041,17 @@ database::delta_exists(string const & id
+ return table_has_entry(ident, "id", table);
+ }
+
++bool
++database::delta_exists(string const & ident,
++ string const & base,
++ string const & table)
++{
++ results res;
++ query q("SELECT 1 FROM " + table + " WHERE id = ? and base = ? LIMIT 1");
++ fetch(res, one_col, any_rows, q % text(ident) % text(base));
++ return !res.empty();
++}
++
+ string
+ database::count(string const & table)
+ {
+@@ -1692,15 +1712,10 @@ database::put_file_version(file_id const
+ file_id const & new_id,
+ file_delta const & del)
+ {
++ I(!(old_id == new_id));
+ file_data old_data, new_data;
+ file_delta reverse_delta;
+
+- if (file_version_exists(new_id))
+- {
+- L(FL("file version '%s' already exists in db") % new_id);
+- return;
+- }
+-
+ if (!file_version_exists(old_id))
+ {
+ W(F("file preimage '%s' missing in db") % old_id);
+@@ -1714,6 +1729,7 @@ database::put_file_version(file_id const
+ patch(old_data.inner(), del.inner(), tmp);
+ new_data = file_data(tmp);
+ }
++
+ {
+ string tmp;
+ invert_xdelta(old_data.inner()(), del.inner()(), tmp);
+@@ -1724,20 +1740,25 @@ database::put_file_version(file_id const
+ calculate_ident(old_tmp, old_tmp_id);
+ I(file_id(old_tmp_id) == old_id);
+ }
+-
+- transaction_guard guard(*this);
++
++ transaction_guard guard(*this);
+ if (file_or_manifest_base_exists(old_id.inner(), "files"))
+ {
+ // descendent of a head version replaces the head, therefore old head
+ // must be disposed of
+- if (have_delayed_file(old_id))
+- cancel_delayed_file(old_id);
+- else
+- drop(old_id.inner()(), "files");
++ drop_or_cancel_file(old_id);
+ }
+- schedule_delayed_file(new_id, new_data);
+- put_file_delta(old_id, new_id, reverse_delta);
+- guard.commit();
++ if (!file_or_manifest_base_exists(new_id.inner(), "files"))
++ {
++ schedule_delayed_file(new_id, new_data);
++ drop(new_id.inner()(), "file_deltas");
++ }
++
++ if (!delta_exists(old_id.inner()(), new_id.inner()(), "file_deltas"))
++ {
++ put_file_delta(old_id, new_id, reverse_delta);
++ guard.commit();
++ }
+ }
+
+ void
+@@ -1944,7 +1965,7 @@ database::deltify_revision(revision_id c
+ delta delt;
+ diff(old_data.inner(), new_data.inner(), delt);
+ file_delta del(delt);
+- drop(delta_entry_dst(j).inner()(), "files");
++ drop_or_cancel_file(delta_entry_dst(j));
+ drop(delta_entry_dst(j).inner()(), "file_deltas");
+ put_file_version(delta_entry_src(j), delta_entry_dst(j), del);
+ }
diff --git a/devel/monotone/patches/patch-dc b/devel/monotone/patches/patch-dc
new file mode 100644
index 00000000000..459315dceb3
--- /dev/null
+++ b/devel/monotone/patches/patch-dc
@@ -0,0 +1,35 @@
+$NetBSD: patch-dc,v 1.1 2007/05/28 08:13:25 dan Exp $
+#
+# old_revision [f92dd754bf5c1e6eddc9c462b8d68691cfeb7f8b]
+#
+# patch "diff_patch.hh"
+# from [f80e158dc7f4b50ac1ce4157896c226e95acfc54]
+# to [d481b1cf53caed0381272a18713c357880d3bd03]
+#
+============================================================
+--- diff_patch.hh f80e158dc7f4b50ac1ce4157896c226e95acfc54
++++ diff_patch.hh d481b1cf53caed0381272a18713c357880d3bd03
+@@ -48,6 +48,7 @@ content_merge_adaptor
+ file_id const & right_ident,
+ file_id const & merged_ident,
+ file_data const & left_data,
++ file_data const & right_data,
+ file_data const & merged_data) = 0;
+
+ virtual void get_ancestral_roster(node_id nid,
+@@ -75,6 +76,7 @@ content_merge_database_adaptor
+ file_id const & right_ident,
+ file_id const & merged_ident,
+ file_data const & left_data,
++ file_data const & right_data,
+ file_data const & merged_data);
+
+ void get_ancestral_roster(node_id nid,
+@@ -101,6 +103,7 @@ content_merge_workspace_adaptor
+ file_id const & right_ident,
+ file_id const & merged_ident,
+ file_data const & left_data,
++ file_data const & right_data,
+ file_data const & merged_data);
+
+ void get_ancestral_roster(node_id nid,
diff --git a/devel/monotone/patches/patch-dd b/devel/monotone/patches/patch-dd
new file mode 100644
index 00000000000..1e32068fb85
--- /dev/null
+++ b/devel/monotone/patches/patch-dd
@@ -0,0 +1,70 @@
+$NetBSD: patch-dd,v 1.1 2007/05/28 08:13:25 dan Exp $
+#
+# old_revision [f92dd754bf5c1e6eddc9c462b8d68691cfeb7f8b]
+#
+# patch "diff_patch.cc"
+# from [5437f74550a59622f0aca36b00dd43f104b7692a]
+# to [d4826b42f48007454d5827ae45c9eb39d99dbe6a]
+#
+============================================================
+--- diff_patch.cc 5437f74550a59622f0aca36b00dd43f104b7692a
++++ diff_patch.cc d4826b42f48007454d5827ae45c9eb39d99dbe6a
+@@ -500,19 +500,26 @@ content_merge_database_adaptor::record_m
+ file_id const & right_ident,
+ file_id const & merged_ident,
+ file_data const & left_data,
++ file_data const & right_data,
+ file_data const & merged_data)
+ {
+ L(FL("recording successful merge of %s <-> %s into %s")
+ % left_ident % right_ident % merged_ident);
+
+- delta left_delta, right_delta;
+ transaction_guard guard(app.db);
+
+- diff(left_data.inner(), merged_data.inner(), left_delta);
+- diff(left_data.inner(), merged_data.inner(), right_delta);
+-
+- app.db.put_file_version(left_ident, merged_ident, file_delta(left_delta));
+- app.db.put_file_version(right_ident, merged_ident, file_delta(right_delta));
++ if (!(left_ident == merged_ident))
++ {
++ delta left_delta;
++ diff(left_data.inner(), merged_data.inner(), left_delta);
++ app.db.put_file_version(left_ident, merged_ident, file_delta(left_delta));
++ }
++ if (!(right_ident == merged_ident))
++ {
++ delta right_delta;
++ diff(right_data.inner(), merged_data.inner(), right_delta);
++ app.db.put_file_version(right_ident, merged_ident, file_delta(right_delta));
++ }
+ guard.commit();
+ }
+
+@@ -574,6 +581,7 @@ content_merge_workspace_adaptor::record_
+ file_id const & right_id,
+ file_id const & merged_id,
+ file_data const & left_data,
++ file_data const & right_data,
+ file_data const & merged_data)
+ {
+ L(FL("temporarily recording merge of %s <-> %s into %s")
+@@ -734,7 +742,7 @@ content_merger::try_to_merge_files(file_
+
+ merged_id = merged_fid;
+ adaptor.record_merge(left_id, right_id, merged_fid,
+- left_data, merge_data);
++ left_data, right_data, merge_data);
+
+ return true;
+ }
+@@ -764,7 +772,7 @@ content_merger::try_to_merge_files(file_
+
+ merged_id = merged_fid;
+ adaptor.record_merge(left_id, right_id, merged_fid,
+- left_data, merge_data);
++ left_data, right_data, merge_data);
+ return true;
+ }
+
diff --git a/devel/monotone/patches/patch-de b/devel/monotone/patches/patch-de
new file mode 100644
index 00000000000..bcc24a73257
--- /dev/null
+++ b/devel/monotone/patches/patch-de
@@ -0,0 +1,21 @@
+$NetBSD: patch-de,v 1.1 2007/05/28 08:13:26 dan Exp $
+#
+# old_revision [f92dd754bf5c1e6eddc9c462b8d68691cfeb7f8b]
+#
+# patch "work.cc"
+# from [0b6a0b54ff0eeab3092ad1f8fd73bb2af2308847]
+# to [9b78a7cb064436d0eed809eaa14c46b548b46096]
+#
+============================================================
+--- work.cc 0b6a0b54ff0eeab3092ad1f8fd73bb2af2308847
++++ work.cc 9b78a7cb064436d0eed809eaa14c46b548b46096
+@@ -732,7 +732,8 @@ struct content_merge_empty_adaptor : pub
+ virtual void get_version(file_id const &, file_data &) const
+ { I(false); }
+ virtual void record_merge(file_id const &, file_id const &,
+- file_id const &, file_data const &,
++ file_id const &,
++ file_data const &, file_data const &,
+ file_data const &)
+ { I(false); }
+ virtual void get_ancestral_roster(node_id, boost::shared_ptr<roster_t const> &)