Page MenuHomeSoftware Heritage

D8685.id31359.diff
No OneTemporary

D8685.id31359.diff

diff --git a/src/main/gitlab/base.lisp b/src/main/gitlab/base.lisp
--- a/src/main/gitlab/base.lisp
+++ b/src/main/gitlab/base.lisp
@@ -78,6 +78,12 @@
Useful to create backlinks to the previous system, or addition migration information")
+(defvar *snippet-suffix* nil
+ "A function that takes an argument of a forgerie-core:snippet and
+ returns a string that will be appended to the description of created snippets (pastes).
+
+ Useful to create backlinks to the previous system, or addition migration information")
+
(defvar *limit-to-active-users* nil
"If non nil, will only add users to the gitlab instance if they are active in the
items also coming over for processing. Useful when doing piecemeal conversions.")
diff --git a/src/main/gitlab/export.lisp b/src/main/gitlab/export.lisp
--- a/src/main/gitlab/export.lisp
+++ b/src/main/gitlab/export.lisp
@@ -1133,7 +1133,11 @@
(let
((content
(with-open-file (str (forgerie-core:file-location file) :element-type 'unsigned-byte)
- (let ((seq (make-sequence 'vector (file-length str)))) (read-sequence seq str) (trivial-utf-8:utf-8-bytes-to-string seq)))))
+ (let ((seq (make-sequence 'vector (file-length str))))
+ (read-sequence seq str)
+ (trivial-utf-8:utf-8-bytes-to-string seq))))
+ ()
+ )
(post-request
(format nil "/projects/~A/snippets" (getf default-project :id))
; This is deprecated, but it's an easier interface for now. Someday we may have
@@ -1143,6 +1147,7 @@
; See https://docs.gitlab.com/ee/api/snippets.html#create-new-snippet
`(("title" . ,(or (forgerie-core:snippet-title snippet) "Forgerie Generated Title"))
("content" . ,content)
+ ("description" . ,(when *snippet-suffix* (funcall *snippet-suffix* (forgerie-core:snippet-id snippet))))
("visibility" . ,(if (forgerie-core:snippet-private snippet) "private" "public"))
("file_name" . ,(forgerie-core:file-name file))))))
(error (e)
diff --git a/src/main/gitlab/package.lisp b/src/main/gitlab/package.lisp
--- a/src/main/gitlab/package.lisp
+++ b/src/main/gitlab/package.lisp
@@ -2,4 +2,5 @@
(:export
#:*private-token* #:*server-address* #:*default-project* #:*ssh-public-key*
#:*default-group* #:*group-structure* #:*single-project* #:*rails-command* #:*rails-command-args*
- #:*namespace-for-repo* #:*merge-request-suffix* #:*ticket-suffix* #:*limit-to-active-users*))
+ #:*namespace-for-repo* #:*merge-request-suffix* #:*ticket-suffix* #:*limit-to-active-users*
+ #:*snippet-suffix*))

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 9:07 AM (2 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3230703

Event Timeline