mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
cdatapack: fix empty revision reading
Summary: The newly changed `LZ4_decompress_safe` is unhappy about empty buffer. So let's check empty revision explicitly. Test Plan: Added a test Reviewers: #mercurial, ikostia Reviewed By: ikostia Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4986277 Signature: t1:4986277:1493743735:be2ad6047bb0b983425c6e49b7c5ddf2c94d1c1a
This commit is contained in:
parent
004e19698b
commit
488cf5ea26
@ -488,8 +488,8 @@ const get_delta_chain_link_result_t getdeltachainlink(
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool uncompressdeltachainlink(delta_chain_link_t *link) {
|
bool uncompressdeltachainlink(delta_chain_link_t *link) {
|
||||||
if (link->delta != NULL) {
|
if (link->delta != NULL || link->delta_sz == 0) {
|
||||||
// previously decompressed
|
// previously decompressed or no content to decompress
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,11 +71,10 @@ class datapacktestsbase(object):
|
|||||||
path = packer.close()
|
path = packer.close()
|
||||||
return self.datapackreader(path)
|
return self.datapackreader(path)
|
||||||
|
|
||||||
def testAddSingle(self):
|
def _testAddSingle(self, content):
|
||||||
"""Test putting a simple blob into a pack and reading it out.
|
"""Test putting a simple blob into a pack and reading it out.
|
||||||
"""
|
"""
|
||||||
filename = "foo"
|
filename = "foo"
|
||||||
content = "abcdef"
|
|
||||||
node = self.getHash(content)
|
node = self.getHash(content)
|
||||||
|
|
||||||
revisions = [(filename, node, nullid, content)]
|
revisions = [(filename, node, nullid, content)]
|
||||||
@ -86,6 +85,12 @@ class datapacktestsbase(object):
|
|||||||
chain = pack.getdeltachain(filename, node)
|
chain = pack.getdeltachain(filename, node)
|
||||||
self.assertEquals(content, chain[0][4])
|
self.assertEquals(content, chain[0][4])
|
||||||
|
|
||||||
|
def testAddSingle(self):
|
||||||
|
self._testAddSingle('')
|
||||||
|
|
||||||
|
def testAddSingleEmpty(self):
|
||||||
|
self._testAddSingle('abcdef')
|
||||||
|
|
||||||
def testAddMultiple(self):
|
def testAddMultiple(self):
|
||||||
"""Test putting multiple unrelated blobs into a pack and reading them
|
"""Test putting multiple unrelated blobs into a pack and reading them
|
||||||
out.
|
out.
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
Remotefilelog appears to have issues with specific (historical?) datapack
|
|
||||||
files, see https://phabricator.intern.facebook.com/P57361795.
|
|
||||||
|
|
||||||
This test is here only to ensure we don't push out a build with this bug.
|
|
||||||
|
|
||||||
$ echo FAIL
|
|
||||||
Please fix remotefilelog file parsing, see t17796162
|
|
Loading…
Reference in New Issue
Block a user