Commit Graph

194 Commits

Author SHA1 Message Date
Pierre-Yves David
d03cabd953 obsmarkers: add a parentnodes method to retrieve parent information 2014-08-18 17:14:27 -07:00
Pierre-Yves David
fd1f0f7321 obsstore: also store the 'parents' field on disk
We now store the `parents` field on disk. We use the same strategy as for
`date`: We stick it into the metadata. This is slow and dirty, but this is also
the only way we currently have.

At some point we'll have a new obsstore format to store this properly.
2014-08-18 16:28:44 -07:00
Pierre-Yves David
41733331bc obsstore: drop 'date' from the metadata dictionary
We are extracting the `date` information from the metadata at read time.
However, we failed to remove it from the metadata returned in the markers. This
is now fixed.
2014-08-18 17:06:08 -07:00
Pierre-Yves David
c584b9c277 createmarkers: automatically record the parent of pruned changesets
We need this information to build the set of relevant markers during
exchanges. This can only be done at the `createmarkers` level since
the `obsstore.create` function does not have a repo and therefore has
no access to the parent information.
2014-08-18 16:17:16 -07:00
Pierre-Yves David
767b2c8f0d obsstore: add a parents argument to obsstore.create
We need a way to pass the information to the function. Some guru told me that
what's arguments are made for.
2014-08-18 16:12:29 -07:00
Pierre-Yves David
95fa5b1577 obsstore: add a parents field
This field is intended to store the parent of the precursor. This is useful to
attach pruned changesets to a set of exchanged changesets. We currently just
add the fields with a None value. None stands for "no data recorded".
2014-08-18 16:08:44 -07:00
Pierre-Yves David
21ceed5f91 obsstore: add some documentation about the marker fields
As the number of fields grow, it makes sense to start documenting their contents.
2014-08-19 14:42:08 -07:00
Pierre-Yves David
3b78721608 obsmarker: add date as an explicit field
The markers are now 5-item tuples (concluded by the date). The obsstore.fields
contents have been updated accordingly.

There is no change to the on-disk format yet, so the date has to be extracted
every time we read binary markers and re-injected each team we write them. This
introduces a slowdown that will be solved when a new version of the format is
added. Such a slowdown was already introduced by the evolve extension anyway.
2014-08-19 10:01:06 -07:00
Pierre-Yves David
971ae35ea3 obsstore: add fields attribute to track each field in a marker
We are going to increase the amount of data explicitly stored in obsolescence
markers. This mean we are going to have a longer tuple and some values will be
shuffled around. So we add a ``fields`` attribute to the obsstore class to
keep track of what entry is what. This will be useful for extensions and for
documentation purpose.
2014-08-12 01:49:38 -07:00
Pierre-Yves David
f43f2ce984 obsolete: add a date argument to the createmarkers function
The function is now just passing the value to create markers.
2014-08-14 12:59:48 -07:00
Pierre-Yves David
a9a2652690 obsstore: add an explicit date argument to obsstore.create
The date will become an official field in the markers (and ultimately
in the on-disk format). We start by making it an official argument for
the function.
2014-08-13 22:44:47 -07:00
Pierre-Yves David
3b69b7e067 obsolete: explicitly pass metadata argument using keyword argument
We are about to add more arguments to this function (date, parents, etc).
Passing metadata as a keyword argument gives us more flexibility when adding
them.
2014-08-14 01:53:07 -07:00
Pierre-Yves David
b1789db911 obsmarker: add a flags method
We introduce a proper method to access the flag information.
2014-08-15 09:41:30 -07:00
Matt Mackall
92e0debc2b merge with stable 2014-08-15 11:48:05 -05:00
Mads Kiilerich
5d377a8588 cleanup: avoid local vars shadowing imports
This will mute some pyflakes "import ... shadowed by loop variable" warnings.
2014-08-15 16:20:47 +02:00
Pierre-Yves David
8bf8eb1b78 obsstore.create: add a simple safeguard against cyclic markers
We detect when there is a cycle in the marker itself (precursors being listed
as successors).
2014-08-14 14:59:42 -07:00
Martin Geisler
df032a1bc2 obsolete: fix one-element tuple in module docstring 2014-04-19 20:12:53 +02:00
Martin Geisler
010f4026c6 obsolete: let N denote number of obsoleted changestes in a marker
The number of obsoleted changesets is referred to as N later in the
docstring.
2014-04-19 19:53:46 +02:00
Martin Geisler
3b1788aa56 obsolete: fix language and grammar in module docstring 2014-04-19 19:52:09 +02:00
FUJIWARA Katsunori
87f58fc092 obsolete: add '%' specifier to the format string to avoid TypeError at runtime
Mapping operation on the format string not including any '%'
specifiers causes TypeError at runtime.
2014-04-16 03:05:00 +09:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Pierre-Yves David
a61297246c obsolete: extract encoding of marker for pushkey from the list key function
We now have a function taking a list and marker and returning an encoded
version. This will allow obsolescence marker exchange experimentation to easily
pushkey-encode markers to be pushed after selection.
2014-02-27 20:01:28 -08:00
Pierre-Yves David
d8fd55e6c1 obsstore: add a __len__ method
We can already use "for mark in store:" it make sense to allow
"len(store)" too.
2014-02-25 10:32:54 -08:00
Pierre-Yves David
8ed33f95d4 obsstore: create method return True if a marker is actually added
The obsstore method now have a return value. This informs caller about the
actual creation of a new markers. No new markers are created if it would have
been a duplicate.
2014-02-25 10:21:54 -08:00
Mads Kiilerich
92dc407d90 comments: fix minor spelling issues found with spell checker 2014-02-20 02:39:01 +01:00
Pierre-Yves David
1c8096195c createmarkers: allow to pass metadata for a marker only
The `metadata` argument only allow to specify metadata for all new markers. We
extension the format of the `relations` argument to support optional metadata
argument.

The first user of this should be the evolve extension who want to store parent
information of pruned changeset in extra (until we make a second version of the
format)
2014-02-13 17:34:09 -08:00
Pierre-Yves David
098932cf2d obsstore: update create docstring to point to the coder friendly function
The `obsstore` class have a `create` method that create new obsolescence marker
from node. There is another function in the same module `createmarkers`. This
other function is higher level and automatically missing meta data (ultimately
calling the first one)

We add a new comment in the docstring of `obsstore.create` highlighting that
people writing new code probably want to use the top level one.
2014-02-13 17:33:45 -08:00
Pierre-Yves David
33b568da08 pull: move obsolescence marker exchange in the exchange module
The obsolescence marker exchange code was already extracted during a previous
cycle. We are moving the extracted functio in this module. This function will
read and write data in the `pulloperation` object and I prefer to have all core
function collaborating through this object in the same place.

This changeset is pure code movement only. Code change for direct consumption of
the `pulloperation` object will come later.
2014-01-30 17:38:41 -08:00
Pierre-Yves David
97a8524afb push: move obsolescence marker exchange in the exchange module
The obsolescence marker exchange code was already extracted during a previous
cycle. We are moving the extracted functio in this module. This function will
read and write data in the `pushoperation` object and I prefer to have all core
function collaborating through this object in the same place.

This changeset is pure code movement only. Code change for direct consumption of
the `pushoperation` object will come later.
2014-01-30 17:54:47 -08:00
Sean Farley
ef93a468a7 obsolete: clarify documentation for succcessorssets 2014-01-15 18:14:12 -06:00
Pierre-Yves David
bab0fe5a64 obsolete: order of magnitude speedup in _computebumpedset
Reminder: a changeset is said "bumped" if it tries to obsolete a immutable
          changeset.


The previous algorithm for computing bumped changeset was:

    1) Get all public changesets
    2) Find all they successors
    3) Search for stuff that are eligible for being "bumped"
       (mutable and non obsolete)

The entry size of this algorithm is `O(len(public))` which is mostly the same as
`O(len(repo))`. Even this this approach mean fewer obsolescence marker are
traveled, this is not very scalable.

The new algorithm is:

    1) For each potential bumped changesets (non obsolete mutable)
    2) iterate over precursors
    3) if a precursors is public. changeset is bumped

We travel more obsolescence marker, but the entry size is much smaller since
the amount of potential bumped should remains mostly stable with time `O(1)`.

On some confidential gigantic repo this move bumped computation from 15.19s to
0.46s (×33 speedup…). On "smaller" repo (mercurial, cubicweb's review) no
significant gain were seen. The additional traversal of obsolescence marker is
probably probably counter balance the advantage of it.

Other optimisation could be done in the future (eg: sharing precursors cache
for divergence detection)
2013-12-23 15:29:51 -08:00
Pierre-Yves David
777603b25a obsolete: add an allprecursors method mirroring allsuccessors one.
Detection of bumped changeset should use `allprecursors(<mutable>)` instead or
`allsuccessors(<immutable>)` so we need the all precursors function to exists.
2013-12-23 13:36:13 -08:00
Pierre-Yves David
04de18abd8 obsolete: improve allsuccessors doc string
The fact original nodes are also yield is not obvious. We update the docstring
to highlight it.
2013-12-23 13:33:21 -08:00
Pierre-Yves David
9cb9a199aa obsolete: fix bad comment
We cannot afford such extra "with" they are far too pricy.
2013-12-23 13:32:03 -08:00
Augie Fackler
2f26b47577 obsolete: add __eq__ and __hash__ to marker to make set() deduplication work 2013-11-16 20:12:02 -05:00
Pierre-Yves David
1a1b1b5ce2 obsolete: do not accept duplicated marker during exchange
Before this patch, duplicated obsolescence markers could slip into an
obstore if the bookmark was unknown locally and duplicated in the
incoming obsolescence stream.

Existing duplicate markers will not be automatically removed but
they'll stop propagating. Having a few duplicated markers is harmless
and people have been warned evolution is <blink>experimental</blink>
anyway.
2013-11-16 20:31:58 -05:00
Pierre-Yves David
f1f6dad830 obsolete: stop doing membership test on list
According to the Surgeon General, computer should not use list for membership
testing because of the risk of being slow.
2013-11-16 20:34:58 -05:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
Augie Fackler
2ae3ed4f92 Backed out changeset c65cc2c5ce84 2013-08-15 21:36:53 -04:00
Dan Villiom Podlaski Christiansen
3f40ec5e82 obsolete: allow passing a revision to successorssets() 2013-08-04 13:43:39 +02:00
Augie Fackler
10a7abe904 obsolete: clean up a couple of docstrings for correctness 2013-07-26 15:59:16 -04:00
Pierre-Yves David
69d3fb6919 obsolete: extract obsolescence marker pulling into a dedicated function
Having a dedicated function will allow us to experiment with other exchange
strategies in an extension. As we have no solid clues about how to do it right,
being able to experiment is vital.

Some transaction tricks are necessary for pull. But nothing too scary.
2013-04-17 11:47:49 +02:00
Pierre-Yves David
0a4431da48 obsolete: extract obsolescence marker pushing into a dedicated function
Having a dedicated function will allows us to experiment with other exchange
strategies in an extension. As we have no solid clues about how to do it right,
being able to experiment is vital.

I intended a more ambitious extraction of push logic, but we are far too
advanced in the release cycle for it.
2013-04-17 11:18:36 +02:00
Pierre-Yves David
ccfae81adc obsolete: extract foreground computation from bookmark.validdest
This foreground logic will be reused by update logic.
2013-04-16 15:16:33 +02:00
Pierre-Yves David
a256234df3 obsolete: ensure all markers have a date
Obsolescence creates a sparse DAG mostly composed of a lot of small independent
chain of markers. Date is the only simple and "reliable" way to sort them. The
existence of a date is now enforced at creation time as I'm more and more
convinced that date will have a key role in obsolescence markers exchange.
2013-02-11 11:20:12 +01:00
Mads Kiilerich
5787baee50 spelling: fix some minor issues found by spell checker 2013-02-10 18:24:29 +01:00
Mads Kiilerich
f289ae22ed obsolete: process markers in a stable order
Using set iteration order gave unstable debugsuccessorssets output with
PYTHONHASHSEED=random.
2013-01-15 02:59:13 +01:00
Pierre-Yves David
bafe2b5542 performance: speedup computation of extinct revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.

This change drops revset calls in favor of direct testing of the phase
of changesets.

Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! extinct
  ! wall 0.015124

After:
  ! extinct
  ! wall 0.009424

Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! extinct
  ! wall 0.032844

After:
  ! extinct
  ! wall 0.000066
2013-01-04 03:16:08 +01:00
Pierre-Yves David
6124831a17 performance: speedup computation of suspended revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.

This change drops a revset call in favor of direct testing of the
phase of changesets.

Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! suspended
  ! wall 0.014319

After:
  ! suspended
  ! wall 0.009559

Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! suspended
  ! wall 0.033373

After:
  ! suspended
  ! wall 0.000053
2013-01-04 03:15:44 +01:00
Pierre-Yves David
2b70610cfb performance: speedup computation of unstable revisions
In their current state, revset calls can be very costly, as we test
predicates on the entire repository.

This change drops revset call in favor of direct testing of the
phase of changesets.

Performance test on my Mercurial checkout
- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! unstable
  ! wall 0.017366

After this changes:
  ! unstable
  ! wall 0.008093

Performance test on a Mozilla central checkout:
- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! unstable
  ! wall 0.045190

After:
  ! unstable
  ! wall 0.000032
2013-01-04 03:15:21 +01:00
Pierre-Yves David
6f3c5389b0 performance: speedup computation of obsolete revisions
In their current state, revset calls can be very costly as we test
predicates on the entire repository. As obsolete computation is used
by the "hidden" filter, it needs to be very fast.

This changet drops the revset call in favor of direct testing of
the phase of a changeset.

Performance test on my Mercurial checkout

- 19857 total changesets,
- 1584 obsolete changesets,
- 13310 obsolescence markers.

Before:
  ! obsolete
  ! wall 0.047041

After:
  ! obsolete
  ! wall 0.004590


Performance test on a Mozilla central checkout:

- 117293 total changesets,
- 1 obsolete changeset,
- 1 obsolescence marker.

Before:
  ! obsolete
  ! wall 0.001539

After:
  ! obsolete
  ! wall 0.000017
2013-01-04 03:14:54 +01:00
Pierre-Yves David
0ea6453a8a clfilter: add a cache on repo for set of revision to filter for a given set.
Recomputing the filtered revisions at every access to changelog is far too
expensive. This changeset introduce a cache for this information. This cache is
hold by the repository (unfiltered repository) and invalidated when necessary.
This cache is not a protected attribute (leading _) because some logic that
invalidate it is not held by the local repo itself.
2012-12-20 17:14:07 +01:00
Pierre-Yves David
5f44f3518f obsolete: detect divergent changesets
Divergent changeset are final successors (non obsolete) of a changeset who
compete with another set of final successors for this same changeset.

For example if you have two obsolescence markers A -> B and A -> C, B and C are
both "divergent" because they compete to be the one true successors of A.

Public revision can't be divergent.

This function is used and tested in the next changeset.
2012-12-12 03:19:30 +01:00
Pierre-Yves David
70d5b32616 obsolete: drop successors sets which are subset of another one
If both "(B,)" and "(B, C)" are successors set of "A", "(B,)" is dropped.
We won't be interrested in detection such divergence scenario.
2012-11-10 01:56:59 +01:00
Pierre-Yves David
da22110fc6 obsolete: compute successors set
Successors set are an important part of obsolescence. It is necessary to detect
and solve divergence situation. This changeset add a core function to compute
them, a debug command to audit them and solid test on the concept.

Check function docstring for details about the concept.
2012-12-13 15:38:43 +01:00
Pierre-Yves David
4abb88cb7f clfilter: unfilter computation of obsolescence related computation
All obsolescence related sets need to be computed on the full unfiltered
version of the repository, in particular because several of them
(obsolete, extinct) are used to compute the hidden revisions.

On a filtered repo, revset predicates related to these sets will be
properly filtered because of revset's own pre-filtering.
2012-10-08 16:55:00 +02:00
Pierre-Yves David
14f39efa9f obsolete: add a flag that allows fixing "bumped" changeset
The first obsolescence flag is introduced to allows for fixing the "bumped"
changeset situation.

    bumpedfix == 1.

Creator of new changesets intended to fix "bumped" situation should not forget
to add this flag to the marker. Otherwise the newly created changeset will be
bumped too. See inlined documentation for details.
2012-10-19 00:41:53 +02:00
Pierre-Yves David
7463f55b32 obsolete: add the detection of bumped changeset.
Bumped changesets are non-public changesets that tries to succeed a public()
changeset.
2012-10-19 00:36:18 +02:00
Pierre-Yves David
19b261d640 obsolete: have allsuccessors takes a list of nodes
Additional logic, used to detect mutable history troubles, will need to quickly
compute successors of a whole set of changeset.
2012-10-16 15:49:58 +02:00
Pierre-Yves David
1d9b00f6af obsolete: rename anysuccessors into allsuccessors
The "any" prefix looks like it returned a boolean. `allsuccessors` is more
accurate.
2012-10-19 00:30:11 +02:00
Pierre-Yves David
bc08c6dbf1 obsolete: rename getobscache into getrevs
The old name was not very good for two reasons:
- caller does not care about "cache",
- set of revision returned may not be obsolete at all.

The new name was suggested by Kevin Bullock.
2012-10-19 00:28:13 +02:00
Pierre-Yves David
2bf3f1f2c0 obsolete: flip obstore.successors and obsolete.precursors
People were confused by the fact `obstore.precursors` contained marker allowing
to find "precursors" and vice-versa.

This changeset changes their meaning to:

- precursors[x] -> set(markers on precursors edges of x)
- successors[x] -> set(markers on successors edges of x)

Some documentation is added to clarify the situation.
2012-10-16 15:39:12 +02:00
Pierre-Yves David
e7bae9b381 obsolete: add example of marker usage in the documentation
Recent discussion with Augie Fackler pointed the lack of such example in the
documentation.
2012-10-14 23:33:10 +02:00
Pierre-Yves David
57d4155cf7 obsolete: cheap detection of nullid as successors
Nullid as successors create multiple issues:

- Nullid revnum is -1, confusing algorithm that use revnum unless you add
  special handling in all of them.
- Nullid confuses "divergent" changeset detection and resolution. As you can't
  add any successors to Nullid without being in even more troubles

Fortunately, there is no good reason to use nullid as a successor. The only
sensible meaning of "succeed by nullid" is "dropped" and this meaning is already
covered by obsolescence marker with empty successors set.

However, letting some nullid successors to slip in may cause terrible damage in
such algorithm difficult to debug. So I prefer to perform and clear detection of
of such pathological changeset. We could be much smarter by cleaning up nullid
successors on the fly but it would be much for expensive. As core Mercurial does
not create any such changeset, I think it is fine to just abort when suspicious
situation is detected.

Earlier experimental version created such changesets, so there are some out
there.  The evolve extension added the necessary logic to clean up its mess.
2012-10-15 00:12:06 +02:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
Pierre-Yves David
de8b13c1de obsolete: add a high level function to create an obsolete marker
This function is designed to be used by all code that creates new
obsolete markers in the local repository.

It is not used by debugobsolete because debugobsolete allows the
use of an unknown hash as argument.
2012-08-24 21:16:23 +02:00
Pierre-Yves David
785d90eba0 obsolete: introduce caches for all meaningful sets
This changeset introduces caches on the `obsstore` that keeps track of sets of
revisions meaningful for obsolescence related logics. For now they are:

- obsolete: changesets used as precursors (and not public),
- extinct:  obsolete changesets with osbolete descendants only,
- unstable: non obsolete changesets with obsolete ancestors.

The cache is accessed using the `getobscache(repo, '<set-name>')` function which
builds the cache on demand. The `clearobscaches(repo)` function takes care of
clearing the caches if any.

Caches are cleared when one of these events happens:

- a new marker is added,
- a new changeset is added,
- some changesets are made public,
- some public changesets are demoted to draft or secret.

Declaration of more sets is made easy because we will have to handle at least
two other "troubles" (latecomer and conflicting).

Caches are now used by revset and changectx. It is usually not much more
expensive to compute the whole set than to check the property of a few elements.
The performance boost is welcome in case we apply obsolescence logic on a lot of
revisions. This makes the feature usable!
2012-08-28 20:52:04 +02:00
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
Mads Kiilerich
48016eb3fc declare local constants instead of using magic values and comments 2012-08-27 23:16:22 +02:00
Mads Kiilerich
520076e707 delete some dead comments and docstrings 2012-08-21 02:41:20 +02:00
Mads Kiilerich
2372d51b68 fix wording and not-completely-trivial spelling errors and bad docstrings 2012-08-15 22:39:18 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Steve Borho
029f4079a2 obsolete: import modules within mercurial/ without "from mercurial" 2012-08-28 11:15:34 -05: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