monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] heads up - packet_db_writer goes away


From: Zack Weinberg
Subject: [Monotone-devel] heads up - packet_db_writer goes away
Date: Sun, 1 Apr 2007 20:56:54 -0700

I just pushed some changes which eliminate almost all uses of
packet_db_writer - things that used to  use it as an intermediary now
access the database or the key_store directly.  To accomplish this,
the sanity checks that packet_db_writer used to do (mostly, not
putting things into the database if they were already there) have been
pushed down into database.cc and key_store.cc.  There were a few
places that were already using the database or key_store interfaces
for things you could do with a packet_db_writer; in all cases they had
either duplicated packet_db_writer's checks, or should have.  The only
user-visible effect of this change should be that some error
conditions are now consistently diagnosed across all subcommands.

The sole remaining user of packet_db_writer is "mtn read", which
actually needs it - the class definition has been moved to
cmd_packet.cc to prevent accidental users appearing.

If you've got a long-lived branch you might want to merge up.  A glossary:

old API                      new API
-------                      -------
dbw.consume_file_data        app.db.put_file
dbw.consume_file_delta       app.db.put_file_version
dbw.consume_revision_data    app.db.put_revision
dbw.consume_revision_cert    app.db.put_revision_cert
dbw.consume_public_key       app.db.put_key
dbw.consume_key_pair         app.keys.put_key_pair

You may also need to provide your own transaction_guard around the
operation if you didn't previously.

The certificate-generation interfaces in cert.hh and project.hh
interfaces are all spelled the same as they used to be, they just lost
the final packet_consumer argument.  Finally, in case anyone's got
their own packet_consumer subclass off on a branch (why?) note that
the on_(cert|keypair|pubkey|revision)_written hooks have gone away.

zw




reply via email to

[Prev in Thread] Current Thread [Next in Thread]