diff --git a/cypress/fixtures/swh:1:dir:cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz b/cypress/fixtures/swh_1_dir_cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz rename from cypress/fixtures/swh:1:dir:cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz rename to cypress/fixtures/swh_1_dir_cd19126d815470b28919d64b2a8e6a3e37f900dd.tar.gz diff --git a/cypress/fixtures/swh:1:rev:1c480a4573d2a003fc2630c21c2b25829de49972.git.tar b/cypress/fixtures/swh_1_rev_1c480a4573d2a003fc2630c21c2b25829de49972.git.tar rename from cypress/fixtures/swh:1:rev:1c480a4573d2a003fc2630c21c2b25829de49972.git.tar rename to cypress/fixtures/swh_1_rev_1c480a4573d2a003fc2630c21c2b25829de49972.git.tar diff --git a/cypress/integration/vault.spec.js b/cypress/integration/vault.spec.js --- a/cypress/integration/vault.spec.js +++ b/cypress/integration/vault.spec.js @@ -200,9 +200,9 @@ // Stub response to the vault API to simulate archive download cy.intercept('GET', this.vaultFetchDirectoryUrl, { - fixture: `${this.directory}.tar.gz`, + fixture: `${this.directory.replace(/:/g, '_')}.tar.gz`, headers: { - 'Content-disposition': `attachment; filename=${this.directory}.tar.gz`, + 'Content-disposition': `attachment; filename=${this.directory.replace(/:/g, '_')}.tar.gz`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); @@ -285,9 +285,9 @@ // Stub response to the vault API indicating to simulate archive download cy.intercept({url: this.vaultFetchRevisionUrl}, { - fixture: `${this.revision}.git.tar`, + fixture: `${this.revision.replace(/:/g, '_')}.git.tar`, headers: { - 'Content-disposition': `attachment; filename=${this.revision}.git.tar`, + 'Content-disposition': `attachment; filename=${this.revision.replace(/:/g, '_')}.git.tar`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); @@ -462,9 +462,9 @@ // Stub response to the vault API to simulate archive download cy.intercept({url: this.vaultFetchDirectoryUrl}, { - fixture: `${this.directory}.tar.gz`, + fixture: `${this.directory.replace(/:/g, '_')}.tar.gz`, headers: { - 'Content-disposition': `attachment; filename=${this.directory}.tar.gz`, + 'Content-disposition': `attachment; filename=${this.directory.replace(/:/g, '_')}.tar.gz`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); @@ -495,9 +495,9 @@ // Stub response to the vault API to simulate archive download cy.intercept({url: this.vaultFetchRevisionUrl}, { - fixture: `${this.revision}.git.tar`, + fixture: `${this.revision.replace(/:/g, '_')}.git.tar`, headers: { - 'Content-disposition': `attachment; filename=${this.revision}.git.tar`, + 'Content-disposition': `attachment; filename=${this.revision.replace(/:/g, '_')}.git.tar`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); diff --git a/swh/web/api/views/vault.py b/swh/web/api/views/vault.py --- a/swh/web/api/views/vault.py +++ b/swh/web/api/views/vault.py @@ -84,7 +84,7 @@ Then to extract the cooked directory in the current one, use:: - $ tar xvf path/to/swh:1:*.tar.gz + $ tar xvf path/to/swh_1_*.tar.gz :param string swhid: the object's SWHID @@ -189,7 +189,9 @@ ) fname = "{}.tar.gz".format(swhid) response = HttpResponse(res, content_type="application/gzip") - response["Content-disposition"] = "attachment; filename={}".format(fname) + response["Content-disposition"] = "attachment; filename={}".format( + fname.replace(":", "_") + ) return response @@ -246,7 +248,7 @@ Then to import the revision in the current directory, use:: $ git init - $ zcat path/to/swh:1:rev:*.gitfast.gz | git fast-import + $ zcat path/to/swh_1_rev_*.gitfast.gz | git fast-import $ git checkout HEAD :param string swhid: the revision's permanent identifiers @@ -351,7 +353,9 @@ ) fname = "{}.gitfast.gz".format(swhid) response = HttpResponse(res, content_type="application/gzip") - response["Content-disposition"] = "attachment; filename={}".format(fname) + response["Content-disposition"] = "attachment; filename={}".format( + fname.replace(":", "_") + ) return response @@ -404,7 +408,7 @@ Then to import the revision in the current directory, use:: - $ tar -xf path/to/swh:1:rev:*.git.tar + $ tar -xf path/to/swh_1_rev_*.git.tar $ git clone swh:1:rev:*.git new_repository (replace ``swh:1:rev:*`` with the SWHID of the requested revision) @@ -486,5 +490,7 @@ ) fname = "{}.git.tar".format(swhid) response = HttpResponse(res, content_type="application/gzip") - response["Content-disposition"] = "attachment; filename={}".format(fname) + response["Content-disposition"] = "attachment; filename={}".format( + fname.replace(":", "_") + ) return response