[31053] trunk/dports/devel/bazaar-ng

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 14 15:35:01 PST 2007


Revision: 31053
          http://trac.macosforge.org/projects/macports/changeset/31053
Author:   ram at macports.org
Date:     2007-11-14 15:35:00 -0800 (Wed, 14 Nov 2007)

Log Message:
-----------
apply patch, taken from bzr.dev r2975, that enables the automatic
cleanup of obsolete packs with the knitpack-experimental repository
format

Modified Paths:
--------------
    trunk/dports/devel/bazaar-ng/Portfile

Added Paths:
-----------
    trunk/dports/devel/bazaar-ng/files/bzr.dev-r2975.diff

Modified: trunk/dports/devel/bazaar-ng/Portfile
===================================================================
--- trunk/dports/devel/bazaar-ng/Portfile	2007-11-14 23:07:18 UTC (rev 31052)
+++ trunk/dports/devel/bazaar-ng/Portfile	2007-11-14 23:35:00 UTC (rev 31053)
@@ -5,6 +5,7 @@
 
 name          bazaar-ng
 version       0.92
+revision      1
 categories    devel python
 platforms     darwin
 maintainers   ram openmaintainer
@@ -26,7 +27,8 @@
               sha1 51901b0c467e30dab9e51b990bb491752460d680 \
               rmd160 f7a6c24944be50c830c25376bfaf0d2b8c56ae56
 
-patchfiles    patch-setup.py
+patchfiles    patch-setup.py \
+              bzr.dev-r2975.diff
 
 depends_lib-append  port:py25-paramiko \
                     port:py25-crypto \

Added: trunk/dports/devel/bazaar-ng/files/bzr.dev-r2975.diff
===================================================================
--- trunk/dports/devel/bazaar-ng/files/bzr.dev-r2975.diff	                        (rev 0)
+++ trunk/dports/devel/bazaar-ng/files/bzr.dev-r2975.diff	2007-11-14 23:35:00 UTC (rev 31053)
@@ -0,0 +1,64 @@
+--- bzrlib/repofmt/pack_repo.py	2007-11-09 08:19:25.000000000 -0500
++++ bzrlib/repofmt/pack_repo.py	2007-11-14 10:36:27.000000000 -0500
+@@ -748,7 +748,7 @@
+                 self._remove_pack_from_memory(pack)
+         # record the newly available packs and stop advertising the old
+         # packs
+-        self._save_pack_names()
++        self._save_pack_names(clear_obsolete_packs=True)
+         # Move the old packs out of the way now they are no longer referenced.
+         for revision_count, packs in pack_operations:
+             self._obsolete_packs(packs)
+@@ -1133,13 +1133,16 @@
+         """Release the mutex around the pack-names index."""
+         self.repo.control_files.unlock()
+ 
+-    def _save_pack_names(self):
++    def _save_pack_names(self, clear_obsolete_packs=False):
+         """Save the list of packs.
+ 
+         This will take out the mutex around the pack names list for the
+         duration of the method call. If concurrent updates have been made, a
+         three-way merge between the current list and the current in memory list
+         is performed.
++
++        :param clear_obsolete_packs: If True, clear out the contents of the
++            obsolete_packs directory.
+         """
+         self.lock_names()
+         try:
+@@ -1165,6 +1168,10 @@
+             self.transport.put_file('pack-names', builder.finish())
+             # move the baseline forward
+             self._packs_at_load = disk_nodes
++            # now clear out the obsolete packs directory
++            if clear_obsolete_packs:
++                self.transport.clone('obsolete_packs').delete_multi(
++                    self.transport.list_dir('obsolete_packs'))
+         finally:
+             self._unlock_names()
+         # synchronise the memory packs list with what we just wrote:
+--- bzrlib/tests/test_repository.py	2007-11-09 08:19:29.000000000 -0500
++++ bzrlib/tests/test_repository.py	2007-11-14 10:36:27.000000000 -0500
+@@ -888,6 +888,9 @@
+         # there should be 9 packs:
+         index = GraphIndex(trans, 'pack-names', None)
+         self.assertEqual(9, len(list(index.iter_all_entries())))
++        # insert some files in obsolete_packs which should be removed by pack.
++        trans.put_bytes('obsolete_packs/foo', '123')
++        trans.put_bytes('obsolete_packs/bar', '321')
+         # committing one more should coalesce to 1 of 10.
+         tree.commit('commit triggering pack')
+         index = GraphIndex(trans, 'pack-names', None)
+@@ -896,6 +899,11 @@
+         tree = tree.bzrdir.open_workingtree()
+         check_result = tree.branch.repository.check(
+             [tree.branch.last_revision()])
++        # We should have 50 (10x5) files in the obsolete_packs directory.
++        obsolete_files = list(trans.list_dir('obsolete_packs'))
++        self.assertFalse('foo' in obsolete_files)
++        self.assertFalse('bar' in obsolete_files)
++        self.assertEqual(50, len(obsolete_files))
+         # XXX: Todo check packs obsoleted correctly - old packs and indices
+         # in the obsolete_packs directory.
+         large_pack_name = list(index.iter_all_entries())[0][1][0]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071114/65a72fd8/attachment-0001.html


More information about the macports-changes mailing list