--- desktopcouch-0.6.4.orig/debian/changelog +++ desktopcouch-0.6.4/debian/changelog @@ -0,0 +1,318 @@ +desktopcouch (0.6.4-0ubuntu3.1) lucid-proposed; urgency=low + + * Add gnome-keyring to depends of python-desktopcouch (LP: #565376) + and desktop couch (LP: #561541) for proper authentication in KDE + + -- Rohan Garg Sun, 19 Sep 2010 20:18:04 +0200 + +desktopcouch (0.6.4-0ubuntu3) lucid; urgency=low + + * debian/patches/lp_522538.patch + - Handle reconnects if the server isn't running (LP: #522538) + + -- Ken VanDine Mon, 19 Apr 2010 12:52:22 -0400 + +desktopcouch (0.6.4-0ubuntu2) lucid; urgency=low + + * debian/patches/replication-exclusion.patch + - replication exclusion doesn't work with MergableList value (LP: #563901) + + -- Ken VanDine Thu, 15 Apr 2010 14:57:16 -0400 + +desktopcouch (0.6.4-0ubuntu1) lucid; urgency=low + + * Upstream release. Adds all patches that were previously in this packaging. + * Split desktopcouch-service threads into to discrete processes, since they + do not depend on each other, and because multithreading breaks with recent + changes to libraries. (LP: #524566, #530605) + * Made desktopcouch more robust when dealing with mergeable lists. + (LP: #555908) + * If the replication service gives a user_id, then include it in the + query string, so the service can shard access. + * Add bookmark records support. + * Handle cancelled keyring dialogs. (LP: #527036) + * Retry when starting couchdb fails. (LP: #530541) + * debian/patches/0-items-should-expose-private-data-for-now.patch + - Gwibber demands that some items that are private be exposed, namely + keys _id and _rev. These should properly be accessed as attributes + .record_id and .record_revision in some future release of gwibber. + + -- Chad MILLER Mon, 12 Apr 2010 23:02:01 -0400 + +desktopcouch (0.6.3-0ubuntu3) lucid; urgency=low + + * debian/patches/2-expire_log_files + - Make log files rotate away so they don't grow out of control. + * debian/patches/4-lp_524566_gui_in_main_thread + - Execute GUI operations in the main execution thread only. (LP: #524566) + + -- Ken VanDine Wed, 31 Mar 2010 09:46:47 -0400 + +desktopcouch (0.6.3-0ubuntu2) lucid; urgency=low + + * debian/patches/lp_534171.patch + - Don't parse all the _changes feed; work out update_seq from the DB info, + so we never request the whole feed, which is doom when the whole feed is + large. (LP: #534171) + + -- Ken VanDine Mon, 29 Mar 2010 21:24:15 -0400 + +desktopcouch (0.6.3-0ubuntu1) lucid; urgency=low + + * New upstream bugfix release. + - Provide more isolation in tests to avoid polluting the env when + running tests. + - Drop no_uri.patch and revert_dbus_getport.patch (included upstream) + - Don't depend on simplejson, use built in json (LP: #511427) + - Provide a method for clients to enable/disable replication of + arbitrary databases with Ubuntu One (needed to allow enabling and + disabling of gwibber and contact syncing). + + -- Elliot Murphy Wed, 10 Mar 2010 18:54:33 -0500 + +desktopcouch (0.6.2-0ubuntu3) lucid; urgency=low + + * debian/patches/no_uri.patch + - fix a place were replication was not fully qualifying its accesses to + Databases with a specific URL. + * debian/patches/revert_dbus_getport.patch + - Revert the change in 0.6.2 that completely relied on dbus to get the + port, this failed multithreaded execution in the client (LP: #530716) + + -- Ken VanDine Thu, 04 Mar 2010 14:09:34 -0500 + +desktopcouch (0.6.2-0ubuntu2) lucid; urgency=low + + * In the last upload, I incorrectly resolved the merge presented + after running bzr merge-upstream --version=0.6.2 + ../desktopcouch_0.6.2.orig.tar.gz. So, the last upload had incorrect + contents in the tarball for desktopcouch/records/server_base.py and + desktopcouch/replication.py. This revision restores the correct contents + of those two files to match what was shipped in the upstream tarball. + + -- Elliot Murphy Tue, 02 Mar 2010 15:28:45 -0500 + +desktopcouch (0.6.2-0ubuntu1) lucid; urgency=low + + * New upstream bugfix release. + - Include a new program bin/desktopcouch-get-port . + - Use DBus to get port, and thereby start the service daemon, on normal + Python access to the database. (LP: #519444) + - Update docs to be explicit about put_record(r) mutating r . + - Add new method put_records_batch(iterable_of_records) . + - Fix up apport collection. + - Fix a problem with couchdb mutating its INI file to store a hashed + password, which is useless for HTTP Basic auth in the bookmark file. + - Fix obscure bugs in couchdb startup regarding port availability. + - Update execute_view() ti take a dict of additional parameters for + execution. + - Add has_key() method to desktopcouch.record.RecordDict so that it + behaves more like a dictionary. + + -- Elliot Murphy Mon, 01 Mar 2010 11:47:53 -0500 + +desktopcouch (0.6.1-0ubuntu1) lucid; urgency=low + + * New upstream release. + - When logging replication events, replace all oauth secrets with a + string of the same length. + - Add CouchDatabase.report_changes() method. + - Don't remove the HTML file that bookmarks point to. + - Improve test coverage. + - Use an explicit test context for testing. + - For startup, loop over finding the port in case the port is not + available when the PID is. + - Ensure that the method that tests for the presence of a record does + not just check if the field is present but ensures that the value + is correct. + - Do not read from the keyring if we have a configuration file that + already has the info we need. + - Move record_id to be a property rather than an attribute. + - Improved pairing tool reliability by fixing race conditions. + - Make the database generate it's own record IDs at "put" time, avoiding + issues with non-idempotency of POST for doc creation. + - Add Record.record_revision attribute to make it easier to get a records + revision ID. + * debian/control + - bumped standards version to 3.8.3 + + -- Elliot Murphy Wed, 03 Feb 2010 14:09:55 -0500 + +desktopcouch (0.5-0ubuntu1) karmic; urgency=low + + * New upstream release. + + Fix remote-db-listing bug for SSL/HTTPS services. (LP: #458540) + + Fix OAuth signatures for SSL urls. + + Avoid couchdb bug where users' PID files are incorrectly interpreted as + valid by couchdb, and so after slightly different boot, desktopcouch can + never start couchdb, causing desktopcouch to quit. (LP: #442120) + + For dbus, do not resolve data for events signaling a service disappears, + and use explicit veriable-passing / references. (LP: #440072) + + Flip push/pull logic in replication information. + + When pulling from remote DB, do not try to access remote management DB. + + Use meaningful names for keyring access. (LP: #451333) + + -- Chad MILLER Thu, 22 Oct 2009 17:15:57 -0400 + +desktopcouch (0.4.4-0ubuntu1) karmic; urgency=low + + * New upstream release. + + Include doc "txt" and translation files in sources. + + couchgrid does not correctly retrieve record id (LP: #447512) + + couchgrid selected_records property is buggy and should be removed for + karmic if possible (LP: #448357) + + -- Chad MILLER Mon, 12 Oct 2009 10:17:50 -0400 + +desktopcouch (0.4.3-0ubuntu1) karmic; urgency=low + + * Include compulsory-auth INI file to be secure by default. + (LP: #438800) + * Make debhelper warn about files not installed to some package. + * Shorten debhelper install paths using dh_install exlusions. + * New upstream release: + + couchgrid did not correctly retrieve record id (LP: #447512) + + HTTP 401 for valid auth information when talking to couchdb over SSL + (LP: #446516) + + Support headless apps. (LP: #428681) + + desktopcouch-service "ValueError: dictionary update sequence..." on + stdout(LP: #446511) + + -- Chad Miller Mon, 12 Oct 2009 07:02:07 -0400 + +desktopcouch (0.4.2-0ubuntu1) karmic; urgency=low + + * Include missing 0.4.0 changelog entry. + * New upstream release. + + Log to correct place in service, ~/.cache/desktop-couch/ . + + Abandon service modules giving host and port info separate from the + db prefixes, which now give a URI. + + Let the replicator gather its own OAuth data to use to connect to far + end. This *should* fix repliction to cloud. + + Make service more resilient to errors, and make breakable parts in + smaller granules. + + Support Python 2.5. + + Added basic notes record API to include NOTE_RECORD_TYPE. + + Make create-contacts script agnostic of desktop vs cloud and oauth + vs noauth. + * Depend on a more recent version of couchdb, which provides OAuth + support. + + -- Chad Miller Mon, 28 Sep 2009 12:06:08 -0400 + +desktopcouch (0.4.1-0ubuntu1) karmic; urgency=low + + * New upstream release (LP: #435429) + * debian/python-desktopcouch-records.install + Added notes, contacts, and replication_services + + -- Ken VanDine Wed, 23 Sep 2009 14:22:38 -0400 + +desktopcouch (0.4-0ubuntu1) karmic; urgency=low + + * Packaging: desktopcouch-tools installed by default in Karmic (LP: #427421) + * Forcing desktopcouch auth on. (LP: #427446) + * Requiring new version of couchdb that supports authentication properly. + * Pairing updates couchdb replication system. (LP: #397663) + * Added pairing of desktop Couches to desktopcouch-tools (LP: #404087) + * Admin users in the system couchdb are no longer inherited by desktopcouch + couchdbs (LP: #424330) + * Fixed failing tests in desktopcouch (LP: #405612) + * Creating login details on initial desktopcouch setup (LP: #416413) + * Starting replication to paired servers on desktopcouch startup. + (LP: #416581) + * Unpaired couchdb peers are reconciled with replication. (LP: #424386) + * At pairing time, changing couchdb pairing address to public. (LP: #419969) + * In replication daemon, verifying local couchdb bind address is not 127/8 . + (LP: #419973) + * getPort no longer suceeds when desktopcouch isn't running. (LP: #422127) + + -- Chad Miller Mon, 14 Sep 2009 19:24:08 -0400 + +desktopcouch (0.3.1-0ubuntu2) karmic; urgency=low + + * Depend on couchdb-bin instead of couchdb (LP: #427036) + + -- Elliot Murphy Wed, 16 Sep 2009 17:32:51 -0400 + +desktopcouch (0.3.1-0ubuntu1) karmic; urgency=low + + [Ken VanDine] + * debian/control + - Added depends on python-desktopcouch-records. (LP: #422179) + [Chad Miller] + * New upstream release. + * Changed Vcs-Bzr links in control file. + * Changed version dependency on couchdb. + * Converting to a full-blown source-package branch. + * Fix getPort failure. (LP: #420911, LP: #422127) + * Check couchdb bind-port in replicator. (LP: #419973) + * Change couchdb bind-port in pairing tool. (LP: #419969) + + -- Chad Miller Tue, 01 Sep 2009 11:57:25 -0400 + +desktopcouch (0.3-0ubuntu1) karmic; urgency=low + + [ Ken VanDine ] + * New upstream release (LP: #416591) + - added unit tests for couchwidget, and then fixed bug #412266 + - Change to freedesktop URL for record type spec. + - First version of the contacts picker, based on CouchWidget + - Adding the desktopcouch.contacts module. + - Use subprocess.Popen and ourselves to the wait()ing, + since subprocess.call() is buggy. There's still an EINTR bug + in subprocess, though. + - Occasionally stop couchdb in tests, so we exercise the automatic + starting code. This will lead to spurious errors because of the + aforementioned subprocess bug, but it's the right thing to do. + - Abstract away some of the linuxisms and complain if we're run on + an unsupported OS. + - Fix a race condition in the process-testing code. + - Replace the TestCase module with one that doesn't complain of dirty + twisted reactors. + - Add a means of stopping the desktop couchdb daemon. + - Add an additional check that a found PID and process named correctly + is indeed a process that this user started, so we don't try to talk + to other local users' desktop couchdbs. + - Get the port at function-call time, instead of storing a port at + start-time and giving that back. The info can be stale, the old + way. + - Don't create a view per record-type; instead, call the standard + return-all-records-keyed-by-record-type and use slice notation on + the viewresults to only get back the records with that type, + which does the same thing but more elegantly. + - Remove the unused/invalid "utils" import from test_server + - Change the name of a function tested to be what actually exists in + the code. + - Refactored server.py by renaming server.get_records_and_type to + server.get_records. Also modified the function to take a record + type param if desired to only create records of that type and + optionally create a view name "get_"+ record_type. (LP: #411475) + * debian/control + - Make python-desktopcouch depend on python-gtk2 and python-gnomekeyring + - Make python-desktopcouch-records depend on python-gtk2, + python-gnomekeyring, and python-oauth. + - Remove depends for python-distutils-extra + - Fixed Vcs-Browser tag + + [Elliot Murphy] + * debian/control: added build-dep on python-setuptools + + + [ Martin Pitt ] + * debian/control: Fix Vcs-* links. + + -- Ken VanDine Thu, 27 Aug 2009 15:32:11 +0200 + +desktopcouch (0.2-0ubuntu1) karmic; urgency=low + + * New upstream release + * Handle the case where the pid file is empty or doesn't exist (LP: #408796) + + -- Ken VanDine Wed, 05 Aug 2009 02:17:47 +0100 + +desktopcouch (0.1-0ubuntu1) karmic; urgency=low + + * Initial release (LP: #397662) + + -- Ken VanDine Fri, 31 Jul 2009 13:44:45 -0400 --- desktopcouch-0.6.4.orig/debian/control +++ desktopcouch-0.6.4/debian/control @@ -0,0 +1,78 @@ +Source: desktopcouch +Section: python +Priority: optional +Build-Depends: cdbs (>= 0.4.43), + debhelper (>= 6), + python, + python-central (>= 0.6.11), + python-distutils-extra (>= 2.8), + python-setuptools +Maintainer: Ubuntu Developers +Standards-Version: 3.8.4 +XS-Python-Version: current +Homepage: http://launchpad.net/desktopcouch +Vcs-Bzr: https://code.launchpad.net/~ubuntuone-control-tower/ubuntu/karmic/desktopcouch/spb +Vcs-Browser: http://bazaar.launchpad.net/~ubuntuone-control-tower/ubuntu/karmic/desktopcouch/spb + +Package: desktopcouch +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, + ${python:Depends}, + couchdb-bin (>= 0.10.0-0ubuntu3), + python-dbus, + python-couchdb (>= 0.6), + python-twisted-core, + python-gobject, + python-avahi, + python-desktopcouch, + python-desktopcouch-records, + python-gtk2, + gnome-keyring +Description: A Desktop CouchDB instance + Runs an instance of CouchDB with the users session. + +Package: desktopcouch-tools +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, + ${python:Depends}, + python-dbus, + python-twisted-core, + python-gobject, + python-avahi, + python-desktopcouch, + python-desktopcouch-records, + python-gtk2 +Description: Desktop CouchDB tools + Tools used to work with Desktop CouchDB. + +Package: python-desktopcouch +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, + ${python:Depends}, + desktopcouch, + python-dbus, + python-couchdb, + python-xdg, + python-twisted-core, + python-gtk2, + python-gnomekeyring, + gnome-keyring +Description: Python Desktop CouchDB + A Python library for Desktop CouchDB. + +Package: python-desktopcouch-records +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, + ${python:Depends}, + python-dbus, + python-couchdb, + python-desktopcouch, + python-gtk2, + python-gnomekeyring, + python-oauth +Description: Desktop CouchDB Records API + A Python library for the Desktop CouchDB Records API. --- desktopcouch-0.6.4.orig/debian/desktopcouch.install +++ desktopcouch-0.6.4/debian/desktopcouch.install @@ -0,0 +1,6 @@ +debian/tmp/etc/xdg/desktop-couch/ +debian/tmp/usr/share/desktopcouch/ +debian/tmp/usr/lib/desktopcouch/desktopcouch-service +debian/tmp/usr/lib/desktopcouch/desktopcouch-stop +debian/tmp/usr/lib/desktopcouch/desktopcouch-get-port +debian/tmp/usr/share/dbus-1/services/org.desktopcouch.CouchDB.service --- desktopcouch-0.6.4.orig/debian/python-desktopcouch.install +++ desktopcouch-0.6.4/debian/python-desktopcouch.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/*/*/desktopcouch/*.py +debian/tmp/usr/lib/*/*/desktopcouch/pair/ --- desktopcouch-0.6.4.orig/debian/python-desktopcouch-records.install +++ desktopcouch-0.6.4/debian/python-desktopcouch-records.install @@ -0,0 +1,5 @@ +debian/tmp/usr/share/doc/python-desktopcouch-records/api/ +debian/tmp/usr/lib/*/*/desktopcouch/records/ +debian/tmp/usr/lib/*/*/desktopcouch/contacts/ +debian/tmp/usr/lib/*/*/desktopcouch/notes/ +debian/tmp/usr/lib/*/*/desktopcouch/replication_services/ --- desktopcouch-0.6.4.orig/debian/pycompat +++ desktopcouch-0.6.4/debian/pycompat @@ -0,0 +1 @@ +2 --- desktopcouch-0.6.4.orig/debian/desktopcouch-tools.install +++ desktopcouch-0.6.4/debian/desktopcouch-tools.install @@ -0,0 +1,3 @@ +debian/tmp/usr/share/applications/desktopcouch-pair.desktop +debian/tmp/usr/bin/desktopcouch-pair +debian/tmp/usr/share/man/man1/desktopcouch-pair.1 --- desktopcouch-0.6.4.orig/debian/copyright +++ desktopcouch-0.6.4/debian/copyright @@ -0,0 +1,11 @@ +Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat +Upstream-Name: desktopcouch +Upstream-Maintainer: Stuart Langridge +Upstream-Source: https://launchpad.net/desktopcouch + +Files: * +Copyright: (C) 2009 Canonical Ltd. + +License: LGPL-3 + The full text of the LGPL is distributed in + /usr/share/common-licenses/LGPL-3 on Debian systems. --- desktopcouch-0.6.4.orig/debian/rules +++ desktopcouch-0.6.4/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +DEB_PYTHON_SYSTEM := pycentral +DEB_DH_INSTALL_ARGS := --list-missing --exclude=/tests/ --exclude=egg-info/ + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/python-distutils.mk +include /usr/share/cdbs/1/rules/langpack.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk --- desktopcouch-0.6.4.orig/debian/watch +++ desktopcouch-0.6.4/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://launchpad.net/desktopcouch/+download .*/desktopcouch-([0-9.]+)\.tar\.gz --- desktopcouch-0.6.4.orig/debian/compat +++ desktopcouch-0.6.4/debian/compat @@ -0,0 +1 @@ +6 --- desktopcouch-0.6.4.orig/debian/patches/lp_522538.patch +++ desktopcouch-0.6.4/debian/patches/lp_522538.patch @@ -0,0 +1,207 @@ +=== modified file 'desktopcouch/records/server_base.py' +--- old/desktopcouch/records/server_base.py 2010-04-08 15:27:33 +0000 ++++ new/desktopcouch/records/server_base.py 2010-04-19 16:07:11 +0000 +@@ -42,6 +42,7 @@ + from couchdb.client import ResourceNotFound, ResourceConflict, uri as couchdburi + from couchdb.design import ViewDefinition + from record import Record ++import logging + + #DEFAULT_DESIGN_DOCUMENT = "design" + DEFAULT_DESIGN_DOCUMENT = None # each view in its own eponymous design doc. +@@ -142,29 +143,53 @@ + + def __init__(self, database, uri, record_factory=None, create=False, + server_class=Server, **server_class_extras): ++ self._database_name = database ++ self._create = create ++ self._server_class = server_class ++ self._server_class_extras = server_class_extras ++ self.record_factory = record_factory or Record + self.server_uri = uri +- self._server = server_class(self.server_uri, **server_class_extras) +- if database not in self._server: +- if create: +- self._server.create(database) +- else: +- raise NoSuchDatabase(database) +- self.db = self._server[database] +- self.record_factory = record_factory or Record ++ self._reconnect() + self._changes_since = self.db.info()["update_seq"] + self._changes_last_used = 0 # Immediate run works. + ++ @staticmethod ++ def _is_bug_lp539674(ex): ++ return isinstance(ex, AttributeError) and \ ++ ex.args == ("'NoneType' object has no attribute 'makefile'",) ++ ++ def with_reconnects(self, func, *args, **kwargs): ++ for retry in (2, 1, None): ++ try: ++ return func(*args, **kwargs) ++ except Exception, e: ++ if self._is_bug_lp539674(e) and retry: ++ logging.warn("DB connection timed out. Reconnecting.") ++ self._reconnect() ++ continue ++ else: ++ raise ++ ++ def _reconnect(self): ++ self._server = self._server_class(self.server_uri, ++ **self._server_class_extras) ++ if self._database_name not in self._server: ++ if self._create: ++ self._server.create(self._database_name) ++ else: ++ raise NoSuchDatabase(self._database_name) ++ self.db = self._server[self._database_name] + + def _temporary_query(self, map_fun, reduce_fun=None, language='javascript', + wrapper=None, **options): + """Pass-through to CouchDB library. Deprecated.""" +- return self.db.query(map_fun, reduce_fun, language, ++ return self.with_reconnects(self.db.query, map_fun, reduce_fun, language, + wrapper, **options) + + def get_record(self, record_id): + """Get a record from back end storage.""" + try: +- couch_record = self.db[record_id] ++ couch_record = self.with_reconnects(self.db.__getitem__, record_id) + except ResourceNotFound: + return None + data = {} +@@ -193,11 +218,12 @@ + # Do not rely on couchdb to create an ID for us. + from uuid import uuid4 + record.record_id = uuid4().hex +- self.db[record.record_id] = record._data ++ self.with_reconnects(self.db.__setitem__, ++ record.record_id, record._data) + + for attachment_name in record.list_attachments(): + data, content_type = record.attachment_data(attachment_name) +- self.db.put_attachment( ++ self.with_reconnects(self.db.put_attachment, + record._data, data, attachment_name, content_type) + + return record.record_id +@@ -215,7 +241,8 @@ + # although with a single record we need to test for the + # revisison, with a batch we do not, but we have to make sure + # that we did not get an error +- batch_put_result = self.db.update([record._data for record in batch]) ++ batch_put_result = self.with_reconnects( ++ self.db.update, [record._data for record in batch]) + for current_tuple in batch_put_result: + success, docid, rev_or_exc = current_tuple + if success: +@@ -224,7 +251,7 @@ + record._data["_rev"] = rev_or_exc + for attachment_name in record.list_attachments(): + data, content_type = record.attachment_data(attachment_name) +- self.db.put_attachment( ++ self.with_reconnects(self.db.put_attachment, + {"_id":record.record_id, "_rev":record["_rev"]}, + data, attachment_name, content_type) + # all success record have the blobs added we return result of +@@ -249,7 +276,8 @@ + # as far as we know. (If they're not, we'll get a + # ResourceConflict later on, from which we can recover.) + if cached_record is None: +- cached_record = self.db[record_id] ++ cached_record = self.with_reconnects(self.db.__getitem__, ++ record_id) + if isinstance(cached_record, Record): + cached_record = cached_record._data + record = copy.deepcopy(cached_record) +@@ -294,13 +322,15 @@ + # it. + if modified: + try: +- self.db[record_id] = record ++ self.with_reconnects(self.db.__setitem__, record_id, ++ record) + except ResourceConflict: + # We got a conflict, meaning the record has + # changed in the database since we last loaded it + # into memory. Let's get a fresh copy and try + # again. +- record = self.db[record_id] ++ record = self.with_reconnects(self.db.__getitem__, ++ record_id) + continue + # If we get here, nothing remains to be done, and we can + # take a well deserved break. +@@ -308,17 +338,17 @@ + + def delete_record(self, record_id): + """Delete record with given id""" +- record = self.db[record_id] ++ record = self.with_reconnects(self.db.__getitem__, record_id) + record.setdefault('application_annotations', {}).setdefault( + 'Ubuntu One', {}).setdefault('private_application_annotations', {})[ + 'deleted'] = True +- self.db[record_id] = record ++ self.with_reconnects(self.db.__setitem__, record_id, record) + + def record_exists(self, record_id): + """Check if record with given id exists.""" + if record_id not in self.db: + return False +- record = self.db[record_id] ++ record = self.with_reconnects(self.db.__getitem__, record_id) + return not row_is_deleted(record) + + def delete_view(self, view_name, design_doc=DEFAULT_DESIGN_DOCUMENT): +@@ -332,7 +362,8 @@ + # No atomic updates. Only read & mutate & write. Le sigh. + # First, get current contents. + try: +- view_container = self.db[doc_id]["views"] ++ view_container = self.with_reconnects( ++ self.db.__getitem__, doc_id)["views"] + except (KeyError, ResourceNotFound): + raise KeyError + +@@ -358,7 +389,7 @@ + + # Remove design document. This assumes there are only views in + # design documents. :( +- del self.db[doc_id] ++ self.with_reconnects(self.db.__delitem__, doc_id) + + assert not self.view_exists(view_name, design_doc) + +@@ -371,7 +402,8 @@ + design_doc = view_name + + view_id_fmt = "_design/%(design_doc)s/_view/%(view_name)s" +- return self.db.view(view_id_fmt % locals(), **params) ++ return self.with_reconnects(self.db.view, view_id_fmt % locals(), ++ **params) + + def add_view(self, view_name, map_js, reduce_js, + design_doc=DEFAULT_DESIGN_DOCUMENT): +@@ -393,7 +425,8 @@ + doc_id = "_design/%(design_doc)s" % locals() + + try: +- view_container = self.db[doc_id]["views"] ++ view_container = \ ++ self.with_reconnects(self.db.__getitem__, doc_id)["views"] + return view_name in view_container + except (KeyError, ResourceNotFound): + return False +@@ -404,7 +437,7 @@ + in it.""" + doc_id = "_design/%(design_doc)s" % locals() + try: +- return list(self.db[doc_id]["views"]) ++ return list(self.with_reconnects(self.db.__getitem__, doc_id)["views"]) + except (KeyError, ResourceNotFound): + return [] + + --- desktopcouch-0.6.4.orig/debian/patches/replication-exclusion.patch +++ desktopcouch-0.6.4/debian/patches/replication-exclusion.patch @@ -0,0 +1,71 @@ +=== modified file 'desktopcouch/pair/couchdb_pairing/couchdb_io.py' +--- desktopcouch/pair/couchdb_pairing/couchdb_io.py 2010-04-12 19:24:14 +0000 ++++ desktopcouch/pair/couchdb_pairing/couchdb_io.py 2010-04-15 14:56:36 +0000 +@@ -212,7 +212,10 @@ + if key in record.value: # EAFP, rather than LBYL? Nones default? + value = record.value[key] + if value is not None: +- values.append(value) ++ if "_order" in value: # MergableList, so decode. ++ values.append(value[k] for k in value["_order"]) ++ else: ++ values.append(value) + else: + logging.debug("skipping record empty %s", key) + else: + +=== modified file 'desktopcouch/pair/tests/test_couchdb_io.py' +--- desktopcouch/pair/tests/test_couchdb_io.py 2009-11-12 22:05:09 +0000 ++++ desktopcouch/pair/tests/test_couchdb_io.py 2010-04-15 14:56:36 +0000 +@@ -23,6 +23,7 @@ + from desktopcouch.pair.couchdb_pairing import couchdb_io + from desktopcouch.records.server import CouchDatabase + from desktopcouch.records.record import Record ++from desktopcouch.replication_services import ubuntuone + from twisted.trial import unittest + import uuid + import os +@@ -39,6 +40,9 @@ + self.foo_database = CouchDatabase('foo', create=True, uri=URI, + ctx=test_environment.test_context) + #create some records to pull out and test ++ self.foo_database = CouchDatabase('bar', create=True, uri=URI, ++ ctx=test_environment.test_context) ++ #create some records to pull out and test + self.foo_database.put_record(Record({ + "key1_1": "val1_1", "key1_2": "val1_2", "key1_3": "val1_3", + "record_type": "test.com"})) +@@ -49,6 +53,15 @@ + "key13_1": "va31_1", "key3_2": "val3_2", "key3_3": "val3_3", + "record_type": "test.com"})) + ++ couchdb_io.put_static_paired_service({ ++ "consumer_key": str("abcdef"), ++ "consumer_secret": str("ghighjklm"), ++ "token": str("opqrst"), ++ "token_secret": str("uvwxyz")}, "ubuntuone", uri=URI, ++ ctx=test_environment.test_context) ++ excl = ubuntuone.ReplicationExclusion(ctx=test_environment.test_context) ++ excl.exclude("bar") ++ + def tearDown(self): + """tear down each test""" + del self.mgt_database._server['management'] +@@ -95,7 +108,7 @@ + uri=URI, ctx=test_environment.test_context) + + pairings = list(couchdb_io.get_pairings(ctx=test_environment.test_context)) +- self.assertEqual(3, len(pairings)) ++ self.assertEqual(4, len(pairings)) # 3, plus 1 from setUp() + self.assertEqual(pairings[0].value["oauth"], oauth_data) + self.assertEqual(pairings[0].value["server"], hostname) + self.assertEqual(pairings[0].value["pairing_identifier"], remote_uuid) +@@ -126,6 +139,7 @@ + names = couchdb_io.get_database_names_replicatable(uri=URI, ctx=test_environment.test_context) + self.assertFalse('management' in names) + self.assertTrue('foo' in names) ++ self.assertFalse('bar' in names, names) # is excluded + + def test_get_my_host_unique_id(self): + got = couchdb_io.get_my_host_unique_id(uri=URI, ctx=test_environment.test_context) + --- desktopcouch-0.6.4.orig/debian/patches/0-items-should-expose-private-data-for-now.patch +++ desktopcouch-0.6.4/debian/patches/0-items-should-expose-private-data-for-now.patch @@ -0,0 +1,24 @@ +=== modified file 'desktopcouch/records/record.py' +--- old/desktopcouch/records/record.py 2010-03-18 19:12:33 +0000 ++++ new/desktopcouch/records/record.py 2010-04-08 16:06:20 +0000 +@@ -218,7 +218,18 @@ + self[key] = val + + def items(self): +- """Return all items.""" ++ """Return all items, even private or internal ones.""" ++ return self.all_items() ++ ++ def all_items(self): ++ """Return all items, even private or internal ones.""" ++ data = [] ++ for key, value in self._data.items(): ++ data.append((key, value)) ++ return data ++ ++ def public_items(self): ++ """Return items that are NOT internal or private structures.""" + return [(key, self[key]) for key in self] + + def keys(self): +