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 @@ -202,7 +202,7 @@ cy.intercept('GET', this.vaultFetchDirectoryUrl, { fixture: `${this.directory}.tar.gz`, headers: { - 'Content-disposition': `attachment; filename=${this.directory}.tar.gz`, + 'Content-disposition': `attachment; filename=${this.directory.replace(/:/, '/')}.tar.gz`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); @@ -287,7 +287,7 @@ cy.intercept({url: this.vaultFetchRevisionUrl}, { fixture: `${this.revision}.git.tar`, headers: { - 'Content-disposition': `attachment; filename=${this.revision}.git.tar`, + 'Content-disposition': `attachment; filename=${this.revision.replace(/:/, '/')}.git.tar`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); @@ -464,7 +464,7 @@ cy.intercept({url: this.vaultFetchDirectoryUrl}, { fixture: `${this.directory}.tar.gz`, headers: { - 'Content-disposition': `attachment; filename=${this.directory}.tar.gz`, + 'Content-disposition': `attachment; filename=${this.directory.replace(/:/, '/')}.tar.gz`, 'Content-Type': 'application/gzip' } }).as('fetchCookedArchive'); @@ -497,7 +497,7 @@ cy.intercept({url: this.vaultFetchRevisionUrl}, { fixture: `${this.revision}.git.tar`, headers: { - 'Content-disposition': `attachment; filename=${this.revision}.git.tar`, + 'Content-disposition': `attachment; filename=${this.revision.replace(/:/, '/')}.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