Commit Graph

22 Commits

Author SHA1 Message Date
timeless@mozdev.org
b770ee27e4 spelling: transaction 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
2632fc55ea spelling: split 2012-08-17 13:58:19 -07:00
Pierre-Yves David
0ae0504426 obsolete: properly increment currentlen when building pushkey payload
In the old code, the current length was always 0 leading to markers
payload never being split.
2012-07-31 15:32:08 +02:00
Pierre-Yves David
fd393b84f3 pushkey: do not exchange obsole markers if feature is disabled
This apply to both push and pull both when client or server.
2012-07-28 13:33:06 +02:00
Pierre-Yves David
6e161cf9e7 obsolete: introduce an _enabled switch to disable the feature by default
Obsolete markers wide-usage and propagation should be avoided by default until
the obsolete feature is more mature.

This changeset introduce the `_enable` variable and prevent the creation of
obsolete marker if the feature is set to `False` (the default).

More limitation comes in followup changesets.
2012-07-28 13:19:06 +02:00
Pierre-Yves David
dd7869713e pushkey: splits obsolete marker exchange into multiple keys
Obsolete markers are now exchanged in smaller pieces that fit in a http header.

This changes is done to avoid 400 bad request error when exchanging obsolete
puskey over http.

The last key pushed is always hold by the "dump0" key to ensure an easy place to
hook for people who need it.
2012-07-27 18:32:56 +02:00
Pierre-Yves David
35a54a30a2 obsolete: fix decoding error message arguments 2012-07-26 16:21:43 +02:00
Pierre-Yves.David@ens-lyon.org
1f1aafaab3 obsolete: obsstore.add now takes a list of markers.
This allow efficient IO and it greatly simplify the merging of markers.
2012-07-13 22:15:11 +02:00
Pierre-Yves.David@ens-lyon.org
25defec21b obsolete: refactor writemarkers to only encode them
The function is now able to write the version header as necessary. The function
now yield bytes to be written to a stream.

This should ease later use of this function for wireprotocol based exchanged.

Prepare the public use of the writemarker by wireprotocol function.
2012-07-12 19:58:07 +02:00
Pierre-Yves David
0038209994 obsolete: add an any successors function
This function yield every nodes which succeed to a group of nodes.

The first user will be checkheads who need to know if we push successors for
remote extra heads.
2012-07-17 17:31:29 +02:00
Adrian Buehlmann
bca295056a obsolete: os.SEEK_END first appeared in Python 2.5
fixes 5274228efcdc failing for Python 2.4
2012-07-17 00:55:22 +02:00
Adrian Buehlmann
f1e9744a78 obsolete: add seek to end of file before calling tell (issue3543) 2012-07-16 22:37:44 +02:00
Pierre-Yves David
100b68ca2e obsolete: write obsolete marker inside a transaction
Marker are now written as soon as possible but within a transaction. Using a
transaction ensure a proper behavior on error and rollback compatibility.

Flush logic are not necessary anymore and are dropped from lock release.

With this changeset, the obsstore is open, written and closed for every single
added marker. This is expected to be highly inefficient and batched write should
be implemented "quickly".

Another issue is that every flush of the file will invalidate the obsstore
filecache and trigger a full re instantiation of the repo.obsstore attribute
(including, reading and parsing entry). This is also expected to be highly
inefficient and proper filecache operation should be implemented "quickly" too.

A side benefit of the filecache issue is that repo.obsstore  object is properly
invalidated on transaction abortion.
2012-07-04 02:21:04 +02:00
Pierre-Yves David
587d4505e1 obsolete: append new markers to obsstore file instead of rewriting everything
This is the second step toward incremental writing of marker inside a
transaction. The obsstore file is now handled append only.

Header writing have been extracted from _writemarkers.

Because the _writemarkers method have been dropped, the push code
directly reuse the serialised content of local repo `listkeys`. This
is not very pretty, but this part of the protocol still need major
improvement anyway.
2012-07-04 02:02:48 +02:00
Pierre-Yves David
3fa4ff72f7 obsolete: move obsolete markers read/write logic to obsstore object
This is the first step toward incremental writing of obsolete marker within a
transaction.

For this purpose, obsstore is now given its repo sopener. This make it able to
handles read and write to the obsstore file itself. Most IO logic is removed
from localrepo and handled by obsstore object directly.
2012-07-04 02:00:36 +02:00
Pierre-Yves David
b187e6bd52 obsolete: fix error message at marker creation
precursors content where printed for invalid successor.
2012-07-04 16:37:00 +02:00
Pierre-Yves.David@ens-lyon.org
3c02b8eab1 obsolete: function and method to access some obsolete data
An `obsolete` boolean property is added to changeset context. Function to get
obsolete marker object from a changeset context are added to the obsolete
module.
2012-06-06 01:56:58 +02:00
Pierre-Yves.David@ens-lyon.org
d60eedc2d6 obsolete: exchange obsolete marker over pushkey
For a version of the exchange, all markers are exchange. This won't
scale and we will need a better protocol later.
2012-06-07 19:21:59 +02:00
Pierre-Yves.David@ens-lyon.org
1cc1e699cb obsolete: add easy way to iterate over obsolete marker object 2012-06-04 00:50:19 +02:00
Pierre-Yves.David@ens-lyon.org
3659d103ff obsolete: helper class to access obsolete marker data 2012-06-07 19:19:58 +02:00
Pierre-Yves.David@ens-lyon.org
0d5addf62d command: creation of obsolete marker
* add metadata encoding/decoding ability

* add a method to obsstore to help creating marker

* add a debug command to create marker
2012-06-07 19:15:23 +02:00
Pierre-Yves.David@ens-lyon.org
f9dd15112c obsolete: introduction of obsolete markers
Markers are stored as binary records in a log structured file in
.hg/store/obsstore.
2012-06-07 19:07:39 +02:00