Commit Graph

19 Commits

Author SHA1 Message Date
Durham Goode
8ab51eaa9f Add pending revision validation
Before writing revisions to the database we now validate that they are
correct. This consists of two checks:

1. Are we appending to the same linkrev in the database as we are in the local
repo.
2. Every rev that we are writing to the database has a base, p1, and p2 rev
dependency. Before we write the rev, verify that the base, p1, and p2 revs in
the database have the same nodes as in the localrepo. This prevents us from
writing rev dependencies that then point at the incorrect node (due to
different ordering in the db vs local).
2014-01-21 16:09:08 -08:00
Durham Goode
9f0b718461 Allow nested connections
When performing a pull it does the commits, then the bookmarks. This change
allows the sql connections to become nested, enabling that.
2014-01-21 16:06:25 -08:00
Durham Goode
97167ab6c4 Add node information to revisions table
In order to validate that the incoming revisions are valid, we need node
information in the revisions table. A future patch will add the actual
validation.
2014-01-21 16:05:27 -08:00
Durham Goode
6e3be66ba0 Add more verification during syncs
Check that heads and bookmarks match after syncing.
Verify that the new commits are being applied on top of the correct linkrev on
the server.
Remove excess invalidate steps. They are no longer necessary since we do the
lock.release() much later in the process (which was what caused problems
originally).
2014-01-03 12:03:52 -08:00
Durham Goode
52fa7e03b2 Wrap revlog._writeentry instead of intercepting
I added revlog._writeentry to upstream Mercurial which allows us to easily
intercept revlog writes instead of building crazy file-like objects to
intercept the calls.
2014-01-03 12:01:50 -08:00
Durham Goode
0ed408193a Refactor sql transactions to a single function
Moves the sql connect, lock, unlock, close logic to a single executewithsql
function so all the complicated try/finally logic is in one place.

Move pre-transaction close logic out of the hook and into a transaction.close
wrapper. This makes it more symettrical (matches transaction open/close) and
allows hooks to fail the transaction before the db commit.
2014-01-02 12:19:50 -08:00
Durham Goode
b287ed5fb6 Use a single table for many repos
Switches to using a single table for many repos instead of multiple databases.

Changes the headbookmarks table to be a pushkeys table using the pushkeys
namespace convention.
2014-01-02 11:06:45 -08:00
Durham Goode
64af581fa1 Fix error with transaction offsets, plus a bunch of tweaks 2013-12-10 19:00:55 -08:00
Durham Goode
a30ef476ad Catch sql unlock errors, so they don't hide real errors 2013-11-27 11:16:45 -08:00
Durham Goode
83eee89448 Get rid of global variables
Create sqllocalrepo class that manages the sql connection
2013-11-21 12:32:05 -08:00
Durham Goode
fc39c7a376 Increase mysql idle timeout to 5 minutes
Move public phase boundary forward during sync
Thread syncdb so we pull from the db at the same time we are writing to the
revlogs. Also use a buffered revlog so we only flush at the very end.
Clear repo._filecache after syncing in order to force the changelog to update.
2013-10-31 10:37:49 -07:00
Durham Goode
43a7de50fb Split large files into multiple records 2013-10-30 13:41:33 -07:00
Durham Goode
5baeae4cf4 Add revisions in linkrev order 2013-10-29 15:55:43 -07:00
Durham Goode
384d770abd Add sqlrecover command
Add createdtime to revs table
Allow pulls into the repo
2013-10-29 12:55:14 -07:00
Durham Goode
3501e57b92 Add revlog validation and fix transaction truncating 2013-10-28 18:57:18 -07:00
Durham Goode
91f0ca4206 Enable bookmark/head sync 2013-10-28 16:09:47 -07:00
Durham Goode
1b6e441663 Fix path bug and fix i/d files 2013-10-17 17:15:41 -07:00
Durham Goode
ec4bd7e3d9 Add transaction hooks and attempt to get .d working 2013-10-17 16:47:34 -07:00
Durham Goode
cedf7a6d6e Initial prototype 2013-10-17 16:46:12 -07:00