Commit Graph

6 Commits

Author SHA1 Message Date
Durham Goode
c00411b064 revlog: add revmap back to revlog.addgroup
The recent e85296920485 patch removed the linkmapper argument from addgroup, as
part of trying to make addgroup more agnostic from the changegroup format. It
turns out that the changegroup can't resolve linkrevs while iterating over the
deltas, because applying the deltas might affect the linkrev resolution. For
example, when applying a series of changelog entries, the linkmapper just
returns len(cl). If we're iterating over the deltas without applying them to the
changelog, this results in incorrect linkrevs. This was caught by the hgsql
extension, which reads the revisions before applying them.

The fix is to return linknodes as part of the delta iterator, and let the
consumer choose what to do.

Differential Revision: https://phab.mercurial-scm.org/D730
2017-09-20 09:22:22 -07:00
Durham Goode
c94bd0e75c changegroup: remove changegroup dependency from revlog.addgroup
Previously revlog.addgroup would accept a changegroup and a linkmapper and use
it to iterate of the deltas. As part of untangling the revlog-changegroup
interdependency, let's move the changegroup delta iteration logic to it's own
function and pass the simple iterator to the revlog instead.

This will make it easier to introduce non-revlogs stores in the future, without
reinventing any changegroup specific logic.

Differential Revision: https://phab.mercurial-scm.org/D688
2017-09-13 10:43:44 -07:00
Yuya Nishihara
c94a7a8e9e test-revlog-raw: close file handles explicitly (issue5644) 2017-08-02 22:58:38 +09:00
Jun Wu
0da1479f96 test-revlog-raw: remove duplicated option 2017-04-02 18:13:03 -07:00
Jun Wu
09bd75fdff test-revlog-raw: fix "genbits" implementation
The "genbits" implementation is actually incorrect. This patch fixes it. A
good "genbits" implementation should pass the below assertion:

    n = 3 # or other number
    l = list(genbits(n))
    assert 2**(n*2) == len(set((l[i]<<n)+l[i+1] for i in range(len(l)-1)))

An assertion is added to make sure "genbits" won't work unexpectedly.
2017-04-02 18:12:47 -07:00
Jun Wu
0409ae86fa revlog: add a stronger test for raw processing
There are some issues about revlog raw processing (flag processor). The test
is relatively strong covering many cases. It will verify fixes.
2017-03-30 20:48:57 -07:00